Generic mapappend over a typed list.
Function:
(defun elementlist-mapappend (x) (if (atom x) nil (append (element-listxformer (car x)) (elementlist-mapappend (cdr x)))))
Theorem:
(defthm outelement-list-p-of-elementlist-mapappend (implies (element-list-p x) (outelement-list-p (elementlist-mapappend x))) :rule-classes :rewrite)
Theorem:
(defthm elementlist-mapappend-of-cons (equal (elementlist-mapappend (cons a b)) (append (element-listxformer a) (elementlist-mapappend b))) :rule-classes :rewrite)
Theorem:
(defthm elementlist-mapappend-when-not-consp (implies (not (consp x)) (equal (elementlist-mapappend x) nil)) :rule-classes :rewrite)
Theorem:
(defthm elementlist-mapappend-of-append (equal (elementlist-mapappend (append a b)) (append (elementlist-mapappend a) (elementlist-mapappend b))) :rule-classes :rewrite)