lean4-htt/tests/lean/run/hashmap-toList-simps.lean
Johannes Tantow 010c6c36f1
feat: verify toList for hash maps (#6954)
This PR verifies the `toList`function for hash maps and dependent hash
maps.
2025-02-18 13:10:03 +00:00

23 lines
579 B
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import Std.Data.DHashMap.Lemmas
import Std.Data.HashMap.Lemmas
section
variable [BEq α] [Hashable α] [EquivBEq α] [LawfulHashable α] {m : Std.HashMap α β} {k : α} {v : β}
#check_simp (k, v) ∈ m.toList ~> m.getKey? k = some k ∧ m[k]? = some v
end
section
variable [BEq α] [Hashable α] [LawfulBEq α] {m : Std.HashMap α β} {k : α} {v : β}
#check_simp (k, v) ∈ m.toList ~> m[k]? = some v
end
section
variable [BEq α] [Hashable α] [LawfulBEq α] {m : Std.DHashMap α β} {k : α} {v : β k}
#check_simp ⟨k, v⟩ ∈ m.toList ~> m.get? k = some v
end