Some theorems about the built-in function nthcdr.
The theorems
Theorem:
(defthm nthcdr-of-append-when-leq-len-first (implies (<= n (len a)) (equal (nthcdr n (append a b)) (append (nthcdr n a) b))))
Theorem:
(defthm nthcdr-of-append-when-gt-len-first (implies (and (natp n) (> n (len a))) (equal (nthcdr n (append a b)) (nthcdr (- n (len a)) b))))
Theorem:
(defthm nthcdr-of-append (implies (natp n) (equal (nthcdr n (append a b)) (if (<= n (len a)) (append (nthcdr n a) b) (nthcdr (- n (len a)) b)))))
Theorem:
(defthm nthcdr-when-len (implies (equal n (len x)) (list-equiv (nthcdr n x) nil)))