The free monoid on a given set is the monoid whose elements are all the strings of zero or more elements from that set, with string concatenation as the monoid operation and the empty string as the identity element. Given a subset of a free monoid, one may define sets that consist of formal left or right inverses of elements in. These are called quotients, and one may define right or left quotients, depending on which side one is concatenating. Thus, the right quotient of by an element from is the set Similarly, the left quotient is
Syntactic equivalence
The syntactic quotient induces an equivalence relation on M, called the syntactic relation, or syntactic equivalence . The right syntactic equivalence is the equivalence relation Similarly, the left syntactic relation is The syntactic congruence or Myhill congruence may be defined as The definition extends to a congruence defined by a subset S of a general monoid M. A disjunctive set is a subset S such that the syntactic congruence defined by S is the equality relation. Let uscall the equivalence class of for the syntactic congruence. The syntactic congruence is compatible with concatenation in the monoid, in that one has for all. Thus, the syntactic quotient is a monoid morphism, and induces a quotient monoid This monoid is called the syntactic monoid of S. It can be shown that it is the smallest monoid that recognizes S; that is, M recognizes S, and for every monoid N recognizing S, M is a quotient of a submonoid of N. The syntactic monoid of S is also the transition monoid of the minimal automaton of S. Similarly, a language L is regularif and only if the family of quotients is finite. The proof showing equivalence is quite easy. Assume that a string x is read by a deterministic finite automaton, with the machine proceeding into state p. If y is another string read by the machine, also terminating in the same state p, then clearly one has. Thus, the number of elements in is at most equal to the number of states of the automaton and is at most the number of final states. Assume, conversely, that the number of elements in is finite. One can then construct an automaton where is the set of states, is the set of final states, the language L is the initial state, and the transition function is given by. Clearly, this automaton recognizes L. Thus, a language L is recognizable if and only if the set is finite. Note that this proof also builds the minimal automaton. Given a regular expressionE representing S, it is easy to compute the syntactic monoid of S. A group language is one for which the syntactic monoid is a group.
Examples
Let L be the language over A = of words of even length. The syntactic congruence has two classes, L itself and L1, the words of odd length. The syntactic monoid is the group of order 2 on.
The free monoid on A is the syntactic monoid of the language, where wR denotes the reversal of word w.
Every finite monoid is homomorphic to the syntactic monoid of some non-trivial language, but not every finite monoid is isomorphic to a syntactic monoid.
Every finite group is isomorphic to the syntactic monoid of some non-trivial language.
The language over in which the number of occurrences of a and b are congruent modulo 2n is a group language with syntactic monoid Z/2n.