@@ -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
@@ -110,6 +109,38 @@ theorem mem_buchiFamily [Inhabited Symbol]
110109 xl ++ω xls.flatten = xs := by
111110 grind [buchiFamily]
112111
112+ /-- `na.buchiFamily` is a cover if `na` has only finitely many states.
113+ This theorem uses the Ramsey theorem for infinite graphs and does not depend on any details
114+ of `na.BuchiCongruence` other than that it is of finite index. -/
115+ theorem buchiFamily_cover [Inhabited Symbol] [Finite State] :
116+ ⨆ i, na.buchiFamily i = ⊤ := by
117+ ext xs
118+ simp only [ωLanguage.mem_iSup, Prod.exists, ωLanguage.mem_top, iff_true]
119+ have : Finite (Quotient na.BuchiCongruence.eq) := buchiCongruence_fin_index
120+ let color (t : Finset ℕ) : Quotient na.BuchiCongruence.eq :=
121+ if h : t.Nonempty then ⟦ xs.extract (t.min' h) (t.max' h) ⟧ else ⟦ [] ⟧
122+ obtain ⟨b, ns, h_ns, h_color⟩ := infinite_graph_ramsey color
123+ obtain ⟨f, h_mono, rfl⟩ := strictMono_of_infinite h_ns
124+ let a : Quotient na.BuchiCongruence.eq := ⟦ xs.take (f 0 ) ⟧
125+ use a, b
126+ apply mem_buchiFamily.mpr
127+ let ys := xs.drop (f 0 )
128+ let g := (f · - f 0 )
129+ have h_mono' : StrictMono g := Nat.base_zero_strictMono h_mono
130+ use xs.take (f 0 ), ys.toSegs g, by grind, ?_, by grind
131+ intro k
132+ simp only [toSegs_def, Language.mem_sub_one]
133+ split_ands
134+ · have := h_mono.monotone (show 0 ≤ k by grind)
135+ have := h_mono.monotone (show 0 ≤ k + 1 by grind)
136+ simp [ys, g, extract_drop, show f 0 + (f k - f 0 ) = f k by grind,
137+ show f 0 + (f (k + 1 ) - f 0 ) = f (k + 1 ) by grind]
138+ have := h_mono (show k < k + 1 by grind)
139+ specialize h_color ({f k, f (k + 1 )} : Finset ℕ) (by grind) (by grind)
140+ simp [color] at h_color
141+ grind
142+ · grind [h_mono' (show k < k + 1 by grind)]
143+
113144-- This intermediate result is split out of the proof of `buchiCongruence_saturation` below
114145-- because that proof was too big and kept exceeding the default `maxHeartbeats`.
115146private lemma frequently_via_accept [Inhabited Symbol]
0 commit comments