• 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
      • Riscv
      • Taspi
      • Bitcoin
      • Des
      • Ethereum
      • X86isa
      • Sha-2
      • Yul
      • Zcash
      • Proof-checker-itp13
      • Regex
      • ACL2-programming-language
      • Json
      • Jfkr
      • Equational
      • Cryptography
      • Poseidon
      • Where-do-i-place-my-book
      • Axe
      • Aleo
        • Aleobft
        • Aleovm
        • Leo
          • Grammar
          • Early-version
            • Json2ast
            • Testing
            • Definition
              • Flattening
              • Abstract-syntax
              • Dynamic-semantics
              • Compilation
              • Static-semantics
                • Type-checking
                • Static-environments
                • Curve-parameterization
                  • Curve-subgroupp
                  • Curve-subgroup-add
                  • Curve-subgroup-mul
                  • Curve
                  • Curve-subgroup-neg
                    • Curve-generator
                    • Curve-zero
                    • Curve-base-prime
                    • Curve-scalar-prime
                  • Function-recursion
                  • Struct-recursion
                  • Input-checking
                  • Program-checking
                  • Type-maps-for-struct-components
                  • Program-and-input-checking
                  • Output-checking
                • Concrete-syntax
        • Bigmems
        • Builtins
        • Execloader
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Community
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Curve-parameterization

    Curve-subgroup-neg

    Negation in the subgroup.

    Signature
    (curve-subgroup-neg x curve) → (mv okp -x)
    Arguments
    x — Guard (curve-subgroupp x curve).
    curve — Guard (curvep curve).
    Returns
    okp — Type (booleanp okp).
    -x — Type (curve-subgroupp -x curve).

    We use the same two-result approach as for addition; see curve-subgroup-add.

    Definitions and Theorems

    Function: curve-subgroup-neg

    (defun curve-subgroup-neg (x curve)
      (declare (xargs :guard (and (curvep curve)
                                  (curve-subgroupp x curve))))
      (let ((__function__ 'curve-subgroup-neg))
        (declare (ignorable __function__))
        (b* ((x (mbe :logic
                     (if (curve-subgroupp x curve)
                         x
                       (curve-zero curve))
                     :exec x))
             (-x (ecurve::edwards-bls12-neg x)))
          (if (curve-subgroupp -x curve)
              (mv t -x)
            (mv nil (curve-zero curve))))))

    Theorem: booleanp-of-curve-subgroup-neg.okp

    (defthm booleanp-of-curve-subgroup-neg.okp
      (b* (((mv ?okp ?-x)
            (curve-subgroup-neg x curve)))
        (booleanp okp))
      :rule-classes :rewrite)

    Theorem: return-type-of-curve-subgroup-neg.-x

    (defthm return-type-of-curve-subgroup-neg.-x
      (b* (((mv ?okp ?-x)
            (curve-subgroup-neg x curve)))
        (curve-subgroupp -x curve))
      :rule-classes :rewrite)

    Theorem: pointp-of-curve-subgroup-neg.-x

    (defthm pointp-of-curve-subgroup-neg.-x
      (b* (((mv ?okp ?-x)
            (curve-subgroup-neg x curve)))
        (pointp -x))
      :rule-classes :rewrite)

    Theorem: curve-subgroup-neg-of-curve-fix-curve

    (defthm curve-subgroup-neg-of-curve-fix-curve
      (equal (curve-subgroup-neg x (curve-fix curve))
             (curve-subgroup-neg x curve)))

    Theorem: curve-subgroup-neg-curve-equiv-congruence-on-curve

    (defthm curve-subgroup-neg-curve-equiv-congruence-on-curve
      (implies (curve-equiv curve curve-equiv)
               (equal (curve-subgroup-neg x curve)
                      (curve-subgroup-neg x curve-equiv)))
      :rule-classes :congruence)