Syntactic topos
Project: Topoi of automata
Contents
The syntactic monoid of a language is the smallest quotient monoid of $\Sigma^*$ that recognizes the language. The syntactic topos is its analogue with topoi in place of monoids: a surjective monoid homomorphism from $\Sigma^*$ is replaced by a hyperconnected geometric morphism from the topos of $\Sigma$-sets. It is defined for every class of languages, regular or not, and for one regular language it is the topos of presheaves on the syntactic monoid.
1. Idea§
Fix a finite alphabet $\Sigma$, and let $\Sigma\text{-}\mathbf{Set}$ be the topos of $\Sigma$-sets. In algebraic language theory, a surjective monoid homomorphism $\varphi:\Sigma^*\to M$ recognizes a language $L$ if $L=\varphi^{-1}(S)$ for some subset $S\subseteq M$. Such a homomorphism induces a hyperconnected geometric morphism from $\Sigma\text{-}\mathbf{Set}$ to the topos of right $M$-sets (lemma).
The hyperconnected morphism to the topos of orbit-finite $\Sigma$-sets recognizes exactly the regular languages (proposition). Other hyperconnected morphisms recognize other classes of languages.
2. Definition§
A hyperconnected geometric morphism $h$ from $\Sigma\text{-}\mathbf{Set}$ has a fully faithful inverse image $h^*$. So we regard the codomain of $h$ as a full subcategory of $\Sigma\text{-}\mathbf{Set}$, the essential image $\mathcal E_h$ of $h^*$, and call it a hyperconnected quotient. We order the hyperconnected quotients by inclusion.
Definition 2.1 (Σ-set of languages)§
Write $\mathcal L$ for the $\Sigma$-set of all languages, with the action $L\cdot w=w^{-1}L=\{v\in\Sigma^*\mid wv\in L\}$.
Definition 2.2 (Recognition)§
A hyperconnected geometric morphism $h$ from $\Sigma\text{-}\mathbf{Set}$ recognizes a language $L$ if $L$ belongs to the sub-$\Sigma$-set $\mathcal L_h=h^*h_*\mathcal L\rightarrowtail\mathcal L$ given by the counit of $h^*\dashv h_*$. So $\mathcal L_h$ is the set of the languages that $h$ recognizes.
See Definition 3.2.
Lemma 2.3 (Recognition via subcategories)§☆
Let $h$ be a hyperconnected geometric morphism from $\Sigma\text{-}\mathbf{Set}$. The essential image $\mathcal E_h$ of $h^*$ is closed under small coproducts, finite products, subobjects and quotients. Moreover, $\mathcal L_h$ is the largest sub-$\Sigma$-set of $\mathcal L$ in $\mathcal E_h$, and $h$ recognizes $L$ if and only if the orbit $O_L=\{w^{-1}L\mid w\in\Sigma^*\}$ lies in $\mathcal E_h$.
Proof§
Both descriptions are in Lemma A.2, its proof and the remark after it: the functor $h^*h_*$ takes the largest subobject in $\mathcal E_h$. So if $L\in\mathcal L_h$, then $O_L\subseteq\mathcal L_h$ lies in $\mathcal E_h$. Conversely, if $O_L\in\mathcal E_h$, then $L\in O_L\subseteq\mathcal L_h$.
Remark 2.4 (Minimal automaton)§
The orbit $O_L$, with $L$ as initial state, is the minimal automaton of $L$ (example). So $h$ recognizes $L$ exactly when the minimal automaton of $L$ lies in $\mathcal E_h$. Equivalently, some $\Sigma$-set in $\mathcal E_h$ recognizes $L$ as an automaton, with a suitable initial state and suitable accepting states.
See p. 54 of the slides Topoi of automata (IRIF).
Definition 2.5 (Syntactic topos)§
For a set $C$ of languages, the syntactic topos $T(C)$ is the smallest hyperconnected quotient of $\Sigma\text{-}\mathbf{Set}$ that recognizes every language in $C$. For a single language $L$, we write $T(L)=T(\{L\})$.
See Definition 3.4; the existence follows from Lemma 3.6 and Proposition 3.8.
3. Examples§
We give the syntactic topoi of the class of all languages and of the class of regular languages.
Example 3.1 (Language classes)§
The syntactic topos of the class of all languages is $\Sigma\text{-}\mathbf{Set}$, and the syntactic topos of the class of regular languages is the topos of orbit-finite $\Sigma$-sets. More examples are listed in Cohomology of language classes.
See pp. 52 and 59 of the slides Topoi of automata (IRIF).
4. Properties§
We compare the syntactic topos with the syntactic monoid, state the Galois connection, and calculate with the local state classifier.
Syntactic monoids§
For a regular language, the syntactic topos is the syntactic monoid, regarded as a topos.
Definition 4.1 (Syntactic monoid)§
The syntactic congruence of a language $L$ is the congruence $\equiv_L$ on the monoid $\Sigma^*$ with $u\equiv_Lv$ if and only if, for all words $x$ and $z$, $xuz\in L\iff xvz\in L$. The **syntactic monoid** of $L$ is the quotient monoid $M_L=\Sigma^*/{\equiv_L}$.
Lemma 4.2 (Monoid quotients)§☆
Let $\phi\colon\Sigma^*\twoheadrightarrow M$ be a surjective monoid homomorphism, and let $\mathcal E_\phi$ be the full subcategory of the $\Sigma$-sets with $q\cdot u=q\cdot v$ whenever $\phi(u)=\phi(v)$. Restriction along $\phi$ is an equivalence from the category $\mathbf{PSh}(M)$ of right $M$-sets to $\mathcal E_\phi$. Moreover, $\mathcal E_\phi$ is a hyperconnected quotient in which every object is a quotient of a coproduct of copies of $M$, with the action $m\cdot w=m\,\phi(w)$.
Proof§
All claims are checked on underlying sets. Since $\phi$ is surjective, restriction is fully faithful, and its image is $\mathcal E_\phi$, the actions that factor through $M$. The equations $q\cdot u=q\cdot v$ pass to small coproducts, finite products, subobjects and quotients, so $\mathcal E_\phi$ is a hyperconnected quotient by Lemma A.2. Finally, $Q\in\mathcal E_\phi$ is the image of $\coprod_{q\in Q}M\to Q$, $(q,m)\mapsto q\cdot m$.
Lemma 4.3 (Syntactic monoid in a power of the orbit)§☆
Let $L$ be a regular language with syntactic monoid $\phi\colon\Sigma^*\twoheadrightarrow M_L$ and orbit $O_L=\{w^{-1}L\mid w\in\Sigma^*\}$. Then $M_L$, as a $\Sigma$-set via $\phi$, is a subobject of a finite power $O_L^n$.
Proof§
We factor a map $\Sigma^*\to O_L^n$ through $\phi$. For a word $x$, the map $f_x\colon\Sigma^*\to O_L$, $u\mapsto(xu)^{-1}L$, is equivariant and depends only on $x^{-1}L$; as $O_L$ is finite by Lemma 2.22, finitely many words $x_1,\dots,x_n$ give all the $f_x$. The map $(f_{x_1},\dots,f_{x_n})$ identifies $u$ and $v$ exactly when $xuz\in L\iff xvz\in L$ for all words $x,z$, that is, when $\phi(u)=\phi(v)$. So it factors through $\phi$ by a monomorphism.
Proposition 4.4 (Syntactic monoid)§☆
If $L$ is regular, then $T(L)$ is the presheaf topos on the syntactic monoid $M_L$, with the quotient induced by $\Sigma^*\twoheadrightarrow M_L$.
See p. 58 of the slides Topoi of automata (IRIF) and the full draft of Topoi of automata II, §3.3.
Proof§
By the recognition lemma, $T(L)$ is the least hyperconnected quotient $\mathcal E_h$ containing the orbit $O_L$; we show that it is $\mathcal E_\phi\simeq\mathbf{PSh}(M_L)$ of the monoid quotient lemma, for $\phi\colon\Sigma^*\twoheadrightarrow M_L$. First, $O_L\in\mathcal E_\phi$: if $\phi(u)=\phi(v)$, then $wuz\in L\iff wvz\in L$ for all $w,z$, so
Conversely, if $O_L\in\mathcal E_h$, then $M_L\in\mathcal E_h$ by the embedding lemma, and so $\mathcal E_\phi\subseteq\mathcal E_h$, since every object of $\mathcal E_\phi$ is a quotient of a coproduct of copies of $M_L$.
Regular languages and the Galois connection§
The next two results describe the languages recognized by one quotient, and then by all quotients at once.
Proposition 4.5 (Myhill–Nerode)§☆
The hyperconnected morphism from $\Sigma$-sets to orbit-finite $\Sigma$-sets recognizes exactly the regular languages.
See p. 54 of the slides Topoi of automata (IRIF) and the full draft of Topoi of automata II, §3.1.
Proof§
For the hyperconnected morphism $h$ to orbit-finite $\Sigma$-sets, $h^*h_*\mathcal L$ is the sub-$\Sigma$-set of languages $L$ with finite orbit $\{w^{-1}L\mid w\in\Sigma^*\}$, by Lemma 2.20. By the Myhill–Nerode theorem (Lemma 2.22), these are exactly the regular languages.
Proposition 4.6 (Galois connection)§☆
A class of languages is quotient-stable if it is closed under $L\mapsto w^{-1}L$ for every word $w$. The assignments $h\mapsto\mathcal L_h$ and $C\mapsto T(C)$ form a Galois connection between the hyperconnected quotients of $\Sigma\text{-}\mathbf{Set}$ and the quotient-stable classes of languages: for every hyperconnected quotient $h$ and every quotient-stable class $C$,
Their fixed points correspond bijectively.
See p. 57 of the slides Topoi of automata (IRIF) and the full draft of Topoi of automata II, §3.5.
Proof§
By the recognition lemma, $\mathcal L_h$ is a sub-$\Sigma$-set of $\mathcal L$, that is, a quotient-stable class, and it grows with $\mathcal E_h$. So $T(C)\le h$ gives $C\subseteq\mathcal L_{T(C)}\subseteq\mathcal L_h$, and the converse is the minimality of $T(C)$. In every Galois connection, the two maps restrict to inverse bijections between their fixed points.
Calculation by the local state classifier§
Hyperconnected quotients are calculated with the Local state classifier, which connects them with congruences on words.
Definition 4.7 (Nerode congruence)§
A right congruence on $\Sigma^*$ is an equivalence relation $\rho$ such that $u\mathrel\rho v$ implies $uw\mathrel\rho vw$ for all words $u$, $v$ and $w$. The Nerode congruence of a language $L$ is the right congruence $\sim_L$ with
Proposition 4.8 (Local state classifier of Σ-sets)§☆
The Local state classifier $\Xi$ of $\Sigma\text{-}\mathbf{Set}$ is the set of the right congruences on $\Sigma^*$. A word $w$ acts on it by sending $\rho$ to the right congruence $\rho\cdot w$ with $u\mathrel{(\rho\cdot w)}v$ if and only if $wu\mathrel\rho wv$. Its cocone map $\xi_{\mathcal L}:\mathcal L\to\Xi$ sends a language $L$ to its Nerode congruence $\sim_L$. The internal filters of $\Xi$ are the subsets that contain the relation with one class and are closed under finite intersections, under larger right congruences, and under the action of words.
Proposition 4.9 (Recognition by Nerode congruences)§☆
Let $h$ be a hyperconnected geometric morphism from $\Sigma\text{-}\mathbf{Set}$, and let $F_h\subseteq\Xi$ be the internal filter that corresponds to $h$. Then $h$ recognizes a language $L$ if and only if $F_h$ contains the Nerode congruence $\sim_L$. More precisely, the following square is a pullback.
See Proposition 3.1.
Proposition 4.10 (Generating filter)§☆
For a set $C$ of languages, the internal filter of $\Xi$ that corresponds to $T(C)$ is the smallest internal filter that contains the Nerode congruence $\sim_L$ for every $L\in C$.
See Proposition 3.8.
5. Related concepts§
6. References§
- [Hor] Ryuya Hora, Topoi of automata II: Hyperconnected geometric morphisms and syntactic topoi, prepreprint (abridged); the full draft is unpublished.
- [Hor24] Ryuya Hora, Topoi of automata I: Four topoi of automata and regular languages, arXiv:2411.06358v2, Lemmas 2.20, 2.22 and A.2.
- [Hor25] Ryuya Hora, Topoi of automata (IRIF), slides, Categories for Automata and Language Theory, IRIF, 6 May 2025, pp. 52–59 and 70.