Generic projection over a typed list.
Function:
(defun elementlist-projection (x) (if (atom x) nil (cons (element-xformer (car x)) (elementlist-projection (cdr x)))))
Theorem:
(defthm outelement-list-p-of-elementlist-projection (implies (element-list-p x) (outelement-list-p (elementlist-projection x))) :rule-classes :rewrite)
Theorem:
(defthm elementlist-projection-of-cons (equal (elementlist-projection (cons a b)) (cons (element-xformer a) (elementlist-projection b))) :rule-classes :rewrite)
Theorem:
(defthm elementlist-projection-when-not-consp (implies (not (consp x)) (equal (elementlist-projection x) nil)) :rule-classes :rewrite)
Theorem:
(defthm true-listp-of-elementlist-projection (true-listp (elementlist-projection x)) :rule-classes :type-prescription)
Theorem:
(defthm len-of-elementlist-projection (equal (len (elementlist-projection x)) (len x)) :rule-classes :rewrite)
Theorem:
(defthm consp-of-elementlist-projection (equal (consp (elementlist-projection x)) (consp x)) :rule-classes :rewrite)
Theorem:
(defthm elementlist-projection-under-iff (iff (elementlist-projection x) (consp x)) :rule-classes :rewrite)
Theorem:
(defthm car-of-elementlist-projection-when-nil-preservingp (implies (equal nil (element-xformer nil)) (equal (car (elementlist-projection x)) (element-xformer (car x)))) :rule-classes :rewrite)
Theorem:
(defthm car-of-elementlist-projection (equal (car (elementlist-projection x)) (and (consp x) (element-xformer (car x)))) :rule-classes :rewrite)
Theorem:
(defthm cdr-of-elementlist-projection (equal (cdr (elementlist-projection x)) (elementlist-projection (cdr x))) :rule-classes :rewrite)
Theorem:
(defthm elementlist-projection-of-append (equal (elementlist-projection (append a b)) (append (elementlist-projection a) (elementlist-projection b))) :rule-classes :rewrite)