Documentation

Mathlib.ModelTheory.Complexity

Quantifier Complexity #

This file defines quantifier complexity of first-order formulas, and constructs prenex normal forms.

Main Definitions #

Main Results #

An atomic formula is either equality or a relation symbol applied to terms. Note that ⊥ and ⊤ are not considered atomic in this convention.

Instances For
    theorem FirstOrder.Language.BoundedFormula.IsAtomic.relabel {L : Language} {α : Type u'} {β : Type v'} {n m : ℕ} {φ : L.BoundedFormula α m} (h : φ.IsAtomic) (f : α → β ⊕ Fin n) :
    inductive FirstOrder.Language.BoundedFormula.IsQF {L : Language} {α : Type u'} {n : ℕ} :
    L.BoundedFormula α n → Prop

    A quantifier-free formula is a formula defined without quantifiers. These are all equivalent to Boolean combinations of atomic formulas.

    Instances For
      theorem FirstOrder.Language.BoundedFormula.IsQF.not {L : Language} {α : Type u'} {n : ℕ} {φ : L.BoundedFormula α n} (h : φ.IsQF) :
      theorem FirstOrder.Language.BoundedFormula.IsQF.sup {L : Language} {α : Type u'} {n : ℕ} {φ ψ : L.BoundedFormula α n} (hφ : φ.IsQF) (hψ : ψ.IsQF) :
      (φ ⊔ ψ).IsQF
      theorem FirstOrder.Language.BoundedFormula.IsQF.inf {L : Language} {α : Type u'} {n : ℕ} {φ ψ : L.BoundedFormula α n} (hφ : φ.IsQF) (hψ : ψ.IsQF) :
      (φ ⊓ ψ).IsQF
      theorem FirstOrder.Language.BoundedFormula.IsQF.relabel {L : Language} {α : Type u'} {β : Type v'} {n m : ℕ} {φ : L.BoundedFormula α m} (h : φ.IsQF) (f : α → β ⊕ Fin n) :
      (relabel f φ).IsQF
      theorem FirstOrder.Language.BoundedFormula.IsQF.liftAt {L : Language} {α : Type u'} {l : ℕ} {φ : L.BoundedFormula α l} {k m : ℕ} (h : φ.IsQF) :
      (liftAt k m φ).IsQF
      theorem FirstOrder.Language.BoundedFormula.IsQF.castLE {L : Language} {α : Type u'} {n l : ℕ} {φ : L.BoundedFormula α l} {h : l ≤ n} (hφ : φ.IsQF) :
      (castLE h φ).IsQF

      Indicates that a bounded formula is in prenex normal form - that is, it consists of quantifiers applied to a quantifier-free formula.

      Instances For
        theorem FirstOrder.Language.BoundedFormula.IsPrenex.induction_on_all_not {L : Language} {α : Type u'} {n : ℕ} {P : {n : ℕ} → L.BoundedFormula α n → Prop} {φ : L.BoundedFormula α n} (h : φ.IsPrenex) (hq : ∀ {m : ℕ} {ψ : L.BoundedFormula α m}, ψ.IsQF → P ψ) (ha : ∀ {m : ℕ} {ψ : L.BoundedFormula α (m + 1)}, P ψ → P ψ.all) (hn : ∀ {m : ℕ} {ψ : L.BoundedFormula α m}, P ψ → P ψ.not) :
        P φ
        theorem FirstOrder.Language.BoundedFormula.IsPrenex.relabel {L : Language} {α : Type u'} {β : Type v'} {n m : ℕ} {φ : L.BoundedFormula α m} (h : φ.IsPrenex) (f : α → β ⊕ Fin n) :
        theorem FirstOrder.Language.BoundedFormula.IsPrenex.castLE {L : Language} {α : Type u'} {l : ℕ} {φ : L.BoundedFormula α l} (hφ : φ.IsPrenex) {n : ℕ} {h : l ≤ n} :

        An auxiliary operation to FirstOrder.Language.BoundedFormula.toPrenex. If φ is quantifier-free and ψ is in prenex normal form, then φ.toPrenexImpRight ψ is a prenex normal form for φ.imp ψ.

        Equations
        Instances For

          An auxiliary operation to FirstOrder.Language.BoundedFormula.toPrenex. If φ and ψ are in prenex normal form, then φ.toPrenexImp ψ is a prenex normal form for φ.imp ψ.

          Equations
          Instances For
            theorem FirstOrder.Language.BoundedFormula.isPrenex_toPrenexImp {L : Language} {α : Type u'} {n : ℕ} {φ ψ : L.BoundedFormula α n} (hφ : φ.IsPrenex) (hψ : ψ.IsPrenex) :

            For any bounded formula φ, φ.toPrenex is a semantically-equivalent formula in prenex normal form.

            Equations
            Instances For
              theorem FirstOrder.Language.BoundedFormula.realize_toPrenexImpRight {L : Language} {M : Type w} [L.Structure M] {α : Type u'} {n : ℕ} [Nonempty M] {φ ψ : L.BoundedFormula α n} (hφ : φ.IsQF) (hψ : ψ.IsPrenex) {v : α → M} {xs : Fin n → M} :
              (φ.toPrenexImpRight ψ).Realize v xs ↔ (φ.imp ψ).Realize v xs
              theorem FirstOrder.Language.BoundedFormula.realize_toPrenexImp {L : Language} {M : Type w} [L.Structure M] {α : Type u'} {n : ℕ} [Nonempty M] {φ ψ : L.BoundedFormula α n} (hφ : φ.IsPrenex) (hψ : ψ.IsPrenex) {v : α → M} {xs : Fin n → M} :
              (φ.toPrenexImp ψ).Realize v xs ↔ (φ.imp ψ).Realize v xs
              @[simp]
              theorem FirstOrder.Language.BoundedFormula.realize_toPrenex {L : Language} {M : Type w} [L.Structure M] {α : Type u'} {n : ℕ} [Nonempty M] (φ : L.BoundedFormula α n) {v : α → M} {xs : Fin n → M} :
              φ.toPrenex.Realize v xs ↔ φ.Realize v xs
              theorem FirstOrder.Language.BoundedFormula.IsQF.induction_on_sup_not {L : Language} {α : Type u'} {n : ℕ} {P : L.BoundedFormula α n → Prop} {φ : L.BoundedFormula α n} (h : φ.IsQF) (hf : P ⊥) (ha : ∀ (ψ : L.BoundedFormula α n), ψ.IsAtomic → P ψ) (hsup : ∀ {φ₁ φ₂ : L.BoundedFormula α n}, P φ₁ → P φ₂ → P (φ₁ ⊔ φ₂)) (hnot : ∀ {φ : L.BoundedFormula α n}, P φ → P φ.not) (hse : ∀ {φ₁ φ₂ : L.BoundedFormula α n}, ∅.Iff φ₁ φ₂ → (P φ₁ ↔ P φ₂)) :
              P φ
              theorem FirstOrder.Language.BoundedFormula.IsQF.induction_on_inf_not {L : Language} {α : Type u'} {n : ℕ} {P : L.BoundedFormula α n → Prop} {φ : L.BoundedFormula α n} (h : φ.IsQF) (hf : P ⊥) (ha : ∀ (ψ : L.BoundedFormula α n), ψ.IsAtomic → P ψ) (hinf : ∀ {φ₁ φ₂ : L.BoundedFormula α n}, P φ₁ → P φ₂ → P (φ₁ ⊓ φ₂)) (hnot : ∀ {φ : L.BoundedFormula α n}, P φ → P φ.not) (hse : ∀ {φ₁ φ₂ : L.BoundedFormula α n}, ∅.Iff φ₁ φ₂ → (P φ₁ ↔ P φ₂)) :
              P φ
              theorem FirstOrder.Language.BoundedFormula.induction_on_all_ex {L : Language} {α : Type u'} {n : ℕ} {P : {m : ℕ} → L.BoundedFormula α m → Prop} (φ : L.BoundedFormula α n) (hqf : ∀ {m : ℕ} {ψ : L.BoundedFormula α m}, ψ.IsQF → P ψ) (hall : ∀ {m : ℕ} {ψ : L.BoundedFormula α (m + 1)}, P ψ → P ψ.all) (hex : ∀ {m : ℕ} {φ : L.BoundedFormula α (m + 1)}, P φ → P φ.ex) (hse : ∀ {m : ℕ} {φ₁ φ₂ : L.BoundedFormula α m}, ∅.Iff φ₁ φ₂ → (P φ₁ ↔ P φ₂)) :
              P φ
              theorem FirstOrder.Language.BoundedFormula.induction_on_exists_not {L : Language} {α : Type u'} {n : ℕ} {P : {m : ℕ} → L.BoundedFormula α m → Prop} (φ : L.BoundedFormula α n) (hqf : ∀ {m : ℕ} {ψ : L.BoundedFormula α m}, ψ.IsQF → P ψ) (hnot : ∀ {m : ℕ} {φ : L.BoundedFormula α m}, P φ → P φ.not) (hex : ∀ {m : ℕ} {φ : L.BoundedFormula α (m + 1)}, P φ → P φ.ex) (hse : ∀ {m : ℕ} {φ₁ φ₂ : L.BoundedFormula α m}, ∅.Iff φ₁ φ₂ → (P φ₁ ↔ P φ₂)) :
              P φ

              A universal formula is a formula defined by applying only universal quantifiers to a quantifier-free formula.

              Instances For

                An existential formula is a formula defined by applying only existential quantifiers to a quantifier-free formula.

                Instances For
                  theorem FirstOrder.Language.BoundedFormula.IsAtomic.realize_comp_of_injective {L : Language} {α : Type u'} {n : ℕ} {M : Type u_1} [L.Structure M] {N : Type u_2} [L.Structure N] {F : Type u_3} [FunLike F M N] {φ : L.BoundedFormula α n} (hA : φ.IsAtomic) [L.HomClass F M N] {f : F} (hInj : Function.Injective ⇑f) {v : α → M} {xs : Fin n → M} :
                  φ.Realize v xs → φ.Realize (⇑f ∘ v) (⇑f ∘ xs)
                  theorem FirstOrder.Language.BoundedFormula.IsAtomic.realize_comp {L : Language} {α : Type u'} {n : ℕ} {M : Type u_1} [L.Structure M] {N : Type u_2} [L.Structure N] {F : Type u_3} [FunLike F M N] {φ : L.BoundedFormula α n} (hA : φ.IsAtomic) [EmbeddingLike F M N] [L.HomClass F M N] (f : F) {v : α → M} {xs : Fin n → M} :
                  φ.Realize v xs → φ.Realize (⇑f ∘ v) (⇑f ∘ xs)
                  theorem FirstOrder.Language.BoundedFormula.IsQF.realize_embedding {L : Language} {α : Type u'} {n : ℕ} {M : Type u_1} [L.Structure M] {N : Type u_2} [L.Structure N] {F : Type u_3} [FunLike F M N] [EmbeddingLike F M N] [L.StrongHomClass F M N] {φ : L.BoundedFormula α n} (hQF : φ.IsQF) (f : F) {v : α → M} {xs : Fin n → M} :
                  φ.Realize (⇑f ∘ v) (⇑f ∘ xs) ↔ φ.Realize v xs
                  theorem FirstOrder.Language.BoundedFormula.IsUniversal.realize_embedding {L : Language} {α : Type u'} {n : ℕ} {M : Type u_1} [L.Structure M] {N : Type u_2} [L.Structure N] {F : Type u_3} [FunLike F M N] [EmbeddingLike F M N] [L.StrongHomClass F M N] {φ : L.BoundedFormula α n} (hU : φ.IsUniversal) (f : F) {v : α → M} {xs : Fin n → M} :
                  φ.Realize (⇑f ∘ v) (⇑f ∘ xs) → φ.Realize v xs
                  theorem FirstOrder.Language.BoundedFormula.IsExistential.realize_embedding {L : Language} {α : Type u'} {n : ℕ} {M : Type u_1} [L.Structure M] {N : Type u_2} [L.Structure N] {F : Type u_3} [FunLike F M N] [EmbeddingLike F M N] [L.StrongHomClass F M N] {φ : L.BoundedFormula α n} (hE : φ.IsExistential) (f : F) {v : α → M} {xs : Fin n → M} :
                  φ.Realize v xs → φ.Realize (⇑f ∘ v) (⇑f ∘ xs)

                  A theory is universal when it is comprised only of universal sentences - these theories apply also to substructures.

                  Instances
                    theorem FirstOrder.Language.Theory.IsUniversal.models_of_embedding {L : Language} {M : Type w} [L.Structure M] {T : L.Theory} [hT : T.IsUniversal] {N : Type u_1} [L.Structure N] [N ⊨ T] (f : L.Embedding M N) :
                    M ⊨ T
                    theorem FirstOrder.Language.Relations.isAtomic {L : Language} {α : Type u'} {n l : ℕ} (r : L.Relations l) (ts : Fin l → L.Term (α ⊕ Fin n)) :
                    theorem FirstOrder.Language.Relations.isQF {L : Language} {α : Type u'} {n l : ℕ} (r : L.Relations l) (ts : Fin l → L.Term (α ⊕ Fin n)) :