• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Pfcs
      • Wp-gen
      • Dimacs-reader
      • Legacy-defrstobj
      • Proof-checker-array
      • Soft
      • C
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Leftist-trees
      • Java
      • Taspi
      • Riscv
      • 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
          • Circuits
            • Circuits-pfcs
            • Circuits-r1cs
            • Field-div-flagged
            • Boolean-assert-true
            • Field-inv-flagged
            • Boolean-assert
            • Field-div-unchecked
            • Field-neq
              • Field-neq-correctness
              • Field-neq-spec
              • Field-neq-circuit
              • Field-neq-lifting
              • Boolean-not
              • Boolean-assert-all
              • Boolean-if
              • Field-if
              • Boolean-xor
              • Boolean-or
              • Boolean-nor
              • Boolean-and
              • Boolean-nand
              • Boolean-neq
              • Boolean-eq
              • Boolean-assert-neq
              • Boolean-assert-eq
              • Field-eq
              • Field-div-checked
              • Field-inv-checked
              • Field-assert-neq
              • Field-assert-eq
              • Field-mul
              • Field-sub
              • Field-square
              • Field-neg
              • Field-double
              • Field-add
            • Language
          • Leo
        • Bigmems
        • Builtins
        • Execloader
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Community
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Field-neq

    Field-neq-lifting

    Lifting of the circuit to a predicate.

    Definitions and Theorems

    Theorem: field-neq-pred-suff

    (defthm field-neq-pred-suff
     (implies
      (and
       (pfield::fep w prime)
       (and
         (equal (pfield::mul
                     (pfield::add x (pfield::mul (mod -1 prime) y prime)
                                  prime)
                     w prime)
                z)
         (equal (pfield::mul
                     (pfield::add x (pfield::mul (mod -1 prime) y prime)
                                  prime)
                     (pfield::add (mod 1 prime)
                                  (pfield::mul (mod -1 prime) z prime)
                                  prime)
                     prime)
                (mod 0 prime))))
      (field-neq-pred x y z prime)))

    Theorem: definition-satp-to-field-neq-pred

    (defthm definition-satp-to-field-neq-pred
     (implies
      (and
       (equal
          (pfcs::lookup-definition "field_neq" pfcs::defs)
          '(:definition
                (pfcs::name . "field_neq")
                (pfcs::para "x" "y" "z")
                (pfcs::body
                     (:equal (:mul (:add (:var "x")
                                         (:mul (:const -1) (:var "y")))
                                   (:var "w"))
                             (:var "z"))
                     (:equal (:mul (:add (:var "x")
                                         (:mul (:const -1) (:var "y")))
                                   (:add (:const 1)
                                         (:mul (:const -1) (:var "z"))))
                             (:const 0)))))
       (pfield::fep x prime)
       (pfield::fep y prime)
       (pfield::fep z prime)
       (primep prime))
      (equal (pfcs::definition-satp "field_neq" pfcs::defs (list x y z)
                                    prime)
             (field-neq-pred x y z prime))))