Prove2Me
Navigate
DiscoverFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Corollary 3.32: operation symbols preserve recognizability

Proved
MSKleene.rec_op

by Cosme · Sep 8, 2026 · Mathlib 0df444a (Lean v4.33.1)

formal-languagesmany-sorted-algebratree-automatauniversal-algebra

Operation symbols preserve recognizability (Corollary 3.32).

Let (s,s)∈S⋆×S(\mathbf{s},s)\in S^{\star}\times S(s,s)∈S⋆×S, σ∈Σs,s\sigma\in\Sigma_{\mathbf{s},s}σ∈Σs,s​, and (Lj)j∈∏jRecsj(TΣ(X))(L_{j})_{j}\in\prod_{j}\mathrm{Rec}_{s_{j}}(\mathbf{T}_{\Sigma}(X))(Lj​)j​∈∏j​Recsj​​(TΣ​(X)). Then σTΣ(X)℘((Lj)j)∈Recs(TΣ(X))\sigma^{\mathbf{T}_{\Sigma}(X)^{\wp}}((L_{j})_{j})\in\mathrm{Rec}_{s}(\mathbf{T}_{\Sigma}(X))σTΣ​(X)℘((Lj​)j​)∈Recs​(TΣ​(X)). (From CVCL20, Cor. 3.21.)

Preamble
import Definitions.Def_MSKleene_Term
import Definitions.Def_MSKleene_Recognizable
import Definitions.Def_MSKleene_Power
Formal statement
namespace MSKleene

/-- **Operation symbols preserve recognizability** (Corollary 3.32; from CVCL20).

With `S` and `X` finite: for `σ ∈ Σ_{w,s}` and a tuple `Ls` of languages, each
`s_j`-recognizable, the image `σ^{T_Σ(X)^℘}(Ls)` is `s`-recognizable. -/
theorem rec_op {S : Type} [Finite S] (sig : Signature S) (X : SSet S)
    (hX : SFinite X) {w : List S} {s : S} (σ : sig w s)
    (Ls : Args (fun s => Set (Term sig X s)) w)
    (hLs : Args.All (fun s L => sRecognizable (freeAlgebra sig X) s L) Ls) :
    sRecognizable (freeAlgebra sig X) s (powerOp (freeAlgebra sig X) σ Ls) := by
  sorry

end MSKleene
Source
Gong, Ruiz Mora, Sanmartín Vich, Cosme Llópez, "A Kleene theorem for free many-sorted algebras", 2026
Read-back

What the Lean code literally says, in plain math · claude-sonnet-5

Fix a type SSS of sorts together with an instance witnessing that SSS is a finite type. Let sig\mathrm{sig}sig be a signature over SSS: for every list of sorts w∈List Sw\in\mathrm{List}\,Sw∈ListS and every sort s∈Ss\in Ss∈S, sig(w,s)\mathrm{sig}(w,s)sig(w,s) is a type whose elements are the operation symbols of input profile www and output sort sss. (No hypothesis asserts that the total collection of operation symbols is finite.) Let XXX be a sorted set of variables, i.e. a family (Xs)s∈S(X_s)_{s\in S}(Xs​)s∈S​ of types, and assume hX:SFinite XhX:\mathrm{SFinite}\,XhX:SFiniteX, meaning the dependent sum ∑s∈SXs\sum_{s\in S}X_s∑s∈S​Xs​ is a finite type (finitely many variables in total).

Write T=freeAlgebra sig XT=\mathrm{freeAlgebra}\,\mathrm{sig}\,XT=freeAlgebrasigX for the term algebra: its carrier at sort sss is the inductive type Term(sig,X)s\mathrm{Term}(\mathrm{sig},X)_sTerm(sig,X)s​ of well-sorted terms, each of which is either a variable var(x)\mathrm{var}(x)var(x) with x∈Xsx\in X_sx∈Xs​ or an application app τ (t1,…,tk)\mathrm{app}\,\tau\,(t_1,\dots,t_k)appτ(t1​,…,tk​) with τ∈sig(v,s)\tau\in\mathrm{sig}(v,s)τ∈sig(v,s) and the tjt_jtj​ terms of the sorts listed in vvv; the operation of TTT interpreting a symbol τ\tauτ on an argument tuple is the formal term app τ\mathrm{app}\,\tauappτ applied to that tuple.

Fix an implicit list of sorts w=[s1,…,sn]w=[s_1,\dots,s_n]w=[s1​,…,sn​] and an implicit sort sss, and let σ∈sig(w,s)\sigma\in\mathrm{sig}(w,s)σ∈sig(w,s) be an operation symbol. Let Ls=(L1,…,Ln)Ls=(L_1,\dots,L_n)Ls=(L1​,…,Ln​) be a tuple indexed by www whose iii-th component is a set of terms of sort sis_isi​, i.e. Li⊆Term(sig,X)siL_i\subseteq\mathrm{Term}(\mathrm{sig},X)_{s_i}Li​⊆Term(sig,X)si​​; when n=0n=0n=0 this tuple is empty.

The hypothesis hLshLshLs states that every component is recognizable in TTT: for each i∈{1,…,n}i\in\{1,\dots,n\}i∈{1,…,n}, sRecognizable T si Li\mathrm{sRecognizable}\,T\,s_i\,L_isRecognizableTsi​Li​ holds (for n=0n=0n=0 this hypothesis is the vacuously true empty conjunction). Here sRecognizable A s^ L\mathrm{sRecognizable}\,A\,\hat s\,LsRecognizableAs^L means that there exists a sig\mathrm{sig}sig-algebra BBB such that:

  • BBB is finite, i.e. ∑s′∈SB.carriers′\sum_{s'\in S}B.\mathrm{carrier}_{s'}∑s′∈S​B.carriers′​ is a finite type; and
  • there exist an algebra homomorphism f:A→Bf:A\to Bf:A→B — a sortwise family of maps fs′:A.carriers′→B.carriers′f_{s'}:A.\mathrm{carrier}_{s'}\to B.\mathrm{carrier}_{s'}fs′​:A.carriers′​→B.carriers′​ satisfying, for all v,s′,τ∈sig(v,s′)v,s',\tau\in\mathrm{sig}(v,s')v,s′,τ∈sig(v,s′) and all argument tuples aaa, the equation fs′(A.op τ a)=B.op τ (a with f applied componentwise)f_{s'}\big(A.\mathrm{op}\,\tau\,a\big)=B.\mathrm{op}\,\tau\,\big(a\text{ with }f\text{ applied componentwise}\big)fs′​(A.opτa)=B.opτ(a with f applied componentwise) — together with a subset M⊆B.carriers^M\subseteq B.\mathrm{carrier}_{\hat s}M⊆B.carriers^​;
  • such that fs^−1(M)=Lf_{\hat s}^{-1}(M)=Lfs^−1​(M)=L as sets, i.e. for every x∈A.carriers^x\in A.\mathrm{carrier}_{\hat s}x∈A.carriers^​ one has x∈L  ⟺  fs^(x)∈Mx\in L\iff f_{\hat s}(x)\in Mx∈L⟺fs^​(x)∈M.

The conclusion is sRecognizable T s (powerOp T σ Ls)\mathrm{sRecognizable}\,T\,s\,\big(\mathrm{powerOp}\,T\,\sigma\,Ls\big)sRecognizableTs(powerOpTσLs), where

powerOp T σ Ls  =  { y∈Term(sig,X)s  ∣  ∃ (t1,…,tn), (t1∈L1∧⋯∧tn∈Ln) ∧ y=app σ (t1,…,tn) },\mathrm{powerOp}\,T\,\sigma\,Ls \;=\; \big\{\, y\in\mathrm{Term}(\mathrm{sig},X)_s \;\big|\; \exists\,(t_1,\dots,t_n),\ \big(t_1\in L_1 \wedge \cdots \wedge t_n\in L_n\big) \ \wedge\ y=\mathrm{app}\,\sigma\,(t_1,\dots,t_n) \,\big\},powerOpTσLs={y∈Term(sig,X)s​​∃(t1​,…,tn​), (t1​∈L1​∧⋯∧tn​∈Ln​) ∧ y=appσ(t1​,…,tn​)},

that is, the set of all terms of sort sss of the form σ(t1,…,tn)\sigma(t_1,\dots,t_n)σ(t1​,…,tn​) obtained by choosing one term ti∈Lit_i\in L_iti​∈Li​ from each component.

In words: assuming SSS is finite, the variable family XXX has finitely many elements in total, and every LiL_iLi​ is recognizable in the term algebra TTT, the theorem asserts that the "elementwise σ\sigmaσ-application" set {σ(t1,…,tn)∣ti∈Li for all i}\{\sigma(t_1,\dots,t_n)\mid t_i\in L_i\text{ for all }i\}{σ(t1​,…,tn​)∣ti​∈Li​ for all i} is again recognizable in TTT — i.e. there exist a finite sig\mathrm{sig}sig-algebra BBB, a homomorphism f:T→Bf:T\to Bf:T→B, and a subset M⊆B.carriersM\subseteq B.\mathrm{carrier}_sM⊆B.carriers​ whose preimage under fsf_sfs​ is exactly that set. In the degenerate case n=0n=0n=0, σ\sigmaσ is a constant symbol, the hypothesis hLshLshLs carries no content, and the claim reduces to: the singleton set {app σ ()}\{\mathrm{app}\,\sigma\,()\}{appσ()} consisting of the single constant term is recognizable in TTT.

Human review
  • Endorsed by Shuze Chen · Sep 9, 2026

  • Endorsed by Cosme · Sep 9, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paper
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me