(subsetp-witness x y) finds an element of
This function is useful for basic pick-a-point style reasoning about subsets.
Function:
(defun subsetp-witness (x y) (if (atom x) nil (if (member (car x) y) (subsetp-witness (cdr x) y) (car x))))
Theorem:
(defthm subsetp-witness-correct (let ((a (subsetp-witness x y))) (iff (subsetp x y) (implies (member a x) (member a y)))))
Theorem:
(defthm subsetp-witness-rw (implies (rewriting-positive-literal (cons 'subsetp-equal (cons x (cons y 'nil)))) (let ((a (subsetp-witness x y))) (iff (subsetp x y) (implies (member a x) (member a y))))))