op309_girth_nine_no_three_cycle
A graph of girth at least nine has no cycle of length 3 on distinct vertices.
Statement
theorem op309_girth_nine_no_three_cycle {V : Type*} (G : SimpleGraph V) (hgirth : (9 : ℕ∞) ≤ G.egirth) (a b c : V) (hvertices : [a,b,c].Nodup) (hedges : G.Adj a b ∧ G.Adj b c ∧ G.Adj c a) : False
- Source
- OP-309 girth-nine canonical-port local cycle exclusions.
- Verified
- 27 Nov 2026
- Axioms
Classical.choiceQuot.soundpropext
The proof, explained
We construct a closed walk p of length 3 from the triangle edges a → b → c → a. Because the vertices a, b, c are pairwise distinct, the tail of this walk is duplicate-free, which makes p a valid cycle. The girth of a graph is at most the length of any of its cycles, forcing G.egirth ≤ 3, which contradicts the hypothesis that G has girth at least 9.
Construct a non-empty closed walk p of length 3 tracing the cycle a → b → c → a.
Unpack the hypothesis hedges into the three edges a ∼ b, b ∼ c, and c ∼ a. Chain these edges together into a closed walk p from a to a. By definition, p has length 3 and is not the nil walk.
open SimpleGraph in rcases hedges with ⟨hab, hbc, hca⟩ let p : G.Walk a a := Walk.cons hab (Walk.cons hbc (Walk.cons hca Walk.nil)) have hlen : p.length = 3 := rfl have hnotnil : ¬ p.Nil := by simp [p]
The tail of the walk p is a path, meaning the vertex list [b, c, a] contains no duplicates.
By Walk.isPath_def, a walk is a path when its vertex list contains no duplicates. Since p is non-nil, Walk.support_tail_of_not_nil shows that the vertices of p.tail are the tail of the vertices of p, which is [b, c, a]. Expanding the list duplicate-freeness condition (via List.nodup_cons, List.mem_cons, List.not_mem_nil, and not_false_eq_true) on both the assumption that [a, b, c] is duplicate-free and the goal reduces the problem to propositional logic: the distinctness of a, b, c implies the distinctness of b, c, a, which is solved by propositional reasoning (tauto).
uses
Walk.isPath_def,Walk.support_tail_of_not_nil,List.nodup_cons,List.mem_cons,List.not_mem_nil,not_false_eq_truehave hpath : p.tail.IsPath := by rw [Walk.isPath_def, Walk.support_tail_of_not_nil p hnotnil] change [b, c, a].Nodup simp only [List.nodup_cons, List.mem_cons, List.not_mem_nil, not_false_eq_true] at hvertices ⊢ tauto
The walk p is a cycle in G.
By Walk.isCycle_iff_isPath_tail_and_le_length, a closed walk is a cycle if and only if its tail is a path and its length is at least 3. Both conditions are satisfied: p.tail was shown to be a path, and the length of p is 3, satisfying 3 ≤ 3.
uses
Walk.isCycle_iff_isPath_tail_and_le_lengthhave hcycle : p.IsCycle := by rw [Walk.isCycle_iff_isPath_tail_and_le_length] exact ⟨hpath, by rw [hlen]⟩
The existence of a 3-cycle contradicts the girth bound 9 ≤ G.egirth.
By G.egirth_le_length, the girth of G is bounded above by the length of any cycle, giving G.egirth ≤ 3. Chaining this with the assumption 9 ≤ G.egirth via transitivity yields 9 ≤ 3, which norm_num refutes as numerically false.
uses
G.egirth_le_lengthhave hle := G.egirth_le_length hcycle rw [hlen] at hle have : (9 : ℕ∞) ≤ 3 := hgirth.trans hle norm_num at this
G.egirth_le_length- The extended girth of a graph is at most the length of any cycle in that graph.
List.mem_cons- An element belongs to a list constructed by prepending a head to a tail if and only if it equals the head or belongs to the tail.
List.nodup_cons- A list with a head prepended is duplicate-free if and only if the head does not appear in the tail and the tail is duplicate-free.
List.not_mem_nil- The empty list contains no elements.
not_false_eq_true- The negation of false is true.
Walk.isCycle_iff_isPath_tail_and_le_length- A closed walk is a cycle if and only if its tail is a path and its length is at least 3.
Walk.isPath_def- A walk is a path if and only if its list of vertices (support) contains no duplicate entries.
Walk.support_tail_of_not_nil- For any walk that is not nil, the vertex list of its tail equals the tail of its vertex list.
- In Lean, verifying that a closed walk on three distinct vertices is indeed a cycle requires explicitly checking that the tail of the walk has no duplicate vertices, which boils down to showing that the list [b, c, a] has no duplicates given that [a, b, c] has none.
- The graph's girth (egirth) is represented in ℕ∞ (the extended natural numbers, including infinity), so arithmetic and comparisons with 9 and 3 occur in ℕ∞.
Written by a model (gemini-3.8-flash) from the Lean proof and the goal states Lean reported at each step. Lean verified the proof; this explanation is a reading aid and is not itself machine-checked.
Lean source view module on GitHub
Choose a tactic — a marked line — to see the goals Lean had before and after it, as in Lean’s infoview. Step with ← → or j k.
theorem op309_girth_nine_no_three_cycle {V : Type*} (G : SimpleGraph V) (hgirth : (9 : ℕ∞) ≤ G.egirth) (a b c : V) (hvertices : [a,b,c].Nodup) (hedges : G.Adj a b ∧ G.Adj b c ∧ G.Adj c a) : False := by open SimpleGraph in rcases hedges with ⟨hab, hbc, hca⟩ let p : G.Walk a a := Walk.cons hab (Walk.cons hbc (Walk.cons hca Walk.nil)) have hlen : p.length = 3 := rfl have hnotnil : ¬ p.Nil := by simp [p] have hpath : p.tail.IsPath := by rw [Walk.isPath_def, Walk.support_tail_of_not_nil p hnotnil] change [b, c, a].Nodup simp only [List.nodup_cons, List.mem_cons, List.not_mem_nil, not_false_eq_true] at hvertices ⊢ tauto have hcycle : p.IsCycle := by rw [Walk.isCycle_iff_isPath_tail_and_le_length] exact ⟨hpath, by rw [hlen]⟩ have hle := G.egirth_le_length hcycle rw [hlen] at hle have : (9 : ℕ∞) ≤ 3 := hgirth.trans hle norm_num at this