Global substitution operator
DefinitionMSKleene_SubstGlobalThe global substitution operator of Definition 3.20, used in Proposition 3.30.
An -sorted map is exactly a family of languages , one per variable. substGlobalHom ρ is the induced homomorphism , and substGlobalP ρ s K = ⋃_{P ∈ K} (substGlobalHom ρ)_s(P) its completely additive extension.
/-
The global substitution operator `(((x/L_x)_{x∈X_t})_{t∈S})^{♯ᵖ}` of
Definition 3.20, used in Proposition 3.30 (`PRecSubs`).
An `S`-sorted map `ρ : X → T_Σ(X)^℘` is exactly a family of languages
`(L_x)_{x}` , one per variable. `substGlobalHom ρ` is the induced homomorphism
`T_Σ(X) → T_Σ(X)^℘`, and `substGlobalP ρ s` its completely additive extension.
-/
import Definitions.Def_MSKleene_Term
import Definitions.Def_MSKleene_Power
import Mathlib.Data.Set.Lattice
namespace MSKleene
universe u
variable {S : Type u} {sig : Signature S} {X : SSet S}
/-- The homomorphism `(((x/L_x))_{x})^{♯} : T_Σ(X) → T_Σ(X)^℘` induced by a
family of languages `ρ` indexed by the variables (Definition 3.20). -/
noncomputable def substGlobalHom
(ρ : SMap X (powerAlgebra (freeAlgebra sig X)).carrier) :
Hom (freeAlgebra sig X) (powerAlgebra (freeAlgebra sig X)) :=
evalHom (powerAlgebra (freeAlgebra sig X)) ρ
/-- Its completely additive extension
`(((x/L_x))_{x})^{♯ᵖ}_s (K) = ⋃_{P ∈ K} (((x/L_x))_{x})^{♯}_s (P)`. -/
noncomputable def substGlobalP
(ρ : SMap X (powerAlgebra (freeAlgebra sig X)).carrier) (s : S)
(K : Set (Term sig X s)) : Set (Term sig X s) :=
⋃ P ∈ K, (substGlobalHom ρ).toFun s P
end MSKleene
Read-back
What the Lean code literally says, in plain math · claude-sonnet-5
substGlobalHom
Fix a universe level, a type whose elements are called sorts, a signature over (implicitly), and an -indexed family of variable types (implicitly); here assigns to each list of sorts and each sort a type of operation symbols with input profile and output sort , and is the type of variables of sort . Recall that is the type of well-sorted terms of sort : every variable gives a term , and every symbol together with a sort-indexed tuple of subterms whose sorts spell out gives a term . Let be the term algebra, whose carrier at sort is and whose interpretation of a symbol on an argument tuple is the term . Let be its power algebra, whose carrier at sort is the set of all subsets and whose interpretation of a symbol on a tuple of sets (indexed by ) is
which for empty reduces to the singleton (the membership condition being vacuous). The definition takes one explicit argument that, for every sort and every variable , selects a set of terms . It returns the algebra homomorphism given by the evaluation homomorphism into determined by ; write it . Its underlying sort-indexed map sends a term of sort to a subset defined by structural recursion: , and , i.e. the set of all terms with each ranging over the recursively computed set . As a homomorphism, also carries the proof that for every symbol and every tuple of term arguments , equals applied to the tuple obtained by applying componentwise to . The definition is marked noncomputable and has no further hypotheses.
substGlobalP
With the same implicitly fixed data (universe level, sort type , signature , variable family ), this definition takes three explicit arguments: an assignment that for every sort and every variable gives a set of terms (the same argument as for ), a sort , and a set of terms of sort . It returns the set of terms of sort
where is the homomorphism described above and is its component function at sort . Equivalently, a term of sort belongs to if and only if there exists a term with and , where is the value that assigns to , namely the evaluation of in the power algebra under . In particular, when is empty the result is the empty set. The definition is marked noncomputable and carries no additional hypotheses.
Confirmed by the mission captain (proposal self-audit).