Theory Rasiowa_Sikorski

section‹The general Rasiowa-Sikorski lemma›
theory Rasiowa_Sikorski imports Forcing_Notions Pointed_DC begin

context countable_generic
begin

lemma RS_relation:
  assumes "pP" "nnat"
  shows "yP. p,y  (λmnat. {x,yP×P. yx  y𝒟`(pred(m))})`n"
proof -
  from seq_of_denses nnat
  have "dense(𝒟 ` pred(n))" by simp
  with pP
  have "d𝒟 ` Arith.pred(n). d p"
    unfolding dense_def by simp
  then obtain d where 3: "d  𝒟 ` Arith.pred(n)  d p"
    by blast
  from countable_subs_of_P nnat
  have "𝒟 ` Arith.pred(n)  Pow(P)"
    by (blast dest:apply_funtype intro:pred_type)
  then 
  have "𝒟 ` Arith.pred(n)  P" 
    by (rule PowD)
  with 3
  have "d  P  d p  d  𝒟 ` Arith.pred(n)"
    by auto
  with pP nnat 
  show ?thesis by auto
qed

lemma DC_imp_RS_sequence:
  assumes "pP"
  shows "f. f: natP  f ` 0 = p  
     (nnat. f ` succ(n) f ` n  f ` succ(n)  𝒟 ` n)"
proof -
  let ?S="(λmnat. {x,yP×P. yx  y𝒟`(pred(m))})"
  have "xP. nnat. yP. x,y  ?S`n" 
    using RS_relation by (auto)
  then
  have "aP. (f  natP. f`0 = a  (n  nat. f`n,f`succ(n)?S`succ(n)))"
    using sequence_DC by (blast)
  with pP
  show ?thesis by auto
qed
  
theorem rasiowa_sikorski:
  "pP  G. pG  D_generic(G)"
  using RS_sequence_imp_rasiowa_sikorski by (auto dest:DC_imp_RS_sequence)

end (* countable_generic *)

end