Clean up `empty{',_inv,_iff}` lemmas.
Write them all using ↔
and consistently use the _iff
suffix.
Also:
- Make
map_empty
a biimplication - Add lemma
map_filter_empty_iff
Merge request reports
Activity
70 70 Proof. 71 71 intros x. rewrite elem_of_dom, lookup_empty, <-not_eq_None_Some. set_solver. 72 72 Qed. 73 Lemma dom_empty_inv {A} (m : M A) : dom D m ≡ ∅ → m = ∅. 73 Lemma dom_empty_iff {A} (m : M A) : dom D m ≡ ∅ ↔ m = ∅. Sometimes biimplications work less well than one-directional ones, in particular with typeclasses such as
dom
orempty
... might be good to also still have a one-directional version?Edited by Ralf Jung@tchajed reports that this is quite painful in Perennial because rewriting with these lemmas no longer works.
I agree with @tchajed. If either one of you want to add the
_inv
lemmas, though, please make an MR :)The rewrites in Perennial were already specifying the map involved in many cases (since the goal had more than one map), so they weren't any less verbose, while the assertion says exactly what's going on. It's also more general because the map is substituted everywhere rather than just the goal.
We also had an anti-pattern of using
replace
, which requires annotating the \empty with the right type and produces a goal\empty = m
whichdom_empty_iff_L
doesn't apply to. Usingassert
instead solves both problems.
added 13 commits
-
82362145...cbd68767 - 9 commits from branch
master
- 1b3a09b4 - Make `map_empty` a biimplication.
- ead373e4 - Clean up `empty_{inv,iff}` lemmas.
- 953658b1 - Add lemma `map_filter_empty_iff`.
- 255e2a6e - CHANGELOG.
Toggle commit list-
82362145...cbd68767 - 9 commits from branch
mentioned in merge request !245 (merged)
- Resolved by Robbert Krebbers
- Resolved by Robbert Krebbers
- Resolved by Robbert Krebbers
I tested it now, turns out I fucked up escaping
'
... My current solution is ugly, but it seems to work.