AFTD Auto-Formalizing Theoretical Domains

cyclic_distance_seven

def

The cyclic distance on Z/7: cyclic_distance_seven a b = min of the two residues (b-a) and (a-b), i.e. the graph distance in the cycle C_7.

Statement

def cyclic_distance_seven (a b : ZMod 7) : ℕ
Source
step towards not_forall_power_well_covered_diam_le_three_and_twin_free_bounded
Verified
20 Oct 2026
Axioms
none listed
Used by 2
  • c7_box_k3_distanceThe product distance on Z/7 x {0,1,2}: c7_box_k3_distance u v = (cyclic distance of the first coordinates) + (0 if the second coordinates…
  • c7_box_k3_graphThe graph C_7 (box) C_3 = C_21(1,7) on Z/7 x {0,1,2}: u and v are adjacent iff they are distinct and c7_box_k3_distance u v = 1.

Lean source view module on GitHub

/-- Cyclic distance on `ZMod 7`, i.e. the graph distance in the 7-cycle. -/
def cyclic_distance_seven (a b : ZMod 7) : ℕ := min (b - a).val (a - b).val
See it in the graphDiscuss this resultChallenge it