Theory of first-order arithmetic #
This file formalizes Peano arithmetic and Robinson's Q, two first-order theories of arithmetic. The
goal is to prove Gödel's first incompleteness theorem under Q and second incompleteness theorem
under PA.
The language of first-order arithmetic.
Equations
- FirstOrder.Language.peano = { Func := FirstOrder.Language.peanoFunc, Rel := fun (x : ℕ) => Empty }
Instances For
Instances For
Equations
- FirstOrder.Language.peano.termS = Lean.ParserDescr.node `FirstOrder.Language.peano.termS 1024 (Lean.ParserDescr.symbol "S")
Instances For
Equations
Equations
Equations
- FirstOrder.Language.peano.instAddTerm = { add := fun (x1 x2 : FirstOrder.Language.peano.Term n) => FirstOrder.Language.peanoFunc.add ⬝ᶠ [x1, x2]ᵥ }
Equations
- FirstOrder.Language.peano.instMulTerm = { mul := fun (x1 x2 : FirstOrder.Language.peano.Term n) => FirstOrder.Language.peanoFunc.mul ⬝ᶠ [x1, x2]ᵥ }
Equations
Instances For
Equations
Equations
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Robinson's Q.
- ax_succ_ne_zero : Q (∀' (~ peano.succ #0 ≐ 0))
- ax_succ_inj : Q (∀' ∀' (peano.succ #1 ≐ peano.succ #0 ⇒ #1 ≐ #0))
- ax_add_zero : Q (∀' (#0 + 0 ≐ #0))
- ax_add_succ : Q (∀' ∀' (#1 + peano.succ #0 ≐ peano.succ (#1 + #0)))
- ax_mul_zero : Q (∀' (#0 * 0 ≐ 0))
- ax_mul_succ : Q (∀' ∀' (#1 * peano.succ #0 ≐ #1 * #0 + #1))
- ax_zero_or_succ : Q (∀' (#0 ≐ 0 ⩒ ∃' (#1 ≐ peano.succ #0)))
Instances For
theorem
FirstOrder.Language.Theory.Q.succ_inj
{n : ℕ}
{t₁ t₂ : peano.Term n}
:
↑ᵀ^[n] Q ⊢ peano.succ t₁ ≐ peano.succ t₂ ⇒ t₁ ≐ t₂
theorem
FirstOrder.Language.Theory.Q.add_succ
{n : ℕ}
(t₁ t₂ : peano.Term n)
:
↑ᵀ^[n] Q ⊢ t₁ + peano.succ t₂ ≐ peano.succ (t₁ + t₂)
theorem
FirstOrder.Language.Theory.Q.succ_inj_iff
{n : ℕ}
{t₁ t₂ : peano.Term n}
:
↑ᵀ^[n] Q ⊢ peano.succ t₁ ≐ peano.succ t₂ ⇔ t₁ ≐ t₂
theorem
FirstOrder.Language.Theory.Q.succ_le_succ_iff
{n : ℕ}
{t₁ t₂ : peano.Term n}
:
↑ᵀ^[n] Q ⊢ peano.succ t₁ ⪯ peano.succ t₂ ⇔ t₁ ⪯ t₂
theorem
FirstOrder.Language.Theory.Q.succ_lt_succ_iff
{n : ℕ}
{t₁ t₂ : peano.Term n}
:
↑ᵀ^[n] Q ⊢ peano.succ t₁ ≺ peano.succ t₂ ⇔ t₁ ≺ t₂
theorem
FirstOrder.Language.Theory.Q.zero_lt_succ
{n : ℕ}
{t : peano.Term n}
:
↑ᵀ^[n] Q ⊢ 0 ≺ peano.succ t
theorem
FirstOrder.Language.Theory.Q.add_ofNat
{n a b : ℕ}
:
↑ᵀ^[n] Q ⊢ peano.ofNat a + peano.ofNat b ≐ peano.ofNat (a + b)
theorem
FirstOrder.Language.Theory.Q.mul_ofNat
{n a b : ℕ}
:
↑ᵀ^[n] Q ⊢ peano.ofNat a * peano.ofNat b ≐ peano.ofNat (a * b)
theorem
FirstOrder.Language.Theory.Q.ne_ofNat
{n a b : ℕ}
(h : a ≠ b)
:
↑ᵀ^[n] Q ⊢ ~ peano.ofNat a ≐ peano.ofNat b
theorem
FirstOrder.Language.Theory.Q.le_ofNat
{n a b : ℕ}
(h : a ≤ b)
:
↑ᵀ^[n] Q ⊢ peano.ofNat a ⪯ peano.ofNat b
theorem
FirstOrder.Language.Theory.Q.lt_ofNat
{n a b : ℕ}
(h : a < b)
:
↑ᵀ^[n] Q ⊢ peano.ofNat a ≺ peano.ofNat b
theorem
FirstOrder.Language.Theory.Q.not_le_ofNat
{n a b : ℕ}
(h : b < a)
:
↑ᵀ^[n] Q ⊢ ~ peano.ofNat a ⪯ peano.ofNat b
theorem
FirstOrder.Language.Theory.Q.not_lt_ofNat
{n a b : ℕ}
(h : b ≤ a)
:
↑ᵀ^[n] Q ⊢ ~ peano.ofNat a ≺ peano.ofNat b
theorem
FirstOrder.Language.Theory.Q.lt_or_ge_ofNat
{n : ℕ}
(t : peano.Term n)
(a : ℕ)
:
↑ᵀ^[n] Q ⊢ t ≺ peano.ofNat a ⩒ peano.ofNat a ⪯ t
theorem
FirstOrder.Language.Theory.Q.le_or_gt_ofNat
{n : ℕ}
(t : peano.Term n)
(a : ℕ)
:
↑ᵀ^[n] Q ⊢ t ⪯ peano.ofNat a ⩒ peano.ofNat a ≺ t
theorem
FirstOrder.Language.Theory.Q.not_lt_ofNat_iff
{n : ℕ}
{t : peano.Term n}
{a : ℕ}
:
↑ᵀ^[n] Q ⊢ ~ t ≺ peano.ofNat a ⇔ peano.ofNat a ⪯ t
theorem
FirstOrder.Language.Theory.Q.not_le_ofNat_iff
{n : ℕ}
{t : peano.Term n}
{a : ℕ}
:
↑ᵀ^[n] Q ⊢ ~ t ⪯ peano.ofNat a ⇔ peano.ofNat a ≺ t
theorem
FirstOrder.Language.Theory.Q.ne_ofNat_iff
{n : ℕ}
{t : peano.Term n}
{a : ℕ}
:
↑ᵀ^[n] Q ⊢ ~ t ≐ peano.ofNat a ⇔ t ≺ peano.ofNat a ⩒ peano.ofNat a ≺ t
theorem
FirstOrder.Language.Theory.Q.not_ge_ofNat_iff
{n : ℕ}
{t : peano.Term n}
{a : ℕ}
:
↑ᵀ^[n] Q ⊢ ~ peano.ofNat a ⪯ t ⇔ t ≺ peano.ofNat a
theorem
FirstOrder.Language.Theory.Q.not_gt_ofNat_iff
{n : ℕ}
{t : peano.Term n}
{a : ℕ}
:
↑ᵀ^[n] Q ⊢ ~ peano.ofNat a ≺ t ⇔ t ⪯ peano.ofNat a
Peano arithmetic.
- ax_succ_ne_zero : PA (∀' (~ peano.succ #0 ≐ 0))
- ax_succ_inj : PA (∀' ∀' (peano.succ #1 ≐ peano.succ #0 ⇒ #1 ≐ #0))
- ax_add_zero : PA (∀' (#0 + 0 ≐ #0))
- ax_add_succ : PA (∀' ∀' (#1 + peano.succ #0 ≐ peano.succ (#1 + #0)))
- ax_mul_zero : PA (∀' (#0 * 0 ≐ 0))
- ax_mul_succ : PA (∀' ∀' (#1 * peano.succ #0 ≐ #1 * #0 + #1))
- ax_ind {n : ℕ} {p : peano.Formula (n + 1)} : PA (∀* (p[↦ₛ 0]ₚ ⇒ ∀' (p ⇒ p[≔ₛ peano.succ #0]ₚ) ⇒ ∀' p))
Instances For
theorem
FirstOrder.Language.Theory.PA.succ_add
{n : ℕ}
(t₁ t₂ : peano.Term n)
:
↑ᵀ^[n] PA ⊢ peano.succ t₁ + t₂ ≐ peano.succ (t₁ + t₂)
theorem
FirstOrder.Language.Theory.PA.lt_succ_self
{n : ℕ}
{t : peano.Term n}
:
↑ᵀ^[n] PA ⊢ t ≺ peano.succ t
theorem
FirstOrder.Language.Theory.PA.le_succ_self
{n : ℕ}
{t : peano.Term n}
:
↑ᵀ^[n] PA ⊢ t ⪯ peano.succ t