Extract the bit at the given index from a sparseint
(sparseint-bit n x) → bit
Function:
(defun sparseint-bit$inline (n x) (declare (xargs :guard (and (natp n) (sparseint-p x)))) (let ((__function__ 'sparseint-bit)) (declare (ignorable __function__)) (sparseint$-bit n (sparseint-fix x))))
Theorem:
(defthm bitp-of-sparseint-bit (b* ((bit (sparseint-bit$inline n x))) (bitp bit)) :rule-classes :type-prescription)
Theorem:
(defthm sparseint-bit-correct (b* nil (equal (sparseint-bit n x) (logbit n (sparseint-val x)))))
Theorem:
(defthm sparseint-bit$inline-of-nfix-n (equal (sparseint-bit$inline (nfix n) x) (sparseint-bit$inline n x)))
Theorem:
(defthm sparseint-bit$inline-nat-equiv-congruence-on-n (implies (nat-equiv n n-equiv) (equal (sparseint-bit$inline n x) (sparseint-bit$inline n-equiv x))) :rule-classes :congruence)
Theorem:
(defthm sparseint-bit$inline-of-sparseint-fix-x (equal (sparseint-bit$inline n (sparseint-fix x)) (sparseint-bit$inline n x)))
Theorem:
(defthm sparseint-bit$inline-sparseint-equiv-congruence-on-x (implies (sparseint-equiv x x-equiv) (equal (sparseint-bit$inline n x) (sparseint-bit$inline n x-equiv))) :rule-classes :congruence)