Mathlib theorem · Existing formal mathematics

Existing in Mathlib · Computability and logic

Myhill–Nerode Theorem

For each possible prefix x, look at exactly which suffixes y complete x to a word in the language. The language is regular exactly when only finitely many different suffix-languages arise as x varies.

Exact theorem

Exact Mathlib statement

theorem Language.isRegular_iff_finite_range_leftQuotient {α : Type u} {L : Language α} : L.IsRegular ↔ (Set.range L.leftQuotient).Finite

The theorem at a glance

Myhill–Nerode theorem at a glance

A visual guide to the theorem's hypotheses, structure, and conclusion; the exact statement gives the formal detail.

Mathlib's selected Myhill–Nerode endpoint: regularity is equivalent to finiteness of the range of the left-quotient function. Explanatory diagram.
Detailed visual description

A restrained editorial poster gives the exact left-quotient equivalence in large type, defines the left quotient by the suffix condition x ++ y ∈ L, and uses a small two-way automata-and-quotients diagram without adding minimality, Nerode-index, or pumping-lemma claims.

Statement structure

From hypotheses to conclusion

Statement map for Myhill–Nerode TheoremA language is regular if and only if its left-quotient function has finite range. The pinned upstream declaration is Language.isRegular_iff_finite_range_leftQuotient. The exact checked statement is theorem Language.isRegular_iff_finite_range_leftQuotient {α : Type u} {L : Language α} : L.IsRegular ↔ (Set.range L.leftQuotient).Finite.Mathematical readingA language is regular ifand only if itsleft-quotient functionhas finite range.Pinned declarationmathlib ·Language.isRegular_iff_finite_range_leftQuotientExact checked formtheoremLanguage.isRegular_iff_finite_range_leftQuotient{α : Type u} {L :Language α} :L.IsRegular ↔ (Set.rangeL.leftQuotient).FiniteStatement map for Myhill–Nerode TheoremA language is regular if and only if its left-quotient function has finite range. The pinned upstream declaration is Language.isRegular_iff_finite_range_leftQuotient. The exact checked statement is theorem Language.isRegular_iff_finite_range_leftQuotient {α : Type u} {L : Language α} : L.IsRegular ↔ (Set.range L.leftQuotient).Finite.Mathematical readingA language is regular ifand only if itsleft-quotient functionhas finite range.Pinned declarationmathlib ·Language.isRegular_iff_finite_range_leftQuotientExact checked formtheoremLanguage.isRegular_iff_finite_range_leftQuotient{α : Type u} {L :Language α} :L.IsRegular ↔ (Set.rangeL.leftQuotient).Finite

This map summarizes the statement's structure; the exact Mathlib declaration remains authoritative.

Regularity of L is equivalent to the range of x ↦ L.leftQuotient x being finite. Explanatory scientific diagram.
Detailed visual description

This target indexes Mathlib's left-quotient formulation of the Myhill–Nerode theorem. For a language L, leftQuotient sends a word x to the language of suffixes y such that x ++ y ∈ L. The theorem identifies regularity of L with finiteness of the range of that function. It does not, in this declaration, assert uniqueness of a minimal DFA, state finite index of the Nerode equivalence, or derive the pumping lemma.

Why it matters

A mathematical landmark

The theorem gives a structural characterization of regular languages: finite-state recognizability is exactly finiteness of the possible residual languages after prefixes. It is a foundational bridge between automata and language semantics.

ProofAtlas record

What has been checked

Upstream indexedPinned source bytes verified locally
Locally reproducedExact upstream declaration replayed
Reviewed pageCurrent public presentation reviewed
Accepted Atlas resultNot recorded for the preferred artifact

Mathlib is the source of the theorem; the local Lean replay and page review are separate.

Claim boundary

No new theorem is claimed

This target indexes Mathlib's left-quotient formulation of the Myhill–Nerode theorem. For a language L, leftQuotient sends a word x to the language of suffixes y such that x ++ y ∈ L. The theorem identifies regularity of L with finiteness of the range of that function. It does not, in this declaration, assert uniqueness of a minimal DFA, state finite index of the Nerode equivalence, or derive the pumping lemma.

Source and local evidence

Where the theorem comes from

Existing declaration
Language.isRegular_iff_finite_range_leftQuotient in mathlib
Relationship
The checked artifact is the upstream declaration itself
Local Lean evidence
artifact.library.mathlib.myhill-nerode-theorem.v001
Source
Open the pinned upstream reference