Check if (every occurrence of) every value in the first obag is also (an occurrence of) a value in the second obag.
This is similar to subset for osets.
Function:
(defun subbag (sub sup) (declare (xargs :guard (and (bagp sub) (bagp sup)))) (let ((__function__ 'subbag)) (declare (ignorable __function__)) (or (emptyp sub) (and (in (head sub) sup) (subbag (tail sub) (delete (head sub) sup))))))
Theorem:
(defthm booleanp-of-subbag (b* ((yes/no (subbag sub sup))) (booleanp yes/no)) :rule-classes :rewrite)