AFTD Auto-Formalizing Theoretical Domains

max_vertex_discrepancy

def

The maximum absolute discrepancy among all vertices for an integer discrepancy vector d on n vertices.

Statement

def max_vertex_discrepancy (n : ℕ) (d : Fin n → ℤ) : ℕ
Defined in
arXiv:2611.00388 Sec 1.1, Online carpooling against an oblivious adversary
Verified
06 Nov 2026
Axioms
none listed
Used by 4

Read back from the Lean

Given a natural number $n$ and a function $d : \mathrm{Fin}\ n \to \mathbb{Z}$, max_vertex_discrepancy n d is defined as the supremum (maximum) over all vertices $v \in \mathrm{Fin}\ n$ of the absolute value $|d(v)|$ (as a natural number), evaluating to $0$ if $n = 0$.

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 supremum norm of an integer discrepancy vector on n vertices. -/
def max_vertex_discrepancy (n : ℕ) (d : Fin n → ℤ) : ℕ := Finset.univ.sup (fun v => (d v).natAbs)
See it in the graphDiscuss this resultChallenge it