The syntactic monoid of a language #
The syntactic monoid of a language L : Language α is the quotient of the free monoid
FreeMonoid α by the syntactic congruence: two words are identified when no two-sided context
distinguishes them as L-members, ∀ x y, x ++ u ++ y ∈ L ↔ x ++ v ++ y ∈ L.
It is the coarsest congruence saturating L, so the syntactic morphism factors through every
recognizing homomorphism, and the quotient is finite exactly when L is regular. This is the
two-sided refinement of the one-sided right-Nerode quotient Language.leftQuotient, carrying a
monoid structure rather than a bare set of states.
Main definitions #
Language.syntacticCon: the syntactic congruence, two-sided context equivalenceLanguage.SyntacticMonoid: the quotient monoid(syntacticCon L).QuotientLanguage.toSyntacticMonoid: the projectionFreeMonoid α →* L.SyntacticMonoidLanguage.syntacticClass: the syntactic class of a wordLanguage.Recognizes:φrecognizesL, i.e.Lis a union ofφ-fibresLanguage.rightQuotient: the right-quotient dual ofLanguage.leftQuotient
Main results #
Language.recognizes_iff_ker_le: the syntactic congruence is the coarsest congruence saturatingL— a hom recognizesLexactly when its kernel refines itLanguage.syntacticCon_eq_ker_transitionHom: the intrinsic congruence is the kernel of the transition action ofL.toDFALanguage.isRegular_iff_finite_syntacticMonoid: the Myhill–Nerode theorem in monoid form
References #
Syntactic equivalence #
Two words are syntactically equivalent for L when no two-sided context distinguishes
them as L-members.
Equations
- L.SyntacticEquiv u v = ∀ (x y : List α), x ++ u ++ y ∈ L ↔ x ++ v ++ y ∈ L
Instances For
The syntactic congruence and monoid #
The syntactic congruence of L identifies two words when no two-sided context distinguishes
them as L-members.
Equations
- L.syntacticCon = { r := fun (u v : FreeMonoid α) => L.SyntacticEquiv (FreeMonoid.toList u) (FreeMonoid.toList v), iseqv := ⋯, mul' := ⋯ }
Instances For
The syntactic congruence refines the Nerode equivalence uniformly: u and v are related
when their left quotients agree in every left context.
The syntactic monoid of L is the quotient of FreeMonoid α by the syntactic congruence.
Equations
- L.SyntacticMonoid = L.syntacticCon.Quotient
Instances For
The syntactic morphism of L projects FreeMonoid α onto the syntactic monoid.
Equations
- L.toSyntacticMonoid = L.syntacticCon.mk'
Instances For
The syntactic class of a word #
The syntactic class of a word w is its image in the syntactic monoid.
Equations
- L.syntacticClass w = L.toSyntacticMonoid (FreeMonoid.ofList w)
Instances For
Universal property #
φ recognizes L when L is the FreeMonoid.ofList-pullback of a union of
φ-fibres.
Equations
- Language.Recognizes φ L = ∃ (S : Set M), L = ⇑FreeMonoid.ofList ⁻¹' ⇑φ ⁻¹' S
Instances For
Minimality of the syntactic monoid: it divides every monoid recognising L — the
image of φ surjects onto the syntactic quotient through the first isomorphism theorem.
Connection to the minimal DFA #
A DFA's transition action recognizes the language it accepts.
The kernel of the minimal DFA's transition action has the same left-quotient characterization as the syntactic congruence.
The intrinsic syntactic congruence is the kernel of the minimal DFA's transition action.
Myhill–Nerode #
L is regular iff L.SyntacticMonoid is finite.
Boolean combinations #
Quotients #
The right quotient of L by u is the set of prefixes w such that w ++ u is in L.
Equations
- L.rightQuotient u = {w : List α | w ++ u ∈ L}