| 1 |
From Coq Require Import Morphisms. |
| 2 |
From Coq Require Import Equalities. |
| 3 |
Require Export Crypto.Util.FixCoqMistakes. |
| 4 |
|
| 5 |
Module Type UsualEqualityTypeOrig <: EqualityTypeOrig |
| 6 |
:= UsualEq <+ UsualIsEqOrig. |
| 7 |
Module Type UsualEqualityTypeBoth <: EqualityTypeBoth |
| 8 |
:= UsualEq <+ UsualIsEq <+ UsualIsEqOrig. |
| 9 |
|
| 10 |
Local Coercion is_true : bool >-> Sortclass. |
| 11 |
Module Type IsEqb (Import E : Typ) (Import Eb:HasEqb E). |
| 12 |
#[global] |
| 13 |
Declare Instance eqb_equiv : Equivalence eqb. |
| 14 |
End IsEqb. |
| 15 |
|
| 16 |
Module IsEqbFacts (Import E : Typ) (Import Eb:HasEqb E) (Import E' : IsEqb E Eb). |
| 17 |
#[global] |
| 18 |
Instance eqb_Proper : Proper (eqb ==> eqb ==> eq) eqb | 10. |
| 19 |
Proof. |
| 20 |
intros x x' Hx y y' Hy; destruct (eqb x y) eqn:Hxy, (eqb x' y') eqn:Hxy'; try reflexivity; |
| 21 |
(rewrite <- Hxy + rewrite <- Hxy'); (idtac + symmetry); |
| 22 |
(change (is_true (eqb x' y')) + change (is_true (eqb x y))). |
| 23 |
all: etransitivity; (idtac + symmetry); (idtac + etransitivity); eassumption. |
| 24 |
Qed. |
| 25 |
End IsEqbFacts. |
| 26 |
|
| 27 |
Module Type EqbType := Typ <+ HasEqb <+ IsEqb. |
| 28 |
Module Type EqbType' := Typ <+ HasEqb <+ IsEqb <+ EqbNotation. |