SocialChoice.Voting.rank
defimported Lean
rank r a is the number of alternatives strictly above a in ballot r.
Statement
set_option autoImplicit true in set_option relaxedAutoImplicit true in open Classical in open Finset in open scoped BigOperators in variable {N A : Type*} in noncomputable def SocialChoice.Voting.rank [Fintype A] (r : LinearOrder A) (a : A) : Nat
- Defined in
- EconCSLib, `SocialChoice.Voting.rank`
- Lean proof
- By xbei (from the file's git history), from github.com/gametheoryinlean/EconCSLib at
1a88f809b538(Copyright (c) 2026 EconCSLib contributors. All rights reserved, Apache-2.0). Compiled here against leanprover/lean4:v4.33.1, Mathlib v4.33.1; written for leanprover/lean4:v4.30.0.SocialChoice.Voting.rank← SocialChoice.Voting.rank (EconCSLib/SocialChoice/Voting/VotingRules.lean:47): verbatim
- Verified
- 08 Oct 2026
- Axioms
- none listed
- Built on 2
- SocialChoice.Voting.BallotPrefersBallot
rranksastrictly aboveb. - SocialChoice.Voting.BallotPrefers_ballotFromInjectiveSocialChoice.Voting.BallotPrefers_ballotFromInjective
- SocialChoice.Voting.BallotPrefersBallot
- Used by 17
- SocialChoice.Voting.scoreCandidateTotal score for a candidate under a positional score vector.
- SocialChoice.Voting.betweenBallot_xzSocialChoice.Voting.betweenBallot_xz
- SocialChoice.Voting.topBallot_topSocialChoice.Voting.topBallot_top
- SocialChoice.Voting.rank_lt_of_ltSocialChoice.Voting.rank_lt_of_lt
- SocialChoice.Voting.topBallot_preservesSocialChoice.Voting.topBallot_preserves
- SocialChoice.Voting.rank_lt_iffSocialChoice.Voting.rank_lt_iff
- SocialChoice.Voting.betweenKey_injectiveSocialChoice.Voting.betweenKey_injective
- SocialChoice.Voting.bottomKeySocialChoice.Voting.bottomKey
- SocialChoice.Voting.positionThe 1-based position of
ain ballotr. - SocialChoice.Voting.betweenBallot_yzSocialChoice.Voting.betweenBallot_yz
- SocialChoice.Voting.zKeyThe rank function used by
zBallot: first separate alternatives by membership inR, then use the relevant source ballot's rank. - SocialChoice.Voting.position_eq_rank_succSocialChoice.Voting.position_eq_rank_succ
- SocialChoice.Voting.betweenBallot_xySocialChoice.Voting.betweenBallot_xy
- SocialChoice.Voting.betweenKeySocialChoice.Voting.betweenKey
- SocialChoice.Voting.topKeySocialChoice.Voting.topKey
- SocialChoice.Voting.topKey_injectiveSocialChoice.Voting.topKey_injective
- SocialChoice.Voting.rank_injectiveSocialChoice.Voting.rank_injective
Lean source view module on GitHub
set_option autoImplicit true in set_option relaxedAutoImplicit true in open Classical in open Finset in open scoped BigOperators in variable {N A : Type*} in /-- `rank r a` is the number of alternatives strictly above `a` in ballot `r`. -/ noncomputable def SocialChoice.Voting.rank [Fintype A] (r : LinearOrder A) (a : A) : Nat := Finset.card (Finset.univ.filter (fun b => BallotPrefers r b a))