op309_girth_nine_no_four_cycle
A graph of girth at least nine has no cycle of length 4 on distinct vertices.
Statement
theorem op309_girth_nine_no_four_cycle {V : Type*} (G : SimpleGraph V) (hgirth : (9 : ℕ∞) ≤ G.egirth) (a b c d : V) (hvertices : [a,b,c,d].Nodup) (hedges : G.Adj a b ∧ G.Adj b c ∧ G.Adj c d ∧ G.Adj d a) : False
- Source
- OP-309 girth-nine canonical-port local cycle exclusions.
- Verified
- 27 Nov 2026
- Axioms
Classical.choiceQuot.soundpropext- Used by 1
- op309_girth9_disjoint_p3_leaf_hosts_uniqueIn a graph of girth at least nine, two vertex-disjoint three-vertex paths cannot both have leaves adjacent to each of two distinct outside…
The proof, explained
The proof proceeds by contradiction. From the four given edges connecting distinct vertices a, b, c, d in a loop, we construct a closed walk w of length 4. Since the vertices are pairwise distinct, w is a cycle, which bounds the extended girth of G from above by 4. Transitivity with the assumption that the girth is at least 9 yields 9 ≤ 4, an arithmetic contradiction.
We extract the individual edge adjacencies and construct a closed walk w of length 4 from a back to a.
We decompose the hypothesis hedges into the four directed edges a ~ b, b ~ c, c ~ d, and d ~ a, and assemble them via Walk.cons and Walk.nil into a closed walk w traversing the sequence of vertices a, b, c, d, a.
uses
SimpleGraph.Walk.cons,SimpleGraph.Walk.nilrcases hedges with ⟨hab, hbc, hcd, hda⟩ let w : G.Walk a a := SimpleGraph.Walk.cons hab (SimpleGraph.Walk.cons hbc (SimpleGraph.Walk.cons hcd (SimpleGraph.Walk.cons hda SimpleGraph.Walk.nil)))
The walk w is a cycle.
By SimpleGraph.Walk.isCycle_iff_isPath_tail_and_le_length, a closed walk is a cycle if and only if its length is at least 3 and its tail is a path. The length condition 3 ≤ 4 holds by arithmetic. By SimpleGraph.Walk.isPath_def, the tail walk is a path if and only if its vertex support [b, c, d, a] has no duplicates. Expanding the no-duplicates condition for both the assumption [a, b, c, d] and the target [b, c, d, a] into pairwise disequalities leaves a propositional tautology, which is verified automatically.
uses
SimpleGraph.Walk.isCycle_iff_isPath_tail_and_le_length,SimpleGraph.Walk.isPath_def,List.nodup_cons,List.mem_cons,not_or,List.not_mem_nil,and_true,not_false_eq_truehave hw : w.IsCycle := by rw [SimpleGraph.Walk.isCycle_iff_isPath_tail_and_le_length] refine ⟨?_, by norm_num [w]⟩ rw [SimpleGraph.Walk.isPath_def] change [b, c, d, a].Nodup simp only [List.nodup_cons, List.mem_cons, not_or, List.not_mem_nil, and_true, not_false_eq_true] at hvertices ⊢ tauto
The extended girth of G is at most 4.
Since the extended girth is the infimum of cycle lengths in G, the existence of the cycle w of length 4 implies G.egirth ≤ 4 by SimpleGraph.egirth_le_length.
uses
SimpleGraph.egirth_le_lengthhave hle : G.egirth ≤ (4 : ℕ∞) := SimpleGraph.egirth_le_length hwWe obtain a contradiction from 9 ≤ 4.
Combining the hypothesis 9 ≤ G.egirth with G.egirth ≤ 4 by transitivity of inequality gives 9 ≤ 4. Numeric evaluation detects that 9 ≤ 4 is false, closing the proof.
uses
le_transhave h94 : (9 : ℕ∞) ≤ (4 : ℕ∞) := le_trans hgirth hle revert h94 norm_num
and_true- For any proposition p, the conjunction p ∧ True is equivalent to p.
le_trans- In any preorder, if a ≤ b and b ≤ c, then a ≤ c.
List.mem_cons- An element a is in the list b :: l if and only if a = b or a is in l.
List.nodup_cons- The list a :: l has no duplicates if and only if a is not in l and l has no duplicates.
List.not_mem_nil- No element belongs to the empty list.
not_false_eq_true- The negation of False is True.
not_or- The negation of a disjunction p ∨ q is equivalent to ¬p ∧ ¬q.
SimpleGraph.egirth_le_length- The extended girth of a graph is at most the length of any cycle in that graph.
SimpleGraph.Walk.cons- Prepending an edge between u and v to a walk from v to w yields a walk from u to w.
SimpleGraph.Walk.isCycle_iff_isPath_tail_and_le_length- A closed walk is a cycle if and only if its tail walk is a path and its length is at least 3.
SimpleGraph.Walk.isPath_def- A walk is a path if and only if its vertex sequence (support) has no duplicate entries.
SimpleGraph.Walk.nil- The trivial walk from a vertex u to itself with length 0.
- The graph's girth is formalized as `egirth` taking values in `ℕ∞` (the natural numbers extended with infinity), which is why the numerals 9 and 4 are explicitly typed as `ℕ∞`.
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_four_cycle {V : Type*} (G : SimpleGraph V) (hgirth : (9 : ℕ∞) ≤ G.egirth) (a b c d : V) (hvertices : [a,b,c,d].Nodup) (hedges : G.Adj a b ∧ G.Adj b c ∧ G.Adj c d ∧ G.Adj d a) : False := by rcases hedges with ⟨hab, hbc, hcd, hda⟩ let w : G.Walk a a := SimpleGraph.Walk.cons hab (SimpleGraph.Walk.cons hbc (SimpleGraph.Walk.cons hcd (SimpleGraph.Walk.cons hda SimpleGraph.Walk.nil))) have hw : w.IsCycle := by rw [SimpleGraph.Walk.isCycle_iff_isPath_tail_and_le_length] refine ⟨?_, by norm_num [w]⟩ rw [SimpleGraph.Walk.isPath_def] change [b, c, d, a].Nodup simp only [List.nodup_cons, List.mem_cons, not_or, List.not_mem_nil, and_true, not_false_eq_true] at hvertices ⊢ tauto have hle : G.egirth ≤ (4 : ℕ∞) := SimpleGraph.egirth_le_length hw have h94 : (9 : ℕ∞) ≤ (4 : ℕ∞) := le_trans hgirth hle revert h94 norm_num