AFTD Auto-Formalizing Theoretical Domains

alternating_path_vertex

def

The m-th vertex in the alternating path AP_n is m/2 if m is even, and n - 1 - m/2 if m is odd.

Statement

def alternating_path_vertex (n : ℕ) (m : ℕ) : ℕ
Defined in
arXiv:2611.08375 "New results on cyclic and ordered Ramsey numbers", Section 1
Verified
06 Nov 2026
Axioms
none listed
Used by 4

Read back from the Lean

alternating_path_vertex is a function taking two natural numbers $n$ and $m$ that returns a natural number: if $m$ is even ($m \bmod 2 = 0$), it returns $m / 2$ (integer division); otherwise (if $m$ is odd), it returns $(n - 1) - (m / 2)$ (using truncated natural number subtraction and integer division).

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 m-th vertex in the alternating path AP_n on Fin n. -/
def alternating_path_vertex (n : ℕ) (m : ℕ) : ℕ := if m % 2 = 0 then m / 2 else n - 1 - m / 2
See it in the graphDiscuss this resultChallenge it