Langlib

Langlib.Classes.Regular.Decidability.Equivalence

Decidability of Equivalence for Regular Languages #

This file proves that equivalence is decidable for regular languages.

The proof reduces equivalence to emptiness of the symmetric difference: L₁ = L₂ ↔ symmDiff L₁ L₂ = ∅, and the symmetric difference is regular (by closure under complement, intersection, and union).

Main results #

theorem eq_iff_symmDiff_eq_bot {α : Type u_1} (L₁ L₂ : Language α) :
L₁ = L₂ symmDiff L₁ L₂ =
theorem symmDiff_isRegular {α : Type u_1} {L₁ L₂ : Language α} (h₁ : L₁.IsRegular) (h₂ : L₂.IsRegular) :
(symmDiff L₁ L₂).IsRegular
noncomputable def regular_equivalence_decidable {α : Type u_1} [Fintype α] [DecidableEq α] (L₁ L₂ : Language α) (h₁ : L₁.IsRegular) (h₂ : L₂.IsRegular) :
Decidable (L₁ = L₂)

Equivalence of two regular languages is decidable.

Equations
Instances For

    Uniform computability over encoded right-regular grammars #

    A coarse product subset-DFA state bound for comparing two encoded right-regular grammars.

    Equations
    Instances For

      The raw uniform equivalence decider for encoded right-regular grammars.

      Equivalence is uniformly computable for the regular languages: encoded right-regular grammars are an adequate, effective presentation (regularLanguageOf_characterizes) with uniformly decidable equivalence.