diff --git a/theories/prelude/decidable.v b/theories/prelude/decidable.v index 9c7ec3ab4693d8d60958fa883ccec354c67eab19..ec5e19c4b717f5e05ddddf55bea4d30a86e246f5 100644 --- a/theories/prelude/decidable.v +++ b/theories/prelude/decidable.v @@ -36,6 +36,11 @@ Lemma decide_iff {A} P Q `{Decision P, Decision Q} (x y : A) : (P ↔ Q) → (if decide P then x else y) = (if decide Q then x else y). Proof. intros [??]. destruct (decide P), (decide Q); tauto. Qed. +Lemma decide_left`{Decision P, !ProofIrrel P} (HP : P) : decide P = left HP. +Proof. destruct (decide P) as [?|?]; [|contradiction]. f_equal. apply proof_irrel. Qed. +Lemma decide_right`{Decision P} `{!ProofIrrel (¬ P)} (HP : ¬ P) : decide P = right HP. +Proof. destruct (decide P) as [?|?]; [contradiction|]. f_equal. apply proof_irrel. Qed. + (** The tactic [destruct_decide] destructs a sumbool [dec]. If one of the components is double negated, it will try to remove the double negation. *) Tactic Notation "destruct_decide" constr(dec) "as" ident(H) :=