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 α nProp

    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 α nProp} {φ : L.BoundedFormula α n} (h : φ.IsPrenex) (hq : ∀ {m : } {ψ : L.BoundedFormula α m}, ψ.IsQFP ψ) (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 nM} :
              (φ.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 nM} :
              (φ.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 nM} :
              φ.toPrenex.Realize v xs φ.Realize v xs
              theorem FirstOrder.Language.BoundedFormula.IsQF.induction_on_sup_not {L : Language} {α : Type u'} {n : } {P : L.BoundedFormula α nProp} {φ : L.BoundedFormula α n} (h : φ.IsQF) (hf : P ) (ha : ∀ (ψ : L.BoundedFormula α n), ψ.IsAtomicP ψ) (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 α nProp} {φ : L.BoundedFormula α n} (h : φ.IsQF) (hf : P ) (ha : ∀ (ψ : L.BoundedFormula α n), ψ.IsAtomicP ψ) (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 α mProp} (φ : L.BoundedFormula α n) (hqf : ∀ {m : } {ψ : L.BoundedFormula α m}, ψ.IsQFP ψ) (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 α mProp} (φ : L.BoundedFormula α n) (hqf : ∀ {m : } {ψ : L.BoundedFormula α m}, ψ.IsQFP ψ) (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 nM} :
                  φ.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 nM} :
                  φ.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 nM} :
                  φ.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 nM} :
                  φ.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 nM} :
                  φ.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 lL.Term (α Fin n)) :
                    theorem FirstOrder.Language.Relations.isQF {L : Language} {α : Type u'} {n l : } (r : L.Relations l) (ts : Fin lL.Term (α Fin n)) :