Langlib

Langlib.Classes.Regular.Closure.InverseHomomorphism

Regular Closure Under Inverse Homomorphism #

Proof idea: keep the DFA for the target language, but replace each input step on a by the DFA transition over the whole word h a. After reading w, the new automaton is in exactly the state the old automaton would reach on w.flatMap h.

Regular Closure Under Inverse String Homomorphism #

This file proves that regular languages are closed under inverse string homomorphism. Given a DFA M recognising L and a string homomorphism h : β → List α, we construct a DFA for h⁻¹(L) = {w ∈ β* | h*(w) ∈ L} by composing h into the transition function.

Main results #

noncomputable def inverseHomDFA {α : Type u_1} {β : Type u_2} {σ : Type u_3} (M : DFA α σ) (h : βList α) :
DFA β σ

DFA for the inverse homomorphism h⁻¹(L).

Given a DFA M over α and a string homomorphism h : β → List α, the new DFA has the same state set but transitions via M.evalFrom q (h b) — it processes the entire image h(b) in one step.

Equations
Instances For
    theorem inverseHomDFA_eval {α : Type u_1} {β : Type u_2} {σ : Type u_3} (M : DFA α σ) (h : βList α) (w : List β) :
    @[simp]
    theorem inverseHomDFA_accept {α : Type u_1} {β : Type u_2} {σ : Type u_3} (M : DFA α σ) (h : βList α) :
    theorem inverseHomDFA_correct {α : Type u_1} {β : Type u_2} {σ : Type u_3} (M : DFA α σ) (h : βList α) :
    theorem Language.IsRegular.inverseStringHomomorphism {α : Type u_1} {β : Type u_2} {L : Language α} (hL : L.IsRegular) (h : βList α) :

    Regular languages are closed under inverse string homomorphism.

    The class of regular languages is closed under inverse string homomorphism.