SocialChoice.Voting.ballotFromInjective
defimported Lean
Pull a linear order back along an injective map, using the supplied codomain order explicitly rather than relying on ambient typeclass search. This is the safe constructor for ballots on types such as Fin n, which already carry a default order.
Statement
set_option autoImplicit true in set_option relaxedAutoImplicit true in open Finset in variable {N A : Type*} in noncomputable def SocialChoice.Voting.ballotFromInjective {B : Type*} (rB : LinearOrder B) (f : A → B) (hf : Function.Injective f) : LinearOrder A
- Defined in
- EconCSLib, `SocialChoice.Voting.ballotFromInjective`
- 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.ballotFromInjective← SocialChoice.Voting.ballotFromInjective (EconCSLib/SocialChoice/Voting/Basic.lean:68): verbatim
- Verified
- 08 Oct 2026
- Axioms
- none listed
- Built on 2
- SocialChoice.Voting.ballotLEBallot
rranksastrictly aboveb. - SocialChoice.Voting.ballotLTBallot
r's strict-order instance, exposed explicitly to avoid ambient typeclass search.
- SocialChoice.Voting.ballotLEBallot
- Used by 12
- SocialChoice.Voting.finThreeRankOrderSocialChoice.Voting.finThreeRankOrder
- SocialChoice.Voting.betweenBallot_xzSocialChoice.Voting.betweenBallot_xz
- SocialChoice.Voting.BallotPrefers_ballotFromInjectiveSocialChoice.Voting.BallotPrefers_ballotFromInjective
- SocialChoice.Voting.topBallot_topSocialChoice.Voting.topBallot_top
- SocialChoice.Voting.topBallot_preservesSocialChoice.Voting.topBallot_preserves
- SocialChoice.Voting.betweenBallot_yzSocialChoice.Voting.betweenBallot_yz
- SocialChoice.Voting.relabelBallotRelabel a linear order along a permutation of alternatives.
- SocialChoice.Voting.betweenBallot_xySocialChoice.Voting.betweenBallot_xy
- SocialChoice.Voting.defaultBallotSocialChoice.Voting.defaultBallot
- SocialChoice.Voting.topBallotSocialChoice.Voting.topBallot
- SocialChoice.Voting.betweenBallotSocialChoice.Voting.betweenBallot
- SocialChoice.Voting.relabelBallotEquivRelabel a linear order along an equivalence of alternative types.
Lean source view module on GitHub
set_option autoImplicit true in set_option relaxedAutoImplicit true in open Finset in variable {N A : Type*} in /-- Pull a linear order back along an injective map, using the supplied codomain order explicitly rather than relying on ambient typeclass search. This is the safe constructor for ballots on types such as `Fin n`, which already carry a default order. -/ noncomputable def SocialChoice.Voting.ballotFromInjective {B : Type*} (rB : LinearOrder B) (f : A → B) (hf : Function.Injective f) : LinearOrder A where toPartialOrder := { toPreorder := { toLE := ⟨fun a b => @LE.le B (ballotLE rB) (f a) (f b)⟩ toLT := ⟨fun a b => @LT.lt B (ballotLT rB) (f a) (f b)⟩ le_refl := fun a => rB.le_refl (f a) le_trans := fun a b c hab hbc => rB.le_trans (f a) (f b) (f c) hab hbc lt_iff_le_not_ge := fun a b => rB.lt_iff_le_not_ge (f a) (f b) } le_antisymm := fun a b hab hba => hf (rB.le_antisymm (f a) (f b) hab hba) } toMin := ⟨fun a b => if @LE.le B (ballotLE rB) (f a) (f b) then a else b⟩ toMax := ⟨fun a b => if @LE.le B (ballotLE rB) (f a) (f b) then b else a⟩ le_total := fun a b => rB.le_total (f a) (f b) toDecidableLE := fun a b => @LinearOrder.toDecidableLE B rB (f a) (f b) toDecidableEq := Classical.decEq A toDecidableLT := fun a b => @LinearOrder.toDecidableLT B rB (f a) (f b) min_def := by intro a b rfl max_def := by intro a b rfl