(head x) returns the smallest element in a set.
This is like car, but respects the non-set convention and
always returns
Function:
(defun head (x) (declare (xargs :guard (and (setp x) (not (emptyp x))))) (mbe :logic (car (sfix x)) :exec (car x)))
Theorem:
(defthm head-count (implies (not (emptyp x)) (< (acl2-count (head x)) (acl2-count x))) :rule-classes ((:rewrite) (:linear)))
Theorem:
(defthm head-count-built-in (implies (not (emptyp x)) (o< (acl2-count (head x)) (acl2-count x))) :rule-classes :built-in-clause)
Theorem:
(defthm head-when-emptyp (implies (emptyp x) (equal (head x) nil)))
Theorem:
(defthm head-sfix-cancel (equal (head (sfix x)) (head x)))
Theorem:
(defthm head-minimal (implies (<< a (head x)) (not (in a x))))
Theorem:
(defthm head-minimal-2 (implies (in a x) (not (<< a (head x)))))
Theorem:
(defthm head-unique (not (in (head x) (tail x))))