Download data/lean/OAI/Computability/DegreeRigidity/Syntax/BoundedTruthRecursion.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 8.89 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Computability/DegreeRigidity/Syntax/BoundedTruthRecursion.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Computability/DegreeRigidity/Syntax/BoundedTruthRecursion.lean
-
curl -L -o BoundedTruthRecursion.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Computability/DegreeRigidity/Syntax/BoundedTruthRecursion.lean
8.89 kB
| import OAI.Computability.DegreeRigidity.Representation.SourceTheory | |
| import OAI.Computability.DegreeRigidity.Syntax.FiniteTerm | |
| import OAI.Computability.DegreeRigidity.Syntax.BoundedFormulaRename | |
| namespace OAI | |
| namespace TuringRigidity.BoundedTruthRecursion | |
| open TransitiveNameModel BoundedSetTheory | |
| def Local (Ο : Formula) (e : β β ZFSet.{0}) : Prop := | |
| β D : ZFSet.{0}, Transitive D β β t β D, β Y Z : ZFSet.{0}, | |
| (β s β D, ZFSet.rank s < ZFSet.rank t β (s β Y β s β Z)) β | |
| (Ο.Eval (cons t (cons Y e)) β Ο.Eval (cons t (cons Z e))) | |
| def Partial (Ο : Formula) (e : β β ZFSet.{0}) (K D Y : ZFSet.{0}) : Prop := | |
| Transitive D β§ D β K β§ Y β D β§ | |
| β t β D, t β Y β Ο.Eval (cons t (cons Y e)) | |
| theorem partial_sound (Ο : Formula) (e : β β ZFSet.{0}) (K D Y Z : ZFSet.{0}) | |
| (hl : Local Ο e) (hp : Partial Ο e K D Y) | |
| (hz : β t β K, t β Z β Ο.Eval (cons t (cons Z e))) : | |
| β t β D, t β Y β t β Z := by | |
| have wf : WellFounded (fun a b : ZFSet.{0} => ZFSet.rank a < ZFSet.rank b) := | |
| InvImage.wf ZFSet.rank Ordinal.lt_wf | |
| intro t | |
| induction t using wf.induction with | |
| | h t ih => | |
| intro ht | |
| exact (hp.2.2.2 t ht).trans ((hl D hp.1 t ht Y Z | |
| (fun s hs hst => ih s hst hs)).trans (hz t (hp.2.1 ht)).symm) | |
| def dropSlots : β β β | |
| | 0 => 0 | |
| | 1 => 1 | |
| | n+2 => n+4 | |
| def partialFormula (Ο : Formula) : Formula := | |
| .conj (.transitive 1) (.conj (.subset 1 2) (.conj (.subset 0 1) | |
| (.allMem 1 (.iff (.member 0 1) (Ο.rename dropSlots))))) | |
| theorem partialFormula_spec (Ο : Formula) (e : β β ZFSet.{0}) (K D Y : ZFSet.{0}) : | |
| (partialFormula Ο).Eval (cons Y (cons D (cons K e))) β Partial Ο e K D Y := by | |
| simp only [partialFormula,Formula.Eval,Formula.eval_transitive,Formula.eval_subset, | |
| Formula.eval_allMem,Formula.eval_iff,Formula.eval_rename_comp,cons_zero,cons_succ,Partial] | |
| have eq (t : ZFSet.{0}) : cons t (cons Y (cons D (cons K e))) β dropSlots = cons t (cons Y e) := by | |
| funext i; rcases i with _|_|i <;> rfl | |
| simp only [eq] | |
| noncomputable def domain (Ο : Formula) (e : β β ZFSet.{0}) (K Q : ZFSet.{0}) : ZFSet.{0} := | |
| K.sep (fun t => β D β Q, β Y β Q, Partial Ο e K D Y β§ t β D) | |
| noncomputable def truth (Ο : Formula) (e : β β ZFSet.{0}) (K Q : ZFSet.{0}) : ZFSet.{0} := | |
| K.sep (fun t => β D β Q, β Y β Q, Partial Ο e K D Y β§ t β Y) | |
| def candidateSlots : β β β | |
| | 0 => 0 | |
| | 1 => 1 | |
| | n+2 => n+4 | |
| def unionFormula (Ο : Formula) (which : β) : Formula := | |
| .existsMem 1 (.existsMem 2 (.conj ((partialFormula Ο).rename candidateSlots) (.member 2 which))) | |
| theorem unionFormula_spec (Ο : Formula) (e : β β ZFSet.{0}) (K Q t : ZFSet.{0}) (which : β) : | |
| (unionFormula Ο which).Eval (cons t (cons Q (cons K e))) β | |
| β D β Q, β Y β Q, Partial Ο e K D Y β§ | |
| t β cons Y (cons D (cons t (cons Q (cons K e)))) which := by | |
| simp only [unionFormula,Formula.Eval,Formula.eval_rename_comp,cons_zero,cons_succ] | |
| have eq (D Y : ZFSet.{0}) : | |
| cons Y (cons D (cons t (cons Q (cons K e)))) β candidateSlots = cons Y (cons D (cons K e)) := by | |
| funext i; rcases i with _|_|i <;> rfl | |
| simp only [eq,partialFormula_spec] | |
| theorem domain_truth_mem (M K Q : ZFSet.{0}) (hM : Transitive M) (hT : SourceT M) | |
| (hK : K β M) (hQ : Q β M) (Ο : Formula) (e : β β ZFSet.{0}) (he : β i, e i β M) : | |
| domain Ο e K Q β M β§ truth Ο e K Q β M := by | |
| have henv : β i, cons Q (cons K e) i β M := by | |
| intro i; rcases i with _|_|i; exact hQ; exact hK; exact he i | |
| constructor | |
| Β· have hs := sep_mem M hM hT.separation.finitePrefix.bounded (unionFormula Ο 1) _ henv hK | |
| simpa only [unionFormula_spec,cons_succ,cons_zero,domain] using hs | |
| Β· have hs := sep_mem M hM hT.separation.finitePrefix.bounded (unionFormula Ο 0) _ henv hK | |
| simpa only [unionFormula_spec,cons_succ,cons_zero,truth] using hs | |
| theorem domain_transitive (Ο : Formula) (e : β β ZFSet.{0}) (K Q : ZFSet.{0}) : | |
| Transitive (domain Ο e K Q) := by | |
| intro t ht s hst | |
| obtain β¨_,D,hD,Y,hY,hp,htDβ© := ZFSet.mem_sep.mp ht | |
| have hsD := hp.1 t htD s hst | |
| exact ZFSet.mem_sep.mpr β¨hp.2.1 hsD,D,hD,Y,hY,hp,hsDβ© | |
| theorem truth_subset_domain (Ο : Formula) (e : β β ZFSet.{0}) (K Q : ZFSet.{0}) : | |
| truth Ο e K Q β domain Ο e K Q := by | |
| intro t ht | |
| obtain β¨htK,D,hD,Y,hY,hp,htYβ© := ZFSet.mem_sep.mp ht | |
| exact ZFSet.mem_sep.mpr β¨htK,D,hD,Y,hY,hp,hp.2.2.1 htYβ© | |
| theorem truth_agrees (Ο : Formula) (e : β β ZFSet.{0}) (K Q Z : ZFSet.{0}) | |
| (hl : Local Ο e) (hz : β t β K, t β Z β Ο.Eval (cons t (cons Z e))) : | |
| β t β domain Ο e K Q, t β truth Ο e K Q β t β Z := by | |
| intro t ht | |
| constructor | |
| Β· intro h | |
| obtain β¨_,D,_,Y,_,hp,htYβ© := ZFSet.mem_sep.mp h | |
| exact (partial_sound Ο e K D Y Z hl hp hz t (hp.2.2.1 htY)).mp htY | |
| Β· intro h | |
| obtain β¨htK,D,hD,Y,hY,hp,htDβ© := ZFSet.mem_sep.mp ht | |
| exact ZFSet.mem_sep.mpr β¨htK,D,hD,Y,hY,hp,(partial_sound Ο e K D Y Z hl hp hz t htD).mpr hβ© | |
| theorem partial_of_agrees (Ο : Formula) (e : β β ZFSet.{0}) (K D Y Z : ZFSet.{0}) | |
| (hl : Local Ο e) (hz : β t β K, t β Z β Ο.Eval (cons t (cons Z e))) | |
| (hD : Transitive D) (hDK : D β K) (hYD : Y β D) | |
| (ha : β t β D, t β Y β t β Z) : Partial Ο e K D Y := by | |
| refine β¨hD,hDK,hYD,?_β© | |
| intro t ht | |
| exact (ha t ht).trans ((hz t (hDK ht)).trans | |
| (hl D hD t ht Y Z (fun s hs _ => ha s hs)).symm) | |
| theorem truth_internal (M K Z : ZFSet.{0}) (hM : Transitive M) (hT : SourceT M) | |
| (hKM : K β M) (hK : Transitive K) (Ο : Formula) (e : β β ZFSet.{0}) | |
| (he : β i, e i β M) (hl : Local Ο e) | |
| (hz : β t β K, t β Z β Ο.Eval (cons t (cons Z e))) : | |
| K.sep (fun t => t β Z) β M := by | |
| classical | |
| obtain β¨Q,hQM,hQβ© := internal_power M hM hT.powerSet hKM | |
| let D := domain Ο e K Q | |
| let Y := truth Ο e K Q | |
| obtain β¨hDM,hYMβ© := domain_truth_mem M K Q hM hT hKM hQM Ο e he | |
| have hD : Transitive D := domain_transitive Ο e K Q | |
| have hDK : D β K := fun _ h => (ZFSet.mem_sep.mp h).1 | |
| have hYD : Y β D := truth_subset_domain Ο e K Q | |
| have ha : β t β D, t β Y β t β Z := truth_agrees Ο e K Q Z hl hz | |
| have hcover (t : ZFSet.{0}) : t β K β t β D := by | |
| induction t using ZFSet.inductionOn with | |
| | h t ih => | |
| intro htK | |
| by_cases htD : t β D | |
| Β· exact htD | |
| have hchildren : t β D := fun s hs => ih s hs (hK t htK s hs) | |
| let D' := D βͺ ({t} : ZFSet.{0}) | |
| let Y' := if t β Z then Y βͺ ({t} : ZFSet.{0}) else Y | |
| have hDD' : D β D' := fun _ h => ZFSet.mem_union.mpr (Or.inl h) | |
| have htD' : t β D' := ZFSet.mem_union.mpr (Or.inr (ZFSet.mem_singleton.mpr rfl)) | |
| have hD' : Transitive D' := by | |
| intro a ha b hb | |
| rcases ZFSet.mem_union.mp ha with ha | ha | |
| Β· exact hDD' (hD a ha b hb) | |
| Β· have ha := ZFSet.mem_singleton.mp ha | |
| subst a | |
| exact hDD' (hchildren hb) | |
| have hD'K : D' β K := by | |
| intro a ha | |
| rcases ZFSet.mem_union.mp ha with ha | ha | |
| Β· exact hDK ha | |
| Β· exact (ZFSet.mem_singleton.mp ha) βΈ htK | |
| have hY'D' : Y' β D' := by | |
| intro a ha | |
| dsimp [Y'] at ha | |
| split_ifs at ha | |
| Β· rcases ZFSet.mem_union.mp ha with ha | ha | |
| Β· exact hDD' (hYD ha) | |
| Β· exact (ZFSet.mem_singleton.mp ha) βΈ htD' | |
| Β· exact hDD' (hYD ha) | |
| have ha' : β a β D', a β Y' β a β Z := by | |
| intro a haD' | |
| by_cases hat : a = t | |
| Β· subst a | |
| have htY : t β Y := fun h => htD (hYD h) | |
| simp only [Y'] | |
| split_ifs with htZ <;> simp [htZ,htY] | |
| Β· have haD : a β D := (ZFSet.mem_union.mp haD').resolve_right (fun h => hat (ZFSet.mem_singleton.mp h)) | |
| have hae := ha a haD | |
| dsimp [Y'] | |
| split_ifs <;> simpa only [ZFSet.mem_union,ZFSet.mem_singleton,hat,or_false] using hae | |
| have htM := hM K hKM t htK | |
| have hsM := singleton_mem M hM hT.pairing htM | |
| have hD'M : D' β M := binary_union_mem M hM hT.pairing hT.union hDM hsM | |
| have hY'M : Y' β M := by | |
| dsimp [Y']; split_ifs | |
| Β· exact binary_union_mem M hM hT.pairing hT.union hYM hsM | |
| Β· exact hYM | |
| exact ZFSet.mem_sep.mpr β¨htK,D',(hQ _).mpr β¨hD'M,hD'Kβ©, | |
| Y',(hQ _).mpr β¨hY'M,fun _ h => hD'K (hY'D' h)β©, | |
| partial_of_agrees Ο e K D' Y' Z hl hz hD' hD'K hY'D' ha',htD'β© | |
| have eq : Y = K.sep (fun t => t β Z) := by | |
| apply ZFSet.ext; intro t | |
| constructor | |
| Β· intro ht | |
| exact ZFSet.mem_sep.mpr β¨hDK (hYD ht),(ha t (hYD ht)).mp htβ© | |
| Β· intro ht | |
| obtain β¨htK,htZβ© := ZFSet.mem_sep.mp ht | |
| exact (ha t (hcover t htK)).mpr htZ | |
| exact eq βΈ hYM | |
| end TuringRigidity.BoundedTruthRecursion | |
| end OAI | |