Skip to content

Commit

Permalink
chore(FirstOrder): rename to 𝐄𝐐
Browse files Browse the repository at this point in the history
  • Loading branch information
iehality committed Apr 4, 2024
1 parent d7ee5af commit 00a81cf
Show file tree
Hide file tree
Showing 13 changed files with 33 additions and 34 deletions.
2 changes: 1 addition & 1 deletion Logic/FirstOrder/Arith/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ lemma consistent_of_sound [SoundOn T F] (hF : F βŠ₯) : System.Consistent T :=

end

variable {L : Language} [L.ORing] (T : Theory L) [𝐄πͺ β‰Ύ T]
variable {L : Language} [L.ORing] (T : Theory L) [𝐄𝐐 β‰Ύ T]

lemma consequence_of (Οƒ : Sentence L)
(H : βˆ€ (M : Type u)
Expand Down
2 changes: 1 addition & 1 deletion Logic/FirstOrder/Arith/EA/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace LO.FirstOrder

namespace Arith

variable {L : Language} [L.ORing] (T : Theory L) [𝐄πͺ β‰Ύ T] [L.Exp]
variable {L : Language} [L.ORing] (T : Theory L) [𝐄𝐐 β‰Ύ T] [L.Exp]

instance : Language.ORing β„’β‚’α΅£(exp) := Language.ORing.mk

Expand Down
2 changes: 1 addition & 1 deletion Logic/FirstOrder/Arith/Model.lean
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ abbrev Theory.trueArith : Theory β„’β‚’α΅£ := Structure.theory β„’β‚’α΅£ β„•

notation "𝐓𝐀" => Theory.trueArith

variable (T : Theory β„’β‚’α΅£) [𝐄πͺ β‰Ύ T]
variable (T : Theory β„’β‚’α΅£) [𝐄𝐐 β‰Ύ T]

lemma oRing_consequence_of (Οƒ : Sentence β„’β‚’α΅£)
(H : βˆ€ (M : Type)
Expand Down
4 changes: 2 additions & 2 deletions Logic/FirstOrder/Arith/Nonstandard.lean
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ local notation "ℒₒᡣ⋆" => withStar
def starUnbounded (c : β„•) : Theory ℒₒᡣ⋆ := Set.range fun n : Fin c ↦ β€œ!!(Semiterm.Operator.numeral ℒₒᡣ⋆ n) < ⋆”

def trueArithWithStarUnbounded (n : β„•) : Theory ℒₒᡣ⋆ :=
𝐄πͺ βˆͺ (Semiformula.lMap (Language.Hom.add₁ _ _) '' 𝐓𝐀) βˆͺ starUnbounded n
𝐄𝐐 βˆͺ (Semiformula.lMap (Language.Hom.add₁ _ _) '' 𝐓𝐀) βˆͺ starUnbounded n

lemma trueArithWithStarUnbounded.cumulative : Cumulative trueArithWithStarUnbounded := fun c =>
Set.union_subset_union_right _ <|
Expand Down Expand Up @@ -42,7 +42,7 @@ lemma satisfiable_union_trueArithWithStarUnbounded :
(Compact.compact_cumulative trueArithWithStarUnbounded.cumulative).mpr
satisfiable_trueArithWithStarUnbounded

instance trueArithWithStarUnbounded.eqTheory : 𝐄πͺ β‰Ύ (⋃ c, trueArithWithStarUnbounded c) :=
instance trueArithWithStarUnbounded.eqTheory : 𝐄𝐐 β‰Ύ (⋃ c, trueArithWithStarUnbounded c) :=
System.Subtheory.ofSubset <|
Set.subset_iUnion_of_subset 0 (Set.subset_union_of_subset_left (Set.subset_union_left _ _) _)

Expand Down
2 changes: 1 addition & 1 deletion Logic/FirstOrder/Arith/PeanoMinus.lean
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ lemma pval_of_pval_nat_of_sigma_one : βˆ€ {n} {Οƒ : Semisentence β„’β‚’α΅£ n},

end Model

variable {T : Theory β„’β‚’α΅£} [𝐄πͺ β‰Ύ T] [𝐏𝐀⁻ β‰Ύ T]
variable {T : Theory β„’β‚’α΅£} [𝐄𝐐 β‰Ύ T] [𝐏𝐀⁻ β‰Ύ T]

theorem sigma_one_completeness {σ : Sentence ℒₒᡣ} (hσ : Hierarchy Σ 1 σ) :
β„• βŠ§β‚˜ Οƒ β†’ T ⊒ Οƒ := fun H =>
Expand Down
2 changes: 1 addition & 1 deletion Logic/FirstOrder/Arith/Representation.lean
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ lemma codeOfPartrec_spec {k} {f : Vector β„• k β†’. β„•} (hf : Nat.Partrec' f) {
exact ⟨c, models_code hc⟩
exact Classical.epsilon_spec this y v

variable {T : Theory β„’β‚’α΅£} [𝐄πͺ β‰Ύ T] [𝐏𝐀⁻ β‰Ύ T] [DecidablePred T] [SigmaOneSound T] [Theory.Computable T]
variable {T : Theory β„’β‚’α΅£} [𝐄𝐐 β‰Ύ T] [𝐏𝐀⁻ β‰Ύ T] [DecidablePred T] [SigmaOneSound T] [Theory.Computable T]

section representation

Expand Down
30 changes: 14 additions & 16 deletions Logic/FirstOrder/Basic/Eq.lean
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ inductive eqAxiom : Theory L
| relExt {k} (r : L.Rel k) :
eqAxiom β€œβˆ€* (!(Semiformula.vecEq varSumInL varSumInR) β†’ !(Semiformula.rel r varSumInL) β†’ !(Semiformula.rel r varSumInR))”

notation "𝐄πͺ" => eqAxiom
notation "𝐄𝐐" => eqAxiom

end Eq

Expand All @@ -60,9 +60,7 @@ namespace Structure

namespace Eq



@[simp] lemma models_eqAxiom {M : Type u} [Nonempty M] [Structure L M] [Structure.Eq L M] : M βŠ§β‚˜* (𝐄πͺ : Theory L) := ⟨by
@[simp] lemma models_eqAxiom {M : Type u} [Nonempty M] [Structure L M] [Structure.Eq L M] : M βŠ§β‚˜* (𝐄𝐐 : Theory L) := ⟨by
intro Οƒ h
cases h <;> simp[models_def, Semiformula.vecEq, Semiterm.val_func]
Β· intro e h; congr; funext i; exact h i
Expand All @@ -71,15 +69,15 @@ namespace Eq

variable (L)

instance models_eqAxiom' (M : Type u) [Nonempty M] [Structure L M] [Structure.Eq L M] : M βŠ§β‚˜* (𝐄πͺ : Theory L) := Structure.Eq.models_eqAxiom
instance models_eqAxiom' (M : Type u) [Nonempty M] [Structure L M] [Structure.Eq L M] : M βŠ§β‚˜* (𝐄𝐐 : Theory L) := Structure.Eq.models_eqAxiom

variable {M : Type u} [Nonempty M] [Structure L M]

def eqv (a b : M) : Prop := (@Semiformula.Operator.Eq.eq L _).val ![a, b]

variable {L}

variable (H : M βŠ§β‚˜* (𝐄πͺ : Theory L))
variable (H : M βŠ§β‚˜* (𝐄𝐐 : Theory L))

open Semiterm Theory Semiformula

Expand Down Expand Up @@ -123,7 +121,7 @@ lemma eqv_equivalence : Equivalence (eqv L (M := M)) where
symm := eqv_symm H
trans := eqv_trans H

def eqvSetoid (H : M βŠ§β‚˜* (𝐄πͺ : Theory L)) : Setoid M := Setoid.mk (eqv L) (eqv_equivalence H)
def eqvSetoid (H : M βŠ§β‚˜* (𝐄𝐐 : Theory L)) : Setoid M := Setoid.mk (eqv L) (eqv_equivalence H)

def QuotEq := Quotient (eqvSetoid H)

Expand Down Expand Up @@ -195,41 +193,41 @@ end Eq

end Structure

lemma consequence_iff_eq {T : Theory L} [𝐄πͺ β‰Ύ T] {Οƒ : Sentence L} :
lemma consequence_iff_eq {T : Theory L} [𝐄𝐐 β‰Ύ T] {Οƒ : Sentence L} :
T ⊨ Οƒ ↔ (βˆ€ (M : Type u) [Nonempty M] [Structure L M] [Structure.Eq L M], M βŠ§β‚˜* T β†’ M βŠ§β‚˜ Οƒ) := by
simp[consequence_iff]; constructor
Β· intro h M x s _ hM; exact h M x hM
Β· intro h M x s hM
haveI : Nonempty M := ⟨x⟩
have H : M βŠ§β‚˜* (𝐄πͺ : Theory L) := Sound.modelsTheory_of_subtheory hM
have H : M βŠ§β‚˜* (𝐄𝐐 : Theory L) := Sound.modelsTheory_of_subtheory hM
have e : Structure.Eq.QuotEq H ≑ₑ[L] M := Structure.Eq.QuotEq.elementaryEquiv H
exact e.models.mp $ h (Structure.Eq.QuotEq H) ⟦x⟧ (e.modelsTheory.mpr hM)

lemma consequence_iff_eq' {T : Theory L} [𝐄πͺ β‰Ύ T] {Οƒ : Sentence L} :
lemma consequence_iff_eq' {T : Theory L} [𝐄𝐐 β‰Ύ T] {Οƒ : Sentence L} :
T ⊨ Οƒ ↔ (βˆ€ (M : Type u) [Nonempty M] [Structure L M] [Structure.Eq L M] [M βŠ§β‚˜* T], M βŠ§β‚˜ Οƒ) := by
rw [consequence_iff_eq]

lemma consequence_iff_add_eq {T : Theory L} {Οƒ : Sentence L} :
T + 𝐄πͺ ⊨ Οƒ ↔ (βˆ€ (M : Type u) [Nonempty M] [Structure L M] [Structure.Eq L M], M βŠ§β‚˜* T β†’ M βŠ§β‚˜ Οƒ) :=
T + 𝐄𝐐 ⊨ Οƒ ↔ (βˆ€ (M : Type u) [Nonempty M] [Structure L M] [Structure.Eq L M], M βŠ§β‚˜* T β†’ M βŠ§β‚˜ Οƒ) :=
Iff.trans consequence_iff_eq (forallβ‚„_congr <| fun M _ _ _ ↦ by simp)

lemma satisfiableTheory_iff_eq {T : Theory L} [𝐄πͺ β‰Ύ T] :
lemma satisfiableTheory_iff_eq {T : Theory L} [𝐄𝐐 β‰Ύ T] :
Semantics.SatisfiableTheory T ↔ (βˆƒ (M : Type u) (_ : Nonempty M) (_ : Structure L M) (_ : Structure.Eq L M), M βŠ§β‚˜* T) := by
simp[satisfiableTheory_iff]; constructor
· intro ⟨M, x, s, hM⟩;
haveI : Nonempty M := ⟨x⟩
have H : M βŠ§β‚˜* (𝐄πͺ : Theory L) := Sound.modelsTheory_of_subtheory hM
have H : M βŠ§β‚˜* (𝐄𝐐 : Theory L) := Sound.modelsTheory_of_subtheory hM
have e : Structure.Eq.QuotEq H ≑ₑ[L] M := Structure.Eq.QuotEq.elementaryEquiv H
exact ⟨Structure.Eq.QuotEq H, ⟦x⟧, inferInstance, inferInstance, e.modelsTheory.mpr hM⟩
· intro ⟨M, i, s, _, hM⟩; exact ⟨M, i, s, hM⟩

def ModelOfSatEq {T : Theory L} [𝐄πͺ β‰Ύ T] (sat : Semantics.SatisfiableTheory T) : Type _ :=
have H : ModelOfSat sat βŠ§β‚˜* (𝐄πͺ : Theory L) := Sound.modelsTheory_of_subtheory (ModelOfSat.models sat)
def ModelOfSatEq {T : Theory L} [𝐄𝐐 β‰Ύ T] (sat : Semantics.SatisfiableTheory T) : Type _ :=
have H : ModelOfSat sat βŠ§β‚˜* (𝐄𝐐 : Theory L) := Sound.modelsTheory_of_subtheory (ModelOfSat.models sat)
Structure.Eq.QuotEq H

namespace ModelOfSatEq

variable {T : Theory L} [𝐄πͺ β‰Ύ T] (sat : Semantics.SatisfiableTheory T)
variable {T : Theory L} [𝐄𝐐 β‰Ύ T] (sat : Semantics.SatisfiableTheory T)

noncomputable instance : Nonempty (ModelOfSatEq sat) := Structure.Eq.QuotEq.inhabited _

Expand Down
4 changes: 2 additions & 2 deletions Logic/FirstOrder/Incompleteness/FirstIncompleteness.lean
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace Arith

namespace FirstIncompleteness

variable {T : Theory β„’β‚’α΅£} [𝐄πͺ β‰Ύ T] [𝐏𝐀⁻ β‰Ύ T] [DecidablePred T] [SigmaOneSound T] [Theory.Computable T]
variable {T : Theory β„’β‚’α΅£} [𝐄𝐐 β‰Ύ T] [𝐏𝐀⁻ β‰Ύ T] [DecidablePred T] [SigmaOneSound T] [Theory.Computable T]

variable (T)

Expand Down Expand Up @@ -65,7 +65,7 @@ theorem main : Β¬System.Complete T := System.incomplete_iff_exists_independent.m

end FirstIncompleteness

variable (T : Theory β„’β‚’α΅£) [DecidablePred T] [𝐄πͺ β‰Ύ T] [𝐏𝐀⁻ β‰Ύ T] [SigmaOneSound T] [Theory.Computable T]
variable (T : Theory β„’β‚’α΅£) [DecidablePred T] [𝐄𝐐 β‰Ύ T] [𝐏𝐀⁻ β‰Ύ T] [SigmaOneSound T] [Theory.Computable T]
open FirstIncompleteness

/- GΓΆdel's First incompleteness theorem -/
Expand Down
4 changes: 2 additions & 2 deletions Logic/FirstOrder/Incompleteness/SelfReference.lean
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace Arith

namespace SelfReference

variable {T : Theory β„’β‚’α΅£} [𝐄πͺ β‰Ύ T] [𝐏𝐀⁻ β‰Ύ T] [SigmaOneSound T]
variable {T : Theory β„’β‚’α΅£} [𝐄𝐐 β‰Ύ T] [𝐏𝐀⁻ β‰Ύ T] [SigmaOneSound T]

open Encodable Semiformula

Expand Down Expand Up @@ -65,7 +65,7 @@ end SelfReference

namespace FirstIncompletenessBySelfReference

variable {T : Theory β„’β‚’α΅£} [𝐄πͺ β‰Ύ T] [𝐏𝐀⁻ β‰Ύ T] [SigmaOneSound T]
variable {T : Theory β„’β‚’α΅£} [𝐄𝐐 β‰Ύ T] [𝐏𝐀⁻ β‰Ύ T] [SigmaOneSound T]

section ProvableSentence

Expand Down
4 changes: 2 additions & 2 deletions Logic/FirstOrder/Interpretation.lean
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ structure Interpretation {L : Language} [L.Eq] (T : Theory L) (L' : Language) wh
rel {k} : L'.Rel k β†’ Semisentence L k
func {k} : L'.Func k β†’ Semisentence L (k + 1)
domain_nonempty :
T + 𝐄πͺ ⊨ βˆƒ' domain
T + 𝐄𝐐 ⊨ βˆƒ' domain
func_defined {k} (f : L'.Func k) :
T + 𝐄πͺ ⊨ βˆ€* ((Matrix.conj fun i ↦ domain/[#i]) ⟢ βˆƒ'! (domain/[#0] ⋏ func f))
T + 𝐄𝐐 ⊨ βˆ€* ((Matrix.conj fun i ↦ domain/[#i]) ⟢ βˆƒ'! (domain/[#0] ⋏ func f))

namespace Interpretation

Expand Down
2 changes: 1 addition & 1 deletion Logic/FirstOrder/Order/Le.lean
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ end
end Semiformula

namespace Order
variable {T : Theory L} [𝐄πͺ β‰Ύ T]
variable {T : Theory L} [𝐄𝐐 β‰Ύ T]

noncomputable def leIffEqOrLt : T ⊒ β€œβˆ€ βˆ€ (#0 ≀ #1 ↔ #0 = #1 ∨ #0 < #1)” :=
Complete.complete
Expand Down
2 changes: 1 addition & 1 deletion Logic/Summary.lean
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ noncomputable example {Οƒ : Sentence L} : T ⊨ Οƒ β†’ T ⊒ Οƒ := FirstOrder.co
open Arith FirstIncompleteness

variable (T : Theory β„’β‚’α΅£) [DecidablePred T]
[𝐄πͺ β‰Ύ T] [𝐏𝐀⁻ β‰Ύ T] [SigmaOneSound T] [Theory.Computable T]
[𝐄𝐐 β‰Ύ T] [𝐏𝐀⁻ β‰Ύ T] [SigmaOneSound T] [Theory.Computable T]

/-- GΓΆdel's first incompleteness theorem -/
example : Β¬System.Complete T :=
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ The key results are summarised in `Logic/Summary.lean`.
| :----: | ---- | ---- | :----: |
| $(\rm Cut)\vdash_\mathrm{T} \Gamma$ | Derivation in Tait-Calculus + Cut | [LO.FirstOrder.Derivation](https://iehality.github.io/lean4-logic/Logic/FirstOrder/Basic/Calculus.html#LO.FirstOrder.Derivation) | `⊒¹ Ξ“` |
| $M \models \sigma$ | Tarski's truth definition condition | [LO.FirstOrder.Models](https://iehality.github.io/lean4-logic/Logic/FirstOrder/Basic/Semantics/Semantics.html#LO.FirstOrder.Models) | `M βŠ§β‚˜ Οƒ` |
| $\mathbf{Eq}$ | Axiom of equality | [LO.FirstOrder.Theory.Eq](https://iehality.github.io/lean4-logic/Logic/FirstOrder/Basic/Eq.html#LO.FirstOrder.Theory.Eq) | `𝐄πͺ` |
| $T \triangleright U$ | Theory interpretation | [LO.FirstOrder.TheoryInterpretation](https://iehality.github.io/lean4-logic/Logic/FirstOrder/Interpretation.html#LO.FirstOrder.TheoryInterpretation) | `T ⊳ U` |
| $\mathbf{EQ}$ | Axiom of equality | [LO.FirstOrder.Theory.eqAxiom](https://iehality.github.io/lean4-logic/Logic/FirstOrder/Basic/Eq.html#LO.FirstOrder.Theory.eqAxiom) | `𝐄𝐐` |
| $\mathbf{PA^-}$ | Finitely axiomatized fragment of $\mathbf{PA}$ | [LO.FirstOrder.Arith.Theory.peanoMinus](https://iehality.github.io/lean4-logic/Logic/FirstOrder/Arith/Theory.html#LO.FirstOrder.Arith.Theory.peanoMinus) | `𝐏𝐀⁻` |
| $\mathbf{I}_\mathrm{open}$ | Induction of open formula | [LO.FirstOrder.Arith.Theory.iOpen](https://iehality.github.io/lean4-logic/Logic/FirstOrder/Arith/Theory.html#LO.FirstOrder.Arith.Theory.iOpen) | `𝐈open` |
| $\mathbf{I\Sigma}_n$ | Induction of $\Sigma_n$ formula | [LO.FirstOrder.Arith.Theory.iSigma](https://iehality.github.io/lean4-logic/Logic/FirstOrder/Arith/Theory.html#LO.FirstOrder.Arith.Theory.iSigma) | `𝐈𝚺` |
Expand Down Expand Up @@ -168,7 +169,7 @@ The key results are summarised in `Logic/Summary.lean`.
theorem LO.FirstOrder.Arith.first_incompleteness
(T : LO.FirstOrder.Theory β„’β‚’α΅£)
[DecidablePred T]
[𝐄πͺ β‰Ύ T]
[𝐄𝐐 β‰Ύ T]
[𝐏𝐀⁻ β‰Ύ T]
[LO.FirstOrder.Arith.SigmaOneSound T]
[LO.FirstOrder.Theory.Computable T] :
Expand All @@ -179,7 +180,7 @@ The key results are summarised in `Logic/Summary.lean`.
theorem LO.FirstOrder.Arith.undecidable
(T : LO.FirstOrder.Theory β„’β‚’α΅£)
[DecidablePred T]
[𝐄πͺ β‰Ύ T]
[𝐄𝐐 β‰Ύ T]
[𝐏𝐀⁻ β‰Ύ T]
[LO.FirstOrder.Arith.SigmaOneSound T]
[LO.FirstOrder.Theory.Computable T] :
Expand Down

0 comments on commit 00a81cf

Please sign in to comment.