Proposition 3.5: universal property of the free algebra
ProvedMSKleene.free_universalUniversal property of the free algebra (Proposition 3.5).
The pair has the universal property: for every -algebra and every -sorted mapping there exists a unique homomorphism such that .
import Definitions.Def_MSKleene_Term
namespace MSKleene
/-- **Universal property of the free many-sorted algebra** (Proposition 3.5).
For every `Σ`-algebra `A` and every `S`-sorted map `ρ : X → A`, there is a
unique `Σ`-homomorphism `ρ^♯ : T_Σ(X) → A` with `ρ^♯ ∘ η^X = ρ`. -/
theorem free_universal {S : Type} (sig : Signature S) (X : SSet S)
(A : Algebra sig) (ρ : SMap X A.carrier) :
∃! g : Hom (freeAlgebra sig X) A,
∀ (s : S) (x : X s), g.toFun s (eta sig X s x) = ρ s x := by
sorry
end MSKleeneRead-back
What the Lean code literally says, in plain math · claude-sonnet-5
Fix a type whose elements are called sorts (it lives in the lowest type universe; no finiteness is assumed of it). The statement takes the following parameters:
- a signature : for every finite list of sorts and every sort , a type whose elements are operation symbols of input arity and output sort (no finiteness assumed);
- a sorted set of variables : for each sort , a type ;
- an algebra for : a carrier family of types, together with, for every , every , and every symbol , an interpretation (when the domain is a one-point type, so names a constant of );
- a variable assignment : a family of functions , one per sort .
From and one builds the term algebra : its carrier at sort is the inductive type of well-sorted terms, generated by a constructor and a constructor that, from a symbol and a tuple of subterms whose sorts match , forms a term of sort ; the operation sends a tuple of terms to the formal term applied to them. The map is the family given by . A homomorphism consists of a family of functions such that for all , all , all , and all argument tuples ,
i.e. commutes with every operation, applied componentwise to arguments.
The theorem asserts that there exists exactly one homomorphism satisfying
equivalently for every sort and every . The "" means: such a homomorphism exists, and any two homomorphisms both satisfying this variable-agreement condition are equal (equality of the homomorphism structures, which reduces to equality of the underlying function families, the commutation law being a proposition). Degenerate cases falling under the quantifiers: if is empty, or if is empty for every sort , the agreement condition on is vacuous and the claim becomes that there is exactly one homomorphism at all; nullary symbols () are included, their argument tuple being the unique element of a one-point type.
Confirmed by the mission captain (proposal self-audit).