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 tpath → valueIn 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