• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • C
      • Proof-checker-array
      • Soft
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
        • Fairness-criteria
          • Eliminate-candidates
          • Sum-nats
          • Eliminate-other-candidates
          • Clone-p
          • Last-place
          • All-head-to-head-competition-loser-p
            • Head-to-head-competition-loser-p
            • Non-maj-ind-hint
            • Find-condorcet-loser
            • Last-place-elim-ind-hint
          • Candidate-with-least-nth-place-votes
          • Eliminate-candidate
          • First-choice-of-majority-p
          • Candidate-ids
          • Irv
          • Create-nth-choice-count-alist
          • Irv-alt
          • Irv-ballot-p
          • Majority
          • Number-of-candidates
          • List-elements-equal
          • Number-of-voters
        • Imp-language
        • Sidekick
        • Ethereum
        • Leftist-trees
        • Java
        • Riscv
        • Taspi
        • Bitcoin
        • Zcash
        • Des
        • X86isa
        • Sha-2
        • Yul
        • Proof-checker-itp13
        • Regex
        • ACL2-programming-language
        • Json
        • Jfkr
        • Equational
        • Cryptography
        • Axe
        • Poseidon
        • Where-do-i-place-my-book
        • Aleo
        • Bigmems
        • Builtins
        • Execloader
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Community
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • All-head-to-head-competition-loser-p

    Head-to-head-competition-loser-p

    Check if l will lose in a head-to-head competition against c

    Signature
    (head-to-head-competition-loser-p l c xs) → *
    Arguments
    l — Possible loser.
        Guard (natp l).
    c — The other candidate in xs.
        Guard (natp c).
    xs — Guard (irv-ballot-p xs).

    Definitions and Theorems

    Function: head-to-head-competition-loser-p

    (defun head-to-head-competition-loser-p (l c xs)
      (declare (xargs :guard (and (natp l)
                                  (natp c)
                                  (irv-ballot-p xs))))
      (declare (xargs :guard (and (member-equal l (candidate-ids xs))
                                  (member-equal c (candidate-ids xs))
                                  (not (equal l c)))))
      (let ((__function__ 'head-to-head-competition-loser-p))
        (declare (ignorable __function__))
        (b* ((xs-pairwise (eliminate-other-candidates (list l c)
                                                      xs)))
          (equal (irv xs-pairwise) c))))