duaLab Contribute

Cohomology of language classes

Project: Topoi of automata

Contents

Every Grothendieck topos has cohomology. Hora proposes to use the cohomology of the Syntactic topos $T(C)$ as an invariant of a class $C$ of languages. The aim is to separate classes such as star-free, regular and non-regular languages, with the generalized star-height problem in view.

1. Idea

Grothendieck defined topoi to introduce geometric methods into number theory, which is traditionally regarded as a finite and discrete subject. Automata theory is also regarded as a finite and discrete subject. So we ask whether we can construct a space, that is, a topos, for each class of languages, and extract its topological invariants.

2. Definition

The cohomology of a class of languages is the cohomology of its syntactic topos.

Definition 2.1 (Cohomology of a language class)

Fix a finite alphabet $\Sigma$. For a set $C$ of languages, let $T(C)$ be its Syntactic topos, the smallest hyperconnected quotient of the topos of Σ-sets that recognizes every language in $C$. For an abelian group object $A$ of $T(C)$, the cohomology of $C$ with coefficients in $A$ is the topos cohomology $H^n(T(C),A)$, the $n$-th right derived functor of the global sections functor $A\mapsto\mathrm{Hom}(1,A)$. For a single language $L$, we write $T(L)=T(\{L\})$.

See p. 52 of Topoi of automata (IRIF) and Definition 3.4 of Topoi of automata II.

3. Examples

We first list the syntactic topoi of some classes of languages. Then we compute the cohomology in the easiest case, one language over one letter.

Example 3.1 (Syntactic topoi of language classes)

For a general alphabet $\Sigma$, the syntactic topoi of four classes of languages are as follows. Here $\mathbf{Cont}(M)$ is the topos of continuous actions of a topological monoid $M$, and $\widehat{F_\Sigma}$ is the profinite completion of the free group on $\Sigma$. A group language is a language whose syntactic monoid is a finite group, and a commutative language is a language that contains, with a word, all the words with the same number of occurrences of each letter.

$$\begin{array}{l|l} \text{class }C & T(C)\\ \hline \text{all languages} & \Sigma\text{-}\mathbf{Set}\\ \text{regular languages} & \text{orbit-finite }\Sigma\text{-sets}\\ \text{group languages} & \mathbf{Cont}(\widehat{F_\Sigma})\\ \text{commutative languages} & \mathbf{PSh}(\mathbb N^{\oplus\Sigma}) \end{array}$$

See p. 59 of Topoi of automata (IRIF).

Example 3.2 (Syntactic topoi over one letter)

For a one-letter alphabet $\Sigma=\{a\}$, the syntactic topoi are as follows. A $p$-adic language is a periodic language whose period is a power of the prime $p$. The topos $\mathbf{PSh}(\mathbb N)$ is the topos of discrete dynamical systems, and $\mathbb N\cup\hat{\mathbb Z}$ is the free profinite monoid on one generator.

$$\begin{array}{l|l} \text{class }C & T(C)\\ \hline \text{all languages} & \mathbf{PSh}(\mathbb N)\\ \text{regular languages} & \mathbf{Cont}(\mathbb N\cup\hat{\mathbb Z})\\ \text{star-free languages} & \mathbf{Cont}(\mathbb N\cup\{\infty\})\\ \text{group languages} & \mathbf{Cont}(\hat{\mathbb Z})\\ p\text{-adic languages} & \mathbf{Cont}(\mathbb Z_p) \end{array}$$

See p. 59 of Topoi of automata (IRIF) and the full draft of Topoi of automata II, §3.6.

Example 3.3 (One-letter languages)

Let $\Sigma=\{a\}$ and let $L$ be a language. A coefficient $A$, an abelian group object of $T(L)$, is in particular an abelian group with an endomorphism $f$, the action of $a$. Write $A^f$ for the fixed points and $A/(1-f)$ for the coinvariants of $f$. The cohomology $H^n(T(L),A)$ and the cohomological dimension of $T(L)$ are as follows.

$$\begin{array}{l|l|l|l} L & n=0 & n\ge1 & \text{dimension}\\ \hline \text{star-free} & A^f & 0 & 0\\ \text{regular, not star-free} & A^f & 2\text{-periodic in }n,\text{ need not vanish} & \infty\\ \text{not regular} & A^f & A/(1-f)\text{ for }n=1,\ 0\text{ for }n\ge2 & 1 \end{array}$$

The three dimensions are those of a point, of $\mathbb{RP}^\infty$ and of the circle $S^1$.

See p. 61 of Topoi of automata (IRIF).

Remark 3.4 (Classical inputs)

The underlying cases are the classical cohomology of the free monoid $\mathbb N$ and of cyclic groups, which is $2$-periodic for $\mathbb Z/n\mathbb Z$ [CE56, XII.7].

Remark 3.5 (Group languages)

For $\Sigma=\{a\}$, the syntactic topos $\mathbf{Cont}(\hat{\mathbb Z})$ of group languages is the classifying topos of $\mathrm{Gal}(\overline{\mathbb F_q}/\mathbb F_q)\cong\hat{\mathbb Z}$, whose cohomology is classical; see the next fact.

See p. 38 of Topoi of automata (CSCAT 2025).

Fact 3.6 (Cohomology of $\hat{\mathbb Z}$ [Ser64])

The group $\hat{\mathbb Z}$ has cohomological dimension $1$, that is, $H^n(\hat{\mathbb Z},A)=0$ for $n\ge2$ and torsion coefficients $A$ [Ser64, Ch. I]. This fails for other coefficients: $H^2(\hat{\mathbb Z},\mathbb Z)\cong\mathbb Q/\mathbb Z$. With all coefficients the dimension is $2$: we have $H^n(\hat{\mathbb Z},A)=0$ for $n\ge3$ and every discrete $\hat{\mathbb Z}$-module $A$, since the strict cohomological dimension is at most one more than the cohomological dimension [Ser64, Ch. I, §3.2].

4. Properties

For a regular language, the cohomology is the cohomology of a finite monoid.

Proposition 4.1 (Regular languages)☆

For a regular language $L$ with syntactic monoid $M$, the syntactic topos $T(L)$ is the topos $\mathbf{PSh}(M)$ of right $M$-sets.

See p. 58 of Topoi of automata (IRIF).

Proof

This is the syntactic monoid result for the syntactic topos; see its proof.

Remark 4.2 (Ext description)

Presheaves on $M$ are right $M$-sets, and abelian group objects of $\mathbf{PSh}(M)$ are right $\mathbb ZM$-modules. Let $M$ act trivially on $\mathbb Z$. Then for a regular language $L$ with syntactic monoid $M$ and a right $\mathbb ZM$-module $A$, we have $H^n(T(L),A)=\mathrm{Ext}^n_{\mathbb ZM}(\mathbb Z,A)$.

Example 4.3 (Two letters)

Let $\Sigma=\{a,b\}$. For a regular language $L$ with syntactic monoid $M$, let $\mathbb Z_0$ be the abelian group $\mathbb Z$ on which every non-identity element of $M$ acts by $0$, and let $\mathbb Z$ have the trivial action. The cohomological dimension of $T(L)$ is as follows for four languages.

$$\begin{array}{l|l|l|l} L & \text{star-free} & \text{dimension} & \text{cohomology}\\ \hline \Sigma^*a & \text{yes} & 1 & H^1(T(L),\mathbb Z_0)=\mathbb Z\\ a\Sigma^*b & \text{yes} & 2 & H^2(T(L),\mathbb Z)=\mathbb Z\\ \Sigma\Sigma^*a & \text{yes} & \infty & H^n(T(L),\mathbb Z_0)=\mathbb Z\text{ for all }n\ge1\\ (aa)^* & \text{no} & 0 & H^n(T(L),A)=0\text{ for all }n\ge1\text{ and all }A \end{array}$$

With left actions instead of right actions, read the reversed languages $a\Sigma^*$, $b\Sigma^*a$ and $a\Sigma\Sigma^*$.

Remark 4.4 (Star-freeness over two letters)

So over two letters, unlike in the one-letter example, the cohomological dimension does not tell whether a language is star-free.

5. Open problems

Problem 5.1 (Separation by cohomology)

Can the cohomology of syntactic topoi separate language classes in open problems of automata theory, in particular in the generalized star-height problem?

Remark 5.2 (Evidence)

Already in the one-letter case, the cohomology of $T(L)$ carries information about star height: it tells whether $L$ is star-free, that is, of generalized star height $0$. See pp. 6–8 of Topoi of automata (Groupe de travail topossique) and p. 7 of Topoi of automata (SLACS 2025).

Over two letters, the cohomological dimension alone does not separate the star-free languages: see example.

7. References

Last edited