torusDistance
def
The distance on the one-dimensional torus R/Z, defined as the distance of a real number to the nearest integer.
Statement
noncomputable def torusDistance (u : ℝ) : ℝ
- Defined in
- arXiv:2610.19174, Section 2.1 and Listing A.1
- Verified
- 21 Oct 2026
- Axioms
- none listed
- Used by 1
- explicitApproximant_torusDistanceFor any Boolean function f : (Fin n → Bool) → Bool on n > 0 variables and any x : Fin n → Bool, torusDistance (explicitApproximant f x -…
Read back from the Lean
The definition torusDistance maps a real number $u$ to $|u - \operatorname{round}(u)|$, the absolute difference between $u$ and the nearest integer to $u$ (cast to $\mathbb{R}$).
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
/-- Distance of a real number to the nearest integer. -/ noncomputable def torusDistance (u : ℝ) : ℝ := |u - (round u : ℝ)|