- mk {α : Type u_1} {β : Type u_2} [DecidableEq α] [Hashable α] : Option β → (mp : Std.DHashMap.Raw α fun (x : α) => Raw₀ α β) → Raw₀ α β
Instances For
Equations
- (Trie.Raw₀.mk val mp).val = val
Instances For
def
Trie.Raw₀.mp
{α : Type u_1}
{β : Type u_2}
[ha₁ : DecidableEq α]
[ha₂ : Hashable α]
:
Raw₀ α β → Std.DHashMap.Raw α fun (x : α) => Raw₀ α β
Equations
- (Trie.Raw₀.mk val mp).mp = mp
Instances For
@[simp]
theorem
Trie.Raw₀.val_mk
{α : Type u_1}
{β : Type u_2}
[ha₁ : DecidableEq α]
[ha₂ : Hashable α]
{val : Option β}
{mp : Std.DHashMap.Raw α fun (x : α) => Raw₀ α β}
:
@[simp]
theorem
Trie.Raw₀.mp_mk
{α : Type u_1}
{β : Type u_2}
[ha₁ : DecidableEq α]
[ha₂ : Hashable α]
{val : Option β}
{mp : Std.DHashMap.Raw α fun (x : α) => Raw₀ α β}
:
class inductive
Trie.Raw₀.WF
{α : Type u_1}
{β : Type u_2}
[ha₁ : DecidableEq α]
[ha₂ : Hashable α]
:
- mk {α : Type u_1} {β : Type u_2} [ha₁ : DecidableEq α] [ha₂ : Hashable α] {val : Option β} {mp : Std.DHashMap.Raw α fun (x : α) => Raw₀ α β} : mp.WF → (∀ {k : α} {t : Raw₀ α β}, mp.get? k = some t → ¬t.isEmpty) → (∀ {k : α} {t : Raw₀ α β}, mp.get? k = some t → t.WF) → (Raw₀.mk val mp).WF
Instances
@[simp]
theorem
Trie.Raw₀.WF.mp
{α : Type u_1}
{β : Type u_2}
[ha₁ : DecidableEq α]
[ha₂ : Hashable α]
{t : Raw₀ α β}
[wf : t.WF]
:
theorem
Trie.Raw₀.rec_2_eq
{α : Type u_1}
{β : Type u_2}
[ha₁ : DecidableEq α]
[ha₂ : Hashable α]
{arr : Array (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 : Option β) → (mp : Std.DHashMap.Raw α fun (x : α) => Raw₀ α β) → M₂ mp → M₁ (mk a mp)}
{H₂ :
(size : ℕ) →
(buckets : Array (Std.DHashMap.Internal.AssocList α fun (x : α) => Raw₀ α β)) →
M₃ buckets → M₂ { size := size, buckets := buckets }}
{H₃ : (toList : List (Std.DHashMap.Internal.AssocList α fun (x : α) => Raw₀ α β)) → M₄ toList → M₃ { toList := toList }}
{H₄ : M₄ []}
{H₅ :
(head : Std.DHashMap.Internal.AssocList α fun (x : α) => Raw₀ α β) →
(tail : List (Std.DHashMap.Internal.AssocList α fun (x : α) => Raw₀ α β)) → M₅ head → M₄ tail → M₄ (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₁ value → M₅ tail → M₅ (Std.DHashMap.Internal.AssocList.cons key value tail)}
:
theorem
Trie.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 : Option β) → (mp : Std.DHashMap.Raw α fun (x : α) => Raw₀ α β) → M₂ mp → M₁ (mk a mp)}
{H₂ :
(size : ℕ) →
(buckets : Array (Std.DHashMap.Internal.AssocList α fun (x : α) => Raw₀ α β)) →
M₃ buckets → M₂ { size := size, buckets := buckets }}
{H₃ : (toList : List (Std.DHashMap.Internal.AssocList α fun (x : α) => Raw₀ α β)) → M₄ toList → M₃ { toList := toList }}
{H₄ : M₄ []}
{H₅ :
(head : Std.DHashMap.Internal.AssocList α fun (x : α) => Raw₀ α β) →
(tail : List (Std.DHashMap.Internal.AssocList α fun (x : α) => Raw₀ α β)) → M₅ head → M₄ tail → M₄ (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₁ value → M₅ tail → M₅ (Std.DHashMap.Internal.AssocList.cons key value tail)}
:
rec_3 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₇ x) acc)
xs
theorem
Trie.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 : Option β) → (mp : Std.DHashMap.Raw α fun (x : α) => Raw₀ α β) → M₂ mp → M₁ (mk a mp)}
{H₂ :
(size : ℕ) →
(buckets : Array (Std.DHashMap.Internal.AssocList α fun (x : α) => Raw₀ α β)) →
M₃ buckets → M₂ { size := size, buckets := buckets }}
{H₃ : (toList : List (Std.DHashMap.Internal.AssocList α fun (x : α) => Raw₀ α β)) → M₄ toList → M₃ { toList := toList }}
{H₄ : M₄ []}
{H₅ :
(head : Std.DHashMap.Internal.AssocList α fun (x : α) => Raw₀ α β) →
(tail : List (Std.DHashMap.Internal.AssocList α fun (x : α) => Raw₀ α β)) → M₅ → M₄ tail → M₄ (head :: tail)}
{H₆ : M₅}
{H₇ :
(key : α) →
(value : (fun (x : α) => Raw₀ α β) key) →
(Std.DHashMap.Internal.AssocList α fun (x : α) => Raw₀ α β) → M₁ value → M₅ → M₅}
:
noncomputable def
Trie.Raw₀.depthAux
{α : Type u_1}
{β : Type u_2}
[ha₁ : DecidableEq α]
[ha₂ : Hashable α]
(t : Raw₀ α β)
:
Equations
- t.depthAux = (fun (motive_1 : Trie.Raw₀ α β → Type) (motive_2 : (Std.DHashMap.Raw α fun (x : α) => Trie.Raw₀ α β) → Type) (motive_3 : Array (Std.DHashMap.Internal.AssocList α fun (x : α) => Trie.Raw₀ α β) → Type) (motive_4 : List (Std.DHashMap.Internal.AssocList α fun (x : α) => Trie.Raw₀ α β) → Type) (motive_5 : (Std.DHashMap.Internal.AssocList α fun (x : α) => Trie.Raw₀ α β) → Type) => t.recOn) (fun (x : Trie.Raw₀ α β) => ℕ) (fun (x : Std.DHashMap.Raw α fun (x : α) => Trie.Raw₀ α β) => ℕ) (fun (x : Array (Std.DHashMap.Internal.AssocList α fun (x : α) => Trie.Raw₀ α β)) => ℕ) (fun (x : List (Std.DHashMap.Internal.AssocList α fun (x : α) => Trie.Raw₀ α β)) => ℕ) (fun (x : Std.DHashMap.Internal.AssocList α fun (x : α) => Trie.Raw₀ α β) => ℕ) (fun (x : Option β) (x_1 : Std.DHashMap.Raw α fun (x : α) => Trie.Raw₀ α β) (n : ℕ) => n) (fun (x : ℕ) (x_1 : Array (Std.DHashMap.Internal.AssocList α fun (x : α) => Trie.Raw₀ α β)) (n : ℕ) => n) (fun (x : List (Std.DHashMap.Internal.AssocList α fun (x : α) => Trie.Raw₀ α β)) (n : ℕ) => n) 0 (fun (x : Std.DHashMap.Internal.AssocList α fun (x : α) => Trie.Raw₀ α β) (x_1 : List (Std.DHashMap.Internal.AssocList α fun (x : α) => Trie.Raw₀ α β)) (n m : ℕ) => max n m) 0 fun (x : α) (x_1 : Trie.Raw₀ α β) (x_2 : Std.DHashMap.Internal.AssocList α fun (x : α) => Trie.Raw₀ α β) (n m : ℕ) => max (n + 1) m
Instances For
@[irreducible]
def
Trie.Raw₀.recAux
{α : Type u_1}
{β : Type u_2}
[ha₁ : DecidableEq α]
[ha₂ : Hashable α]
{γ : Raw₀ α β → Sort u_3}
(t : Raw₀ α β)
(wf : t.WF)
(motive :
(val : Option β) →
(mp : Std.DHashMap.Raw α fun (x : α) => Raw₀ α β) →
mp.WF → ((i : α) → (t : Raw₀ α β) → mp.get? i = some t → γ t) → γ (mk val mp))
:
γ t
Equations
Instances For
def
Trie.Raw₀.rec'
{α : Type u_1}
{β : Type u_2}
[ha₁ : DecidableEq α]
[ha₂ : Hashable α]
{γ : Raw₀ α β → Sort u_3}
(t : Raw₀ α β)
[wf : t.WF]
(motive :
(val : Option β) →
(mp : Std.DHashMap.Raw α fun (x : α) => Raw₀ α β) →
mp.WF → ((i : α) → (t : Raw₀ α β) → mp.get? i = some t → γ t) → γ (mk val mp))
:
γ t
Instances For
def
Trie.Raw₀.depth
{α : Type u_1}
{β : Type u_2}
[ha₁ : DecidableEq α]
[ha₂ : Hashable α]
(t : Raw₀ α β)
[wf : t.WF]
:
Equations
- t.depth = t.rec' fun (x : Option β) (mp : Std.DHashMap.Raw α fun (x : α) => Trie.Raw₀ α β) (h₁ : mp.WF) (f : (i : α) → (t : Trie.Raw₀ α β) → mp.get? i = some t → ℕ) => (fun (x : ℕ → (i : α) → (x : Trie.Raw₀ α β) → mp.get? i = some x → ℕ) => mp.foldWith h₁ x 0) fun (acc : ℕ) (i : α) (x : Trie.Raw₀ α β) (h₂ : mp.get? i = some x) => max acc (1 + f i x h₂)
Instances For
def
Trie.Raw₀.empty
{α : Type u_1}
{β : Type u_2}
[ha₁ : DecidableEq α]
[ha₂ : Hashable α]
:
Raw₀ α β
Equations
Instances For
@[instance_reducible]
instance
Trie.Raw₀.instEmptyCollection
{α : Type u_1}
{β : Type u_2}
[ha₁ : DecidableEq α]
[ha₂ : Hashable α]
:
EmptyCollection (Raw₀ α β)
Equations
- Trie.Raw₀.instEmptyCollection = { emptyCollection := Trie.Raw₀.empty }
instance
Trie.Raw₀.instWFEmptyCollection
{α : Type u_1}
{β : Type u_2}
[ha₁ : DecidableEq α]
[ha₂ : Hashable α]
:
@[simp]
theorem
Trie.Raw₀.rec'_mk
{α : Type u_1}
{β : Type u_2}
[ha₁ : DecidableEq α]
[ha₂ : Hashable α]
{γ : Raw₀ α β → Sort u_3}
{val : Option β}
{mp : Std.DHashMap.Raw α fun (x : α) => Raw₀ α β}
[wf : (mk val mp).WF]
{motive :
(val : Option β) →
(mp : Std.DHashMap.Raw α fun (x : α) => Raw₀ α β) →
mp.WF → ((i : α) → (t : Raw₀ α β) → mp.get? i = some t → γ t) → γ (mk val mp)}
:
@[simp]
theorem
Trie.Raw₀.depth_mk
{α : Type u_1}
{β : Type u_2}
[ha₁ : DecidableEq α]
[ha₂ : Hashable α]
{val : Option β}
{mp : Std.DHashMap.Raw α fun (x : α) => Raw₀ α β}
[wf : (mk val mp).WF]
:
@[simp]
theorem
Trie.Raw₀.depth_empty
{α : Type u_1}
{β : Type u_2}
[ha₁ : DecidableEq α]
[ha₂ : Hashable α]
:
def
Trie.Raw₀.setVal
{α : Type u_1}
{β : Type u_2}
[ha₁ : DecidableEq α]
[ha₂ : Hashable α]
(t : Raw₀ α β)
(val : Option β)
:
Raw₀ α β
Equations
- t.setVal val = Trie.Raw₀.mk val t.mp
Instances For
@[simp]
theorem
Trie.Raw₀.setVal_mk
{α : Type u_1}
{β : Type u_2}
[ha₁ : DecidableEq α]
[ha₂ : Hashable α]
{val val₁ : Option β}
{mp : Std.DHashMap.Raw α fun (x : α) => Raw₀ α β}
:
def
Trie.Raw₀.erase1
{α : Type u_1}
{β : Type u_2}
[ha₁ : DecidableEq α]
[ha₂ : Hashable α]
(t : Raw₀ α β)
(i : α)
:
Raw₀ α β
Instances For
@[simp]
theorem
Trie.Raw₀.erase1_mk
{α : Type u_1}
{β : Type u_2}
[ha₁ : DecidableEq α]
[ha₂ : Hashable α]
{val : Option β}
{mp : Std.DHashMap.Raw α fun (x : α) => Raw₀ α β}
{i : α}
:
@[simp]
instance
Trie.Raw₀.instWFErase1
{α : Type u_1}
{β : Type u_2}
[ha₁ : DecidableEq α]
[ha₂ : Hashable α]
{t : Raw₀ α β}
{i : α}
[wf : t.WF]
: