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

Decider for empty listsets.

parent 52a3dc34
No related branches found
No related tags found
No related merge requests found
...@@ -24,6 +24,16 @@ Proof. ...@@ -24,6 +24,16 @@ Proof.
* by apply elem_of_list_singleton. * by apply elem_of_list_singleton.
* intros [?] [?]. apply elem_of_app. * intros [?] [?]. apply elem_of_app.
Qed. Qed.
Lemma listset_empty_alt X : X listset_car X = [].
Proof.
destruct X as [l]; split; [|by intros; simplify_equality'].
intros [Hl _]; destruct l as [|x l]; [done|]. feed inversion (Hl x); left.
Qed.
Global Instance listset_empty_dec (X : listset A) : Decision (X ).
Proof.
refine (cast_if (decide (listset_car X = [])));
abstract (by rewrite listset_empty_alt).
Defined.
Context `{ x y : A, Decision (x = y)}. Context `{ x y : A, Decision (x = y)}.
......
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