Fixing function for secp256k1-point structures.
(secp256k1-point-fix p) → new-x
Function:
(defun secp256k1-point-fix$inline (p) (declare (xargs :guard (secp256k1-pointp p))) (let ((acl2::__function__ 'secp256k1-point-fix)) (declare (ignorable acl2::__function__)) (mbe :logic (b* ((x (secp256k1-field-fix (std::da-nth 0 p))) (y (secp256k1-field-fix (std::da-nth 1 p)))) (list x y)) :exec p)))
Theorem:
(defthm secp256k1-pointp-of-secp256k1-point-fix (b* ((new-x (secp256k1-point-fix$inline p))) (secp256k1-pointp new-x)) :rule-classes :rewrite)
Theorem:
(defthm secp256k1-point-fix-when-secp256k1-pointp (implies (secp256k1-pointp p) (equal (secp256k1-point-fix p) p)))
Function:
(defun secp256k1-point-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (secp256k1-pointp acl2::x) (secp256k1-pointp acl2::y)))) (equal (secp256k1-point-fix acl2::x) (secp256k1-point-fix acl2::y)))
Theorem:
(defthm secp256k1-point-equiv-is-an-equivalence (and (booleanp (secp256k1-point-equiv x y)) (secp256k1-point-equiv x x) (implies (secp256k1-point-equiv x y) (secp256k1-point-equiv y x)) (implies (and (secp256k1-point-equiv x y) (secp256k1-point-equiv y z)) (secp256k1-point-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm secp256k1-point-equiv-implies-equal-secp256k1-point-fix-1 (implies (secp256k1-point-equiv acl2::x x-equiv) (equal (secp256k1-point-fix acl2::x) (secp256k1-point-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm secp256k1-point-fix-under-secp256k1-point-equiv (secp256k1-point-equiv (secp256k1-point-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-secp256k1-point-fix-1-forward-to-secp256k1-point-equiv (implies (equal (secp256k1-point-fix acl2::x) acl2::y) (secp256k1-point-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-secp256k1-point-fix-2-forward-to-secp256k1-point-equiv (implies (equal acl2::x (secp256k1-point-fix acl2::y)) (secp256k1-point-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm secp256k1-point-equiv-of-secp256k1-point-fix-1-forward (implies (secp256k1-point-equiv (secp256k1-point-fix acl2::x) acl2::y) (secp256k1-point-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm secp256k1-point-equiv-of-secp256k1-point-fix-2-forward (implies (secp256k1-point-equiv acl2::x (secp256k1-point-fix acl2::y)) (secp256k1-point-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)