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

Add lemma `bind_Some_equiv`.

parent 7bf7c7fa
No related branches found
No related tags found
No related merge requests found
......@@ -225,6 +225,9 @@ Proof. intros. by apply option_bind_ext. Qed.
Lemma bind_Some {A B} (f : A option B) (mx : option A) y :
mx ≫= f = Some y x, mx = Some x f x = Some y.
Proof. destruct mx; naive_solver. Qed.
Lemma bind_Some_equiv {A} `{Equiv B} (f : A option B) (mx : option A) y :
mx ≫= f Some y x, mx = Some x f x Some y.
Proof. destruct mx; (split; [inversion 1|]); naive_solver. Qed.
Lemma bind_None {A B} (f : A option B) (mx : option A) :
mx ≫= f = None mx = None x, mx = Some x f x = None.
Proof. destruct mx; naive_solver. Qed.
......
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