AFTD Auto-Formalizing Theoretical Domains

minimal_advantage

def

The minimal winning advantage threshold for an n-sided die: n^2 / 2 + 1 if n is even, and (n^2 + 1) / 2 if n is odd.

Statement

def minimal_advantage (n : ℕ) : ℕ
Defined in
arXiv:2610.40321 Eq 1
Verified
31 Oct 2026
Axioms
none listed
Used by 6
  • dice_graphFor an explicit parameter n : ℕ, dice_graph n is the bundled Digraph on Die n whose adjacency relation Adj x y holds if and only if…
  • op744_dice6_has_cycle_sixThe relation (dice_graph 6).Adj has a directed simple cycle of length 6, has_directed_cycle (dice_graph 6).Adj 6.
  • op744_dice11_has_directed_cycle_ge_twelveThere exists an integer k ≥ 12 such that has_directed_cycle (dice_graph 11).Adj k holds.
  • minimal_advantage_elevenThe minimal winning advantage threshold for 11-sided dice is 61.
  • op744_dice3_no_cycle_threeThe relation (dice_graph 3).Adj contains no directed simple cycle of length 3, that is, ¬ has_directed_cycle (dice_graph 3).Adj 3.
  • op744_dice7_has_cycle_fourteenThe relation (dice_graph 7).Adj has a directed simple cycle of length 14, has_directed_cycle (dice_graph 7).Adj 14.

Read back from the Lean

The function minimal_advantage takes a natural number $n$ and returns a natural number, defined conditionally: if $n$ is even ($n \pmod 2 = 0$), it evaluates to $n^2 / 2 + 1$; otherwise (if $n$ is odd), it evaluates to $(n^2 + 1) / 2$ (using natural number 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

/-- Minimal winning advantage threshold for an n-sided die. -/
def minimal_advantage (n : ℕ) : ℕ := if n % 2 == 0 then n ^ 2 / 2 + 1 else (n ^ 2 + 1) / 2
See it in the graphDiscuss this resultChallenge it