@[simp]
instance
Trie.Raw.instWFInner
{α : Type u_1}
{β : Type u_2}
[ha₁ : DecidableEq α]
[ha₂ : Hashable α]
{t : Raw α β}
:
def
Trie.Raw.mp
{α : Type u_1}
{β : Type u_2}
[ha₁ : DecidableEq α]
[ha₂ : Hashable α]
(t : Raw α β)
:
Std.DHashMap.Raw α fun (x : α) => Raw₀ α β
Instances For
@[irreducible]
def
Trie.Raw.rec'
{α : Type u_1}
{β : Type u_2}
[ha₁ : DecidableEq α]
[ha₂ : Hashable α]
{γ : Raw α β → Sort u_3}
(motive :
(val : Option β) →
(mp : Std.DHashMap.Raw α fun (x : α) => Raw₀ α β) →
(wf : (Raw₀.mk val mp).WF) →
((i : α) → (t : Raw α β) → mp.get? i = some t.inner → γ t) → γ { inner := Raw₀.mk val mp, wf := wf })
(t : Raw α β)
:
γ t
Equations
- Trie.Raw.rec' motive { inner := Trie.Raw₀.mk val mp, wf := wf } = motive val mp wf fun (i : α) (t : Trie.Raw α β) (h₁ : mp.get? i = some t.inner) => Trie.Raw.rec' motive { inner := t.inner, wf := ⋯ }
Instances For
@[reducible, inline]
abbrev
Trie.Raw.ind
{α : Type u_3}
{β : Type u_4}
[ha₁ : DecidableEq α]
[ha₂ : Hashable α]
{γ : Raw α β → Sort u_5}
(motive :
(val : Option β) →
(mp : Std.DHashMap.Raw α fun (x : α) => Raw₀ α β) →
(wf : (Raw₀.mk val mp).WF) →
((i : α) → (t : Raw α β) → mp.get? i = some t.inner → γ t) → γ { inner := Raw₀.mk val mp, wf := wf })
(t : Raw α β)
:
γ t
Equations
Instances For
@[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 : (Raw₀.mk val mp).WF}
{motive :
(val : Option β) →
(mp : Std.DHashMap.Raw α fun (x : α) => Raw₀ α β) →
(wf : (Raw₀.mk val mp).WF) →
((i : α) → (t : Raw α β) → mp.get? i = some t.inner → γ t) → γ { inner := Raw₀.mk val mp, wf := wf }}
:
Equations
- Trie.Raw.empty = { inner := ∅, wf := ⋯ }
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 }
@[simp]
theorem
Trie.Raw.inner_empty
{α : Type u_1}
{β : Type u_2}
[ha₁ : DecidableEq α]
[ha₂ : Hashable α]
:
def
Trie.Raw.depth
{α : Type u_1}
{β : Type u_2}
[ha₁ : DecidableEq α]
[ha₂ : Hashable α]
(t : Raw α β)
:
Equations
- t.depth = Trie.Raw.rec' (fun (x : Option β) (mp : Std.DHashMap.Raw α fun (x : α) => Trie.Raw₀ α β) (wf : (Trie.Raw₀.mk x mp).WF) (f : (i : α) → (t : Trie.Raw α β) → mp.get? i = some t.inner → ℕ) => (fun (x_1 : ℕ → (i : α) → (x : Trie.Raw₀ α β) → mp.get? i = some x → ℕ) => mp.foldWith ⋯ x_1 0) fun (acc : ℕ) (i : α) (x_1 : Trie.Raw₀ α β) (h₂ : mp.get? i = some x_1) => max acc (1 + f i { inner := x_1, wf := ⋯ } h₂)) t
Instances For
@[simp]
theorem
Trie.Raw.depth_empty
{α : Type u_1}
{β : Type u_2}
[ha₁ : DecidableEq α]
[ha₂ : Hashable α]
:
@[simp]
theorem
Trie.Raw.WF.mp
{α : Type u_1}
{β : Type u_2}
[ha₁ : DecidableEq α]
[ha₂ : Hashable α]
{t : Raw α β}
:
theorem
Trie.Raw.get?_mp
{α : Type u_1}
{β : Type u_2}
[ha₁ : DecidableEq α]
[ha₂ : Hashable α]
{t : Raw α β}
{k : α}
:
@[instance_reducible]
instance
Trie.Raw.instDecidableIsEmpty
{α : Type u_1}
{β : Type u_2}
[ha₁ : DecidableEq α]
[ha₂ : Hashable α]
{t : Raw α β}
: