Fixing function for short-weierstrass structures.
(short-weierstrass-fix x) → new-x
Function:
(defun short-weierstrass-fix$inline (x) (declare (xargs :guard (short-weierstrass-p x))) (let ((acl2::__function__ 'short-weierstrass-fix)) (declare (ignorable acl2::__function__)) (mbe :logic (b* ((p (nfix (cdr (std::da-nth 0 x)))) (a (nfix (cdr (std::da-nth 1 x)))) (b (nfix (cdr (std::da-nth 2 x))))) (let ((p (if (and (> p 3) (fep a p) (fep b p) (posp (mod (+ (* 4 a a a) (* 27 b b)) p))) p 5)) (a (if (and (> p 3) (fep a p) (fep b p) (posp (mod (+ (* 4 a a a) (* 27 b b)) p))) a 0)) (b (if (and (> p 3) (fep a p) (fep b p) (posp (mod (+ (* 4 a a a) (* 27 b b)) p))) b 1))) (list (cons 'p p) (cons 'a a) (cons 'b b)))) :exec x)))
Theorem:
(defthm short-weierstrass-p-of-short-weierstrass-fix (b* ((new-x (short-weierstrass-fix$inline x))) (short-weierstrass-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm short-weierstrass-fix-when-short-weierstrass-p (implies (short-weierstrass-p x) (equal (short-weierstrass-fix x) x)))
Function:
(defun short-weierstrass-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (short-weierstrass-p acl2::x) (short-weierstrass-p acl2::y)))) (equal (short-weierstrass-fix acl2::x) (short-weierstrass-fix acl2::y)))
Theorem:
(defthm short-weierstrass-equiv-is-an-equivalence (and (booleanp (short-weierstrass-equiv x y)) (short-weierstrass-equiv x x) (implies (short-weierstrass-equiv x y) (short-weierstrass-equiv y x)) (implies (and (short-weierstrass-equiv x y) (short-weierstrass-equiv y z)) (short-weierstrass-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm short-weierstrass-equiv-implies-equal-short-weierstrass-fix-1 (implies (short-weierstrass-equiv acl2::x x-equiv) (equal (short-weierstrass-fix acl2::x) (short-weierstrass-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm short-weierstrass-fix-under-short-weierstrass-equiv (short-weierstrass-equiv (short-weierstrass-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-short-weierstrass-fix-1-forward-to-short-weierstrass-equiv (implies (equal (short-weierstrass-fix acl2::x) acl2::y) (short-weierstrass-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-short-weierstrass-fix-2-forward-to-short-weierstrass-equiv (implies (equal acl2::x (short-weierstrass-fix acl2::y)) (short-weierstrass-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm short-weierstrass-equiv-of-short-weierstrass-fix-1-forward (implies (short-weierstrass-equiv (short-weierstrass-fix acl2::x) acl2::y) (short-weierstrass-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm short-weierstrass-equiv-of-short-weierstrass-fix-2-forward (implies (short-weierstrass-equiv acl2::x (short-weierstrass-fix acl2::y)) (short-weierstrass-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)