AFTD Auto-Formalizing Theoretical Domains

not_is_snark_completeGraph_four

theoremverified

The complete graph on four vertices is not a snark.

Statement

theorem not_is_snark_completeGraph_four : ¬ is_snark (⊤ : SimpleGraph (Fin 4))
Source
folklore
Verified
26 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 2
  • is_snarkGiven a finite type V and a simple graph G on V, is_snark G asserts that every vertex of G has degree 3, G is bridgeless, and the line…
  • is_bridgeless_graphA simple graph G is bridgeless if no edge of G is a bridge.

Read back from the Lean

The complete graph on 4 vertices (the top element of SimpleGraph (Fin 4)) is not a snark (i.e., it does not simultaneously have every vertex with degree 3, be bridgeless, and have a line graph that is not 3-colorable).

Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.

The proof, explained

A snark is a cubic bridgeless graph whose chromatic index is greater than 3, which means its line graph is not 3-colorable. The complete graph K₄ on four vertices has six edges, which can be partitioned into three disjoint 1-factors (matchings of size 2): {(0,1), (2,3)}, {(0,2), (1,3)}, and {(0,3), (1,2)}. Assigning one of three colors to each matching yields an explicit proper 3-edge-coloring of K₄, which provides a proper 3-coloring of its line graph. Because its line graph is 3-colorable, K₄ fails the chromatic requirement of a snark and therefore is not a snark.

  1. The vertex-pair coloring function `not_is_snark_completeGraph_four_c_fun` is symmetric: c(a, b) = c(b, a) for all vertices a and b. automation

    The edge coloring of K₄ is given by partitioning the six edges into three disjoint 1-factors (matchings of size 2). Evaluating all 16 possible pairs of vertices in Fin 4 by finite decision (`decide`) verifies that the assigned color is independent of the order of endpoints, allowing it to be lifted to unordered pairs.

    lines 18–19

      revert a b
      decide
  2. Any two distinct edges sharing a vertex are assigned different colors by `not_is_snark_completeGraph_four_c_fun`. automation

    For any vertices a, b, c, d, v in Fin 4, if {a, b} and {c, d} are distinct non-loop pairs sharing an endpoint v, their assigned colors are different. Because the domain Fin 4 is finite, this exhaustive condition is checked by the `decide` tactic over all 4⁵ = 1024 cases.

    lines 32–33

      revert a b c d v
      decide
  3. Two adjacent vertices in the line graph of K₄ correspond to distinct unordered pairs of vertices that share an endpoint.

    Given two adjacent vertices e₁ and e₂ in the line graph, `SimpleGraph.lineGraph_adj_iff_exists` unpacks adjacency into the statement that e₁ ≠ e₂ and they share some vertex v. Using `Sym2.inductionOn`, the edges are represented as unordered pairs s(a, b) and s(c, d), and vertex incidence is simplified to v = a ∨ v = b and v = c ∨ v = d via `Sym2.mem_iff`.

    lines 38–45

    uses SimpleGraph.lineGraph_adj_iff_exists, Sym2.inductionOn, Sym2.mem_iff

      obtain ⟨e₁, h₁⟩ := e₁
      obtain ⟨e₂, h₂⟩ := e₂
      rw [SimpleGraph.lineGraph_adj_iff_exists] at h
      rcases h with ⟨hne, v, hv₁, hv₂⟩
      induction e₁ using Sym2.inductionOn with | hf a b =>
      induction e₂ using Sym2.inductionOn with | hf c d =>
      dsimp [not_is_snark_completeGraph_four_c_edge, not_is_snark_completeGraph_four_c_sym2]
      simp only [Sym2.mem_iff] at hv₁ hv₂
  4. Adjacent edges in the line graph receive different colors.

    Because s(a, b) and s(c, d) are edges of K₄, neither is a self-loop (a ≠ b and c ≠ d). Since the edges are distinct, their endpoints cannot coincide in either order (`Subtype.ext` and `Sym2.eq_iff`). These properties satisfy the hypotheses of `not_is_snark_completeGraph_four_c_fun_prop`, which concludes that the colors assigned to the two edges are distinct.

    lines 46–54

    uses Subtype.ext, Sym2.eq_iff, not_is_snark_completeGraph_four_c_fun_prop

      have hab : a ≠ b := by simpa using h₁
      have hcd : c ≠ d := by simpa using h₂
      have hne' : ¬ ((a = c ∧ b = d) ∨ (a = d ∧ b = c)) := by
        intro hor
        apply hne
        apply Subtype.ext
        rw [Sym2.eq_iff]
        exact hor
      exact not_is_snark_completeGraph_four_c_fun_prop a b c d v hab hcd hv₁ hv₂ hne'
  5. The edge coloring assigns distinct colors to any adjacent edges in the line graph.

    For the coloring constructor `SimpleGraph.Coloring.mk`, we supply the proof that whenever two vertices of the line graph are adjacent, `not_is_snark_completeGraph_four_c_edge_valid` guarantees their assigned colors are different.

    line 58

    uses not_is_snark_completeGraph_four_c_edge_valid

        (by intro e₁ e₂ h; exact not_is_snark_completeGraph_four_c_edge_valid e₁ e₂ h)
  6. The complete graph K₄ is not a snark.

    Assume for contradiction that K₄ is a snark (`intro hsnark`). Part of the definition of a snark is that its line graph cannot be 3-colored (`hsnark.2.2`). But `not_is_snark_completeGraph_four_lineGraph_colorable` establishes that the line graph of K₄ is indeed 3-colorable, yielding a contradiction.

    lines 65–66

    uses not_is_snark_completeGraph_four_lineGraph_colorable

      intro hsnark
      exact hsnark.2.2 not_is_snark_completeGraph_four_lineGraph_colorable
SimpleGraph.lineGraph_adj_iff_exists
Two vertices of the line graph are adjacent if and only if they represent distinct edges of the base graph that share an endpoint.
Sym2.inductionOn
To prove a property for all unordered pairs in Sym2 α, it suffices to prove it for pairs of the form s(x, y).
Sym2.mem_iff
An element belongs to the unordered pair s(b, c) if and only if it equals b or equals c.
Subtype.ext
Two elements of a subtype are equal if their underlying values are equal.
Sym2.eq_iff
Two unordered pairs s(x, y) and s(z, w) are equal if and only if their elements match in the same order or in reverse order.
not_is_snark_completeGraph_four_c_fun_prop
If two pairs {a, b} and {c, d} are distinct non-loop edges sharing a common endpoint, they receive different colors under the explicit coloring function.
not_is_snark_completeGraph_four_c_edge_valid
Adjacent vertices in the line graph of K₄ are assigned distinct colors by the edge coloring function.
not_is_snark_completeGraph_four_lineGraph_colorable
The line graph of the complete graph K₄ admits a proper 3-vertex-coloring.

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

def not_is_snark_completeGraph_four_c_fun : Fin 4 → Fin 4 → Fin 3  | 0, 1 => 0  | 1, 0 => 0  | 2, 3 => 0  | 3, 2 => 0  | 0, 2 => 1  | 2, 0 => 1  | 1, 3 => 1  | 3, 1 => 1  | 0, 3 => 2  | 3, 0 => 2  | 1, 2 => 2  | 2, 1 => 2  | _, _ => 0lemma not_is_snark_completeGraph_four_c_fun_symm (a b : Fin 4) :    not_is_snark_completeGraph_four_c_fun a b = not_is_snark_completeGraph_four_c_fun b a := by  revert a b  decidedef not_is_snark_completeGraph_four_c_sym2 : Sym2 (Fin 4) → Fin 3 :=  Sym2.lift ⟨not_is_snark_completeGraph_four_c_fun, not_is_snark_completeGraph_four_c_fun_symm⟩def not_is_snark_completeGraph_four_c_edge (e : (⊤ : SimpleGraph (Fin 4)).edgeSet) : Fin 3 :=  not_is_snark_completeGraph_four_c_sym2 e.vallemma not_is_snark_completeGraph_four_c_fun_prop (a b c d v : Fin 4)    (hab : a ≠ b) (hcd : c ≠ d)    (hv₁ : v = a ∨ v = b) (hv₂ : v = c ∨ v = d)    (hne : ¬ ((a = c ∧ b = d) ∨ (a = d ∧ b = c))) :    not_is_snark_completeGraph_four_c_fun a b ≠ not_is_snark_completeGraph_four_c_fun c d := by  revert a b c d v  decidelemma not_is_snark_completeGraph_four_c_edge_valid (e₁ e₂ : (⊤ : SimpleGraph (Fin 4)).edgeSet)    (h : (⊤ : SimpleGraph (Fin 4)).lineGraph.Adj e₁ e₂) :    not_is_snark_completeGraph_four_c_edge e₁ ≠ not_is_snark_completeGraph_four_c_edge e₂ := by  obtain ⟨e₁, h₁⟩ := e₁  obtain ⟨e₂, h₂⟩ := e₂  rw [SimpleGraph.lineGraph_adj_iff_exists] at h  rcases h with ⟨hne, v, hv₁, hv₂⟩  induction e₁ using Sym2.inductionOn with | hf a b =>  induction e₂ using Sym2.inductionOn with | hf c d =>  dsimp [not_is_snark_completeGraph_four_c_edge, not_is_snark_completeGraph_four_c_sym2]  simp only [Sym2.mem_iff] at hv₁ hv₂  have hab : a ≠ b := by simpa using h₁  have hcd : c ≠ d := by simpa using h₂  have hne' : ¬ ((a = c ∧ b = d) ∨ (a = d ∧ b = c)) := by    intro hor    apply hne    apply Subtype.ext    rw [Sym2.eq_iff]    exact hor  exact not_is_snark_completeGraph_four_c_fun_prop a b c d v hab hcd hv₁ hv₂ hne'def not_is_snark_completeGraph_four_c_coloring : (⊤ : SimpleGraph (Fin 4)).lineGraph.Coloring (Fin 3) :=  SimpleGraph.Coloring.mk not_is_snark_completeGraph_four_c_edge    (by intro e₁ e₂ h; exact not_is_snark_completeGraph_four_c_edge_valid e₁ e₂ h)lemma not_is_snark_completeGraph_four_lineGraph_colorable : (⊤ : SimpleGraph (Fin 4)).lineGraph.Colorable 3 :=  ⟨not_is_snark_completeGraph_four_c_coloring⟩/-- The complete graph K_4 on four vertices is not a snark. -/theorem not_is_snark_completeGraph_four : ¬ is_snark (⊤ : SimpleGraph (Fin 4)) := by  intro hsnark  exact hsnark.2.2 not_is_snark_completeGraph_four_lineGraph_colorable
See it in the graphDiscuss this resultChallenge it