Some theorems about osets.
Theorem:
(defthm set::not-emptyp-when-in-of-subset (implies (and (in a x) (subset x y)) (not (emptyp y))))
Theorem:
(defthm set::subset-of-union-when-both-subset (implies (and (subset a s) (subset b s)) (subset (union a b) s)))
Theorem:
(defthm set::cardinality-of-union-upper-bound-when-both-subset (implies (and (subset a s) (subset b s)) (<= (cardinality (union a b)) (cardinality s))) :rule-classes (:rewrite :linear))
Theorem:
(defthm set::intersect-of-insert-left (equal (intersect (insert a x) y) (if (in a y) (insert a (intersect x y)) (intersect x y))))
Theorem:
(defthm set::intersect-of-insert-right (equal (intersect x (insert a y)) (if (in a x) (insert a (intersect x y)) (intersect x y))))
Theorem:
(defthm set::same-element-when-cardinality-leq-1 (implies (and (<= (cardinality set) 1) (in elem1 set) (in elem2 set)) (equal elem1 elem2)) :rule-classes nil)
Theorem:
(defthm set::cardinality-of-tail-leq (<= (cardinality (tail set)) (cardinality set)) :rule-classes :linear)
Theorem:
(defthm set::head-of-intersect-member-when-not-emptyp (implies (not (emptyp (intersect x y))) (and (in (head (intersect x y)) x) (in (head (intersect x y)) y))))
Theorem:
(defthm set::emptyp-when-proper-subset-of-singleton (implies (and (subset x (insert a nil)) (not (equal x (insert a nil)))) (emptyp x)))
Theorem:
(defthm set::intersect-mono-subset (implies (subset a b) (subset (intersect a c) (intersect b c))))
Theorem:
(defthm set::emptyp-to-subset-of-nil (equal (emptyp a) (subset a nil)))
Theorem:
(defthm set::not-member-when-member-of-disjoint (implies (and (not (intersect a b)) (in x a)) (not (in x b))))
Theorem:
(defthm set::emptyp-of-intersect-of-subset-left (implies (and (subset a b) (emptyp (intersect b c))) (emptyp (intersect a c))))
Theorem:
(defthm set::subset-of-intersect-if-subset-of-both (implies (and (subset a b) (subset a c)) (subset a (intersect b c))))
Theorem:
(defthm set::subset-of-tail-and-delete-when-subset (implies (and (not (emptyp x)) (subset x y)) (subset (tail x) (delete (head x) y))))
Theorem:
(defthm set::subset-of-difference-when-disjoint (implies (and (subset x y) (emptyp (intersect x z))) (subset x (difference y z))))
Theorem:
(defthm set::not-emptyp-of-intersect-when-in-both (implies (and (in a x) (in a y)) (not (emptyp (intersect x y)))))