Proof of Schützenberger's theorem full
This proof shows: statement.
We prove that a regular language L⊆Σ∗ is star-free if and only if its syntactic monoid M(L) is aperiodic. The second half follows the proof in Pin's book, by induction on the ideals of the monoid.
Notation
Σ is a finite alphabet. A finite monoid M is aperiodic if there is an integer N≥0 with mN=mN+1 for all m∈M; we fix such an N. For a language L, ηL:Σ∗→M(L) is the syntactic morphism, which is onto, and u≡Lv means ηL(u)=ηL(v), that is, xuy∈L⇔xvy∈L for all strings x,y. A language L is N-aperiodic if for all strings x,u,y:
xuNy∈L⟺xuN+1y∈L. For elements s,t of a monoid M, write sM={sx:x∈M}, Ms and MsM in the same way, and
- sRt if sM=tM,
- sLt if Ms=Mt,
- sJt if MsM=MtM.
These are equivalence relations, and sRt or sLt implies sJt. Since sx∈sM, we have sxM⊆sM and MsxM⊆MsM for all x.
Lemma 0. For a regular language L, M(L) is aperiodic with constant N if and only if L is N-aperiodic.
Proof. M(L) is finite since L is regular. Each m∈M(L) is ηL(u) for some u, and mN=ηL(uN), mN+1=ηL(uN+1). So mN=mN+1 for all m if and only if uN≡LuN+1 for all u, which is the definition of N-aperiodic. □
Part 1: star-free languages are aperiodic
Star-free languages are regular, since ∅ and {a} are regular and regular languages are closed under union, complement and concatenation. By Lemma 0 it is enough to show that every star-free language is N-aperiodic for some N. We use induction on a star-free expression.
Raising N. If K is N-aperiodic, it is N′-aperiodic for every N′≥N: xuN′y=xuN(uN′−Ny) and xuN′+1y=xuN+1(uN′−Ny), so the definition with y′=uN′−Ny gives the claim.
Base cases. ∅ is 0-aperiodic, since both sides are false. {a} is 2-aperiodic: if u=ε, the two strings xu2y and xu3y are both xy; if u=ε, both have length at least 2, so neither is a.
Complement. If K is N-aperiodic, so is Σ∗∖K, since the condition is symmetric in membership and non-membership.
Union. If K is NK-aperiodic and L is NL-aperiodic, both are N-aperiodic for N=max(NK,NL), by raising, and then K∪L is N-aperiodic.
Concatenation. Let K be NK-aperiodic and L be NL-aperiodic; by raising, we may take NK,NL≥1. Let N=NK+NL+1. We show that KL is N-aperiodic. Fix x,u,y. If u=ε there is nothing to show, so let u=ε. Consider a string xuey with e∈{N,N+1}, and a factorization xuey=vz with v∈K, z∈L. The cut between v and z lies inside x, inside one of the e copies of u, at a border between them, or inside y. Let i be the number of copies of u that lie entirely in v and j the number that lie entirely in z. At most one copy is cut, so i+j≥e−1. If i≥1, then v contains x and the first i copies, so v=xuir for some string r; likewise, if j≥1, then z=r′ujy for some string r′. Below, i≥NK or j≥NL always gives i≥1 or j≥1 respectively.
- From e=N+1 to N. Here i+j≥N=NK+NL+1, so i≥NK+1 or j≥NL+1. If i≥NK+1, then i−1≥NK, and since K is (i−1)-aperiodic by raising, xui−1r∈K. Removing one copy of u from v gives xuNy=(xui−1r)z∈KL. If j≥NL+1, remove one copy from z in the same way.
- From e=N to N+1. Here i+j≥N−1=NK+NL, so i≥NK or j≥NL. If i≥NK, then xui+1r∈K, since K is i-aperiodic, and xuN+1y=(xui+1r)z∈KL. If j≥NL, add one copy to z.
So xuNy∈KL if and only if xuN+1y∈KL. By induction, every star-free language is N-aperiodic for some N, and its syntactic monoid is aperiodic by Lemma 0.
Part 2: aperiodic languages are star-free
Let L be regular with M=M(L) aperiodic, and let φ=ηL. Since L=φ−1(φ(L)) and φ(L) is finite, it is enough to show that φ−1(m) is star-free for every m∈M. The argument uses only that φ:Σ∗→M is an onto morphism to a finite aperiodic monoid. Fix N with mN=mN+1 for all m∈M.
Lemma 1 (stability). For s,t∈M: if s∈MstM, then sRst; if s∈MtsM, then sLts.
Proof. Let s=xsty. By induction on k, s=xks(ty)k for all k≥0. With k=N+1 and xN+1=xN,
s=xNs(ty)N+1=(xNs(ty)N)ty=sty. So s∈stM, hence sM⊆stM; also stM⊆sM. So sM=stM. The second claim is the mirror image. □
Lemma 2. Let m,s∈M with s∈mM∩Mm and m∈MsM. Then s=m.
Proof. Write s=mp=qm and m=usv with p,q,u,v∈M.
- m=usv=um(pv). By induction on k, m=ukm(pv)k. With k=N+1 and uN+1=uN, m=uNm(pv)N+1=(uNm(pv)N)pv=mpv=sv.
- s=qm=qsv, using step 1. By induction on k, s=qksvk. With k=N+1 and qN+1=qN, s=qNsvN+1=(qNsvN)v=sv.
So s=sv=m. □
Corollary 3. If 1∈MsM, then s=1. Proof. Lemma 2 with m=1: s∈1M∩M1 holds for every s. □
The rank. For m∈M let r(m)=∣M∖MmM∣. We show that φ−1(m) is star-free by induction on r(m). If MnM⊋MmM then r(n)<r(m). By Corollary 3, r(m)=0, that is MmM=M∋1, holds only for m=1.
The element 1. Let B={a∈Σ:φ(a)=1}. Then φ−1(1)=B∗. Indeed, if φ(w)=1 and w=xay with a∈Σ, then 1=φ(x)φ(a)φ(y)∈Mφ(a)M, so φ(a)=1 by Corollary 3; and every string over B maps to 1. The language B∗=Σ∗∖⋃a∈Σ∖BΣ∗aΣ∗ is star-free, with Σ∗=∅.
An element m=1. Define the finite sets
- E={(n,a)∈M×Σ:nφ(a)Rm, n∈/mM},
- F={(a,n)∈Σ×M:φ(a)nLm, n∈/Mm},
- C={a∈Σ:m∈/Mφ(a)M},
- G={(a,n,b)∈Σ×M×Σ:m∈Mφ(a)nM∩Mnφ(b)M, m∈/Mφ(a)nφ(b)M},
and the languages
U=(n,a)∈E⋃φ−1(n)a,V=(a,n)∈F⋃aφ−1(n),W=(a,n,b)∈G⋃aφ−1(n)b. Lemma 4. Every n that occurs in E, F or G satisfies MnM⊋MmM.
Proof. Case (n,a)∈E. From nφ(a)Rm, m∈nφ(a)M⊆nM, so MmM⊆MnM. Suppose MmM=MnM. Then n∈MmM=Mnφ(a)M, since nφ(a)Jm, and Lemma 1 gives nRnφ(a)Rm. So n∈nM=mM, which contradicts n∈/mM.
Case (a,n)∈F: the mirror image, with Lemma 1 for L.
Case (a,n,b)∈G. From m∈Mnφ(b)M⊆MnM, MmM⊆MnM. Suppose MmM=MnM. Then n∈MmM⊆Mnφ(b)M, and Lemma 1 gives nRnφ(b), so n=nφ(b)t for some t∈M. Then φ(a)n=φ(a)nφ(b)t, so m∈Mφ(a)nM⊆Mφ(a)nφ(b)M, which contradicts the definition of G. □
By Lemma 4 and the induction hypothesis, each φ−1(n) in U, V and W is star-free. So U, V and W are finite unions of concatenations of star-free languages and letters, and they are star-free; so is the finite set C of one-letter strings.
Lemma 5. For m=1,
φ−1(m)=(UΣ∗∩Σ∗V)∖Σ∗(C∪W)Σ∗. Proof of ⊆. Let φ(w)=m.
- w∈UΣ∗. Let p be the shortest prefix of w with φ(p)Rm; it exists, since w itself qualifies. p=ε: else 1Rm, so 1∈mM⊆MmM and m=1 by Corollary 3. Write p=p′a with a∈Σ, and n=φ(p′). Then nφ(a)=φ(p)Rm. If n∈mM, then nM⊆mM=φ(p)M⊆nM, so nRm, and the shorter prefix p′ qualifies, a contradiction. So (n,a)∈E and p∈φ−1(n)a⊆U.
- w∈Σ∗V, by the mirror argument with the shortest suffix s with φ(s)Lm.
- w∈/Σ∗CΣ∗. If w=xay with a∈C, then m=φ(x)φ(a)φ(y)∈Mφ(a)M, a contradiction.
- w∈/Σ∗WΣ∗. If w=xagby with (a,φ(g),b)∈G, then m∈Mφ(a)φ(g)φ(b)M, a contradiction.
Proof of ⊇. Let w be in the right side and s=φ(w). Since w∈UΣ∗, w=pax with (φ(p),a)∈E, so s∈φ(p)φ(a)M=mM, where the equality is φ(p)φ(a)Rm. In the same way w∈Σ∗V gives s∈Mm.
We show m∈MsM. Suppose not. Then some factor f of w has m∈/Mφ(f)M, for example f=w; take a shortest one. f=ε, since Mφ(ε)M=M∋m. If ∣f∣=1, then f∈C and w∈Σ∗CΣ∗, a contradiction. If ∣f∣≥2, write f=agb with a,b∈Σ and n=φ(g). The factors ag and gb are shorter than f, so m∈Mφ(a)nM and m∈Mnφ(b)M; and m∈/Mφ(a)nφ(b)M. So (a,n,b)∈G, f∈W, and w∈Σ∗WΣ∗, a contradiction.
So s∈mM∩Mm and m∈MsM, and Lemma 2 gives s=m, that is, w∈φ−1(m). □
Conclusion. The right side of Lemma 5 is built from star-free languages by concatenation, intersection and difference, so it is star-free. By induction on r(m), φ−1(m) is star-free for every m∈M, and L=⋃m∈φ(L)φ−1(m) is star-free. Together with Part 1, this proves the theorem. ■
A worked case
For L=(ab)∗ over {a,b}, M(L)={1,a,b,ab,ba,0} (see the syntactic monoid page), and no letter maps to 1, so B=∅ and φ−1(1)={ε}. For m=ab: the R-class of ab is {a,ab} and its L-class is {b,ab}, which give E={(1,a)} and F={(b,1)}. Both letters satisfy ab∈Mφ(c)M, so C=∅, and G={(a,1,a),(b,1,b)}. So U={a}, V={b}, W={aa,bb}, and Lemma 5 gives
φ−1(ab)=(aΣ∗∩Σ∗b)∖Σ∗{aa,bb}Σ∗=(ab)+. With φ(L)={1,ab}, L={ε}∪(ab)+.