@@ -7,8 +7,7 @@ Authors: Ching-Tsun Chou
77module
88
99public import Cslib.Computability.Automata.NA.Pair
10- public import Cslib.Computability.Languages.Congruences.RightCongruence
11- public import Cslib.Computability.Languages.OmegaLanguage
10+ public import Cslib.Foundations.Combinatorics.InfiniteGraphRamsey
1211public import Cslib.Foundations.Data.Set.Saturation
1312
1413@[expose] public section
@@ -104,6 +103,38 @@ theorem mem_buchiFamily [Inhabited Symbol]
104103 xl ++ω xls.flatten = xs := by
105104 grind [buchiFamily]
106105
106+ /-- `na.buchiFamily` is a cover if `na` has only finitely many states.
107+ This theorem uses the Ramsey theorem for infinite graphs and does not depend on any details
108+ of `na.BuchiCongruence` other than that it is of finite index. -/
109+ theorem buchiFamily_cover [Inhabited Symbol] [Finite State] :
110+ ⨆ i, na.buchiFamily i = ⊤ := by
111+ ext xs
112+ simp only [ωLanguage.mem_iSup, Prod.exists, ωLanguage.mem_top, iff_true]
113+ have : Finite (Quotient na.BuchiCongruence.eq) := buchiCongruence_fin_index
114+ let color (t : Finset ℕ) : Quotient na.BuchiCongruence.eq :=
115+ if h : t.Nonempty then ⟦ xs.extract (t.min' h) (t.max' h) ⟧ else ⟦ [] ⟧
116+ obtain ⟨b, ns, h_ns, h_color⟩ := infinite_graph_ramsey color
117+ obtain ⟨f, h_mono, rfl⟩ := strictMono_of_infinite h_ns
118+ let a : Quotient na.BuchiCongruence.eq := ⟦ xs.take (f 0 ) ⟧
119+ use a, b
120+ apply mem_buchiFamily.mpr
121+ let ys := xs.drop (f 0 )
122+ let g := (f · - f 0 )
123+ have h_mono' : StrictMono g := Nat.base_zero_strictMono h_mono
124+ use xs.take (f 0 ), ys.toSegs g, by grind, ?_, by grind
125+ intro k
126+ simp only [toSegs_def, Language.mem_sub_one]
127+ split_ands
128+ · have := h_mono.monotone (show 0 ≤ k by grind)
129+ have := h_mono.monotone (show 0 ≤ k + 1 by grind)
130+ simp [ys, g, extract_drop, show f 0 + (f k - f 0 ) = f k by grind,
131+ show f 0 + (f (k + 1 ) - f 0 ) = f (k + 1 ) by grind]
132+ have := h_mono (show k < k + 1 by grind)
133+ specialize h_color ({f k, f (k + 1 )} : Finset ℕ) (by grind) (by grind)
134+ simp [color] at h_color
135+ grind
136+ · grind [h_mono' (show k < k + 1 by grind)]
137+
107138-- This intermediate result is split out of the proof of `buchiCongruence_saturation` below
108139-- because that proof was too big and kept exceeding the default `maxHeartbeats`.
109140private lemma frequently_via_accept [Inhabited Symbol]
0 commit comments