Theorems about the injectivity of the conversions from digits to natural numbers.
The conversions from digits to natural numbers are injective
over digits without superfluous zeros in the most significant positions.
These are simple consequences of the
Another formulation of the inejctivity theorems is that the conversions from digits to natural numbers are injective over lists of digits of the same length.
Note that each formulation of the injectivity theorem is proved via a ``corresponding'' inversion theorem.
Theorem:
(defthm lendian=>nat-injectivity* (implies (and (equal (trim-lendian* (dab-digit-list-fix base digits1)) digits1) (equal (trim-lendian* (dab-digit-list-fix base digits2)) digits2)) (equal (equal (lendian=>nat base digits1) (lendian=>nat base digits2)) (equal digits1 digits2))))
Theorem:
(defthm lendian=>nat-injectivity+ (implies (and (equal (trim-lendian+ (dab-digit-list-fix base digits1)) digits1) (equal (trim-lendian+ (dab-digit-list-fix base digits2)) digits2)) (equal (equal (lendian=>nat base digits1) (lendian=>nat base digits2)) (equal digits1 digits2))))
Theorem:
(defthm lendian=>nat-injectivity (implies (equal (len digits1) (len digits2)) (equal (equal (lendian=>nat base digits1) (lendian=>nat base digits2)) (equal (dab-digit-list-fix base digits1) (dab-digit-list-fix base digits2)))))
Theorem:
(defthm bendian=>nat-injectivity* (implies (and (equal (trim-bendian* (dab-digit-list-fix base digits1)) digits1) (equal (trim-bendian* (dab-digit-list-fix base digits2)) digits2)) (equal (equal (bendian=>nat base digits1) (bendian=>nat base digits2)) (equal digits1 digits2))))
Theorem:
(defthm bendian=>nat-injectivity+ (implies (and (equal (trim-bendian+ (dab-digit-list-fix base digits1)) digits1) (equal (trim-bendian+ (dab-digit-list-fix base digits2)) digits2)) (equal (equal (bendian=>nat base digits1) (bendian=>nat base digits2)) (equal digits1 digits2))))
Theorem:
(defthm bendian=>nat-injectivity (implies (equal (len digits1) (len digits2)) (equal (equal (bendian=>nat base digits1) (bendian=>nat base digits2)) (equal (dab-digit-list-fix base digits1) (dab-digit-list-fix base digits2)))))