@@ -9,6 +9,7 @@ public import Mathlib.Algebra.BigOperators.Fin
99public import Mathlib.Algebra.Order.BigOperators.Group.Finset
1010public import Mathlib.Algebra.CharP.Pi
1111public import Mathlib.Combinatorics.SimpleGraph.Coloring.EdgeLabeling
12+ public import Mathlib.Combinatorics.SimpleGraph.Copy
1213public import Mathlib.Combinatorics.SimpleGraph.DegreeSum
1314public import Mathlib.Data.DFinsupp.WellFounded
1415public import Mathlib.Data.Fin.Basic
@@ -267,6 +268,43 @@ end MonochromaticOf
267268
268269end EdgeLabeling
269270
271+ section
272+
273+ variable {V V' K : Type *} (G : SimpleGraph V) {G' : SimpleGraph V'} (C : EdgeLabeling G' K) (c : K)
274+
275+ def LabelingContains : Prop :=
276+ G ⊑ C.labelGraph c -- should this be `∃ c`?
277+
278+ def LabelingIndContains : Prop :=
279+ G ⊴ C.labelGraph c
280+
281+ variable {G C c}
282+
283+ theorem LabelingIndContains.LabelingContains (h : G.LabelingIndContains C c) :
284+ G.LabelingContains C c :=
285+ h.isContained
286+
287+ end
288+
289+ section
290+
291+ -- todo: add more general defs for graphs in terms of `LabelingContains` and `LabelingIndContains`
292+ -- but keep this def because it is needed to bootstrap existence of ramsey numbers for graphs
293+
294+ /-- The predicate `IsRamseyValid V n` states that the type `V` is large enough to guarantee a
295+ clique of size `n k` for some colour `k : K`. -/
296+ def IsRamseyValid' (V : Type *) (n : K → ℕ) : Prop :=
297+ ∀ C : TopEdgeLabeling V K,
298+ ∃ (m : Finset V) (k : K), (⊤ : SimpleGraph V).LabelingContains C k ∧ n k ≤ m.card
299+
300+ /-- The predicate `IsRamseyValid N n` states that a complete graph of size `N` is large enough to
301+ guarantee a clique of size `n k` for some colour `k : K`. -/
302+ def IsRamseyValid'' (N : ℕ) (n : K → ℕ) : Prop :=
303+ ∀ C : TopEdgeLabeling (Fin N) K,
304+ ∃ (m : Finset V) (c : K), (⊤ : SimpleGraph V).LabelingContains C c ∧ n c ≤ m.card
305+
306+ end
307+
270308end SimpleGraph
271309
272310
@@ -279,6 +317,7 @@ end SimpleGraph
279317
280318
281319
320+
282321namespace Fin
283322
284323open Function Matrix Fin
@@ -337,8 +376,6 @@ theorem exists_even_degree [Fintype V] [DecidableRel G.Adj] (hV : Odd (card V))
337376
338377end
339378
340- variable {V V' : Type *} {G : SimpleGraph V} {G' : SimpleGraph V'} {K K' : Type *}
341-
342379theorem TopEdgeLabeling.monochromaticOf_insert {C : TopEdgeLabeling V K} {c : K}
343380 {m : Set V} {x : V} (hx : x ∉ m) : C.MonochromaticOf (insert x m) c ↔
344381 C.MonochromaticOf m c ∧ ∀ ⦃y⦄, (H : y ∈ m) → C.get x y (H.ne_of_notMem hx).symm = c := by
@@ -468,7 +505,6 @@ theorem isRamseyValid_equiv_right {n : K → ℕ} (f : K' ≃ K) :
468505 IsRamseyValid V (n ∘ f) ↔ IsRamseyValid V n :=
469506 ⟨fun h ↦ by convert h.equiv_right f.symm; ext; simp, fun h ↦ h.equiv_right _⟩
470507
471-
472508instance [DecidableEq K] [DecidableEq V] [DecidableRel G.Adj] (C : EdgeLabeling G K) (m : Finset V)
473509 (c : K) : Decidable (C.MonochromaticOf m c) :=
474510 decidable_of_iff' _ C.monochromaticOf_iff_pairwise
0 commit comments