| 1 |
From Coq Require Import FMapPositive. |
| 2 |
Require Import Crypto.Util.Bool.Equality. |
| 3 |
Require Import Crypto.Util.Decidable. |
| 4 |
|
| 5 |
Module PositiveMap. |
| 6 |
Scheme Induction for PositiveMap.tree Sort Type. |
| 7 |
Scheme Induction for PositiveMap.tree Sort Set. |
| 8 |
Scheme Induction for PositiveMap.tree Sort Prop. |
| 9 |
Scheme Equality for PositiveMap.tree. |
| 10 |
|
| 11 |
Notation t_beq := tree_beq. |
| 12 |
Notation t_eq_dec := tree_eq_dec. |
| 13 |
Notation internal_t_dec_bl := internal_tree_dec_bl. |
| 14 |
Notation internal_t_dec_lb := internal_tree_dec_lb. |
| 15 |
|
| 16 |
Lemma tree_eq_dec' {A} (A_dec : forall x y : A, {x = y} + {x <> y}) |
| 17 |
: forall x y : PositiveMap.tree A, {x = y} + {x <> y}. |
| 18 |
Proof. |
| 19 |
intros; do 2 decide equality. |
| 20 |
Qed. |
| 21 |
|
| 22 |
Global Instance tree_dec_eq {A} {A_dec : DecidableRel (@eq A)} |
| 23 |
: DecidableRel (@eq (PositiveMap.tree A)) |
| 24 |
:= @tree_eq_dec' A A_dec. |
| 25 |
Global Instance t_dec_eq {A} {A_dec : DecidableRel (@eq A)} |
| 26 |
: DecidableRel (@eq (PositiveMap.t A)) |
| 27 |
:= @tree_eq_dec' A A_dec. |
| 28 |
End PositiveMap. |