Returns a list of candidates, if any, which received the minimum number of votes
(candidates-with-min-votes count-alst) → cids
Function:
(defun candidates-with-min-votes (count-alst) (declare (xargs :guard (count-alistp count-alst))) (let ((__function__ 'candidates-with-min-votes)) (declare (ignorable __function__)) (b* ((min-num-of-votes (min-nats (strip-cdrs count-alst)))) (all-keys min-num-of-votes count-alst))))
Theorem:
(defthm nat-listp-of-candidates-with-min-votes (implies (and (count-alistp count-alst)) (b* ((cids (candidates-with-min-votes count-alst))) (nat-listp cids))) :rule-classes :rewrite)
Theorem:
(defthm natp-car-of-candidates-with-min-votes (b* ((?cids (candidates-with-min-votes count-alst))) (implies (and (count-alistp count-alst) cids) (natp (car cids)))) :rule-classes (:rewrite :type-prescription))
Theorem:
(defthm candidates-with-min-votes-is-non-empty (implies (and (count-alistp count-alst) (consp count-alst)) (and (candidates-with-min-votes count-alst) (consp (candidates-with-min-votes count-alst)))))
Theorem:
(defthm candidates-with-min-votes-returns-a-subset-of-candidates (subsetp-equal (candidates-with-min-votes count-alst) (strip-cars count-alst)))