Skip to content

Commit c5af96e

Browse files
Impl nonempty_of_eq_zero_or_eq_zero
1 parent 1234583 commit c5af96e

1 file changed

Lines changed: 15 additions & 5 deletions

File tree

Mathlib/Combinatorics/SimpleGraph/CompleteMultipartite.lean

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -335,8 +335,13 @@ section CompleteEquipartiteSubgraph
335335

336336
variable {V : Type*} {G : SimpleGraph V}
337337

338-
/-- A complete equipartite subgraph in `r` parts each of size `t` in `G` is `r` subsets
339-
of vertices each of size `t` such that vertices in distinct subsets are adjacent. -/
338+
/-- A complete equipartite subgraph in `r > 0` parts each of size `t ≠ 0` in `G` is `r` subsets
339+
of vertices each of size `t` such that vertices in distinct subsets are adjacent.
340+
341+
If `r > 0` but `t = 0`, then `parts = {{}}`. If `r = 0`, then `parts = {}`. These are the two
342+
*distinct* "empty" complete equipartite subgraphs, that is, the complete equipartite subgraphs
343+
having no vertices. -/
344+
@[ext]
340345
structure CompleteEquipartiteSubgraph (G : SimpleGraph V) (r t : ℕ) where
341346
/-- The parts in a complete equipartite subgraph. -/
342347
parts : Finset (Finset V)
@@ -351,6 +356,11 @@ variable {r t : ℕ} (K : G.CompleteEquipartiteSubgraph r t)
351356

352357
namespace CompleteEquipartiteSubgraph
353358

359+
/-- At least one of the "empty" complete equipartite subgraphs is contained in a simple graph. -/
360+
theorem nonempty_of_eq_zero_or_eq_zero (h : r = 0 ∨ t = 0) :
361+
Nonempty (G.CompleteEquipartiteSubgraph r t) :=
362+
⟨{}, h.elim (fun hr ↦ by simp [hr]) (fun ht ↦ by simp [ht]), by simp, by simp⟩
363+
354364
/-- The parts in a complete equipartite subgraph are pairwise disjoint. -/
355365
theorem disjoint : (K.parts : Set (Finset V)).Pairwise Disjoint :=
356366
fun _ h₁ _ h₂ hne ↦ Finset.disjoint_left.mpr fun _ h₁' h₂' ↦
@@ -449,9 +459,9 @@ theorem completeEquipartiteGraph_succ_isContained_iff :
449459
have h_bot (r' : ℕ) : completeEquipartiteGraph r' t = ⊥ :=
450460
completeEquipartiteGraph_eq_bot_iff.mpr <| .inr ht
451461
simp_rw [h_bot (r + 1), ht, Finset.card_eq_zero, exists_eq_left, IsCompleteBetween, mem_coe,
452-
notMem_empty, IsEmpty.forall_iff, implies_true, exists_true_iff_nonempty,
453-
← completeEquipartiteGraph_isContained_iff, h_bot r]
454-
exact ⟨fun _ ↦ ⟨Copy.bot .ofIsEmpty⟩, fun _ ↦ ⟨Copy.bot .ofIsEmpty⟩⟩
462+
notMem_empty, IsEmpty.forall_iff, implies_true, exists_true_iff_nonempty]
463+
exact ⟨fun _ ↦ CompleteEquipartiteSubgraph.nonempty_of_eq_zero_or_eq_zero (.inr ht),
464+
fun _ ↦ ⟨Copy.bot .ofIsEmpty⟩⟩
455465
· rw [completeEquipartiteGraph_isContained_iff]
456466
refine ⟨fun ⟨K'⟩ ↦ ?_, fun ⟨K, s, hs, hadj⟩ ↦ ?_⟩
457467
· obtain ⟨parts, hparts_sub, hparts_card⟩ := K'.parts.exists_subset_card_eq (Nat.pred_le _)

0 commit comments

Comments
 (0)