Download data/lean/OAI/Computability/DegreeRigidity/Syntax/BoundedDefinability.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 5.91 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Computability/DegreeRigidity/Syntax/BoundedDefinability.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Computability/DegreeRigidity/Syntax/BoundedDefinability.lean
-
curl -L -o BoundedDefinability.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Computability/DegreeRigidity/Syntax/BoundedDefinability.lean
5.91 kB
| import OAI.Computability.DegreeRigidity.SetModels.SetModelFunctionGraphs | |
| namespace OAI | |
| namespace TuringRigidity.BoundedDefinability | |
| open BoundedSetTheory TransitiveNameModel SetModelReals SetModelFunctions | |
| universe u | |
| noncomputable section | |
| def mix (e d : β β ZFSet.{u}) (n : β) : ZFSet.{u} := | |
| if n % 2 = 0 then e (n/2) else d (n/2) | |
| @[simp] theorem mix_even (e d : β β ZFSet.{u}) (n : β) : mix e d (2*n) = e n := by | |
| simp [mix] | |
| @[simp] theorem mix_odd (e d : β β ZFSet.{u}) (n : β) : mix e d (2*n+1) = d n := by | |
| simp [mix,Nat.add_div] | |
| theorem parity_ext {Ξ± : Sort*} {f g : β β Ξ±} (he : β n, f (2*n) = g (2*n)) | |
| (ho : β n, f (2*n+1) = g (2*n+1)) : f = g := by | |
| funext n | |
| have hm : n%2 < 2 := Nat.mod_lt n (by decide) | |
| by_cases h : n%2=0 | |
| Β· have hn : n=2*(n/2) := by omega | |
| rw [hn] | |
| exact he _ | |
| Β· have hn : n=2*(n/2)+1 := by omega | |
| rw [hn] | |
| exact ho _ | |
| def slotMap (r s : β β β) (n : β) : β := | |
| if n%2=0 then 2*r (n/2) else 2*s (n/2)+1 | |
| @[simp] theorem slotMap_even (r s : β β β) (n : β) : slotMap r s (2*n) = 2*r n := by | |
| simp [slotMap] | |
| @[simp] theorem slotMap_odd (r s : β β β) (n : β) : slotMap r s (2*n+1) = 2*s n+1 := by | |
| simp [slotMap,Nat.add_div] | |
| @[simp] theorem mix_slotMap (e d : β β ZFSet.{u}) (r s : β β β) : | |
| mix e d β slotMap r s = mix (e β r) (d β s) := by | |
| apply parity_ext <;> intro n <;> simp | |
| def Definable (M : ZFSet.{u}) (P : (β β ZFSet.{u}) β Prop) : Prop := | |
| β p : Formula, β d : β β ZFSet.{u}, (β i, d i β M) β§ | |
| β e, p.Eval (mix e d) β P e | |
| variable {M : ZFSet.{u}} {P Q : (β β ZFSet.{u}) β Prop} | |
| theorem Definable.congr (h : Definable M P) (he : β e, P e β Q e) : Definable M Q := by | |
| obtain β¨p,d,hd,hpβ© := h | |
| exact β¨p,d,hd,fun e => (hp e).trans (he e)β© | |
| theorem Definable.subst (h : Definable M P) (r : β β β) : | |
| Definable M (fun e => P (e β r)) := by | |
| obtain β¨p,d,hd,hpβ© := h | |
| refine β¨p.rename (slotMap r id),d,hd,?_β© | |
| intro e | |
| simpa only [Formula.eval_rename_comp,mix_slotMap,Function.comp_id] using hp (e β r) | |
| theorem Definable.neg (h : Definable M P) : Definable M (fun e => Β¬ P e) := by | |
| obtain β¨p,d,hd,hpβ© := h | |
| exact β¨.neg p,d,hd,fun e => not_congr (hp e)β© | |
| theorem Definable.and (hP : Definable M P) (hQ : Definable M Q) : | |
| Definable M (fun e => P e β§ Q e) := by | |
| obtain β¨p,d,hd,hpβ© := hP | |
| obtain β¨q,c,hc,hqβ© := hQ | |
| refine β¨.conj (p.rename (slotMap id (fun i => 2*i))) | |
| (q.rename (slotMap id (fun i => 2*i+1))),mix d c,?_,?_β© | |
| Β· intro i | |
| unfold mix | |
| split <;> first | exact hd _ | exact hc _ | |
| Β· intro e | |
| simp only [Formula.Eval,Formula.eval_rename_comp,mix_slotMap,Function.comp_id] | |
| have hd' : mix d c β (fun i => 2*i) = d := by funext i; simp | |
| have hc' : mix d c β (fun i => 2*i+1) = c := by funext i; simp | |
| rw [hd',hc',hp,hq] | |
| def bindSlots (n : β) : β := | |
| if n%2=0 then if n/2=0 then 0 else 2*(n/2-1)+1 else 2*(n/2)+2 | |
| @[simp] theorem bindSlots_zero : bindSlots 0 = 0 := rfl | |
| @[simp] theorem bindSlots_even_succ (n : β) : bindSlots (2*(n+1)) = 2*n+1 := by | |
| simp [bindSlots] | |
| @[simp] theorem bindSlots_odd (n : β) : bindSlots (2*n+1) = 2*n+2 := by | |
| simp [bindSlots,Nat.add_div] | |
| theorem bind_mix (x : ZFSet.{u}) (e d : β β ZFSet.{u}) : | |
| cons x (mix e d) β bindSlots = mix (cons x e) d := by | |
| apply parity_ext | |
| Β· intro n | |
| cases n with | |
| | zero => rfl | |
| | succ n => simp | |
| Β· intro n | |
| simp [show 2*n+2 = (2*n+1)+1 from by omega] | |
| theorem Definable.existsMem (h : Definable M P) (i : β) : | |
| Definable M (fun e => β x β e i, P (cons x e)) := by | |
| obtain β¨p,d,hd,hpβ© := h | |
| refine β¨.existsMem (2*i) (p.rename bindSlots),d,hd,?_β© | |
| intro e | |
| simp only [Formula.Eval,mix_even,Formula.eval_rename_comp,bind_mix,hp] | |
| theorem Definable.existsParam (h : Definable M P) {a : ZFSet.{u}} (ha : a β M) : | |
| Definable M (fun e => β x β a, P (cons x e)) := by | |
| obtain β¨p,d,hd,hpβ© := h | |
| let r := slotMap id Nat.succ | |
| refine β¨.existsMem 1 ((p.rename r).rename bindSlots),cons a d,?_,?_β© | |
| Β· intro i | |
| cases i with | |
| | zero => exact ha | |
| | succ i => exact hd i | |
| Β· intro e | |
| have hd' : cons a d β Nat.succ = d := rfl | |
| simp only [r,Formula.Eval,Formula.eval_rename_comp,bind_mix,mix_slotMap,Function.comp_id,hd',hp, | |
| show mix e (cons a d) 1 = a from rfl] | |
| theorem equal_definable (C : Context M) (i j : β) : Definable M (fun e => e i = e j) := | |
| β¨.equal (2*i) (2*j),fun _ => ZFSet.omega,fun _ => C.omega_mem,fun e => by simp [Formula.Eval]β© | |
| theorem member_definable (C : Context M) (i j : β) : Definable M (fun e => e i β e j) := | |
| β¨.member (2*i) (2*j),fun _ => ZFSet.omega,fun _ => C.omega_mem,fun e => by simp [Formula.Eval]β© | |
| theorem equal_param {a : ZFSet.{u}} (ha : a β M) (i : β) : | |
| Definable M (fun e => e i = a) := | |
| β¨.equal (2*i) 1,fun _ => a,fun _ => ha,fun e => by simp [Formula.Eval,mix]β© | |
| theorem pairMem_param {a : ZFSet.{u}} (ha : a β M) (i j : β) : | |
| Definable M (fun e => ZFSet.pair (e i) (e j) β a) := | |
| β¨.pairMem (2*i) (2*j) 1,fun _ => a,fun _ => ha,fun e => by simp [mix]β© | |
| theorem Definable.sep_mem (C : Context M) (h : Definable M P) (e : β β ZFSet.{u}) | |
| (he : β i, e i β M) {a : ZFSet.{u}} (ha : a β M) : | |
| ZFSet.sep (fun x => P (cons x e)) a β M := by | |
| obtain β¨p,d,hd,hpβ© := h | |
| let q := p.rename bindSlots | |
| have hm : β i, mix e d i β M := by | |
| intro i | |
| unfold mix | |
| split <;> first | exact he _ | exact hd _ | |
| have hs := BoundedSetTheory.sep_mem M C.transitive C.separation q (mix e d) hm ha | |
| have hh : ZFSet.sep (fun x => q.Eval (cons x (mix e d))) a = | |
| ZFSet.sep (fun x => P (cons x e)) a := by | |
| apply ZFSet.ext | |
| intro x | |
| simp only [ZFSet.mem_sep,q,Formula.eval_rename_comp,bind_mix,hp] | |
| exact hh βΈ hs | |
| end | |
| end TuringRigidity.BoundedDefinability | |
| end OAI | |