Corollary 4.8: every regular language is recognizable
ProvedMSKleene.reg_subset_recEvery regular language is recognizable (Corollary 4.8).
For every , .
import Definitions.Def_MSKleene_Recognizable import Definitions.Def_MSKleene_Regular
namespace MSKleene
/-- **Every regular language is recognizable** (Corollary 4.8).
With `S` finite, `Σ` a finite signature, and `X` a finite `S`-sorted set:
for every sort `s`, `Reg_s(T_Σ(X)) ⊆ Rec_s(T_Σ(X))`. -/
theorem reg_subset_rec {S : Type} [Finite S] (sig : Signature S) (X : SSet S)
(hsig : SigFinite sig) (hX : SFinite X) (s : S) :
RegS sig X s ⊆ RecS (freeAlgebra sig X) s := by
sorry
end MSKleeneRead-back
What the Lean code literally says, in plain math · claude-sonnet-5
Read-back.
Fix a type of sorts in the lowest universe and assume is a finite type ([Finite S]). A signature assigns to every finite word of argument sorts and every result sort a type of operation symbols; a sorted set over assigns to every sort a type . We are given such a signature , a sorted set of variables, a fixed sort , and two finiteness hypotheses:
i.e. altogether only finitely many operation symbols (over all arities and result sorts) and only finitely many variables (over all sorts). Let be the sorted set of well-sorted terms: a term of sort is either with , or with and a length-matching vector of terms of sorts . Let be the term algebra, with carrier and operations given by term formation.
The theorem asserts the set inclusion
where each side is a collection of subsets of ; unfolded, the inclusion says: for every set of terms , if is sRegular then is sRecognizable, in the following senses.
is sRegular iff there exists a sorted set of auxiliary variables such that, writing for the sorted set : (1) is a finite type; and (2) there exists a regular expression of sort over generators with
where is the left inclusion and renames every variable occurrence in a term to leaving the term structure otherwise fixed (so the right-hand side is the image of under this renaming). Here a regular expression of sort over a generator set is a term of sort with variables in built from the operation symbols of the regular signature, which are: for each a symbol of arity ; for each sort a nullary symbol ; for each a unary symbol of arity ; for each sort a binary symbol of arity ; and for each pair of sorts and each a binary symbol of arity . The value is obtained by evaluating in the power-set algebra whose carrier at is , under the generator assignment , with the regular symbols interpreted on subsets by:
- sends to (form the term over all elementwise choices of members);
- is ;
- sends to , where and ;
- sends to ;
- sends to ;
where , and is the homomorphism from into its power-set algebra determined by the variable assignment sending (of sort ) to when is the sort of and , and to otherwise; concretely, is the set of all terms obtained from some by replacing each occurrence of , independently, with some element of . Thus applied to is the least set containing and closed under substituting members of for .
is sRecognizable (for the algebra and sort ) iff there exists a -algebra such that: (1) is finite, meaning is a finite type; and (2) there exist a homomorphism of -algebras (a sorted family of maps commuting with every operation of ) and a subset with
Scope notes: the outer statement is a plain inclusion of families of subsets, hence a universally quantified implication over all ; nothing constrains the auxiliary set , the regular expression , the recognizing algebra , the homomorphism , or the accepting subset beyond what is stated (in particular may be empty at some or all sorts, provided stays finite); the degenerate case is included and is sRegular (take ) and sRecognizable (take ); if is empty there is no sort and the statement is vacuous; the interpretation always contains (the stage) and its union ranges over all of ; and the hypotheses hsig (SigFinite sig) and hX (SFinite X) are assumed but do not reappear explicitly in the conclusion.
Confirmed by the mission captain (proposal self-audit).