diff options
author | Jason Gross <jgross@mit.edu> | 2017-06-02 00:01:35 -0400 |
---|---|---|
committer | Jason Gross <jasongross9@gmail.com> | 2017-06-05 18:47:35 -0400 |
commit | 7488682db4cf259e0bb0c886e13301c32a2eeaa2 (patch) | |
tree | 9baf80699c9f00b01d3180504d58351b6ecc0f33 /src/Util/Decidable.v | |
parent | c4a0d1fdde22dbd2faaa1753e973ee9602076ee8 (diff) |
Don't rely on autogenerated names
This fixes all of the private-names warnings emitted by
compiling fiat-crypto with https://github.com/coq/coq/pull/268 (minus
the ones in coqprime, which I didn't touch).
Diffstat (limited to 'src/Util/Decidable.v')
-rw-r--r-- | src/Util/Decidable.v | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/Util/Decidable.v b/src/Util/Decidable.v index cc144f062..e5f9cf0bd 100644 --- a/src/Util/Decidable.v +++ b/src/Util/Decidable.v @@ -16,8 +16,8 @@ Notation DecidableRel R := (forall x y, Decidable (R x y)). Global Instance hprop_eq_dec {A} `{DecidableRel (@eq A)} : IsHPropRel (@eq A) | 10. Proof. repeat intro; apply UIP_dec; trivial with nocore. Qed. -Global Instance eq_dec_hprop {A} {x y : A} `{hp : IsHProp A} : Decidable (@eq A x y) | 5. -Proof. left; apply hp. Qed. +Global Instance eq_dec_hprop {A} {x y : A} {hp : IsHProp A} : Decidable (@eq A x y) | 5. +Proof. left; auto. Qed. Ltac no_equalities_about x0 y0 := lazymatch goal with @@ -111,15 +111,16 @@ Global Instance dec_ge_Z : DecidableRel BinInt.Z.ge := ZArith_dec.Z_ge_dec. Global Instance dec_match_pair {A B} {P : A -> B -> Prop} {x : A * B} {HD : Decidable (P (fst x) (snd x))} : Decidable (let '(a, b) := x in P a b) | 1. -Proof. destruct x; assumption. Defined. +Proof. edestruct (_ : _ * _); assumption. Defined. Lemma not_not P {d:Decidable P} : not (not P) <-> P. Proof. destruct (dec P); intuition. Qed. -Global Instance dec_ex_forall_not T (P:T->Prop) {d:Decidable (exists b, P b)} : Decidable (forall b, ~ P b). +Global Instance dec_ex_forall_not : forall T (P:T->Prop) {d:Decidable (exists b, P b)}, Decidable (forall b, ~ P b). Proof. + intros T P d. destruct (dec (~ exists b, P b)) as [Hd|Hd]; [left|right]; - [abstract eauto | abstract (rewrite not_not in Hd by eauto; destruct Hd; eauto) ]. + [abstract eauto | let Hd := Hd in abstract (rewrite not_not in Hd by eauto; destruct Hd; eauto) ]. Defined. Lemma eqsig_eq {T} {U} {Udec:DecidableRel (@eq U)} (f g:T->U) (x x':T) pf pf' : |