Download data/lean/OAI/Computability/DegreeRigidity/Syntax/FiniteGraphSatisfaction.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 3.47 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Computability/DegreeRigidity/Syntax/FiniteGraphSatisfaction.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Computability/DegreeRigidity/Syntax/FiniteGraphSatisfaction.lean
-
curl -L -o FiniteGraphSatisfaction.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Computability/DegreeRigidity/Syntax/FiniteGraphSatisfaction.lean
3.47 kB
| import OAI.Computability.DegreeRigidity.Syntax.SetSatisfactionBounded | |
| import OAI.Computability.DegreeRigidity.Constructibility.ConstructibleTupleSpace | |
| namespace OAI | |
| namespace TuringRigidity.RelativeConstructible | |
| open ElementaryModel BoundedSetTheory TransitiveNameModel | |
| universe u | |
| def prependValues (w : β β ZFSet.{u}) : β β (β β ZFSet.{u}) β β β ZFSet.{u} | |
| | 0, e => e | |
| | n+1, e => prependValues w n (cons (w n) e) | |
| theorem prependValues_tail (w : β β ZFSet.{u}) (n : β) (e : β β ZFSet.{u}) (i : β) : | |
| prependValues w n e (n+i) = e i := by | |
| induction n generalizing e i with | |
| | zero => simp [prependValues] | |
| | succ n ih => | |
| change prependValues w n (cons (w n) e) (n+1+i) = e i | |
| rw [show n+1+i = n+(i+1) by omega,ih] | |
| rfl | |
| theorem prependValues_lt (w : β β ZFSet.{u}) (n : β) (e : β β ZFSet.{u}) | |
| (i : β) (hi : i < n) : prependValues w n e i = w i := by | |
| induction n generalizing e with | |
| | zero => omega | |
| | succ n ih => | |
| by_cases hin : i < n | |
| Β· exact ih _ hin | |
| Β· have he : i = n := by omega | |
| subst i | |
| exact prependValues_tail w n (cons (w n) e) 0 | |
| def readGraph : β β β β β β (β β β) β Formula β Formula | |
| | 0, _, _, _, Ο => Ο | |
| | n+1, a, g, idx, Ο => .existsMem a | |
| (.conj (.pairMem (idx n+1) 0 (g+1)) | |
| (readGraph n (a+1) (g+1) (fun i => idx i+1) Ο)) | |
| theorem readGraph_eval (n a g : β) (idx : β β β) (Ο : Formula) | |
| (e w : β β ZFSet.{u}) (hw : β i, i < n β w i β e a) | |
| (hg : β i, i < n β β y β e a, | |
| (ZFSet.pair (e (idx i)) y β e g β y = w i)) : | |
| (readGraph n a g idx Ο).Eval e β Ο.Eval (prependValues w n e) := by | |
| induction n generalizing a g idx e with | |
| | zero => rfl | |
| | succ n ih => | |
| simp only [readGraph,Formula.Eval,Formula.eval_pairMem,cons_zero,cons_succ] | |
| constructor | |
| Β· rintro β¨x,hx,hpair,hbodyβ© | |
| have he : x = w n := (hg n (by omega) x hx).mp hpair | |
| subst x | |
| exact (ih (a+1) (g+1) (fun i => idx i+1) (cons (w n) e) | |
| (fun i hi => hw i (by omega)) (fun i hi => hg i (by omega))).mp hbody | |
| Β· intro h | |
| refine β¨w n,hw n (by omega),(hg n (by omega) _ (hw n (by omega))).mpr rfl,?_β© | |
| exact (ih (a+1) (g+1) (fun i => idx i+1) (cons (w n) e) | |
| (fun i hi => hw i (by omega)) (fun i hi => hg i (by omega))).mpr h | |
| def graphTruth (p : SentenceForm) (a g : β) (idx : β β β) : Formula := | |
| readGraph p.bound a g idx (setBounded p (p.bound+a) id) | |
| theorem graphTruth_spec (p : SentenceForm) (a g : β) (idx : β β β) | |
| (e : β β ZFSet.{u}) {n : β} (v : Fin n β ZFSet.{u}) | |
| (hv : β i, v i β e a) (hb : p.bound β€ n) (hg : e g = tupleGraph v) | |
| (hi : β i, i < p.bound β e (idx i) = natSet i) : | |
| (graphTruth p a g idx).Eval e β p.Sat (e a : Set ZFSet) (tupleEnv v) := by | |
| have hw (i : β) (h : i < p.bound) : tupleEnv v i β e a := by | |
| simpa [tupleEnv,show i < n by omega] using hv β¨i,by omegaβ© | |
| have hlookup (i : β) (h : i < p.bound) (y : ZFSet.{u}) (_hy : y β e a) : | |
| ZFSet.pair (e (idx i)) y β e g β y = tupleEnv v i := by | |
| rw [hg,hi i h] | |
| simpa [tupleEnv,show i < n by omega] using tupleGraph_pair v β¨i,by omegaβ© y | |
| rw [graphTruth,readGraph_eval p.bound a g idx _ e (tupleEnv v) hw hlookup,setBounded_eval, | |
| prependValues_tail] | |
| exact p.finite_support _ _ _ (fun i h => prependValues_lt _ _ _ i h) | |
| end TuringRigidity.RelativeConstructible | |
| end OAI | |