Skip to content
Snippets Groups Projects
Commit d4665398 authored by Ralf Jung's avatar Ralf Jung
Browse files

add map_size_disj_union

parent 10ba5946
No related branches found
No related tags found
1 merge request!321add map_size_disj_union
Pipeline #51974 passed
......@@ -2294,6 +2294,20 @@ Proof.
destruct (m1 !! i), (m2 !! i); simpl; repeat (destruct (f _)); naive_solver.
Qed.
Lemma map_size_disj_union {A} (m1 m2 : M A) :
m1 ## m2 size (m1 m2) = size m1 + size m2.
Proof.
intros Hdisj. induction m1 as [|k x m1 Hm1 IH] using map_ind.
{ rewrite map_empty_union. (* FIXME: [rewrite left_id] leaves a goal *)
rewrite map_size_empty. done. }
rewrite <-insert_union_l.
rewrite map_size_insert.
rewrite lookup_union_r by done.
apply map_disjoint_insert_l in Hdisj as [-> Hdisj].
rewrite map_size_insert, Hm1.
rewrite IH by done. done.
Qed.
Lemma map_cross_split {A} (ma mb mc md : M A) :
ma ## mb mc ## md
ma mb = mc md
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment