All proofs
Project-declaredLean 4.24.0-rc1 · mathlib@aad26963

Omega reg lang iff finite union form

omega_reg_lang_iff_finite_union_form

Plain-language statement

An ω-language is ω-regular if and only if it is the finite union of sets of the form U * V^ω, where all Us and Vs are regular languages.

Exact Lean statement

theorem omega_reg_lang_iff_finite_union_form [Inhabited A] {L : Set (Stream' A)} :
    OmegaRegLang L ↔
    ∃ n : ℕ, ∃ U V : Fin n → Set (List A),
      (∀ i, RegLang (U i) ∧ RegLang (V i)) ∧ L = ⋃ i, (U i) * (V i)^ω

Formal artifact

Lean source

Canonical source
Full Lean sourceLean 4
theorem omega_reg_lang_iff_finite_union_form [Inhabited A] {L : Set (Stream' A)} :    OmegaRegLang L      n : ,  U V : Fin n  Set (List A),      ( i, RegLang (U i)  RegLang (V i))  L = ⋃ i, (U i) * (V i)^ω := by  constructor  · rintro M, acc, h_fin, rfl    rw [Automata.omega_reg_lang_finite_union_form]    have eq_init : Fin (Nat.cardM.init) ≃ ↑M.init := by exact (Finite.equivFinAutomata.NA.init).symm    have eq_acc : Fin (Nat.card ↑acc) ≃ ↑acc := by exact (Finite.equivFin ↑acc).symm    have eq_prod := Equiv.prodCongr eq_init eq_acc    have eq_fin_prod := (finProdFinEquiv (m := Nat.cardM.init) (n := Nat.card ↑acc)).symm    have eq := Equiv.trans eq_fin_prod eq_prod    use (Nat.cardM.init * Nat.card ↑acc)    use (fun i  M.PairLang (eq i).1 (eq i).2)    use (fun i  M.PairLang (eq i).2 (eq i).2)    constructor    · intro i ; constructor <;> exact Automata.pair_lang_regular    · ext as ; simp ; constructor      · rintro s0, h_s0, sa, h_sa, h_mem        use (eq.invFun (s0, h_s0, sa, h_sa))        simp [h_mem]      · rintro i, h_mem        use (eq i).1 ; simp        use (eq i).2 ; simp [h_mem]  · rintro n, U, V, h_reg, rfl    induction' n with n h_ind    · use { State := Unit, init := {}, next := fun _ _  {} }, {} ; constructor      · exact Finite.of_fintype Unit      ext as ; simp ; by_contra h_contra      obtain ss, h_run, _ := h_contra      simp [Automata.NA.InfRun] at h_run    let U' := (fun i : Fin n  U i.castSucc)    let V' := (fun i : Fin n  V i.castSucc)    specialize h_ind U' V' (by intro i ; simp [U', V', h_reg i.castSucc])    have h : (⋃ i, (U i) * (V i)^ω)           = (⋃ i, (U' i) * (V' i)^ω) ∪ (U (Fin.last n)) * (V (Fin.last n))^ω := by      ext as ; simp ; constructor      · rintro i, h_i        obtain (i', rfl | rfl) := Fin.eq_castSucc_or_eq_last i        . left ; use i'        . right ; assumption      · rintro (i, h_i | h_n)        · use i.castSucc        · use (Fin.last n)    rw [h]    apply omega_reg_lang_union h_ind    apply omega_reg_lang_concat    · exact (h_reg (Fin.last n)).1    · apply omega_reg_lang_omega_iter      exact (h_reg (Fin.last n)).2
Project
Automata Theory
License
Apache-2.0
Commit
f196548710ce
Source
AutomataTheory/Languages/OmegaRegLang.lean:148-197

Reuse this declaration

Bring the exact result into your workflow

The import identifies the source module. Your project still needs the pinned package dependency shown on this page.

What this badge means

This completion status comes from the project or community source. It has not yet been represented here as an independent rebuild and axiom audit.

Continue in this project

Related declarations

Project-declaredLean 4.24.0-rc1

Acc lang congr

acc_lang_congr

Plain-language statement

The language accepted by c.toDA with a unique accepting state s is exactly the equivalence class of s.

automata theoryformal languagescomputer science

Source project: Automata Theory

Person-level attribution pending.

View proof record
Project-declaredLean 4.24.0-rc1

Acc lang concat e

Automata.acc_lang_concat_e

Plain-language statement

The language of the concatenation NA that is accepted by M0's accepting states is the language accepted by M0.

automata theoryformal languagescomputer science

Source project: Automata Theory

Person-level attribution pending.

View proof record
Project-declaredLean 4.24.0-rc1

Acc lang concat ne

Automata.acc_lang_concat_ne

Plain-language statement

The language of the concatenation NA that is accepted by M1's accepting states is the language accepted by M0 concatenated with the language accepted by M1 minus the empty word.

automata theoryformal languagescomputer science

Source project: Automata Theory

Person-level attribution pending.

View proof record