Proposition 4.10: every recognizable language is regular
ProvedMSKleene.rec_subset_regEvery recognizable language is regular (Proposition 4.10).
For every , . The proof is a constructive state elimination: from a recognizing homomorphism it builds, by induction on a sortwise budget, a regular expression denoting the language (Main Claim 4.13).
import Definitions.Def_MSKleene_Recognizable import Definitions.Def_MSKleene_Regular
namespace MSKleene
/-- **Every recognizable language is regular** (Proposition 4.10).
With `S` finite, `Σ` a finite signature, and `X` a finite `S`-sorted set:
for every sort `s`, `Rec_s(T_Σ(X)) ⊆ Reg_s(T_Σ(X))`. The proof is a
constructive state elimination carrying a sortwise budget (Main Claim 4.13). -/
theorem rec_subset_reg {S : Type} [Finite S] (sig : Signature S) (X : SSet S)
(hsig : SigFinite sig) (hX : SFinite X) (s : S) :
RecS (freeAlgebra sig X) s ⊆ RegS sig X s := by
sorry
end MSKleeneRead-back
What the Lean code literally says, in plain math · claude-sonnet-5
The theorem rec_subset_reg is universally quantified over: an arbitrary type of "sorts" equipped with a Finite instance (so has only finitely many elements); an arbitrary many‑sorted signature , which assigns to each input word and output sort a type of operation symbols of that profile; and an arbitrary sorted family of variables . It takes two finiteness hypotheses,
i.e. the total type of all operation symbols across all profiles is finite, and the total type of all variables across all sorts is finite (finiteness here is the propositional "is a finite type", not a chosen enumeration). It also fixes one sort (whose mere presence forces to be inhabited). Write for the type of well‑sorted terms of sort built from a variable family and the symbols of , and let be the term algebra, whose carrier at sort is and whose operation for a symbol is the formal constructor sending an argument tuple to the term . The conclusion is the set inclusion
read as an inclusion between two collections of subsets of : every set that is "‑recognizable" over is also "‑regular" over and .
Unfolding "recognizable": asserts the existence of a ‑algebra — a carrier family together with, for every symbol , an operation taking a ‑indexed tuple of arguments drawn from to an element of — such that is finite in the sense that is a finite type; together with a homomorphism , meaning a sorted map satisfying for every symbol and every argument tuple; and a subset ; such that
i.e. is exactly . This is an exact equality of sets; no surjectivity or any further condition is placed on or , and degenerate choices and are included (making and recognizable).
Unfolding "regular": asserts the existence of an auxiliary sorted variable family such that the sortwise disjoint union is finite in the sense that is a finite type, together with a "regular expression" of sort (defined below), such that
an exact equality of subsets of , where relabels a term over into a term over by replacing every variable (at every sort, recursively through the whole term, leaving function symbols untouched) with its left injection ; so the right‑hand side is the image of under this inclusion‑relabeling. A regular expression of sort is an element of : a term of sort whose variables are drawn from and whose function symbols come from the extended signature , which at profile consists of a symbol for each original (with the same profile); for , a nullary symbol for every output sort ; for , a unary symbol for each ; for , a binary symbol ; and for , a binary symbol for each .
The semantics is the value at sort , applied to , of the unique ‑algebra homomorphism from the free ‑algebra on variable set into the algebra that sends each variable to the singleton set . The algebra has carrier (sets of ordinary ‑terms) and interprets the extended symbols as:
- with , applied to a tuple of sets indexed by the sorts of , yields , the set of formal applications of whose ‑th argument ranges over ;
- yields the empty set ;
- (with ), applied to a single set , yields , where and ;
- , applied to two sets , yields ;
- (with ), applied to a set of sort and a set of sort , yields ;
where , and is the homomorphism from the free ‑algebra on into its power algebra induced by the variable assignment sending (at its own sort) to the set and every other variable (at any sort) to ; concretely is the set of all terms obtained from by replacing each occurrence of independently with an arbitrary element of while leaving every other variable unchanged, and takes the union of this over all . In particular is the set of terms reachable from by finitely many successive rounds of substituting elements of for , and it always contains itself via stage . The theorem asserts that for every such , Finite S instance, , , proofs and , and sort , and for every , the existence of the finite algebra , homomorphism , and subset above entails the existence of the auxiliary family and regular expression above.
Confirmed by the mission captain (proposal self-audit).