File: Mathlib/ModelTheory/Complexity.lean

full_name: FirstOrder.Language.BoundedFormula.IsAtomic
code: /-- An atomic formula is either equality or a relation symbol applied to terms.
Note that `⊥` and `⊤` are not considered atomic in this convention. -/
inductive IsAtomic : L.BoundedFormula α n → Prop
  | equal (t₁ t₂ : L.Term (α ⊕ (Fin n))) : IsAtomic (t₁.bdEqual t₂)
  | rel {l : ℕ} (R : L.Relations l) (ts : Fin l → L.Term (α ⊕ (Fin n))) :
    IsAtomic (R.boundedFormula ts)
goal: L.BoundedFormula α n → Prop

full_name: FirstOrder.Language.BoundedFormula.IsAtomic.equal
code: /-- An atomic formula is either equality or a relation symbol applied to terms.
Note that `⊥` and `⊤` are not considered atomic in this convention. -/
inductive IsAtomic : L.BoundedFormula α n → Prop
  | equal (t₁ t₂ : L.Term (α ⊕ (Fin n))) : IsAtomic (t₁.bdEqual t₂)
  | rel {l : ℕ} (R : L.Relations l) (ts : Fin l → L.Term (α ⊕ (Fin n))) :
    IsAtomic (R.boundedFormula ts)
goal: (t₁.bdEqual t₂).IsAtomic

full_name: FirstOrder.Language.BoundedFormula.IsAtomic.rel
code: /-- An atomic formula is either equality or a relation symbol applied to terms.
Note that `⊥` and `⊤` are not considered atomic in this convention. -/
inductive IsAtomic : L.BoundedFormula α n → Prop
  | equal (t₁ t₂ : L.Term (α ⊕ (Fin n))) : IsAtomic (t₁.bdEqual t₂)
  | rel {l : ℕ} (R : L.Relations l) (ts : Fin l → L.Term (α ⊕ (Fin n))) :
    IsAtomic (R.boundedFormula ts)
goal: (R.boundedFormula ts).IsAtomic

full_name: FirstOrder.Language.BoundedFormula.not_all_isAtomic
code: theorem not_all_isAtomic (φ : L.BoundedFormula α (n + 1)) : ¬φ.all.IsAtomic 
goal: ¬φ.all.IsAtomic

full_name: FirstOrder.Language.BoundedFormula.not_ex_isAtomic
code: theorem not_ex_isAtomic (φ : L.BoundedFormula α (n + 1)) : ¬φ.ex.IsAtomic 
goal: ¬φ.ex.IsAtomic

full_name: FirstOrder.Language.BoundedFormula.IsAtomic.relabel
code: theorem IsAtomic.relabel {m : ℕ} {φ : L.BoundedFormula α m} (h : φ.IsAtomic)
    (f : α → β ⊕ (Fin n)) : (φ.relabel f).IsAtomic 
goal: (FirstOrder.Language.BoundedFormula.relabel f φ).IsAtomic

full_name: FirstOrder.Language.BoundedFormula.IsAtomic.liftAt
code: theorem IsAtomic.liftAt {k m : ℕ} (h : IsAtomic φ) : (φ.liftAt k m).IsAtomic 
goal: (FirstOrder.Language.BoundedFormula.liftAt k m φ).IsAtomic

full_name: FirstOrder.Language.BoundedFormula.IsAtomic.castLE
code: theorem IsAtomic.castLE {h : l ≤ n} (hφ : IsAtomic φ) : (φ.castLE h).IsAtomic 
goal: (FirstOrder.Language.BoundedFormula.castLE h φ).IsAtomic

full_name: FirstOrder.Language.BoundedFormula.IsQF.imp
code: /-- A quantifier-free formula is a formula defined without quantifiers. These are all equivalent
to boolean combinations of atomic formulas. -/
inductive IsQF : L.BoundedFormula α n → Prop
  | falsum : IsQF falsum
  | of_isAtomic {φ} (h : IsAtomic φ) : IsQF φ
  | imp {φ₁ φ₂} (h₁ : IsQF φ₁) (h₂ : IsQF φ₂) : IsQF (φ₁.imp φ₂)
goal: (φ₁.imp φ₂).IsQF

full_name: FirstOrder.Language.BoundedFormula.IsQF.falsum
code: /-- A quantifier-free formula is a formula defined without quantifiers. These are all equivalent
to boolean combinations of atomic formulas. -/
inductive IsQF : L.BoundedFormula α n → Prop
  | falsum : IsQF falsum
  | of_isAtomic {φ} (h : IsAtomic φ) : IsQF φ
  | imp {φ₁ φ₂} (h₁ : IsQF φ₁) (h₂ : IsQF φ₂) : IsQF (φ₁.imp φ₂)
goal: FirstOrder.Language.BoundedFormula.falsum.IsQF

full_name: FirstOrder.Language.BoundedFormula.IsQF
code: /-- A quantifier-free formula is a formula defined without quantifiers. These are all equivalent
to boolean combinations of atomic formulas. -/
inductive IsQF : L.BoundedFormula α n → Prop
  | falsum : IsQF falsum
  | of_isAtomic {φ} (h : IsAtomic φ) : IsQF φ
  | imp {φ₁ φ₂} (h₁ : IsQF φ₁) (h₂ : IsQF φ₂) : IsQF (φ₁.imp φ₂)
goal: L.BoundedFormula α n → Prop

full_name: FirstOrder.Language.BoundedFormula.IsQF.of_isAtomic
code: /-- A quantifier-free formula is a formula defined without quantifiers. These are all equivalent
to boolean combinations of atomic formulas. -/
inductive IsQF : L.BoundedFormula α n → Prop
  | falsum : IsQF falsum
  | of_isAtomic {φ} (h : IsAtomic φ) : IsQF φ
  | imp {φ₁ φ₂} (h₁ : IsQF φ₁) (h₂ : IsQF φ₂) : IsQF (φ₁.imp φ₂)
goal: φ.IsQF

full_name: FirstOrder.Language.BoundedFormula.IsAtomic.isQF
code: theorem IsAtomic.isQF {φ : L.BoundedFormula α n} : IsAtomic φ → IsQF φ 
goal: φ.IsAtomic → φ.IsQF

full_name: FirstOrder.Language.BoundedFormula.isQF_bot
code: theorem isQF_bot : IsQF (⊥ : L.BoundedFormula α n) 
goal: ⊥.IsQF

full_name: FirstOrder.Language.BoundedFormula.IsQF.not
code: theorem IsQF.not {φ : L.BoundedFormula α n} (h : IsQF φ) : IsQF φ.not 
goal: φ.not.IsQF

full_name: FirstOrder.Language.BoundedFormula.IsQF.relabel
code: theorem IsQF.relabel {m : ℕ} {φ : L.BoundedFormula α m} (h : φ.IsQF) (f : α → β ⊕ (Fin n)) :
    (φ.relabel f).IsQF 
goal: (FirstOrder.Language.BoundedFormula.relabel f φ).IsQF

full_name: FirstOrder.Language.BoundedFormula.IsQF.liftAt
code: theorem IsQF.liftAt {k m : ℕ} (h : IsQF φ) : (φ.liftAt k m).IsQF 
goal: (FirstOrder.Language.BoundedFormula.liftAt k m φ).IsQF

full_name: FirstOrder.Language.BoundedFormula.IsQF.castLE
code: theorem IsQF.castLE {h : l ≤ n} (hφ : IsQF φ) : (φ.castLE h).IsQF 
goal: (FirstOrder.Language.BoundedFormula.castLE h φ).IsQF

full_name: FirstOrder.Language.BoundedFormula.not_all_isQF
code: theorem not_all_isQF (φ : L.BoundedFormula α (n + 1)) : ¬φ.all.IsQF 
goal: ¬φ.all.IsQF

full_name: FirstOrder.Language.BoundedFormula.not_ex_isQF
code: theorem not_ex_isQF (φ : L.BoundedFormula α (n + 1)) : ¬φ.ex.IsQF 
goal: ¬φ.ex.IsQF

full_name: FirstOrder.Language.BoundedFormula.IsPrenex
code: /-- Indicates that a bounded formula is in prenex normal form - that is, it consists of quantifiers
  applied to a quantifier-free formula. -/
inductive IsPrenex : ∀ {n}, L.BoundedFormula α n → Prop
  | of_isQF {n} {φ : L.BoundedFormula α n} (h : IsQF φ) : IsPrenex φ
  | all {n} {φ : L.BoundedFormula α (n + 1)} (h : IsPrenex φ) : IsPrenex φ.all
  | ex {n} {φ : L.BoundedFormula α (n + 1)} (h : IsPrenex φ) : IsPrenex φ.ex
goal: L.BoundedFormula α n → Prop

full_name: FirstOrder.Language.BoundedFormula.IsPrenex.ex
code: /-- Indicates that a bounded formula is in prenex normal form - that is, it consists of quantifiers
  applied to a quantifier-free formula. -/
inductive IsPrenex : ∀ {n}, L.BoundedFormula α n → Prop
  | of_isQF {n} {φ : L.BoundedFormula α n} (h : IsQF φ) : IsPrenex φ
  | all {n} {φ : L.BoundedFormula α (n + 1)} (h : IsPrenex φ) : IsPrenex φ.all
  | ex {n} {φ : L.BoundedFormula α (n + 1)} (h : IsPrenex φ) : IsPrenex φ.ex
goal: φ.ex.IsPrenex

full_name: FirstOrder.Language.BoundedFormula.IsPrenex.of_isQF
code: /-- Indicates that a bounded formula is in prenex normal form - that is, it consists of quantifiers
  applied to a quantifier-free formula. -/
inductive IsPrenex : ∀ {n}, L.BoundedFormula α n → Prop
  | of_isQF {n} {φ : L.BoundedFormula α n} (h : IsQF φ) : IsPrenex φ
  | all {n} {φ : L.BoundedFormula α (n + 1)} (h : IsPrenex φ) : IsPrenex φ.all
  | ex {n} {φ : L.BoundedFormula α (n + 1)} (h : IsPrenex φ) : IsPrenex φ.ex
goal: φ.IsPrenex

full_name: FirstOrder.Language.BoundedFormula.IsPrenex.all
code: /-- Indicates that a bounded formula is in prenex normal form - that is, it consists of quantifiers
  applied to a quantifier-free formula. -/
inductive IsPrenex : ∀ {n}, L.BoundedFormula α n → Prop
  | of_isQF {n} {φ : L.BoundedFormula α n} (h : IsQF φ) : IsPrenex φ
  | all {n} {φ : L.BoundedFormula α (n + 1)} (h : IsPrenex φ) : IsPrenex φ.all
  | ex {n} {φ : L.BoundedFormula α (n + 1)} (h : IsPrenex φ) : IsPrenex φ.ex
goal: φ.all.IsPrenex

full_name: FirstOrder.Language.BoundedFormula.IsQF.isPrenex
code: theorem IsQF.isPrenex {φ : L.BoundedFormula α n} : IsQF φ → IsPrenex φ 
goal: φ.IsQF → φ.IsPrenex

full_name: FirstOrder.Language.BoundedFormula.IsAtomic.isPrenex
code: theorem IsAtomic.isPrenex {φ : L.BoundedFormula α n} (h : IsAtomic φ) : IsPrenex φ 
goal: φ.IsPrenex

full_name: FirstOrder.Language.BoundedFormula.IsPrenex.induction_on_all_not
code: theorem IsPrenex.induction_on_all_not {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 φ 
goal: P φ

full_name: FirstOrder.Language.BoundedFormula.IsPrenex.relabel
code: theorem IsPrenex.relabel {m : ℕ} {φ : L.BoundedFormula α m} (h : φ.IsPrenex)
    (f : α → β ⊕ (Fin n)) : (φ.relabel f).IsPrenex 
goal: (FirstOrder.Language.BoundedFormula.relabel f φ).IsPrenex

full_name: FirstOrder.Language.BoundedFormula.IsPrenex.castLE
code: theorem IsPrenex.castLE (hφ : IsPrenex φ) : ∀ {n} {h : l ≤ n}, (φ.castLE h).IsPrenex 
goal: (FirstOrder.Language.BoundedFormula.castLE h φ).IsPrenex

full_name: FirstOrder.Language.BoundedFormula.IsPrenex.liftAt
code: theorem IsPrenex.liftAt {k m : ℕ} (h : IsPrenex φ) : (φ.liftAt k m).IsPrenex 
goal: (FirstOrder.Language.BoundedFormula.liftAt k m φ).IsPrenex

full_name: FirstOrder.Language.BoundedFormula.toPrenexImpRight
code: /-- 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 ψ`. -/
def toPrenexImpRight : ∀ {n}, L.BoundedFormula α n → L.BoundedFormula α n → L.BoundedFormula α n
  
goal: L.BoundedFormula α n → L.BoundedFormula α n → L.BoundedFormula α n

full_name: FirstOrder.Language.BoundedFormula.IsQF.toPrenexImpRight
code: theorem IsQF.toPrenexImpRight {φ : L.BoundedFormula α n} :
    ∀ {ψ : L.BoundedFormula α n}, IsQF ψ → φ.toPrenexImpRight ψ = φ.imp ψ
  
goal: ψ.IsQF → φ.toPrenexImpRight ψ = φ.imp ψ

full_name: FirstOrder.Language.BoundedFormula.isPrenex_toPrenexImpRight
code: theorem isPrenex_toPrenexImpRight {φ ψ : L.BoundedFormula α n} (hφ : IsQF φ) (hψ : IsPrenex ψ) :
    IsPrenex (φ.toPrenexImpRight ψ) 
goal: (φ.toPrenexImpRight ψ).IsPrenex

full_name: FirstOrder.Language.BoundedFormula.toPrenexImp
code: /-- An auxiliary operation to `FirstOrder.Language.BoundedFormula.toPrenex`.
  If `φ` and `ψ` are in prenex normal form, then `φ.toPrenexImp ψ`
  is a prenex normal form for `φ.imp ψ`. -/
def toPrenexImp : ∀ {n}, L.BoundedFormula α n → L.BoundedFormula α n → L.BoundedFormula α n
  
goal: L.BoundedFormula α n → L.BoundedFormula α n → L.BoundedFormula α n

full_name: FirstOrder.Language.BoundedFormula.IsQF.toPrenexImp
code: theorem IsQF.toPrenexImp :
    ∀ {φ ψ : L.BoundedFormula α n}, φ.IsQF → φ.toPrenexImp ψ = φ.toPrenexImpRight ψ
  
goal: φ.IsQF → φ.toPrenexImp ψ = φ.toPrenexImpRight ψ

full_name: FirstOrder.Language.BoundedFormula.isPrenex_toPrenexImp
code: theorem isPrenex_toPrenexImp {φ ψ : L.BoundedFormula α n} (hφ : IsPrenex φ) (hψ : IsPrenex ψ) :
    IsPrenex (φ.toPrenexImp ψ) 
goal: (φ.toPrenexImp ψ).IsPrenex

full_name: FirstOrder.Language.BoundedFormula.toPrenex
code: /-- For any bounded formula `φ`, `φ.toPrenex` is a semantically-equivalent formula in prenex normal
  form. -/
def toPrenex : ∀ {n}, L.BoundedFormula α n → L.BoundedFormula α n
  
goal: L.BoundedFormula α n → L.BoundedFormula α n

full_name: FirstOrder.Language.BoundedFormula.toPrenex_isPrenex
code: theorem toPrenex_isPrenex (φ : L.BoundedFormula α n) : φ.toPrenex.IsPrenex 
goal: φ.toPrenex.IsPrenex

full_name: FirstOrder.Language.BoundedFormula.realize_toPrenexImpRight
code: theorem realize_toPrenexImpRight {φ ψ : L.BoundedFormula α n} (hφ : IsQF φ) (hψ : IsPrenex ψ)
    {v : α → M} {xs : Fin n → M} :
    (φ.toPrenexImpRight ψ).Realize v xs ↔ (φ.imp ψ).Realize v xs 
goal: (φ.toPrenexImpRight ψ).Realize v xs ↔ (φ.imp ψ).Realize v xs

full_name: FirstOrder.Language.BoundedFormula.realize_toPrenexImp
code: theorem realize_toPrenexImp {φ ψ : L.BoundedFormula α n} (hφ : IsPrenex φ) (hψ : IsPrenex ψ)
    {v : α → M} {xs : Fin n → M} : (φ.toPrenexImp ψ).Realize v xs ↔ (φ.imp ψ).Realize v xs 
goal: (φ.toPrenexImp ψ).Realize v xs ↔ (φ.imp ψ).Realize v xs

full_name: FirstOrder.Language.BoundedFormula.realize_toPrenex
code: @[simp]
theorem realize_toPrenex (φ : L.BoundedFormula α n) {v : α → M} :
    ∀ {xs : Fin n → M}, φ.toPrenex.Realize v xs ↔ φ.Realize v xs 
goal: φ.toPrenex.Realize v xs ↔ φ.Realize v xs

full_name: FirstOrder.Language.BoundedFormula.IsQF.induction_on_sup_not
code: theorem IsQF.induction_on_sup_not {P : L.BoundedFormula α n → Prop} {φ : L.BoundedFormula α n}
    (h : IsQF φ) (hf : P (⊥ : L.BoundedFormula α n))
    (ha : ∀ ψ : L.BoundedFormula α n, IsAtomic ψ → P ψ)
    (hsup : ∀ {φ₁ φ₂}, P φ₁ → P φ₂ → P (φ₁ ⊔ φ₂)) (hnot : ∀ {φ}, P φ → P φ.not)
    (hse :
      ∀ {φ₁ φ₂ : L.BoundedFormula α n}, Theory.SemanticallyEquivalent ∅ φ₁ φ₂ → (P φ₁ ↔ P φ₂)) :
    P φ 
goal: P φ

full_name: FirstOrder.Language.BoundedFormula.IsQF.induction_on_inf_not
code: theorem IsQF.induction_on_inf_not {P : L.BoundedFormula α n → Prop} {φ : L.BoundedFormula α n}
    (h : IsQF φ) (hf : P (⊥ : L.BoundedFormula α n))
    (ha : ∀ ψ : L.BoundedFormula α n, IsAtomic ψ → P ψ)
    (hinf : ∀ {φ₁ φ₂}, P φ₁ → P φ₂ → P (φ₁ ⊓ φ₂)) (hnot : ∀ {φ}, P φ → P φ.not)
    (hse :
      ∀ {φ₁ φ₂ : L.BoundedFormula α n}, Theory.SemanticallyEquivalent ∅ φ₁ φ₂ → (P φ₁ ↔ P φ₂)) :
    P φ 
goal: P φ

full_name: FirstOrder.Language.BoundedFormula.semanticallyEquivalent_toPrenex
code: theorem semanticallyEquivalent_toPrenex (φ : L.BoundedFormula α n) :
    (∅ : L.Theory).SemanticallyEquivalent φ φ.toPrenex 
goal: ∅.SemanticallyEquivalent φ φ.toPrenex

full_name: FirstOrder.Language.BoundedFormula.induction_on_all_ex
code: theorem induction_on_all_ex {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},
      Theory.SemanticallyEquivalent ∅ φ₁ φ₂ → (P φ₁ ↔ P φ₂)) :
    P φ 
goal: P φ

full_name: FirstOrder.Language.BoundedFormula.induction_on_exists_not
code: theorem induction_on_exists_not {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},
      Theory.SemanticallyEquivalent ∅ φ₁ φ₂ → (P φ₁ ↔ P φ₂)) :
    P φ 
goal: P φ

full_name: FirstOrder.Language.Formula.isAtomic_graph
code: theorem Formula.isAtomic_graph (f : L.Functions n) : (Formula.graph f).IsAtomic 
goal: FirstOrder.Language.BoundedFormula.IsAtomic (FirstOrder.Language.Formula.graph f)