Commit c0b7f46f authored by Robbert Krebbers's avatar Robbert Krebbers
Browse files

`big_sepM_insert_2` that does not require the element not to be in the map.

parent b16e3e3c
......@@ -568,6 +568,19 @@ Section gmap.
([ map] ky m, Φ k y) Φ i x [ map] ky delete i m, Φ k y.
Proof. apply big_opM_delete. Qed.
Lemma big_sepM_insert_2 Φ m i x :
TCOr ( x, Affine (Φ i x)) (Absorbing (Φ i x))
Φ i x - ([ map] ky m, Φ k y) - [ map] ky <[i:=x]> m, Φ k y.
intros Ha. apply wand_intro_r. destruct (m !! i) as [y|] eqn:Hi; last first.
{ by rewrite -big_sepM_insert. }
assert (TCOr (Affine (Φ i y)) (Absorbing (Φ i x))).
{ destruct Ha; try apply _. }
rewrite big_sepM_delete // assoc.
rewrite (sep_elim_l (Φ i x)) -big_sepM_insert ?lookup_delete //.
by rewrite insert_delete.
Lemma big_sepM_lookup_acc Φ m i x :
m !! i = Some x
([ map] ky m, Φ k y) Φ i x (Φ i x - ([ map] ky m, Φ k y)).
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment