Function:
(defun expt2$inline (n) (declare (xargs :guard (natp n))) (let ((__function__ 'expt2)) (declare (ignorable __function__)) (mbe :logic (expt 2 (nfix n)) :exec (the unsigned-byte (ash 1 (the unsigned-byte n))))))
Theorem:
(defthm expt2-type (b* ((nat (expt2$inline n))) (natp nat)) :rule-classes :type-prescription)