Because of the isomorphism (X × A) → X ∼ = X → X A , the transition structure α : X → X A of a deterministic automaton with state set X and with inputs from an alphabet A can be viewed both as an algebra and as a coalgebra. Here we will use this algebra-coalgebra duality of automata as a common perspective for the study of equations and coequations. Equations are sets of pairs of words (v, w) that are satisfied by a state x ∈ X if they lead to the same state: x v = x w . Dually, coequations are sets of languages and are satisfied by x if the language accepted by x belongs to that set. For every automaton (X, α), we define two new automata: free(X, α) and cofree(X, α) that represent, respectively, the greatest set of equations and the smallest set of coequations satisfied by (X, α). Both constructions are shown to be functorial, that is, they act also on automaton homomorphisms. The automaton free(X, α) is isomorphic to the socalled transition monoid of (X, α), and thereby, cofree(X, α) can be seen as its dual. Our main result is that the restrictions of free and cofree to, respectively, preformations of languages and to quotients A * /C of A * with respect to a congruence relation C, form a dual equivalence. In the present context, preformations of languages are sets of -not necessarily regular -languages that are complete atomic Boolean algebras closed under left and right language derivatives. This result is used to give an alternative definition of the notion of "varieties of regular languages" introduced by Eilenberg. This definition, based on equations and coequations, underscores the prominent role of congruences in this kind of results. As a consequence, we present a variant of Eilenberg's celebrated variety theorem for varieties of monoids (in the sense of Birkhoff) and varieties of languages.
AcknowledgementsWe are much obliged to the two anonymous referees: their comments and suggestions have greatly improved our paper.