Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions ExtTreeMapLemmas/ExtTreeMap.lean
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ import Mathlib.Tactic

namespace Std.ExtTreeMap

variable {α β : Type}
universe u v

variable {α : Type u} {β : Type v}

attribute [local instance low] beqOfOrd
attribute [grind ext] ExtTreeMap.ext_getElem?
attribute [grind] ExtTreeMap.distinct_keys_toList ExtTreeMap.getElem?_ofList_of_mem
attribute [grind .] ExtTreeMap.distinct_keys_toList ExtTreeMap.getElem?_ofList_of_mem

@[grind =]
theorem getElem?_pfilter
Expand All @@ -21,7 +23,7 @@ theorem getElem?_pfilter
-- Apply the hypothesis `h_filter_eq` directly to conclude the proof.
apply Std.ExtDTreeMap.get?_filter_with_getKey_pfilter

variable {α β : Type} {cmp : α → α → Ordering}
variable {α : Type u} {β : Type v} {cmp : α → α → Ordering}
variable {k : α} {m m₁ m₂ : Std.ExtTreeMap α β cmp} {f : α → β → β → β}

@[simp, grind =]
Expand Down Expand Up @@ -111,7 +113,7 @@ lemma toList_ofList [BEq α] [LawfulBEq α] : ofList (toList m) cmp = m := by
grind

@[simp, grind =]
lemma getElem?_filter_with_getKey {β : Type} {f : α → β → Bool} {k : α} {m : ExtTreeMap α β cmp} :
lemma getElem?_filter_with_getKey {f : α → β → Bool} {k : α} {m : ExtTreeMap α β cmp} :
(m.filter f)[k]? = m[k]?.filter (f k) := by
simp

Expand Down
Loading