Lemmas about append available in the std/lists library.
Theorem:
(defthm append-when-not-consp (implies (not (consp x)) (equal (append x y) y)))
Theorem:
(defthm append-of-cons (equal (append (cons a x) y) (cons a (append x y))))
Theorem:
(defthm true-listp-of-append (equal (true-listp (append x y)) (true-listp y)))
Theorem:
(defthm consp-of-append (equal (consp (append x y)) (or (consp x) (consp y))))
Theorem:
(defthm append-under-iff (iff (append x y) (or (consp x) y)))
Theorem:
(defthm len-of-append (equal (len (append x y)) (+ (len x) (len y))))
Theorem:
(defthm equal-when-append-same (equal (equal (append x y1) (append x y2)) (equal y1 y2)))
Theorem:
(defthm equal-of-append-and-append-same-arg2 (equal (equal (append x1 y) (append x2 y)) (equal (true-list-fix x1) (true-list-fix x2))))
Theorem:
(defthm append-of-nil (equal (append x nil) (list-fix x)))
Theorem:
(defthm list-fix-of-append (equal (list-fix (append x y)) (append x (list-fix y))))
Theorem:
(defthm car-of-append (equal (car (append x y)) (if (consp x) (car x) (car y))))
Theorem:
(defthm car-of-append-when-consp (implies (consp x) (equal (car (append x y)) (car x))))
Theorem:
(defthm cdr-of-append (equal (cdr (append x y)) (if (consp x) (append (cdr x) y) (cdr y))))
Theorem:
(defthm cdr-of-append-when-consp (implies (consp x) (equal (cdr (append x y)) (append (cdr x) y))))
Theorem:
(defthm associativity-of-append (equal (append (append a b) c) (append a (append b c))))
Theorem:
(defthm element-list-equiv-implies-element-list-equiv-append-1 (implies (element-list-equiv a a-equiv) (element-list-equiv (append a b) (append a-equiv b))) :rule-classes (:congruence))
Theorem:
(defthm element-list-equiv-implies-element-list-equiv-append-2 (implies (element-list-equiv b b-equiv) (element-list-equiv (append a b) (append a b-equiv))) :rule-classes (:congruence))
Theorem:
(defthm element-list-p-of-append-true-list (equal (element-list-p (append a b)) (and (element-list-p (list-fix a)) (element-list-p b))) :rule-classes :rewrite)