• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • C
      • Proof-checker-array
      • Soft
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Ethereum
      • Leftist-trees
      • Java
      • Riscv
      • Taspi
      • Bitcoin
      • Zcash
      • Des
      • X86isa
      • Sha-2
      • Yul
      • Proof-checker-itp13
      • Regex
      • ACL2-programming-language
      • Json
      • Jfkr
      • Equational
      • Cryptography
      • Axe
      • Poseidon
      • Where-do-i-place-my-book
      • Aleo
        • Aleobft
          • Correctness
            • Unequivocal-dags-def-and-init
            • Same-committees-def-and-implied
            • Dag-omni-paths
            • Signer-records
            • Unequivocal-dags-next
            • Quorum-intersection
            • Dag-previous-quorum-def-and-init-and-next
            • Unequivocal-signed-certificates
            • Signed-previous-quorum
            • Nonforking-anchors-def-and-init-and-next
            • Successor-predecessor-intersection
            • Fault-tolerance
            • Last-anchor-voters-def-and-init-and-next
            • Signer-quorum
            • Committed-redundant-def-and-init-and-next
            • Nonforking-blockchains-def-and-init
            • Blockchain-redundant-def-and-init-and-next
            • No-self-endorsed
            • Last-anchor-present
            • Anchors-extension
              • Collect-anchors-to-append-of-collect-anchors
                • Collect-all-anchors-to-append-of-collect-anchors-dags
                • Collect-all-anchors-to-append-of-collect-anchors
              • Nonforking-blockchains-next
              • Backward-closure
              • Last-blockchain-round
              • Dag-certificate-next
              • Omni-paths-def-and-implied
              • Ordered-blockchain
              • Simultaneous-induction
              • System-certificates
              • Last-anchor-def-and-init
              • Last-anchor-next
              • Dag-previous-quorum
              • Signed-certificates
              • Committed-anchor-sequences
              • Omni-paths
              • Last-anchor-voters
              • Unequivocal-dags
              • Nonforking-blockchains
              • Nonforking-anchors
              • Committed-redundant
              • Same-committees
              • Blockchain-redundant
            • Definition
            • Library-extensions
          • Aleovm
          • Leo
        • 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
    • Anchors-extension

    Collect-anchors-to-append-of-collect-anchors

    Extension theorem for collect-anchors, for a single DAG.

    This is proved by induction on the anchors that form the extension. We have two anchors, anchor and anchor1, with the latter coming strictly after the former. In order to prove this theorem by induction, we formulate it over a generic round round between anchor (inclusive) and anchor1 (exclusive), which matches the previous-round formal of collect-anchors, and is in fact its measured subset that is involved in the induction.

    In the base case, round is the round of anchor, and the equality to prove reduces to:

    (equal (cons anchor1
                 (collect-anchors anchor
                                  (- (certificate->round anchor) 2)
                                  0 dag blockchain))
           (append (list anchor)
                   (collect-anchors anchor
                                    (- (certificate->round anchor) 2)
                                    0 dag blockchain)))

    The cons on the left side arises thanks to the dag-omni-paths-p hypothesis, which tells us that there is a path from anchor1 to anchor. The (list anchor) on the right side is the result of the call of collect-anchors which is the first argument of append. The second argument of append is unchanged. Clearly, the two sides are equal.

    In the step case, round is later than anchor. Both calls of collect-anchors on round expand to terms involving the same recursive calls, and the induction hypothesis ensures equality.

    Definitions and Theorems

    Theorem: collect-anchors-to-append-of-collect-anchors

    (defthm collect-anchors-to-append-of-collect-anchors
     (implies
      (and
        (certificate-setp dag)
        (dag-has-committees-p dag blockchain)
        (dag-in-committees-p dag blockchain)
        (in anchor dag)
        (evenp (certificate->round anchor))
        (equal
             (certificate->author anchor)
             (leader-at-round
                  (certificate->round anchor)
                  (active-committee-at-round (certificate->round anchor)
                                             blockchain)))
        (dag-omni-paths-p anchor dag)
        (in anchor1 dag)
        (evenp (certificate->round anchor1))
        (natp round)
        (evenp round)
        (< round (certificate->round anchor1))
        (>= round (certificate->round anchor)))
      (equal
       (collect-anchors anchor1 round 0 dag blockchain)
       (append (collect-anchors anchor1
                                round (certificate->round anchor)
                                dag blockchain)
               (collect-anchors anchor (- (certificate->round anchor) 2)
                                0 dag blockchain)))))