Documentation

Apportionmentlib.Basic

Basic #

We define basic notions related to apportionment methods, such as elections, apportionments, apportionment rules, and properties of apportionment rules. We also prove the Balinski-Young impossibility theorem.

All definitions follow those given in a textbook by F. Pukelsheim [Puk17]. Distinction between weak and strong exactness is added, following [PPR16].

Main definitions #

Main statements #

References #

An election with a vector of votes for n parties and the total number of seats to be allocated.

  • votes : Vector n

    The number of votes cast for each of the n parties, at the corresponding index.

  • houseSize : ℕ+

    The number of seats to be allocated between the parties.

  • votes_sum_pos : 0 < self.votes.sum

    At least one vote is cast, so that the standard quotas are well defined.

Instances For
    def Apportionmentlib.instDecidableEqElection.decEq {n✝ : } (x✝ x✝¹ : Election n✝) :
    Decidable (x✝ = x✝¹)
    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      @[instance_reducible]
      Equations
      • One or more equations did not get rendered due to their size.

      Notation for an election with a literal house size and vote distribution, as in election![8; [66, 67, 245, 622]].

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For

        Party i's standard (Hare) quota: its proportional share of the house size.

        Equations
        Instances For
          @[instance_reducible]

          This instance enables rendering of elections using the #html command. For example,

          #html election![8; [66, 67, 245, 622]]
          
          Equations
          def Apportionmentlib.Election.mkByPerm {n : } (election : Election n) (σ : Equiv.Perm (Fin n)) :

          Create a new election by permuting the vote distribution of parties according to permutation σ.

          Equations
          Instances For

            Create a new election by scaling all votes by a positive constant k.

            Equations
            Instances For
              theorem Apportionmentlib.Election.n_pos {n : } (election : Election n) :
              0 < n

              The number of parties in an election is positive.

              @[reducible, inline]

              An apportionment is a vector of natural numbers representing the number of seats allocated to each party (at the corresponding index).

              Equations
              Instances For

                An apportionment rule is a function that, given an election, returns a set of apportionments satisfying three properties:

                1. Non-emptiness: there is at least one apportionment returned;
                2. Inheritance of zeros: parties with zero votes are allocated zero seats;
                3. House size feasibility: the total number of seats allocated is equal to the house size.
                Instances For

                  A rule is anonymous if permuting the votes of the parties permutes the allocation of seats in the same way.

                  Instances

                    A rule is balanced if whenever two parties have the same number of votes, then the difference in the number of seats allocated to them is at most one.

                    Instances

                      A rule is concordant if whenever one party has fewer votes than another, then it is allocated no more seats than that other party.

                      Instances

                        A rule is decent if scaling the number of votes for each party by the same positive integer does not change the apportionment.

                        Instances

                          A rule is weakly exact if every Apportionment, when viewed as an input vote distribution Election.votes, is reproduced as the unique solution.

                          Instances

                            A rule is a quota rule if the number of seats allocated to each party is either the floor or the ceiling of its Hare-quota.

                            Instances
                              theorem Apportionmentlib.Rule.seats_le (rule : Rule) [h_quota : IsQuotaRule rule] {n : } (election : Election n) (i : Fin n) (m : ) (h : election.quota i m) (App : Apportionment n) :
                              App rule.res electionApp[i] m

                              A quota rule allocates at most m seats to party i whenever its quota is at most m.

                              theorem Apportionmentlib.Rule.le_seats (rule : Rule) [h_quota : IsQuotaRule rule] {n : } (election : Election n) (i : Fin n) (m : ) (h : m election.quota i) (App : Apportionment n) :
                              App rule.res electionm App[i]

                              A quota rule allocates at least m seats to party i whenever its quota is at least m.

                              A rule is population monotone (or vote ratio monotone) if population paradoxes do not occur. A population paradox occurs when the support for party i increases at a faster rate than that for party j, but i loses seats while j gains seats.

                              Instances

                                If an anonymous rule is population monotone, then it is concordant.

                                Balinski-Young impossibility theorem: a quota rule is never population monotone, so no apportionment method can satisfy both properties simultaneously. Anonymity is not assumed (nor any other property).

                                Gölz, Peters and Procaccia [GPP25] prove this for five or more parties, leaving four open in this generality; the witness used here has only four parties, settling that case.