openAI-math-dataset / lean /OAI /Computability /DegreeRigidity /Syntax /CheckedMembershipSeparation.lean
Download lean/OAI/Computability/DegreeRigidity/Syntax/CheckedMembershipSeparation.lean from roseking/openAI-math-dataset: direct link, hf CLI and curl.
- Browser
- Download file 5.34 kB
-
https://huggingface.co/datasets/roseking/openAI-math-dataset/resolve/main/lean/OAI/Computability/DegreeRigidity/Syntax/CheckedMembershipSeparation.lean
- Command line
-
hf download hf://datasets/roseking/openAI-math-dataset/lean/OAI/Computability/DegreeRigidity/Syntax/CheckedMembershipSeparation.lean
-
curl -L -o CheckedMembershipSeparation.lean https://huggingface.co/datasets/roseking/openAI-math-dataset/resolve/main/lean/OAI/Computability/DegreeRigidity/Syntax/CheckedMembershipSeparation.lean
5.34 kB
| import OAI.Computability.DegreeRigidity.SetModels.InternalCheckedValue | |
| import OAI.Computability.DegreeRigidity.CohenForcing.FullSetForcing | |
| namespace OAI | |
| namespace TuringRigidity.FullSetForcing | |
| open RecursiveNames TransitiveNameModel BoundedSetTheory AtomicForcing CountableForcing | |
| open ElementaryModel SentenceForm | |
| universe u | |
| variable {c : ZFSet.{u}} [Preorder (Conditions c)] [Top (Conditions c)] | |
| noncomputable def checkedMembershipFormula : SentenceForm := | |
| .ex (.conj (checkedValueFormula.rename (fun i => match i with | 0 => 0 | 1 => 1 | _ => 6)) | |
| (code (.member 0 1) 2 3 4 (fun i => match i with | 0 => 0 | _ => 5))) | |
| theorem checkedMembership_spec (M : ZFSet.{u}) (hM : Transitive M) (hT : SourceT M) | |
| {o : ZFSet.{u}} (ho : ∀ r s : Conditions c, | |
| ZFSet.pair (label c r) (label c s) ∈ o ↔ r ≤ s) | |
| (t : Name (Conditions c)) (p : Conditions c) (x : ZFSet.{u}) | |
| (e : ℕ → ZFSet.{u}) (he : ∀ i, e i ∈ M) | |
| (h0 : e 0 = x) (h1 : e 1 = c) (h2 : e 2 = o) (h3 : e 3 = label c p) | |
| (h4 : e 4 = t.encode (label c)) (h5 : e 5 = label c ⊤) : | |
| checkedMembershipFormula.Sat (M : Set ZFSet) e ↔ MemForces (Name.check x) t p := by | |
| let v : ℕ → ℕ := fun i => match i with | 0 => 0 | _ => 5 | |
| let k : ℕ → ℕ := fun i => match i with | 0 => 0 | 1 => 1 | _ => 6 | |
| let names : ℕ → Name (Conditions c) := fun i => match i with | 0 => Name.check x | _ => t | |
| have hc : c ∈ M := h1 ▸ he 1 | |
| have hx : x ∈ M := h0 ▸ he 0 | |
| have hcheck : (Name.check x : Name (Conditions c)).encode (label c) ∈ M := | |
| encoded_check_mem M c hM hT.pairing hT.union hT.powerSet | |
| hT.separation.finitePrefix.bounded hT.replacement.finitePrefix hT.infinity hc hx | |
| have henv (z : ZFSet.{u}) (hz : z ∈ M) : ∀ i, cons z e i ∈ M := by | |
| intro i; cases i; exact hz; exact he _ | |
| have checked (z : ZFSet.{u}) (hz : z ∈ M) : | |
| (checkedValueFormula.rename k).Sat (M : Set ZFSet) (cons z e) ↔ | |
| z = (Name.check x : Name (Conditions c)).encode (label c) := by | |
| rw [sat_rename,checkedValue_spec M hM hT _ (fun i => henv z hz (k i))] | |
| simp only [k,cons_zero,cons_succ,h0,h5,encode_check] | |
| have forcing (z : ZFSet.{u}) (hz : z ∈ M) | |
| (hzv : z = (Name.check x : Name (Conditions c)).encode (label c)) : | |
| (code (.member 0 1) 2 3 4 v).Sat (M : Set ZFSet) (cons z e) ↔ | |
| MemForces (Name.check x) t p := by | |
| exact realize_code M hM hT ho (.member 0 1) names p (cons z e) (henv z hz) | |
| 2 3 4 v h1 h2 h3 (by intro i; cases i; exact hzv; exact h4) | |
| change (∃ z ∈ M, (checkedValueFormula.rename k).Sat _ (cons z e) ∧ _) ↔ _ | |
| constructor | |
| · rintro ⟨z,hz,hzv,hf⟩ | |
| exact (forcing z hz ((checked z hz).mp hzv)).mp hf | |
| · intro hf | |
| exact ⟨_,hcheck,(checked _ hcheck).mpr rfl,(forcing _ hcheck rfl).mpr hf⟩ | |
| noncomputable def checkedValueSigma : SigmaFormula := | |
| .existsSet (.existsSet (.existsSet (.bounded (.conj (CheckFormula.graph 2 1 0 5) | |
| (.conj (.member 4 2) (.conj (.member 3 1) (.pairMem 4 3 0))))))) | |
| noncomputable def checkedMembershipSigma : SigmaFormula := | |
| .existsSet (.conj | |
| (checkedValueSigma.rename (fun i => match i with | 0 => 0 | 1 => 1 | _ => 6)) | |
| (BoundedForcing.SigmaCode.forcing (.bounded (.member 0 1)) 2 3 4 | |
| (fun i => match i with | 0 => 0 | _ => 5))) | |
| theorem checkedMembershipSigma_spec (M : ZFSet.{u}) (e : ℕ → ZFSet.{u}) : | |
| checkedMembershipSigma.Realize M e ↔ checkedMembershipFormula.Sat (M : Set ZFSet) e := by | |
| change (∃ z ∈ M, (SigmaFormula.conj _ _).Realize M (cons z e)) ↔ | |
| ∃ z ∈ M, (SentenceForm.conj _ _).Sat (M : Set ZFSet) (cons z e) | |
| apply exists_congr; intro z | |
| apply and_congr_right; intro _ | |
| rw [SigmaFormula.realize_conj] | |
| change (_ ∧ _) ↔ (_ ∧ _) | |
| rw [SigmaFormula.realize_rename,sat_rename] | |
| exact and_congr (sigma_sat checkedValueSigma M _).symm | |
| (sigma_sat (BoundedForcing.SigmaCode.forcing (.bounded (.member 0 1)) 2 3 4 | |
| (fun i => match i with | 0 => 0 | _ => 5)) M _).symm | |
| theorem internal_forced_members (M : ZFSet.{u}) (hM : Transitive M) (hT : SourceT M) | |
| (hc : c ∈ M) {o a : ZFSet.{u}} | |
| (hoM : o ∈ M) (ha : a ∈ M) | |
| (ho : ∀ r s : Conditions c, ZFSet.pair (label c r) (label c s) ∈ o ↔ r ≤ s) | |
| (t : Name (Conditions c)) (ht : t.encode (label c) ∈ M) (p : Conditions c) : | |
| ∃ b ∈ M, ∀ x, x ∈ b ↔ x ∈ a ∧ MemForces (Name.check x) t p := by | |
| let e := cons c (cons o (cons (label c p) (cons (t.encode (label c)) (fun _ => label c ⊤)))) | |
| have he : ∀ i, e i ∈ M := by | |
| intro i; rcases i with _|_|_|_|i | |
| exact hc | |
| exact hoM | |
| exact hM c hc _ (label_mem c p) | |
| exact ht | |
| exact hM c hc _ (label_mem c ⊤) | |
| obtain ⟨b,hb,hdef⟩ := hT.separation.finitePrefix checkedMembershipSigma e he a ha | |
| have spec (x : ZFSet.{u}) (hx : x ∈ M) := checkedMembership_spec M hM hT ho t p x | |
| (cons x e) (by intro i; cases i; exact hx; exact he _) rfl rfl rfl rfl rfl rfl | |
| refine ⟨b,hb,fun x => ?_⟩ | |
| constructor | |
| · intro hx | |
| have hxM := hM b hb x hx | |
| obtain ⟨hxa,hf⟩ := (hdef x hxM).mp hx | |
| exact ⟨hxa,(spec x hxM).mp ((checkedMembershipSigma_spec M _).mp hf)⟩ | |
| · rintro ⟨hxa,hf⟩ | |
| have hxM := hM a ha x hxa | |
| exact (hdef x hxM).mpr ⟨hxa,(checkedMembershipSigma_spec M _).mpr ((spec x hxM).mpr hf)⟩ | |
| end TuringRigidity.FullSetForcing | |
| end OAI | |