Documentation

FraudProof.DataStructures.BTree

Binary Tree #

inductive ABTree (α β : Type) :
Instances For
    def ABTree.sizeI {α β : Type} (sa : α) (sb : β) :
    ABTree α β
    Equations
    Instances For
      def ABTree.size {α β : Type} :
      ABTree α β
      Equations
      Instances For
        def ABTree.height {α β : Type} :
        ABTree α β
        Equations
        Instances For
          def ABTree.getI' {α β γ : Type} (p : αγ) (q : βγ) :
          ABTree α βγ
          Equations
          Instances For
            def ABTree.hget {α : Type} :
            ABTree α αα
            Equations
            Instances For
              def ABTree.getI {α β : Type} :
              ABTree (α × β) ββ
              Equations
              Instances For
                def ABTree.fold {α β γ : Type} (l : αγ) (n : βγγγ) :
                ABTree α βγ
                Equations
                Instances For
                  theorem ABTree.fold_node {α β γ : Type} {l : αγ} {n : βγγγ} (bl br : ABTree α β) (b : β) :
                  fold l n (node b bl br) = n b (fold l n bl) (fold l n br)
                  def ABTree.map {α₁ α₂ β₁ β₂ : Type} (f : α₁α₂) (g : β₁β₂) :
                  ABTree α₁ β₁ABTree α₂ β₂
                  Equations
                  Instances For
                    theorem abtree_map_compose {α₁ α₂ α₃ β₁ β₂ β₃ : Type} (f : α₁α₂) (f' : α₂α₃) (g : β₁β₂) (g' : β₂β₃) (t : ABTree α₁ β₁) :
                    ABTree.map f' g' (ABTree.map f g t) = ABTree.map (f' f) (g' g) t
                    Equations
                    theorem getMapLaw {α β δ γ σ : Type} (f : αδ) (g : βγ) (f' : δσ) (g' : γσ) (t : ABTree α β) :
                    ABTree.getI' f' g' (ABTree.map f g t) = ABTree.getI' (f' f) (g' g) t
                    def abtree_zip_with {α β δ ε ρ η : Type} (f : αδρ) (g : βεη) (l : ABTree α β) (r : ABTree δ ε) :
                    Option (ABTree ρ η)
                    Equations
                    Instances For
                      def ABTree.forget {α β : Type} :
                      Equations
                      Instances For
                        @[reducible, inline]
                        abbrev BTree (α : Type) :
                        Equations
                        Instances For
                          def BTree.toAB {α : Type} :
                          BTree αABTree α Unit
                          Equations
                          Instances For
                            def BTree.leaf {α : Type} :
                            αBTree α
                            Equations
                            Instances For
                              def BTree.node {α : Type} :
                              BTree αBTree αBTree α
                              Equations
                              Instances For
                                def BTree.map {α β : Type} (f : αβ) :
                                BTree αBTree β
                                Equations
                                Instances For
                                  def BTree.fold {α γ : Type} (l : αγ) (n : γγγ) :
                                  BTree αγ
                                  Equations
                                  Instances For
                                    theorem abfold_bfold {α γ : Type} (l : αγ) (n : γγγ) (t : BTree α) :
                                    BTree.fold l n t = ABTree.fold l (fun (_x : Unit) => n) t
                                    Equations
                                    inductive Mem {α : Type} (a : α) :
                                    BTree αProp
                                    Instances For
                                      instance instMembershipBTree {α : Type} :
                                      Equations
                                      def pairUp' {α : Type} (acc : Option (BTree α)) (ls : List (BTree α)) :
                                      List (BTree α)
                                      Equations
                                      Instances For
                                        theorem pairSize' {α : Type} (ls : List (BTree α)) (p : Option (BTree α)) :
                                        theorem pairSizeNone {α : Type} (ls : List (BTree α)) :
                                        def pairUp {α : Type} (ls : List (BTree α)) :
                                        List (BTree α)
                                        Equations
                                        Instances For
                                          theorem pairSize {α : Type} (ls : List (BTree α)) :
                                          @[irreducible]
                                          def List.fromList' {α : Type} (ls : List (BTree α)) :
                                          Equations
                                          Instances For
                                            def List.fromList {α : Type} (ls : List α) :
                                            Equations
                                            Instances For
                                              @[reducible, inline]
                                              abbrev TreePath (α : Type) :
                                              Equations
                                              Instances For

                                                Value Contention #

                                                Value Contention Definition #

                                                def valueIn {α : Type} [BEq α] (v : α) (bt : BTree α) :
                                                Equations
                                                Instances For
                                                  def valueInProof {α : Type} [BEq α] (v : α) (bt : BTree α) :
                                                  Equations
                                                  Instances For
                                                    theorem notValue {α : Type} [BEq α] (v : α) (bt : BTree α) :
                                                    theorem valueInToProof {α : Type} [BEq α] (v : α) (bt : BTree α) :
                                                    theorem valueInProofToValueIn {α : Type} [BEq α] (v : α) (bt : BTree α) (tpath : TreePath α) :
                                                    valueInProof v bt = some tpathvalueIn v bt = true
                                                    theorem ValueInIFFPath {α : Type} [BEq α] (v : α) (bt : BTree α) :

                                                    Utils #

                                                    def length {α : Type} (bt : BTree α) :
                                                    Equations
                                                    Instances For
                                                      def toList {α : Type} (bt : BTree α) :
                                                      List α
                                                      Equations
                                                      Instances For
                                                        axiom lengthConcat {α : Type} (l r : List α) :
                                                        (l ++ r).length = l.length + r.length
                                                        theorem sameLength {α : Type} (bt : BTree α) :

                                                        Tree Building from Paths #

                                                        def buildTreeN {α : Type} (accumTree : BTree α) (path : TreePath α) :
                                                        Equations
                                                        Instances For
                                                          def buildTree {α : Type} (v : α) (path : TreePath α) :
                                                          Equations
                                                          Instances For
                                                            @[reducible, inline]
                                                            Equations
                                                            Instances For