Commit 8e97f83a authored by Robbert Krebbers's avatar Robbert Krebbers

Lemmas for `##`/`∪` and `filter` on finite maps.

parent c579b46c
......@@ -1507,6 +1507,12 @@ Proof.
Qed.
Lemma map_disjoint_delete_r {A} (m1 m2 : M A) i : m1 ## m2 m1 ## delete i m2.
Proof. symmetry. by apply map_disjoint_delete_l. Qed.
Lemma map_disjoint_filter {A} (P : K * A Prop) `{! x, Decision (P x)} (m : M A) :
filter P m ## filter (λ v, ¬ P v) m.
Proof.
apply map_disjoint_spec. intros i x y.
rewrite !map_filter_lookup_Some. naive_solver.
Qed.
(** ** Properties of the [union_with] operation *)
Section union_with.
......@@ -1783,6 +1789,13 @@ Proof.
naive_solver eauto using map_Forall_union_11,
map_Forall_union_12, map_Forall_union_2.
Qed.
Lemma map_union_filter {A} (P : K * A Prop) `{! x, Decision (P x)} (m : M A) :
filter P m filter (λ v, ¬ P v) m = m.
Proof.
apply map_eq; intros i. apply option_eq; intros x.
rewrite lookup_union_Some, !map_filter_lookup_Some by apply map_disjoint_filter.
destruct (decide (P (i,x))); naive_solver.
Qed.
(** ** Properties of the [union_list] operation *)
Lemma map_disjoint_union_list_l {A} (ms : list (M A)) (m : M 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