math / data /lean /OAI /Computability /DegreeRigidity /Syntax /BoundedRelations.lean
introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
3.56 kB
import OAI.Computability.DegreeRigidity.SetModels.ModelProducts
namespace OAI
namespace TuringRigidity.BoundedSetTheory
open TransitiveNameModel
universe u
namespace Formula
def imp (Ο† ψ : Formula) : Formula := disj (.neg Ο†) ψ
def iff (Ο† ψ : Formula) : Formula := .conj (imp Ο† ψ) (imp ψ Ο†)
@[simp] theorem eval_imp (Ο† ψ : Formula) (e : β„• β†’ ZFSet.{u}) :
(imp Ο† ψ).Eval e ↔ (Ο†.Eval e β†’ ψ.Eval e) := by
classical
simp only [imp, eval_disj, Eval]
constructor
Β· intro h hp; exact h.elim (fun hn => False.elim (hn hp)) id
Β· intro h; by_cases hp : Ο†.Eval e
Β· exact Or.inr (h hp)
Β· exact Or.inl hp
@[simp] theorem eval_iff (Ο† ψ : Formula) (e : β„• β†’ ZFSet.{u}) :
(iff Ο† ψ).Eval e ↔ (Ο†.Eval e ↔ ψ.Eval e) := by
simp only [iff, Eval, eval_imp, iff_def]
def subset (a b : β„•) : Formula := allMem a (.member 0 (b+1))
def transitive (a : β„•) : Formula := allMem a (subset 0 (a+1))
@[simp] theorem eval_subset (a b : β„•) (e : β„• β†’ ZFSet.{u}) :
(subset a b).Eval e ↔ e a βŠ† e b := by
simp only [subset, eval_allMem, Eval, cons_zero, cons_succ]
rfl
@[simp] theorem eval_transitive (a : β„•) (e : β„• β†’ ZFSet.{u}) :
(transitive a).Eval e ↔ Transitive (e a) := by
simp only [transitive, eval_allMem, eval_subset, cons_zero, cons_succ]
rfl
def functionGraph (f d v : β„•) : Formula :=
.conj (allMem f (.existsMem (d+1) (.existsMem (v+2) (orderedPair 2 1 0))))
(allMem d (.existsMem (v+1)
(.conj (pairMem 1 0 (f+2))
(allMem (v+2) (imp (pairMem 2 0 (f+3)) (.equal 0 1))))))
@[simp] theorem eval_functionGraph (f d v : β„•) (e : β„• β†’ ZFSet.{u}) :
(functionGraph f d v).Eval e ↔
(βˆ€ z ∈ e f, βˆƒ x ∈ e d, βˆƒ y ∈ e v, z = ZFSet.pair x y) ∧
(βˆ€ x ∈ e d, βˆƒ y ∈ e v, ZFSet.pair x y ∈ e f ∧
βˆ€ z ∈ e v, ZFSet.pair x z ∈ e f β†’ z = y) := by
simp only [functionGraph, Eval, eval_allMem, eval_orderedPair,
eval_pairMem, eval_imp, cons_zero, cons_succ]
end Formula
inductive SigmaFormula where
| bounded (Ο† : Formula)
| existsSet (Ο† : SigmaFormula)
def SigmaFormula.Realize (M : ZFSet.{u}) (e : β„• β†’ ZFSet.{u}) : SigmaFormula β†’ Prop
| .bounded Ο† => Ο†.Realize M e
| .existsSet Ο† => βˆƒ x ∈ M, Ο†.Realize M (cons x e)
def SigmaReplacement (M : ZFSet.{u}) : Prop :=
βˆ€ (Ο† : SigmaFormula) (e : β„• β†’ ZFSet.{u}), (βˆ€ i, e i ∈ M) β†’
βˆ€ a ∈ M,
(βˆ€ x ∈ a, βˆƒ y ∈ M, Ο†.Realize M (cons y (cons x e)) ∧
βˆ€ z ∈ M, Ο†.Realize M (cons z (cons x e)) β†’ z = y) β†’
βˆƒ b ∈ M, βˆ€ y ∈ M, y ∈ b ↔ βˆƒ x ∈ a, Ο†.Realize M (cons y (cons x e))
theorem replacement_image (M : ZFSet.{u}) (hM : Transitive M)
(hR : SigmaReplacement M) (Ο† : SigmaFormula) (e : β„• β†’ ZFSet.{u})
(he : βˆ€ i, e i ∈ M) {a : ZFSet.{u}} (ha : a ∈ M)
(F : ZFSet.{u} β†’ ZFSet.{u}) (hF : βˆ€ x ∈ a, F x ∈ M)
(hΟ† : βˆ€ x ∈ a, βˆ€ y ∈ M, Ο†.Realize M (cons y (cons x e)) ↔ y = F x) :
βˆƒ b ∈ M, βˆ€ y, y ∈ b ↔ βˆƒ x ∈ a, F x = y := by
obtain ⟨b,hb,hbdef⟩ := hR Ο† e he a ha (fun x hx =>
⟨F x,hF x hx,(hΟ† x hx _ (hF x hx)).mpr rfl,
fun z hz h => (hΟ† x hx z hz).mp h⟩)
refine ⟨b,hb,fun y => ?_⟩
constructor
Β· intro hy
have hyM := hM b hb y hy
obtain ⟨x,hx,hxy⟩ := (hbdef y hyM).mp hy
exact ⟨x,hx,((hΟ† x hx y hyM).mp hxy).symm⟩
· rintro ⟨x,hx,rfl⟩
exact (hbdef _ (hF x hx)).mpr ⟨x,hx,(hΟ† x hx _ (hF x hx)).mpr rfl⟩
end TuringRigidity.BoundedSetTheory
end OAI