The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V32. Logic, model theory and computability

Mathlib.ModelTheory.Satisfiability

50 declarations. Mathlib docs · Source

First-Order Satisfiability

This file deals with the satisfiability of first-order theories, as well as equivalence over them.

Main Definitions

  • FirstOrder.Language.Theory.IsSatisfiable: T.IsSatisfiable indicates that T has a nonempty model.
  • FirstOrder.Language.Theory.IsFinitelySatisfiable: T.IsFinitelySatisfiable indicates that every finite subset of T is satisfiable.
  • FirstOrder.Language.Theory.IsComplete: T.IsComplete indicates that T is satisfiable and models each sentence or its negation.
  • Cardinal.Categorical: A theory is κ-categorical if all models of size κ are isomorphic.

Main Results

  • The Compactness Theorem, FirstOrder.Language.Theory.isSatisfiable_iff_isFinitelySatisfiable, shows that a theory is satisfiable iff it is finitely satisfiable.
  • FirstOrder.Language.completeTheory.isComplete: The complete theory of a structure is complete.
  • FirstOrder.Language.Theory.exists_large_model_of_infinite_model shows that any theory with an infinite model has arbitrarily large models.
  • FirstOrder.Language.Theory.exists_elementaryEmbedding_card_eq: The Upward Löwenheim–Skolem Theorem: If κ is a cardinal greater than the cardinalities of L and an infinite L-structure M, then M has an elementary extension of cardinality κ.

Implementation notes

  • Satisfiability of an L.Theory T is defined in the minimal universe containing all the symbols of L. By Löwenheim-Skolem, this is equivalent to satisfiability in any universe.

def FirstOrder.Language.Theory.IsSatisfiable E3 #

{L : FirstOrder.Language} → L.Theory → Prop

A theory is satisfiable if a structure models it.

def FirstOrder.Language.Theory.IsFinitelySatisfiable E3 #

{L : FirstOrder.Language} → L.Theory → Prop

A theory is finitely satisfiable if all of its finite subtheories are satisfiable.

theorem FirstOrder.Language.Theory.Model.isSatisfiable E1 #

∀ {L : FirstOrder.Language} {T : L.Theory} (M : Type w) [Nonempty M] [inst : L.Structure M] [M ⊨ T], T.IsSatisfiable

theorem FirstOrder.Language.Theory.IsSatisfiable.mono E1 #

∀ {L : FirstOrder.Language} {T T' : L.Theory}, T'.IsSatisfiable → T ⊆ T' → T.IsSatisfiable

theorem FirstOrder.Language.Theory.isSatisfiable_empty E1 #

∀ (L : FirstOrder.Language), ∅.IsSatisfiable

theorem FirstOrder.Language.Theory.isSatisfiable_of_isSatisfiable_onTheory E1 #

∀ {L : FirstOrder.Language} {T : L.Theory} {L' : FirstOrder.Language} (φ : L →ᴸ L'),
  (φ.onTheory T).IsSatisfiable → T.IsSatisfiable

theorem FirstOrder.Language.Theory.isSatisfiable_onTheory_iff E0 #

∀ {L : FirstOrder.Language} {T : L.Theory} {L' : FirstOrder.Language} {φ : L →ᴸ L'},
  φ.Injective → ((φ.onTheory T).IsSatisfiable ↔ T.IsSatisfiable)

theorem FirstOrder.Language.Theory.IsSatisfiable.isFinitelySatisfiable E1 #

∀ {L : FirstOrder.Language} {T : L.Theory}, T.IsSatisfiable → T.IsFinitelySatisfiable

theorem FirstOrder.Language.Theory.isSatisfiable_iff_isFinitelySatisfiable E3 #

∀ {L : FirstOrder.Language} {T : L.Theory}, T.IsSatisfiable ↔ T.IsFinitelySatisfiable

The Compactness Theorem of first-order logic: A theory is satisfiable if and only if it is finitely satisfiable.

theorem FirstOrder.Language.Theory.isSatisfiable_directed_union_iff E0 #

∀ {L : FirstOrder.Language} {ι : Type u_1} [Nonempty ι] {T : ι → L.Theory},
  Directed (fun x1 x2 ↦ x1 ⊆ x2) T →
    (FirstOrder.Language.Theory.IsSatisfiable (⋃ i, T i) ↔ ∀ (i : ι), (T i).IsSatisfiable)

theorem FirstOrder.Language.Theory.isSatisfiable_union_distinctConstantsTheory_of_card_le E1 #

∀ {L : FirstOrder.Language} {α : Type w} (T : L.Theory) (s : Set α) (M : Type w') [Nonempty M] [inst : L.Structure M]
  [M ⊨ T],
  Cardinal.lift.{w', w} (Cardinal.mk ↑s) ≤ Cardinal.lift.{w, w'} (Cardinal.mk M) →
    ((L.lhomWithConstants α).onTheory T ∪ L.distinctConstantsTheory s).IsSatisfiable

theorem FirstOrder.Language.Theory.isSatisfiable_union_distinctConstantsTheory_of_infinite E1 #

∀ {L : FirstOrder.Language} {α : Type w} (T : L.Theory) (s : Set α) (M : Type w') [inst : L.Structure M] [M ⊨ T]
  [Infinite M], ((L.lhomWithConstants α).onTheory T ∪ L.distinctConstantsTheory s).IsSatisfiable

theorem FirstOrder.Language.Theory.exists_large_model_of_infinite_model E3 #

∀ {L : FirstOrder.Language} (T : L.Theory) (κ : Cardinal.{w}) (M : Type w') [inst : L.Structure M] [M ⊨ T] [Infinite M],
  ∃ N, Cardinal.lift.{max u v w, w} κ ≤ Cardinal.mk ↑N

Any theory with an infinite model has arbitrarily large models.

theorem FirstOrder.Language.Theory.isSatisfiable_iUnion_iff_isSatisfiable_iUnion_finset E1 #

∀ {L : FirstOrder.Language} {ι : Type u_1} (T : ι → L.Theory),
  FirstOrder.Language.Theory.IsSatisfiable (⋃ i, T i) ↔
    ∀ (s : Finset ι), FirstOrder.Language.Theory.IsSatisfiable (⋃ i ∈ s, T i)

theorem FirstOrder.Language.exists_elementaryEmbedding_card_eq_of_le E2 #

∀ (L : FirstOrder.Language) (M : Type w') [inst : L.Structure M] (κ : Cardinal.{w}),
  Cardinal.aleph0 ≤ κ →
    Cardinal.lift.{w, max u v} L.card ≤ Cardinal.lift.{max u v, w} κ →
      Cardinal.lift.{w', w} κ ≤ Cardinal.lift.{w, w'} (Cardinal.mk M) →
        ∃ N, Nonempty (L.ElementaryEmbedding (↑N) M) ∧ Cardinal.mk ↑N = κ

A version of The Downward Löwenheim–Skolem theorem where the structure N elementarily embeds into M, but is not by type a substructure of M, and thus can be chosen to belong to the universe of the cardinal κ.

theorem FirstOrder.Language.exists_elementaryEmbedding_card_eq_of_ge E1 #

∀ (L : FirstOrder.Language) (M : Type w') [inst : L.Structure M] [iM : Infinite M] (κ : Cardinal.{w}),
  Cardinal.lift.{w, max u v} L.card ≤ Cardinal.lift.{max u v, w} κ →
    Cardinal.lift.{w, w'} (Cardinal.mk M) ≤ Cardinal.lift.{w', w} κ →
      ∃ N, Nonempty (L.ElementaryEmbedding M ↑N) ∧ Cardinal.mk ↑N = κ

The Upward Löwenheim–Skolem Theorem: If κ is a cardinal greater than the cardinalities of L and an infinite L-structure M, then M has an elementary extension of cardinality κ.

theorem FirstOrder.Language.exists_elementaryEmbedding_card_eq E3 #

∀ (L : FirstOrder.Language) (M : Type w') [inst : L.Structure M] [iM : Infinite M] (κ : Cardinal.{w}),
  Cardinal.aleph0 ≤ κ →
    Cardinal.lift.{w, max u v} L.card ≤ Cardinal.lift.{max u v, w} κ →
      ∃ N, (Nonempty (L.ElementaryEmbedding (↑N) M) ∨ Nonempty (L.ElementaryEmbedding M ↑N)) ∧ Cardinal.mk ↑N = κ

The Löwenheim–Skolem Theorem: If κ is a cardinal greater than the cardinalities of L and an infinite L-structure M, then there is an elementary embedding in the appropriate direction between then M and a structure of cardinality κ.

theorem FirstOrder.Language.exists_elementarilyEquivalent_card_eq E0 #

∀ (L : FirstOrder.Language) (M : Type w') [inst : L.Structure M] [Infinite M] (κ : Cardinal.{w}),
  Cardinal.aleph0 ≤ κ →
    Cardinal.lift.{w, max u v} L.card ≤ Cardinal.lift.{max u v, w} κ →
      ∃ N, L.ElementarilyEquivalent M ↑N ∧ Cardinal.mk ↑N = κ

A consequence of the Löwenheim–Skolem Theorem: If κ is a cardinal greater than the cardinalities of L and an infinite L-structure M, then there is a structure of cardinality κ elementarily equivalent to M.

theorem FirstOrder.Language.Theory.exists_model_card_eq E0 #

∀ {L : FirstOrder.Language} {T : L.Theory},
  (∃ M, Infinite ↑M) →
    ∀ (κ : Cardinal.{w}),
      Cardinal.aleph0 ≤ κ → Cardinal.lift.{w, max u v} L.card ≤ Cardinal.lift.{max u v, w} κ → ∃ N, Cardinal.mk ↑N = κ

def FirstOrder.Language.Theory.ModelsBoundedFormula E1 #

{L : FirstOrder.Language} → L.Theory → {α : Type w} → {n : ℕ} → L.BoundedFormula α n → Prop

A theory models a (bounded) formula when any of its nonempty models realizes that formula on all inputs.

def FirstOrder.Language.Theory.«term_⊨ᵇ_» E1 #

Lean.TrailingParserDescr

A theory models a (bounded) formula when any of its nonempty models realizes that formula on all inputs.

theorem FirstOrder.Language.Theory.models_formula_iff E0 #

∀ {L : FirstOrder.Language} {T : L.Theory} {α : Type w} {φ : L.Formula α},
  T ⊨ᵇ φ ↔ ∀ (M : T.ModelType) (v : α → ↑M), φ.Realize v

theorem FirstOrder.Language.Theory.models_sentence_iff E0 #

∀ {L : FirstOrder.Language} {T : L.Theory} {φ : L.Sentence}, T ⊨ᵇ φ ↔ ∀ (M : T.ModelType), ↑M ⊨ φ

theorem FirstOrder.Language.Theory.models_sentence_of_mem E1 #

∀ {L : FirstOrder.Language} {T : L.Theory} {φ : L.Sentence}, φ ∈ T → T ⊨ᵇ φ

theorem FirstOrder.Language.Theory.models_iff_not_satisfiable E1 #

∀ {L : FirstOrder.Language} {T : L.Theory} (φ : L.Sentence),
  T ⊨ᵇ φ ↔ ¬(T ∪ {FirstOrder.Language.Formula.not φ}).IsSatisfiable

theorem FirstOrder.Language.Theory.ModelsBoundedFormula.realize_sentence E1 #

∀ {L : FirstOrder.Language} {T : L.Theory} {φ : L.Sentence},
  T ⊨ᵇ φ → ∀ (M : Type u_1) [inst : L.Structure M] [M ⊨ T] [Nonempty M], M ⊨ φ

theorem FirstOrder.Language.Theory.models_formula_iff_onTheory_models_equivSentence E1 #

∀ {L : FirstOrder.Language} {T : L.Theory} {α : Type w} {φ : L.Formula α},
  T ⊨ᵇ φ ↔ (L.lhomWithConstants α).onTheory T ⊨ᵇ FirstOrder.Language.Formula.equivSentence φ

theorem FirstOrder.Language.Theory.ModelsBoundedFormula.realize_formula E1 #

∀ {L : FirstOrder.Language} {T : L.Theory} {α : Type w} {φ : L.Formula α},
  T ⊨ᵇ φ → ∀ (M : Type u_1) [inst : L.Structure M] [M ⊨ T] [Nonempty M] {v : α → M}, φ.Realize v

theorem FirstOrder.Language.Theory.models_toFormula_iff E0 #

∀ {L : FirstOrder.Language} {T : L.Theory} {α : Type w} {n : ℕ} {φ : L.BoundedFormula α n}, T ⊨ᵇ φ.toFormula ↔ T ⊨ᵇ φ

theorem FirstOrder.Language.Theory.ModelsBoundedFormula.realize_boundedFormula E1 #

∀ {L : FirstOrder.Language} {T : L.Theory} {α : Type w} {n : ℕ} {φ : L.BoundedFormula α n},
  T ⊨ᵇ φ → ∀ (M : Type u_1) [inst : L.Structure M] [M ⊨ T] [Nonempty M] {v : α → M} {xs : Fin n → M}, φ.Realize v xs

theorem FirstOrder.Language.Theory.models_of_models_theory E1 #

∀ {L : FirstOrder.Language} {T : L.Theory} {α : Type w} {T' : L.Theory},
  (∀ φ ∈ T', T ⊨ᵇ φ) → ∀ {φ : L.Formula α}, T' ⊨ᵇ φ → T ⊨ᵇ φ

theorem FirstOrder.Language.Theory.models_iff_finset_models E1 #

∀ {L : FirstOrder.Language} {T : L.Theory} {φ : L.Sentence}, T ⊨ᵇ φ ↔ ∃ T0, ↑T0 ⊆ T ∧ ↑T0 ⊨ᵇ φ

An alternative statement of the Compactness Theorem. A formula φ is modeled by a theory iff there is a finite subset T0 of the theory such that φ is modeled by T0

def FirstOrder.Language.Theory.IsComplete E3 #

{L : FirstOrder.Language} → L.Theory → Prop

A theory is complete when it is satisfiable and models each sentence or its negation.

theorem FirstOrder.Language.Theory.IsComplete.models_not_iff E0 #

∀ {L : FirstOrder.Language} {T : L.Theory},
  T.IsComplete → ∀ (φ : L.Sentence), T ⊨ᵇ FirstOrder.Language.Formula.not φ ↔ ¬T ⊨ᵇ φ

theorem FirstOrder.Language.Theory.IsComplete.realize_sentence_iff E0 #

∀ {L : FirstOrder.Language} {T : L.Theory},
  T.IsComplete → ∀ (φ : L.Sentence) (M : Type u_1) [inst : L.Structure M] [M ⊨ T] [Nonempty M], M ⊨ φ ↔ T ⊨ᵇ φ

theorem FirstOrder.Language.Theory.IsComplete.isComplete_iff_models_elementarily_equivalent E1 #

∀ {L : FirstOrder.Language} {T : L.Theory},
  T.IsComplete ↔ T.IsSatisfiable ∧ ∀ (M N : T.ModelType), L.ElementarilyEquivalent ↑M ↑N

A theory is complete iff it is satisfiable and all its models are elementarily equivalent.

theorem FirstOrder.Language.Theory.IsComplete.models_elementarily_equivalent E1 #

∀ {L : FirstOrder.Language} {T : L.Theory},
  T.IsComplete →
    ∀ (M : Type u_1) (N : Type u_2) [inst : L.Structure M] [inst_1 : L.Structure N] [M ⊨ T] [N ⊨ T] [Nonempty M]
      [Nonempty N], L.ElementarilyEquivalent M N

If a theory is complete all its models are elementarily equivalent.

def FirstOrder.Language.Theory.IsMaximal E1 #

{L : FirstOrder.Language} → L.Theory → Prop

A theory is maximal when it is satisfiable and contains each sentence or its negation. Maximal theories are complete.

theorem FirstOrder.Language.Theory.IsMaximal.isComplete E1 #

∀ {L : FirstOrder.Language} {T : L.Theory}, T.IsMaximal → T.IsComplete

theorem FirstOrder.Language.Theory.IsMaximal.mem_or_not_mem E0 #

∀ {L : FirstOrder.Language} {T : L.Theory},
  T.IsMaximal → ∀ (φ : L.Sentence), φ ∈ T ∨ FirstOrder.Language.Formula.not φ ∈ T

theorem FirstOrder.Language.Theory.IsMaximal.mem_of_models E0 #

∀ {L : FirstOrder.Language} {T : L.Theory}, T.IsMaximal → ∀ {φ : L.Sentence}, T ⊨ᵇ φ → φ ∈ T

theorem FirstOrder.Language.Theory.IsMaximal.mem_iff_models E0 #

∀ {L : FirstOrder.Language} {T : L.Theory}, T.IsMaximal → ∀ (φ : L.Sentence), φ ∈ T ↔ T ⊨ᵇ φ

theorem FirstOrder.Language.completeTheory.isSatisfiable E1 #

∀ (L : FirstOrder.Language) (M : Type w) [inst : L.Structure M] [Nonempty M], (L.completeTheory M).IsSatisfiable

theorem FirstOrder.Language.completeTheory.mem_or_not_mem E0 #

∀ (L : FirstOrder.Language) (M : Type w) [inst : L.Structure M] (φ : L.Sentence),
  φ ∈ L.completeTheory M ∨ FirstOrder.Language.Formula.not φ ∈ L.completeTheory M

theorem FirstOrder.Language.completeTheory.isMaximal E1 #

∀ (L : FirstOrder.Language) (M : Type w) [inst : L.Structure M] [Nonempty M], (L.completeTheory M).IsMaximal

theorem FirstOrder.Language.completeTheory.isComplete E3 #

∀ (L : FirstOrder.Language) (M : Type w) [inst : L.Structure M] [Nonempty M], (L.completeTheory M).IsComplete

def Cardinal.Categorical E3 #

{L : FirstOrder.Language} → Cardinal.{w} → L.Theory → Prop

A theory is κ-categorical if all models of size κ are isomorphic.

theorem Cardinal.Categorical.isComplete E1 #

∀ {L : FirstOrder.Language} (κ : Cardinal.{w}) (T : L.Theory),
  κ.Categorical T →
    Cardinal.aleph0 ≤ κ →
      Cardinal.lift.{w, max u v} L.card ≤ Cardinal.lift.{max u v, w} κ →
        T.IsSatisfiable → (∀ (M : T.ModelType), Infinite ↑M) → T.IsComplete

The Łoś–Vaught Test : a criterion for categorical theories to be complete.

theorem Cardinal.empty_theory_categorical E1 #

∀ (κ : Cardinal.{w}) (T : FirstOrder.Language.empty.Theory), κ.Categorical T

theorem Cardinal.empty_infinite_Theory_isComplete E1 #

FirstOrder.Language.empty.infiniteTheory.IsComplete