Commit c53cefcd authored by Robbert Krebbers's avatar Robbert Krebbers

Simplify `gmap_uncurry_non_empty` as suggested by JH in !9.

parent 532a9ed0
Pipeline #4927 passed with stages
in 5 minutes and 49 seconds
......@@ -190,11 +190,9 @@ Section curry_uncurry.
Lemma gmap_uncurry_non_empty (m : gmap (K1 * K2) A) i x :
gmap_uncurry m !! i = Some x x .
Proof.
intros Hm ->. revert m Hm.
apply (map_fold_ind (λ mr _, mr !! i = Some False)); [done|].
intros [i' j] x m mr ??. destruct (decide (i = i')) as [->|].
- rewrite lookup_partial_alter. intros [= []%insert_non_empty].
- by rewrite lookup_partial_alter_ne by done.
intros Hm ->. eapply eq_None_not_Some; [|by eexists].
eapply lookup_gmap_uncurry_None; intros j.
by rewrite <-lookup_gmap_uncurry, Hm.
Qed.
Lemma gmap_uncurry_curry_non_empty (m : gmap K1 (gmap K2 A)) :
......
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