Raise a field element to the
If the exponent is negative, we map 0 to 0 and we map non-zero elements to the inverses of their positive powers. Note that raising a non-zero field element to a power yields a non-zero element.
Function:
(defun pow-by-alpha (elem alpha prime) (declare (xargs :guard (and (integerp alpha) (primep prime) (fep elem prime)))) (let ((__function__ 'pow-by-alpha)) (declare (ignorable __function__)) (if (< alpha 0) (if (= elem 0) 0 (inv (pow elem (- alpha) prime) prime)) (pow elem alpha prime))))
Theorem:
(defthm fep-of-pow-by-alpha (implies (primep prime) (b* ((new-elem (pow-by-alpha elem alpha prime))) (fep new-elem prime))) :rule-classes :rewrite)