• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • Proof-checker-array
      • Soft
      • C
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Leftist-trees
      • Java
      • Taspi
      • Bitcoin
      • Riscv
      • Des
      • Ethereum
      • X86isa
      • Sha-2
      • Yul
      • Zcash
      • Proof-checker-itp13
      • Regex
      • ACL2-programming-language
      • Json
      • Jfkr
      • Equational
      • Cryptography
      • Poseidon
        • Poseidon-main-definition
          • Param
          • Hashp
          • Absorb1
          • Sponge
          • Hash
          • All-rounds
          • Sponge-validp
          • Squeeze1
          • Sub-words-partial
          • Squeeze
          • Round
          • Partial-rounds
          • Mode
          • Full-rounds
          • Permute
          • Sub-words
          • Add-round-constants
          • Mix-layer
          • Dot-product
          • Absorb
          • Pow-by-alpha
            • Param->size
            • Sub-words-full
            • Param->capacity-then-rate-p
            • Param->partial-last-p
            • Param-additional-theorems
            • Param->rounds
            • Param->descending-p
            • Init-sponge
          • Poseidon-instantiations
        • Where-do-i-place-my-book
        • Axe
        • Bigmems
        • Builtins
        • Execloader
        • Aleo
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Poseidon-main-definition

    Pow-by-alpha

    Raise a field element to the \alpha power.

    Signature
    (pow-by-alpha elem alpha prime) → new-elem
    Arguments
    elem — Guard (fep elem prime).
    alpha — Guard (integerp alpha).
    prime — Guard (primep prime).
    Returns
    new-elem — Type (fep new-elem prime), given (primep prime).

    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.

    Definitions and Theorems

    Function: pow-by-alpha

    (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: fep-of-pow-by-alpha

    (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)