AFTD Auto-Formalizing Theoretical Domains

rank_score_candidate_weight

def

Given a nonempty finite type of voters V, a finite type of candidates C with decidable equality, a scoring function s : Fin (Fintype.card C) → ℚ, a profile prof : V → LinearOrder C, and a candidate c : C, rank_score_candidate_weight s prof c is the sum over all voters v in V of s applied to candidate_rank (prof v) c, divided by the product of the number of voters (Fintype.card V : ℚ) and scoring_norm_one s.

Statement

def rank_score_candidate_weight {V C : Type*} [Fintype V] [Nonempty V] [Fintype C] [DecidableEq C]
    (s : Fin (Fintype.card C) → ℚ) (prof : V → LinearOrder C) (c : C) : ℚ
Defined in
arXiv:2610.26535 Definition 2
Verified
24 Oct 2026
Axioms
none listed
Built on 2
  • candidate_rankGiven a finite candidate type C with decidable equality, a linear order ord on C, and a candidate c in C, candidate_rank ord c is the…
  • scoring_norm_oneThe 1-norm of a scoring vector s in Q^m is the sum of its entries.
Used by 4

Read back from the Lean

For finite types V (assumed nonempty) and C (with decidable equality), a scoring vector s : Fin |C| → ℚ, a profile prof : V → LinearOrder C assigning a linear order to each voter, and a candidate c : C, rank_score_candidate_weight defines a rational number equal to: the sum over all voters v : V of s applied to the rank of c in prof v (where the rank is the number of candidates strictly greater than c in that order), divided by the product of the number of voters |V| and the sum of all scores ∑ i : Fin |C|, s i.

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

/-- Normalized candidate weight under scoring vector s and preference profile prof. -/
def rank_score_candidate_weight {V C : Type*} [Fintype V] [Nonempty V] [Fintype C] [DecidableEq C]
    (s : Fin (Fintype.card C) → ℚ) (prof : V → LinearOrder C) (c : C) : ℚ :=
  (∑ v : V, s (candidate_rank (prof v) c)) /
    ((Fintype.card V : ℚ) * scoring_norm_one s)
See it in the graphDiscuss this resultChallenge it