Proposition 3.30: recognizability closed under substitution
ProvedMSKleene.rec_substRecognizability closed under substitution (Proposition 3.30).
Assume and finite. Let , , and an -sorted mapping from into . Then . (From CVCL20, Prop. 3.19.)
import Definitions.Def_MSKleene_Recognizable import Definitions.Def_MSKleene_SubstGlobal
namespace MSKleene
/-- **Recognizability is closed under substitution** (Proposition 3.30; from CVCL20).
With `S` and `X` finite: if `K ⊆ T_Σ(X)_s` is `s`-recognizable and
`ρ` assigns to every variable a recognizable language, then the global
substitution `ρ^♯ᵖ_s(K)` is `s`-recognizable. -/
theorem rec_subst {S : Type} [Finite S] (sig : Signature S) (X : SSet S)
(hX : SFinite X) {s : S} (K : Set (Term sig X s))
(hK : sRecognizable (freeAlgebra sig X) s K)
(ρ : SMap X (powerAlgebra (freeAlgebra sig X)).carrier)
(hρ : ∀ (t : S) (x : X t), sRecognizable (freeAlgebra sig X) t (ρ t x)) :
sRecognizable (freeAlgebra sig X) s (substGlobalP ρ s K) := by
sorry
end MSKleeneRead-back
What the Lean code literally says, in plain math · claude-sonnet-5
Read-back of MSKleene.rec_subst
Setting and fixed data. Let be a type (of sorts) that is assumed to be finite. A signature over is a family that assigns to every finite list of sorts and every sort a type of operation symbols of arity and result sort . Fix such a signature . Let be a sorted set of variables, i.e. a family assigning to each sort a type ; assume is sort-finite, meaning the dependent sum (the type of all variables of all sorts together) is a finite type. Fix a sort (an implicit argument).
For each sort , let be the inductively generated type of well-sorted terms of sort : a term is either for a variable , or for an operation symbol with and terms . Let be the -algebra whose carrier at sort is and whose interpretation of an operation symbol sends an argument tuple to the formal term .
The recognizability predicate. For a -algebra , a sort , and a set (subset of the carrier of at sort ), the statement " is -recognizable in " means:
where is a homomorphism, that is, a sort-indexed family of maps satisfying for every operation symbol and every argument tuple , and is the preimage of under at the single sort . The equality is exact set equality. (Since is finite, finiteness of forces each to be finite.)
The power algebra and global substitution. Let be the -algebra whose carrier at sort is the powerset , and whose interpretation of an operation symbol with acts on a tuple of sets with by
Let be a sort-indexed family that assigns to each sort and each variable a set of terms . Let be the evaluation homomorphism induced by : it is the (structurally recursive) homomorphism determined by
Thus for a single term , is the set of all terms obtained from by replacing each occurrence of each variable (of sort ) independently by some element of . For a set , the global substitution is
The assertion. Given:
- , an arbitrary set of terms of sort ;
- a hypothesis that is -recognizable in (in the sense above, with , , );
- the substitution family as above;
- a hypothesis that for every sort and every variable , the set is -recognizable in ;
the theorem concludes:
i.e. there exist a -algebra with finite, a homomorphism , and a set such that . The algebra, homomorphism, and mask witnessing the conclusion are quantified anew and need not relate to those witnessing or .
Edge cases. If the union is empty, so and the conclusion holds trivially. If some , then any in which the variable occurs contributes . The quantifier in ranges over all sorts , including those with empty (for which it is vacuous); if has no variables at all, is vacuous, each , and the statement reduces to . The recognizability hypotheses and are genuine restrictions (not every subset of is -recognizable). No finiteness assumption is placed on the signature ; the standing assumptions are that is finite and that is finite.
Confirmed by the mission captain (proposal self-audit).