Documentation

InfinitaryLogic.Linf.Operations

Operations on L∞ω Formulas #

This file defines operations on L∞ω formulas including relabeling, casting, and substitution.

Main Definitions #

Implementation Notes #

The operations here (castLE, relabel, mapFreeVars, subst) closely mirror those in Lomega1omega/Operations.lean. The duplication exists because BoundedFormulaInf and BoundedFormulaω are separate inductive types: the former uses arbitrary {ι : Type uι} for iSup/iInf while the latter uses . Factoring into a shared abstraction would require a typeclass over the formula type, deferred for future work.

theorem FirstOrder.Language.BoundedFormulaInf.castLE_refl {L : Language} {α : Type u'} {n : } (φ : L.BoundedFormulaInf α n) :
castLE φ = φ

castLE (le_refl n) is the identity on formulas.

theorem FirstOrder.Language.BoundedFormulaInf.realize_castLE_of_eq {L : Language} {α : Type u'} {M : Type u_1} [L.Structure M] {m n : } (φ : L.BoundedFormulaInf α m) (h : m n) (heq : m = n) (v : αM) (xs : Fin nM) :
(castLE h φ).Realize v xs φ.Realize v (xs Fin.cast heq)

castLE over a proof of m ≤ m preserves semantics. This is more general than matching on le_refl directly, as it works for any proof h : m ≤ m regardless of how it was constructed.

theorem FirstOrder.Language.BoundedFormulaInf.realize_castLE_refl {L : Language} {α : Type u'} {M : Type u_1} [L.Structure M] {n : } (φ : L.BoundedFormulaInf α n) (v : αM) (xs : Fin nM) :
(castLE φ).Realize v xs φ.Realize v xs

castLE (le_refl n) preserves semantics.

theorem FirstOrder.Language.BoundedFormulaInf.realize_castLE_self {L : Language} {α : Type u'} {M : Type u_1} [L.Structure M] {n : } (φ : L.BoundedFormulaInf α n) (h : n n) (v : αM) (xs : Fin nM) :
(castLE h φ).Realize v xs φ.Realize v xs

castLE over any proof h : n ≤ n preserves semantics.

def FirstOrder.Language.BoundedFormulaInf.relabelAux {α β : Type u'} {n : } (g : αβ Fin n) (k : ) :
α Fin kβ Fin (n + k)

A function to help relabel the variables in bounded formulas.

Equations
Instances For
    def FirstOrder.Language.BoundedFormulaInf.mapFreeVars {L : Language} {α β : Type u'} (f : αβ) {n : } :

    Renames free variables in a bounded formula using a function f : α → β.

    Unlike relabel, which can move free variables into bound positions, mapFreeVars simply renames free variables while preserving the bound variable structure.

    Equations
    Instances For
      theorem FirstOrder.Language.BoundedFormulaInf.realize_mapFreeVars {L : Language} {α β : Type u'} {n : } {M : Type u_2} [L.Structure M] (f : αβ) (φ : L.BoundedFormulaInf α n) (v : βM) (xs : Fin nM) :
      (mapFreeVars f φ).Realize v xs φ.Realize (v f) xs

      Realization commutes with free variable renaming.

      def FirstOrder.Language.BoundedFormulaInf.subst {L : Language} {α β : Type u'} {n : } :
      L.BoundedFormulaInf α n(αL.Term β)L.BoundedFormulaInf β n

      Substitutes the free variables in a bounded formula with terms.

      Equations
      Instances For

        Universe lifting for index types #

        theorem FirstOrder.Language.BoundedFormulaInf.realize_liftUI {L : Language} {α : Type u'} {M : Type u_2} [L.Structure M] {n : } (φ : L.BoundedFormulaInf α n) (v : αM) (xs : Fin nM) :
        φ.liftUI.Realize v xs φ.Realize v xs

        Universe lifting preserves semantics.

        Quantifying over the last free variable #

        theorem FirstOrder.Language.BoundedFormulaInf.realize_existsLastVarInf {L : Language} {M : Type u_3} [L.Structure M] {n : } (φ : L.FormulaInf (Fin (n + 1))) (v : Fin nM) :
        (existsLastVarInf φ).Realize v ∃ (x : M), φ.Realize (Fin.snoc v x)

        Semantics of existsLastVarInf: existentially quantifies over the last variable.

        theorem FirstOrder.Language.BoundedFormulaInf.realize_forallLastVarInf {L : Language} {M : Type u_3} [L.Structure M] {n : } (φ : L.FormulaInf (Fin (n + 1))) (v : Fin nM) :
        (forallLastVarInf φ).Realize v ∀ (x : M), φ.Realize (Fin.snoc v x)

        Semantics of forallLastVarInf: universally quantifies over the last variable.

        Converts a formula with Fin 0 free variables to a sentence (with Empty free variables).

        Since both Fin 0 and Empty are empty types, this is a purely type-theoretic conversion that does not change the semantics of the formula.

        Equations
        Instances For

          toSentenceInf preserves semantics: the sentence realizes in M iff the original formula realizes with the Fin.elim0 assignment.

          @[simp]
          theorem FirstOrder.Language.BoundedFormula.realize_toLinf {L : Language} {α : Type u'} {n : } {M : Type u_1} [L.Structure M] {v : αM} {xs : Fin nM} (φ : L.BoundedFormula α n) :
          φ.toLinf.Realize v xs φ.Realize v xs
          def FirstOrder.Language.Formula.toLinf {L : Language} {α : Type u'} (φ : L.Formula α) :

          Embeds a first-order formula into L∞ω.

          Equations
          Instances For
            @[simp]
            theorem FirstOrder.Language.Formula.realize_toLinf {L : Language} {α : Type u'} {M : Type u_1} [L.Structure M] {v : αM} (φ : L.Formula α) :

            Embeds a first-order sentence into L∞ω.

            Equations
            Instances For
              @[simp]