Corollary 4.4: Rec is a closed subset of the regular algebra
ProvedMSKleene.rec_closed_regRec is a closed subset of the regular algebra (Corollary 4.4).
Let be a finite -sorted set. The -sorted set is a closed subset of the -algebra : it is closed under every operation of — the empty constant, union, -iteration, -substitution, and every .
import Definitions.Def_MSKleene_Recognizable import Definitions.Def_MSKleene_RegAlgebra
namespace MSKleene
/-- **`Rec` is a closed subset of the regular algebra** (Corollary 4.4).
With `S` finite and `Z` a finite `S`-sorted set: for every symbol of
`Reg(S,Σ,Z)` and every tuple of `Z`-languages that are componentwise
recognizable, the interpreted regular operation on `T_Σ(Z)^℘` yields a
recognizable language. In particular `(Rec_s(T_Σ(Z)))_s` is closed under
`∅`, `+`, `z`-iteration, `z`-substitution, and every `σ ∈ Σ`. -/
theorem rec_closed_reg {S : Type} [Finite S] (sig : Signature S) (Z : SSet S)
(hZ : SFinite Z) {w : List S} {s : S} (sym : regSig sig Z w s)
(Ls : Args (fun s => Set (Term sig Z s)) w)
(hLs : Args.All (fun s L => sRecognizable (freeAlgebra sig Z) s L) Ls) :
sRecognizable (freeAlgebra sig Z) s ((regPowerAlgebra sig Z).op sym Ls) := by
sorry
end MSKleeneRead-back
What the Lean code literally says, in plain math · claude-sonnet-5
Read-back of MSKleene.rec_closed_reg
Fix a type that carries a Finite instance (so there are only finitely many "sorts"). A signature assigns to every pair — with a finite list of sorts and a sort — a type of operation symbols of input arity and result sort ; no finiteness whatsoever is assumed of . Let be an -indexed family of types ("generators"), and let be the hypothesis that the dependent sum is a finite type. Write for the type of many-sorted terms of sort built from these generators and the symbols of : each yields a term , and each together with terms yields a term . Let be the free -algebra on : its carrier at sort is and its interpretation of a symbol is formal application.
Recognizability. For a sort and a set , " is -recognizable in " means that there exist
- a -algebra (a carrier family with an interpretation of every symbol of ) such that the dependent sum is a finite type;
- a homomorphism of -algebras , i.e. a family of maps satisfying for every symbol of ;
- a set ;
such that
Nothing further is required of , , or .
The statement. Given the finite sort type , the signature , the family , the hypothesis ( finite), an implicit list of sorts (with ), an implicit result sort , an element of the type of "regular" symbols, a tuple with for each , and a hypothesis stating that for every the set is -recognizable in (when this hypothesis holds vacuously), the theorem asserts:
The set is defined by cases on which of the five constructors is (each case constrains the implicit and ):
- for a symbol of the original signature, with arbitrary:
(the elementwise application of to the argument sets; if then is a singleton and says nothing).
- : this constructor forces , so is the empty tuple and is vacuous; then
- carrying a generator : this forces , so with and says is -recognizable; then
i.e. adjoins to every term obtained from some by replacing each occurrence of in , independently, by a term of .
- : this forces , so with and says both are -recognizable; then
- carrying a generator (the constructor's two sort arguments are and the result sort ): this forces , so with and , and says is -recognizable and is -recognizable; then
the set of all terms obtained from some by independently replacing every occurrence of by a term of .
Throughout, — for , , — denotes , where is the evaluation homomorphism from into the power algebra of (carrier at each sort , every symbol interpreted by elementwise application) induced by the assignment that sends the generator to the set and every other generator to the singleton ; concretely, is the set of terms produced from by substituting, independently at each occurrence of , an arbitrary term of , leaving all other variables unchanged.
The algebra is an algebra over the extended signature and is used only to produce the set ; the witnessing algebra , homomorphism , and set in both the hypothesis and the conclusion are for the original signature and the free term algebra . "Finite" in " finite" and in " finite" means finiteness of the single dependent-sum type ranging over all sorts.
Confirmed by the mission captain (proposal self-audit).