AFTD Auto-Formalizing Theoretical Domains

op309_six_vertex_max_forest_palette_kernel

theoremverified

Three distinct colors cannot all avoid three other distinct colors in a five-color palette.

Statement

theorem op309_six_vertex_max_forest_palette_kernel
  (a b c x y z : Fin 5)
  (hstar : ([a,b,c] : List (Fin 5)).Nodup)
  (hterminal : ([x,y,z] : List (Fin 5)).Nodup)
  (hx : x ≠ a ∧ x ≠ b ∧ x ≠ c)
  (hy : y ≠ a ∧ y ≠ b ∧ y ≠ c)
  (hz : z ≠ a ∧ z ≠ b ∧ z ≠ c) : False
Source
OP-309 maximum-forest six-vertex obstruction; compare the six-color pigeonhole proof in op309_triangle_three_distinct_ports_no_two_rich_edges.
Verified
26 Nov 2026
Axioms
Classical.choiceQuot.soundpropext

The proof, explained

The proof proceeds by contradiction using the pigeonhole principle. It first concatenates the two triples of colors into a single six-element list [a, b, c, x, y, z] and establishes that all its entries are pairwise distinct from the given hypotheses. Since a duplicate-free list of elements from a five-element palette cannot have length greater than 5, this yields the impossible inequality 6 ≤ 5.

  1. The combined list [a, b, c, x, y, z] contains no duplicate elements.

    We define h6 to assert that the six-element list [a, b, c, x, y, z] has no duplicates (List.Nodup). Rewriting with List.nodup_cons, List.mem_cons, List.mem_singleton, List.nodup_singleton, and not_or unpacks the non-duplication of [a, b, c], [x, y, z], and the combined list into pairwise distinctness conditions. The automated proof search tactic aesop then verifies that all 15 pairwise inequalities hold: a, b, c are pairwise distinct by hypothesis hstar; x, y, z are pairwise distinct by hypothesis hterminal; and each of x, y, z is distinct from each of a, b, c by hypotheses hx, hy, and hz.

    lines 8–11

    uses List.nodup_cons, List.mem_cons, List.mem_singleton, List.nodup_singleton, not_or

      have h6 : ([a,b,c,x,y,z] : List (Fin 5)).Nodup := by
        simp only [List.nodup_cons, List.mem_cons, List.mem_singleton,
          List.nodup_singleton, not_or] at *
        aesop
  2. A contradiction is obtained from the pigeonhole principle.

    By the pigeonhole principle, any list of elements from a finite type without duplicates can have length at most the cardinality of that type (h6.length_le_card). Here, the length of [a, b, c, x, y, z] is 6, while the cardinality of the five-element type Fin 5 is 5. Evaluating this inequality with norm_num produces 6 ≤ 5, which simplifies to False and closes the goal.

    lines 12–13

      have hh := h6.length_le_card
      norm_num at hh
List.nodup_cons
A list with a new head element has no duplicates if and only if the head does not appear in the tail and the tail has no duplicates.
List.mem_cons
An element belongs to a list with a head and tail if and only if it equals the head or belongs to the tail.
List.mem_singleton
An element belongs to a singleton list if and only if it equals the sole element.
List.nodup_singleton
Any singleton list has no duplicates.
not_or
A negated disjunction is equivalent to the conjunction of the negated propositions.

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

theorem op309_six_vertex_max_forest_palette_kernel  (a b c x y z : Fin 5)  (hstar : ([a,b,c] : List (Fin 5)).Nodup)  (hterminal : ([x,y,z] : List (Fin 5)).Nodup)  (hx : x ≠ a ∧ x ≠ b ∧ x ≠ c)  (hy : y ≠ a ∧ y ≠ b ∧ y ≠ c)  (hz : z ≠ a ∧ z ≠ b ∧ z ≠ c) : False := by  have h6 : ([a,b,c,x,y,z] : List (Fin 5)).Nodup := by    simp only [List.nodup_cons, List.mem_cons, List.mem_singleton,      List.nodup_singleton, not_or] at *    aesop  have hh := h6.length_le_card  norm_num at hh
See it in the graphDiscuss this resultChallenge it