AFTD Auto-Formalizing Theoretical Domains

ic_winner_nat

def

Given an online rule, a finite voter type V, and an election profile prof of linear orders on Fin T, ic_winner_nat defines by recursion on t : ℕ (with proof ht : t < T) the candidate in Fin T elected at round t: at round 0 it returns candidate 0, and at round t+1 it compares the incumbent winner of round t against challenger t+1, switching to challenger t+1 if the rule evaluates to true on the pairwise preference vector.

Statement

def ic_winner_nat {T : ℕ} (rule : OnlineICDecision T) {V : Type} [Fintype V]
    (prof : V → LinearOrder (Fin T)) : (t : ℕ) → (ht : t < T) → Fin T
Defined in
arXiv:2611.30683 Sec. 2.2 and Sec. 3.1, Stay or Switch? Metric Distortion with Online Candidate Arrivals
Verified
25 Nov 2026
Axioms
none listed
Built on 1
  • OnlineICDecisionFor a horizon T, OnlineICDecision T is the type of online decision rules that universally quantify over all finite types V of voters,…
Used by 7
  • op_2346_partial_asymptotic_lower_boundProposition 3.5: For every integer k ≥ 2 and horizon T = k * (k - 1) + 1, every deterministic online rule with distortion bound D…
  • is_online_distortion_boundedA rule achieves metric distortion at most D for horizon T if for every nonempty finite voter type V, every pseudometric space on V ⊕ Fin…
  • not_op_2346_optimal_online_metric_distortionThe statement op_2346_optimal_online_metric_distortion is false: The statement asserts the existence of Δ_3 in [3, 5] such that…
  • not_op_2346_partial_asymptotic_upper_boundThe statement op_2346_partial_asymptotic_upper_bound is false: The statement op_2346_partial_asymptotic_upper_bound asserts the…
  • not_op_2346_partial_majority_upper_boundThe statement op_2346_partial_majority_upper_bound is false: The statement is false as formalized because of a defect in the ballot…
  • ic_winner_zeroUnder any online rule and preference profile, the winner at round 0 with proof h0 : 0 < T is candidate ⟨0, h0⟩ in Fin T.
  • ic_winnerFor an online rule, a finite voter type V, and a preference profile prof on Fin T, ic_winner rule prof t evaluates ic_winner_nat on t.val…

Read back from the Lean

The definition ic_winner_nat defines a recursive function that takes: - an implicit natural number $T$, - a rule rule : OnlineICDecision T, - an implicit type $V$ endowed with a Fintype V instance, - a profile prof : V → LinearOrder (Fin T) mapping each $v : V$ to a linear order on $\operatorname{Fin} T$, - an explicit natural number $t : \mathbb{N}$, and - an explicit hypothesis $ht : t < T$, and returns an element of $\operatorname{Fin} T$. It is defined by recursion on $t$: 1. Base case ($t = 0$, with proof $h0 : 0 < T$): returns $\langle 0, h0 \rangle : \operatorname{Fin} T$. 2. Recursive step ($t + 1$, with proof $ht : t + 1 < T$): - Computes $x_{\text{prev}} = \text{ic\_winner\_nat}(rule, prof, t, \dots) : \operatorname{Fin} T$. - Constructs a boolean preference profile $\text{pref} : V \to \text{Bool}$ mapping each voter $v : V$ to $\text{decide}(x_{\text{prev}} < \langle t + 1, ht \rangle)$, evaluated with respect to the linear order $\text{prof}(v)$ on $\operatorname{Fin} T$. - If $\text{rule}(V, \langle t + 1, ht \rangle, \text{pref})$ evaluates to $\text{true}$, it returns $\langle t + 1, ht \rangle$; otherwise, it returns $x_{\text{prev}}$.

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 winner at round t under an online incumbent-challenger voting rule, indexed by Nat. -/
def ic_winner_nat {T : ℕ} (rule : OnlineICDecision T) {V : Type} [Fintype V]
    (prof : V → LinearOrder (Fin T)) : (t : ℕ) → (ht : t < T) → Fin T
  | 0, h0 => ⟨0, h0⟩
  | t + 1, ht =>
    let x_prev := ic_winner_nat rule prof t (Nat.lt_of_succ_lt ht)
    let pref : V → Bool := fun v =>
      letI := prof v
      decide (x_prev < ⟨t + 1, ht⟩)
    if rule V ⟨t + 1, ht⟩ pref then ⟨t + 1, ht⟩ else x_prev
See it in the graphDiscuss this resultChallenge it