cfahlgren1's picture
download
raw
6.74 kB
import OAI.Computability.DegreeRigidity.CohenForcing.InternalCohenConditions
import OAI.Computability.DegreeRigidity.CohenForcing.EncodedForcing
import OAI.Computability.DegreeRigidity.SetModels.SetModelArithmeticSyntax
namespace OAI
namespace TuringRigidity.InternalCohen
open TransitiveNameModel BoundedSetTheory SetModelFunctions SetModelArithmetic SetModelReals
open Encodable EncodedForcing
def wordBit (v : ℕ) : ℕ :=
if (word (Nat.unpair v).1).getD (Nat.unpair v).2 false then 1 else 0
theorem wordBit_primrec : Primrec wordBit :=
CommonIdeal.bit_primrec.comp ((Primrec.list_getD false).comp
(word_primrec.comp (Primrec.fst.comp Primrec.unpair))
(Primrec.snd.comp Primrec.unpair))
def wordGraphFormula : Formula :=
.existsMem 4 (.conj (.pairMem 2 0 3)
(.conj (.functionGraph 1 0 6)
(.allMem 0 (.existsMem 6 (.existsMem 7
(.conj (tripleFormula 5 2 1 11 10)
(.conj (.pairMem 1 0 7) (.pairMem 2 0 4))))))))
noncomputable def wordGraphEnv (q n gl gb : ZFSet.{0}) : ℕ → ZFSet.{0} :=
cons q (cons n (cons gl (cons gb (cons ZFSet.omega
(cons alphabet (cons pairNumbers (fun _ => pairingSet)))))))
theorem wordGraphFormula_spec (gl gb : ZFSet.{0})
(hl : GraphCode gl (fun n => (word n).length)) (hb : GraphCode gb wordBit)
(n : ℕ) (q : ZFSet.{0}) :
wordGraphFormula.Eval (wordGraphEnv q (natSet n) gl gb) ↔
q = wordCode (word n) := by
simp only [wordGraphFormula,wordGraphEnv,Formula.Eval,Formula.eval_pairMem,
Formula.eval_functionGraph,Formula.eval_allMem,eval_tripleFormula,
cons_zero,cons_succ]
simp_rw [omega_exists]
simp only [hl]
constructor
· rintro ⟨l,rfl,hq,hi⟩
have hq' : FunctionGraph (natSet (word n).length) alphabet q := hq
have hbits (i : ℕ) (h : i < (word n).length) :
ZFSet.pair (natSet i) (bitSet (word n)[i]) ∈ q := by
obtain ⟨k,b,⟨_,hk⟩,hb',hi'⟩ := hi (natSet i) ((natSet_mem_natSet _ _).mpr h)
have hk' : k = Nat.pair n i := (pairing_code n i k).mp hk
have hb'' := (hb k b).mp hb'
subst k
subst b
simpa [wordBit,List.getD,h,bitSet] using hi'
apply ZFSet.ext
intro z
constructor
· intro hz
obtain ⟨x,hx,y,_,rfl⟩ := hq'.1 z hz
obtain ⟨i,hi,rfl⟩ := (mem_natSet _ _).mp hx
have hy := hq'.functional ((natSet_mem_natSet _ _).mpr hi) hz (hbits i hi)
rw [hy]
exact (mem_wordCode _ _).mpr ⟨⟨i,hi⟩,rfl⟩
· intro hz
obtain ⟨i,rfl⟩ := (mem_wordCode _ _).mp hz
exact hbits i.val i.isLt
· rintro rfl
refine ⟨(word n).length,rfl,wordCode_function _,?_⟩
intro x hx
obtain ⟨i,hi,rfl⟩ := (mem_natSet _ _).mp hx
refine ⟨Nat.pair n i,wordBit (Nat.pair n i),⟨natPair_mem _ _,
(pairing_code _ _ _).mpr rfl⟩,(hb _ _).mpr rfl,?_⟩
simp only [wordBit,Nat.unpair_pair]
exact (pair_mem_wordCode _ _ _).mpr ⟨hi,by simp [List.getD,hi]⟩
noncomputable def wordCodeGraph : ZFSet.{0} :=
ZFSet.range (fun n : ℕ => ZFSet.pair (natSet n) (wordCode (word n)))
theorem mem_wordCodeGraph (z : ZFSet.{0}) : z ∈ wordCodeGraph ↔
∃ n : ℕ, z = ZFSet.pair (natSet n) (wordCode (word n)) := by
simp only [wordCodeGraph,ZFSet.mem_range,eq_comm]
theorem pair_mem_wordCodeGraph (n : ℕ) (q : ZFSet.{0}) :
ZFSet.pair (natSet n) q ∈ wordCodeGraph ↔ q = wordCode (word n) := by
rw [mem_wordCodeGraph]
constructor
· rintro ⟨k,hk⟩
obtain ⟨hn,hq⟩ := ZFSet.pair_inj.mp hk
have hn' := natSet_injective hn
simpa only [← hn'] using hq
· intro h
exact ⟨n,by rw [h]⟩
theorem wordCodeGraph_function : FunctionGraph ZFSet.omega conditions wordCodeGraph := by
constructor
· intro z hz
obtain ⟨n,rfl⟩ := (mem_wordCodeGraph z).mp hz
exact ⟨natSet n,(mem_omega _).mpr ⟨n,rfl⟩,wordCode (word n),
(mem_conditions _).mpr ⟨_,wordCode_function _⟩,rfl⟩
· intro x hx
obtain ⟨n,rfl⟩ := (mem_omega x).mp hx
exact ⟨wordCode (word n),(mem_conditions _).mpr ⟨_,wordCode_function _⟩,
(pair_mem_wordCodeGraph _ _).mpr rfl,
fun y _ hy => (pair_mem_wordCodeGraph n y).mp hy⟩
theorem wordCodeGraph_mem (M : ZFSet.{0}) (hM : Transitive M) (hT : SourceT M) :
wordCodeGraph ∈ M := by
let C : Context M := ⟨hM,hT.pairing,hT.union,hT.powerSet,
hT.separation.finitePrefix.bounded,hT.infinity⟩
obtain ⟨gl,hgl,hl⟩ := primrec_graph C (Primrec.list_length.comp word_primrec)
obtain ⟨gb,hgb,hb⟩ := primrec_graph C wordBit_primrec
let r : ℕ → ℕ := fun i => if i < 2 then i else i+3
let φ : Formula := .existsMem 1 (.existsMem 3
(.conj (.orderedPair 2 1 0) (wordGraphFormula.rename r)))
let e := cons ZFSet.omega (cons conditions (cons gl (cons gb
(cons ZFSet.omega (cons alphabet (cons pairNumbers (fun _ => pairingSet)))))))
have he : ∀ i, e i ∈ M := by
intro i
rcases i with _|_|_|_|_|_|_|i
· exact C.omega_mem
· exact conditions_mem M hM hT
· exact hgl
· exact hgb
· exact C.omega_mem
· exact alphabet_mem M hM hT
· exact C.pairNumbers_mem
· exact C.pairing_mem
have hs := sep_mem M hM C.separation φ e he
(C.prod_mem C.omega_mem (conditions_mem M hM hT))
have hspec (z : ZFSet.{0}) : φ.Eval (cons z e) ↔ z ∈ wordCodeGraph := by
simp only [φ,Formula.Eval,Formula.eval_orderedPair,Formula.eval_rename_comp,
cons_zero,cons_succ,e]
rw [omega_exists,mem_wordCodeGraph]
have hh (n : ℕ) (q : ZFSet.{0}) :
cons q (cons (natSet n) (cons z e)) ∘ r = wordGraphEnv q (natSet n) gl gb := by
funext i
rcases i with _|_|i <;> simp [r,e,wordGraphEnv,cons]
simp_rw [show ∀ n q, (cons q (cons (natSet n) (cons z
(cons ZFSet.omega (cons conditions (cons gl (cons gb (cons ZFSet.omega
(cons alphabet (cons pairNumbers (fun _ => pairingSet))))))))))) ∘ r =
wordGraphEnv q (natSet n) gl gb from hh]
simp_rw [wordGraphFormula_spec gl gb hl hb]
constructor
· rintro ⟨n,q,_,hz,rfl⟩
exact ⟨n,hz⟩
· rintro ⟨n,rfl⟩
exact ⟨n,wordCode (word n),(mem_conditions _).mpr ⟨_,wordCode_function _⟩,rfl,rfl⟩
have heq : ZFSet.sep (fun z => φ.Eval (cons z e))
(ZFSet.prod ZFSet.omega conditions) = wordCodeGraph := by
apply ZFSet.ext
intro z
rw [ZFSet.mem_sep,hspec]
exact ⟨And.right,fun hz => ⟨ZFSet.mem_prod.mpr (wordCodeGraph_function.1 z hz),hz⟩⟩
exact heq ▸ hs
theorem canonical_wordCodeGraph (p : List Bool) (q : ZFSet.{0}) :
ZFSet.pair (natSet (encode p)) q ∈ wordCodeGraph ↔ q = wordCode p := by
simp only [pair_mem_wordCodeGraph,word,encodek,Option.getD_some]
end TuringRigidity.InternalCohen
end OAI

Xet Storage Details

Size:
6.74 kB
·
Xet hash:
8400fc2f87b5d1233d23b9ffe19f3cc8e81b4f2d71f6df3861cc2f56be1d85c9

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.