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

shorter proof by Robbert

parent 154b5120
No related branches found
No related tags found
No related merge requests found
...@@ -598,24 +598,11 @@ Qed. ...@@ -598,24 +598,11 @@ Qed.
Lemma big_opM_singletons m : Lemma big_opM_singletons m :
([^op map] k x m, {[ k := x ]}) = m. ([^op map] k x m, {[ k := x ]}) = m.
Proof. Proof.
rewrite big_opM_eq /big_opM_def. rewrite big_opM_eq /big_opM_def -{2}(list_to_map_to_list m).
remember (map_to_list m) as l eqn:Heql. assert (NoDup (map_to_list m).*1) as Hnodup by apply NoDup_fst_map_to_list.
assert (map_to_list m l) as Hl by by rewrite Heql. revert Hnodup. induction (map_to_list m) as [|[k x] l IH]; csimpl; first done.
clear Heql. revert m Hl. induction l as [|kx l IH]. intros [??]%NoDup_cons. rewrite IH //.
- intros m ->%map_to_list_empty_inv_alt. rewrite insert_singleton_op ?not_elem_of_list_to_map_1 //.
rewrite big_opL_nil. done.
- destruct kx as [k x].
intros m Hl.
rewrite big_opL_cons.
assert (NoDup ((k, x) :: l).*1) as Hnodup.
{ rewrite -Hl. apply NoDup_fst_map_to_list. }
rewrite (IH (list_to_map l)).
+ rewrite (map_to_list_insert_inv _ _ _ _ Hl).
rewrite insert_singleton_op //.
apply not_elem_of_list_to_map_1.
apply NoDup_cons_11 in Hnodup. done.
+ apply map_to_list_to_map.
eapply NoDup_cons_12. done.
Qed. Qed.
End properties. End properties.
......
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