Lemmas about set-difference$ available in the std/lists library.
Theorem:
(defthm set-difference-equal-when-atom (implies (atom x) (equal (set-difference-equal x y) nil)))
Theorem:
(defthm set-difference-equal-of-cons (equal (set-difference-equal (cons a x) y) (if (member-equal a y) (set-difference-equal x y) (cons a (set-difference-equal x y)))))
Theorem:
(defthm set-difference-equal-when-subsetp-equal (implies (subsetp-equal x y) (equal (set-difference-equal x y) nil)))
Theorem:
(defthm set-difference-equal-of-self (equal (set-difference-equal x x) nil))
Theorem:
(defthm empty-intersect-with-difference-of-self (not (intersectp-equal a (set-difference-equal b a))))
Theorem:
(defthm no-duplicatesp-of-set-difference-equal (implies (no-duplicatesp-equal l1) (no-duplicatesp-equal (set-difference-equal l1 l2))))