borda_score
In an election with k voters and n candidates where each voter v has preferences given by a permutation P v : Equiv.Perm (Fin n), with smaller values indicating higher preference so that candidate y is ranked below c when P v c < P v y, the Borda score of candidate c is the sum over all voters v : Fin k of the number of candidates y : Fin n such that P v c < P v y.
Statement
def borda_score (k n : ℕ) (P : Fin k → Equiv.Perm (Fin n)) (c : Fin n) : ℕ- Defined in
- Gehrlein and Fishburn (1978)
- Verified
- 18 Nov 2026
- Axioms
- none listed
- Used by 2
- is_borda_winnerIn an election with k voters and n candidates with preference profile P : Fin k → Equiv.Perm (Fin n), candidate c : Fin n is a Borda…
- impartial_culture_borda_disagreement_eventThe event D_{k,n} under impartial culture with k voters and n candidates that there exists a candidate w : Fin n who is the strict…
Read back from the Lean
Given natural numbers k and n, a profile P : Fin k → Equiv.Perm (Fin n) assigning a permutation of Fin n to each voter in Fin k, and an element c : Fin n, borda_score k n P c is the sum over all voters v : Fin k of the number of elements y : Fin n such that P v c < P v y (under the standard strict order on Fin n).
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
/-- Total Borda score of candidate c across k voters with preferences P over n candidates. -/ def borda_score (k n : ℕ) (P : Fin k → Equiv.Perm (Fin n)) (c : Fin n) : ℕ := ∑ v : Fin k, (Finset.univ.filter (fun y : Fin n => P v c < P v y)).card