Compare commits

...

1 Commits

Author SHA1 Message Date
Kim Morrison
e1850cf55f chore: add @[simp] to HashMap.get_getKey? 2025-04-28 10:50:04 +02:00
6 changed files with 6 additions and 0 deletions

View File

@@ -762,6 +762,7 @@ theorem getKey_eq_get_getKey? [EquivBEq α] [LawfulHashable α] {a : α} {h} :
m.getKey a h = (m.getKey? a).get (mem_iff_isSome_getKey?.mp h) := by
simp only [getKey?_eq_some_getKey h, Option.get_some]
@[simp]
theorem get_getKey? [EquivBEq α] [LawfulHashable α] {a : α} {h} :
(m.getKey? a).get h = m.getKey a (mem_iff_isSome_getKey?.mpr h) :=
getKey_eq_get_getKey?.symm

View File

@@ -826,6 +826,7 @@ theorem getKey_eq_get_getKey? [EquivBEq α] [LawfulHashable α] (h : m.WF) {a :
m.getKey a h' = (m.getKey? a).get ((mem_iff_isSome_getKey? h).mp h') := by
simp only [getKey?_eq_some_getKey h h', Option.get_some]
@[simp]
theorem get_getKey? [EquivBEq α] [LawfulHashable α] (h : m.WF) {a : α} {h'} :
(m.getKey? a).get h' = m.getKey a ((mem_iff_isSome_getKey? h).mpr h') :=
(getKey_eq_get_getKey? h).symm

View File

@@ -633,6 +633,7 @@ theorem getKey_eq_get_getKey? [EquivBEq α] [LawfulHashable α] {a : α} {h} :
m.getKey a h = (m.getKey? a).get (mem_iff_isSome_getKey?.mp h) :=
m.inductionOn (fun _ _ => DHashMap.getKey_eq_get_getKey?) h
@[simp]
theorem get_getKey? [EquivBEq α] [LawfulHashable α] {a : α} {h} :
(m.getKey? a).get h = m.getKey a (mem_iff_isSome_getKey?.mpr h) :=
m.inductionOn (fun _ _ => DHashMap.get_getKey?) h

View File

@@ -441,6 +441,7 @@ theorem getKey_eq_get_getKey? [EquivBEq α] [LawfulHashable α] {a : α} {h} :
m.getKey a h = (m.getKey? a).get (mem_iff_isSome_getKey?.mp h) :=
ExtDHashMap.getKey_eq_get_getKey?
@[simp]
theorem get_getKey? [EquivBEq α] [LawfulHashable α] {a : α} {h} :
(m.getKey? a).get h = m.getKey a (mem_iff_isSome_getKey?.mpr h) :=
ExtDHashMap.get_getKey?

View File

@@ -529,6 +529,7 @@ theorem getKey_eq_get_getKey? [EquivBEq α] [LawfulHashable α] {a : α} {h} :
m.getKey a h = (m.getKey? a).get (mem_iff_isSome_getKey?.mp h) :=
DHashMap.getKey_eq_get_getKey?
@[simp]
theorem get_getKey? [EquivBEq α] [LawfulHashable α] {a : α} {h} :
(m.getKey? a).get h = m.getKey a (mem_iff_isSome_getKey?.mpr h) :=
DHashMap.get_getKey?

View File

@@ -551,6 +551,7 @@ theorem getKey_eq_get_getKey? [EquivBEq α] [LawfulHashable α] (h : m.WF) {a :
m.getKey a h' = (m.getKey? a).get ((mem_iff_isSome_getKey? h).mp h') :=
DHashMap.Raw.getKey_eq_get_getKey? h.out
@[simp]
theorem get_getKey? [EquivBEq α] [LawfulHashable α] (h : m.WF) {a : α} {h'} :
(m.getKey? a).get h' = m.getKey a ((mem_iff_isSome_getKey? h).mpr h') :=
DHashMap.Raw.get_getKey? h.out