Documentation

Projects.Util.Data.LeafTrie.Raw0

inductive LeafTrie.Raw₀ (α : Type u_1) (β : Type u_2) [DecidableEq α] [Hashable α] :
Type (max u_1 u_2)
Instances For
    def LeafTrie.Raw₀.isLeaf {α : Type u_1} {β : Type u_2} [ha₁ : DecidableEq α] [ha₂ : Hashable α] (t : Raw₀ α β) :
    Equations
    Instances For
      def LeafTrie.Raw₀.isNode {α : Type u_1} {β : Type u_2} [ha₁ : DecidableEq α] [ha₂ : Hashable α] (t : Raw₀ α β) :
      Equations
      Instances For
        class inductive LeafTrie.Raw₀.WF {α : Type u_1} {β : Type u_2} [ha₁ : DecidableEq α] [ha₂ : Hashable α] :
        Raw₀ α βProp
        Instances
          theorem LeafTrie.Raw₀.rec_3_eq {α : Type u_1} {β : Type u_2} [ha₁ : DecidableEq α] [ha₂ : Hashable α] {xs : List (Std.DHashMap.Internal.AssocList α fun (x : α) => Raw₀ α β)} {M₁ : Raw₀ α βSort u_3} {M₂ : (Std.DHashMap.Raw α fun (x : α) => Raw₀ α β)Sort u_3} {M₃ : Array (Std.DHashMap.Internal.AssocList α fun (x : α) => Raw₀ α β)Sort u_3} {M₄ : List (Std.DHashMap.Internal.AssocList α fun (x : α) => Raw₀ α β)Sort u_3} {M₅ : (Std.DHashMap.Internal.AssocList α fun (x : α) => Raw₀ α β)Sort u_3} {H₁ : (a : β) → M₁ (leaf a)} {H₂ : (a : Std.DHashMap.Raw α fun (x : α) => Raw₀ α β) → M₂ aM₁ (node a)} {H₃ : (size : ) → (buckets : Array (Std.DHashMap.Internal.AssocList α fun (x : α) => Raw₀ α β)) → M₃ bucketsM₂ { size := size, buckets := buckets }} {H₄ : (toList : List (Std.DHashMap.Internal.AssocList α fun (x : α) => Raw₀ α β)) → M₄ toListM₃ { toList := toList }} {H₅ : M₄ []} {H₆ : (head : Std.DHashMap.Internal.AssocList α fun (x : α) => Raw₀ α β) → (tail : List (Std.DHashMap.Internal.AssocList α fun (x : α) => Raw₀ α β)) → M₅ headM₄ tailM₄ (head :: tail)} {H₇ : M₅ Std.DHashMap.Internal.AssocList.nil} {H₈ : (key : α) → (value : (fun (x : α) => Raw₀ α β) key) → (tail : Std.DHashMap.Internal.AssocList α fun (x : α) => Raw₀ α β) → M₁ valueM₅ tailM₅ (Std.DHashMap.Internal.AssocList.cons key value tail)} :
          rec_3 H₁ H₂ H₃ H₄ H₅ H₆ H₇ H₈ xs = List.rec H₅ (fun (x : Std.DHashMap.Internal.AssocList α fun (x : α) => Raw₀ α β) (xs : List (Std.DHashMap.Internal.AssocList α fun (x : α) => Raw₀ α β)) (acc : M₄ xs) => H₆ x xs (rec_4 H₁ H₂ H₃ H₄ H₅ H₆ H₇ H₈ x) acc) xs
          theorem LeafTrie.Raw₀.rec_4_eq {α : Type u_1} {β : Type u_2} [ha₁ : DecidableEq α] [ha₂ : Hashable α] {xs : Std.DHashMap.Internal.AssocList α fun (x : α) => Raw₀ α β} {M₁ : Raw₀ α βSort u_3} {M₂ : (Std.DHashMap.Raw α fun (x : α) => Raw₀ α β)Sort u_3} {M₃ : Array (Std.DHashMap.Internal.AssocList α fun (x : α) => Raw₀ α β)Sort u_3} {M₄ : List (Std.DHashMap.Internal.AssocList α fun (x : α) => Raw₀ α β)Sort u_3} {M₅ : Sort u_3} {H₁ : (a : β) → M₁ (leaf a)} {H₂ : (a : Std.DHashMap.Raw α fun (x : α) => Raw₀ α β) → M₂ aM₁ (node a)} {H₃ : (size : ) → (buckets : Array (Std.DHashMap.Internal.AssocList α fun (x : α) => Raw₀ α β)) → M₃ bucketsM₂ { size := size, buckets := buckets }} {H₄ : (toList : List (Std.DHashMap.Internal.AssocList α fun (x : α) => Raw₀ α β)) → M₄ toListM₃ { toList := toList }} {H₅ : M₄ []} {H₆ : (head : Std.DHashMap.Internal.AssocList α fun (x : α) => Raw₀ α β) → (tail : List (Std.DHashMap.Internal.AssocList α fun (x : α) => Raw₀ α β)) → M₅M₄ tailM₄ (head :: tail)} {H₇ : M₅} {H₈ : (key : α) → (value : (fun (x : α) => Raw₀ α β) key) → (Std.DHashMap.Internal.AssocList α fun (x : α) => Raw₀ α β)M₁ valueM₅M₅} :
          rec_4 H₁ H₂ H₃ H₄ H₅ H₆ H₇ H₈ xs = List.rec H₇ (fun (x : (_ : α) × Raw₀ α β) (xs : List ((_ : α) × Raw₀ α β)) (acc : M₅) => H₈ x.fst x.snd (Std.DHashMap.Internal.AssocList.ofList xs) (rec H₁ H₂ H₃ H₄ H₅ H₆ H₇ H₈ x.snd) acc) xs.toList
          noncomputable def LeafTrie.Raw₀.depthAux {α : Type u_1} {β : Type u_2} [ha₁ : DecidableEq α] [ha₂ : Hashable α] (t : Raw₀ α β) :
          Equations
          Instances For
            @[simp]
            theorem LeafTrie.Raw₀.depthAux_leaf {α : Type u_1} {β : Type u_2} [ha₁ : DecidableEq α] [ha₂ : Hashable α] {x : β} :
            theorem LeafTrie.Raw₀.depthAux_lt_of_mem {α : Type u_1} {β : Type u_2} [ha₁ : DecidableEq α] [ha₂ : Hashable α] {mp : Std.DHashMap.Raw α fun (x : α) => Raw₀ α β} {i : α} {t : Raw₀ α β} (h : mp.get? i = some t) :
            def LeafTrie.Raw₀.get? {α : Type u_1} {β : Type u_2} [ha₁ : DecidableEq α] [ha₂ : Hashable α] (t : Raw₀ α β) (k : α) :
            Option (Raw₀ α β)
            Equations
            Instances For
              theorem LeafTrie.Raw₀.WF.mp {α : Type u_1} {β : Type u_2} [ha₁ : DecidableEq α] [ha₂ : Hashable α] {mp₁ : Std.DHashMap.Raw α fun (x : α) => Raw₀ α β} [H : (Raw₀.node mp₁).WF] :
              mp₁.WF
              theorem LeafTrie.Raw₀.WF.mp_get? {α : Type u_1} {β : Type u_2} [ha₁ : DecidableEq α] [ha₂ : Hashable α] {mp₁ : Std.DHashMap.Raw α fun (x : α) => Raw₀ α β} {k : α} {t : Raw₀ α β} [H : (Raw₀.node mp₁).WF] (h : mp₁.get? k = some t) :
              t.WF
              theorem LeafTrie.Raw₀.WF.get? {α : Type u_1} {β : Type u_2} [ha₁ : DecidableEq α] [ha₂ : Hashable α] {mp₁ : Std.DHashMap.Raw α fun (x : α) => Raw₀ α β} {k : α} {t : Raw₀ α β} [H : (Raw₀.node mp₁).WF] (h : (Raw₀.node mp₁).get? k = some t) :
              t.WF
              @[irreducible]
              def LeafTrie.Raw₀.recAux {α : Type u_1} {β : Type u_2} [ha₁ : DecidableEq α] [ha₂ : Hashable α] {γ : Raw₀ α βSort u_3} (t : Raw₀ α β) (wf : t.WF) (motive₁ : (val : β) → γ (leaf val)) (motive₂ : (mp : Std.DHashMap.Raw α fun (x : α) => Raw₀ α β) → mp.WF((i : α) → (t : Raw₀ α β) → mp.get? i = some tγ t)γ (node mp)) :
              γ t
              Equations
              Instances For
                def LeafTrie.Raw₀.rec' {α : Type u_1} {β : Type u_2} [ha₁ : DecidableEq α] [ha₂ : Hashable α] {γ : Raw₀ α βSort u_3} (t : Raw₀ α β) [wf : t.WF] (motive₁ : (val : β) → γ (leaf val)) (motive₂ : (mp : Std.DHashMap.Raw α fun (x : α) => Raw₀ α β) → mp.WF((i : α) → (t : Raw₀ α β) → mp.get? i = some tγ t)γ (node mp)) :
                γ t
                Equations
                • t.rec' motive₁ motive₂ = t.recAux wf motive₁ motive₂
                Instances For
                  def LeafTrie.Raw₀.depth {α : Type u_1} {β : Type u_2} [ha₁ : DecidableEq α] [ha₂ : Hashable α] (t : Raw₀ α β) [wf : t.WF] :
                  Equations
                  Instances For
                    def LeafTrie.Raw₀.empty {α : Type u_1} {β : Type u_2} [ha₁ : DecidableEq α] [ha₂ : Hashable α] :
                    Raw₀ α β
                    Equations
                    Instances For
                      @[instance_reducible]
                      instance LeafTrie.Raw₀.instEmptyCollection {α : Type u_1} {β : Type u_2} [ha₁ : DecidableEq α] [ha₂ : Hashable α] :
                      Equations
                      theorem LeafTrie.Raw₀.empty_def {α : Type u_1} {β : Type u_2} [ha₁ : DecidableEq α] [ha₂ : Hashable α] :
                      instance LeafTrie.Raw₀.WF.empty {α : Type u_1} {β : Type u_2} [ha₁ : DecidableEq α] [ha₂ : Hashable α] :
                      @[simp]
                      theorem LeafTrie.Raw₀.rec'_leaf {α : Type u_1} {β : Type u_2} [ha₁ : DecidableEq α] [ha₂ : Hashable α] {val : β} {γ : Raw₀ α βSort u_3} {motive₁ : (val : β) → γ (leaf val)} {motive₂ : (mp : Std.DHashMap.Raw α fun (x : α) => Raw₀ α β) → mp.WF((i : α) → (t : Raw₀ α β) → mp.get? i = some tγ t)γ (node mp)} :
                      (leaf val).rec' motive₁ motive₂ = motive₁ val
                      @[simp]
                      theorem LeafTrie.Raw₀.rec'_node {α : Type u_1} {β : Type u_2} [ha₁ : DecidableEq α] [ha₂ : Hashable α] {mp₁ : Std.DHashMap.Raw α fun (x : α) => Raw₀ α β} {γ : Raw₀ α βSort u_3} [wf : (node mp₁).WF] {motive₁ : (val : β) → γ (leaf val)} {motive₂ : (mp : Std.DHashMap.Raw α fun (x : α) => Raw₀ α β) → mp.WF((i : α) → (t : Raw₀ α β) → mp.get? i = some tγ t)γ (node mp)} :
                      (node mp₁).rec' motive₁ motive₂ = motive₂ mp₁ fun (x : α) (t : Raw₀ α β) (h : mp₁.get? x = some t) => t.recAux motive₁ motive₂
                      @[simp]
                      theorem LeafTrie.Raw₀.depth_leaf {α : Type u_1} {β : Type u_2} [ha₁ : DecidableEq α] [ha₂ : Hashable α] {val : β} :
                      (leaf val).depth = 0
                      @[simp]
                      theorem LeafTrie.Raw₀.get?_leaf {α : Type u_1} {β : Type u_2} [ha₁ : DecidableEq α] [ha₂ : Hashable α] {x : β} {k : α} :
                      (leaf x).get? k = none
                      @[simp]
                      theorem LeafTrie.Raw₀.get?_node {α : Type u_1} {β : Type u_2} [ha₁ : DecidableEq α] [ha₂ : Hashable α] {mp : Std.DHashMap.Raw α fun (x : α) => Raw₀ α β} {k : α} :
                      (node mp).get? k = mp.get? k
                      theorem LeafTrie.Raw₀.get?_eq_some_iff {α : Type u_1} {β : Type u_2} [ha₁ : DecidableEq α] [ha₂ : Hashable α] {t t₁ : Raw₀ α β} {k : α} :
                      t.get? k = some t₁ ∃ (mp : Std.DHashMap.Raw α fun (x : α) => Raw₀ α β), node mp = t mp.get? k = some t₁
                      theorem LeafTrie.Raw₀.WF.of_mp_get? {α : Type u_1} {β : Type u_2} [ha₁ : DecidableEq α] [ha₂ : Hashable α] {t : Raw₀ α β} {mp₁ : Std.DHashMap.Raw α fun (x : α) => Raw₀ α β} {k : α} [wf : (Raw₀.node mp₁).WF] (h : mp₁.get? k = some t) :
                      t.WF
                      theorem LeafTrie.Raw₀.WF.of_get? {α : Type u_1} {β : Type u_2} [ha₁ : DecidableEq α] [ha₂ : Hashable α] {t t₁ : Raw₀ α β} {k : α} [wf : t.WF] (h : t.get? k = some t₁) :
                      t₁.WF
                      theorem LeafTrie.Raw₀.depth_node {α : Type u_1} {β : Type u_2} [ha₁ : DecidableEq α] [ha₂ : Hashable α] {mp : Std.DHashMap.Raw α fun (x : α) => Raw₀ α β} [wf : (node mp).WF] :
                      (node mp).depth = 1 + mp.foldWith (fun (acc : ) (x : α) (t : Raw₀ α β) (h : mp.get? x = some t) => max acc t.depth) 0
                      @[simp]
                      theorem LeafTrie.Raw₀.depth_empty {α : Type u_1} {β : Type u_2} [ha₁ : DecidableEq α] [ha₂ : Hashable α] :
                      theorem LeafTrie.Raw₀.depth_lt_of_mp_get? {α : Type u_1} {β : Type u_2} [ha₁ : DecidableEq α] [ha₂ : Hashable α] {t : Raw₀ α β} {mp₁ : Std.DHashMap.Raw α fun (x : α) => Raw₀ α β} {k : α} [wf : (node mp₁).WF] (h : mp₁.get? k = some t) :
                      t.depth < (node mp₁).depth
                      theorem LeafTrie.Raw₀.depth_lt_of_get? {α : Type u_1} {β : Type u_2} [ha₁ : DecidableEq α] [ha₂ : Hashable α] {t t₁ : Raw₀ α β} {k : α} [wf : t.WF] (h : t.get? k = some t₁) :
                      t₁.depth < t.depth
                      theorem LeafTrie.Raw₀.WF.of_mem_toList {α : Type u_1} {β : Type u_2} [ha₁ : DecidableEq α] [ha₂ : Hashable α] {mp : Std.DHashMap.Raw α fun (x : α) => Raw₀ α β} {p : (_ : α) × Raw₀ α β} [wf : (Raw₀.node mp).WF] (h : p mp.toList) :
                      theorem LeafTrie.Raw₀.wf_iff {α : Type u_1} {β : Type u_2} [ha₁ : DecidableEq α] [ha₂ : Hashable α] {t : Raw₀ α β} :
                      t.WF (∃ (x : β), leaf x = t) ∃ (mp : Std.DHashMap.Raw α fun (x : α) => Raw₀ α β), node mp = t mp.WF ∀ (k : α) (t₁ : Raw₀ α β), mp.get? k = some t₁t₁.WF
                      theorem LeafTrie.Raw₀.wf_node_iff {α : Type u_1} {β : Type u_2} [ha₁ : DecidableEq α] [ha₂ : Hashable α] {mp : Std.DHashMap.Raw α fun (x : α) => Raw₀ α β} :
                      (node mp).WF mp.WF ∀ (k : α) (t₁ : Raw₀ α β), mp.get? k = some t₁t₁.WF
                      theorem LeafTrie.Raw₀.depthAux_node {α : Type u_1} {β : Type u_2} [ha₁ : DecidableEq α] [ha₂ : Hashable α] {mp : Std.DHashMap.Raw α fun (x : α) => Raw₀ α β} :
                      (node mp).depthAux = 1 + List.foldl (fun (acc : ) (x : (_ : α) × Raw₀ α β) => max acc x.snd.depthAux) 0 mp.toList
                      theorem LeafTrie.Raw₀.depthAux_node' {α : Type u_1} {β : Type u_2} [ha₁ : DecidableEq α] [ha₂ : Hashable α] {mp : Std.DHashMap.Raw α fun (x : α) => Raw₀ α β} (wf : (node mp).WF) :
                      (node mp).depthAux = 1 + mp.foldWith (fun (acc : ) (x : α) (t : Raw₀ α β) (x_1 : mp.get? x = some t) => max acc t.depthAux) 0
                      theorem LeafTrie.Raw₀.depthAux_eq_depth {α : Type u_1} {β : Type u_2} [ha₁ : DecidableEq α] [ha₂ : Hashable α] {t : Raw₀ α β} [wf : t.WF] :