Debian Codegraph @

src/Util/Decidable/Bool2Prop.v

raw
1 From Coq Require ZArith.
2
3 Lemma unit_eq (x y:unit) : x = y. destruct x, y; reflexivity. Qed.
4 Global Hint Resolve unit_eq : core.
5
6 Global Hint Extern 0 (_ = _ :> bool) => (
7 match goal with
8 | [H:Bool.eqb ?a ?b = true |- ?a = ?b ] => apply (proj1 (Bool.eqb_true_iff _ _) H)
9 | [H:Bool.eqb ?b ?a = true |- ?a = ?b ] => symmetry; apply (proj1 (Bool.eqb_true_iff _ _) H)
10 end) : core.
11
12 Global Hint Extern 0 (_ = _ :> nat) => (
13 match goal with
14 | [H:Nat.eqb ?a ?b = true |- ?a = ?b ] => apply (proj1 (PeanoNat.Nat.eqb_eq _ _) H)
15 | [H:Nat.eqb ?b ?a = true |- ?a = ?b ] => symmetry; apply (proj1 (PeanoNat.Nat.eqb_eq _ _) H)
16 end) : core.
17
18 Global Hint Extern 0 (_ <= _) => (
19 match goal with
20 | [H:Nat.ltb ?a ?b = true |- ?a < ?b ] => apply (proj1 (PeanoNat.Nat.ltb_lt _ _) H)
21 end) : core.
22
23 Global Hint Extern 0 (_ <= _) => (
24 match goal with
25 | [H:Nat.leb ?a ?b = true |- ?a <= ?b ] => apply (proj1 (PeanoNat.Nat.leb_le _ _) H)
26 end) : core.
27
28 Global Hint Extern 0 (_ = _ :> BinNums.N) => (
29 match goal with
30 | [H:BinNat.N.eqb ?a ?b = true |- ?a = ?b ] => apply (proj1 (BinNat.N.eqb_eq _ _) H)
31 | [H:BinNat.N.eqb ?b ?a = true |- ?a = ?b ] => symmetry; apply (proj1 (BinNat.N.eqb_eq _ _) H)
32 end) : core.
33 Global Hint Extern 0 (_ = _ :> BinInt.Z) => (
34 match goal with
35 | [H:BinInt.Z.eqb ?a ?b = true |- ?a = ?b ] => apply (proj1 (BinInt.Z.eqb_eq _ _) H)
36 | [H:BinInt.Z.eqb ?a ?b = true |- ?b = ?a ] => symmetry; apply (proj1 (BinInt.Z.eqb_eq _ _) H)
37 end) : core.
38 Global Hint Extern 0 (BinInt.Z.lt _ _) => (
39 match goal with
40 | [H:BinInt.Z.ltb ?a ?b = true |- BinInt.Z.lt ?a ?b ] => apply (proj1 (BinInt.Z.ltb_lt _ _) H)
41 | [H:BinInt.Z.gtb ?b ?a = true |- BinInt.Z.lt ?a ?b ] => apply (proj1 (BinInt.Z.gtb_lt _ _) H)
42 end) : core.
43 Global Hint Extern 0 (BinInt.Z.le _ _) => (
44 match goal with
45 | [H:BinInt.Z.leb ?a ?b = true |- BinInt.Z.le ?a ?b ] => apply (proj1 (BinInt.Z.leb_le _ _) H)
46 | [H:BinInt.Z.geb ?b ?a = true |- BinInt.Z.le ?a ?b ] => apply (proj1 (BinInt.Z.geb_le _ _) H)
47 end) : core.
48
49 Global Hint Extern 0 (_ = _ :> BinPos.positive) => (
50 match goal with
51 | [H:BinPos.Pos.eqb ?a ?b = true |- ?a = ?b ] => apply (proj1 (BinPos.Pos.eqb_eq _ _) H)
52 | [H:BinPos.Pos.eqb ?a ?b = true |- ?b = ?a ] => symmetry; apply (proj1 (BinPos.Pos.eqb_eq _ _) H)
53 end) : core.
54 Global Hint Extern 0 (BinPos.Pos.lt _ _) => (
55 match goal with
56 | [H:BinPos.Pos.ltb ?a ?b = true |- BinPos.Pos.lt ?a ?b ] => apply (proj1 (BinPos.Pos.ltb_lt _ _) H)
57 end) : core.
58 Global Hint Extern 0 (BinPos.Pos.le _ _) => (
59 match goal with
60 | [H:BinPos.Pos.leb ?a ?b = true |- BinPos.Pos.le ?a ?b ] => apply (proj1 (BinPos.Pos.leb_le _ _) H)
61 end) : core.