(a4veclist-nth n x) → elt
Function:
(defun a4veclist-nth (n x) (declare (xargs :guard (and (natp n) (a4veclist-p x)))) (let ((__function__ 'a4veclist-nth)) (declare (ignorable __function__)) (mbe :logic (if (< (nfix n) (len x)) (a4vec-fix (nth n x)) (a4vec-x)) :exec (or (nth n x) (a4vec-x)))))
Theorem:
(defthm a4vec-p-of-a4veclist-nth (b* ((elt (a4veclist-nth n x))) (a4vec-p elt)) :rule-classes :rewrite)
Theorem:
(defthm a4veclist-nth-out-of-bounds (implies (<= (len x) (nfix n)) (equal (a4veclist-nth n x) (a4vec-x))))
Theorem:
(defthm a4veclist-nth-in-of-bounds (implies (< (nfix n) (len x)) (equal (a4veclist-nth n x) (a4vec-fix (nth n x)))))
Theorem:
(defthm a4veclist-nth-of-nfix-n (equal (a4veclist-nth (nfix n) x) (a4veclist-nth n x)))
Theorem:
(defthm a4veclist-nth-nat-equiv-congruence-on-n (implies (nat-equiv n n-equiv) (equal (a4veclist-nth n x) (a4veclist-nth n-equiv x))) :rule-classes :congruence)
Theorem:
(defthm a4veclist-nth-of-a4veclist-fix-x (equal (a4veclist-nth n (a4veclist-fix x)) (a4veclist-nth n x)))
Theorem:
(defthm a4veclist-nth-a4veclist-equiv-congruence-on-x (implies (a4veclist-equiv x x-equiv) (equal (a4veclist-nth n x) (a4veclist-nth n x-equiv))) :rule-classes :congruence)