Skip to content
Snippets Groups Projects
Commit afdc8633 authored by Robbert Krebbers's avatar Robbert Krebbers
Browse files

`Proper`s for `union`, `union_with`, `intersection_with`, `difference_with` on `option`.

parent 65a379f3
No related branches found
No related tags found
1 merge request!281Various setoids lemmas for maps, lists, and option
......@@ -321,6 +321,19 @@ Section union_intersection_difference.
Proof. by intros ? [?|] [?|]; compute; rewrite 1?(comm f). Qed.
Global Instance difference_with_right_id : RightId (=) None (difference_with f).
Proof. by intros [?|]. Qed.
Global Instance union_with_proper `{Equiv A} :
Proper ((() ==> () ==> ()) ==> (≡@{option A}) ==> () ==> ()) union_with.
Proof. intros ?? Hf; do 2 destruct 1; try constructor; by try apply Hf. Qed.
Global Instance intersection_with_proper `{Equiv A} :
Proper ((() ==> () ==> ()) ==> (≡@{option A}) ==> () ==> ()) intersection_with.
Proof. intros ?? Hf; do 2 destruct 1; try constructor; by try apply Hf. Qed.
Global Instance difference_with_proper `{Equiv A} :
Proper ((() ==> () ==> ()) ==> (≡@{option A}) ==> () ==> ()) difference_with.
Proof. intros ?? Hf; do 2 destruct 1; try constructor; by try apply Hf. Qed.
Global Instance union_proper `{Equiv A} :
Proper ((≡@{option A}) ==> () ==> ()) union.
Proof. apply union_with_proper. by constructor. Qed.
End union_intersection_difference.
(** * Tactics *)
......
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