Documentation

CslibFrontier.Foundations.BooleanAnalysis.CondorcetElection

Condorcet elections and Kalai's proof of Arrow's Theorem #

A 3-candidate Condorcet election using a 2-candidate voting rule f : (ι → Bool) → Bool runs the three pairwise elections 0 vs. 1, 1 vs. 2 and 2 vs. 0 among the candidates Fin 3 O'Donnell, Section 2.5. Each voter i ranks the candidates by a permutation π i : Equiv.Perm (Fin 3), read as the position of each candidate, 0 at the top. In the election of c against c + 1 (addition in Fin 3), voter i votes true when ranking c above c + 1 (BitString.condorcetVotes), and society elects c when f returns true on these votes. A candidate is a Condorcet winner when it wins both pairwise elections in which it takes part (BitString.IsCondorcetWinner) O'Donnell, Definition 2.55. The probability of a Condorcet winner under the impartial culture assumption, where every voter independently picks one of the six rankings uniformly at random, is BitString.condorcetWinnerProb f.

Kalai's formula (BitString.condorcetWinnerProb_eq) O'Donnell, Theorem 2.56: reading f as signs F = signVal ∘ f, the probability of a Condorcet winner is 3/4 - 3/4 Stab_{-1/3}[F]. There is a Condorcet winner exactly when the three outcomes are not all equal, and the not-all-equal predicate has Fourier expansion 3/4 - 1/4 (w₁ w₂ + w₁ w₃ + w₂ w₃). The votes of different voters in two of the elections form pairs of strings whose coordinate pairs are independent, with mean-zero signs of correlation -1/3, so each of the three correlations is Stab_{-1/3}[F] (BitString.expect_mul_comp_eq_noiseStability).

Arrow's Theorem follows (BitString.exists_eq_of_forall_exists_isCondorcetWinner): if there is always a Condorcet winner, then Stab_{-1/3}[F] = -1/3, so f is a literal x ↦ b ⊕ x_i (BitString.noiseStability_signVal_eq_iff_of_neg), and unanimity forces the dictator x ↦ x_i. Arrow's Theorem also allows a different unanimous rule in each election: if there is always a Condorcet winner, the three rules agree (BitString.eq_of_forall_exists_isCondorcetWinner), so they are one dictator (BitString.exists_forall_eq_of_forall_exists_isCondorcetWinner) O'Donnell, Exercise 2.51(a); BitString.IsCondorcetWinner takes one rule per election, and the book's election using f is fun _ => f. The same formula bounds the probability by 7/9 + 2/9 W^1[F] (BitString.condorcetWinnerProb_le) O'Donnell, Corollary 2.59. With the Friedgut–Kalai–Naor theorem this gives the robust version: if the probability is at least 1 - ε, then f is 14409/2 · ε-close to a dictator or a negated dictator (BitString.exists_hammingDist_xor_div_le_of_le_condorcetWinnerProb) O'Donnell, Corollary 2.60.

Main definitions #

Main results #

Usage #

Open Cslib.BitString. Rankings are permutations rather than Cslib.GameTheory.SocialChoice.Ranking, a bundled strict order with no Fintype instance, so that the impartial culture is the uniform expectation 𝔼 π : ι → Equiv.Perm (Fin 3). The book's +1 is true throughout: a vote true in the election of c against c + 1 is a vote for c, and the book's unanimity, f(1, …, 1) = 1 and f(-1, …, -1) = -1, is f (fun _ => true) = true and f (fun _ => false) = false. Arrow's Theorem uses only the first half. Both the probability and Stab_{-1/3}[F] are unchanged by negating f, so the sign convention of signVal (false ↦ 1) does not matter. The book states Corollary 2.60 for probability exactly 1 - ε and closeness O(ε); here the hypothesis is 1 - ε ≤ condorcetWinnerProb f, and the constant is the FKN constant 1601 of BitString.exists_hammingDist_xor_div_le_of_le_levelWeight_one times 9/2. Guilbaud's formula and Theorem 2.57, which also need the limit of Stab_ρ[Maj_n] (Theorem 2.45), are in CslibFrontier.Foundations.BooleanAnalysis.CondorcetLimits.

The checked clients in CslibFrontierTests/BooleanAnalysisCondorcetElection.lean show that a dictator always gives a Condorcet winner, so Arrow's hypotheses can hold together, and compute the probability 17/18 for the majority of three voters O'Donnell, Exercise 2.50.

References #

def Cslib.BitString.condorcetVotes {ι : Type u_1} (π : ι → Equiv.Perm (Fin 3)) (c : Fin 3) (i : ι) :

The votes in the pairwise election of candidate c against candidate c + 1 of a 3-candidate Condorcet election: voter i, whose ranking π i gives the position of each candidate (0 at the top), votes true, for c, when ranking c above c + 1 O'Donnell, Section 2.5.

def Cslib.BitString.IsCondorcetWinner {ι : Type u_1} (F : Fin 3 → (ι → Bool) → Bool) (π : ι → Equiv.Perm (Fin 3)) (c : Fin 3) :

Candidate c is a Condorcet winner of the 3-candidate Condorcet election that decides the election of each d against d + 1 by the voting rule F d, on the rankings π: it wins both pairwise elections in which it takes part, the election of c against c + 1, where F c returning true elects c, and that of c - 1 against c, where F (c - 1) returning false elects c O'Donnell, Definition 2.55 and Exercise 2.51. The book's election using one rule f is F = fun _ => f.

Instances For
    @[instance_reducible]
    instance Cslib.BitString.instDecidableIsCondorcetWinner {ι : Type u_1} (F : Fin 3 → (ι → Bool) → Bool) (π : ι → Equiv.Perm (Fin 3)) (c : Fin 3) :
    noncomputable def Cslib.BitString.condorcetWinnerProb {ι : Type u_1} [Fintype ι] [DecidableEq ι] (f : (ι → Bool) → Bool) :

    The probability of a Condorcet winner in the 3-candidate Condorcet election using the voting rule f, under the impartial culture assumption: every voter independently ranks the candidates by one of the six permutations, uniformly at random O'Donnell, Section 2.5.

    The not-all-equal predicate #

    Pairwise vote correlations #

    Kalai's formula and its consequences #

    theorem Cslib.BitString.condorcetWinnerProb_eq {ι : Type u_1} [Fintype ι] [DecidableEq ι] (f : (ι → Bool) → Bool) :
    condorcetWinnerProb f = 3 / 4 - 3 / 4 * noiseStability (-1 / 3) fun (x : ι → Bool) => signVal (f x)

    Kalai's formula O'Donnell, Theorem 2.56: in a 3-candidate Condorcet election using f, under the impartial culture assumption, the probability of a Condorcet winner is 3/4 - 3/4 Stab_{-1/3}[F], for f read as signs F = signVal ∘ f.

    theorem Cslib.BitString.exists_eq_of_forall_exists_isCondorcetWinner {ι : Type u_2} [Finite ι] {f : (ι → Bool) → Bool} (htrue : (f fun (x : ι) => true) = true) (h : ∀ (π : ι → Equiv.Perm (Fin 3)), ∃ (c : Fin 3), IsCondorcetWinner (fun (x : Fin 3) => f) π c) :
    ∃ (i : ι), f = fun (x : ι → Bool) => x i

    Arrow's Theorem, by Kalai's proof O'Donnell, Section 2.5: if a voting rule f always gives a Condorcet winner in a 3-candidate Condorcet election and elects the first candidate when every voter votes for it, then f is a dictator, f x = x_i for some voter i. By Kalai's formula the hypothesis makes Stab_{-1/3}[F] = -1/3, so all the Fourier weight of F is at degree one and f is a dictator or a negated dictator; the vote at the all-true profile excludes the negated dictators. The book assumes unanimity, f (fun _ => true) = true and f (fun _ => false) = false; only the first half is needed.

    Three different voting rules #

    theorem Cslib.BitString.eq_of_forall_exists_isCondorcetWinner {ι : Type u_1} {F : Fin 3 → (ι → Bool) → Bool} (htrue : ∀ (c : Fin 3), (F c fun (x : ι) => true) = true) (hfalse : ∀ (c : Fin 3), (F c fun (x : ι) => false) = false) (h : ∀ (π : ι → Equiv.Perm (Fin 3)), ∃ (c : Fin 3), IsCondorcetWinner F π c) (c : Fin 3) :
    F c = F 0

    Unanimous rules that always give a Condorcet winner agree [O'Donnell, Exercise 2.51(a)] [OD14]: if the three pairwise elections are decided by unanimous voting rules F 0, F 1 and F 2 and there is always a Condorcet winner, then F 0 = F 1 = F 2. Following the book's hint, the votes x, ¬x and the constant F c x in the elections c, c + 1 and c + 2 are cast by some electorate, which forces F (c + 1) (¬x) = ¬F c x; going around the three elections gives the claim.

    theorem Cslib.BitString.exists_forall_eq_of_forall_exists_isCondorcetWinner {ι : Type u_2} [Finite ι] {F : Fin 3 → (ι → Bool) → Bool} (htrue : ∀ (c : Fin 3), (F c fun (x : ι) => true) = true) (hfalse : ∀ (c : Fin 3), (F c fun (x : ι) => false) = false) (h : ∀ (π : ι → Equiv.Perm (Fin 3)), ∃ (c : Fin 3), IsCondorcetWinner F π c) :
    ∃ (i : ι), ∀ (c : Fin 3), F c = fun (x : ι → Bool) => x i

    Arrow's Theorem for three voting rules O'Donnell, Exercise 2.51(a): if the three pairwise elections are decided by unanimous voting rules and there is always a Condorcet winner, then all three rules are the same dictator x ↦ x_i.

    theorem Cslib.BitString.condorcetWinnerProb_le {ι : Type u_1} [Fintype ι] [DecidableEq ι] (f : (ι → Bool) → Bool) :
    condorcetWinnerProb f ≤ 7 / 9 + 2 / 9 * levelWeight 1 fun (x : ι → Bool) => signVal (f x)

    The probability of a Condorcet winner and the degree-one weight O'Donnell, Corollary 2.59: in a 3-candidate Condorcet election using f, the probability of a Condorcet winner is at most 7/9 + 2/9 W^1[F], for f read as signs F = signVal ∘ f.

    theorem Cslib.BitString.exists_hammingDist_xor_div_le_of_le_condorcetWinnerProb {ι : Type u_1} [Fintype ι] [DecidableEq ι] [Nonempty ι] {f : (ι → Bool) → Bool} {ε : ℝ} (h : 1 - ε ≤ condorcetWinnerProb f) :
    ∃ (i : ι) (b : Bool), ↑(hammingDist f fun (x : ι → Bool) => b ^^ x i) / 2 ^ Fintype.card ι ≤ 14409 / 2 * ε

    Robust Arrow's Theorem O'Donnell, Corollary 2.60: if a 3-candidate Condorcet election using f has a Condorcet winner with probability at least 1 - ε, then f is 14409/2 · ε-close to a dictator or a negated dictator: for some voter i and bit b, f x = b ⊕ x_i except on a fraction at most 14409/2 · ε of the inputs. Corollary 2.59 gives W^1[F] ≥ 1 - 9/2 ε, and the Friedgut–Kalai–Naor theorem (BitString.exists_hammingDist_xor_div_le_of_le_levelWeight_one, constant 1601) concludes. The book states the closeness as O(ε).