AFTD Auto-Formalizing Theoretical Domains

zmod_clockwise_dist

def

For any natural number n and any elements s, r in ZMod n, the clockwise distance from s to r is the integer (r - s) mod n, viewed as a real number.

Statement

def zmod_clockwise_dist {n : ℕ} (s r : ZMod n) : ℝ
Defined in
arXiv:2611.02684, Section B.1, p. 34
Verified
04 Nov 2026
Axioms
none listed

Read back from the Lean

For an implicit natural number n and two elements s, r : ZMod n, zmod_clockwise_dist s r is defined as the real number cast of the canonical natural-number representative of the difference r - s, i.e., ((r - s).val : ℝ).

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 clockwise distance c(s, r) = (r - s) mod n from s to r on ZMod n. -/
def zmod_clockwise_dist {n : ℕ} (s r : ZMod n) : ℝ := ((r - s).val : ℝ)
See it in the graphDiscuss this resultChallenge it