Skip to content

Commit 00bc8e5

Browse files
committed
move iff lemmas out of namespace
1 parent 2824b6e commit 00bc8e5

1 file changed

Lines changed: 37 additions & 38 deletions

File tree

Mathlib/Combinatorics/SimpleGraph/Coloring/EdgeLabeling.lean

Lines changed: 37 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -239,10 +239,6 @@ protected theorem symm (hXY : C.MonochromaticBetween X Y k) : C.MonochromaticBet
239239
rw [get_comm _ _ h]
240240
exact hXY hx hy _
241241

242-
theorem _root_.SimpleGraph.EdgeLabeling.monochromaticBetween_comm :
243-
C.MonochromaticBetween Y X k ↔ C.MonochromaticBetween X Y k :=
244-
⟨.symm, .symm⟩
245-
246242
@[simp]
247243
theorem empty_left : C.MonochromaticBetween ∅ Y k := by
248244
simp [MonochromaticBetween]
@@ -251,28 +247,9 @@ theorem empty_left : C.MonochromaticBetween ∅ Y k := by
251247
theorem empty_right : C.MonochromaticBetween X ∅ k := by
252248
simp [MonochromaticBetween]
253249

254-
theorem singleton_left {x : V} :
255-
C.MonochromaticBetween {x} Y k ↔ ∀ ⦃y⦄, y ∈ Y → (h : G.Adj x y) → C.get x y h = k := by
256-
simp [MonochromaticBetween]
257-
258-
theorem singleton_right {y : V} :
259-
C.MonochromaticBetween X {y} k ↔ ∀ ⦃x⦄, x ∈ X → (h : G.Adj x y) → C.get x y h = k := by
260-
simp [MonochromaticBetween]
261-
262250
theorem of_subsingleton [Subsingleton K] : C.MonochromaticBetween X Y k :=
263251
fun _ _ _ _ _ ↦ Subsingleton.elim _ _
264252

265-
theorem union_left : C.MonochromaticBetween (X ∪ Y) Z k ↔
266-
C.MonochromaticBetween X Z k ∧ C.MonochromaticBetween Y Z k := by
267-
grind [MonochromaticBetween]
268-
269-
theorem union_right : C.MonochromaticBetween X (Y ∪ Z) k ↔
270-
C.MonochromaticBetween X Y k ∧ C.MonochromaticBetween X Z k := by
271-
grind [MonochromaticBetween]
272-
273-
protected theorem self : C.MonochromaticBetween X X k ↔ C.MonochromaticOf X k :=
274-
.rfl
275-
276253
protected theorem subset (hWX : C.MonochromaticBetween W X k) (hYW : Y ⊆ W) (hZX : Z ⊆ X) :
277254
C.MonochromaticBetween Y Z k :=
278255
fun _ hx _ hy ↦ hWX (hYW hx) (hZX hy)
@@ -295,12 +272,34 @@ theorem compRight (h : C.MonochromaticBetween X Y k) (e : K → K') :
295272
intro x hx y hy h'
296273
rw [compRight_get, h hx hy h']
297274

298-
protected theorem compRight_iff_of_injective (e : K → K') (he : Function.Injective e) :
275+
end MonochromaticBetween
276+
277+
theorem monochromaticBetween_comm : C.MonochromaticBetween Y X k ↔ C.MonochromaticBetween X Y k :=
278+
⟨.symm, .symm⟩
279+
280+
theorem monochromaticBetween_singleton_left {x : V} :
281+
C.MonochromaticBetween {x} Y k ↔ ∀ ⦃y⦄, y ∈ Y → (h : G.Adj x y) → C.get x y h = k := by
282+
simp [MonochromaticBetween]
283+
284+
theorem monochromaticBetween_singleton_right {y : V} :
285+
C.MonochromaticBetween X {y} k ↔ ∀ ⦃x⦄, x ∈ X → (h : G.Adj x y) → C.get x y h = k := by
286+
simp [MonochromaticBetween]
287+
288+
theorem monochromaticBetween_union_left : C.MonochromaticBetween (X ∪ Y) Z k ↔
289+
C.MonochromaticBetween X Z k ∧ C.MonochromaticBetween Y Z k := by
290+
grind [MonochromaticBetween]
291+
292+
theorem monochromaticBetween_union_right : C.MonochromaticBetween X (Y ∪ Z) k ↔
293+
C.MonochromaticBetween X Y k ∧ C.MonochromaticBetween X Z k := by
294+
grind [MonochromaticBetween]
295+
296+
theorem monochromaticBetween_self : C.MonochromaticBetween X X k ↔ C.MonochromaticOf X k :=
297+
.rfl
298+
299+
theorem monochromaticBetween_compRight_iff_of_injective (e : K → K') (he : Function.Injective e) :
299300
(C.compRight e).MonochromaticBetween X Y (e k) ↔ C.MonochromaticBetween X Y k := by
300301
simp_rw [EdgeLabeling.compRight, MonochromaticBetween, get_eq, Function.comp_apply, he.eq_iff]
301302

302-
end MonochromaticBetween
303-
304303
namespace MonochromaticOf
305304

306305
theorem of_subsingleton_set (hm : X.Subsingleton) : C.MonochromaticOf X k :=
@@ -321,25 +320,13 @@ theorem compRight (h : C.MonochromaticOf X k) (e : K → K') :
321320
(C.compRight e).MonochromaticOf X (e k) :=
322321
MonochromaticBetween.compRight h e
323322

324-
protected theorem compRight_iff_of_injective (e : K → K') (he : Function.Injective e) :
325-
(C.compRight e).MonochromaticOf X (e k) ↔ C.MonochromaticOf X k :=
326-
MonochromaticBetween.compRight_iff_of_injective e he
327-
328323
protected theorem subset (hY : C.MonochromaticOf Y k) (hXY : X ⊆ Y) : C.MonochromaticOf X k :=
329324
MonochromaticBetween.subset hY hXY hXY
330325

331326
protected theorem image {C : EdgeLabeling G' K} {f : G ↪g G'}
332327
(h : (C.pullback f.toHom).MonochromaticOf X k) : C.MonochromaticOf (f '' X) k :=
333328
MonochromaticBetween.image h
334329

335-
protected theorem union : C.MonochromaticOf (X ∪ Y) k ↔
336-
C.MonochromaticOf X k ∧ C.MonochromaticOf Y k ∧ C.MonochromaticBetween X Y k := by
337-
grind [MonochromaticOf, MonochromaticBetween.union_left, monochromaticBetween_comm]
338-
339-
protected theorem insert {x : V} :
340-
C.MonochromaticOf (insert x X) k ↔ C.MonochromaticOf X k ∧ C.MonochromaticBetween X {x} k := by
341-
simp [← Set.union_singleton, MonochromaticOf.union]
342-
343330
theorem image_top {C : TopEdgeLabeling V' K} {f : V ↪ V'}
344331
(h : (C.pullback f).MonochromaticOf X k) : C.MonochromaticOf (f '' X) k := by
345332
simpa [TopEdgeLabeling.monochromaticOf_iff_ne_imp_get_eq]
@@ -351,6 +338,18 @@ theorem map_top {C : TopEdgeLabeling V' K} {f : V ↪ V'} {m : Finset V}
351338

352339
end MonochromaticOf
353340

341+
theorem monochromaticOf_union : C.MonochromaticOf (X ∪ Y) k ↔
342+
C.MonochromaticOf X k ∧ C.MonochromaticOf Y k ∧ C.MonochromaticBetween X Y k := by
343+
grind [MonochromaticOf, monochromaticBetween_union_left, monochromaticBetween_comm]
344+
345+
theorem monochromaticOf_insert {x : V} :
346+
C.MonochromaticOf (insert x X) k ↔ C.MonochromaticOf X k ∧ C.MonochromaticBetween X {x} k := by
347+
simp [← Set.union_singleton, monochromaticOf_union]
348+
349+
theorem monochromaticOf_compRight_iff_of_injective (e : K → K') (he : Function.Injective e) :
350+
(C.compRight e).MonochromaticOf X (e k) ↔ C.MonochromaticOf X k :=
351+
monochromaticBetween_compRight_iff_of_injective e he
352+
354353
end EdgeLabeling
355354

356355
end SimpleGraph

0 commit comments

Comments
 (0)