(intersectp-witness x y) finds a some element that is a member
of both
This function is useful for basic pick-a-point style reasoning about set intersection.
Function:
(defun intersectp-witness (x y) (if (atom x) nil (if (member (car x) y) (car x) (intersectp-witness (cdr x) y))))
Theorem:
(defthm intersectp-witness-correct (let ((a (intersectp-witness x y))) (equal (intersectp x y) (and (member a x) (member a y) t))))
Theorem:
(defthm intersectp-witness-rw (implies (rewriting-negative-literal (cons 'intersectp-equal (cons x (cons y 'nil)))) (let ((a (intersectp-witness x y))) (equal (intersectp x y) (and (member a x) (member a y) t)))))