AFTD Auto-Formalizing Theoretical Domains

zmod19_edge_color

def

The 3-edge-coloring of the complete graph on vertices ZMod 19 assigns color 0 to an edge {x, y} if y - x is in the cubic residue set H = {1, 7, 8, 11, 12, 18}, color 1 if y - x is in 2H, and color 2 otherwise (in 4H).

Statement

def zmod19_edge_color (x y : ZMod 19) : Fin 3
Defined in
arXiv:2611.03878 Theorem 3.2
Verified
04 Nov 2026
Axioms
none listed

Read back from the Lean

A function zmod19_edge_color that takes two elements x and y of ZMod 19 and returns an element of Fin 3, defined by: - 0 if y - x ∈ ({1, 7, 8, 11, 12, 18} : Finset (ZMod 19)); - 1 if y - x is not in that set, but is in the image of {1, 7, 8, 11, 12, 18} under multiplication by 2 (namely, the set {2, 3, 5, 14, 16, 17} in ZMod 19); - 2 otherwise (which corresponds to y - x ∈ {0, 4, 6, 9, 10, 13, 15}).

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

Lean source view module on GitHub

/-- The three-edge-coloring of the complete graph on ZMod 19 based on cubic residue cosets modulo 19. -/
def zmod19_edge_color (x y : ZMod 19) : Fin 3 :=
  if y - x ∈ ({1, 7, 8, 11, 12, 18} : Finset (ZMod 19)) then 0
  else if y - x ∈ ({1, 7, 8, 11, 12, 18} : Finset (ZMod 19)).image (2 * ·) then 1
  else 2
See it in the graphDiscuss this resultChallenge it