Fixing function for dab-digitp.
(dab-digit-fix base x) → fixed-x
Function:
(defun dab-digit-fix (base x) (declare (xargs :guard (and (dab-basep base) (dab-digitp base x)))) (let ((__function__ 'dab-digit-fix)) (declare (ignorable __function__)) (mbe :logic (if (dab-digitp base x) x 0) :exec x)))
Theorem:
(defthm return-type-of-dab-digit-fix (b* ((fixed-x (dab-digit-fix base x))) (dab-digitp base fixed-x)) :rule-classes :rewrite)
Theorem:
(defthm natp-of-dab-digit-fix (b* ((fixed-x (dab-digit-fix base x))) (natp fixed-x)) :rule-classes :type-prescription)
Theorem:
(defthm dab-digit-fix-upper-bound (b* ((fixed-x (dab-digit-fix base x))) (< fixed-x (dab-base-fix base))) :rule-classes :linear)
Theorem:
(defthm dab-digit-fix-when-dab-digitp (implies (dab-digitp base x) (equal (dab-digit-fix base x) x)))
Theorem:
(defthm dab-digit-fix-of-dab-base-fix-base (equal (dab-digit-fix (dab-base-fix base) x) (dab-digit-fix base x)))
Theorem:
(defthm dab-digit-fix-dab-base-equiv-congruence-on-base (implies (dab-base-equiv base base-equiv) (equal (dab-digit-fix base x) (dab-digit-fix base-equiv x))) :rule-classes :congruence)