Download data/lean/OAI/Computability/DegreeRigidity/OrdinalCodes/NaturalDefinitions.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 4.2 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Computability/DegreeRigidity/OrdinalCodes/NaturalDefinitions.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Computability/DegreeRigidity/OrdinalCodes/NaturalDefinitions.lean
-
curl -L -o NaturalDefinitions.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Computability/DegreeRigidity/OrdinalCodes/NaturalDefinitions.lean
4.2 kB
| import OAI.Computability.DegreeRigidity.OrdinalCodes.NaturalPairingFormula | |
| namespace OAI | |
| namespace TuringRigidity.BoundedSetTheory | |
| universe u | |
| def DefinesNatural (Ο : Formula) (f : β β β) : Prop := | |
| β e : β β ZFSet.{u}, e 2 = ZFSet.omega β | |
| (β g : β β β, β k, finiteNaturalGraph g k β e 3) β β n, e 1 = natSet n β | |
| (Ο.Eval e β e 0 = natSet (f n)) | |
| namespace Formula | |
| def unaryVars (o Q x y : β) : β β β | |
| | 0 => y | |
| | 1 => x | |
| | 2 => o | |
| | _+3 => Q | |
| def unary (Ο : Formula) (o Q x y : β) : Formula := Ο.rename (unaryVars o Q x y) | |
| theorem unary_spec {Ο : Formula} {f : β β β} (hΟ : DefinesNatural.{u} Ο f) | |
| (o Q x y : β) (e : β β ZFSet.{u}) (ho : e o = ZFSet.omega) | |
| (hQ : β g : β β β, β k, finiteNaturalGraph g k β e Q) (n : β) (hx : e x = natSet n) : | |
| (unary Ο o Q x y).Eval e β e y = natSet (f n) := by | |
| rw [unary,eval_rename] | |
| exact hΟ (fun i => e (unaryVars o Q x y i)) ho hQ n hx | |
| def numericComposition (Ο Ο : Formula) : Formula := .existsMem 2 | |
| (.conj (unary Ο 3 4 2 0) (unary Ο 3 4 0 1)) | |
| def numericPair (Ο Ο : Formula) : Formula := .existsMem 2 (.existsMem 3 | |
| (.conj (unary Ο 4 5 3 1) (.conj (unary Ο 4 5 3 0) (naturalPair 4 5 1 0 2)))) | |
| def pairedUnary (Ο : Formula) (o Q a b y : β) : Formula := .existsMem o | |
| (.conj (naturalPair (o+1) (Q+1) (a+1) (b+1) 0) (unary Ο (o+1) (Q+1) 0 (y+1))) | |
| theorem pairedUnary_spec {Ο : Formula} {f : β β β} (hΟ : DefinesNatural.{u} Ο f) | |
| (o Q x n y : β) (e : β β ZFSet.{u}) (ho : e o = ZFSet.omega) | |
| (hQ : β g : β β β, β k, finiteNaturalGraph g k β e Q) | |
| (a b : β) (ha : e x = natSet a) (hb : e n = natSet b) : | |
| (pairedUnary Ο o Q x n y).Eval e β e y = natSet (f (Nat.pair a b)) := by | |
| have hp (w : ZFSet.{u}) := naturalPair_spec (o+1) (Q+1) (x+1) (n+1) 0 (cons w e) ho hQ a b ha hb | |
| have hu := unary_spec hΟ (o+1) (Q+1) 0 (y+1) (cons (natSet (Nat.pair a b)) e) ho hQ (Nat.pair a b) rfl | |
| simp only [pairedUnary,Formula.Eval] | |
| constructor | |
| Β· rintro β¨w,_,hw,hβ© | |
| obtain rfl := (hp w).mp hw | |
| exact hu.mp h | |
| Β· intro h | |
| refine β¨natSet (Nat.pair a b),?_,(hp _).mpr rfl,hu.mpr hβ© | |
| rw [ho]; exact (mem_omega _).mpr β¨Nat.pair a b,rflβ© | |
| end Formula | |
| theorem definesNatural_zero : DefinesNatural.{u} (.empty 0) (fun _ => 0) := by | |
| intro e _ _ n _ | |
| exact Formula.eval_empty 0 e | |
| theorem definesNatural_succ : DefinesNatural.{u} (.successor 0 1) Nat.succ := by | |
| intro e _ _ n hn | |
| rw [Formula.eval_successor,hn] | |
| rfl | |
| theorem DefinesNatural.comp {Ο Ο : Formula} {f g : β β β} | |
| (hf : DefinesNatural.{u} Ο f) (hg : DefinesNatural.{u} Ο g) : | |
| DefinesNatural.{u} (Formula.numericComposition Ο Ο) (fun n => f (g n)) := by | |
| intro e ho hQ n hn | |
| have hv (w : ZFSet.{u}) := Formula.unary_spec hg 3 4 2 0 (cons w e) ho hQ n hn | |
| have hu := Formula.unary_spec hf 3 4 0 1 (cons (natSet (g n)) e) ho hQ (g n) rfl | |
| simp only [Formula.numericComposition,Formula.Eval] | |
| constructor | |
| Β· rintro β¨w,_,hw,hβ© | |
| obtain rfl := (hv w).mp hw | |
| exact hu.mp h | |
| Β· intro h | |
| refine β¨natSet (g n),?_,(hv _).mpr rfl,hu.mpr hβ© | |
| rw [ho]; exact (mem_omega _).mpr β¨g n,rflβ© | |
| theorem DefinesNatural.pair {Ο Ο : Formula} {f g : β β β} | |
| (hf : DefinesNatural.{u} Ο f) (hg : DefinesNatural.{u} Ο g) : | |
| DefinesNatural.{u} (Formula.numericPair Ο Ο) (fun n => Nat.pair (f n) (g n)) := by | |
| intro e ho hQ n hn | |
| have hv (w z : ZFSet.{u}) := Formula.unary_spec hf 4 5 3 1 (cons z (cons w e)) ho hQ n hn | |
| have hw (w z : ZFSet.{u}) := Formula.unary_spec hg 4 5 3 0 (cons z (cons w e)) ho hQ n hn | |
| have hp := Formula.naturalPair_spec 4 5 1 0 2 (cons (natSet (g n)) (cons (natSet (f n)) e)) | |
| ho hQ (f n) (g n) rfl rfl | |
| have hmem (k : β) : natSet.{u} k β e 2 := by rw [ho]; exact (mem_omega _).mpr β¨k,rflβ© | |
| simp only [Formula.numericPair,Formula.Eval] | |
| constructor | |
| Β· rintro β¨w,_,z,_,hvw,hwz,hβ© | |
| obtain rfl := (hv w z).mp hvw | |
| obtain rfl := (hw _ z).mp hwz | |
| exact hp.mp h | |
| Β· intro h | |
| exact β¨natSet (f n),hmem _,natSet (g n),hmem _,(hv _ _).mpr rfl,(hw _ _).mpr rfl,hp.mpr hβ© | |
| end TuringRigidity.BoundedSetTheory | |
| end OAI | |