Documentation

LeanPool.InfinitaryLogic.Lomega1omega.Operations

Operations on Lω₁ω Formulas #

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

Main Definitions #

Implementation Notes #

These are the ω-facing operations, defined over BoundedFormulaInf ℕ. An operation that makes sense at an arbitrary branching carrier belongs upstream on BoundedFormulaInf; IndexCoding handles transport between carriers.

Maps the last variable of Fin (n+1) to a bound variable position, keeping the first n as free variables. Used for quantifying over the last position.

This function is used by openBounds (for the all case) and by existsLastVar/forallLastVar in Scott/Formula.lean.

Equations
Instances For
    theorem FirstOrder.Language.BoundedFormulaω.realize_castLE_self {L : Language} {α : Type u'} {M : Type u_1} [L.Structure M] {n : } (φ : L.BoundedFormulaω α 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. This handles the case where the proof term is not definitionally le_refl (e.g., constructed via rewriting or other means).

    def FirstOrder.Language.BoundedFormulaω.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
      theorem FirstOrder.Language.BoundedFormulaω.realize_relabel_sumInr {L : Language} {M : Type u_1} [L.Structure M] {n k : } (φ : L.BoundedFormulaω (Fin n) k) (xs : Fin (n + k)M) :

      Realize commutes with relabel Sum.inr: relabeling free variables Fin n into bound positions via Sum.inr shifts them into the first n bound variable slots.

      For φ : L.BoundedFormulaω (Fin n) k:

      • The relabeled formula φ.relabel Sum.inr has type L.BoundedFormulaω Empty (n + k)
      • Realizing with Empty.elim and xs : Fin (n + k) → M is equivalent to realizing the original formula with xs ∘ Fin.castAdd k for free variables and xs ∘ Fin.natAdd n for bound variables.

      Specialization of realize_relabel_sumInr for formulas (k = 0 bound variables).

      For φ : L.Formulaω (Fin n) (a formula with n free variables and 0 bound variables):

      • φ.relabel Sum.inr : L.BoundedFormulaω Empty n has 0 free vars and n bound vars
      • Realizing the relabeled formula with bound assignment xs : Fin n → M is equivalent to realizing the original formula with free variable assignment xs.
      @[simp]
      theorem FirstOrder.Language.BoundedFormulaω.realize_subst {L : Language} {α β : Type u'} {n : } {M : Type u_2} [L.Structure M] (tf : αL.Term β) (φ : L.BoundedFormulaω α n) (v : βM) (xs : Fin nM) :
      (φ.subst tf).Realize v xs φ.Realize (fun (a : α) => Term.realize v (tf a)) xs

      Realization commutes with free variable substitution.

      This is the Lω₁ω analogue of Mathlib's BoundedFormula.realize_subst.

      Bridge: openBounds ∘ relabel Sum.inr roundtrip #

      Language Maps #

      Lifts a bounded Lω₁ω formula along a language homomorphism L →ᴸ L'.

      This maps function and relation symbols in the formula using the language homomorphism, while preserving the variable structure. It is the Lω₁ω analogue of Mathlib's LHom.onBoundedFormula.

      Equations
      Instances For
        theorem FirstOrder.Language.BoundedFormulaω.realize_mapLanguage {L : Language} {α : Type u'} {n : } {L' : Language} (g : L →ᴸ L') {M : Type u_2} [L.Structure M] [L'.Structure M] [g.IsExpansionOn M] (φ : L.BoundedFormulaω α n) (v : αM) (xs : Fin nM) :
        (mapLanguage g φ).Realize v xs φ.Realize v xs

        Realization of a formula is preserved by language homomorphisms that are expansions.

        If g : L →ᴸ L' is an expansion on M (i.e., g maps symbols to the corresponding symbols in M's L'-structure), then (φ.mapLanguage g).Realize v xs ↔ φ.Realize v xs where the left side uses the L'-structure and the right side uses the L-structure.

        @[simp]
        theorem FirstOrder.Language.BoundedFormulaω.mapLanguage_not {L : Language} {α : Type u'} {n : } {L' : Language} (g : L →ᴸ L') (φ : L.BoundedFormulaω α n) :

        mapLanguage commutes with not.

        @[simp]
        theorem FirstOrder.Language.BoundedFormulaω.mapLanguage_imp {L : Language} {α : Type u'} {n : } {L' : Language} (g : L →ᴸ L') (φ ψ : L.BoundedFormulaω α n) :
        mapLanguage g (φ.imp ψ) = (mapLanguage g φ).imp (mapLanguage g ψ)

        mapLanguage commutes with imp.

        Closed-term substitution #

        Substituting a closed term into a term with no real variables reduces to the plain relabel. Shared by the maximal-consistency term model and the proof-theoretic consistency family; it lives here so that neither needs to import the other.

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

        Embeds a first-order formula into Lω₁ω.

        Equations
        Instances For
          @[simp]
          theorem FirstOrder.Language.Formula.realize_toLω {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]
            theorem FirstOrder.Language.Sentence.realize_toLω {L : Language} {M : Type u_1} [L.Structure M] [_nonemptyM : Nonempty M] (φ : L.Sentence) :
            φ.toLω.Realize M M φ