Fixing function for bip32-ext-key structures.
(bip32-ext-key-fix x) → new-x
Function:
(defun bip32-ext-key-fix$inline (x) (declare (xargs :guard (bip32-ext-key-p x))) (let ((__function__ 'bip32-ext-key-fix)) (declare (ignorable __function__)) (mbe :logic (case (bip32-ext-key-kind x) (:priv (b* ((get (bip32-ext-priv-key-fix (std::da-nth 0 (cdr x))))) (cons :priv (list get)))) (:pub (b* ((get (bip32-ext-pub-key-fix (std::da-nth 0 (cdr x))))) (cons :pub (list get))))) :exec x)))
Theorem:
(defthm bip32-ext-key-p-of-bip32-ext-key-fix (b* ((new-x (bip32-ext-key-fix$inline x))) (bip32-ext-key-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm bip32-ext-key-fix-when-bip32-ext-key-p (implies (bip32-ext-key-p x) (equal (bip32-ext-key-fix x) x)))
Function:
(defun bip32-ext-key-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (bip32-ext-key-p acl2::x) (bip32-ext-key-p acl2::y)))) (equal (bip32-ext-key-fix acl2::x) (bip32-ext-key-fix acl2::y)))
Theorem:
(defthm bip32-ext-key-equiv-is-an-equivalence (and (booleanp (bip32-ext-key-equiv x y)) (bip32-ext-key-equiv x x) (implies (bip32-ext-key-equiv x y) (bip32-ext-key-equiv y x)) (implies (and (bip32-ext-key-equiv x y) (bip32-ext-key-equiv y z)) (bip32-ext-key-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm bip32-ext-key-equiv-implies-equal-bip32-ext-key-fix-1 (implies (bip32-ext-key-equiv acl2::x x-equiv) (equal (bip32-ext-key-fix acl2::x) (bip32-ext-key-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm bip32-ext-key-fix-under-bip32-ext-key-equiv (bip32-ext-key-equiv (bip32-ext-key-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-bip32-ext-key-fix-1-forward-to-bip32-ext-key-equiv (implies (equal (bip32-ext-key-fix acl2::x) acl2::y) (bip32-ext-key-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-bip32-ext-key-fix-2-forward-to-bip32-ext-key-equiv (implies (equal acl2::x (bip32-ext-key-fix acl2::y)) (bip32-ext-key-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm bip32-ext-key-equiv-of-bip32-ext-key-fix-1-forward (implies (bip32-ext-key-equiv (bip32-ext-key-fix acl2::x) acl2::y) (bip32-ext-key-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm bip32-ext-key-equiv-of-bip32-ext-key-fix-2-forward (implies (bip32-ext-key-equiv acl2::x (bip32-ext-key-fix acl2::y)) (bip32-ext-key-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm bip32-ext-key-kind$inline-of-bip32-ext-key-fix-x (equal (bip32-ext-key-kind$inline (bip32-ext-key-fix x)) (bip32-ext-key-kind$inline x)))
Theorem:
(defthm bip32-ext-key-kind$inline-bip32-ext-key-equiv-congruence-on-x (implies (bip32-ext-key-equiv x x-equiv) (equal (bip32-ext-key-kind$inline x) (bip32-ext-key-kind$inline x-equiv))) :rule-classes :congruence)
Theorem:
(defthm consp-of-bip32-ext-key-fix (consp (bip32-ext-key-fix x)) :rule-classes :type-prescription)