Debian Codegraph @

src/Util/Structures/Orders/Empty.v

raw
1 From Coq Require Import Morphisms Setoid.
2 From Coq Require Import Equalities.
3 From Coq Require Import Orders.
4 Require Import Crypto.Util.Structures.Equalities.Empty.
5 Require Import Crypto.Util.Structures.Orders.
6 Require Import Crypto.Util.Tactics.DestructHead.
7
8 Local Set Implicit Arguments.
9
10 Module EmptyHasLeb.
11 Definition leb (x y : Empty_set) := true.
12 End EmptyHasLeb.
13
14 Module EmptyHasLtb.
15 Definition ltb (x y : Empty_set) := false.
16 End EmptyHasLtb.
17
18 Module EmptyHasLe.
19 Definition le : relation Empty_set := fun _ _ => True.
20 End EmptyHasLe.
21
22 Module EmptyHasLt.
23 Definition lt : relation Empty_set := fun _ _ => False.
24 End EmptyHasLt.
25
26 Local Ltac t :=
27 repeat first [ intro
28 | progress cbv in *
29 | progress subst
30 | exfalso; assumption
31 | congruence
32 | progress destruct_head'_Empty_set
33 | progress destruct_head'_or
34 | solve [ eauto ]
35 | exactly_once constructor ].
36
37 Module EmptyIsStrOrder.
38 Global Instance lt_strorder : StrictOrder EmptyHasLt.lt | 1.
39 Proof. t. Qed.
40 Global Instance lt_compat : Proper (eq==>eq==>iff) EmptyHasLt.lt | 1.
41 Proof. t. Qed.
42 End EmptyIsStrOrder.
43
44 Module EmptyLeIsLtEq.
45 Local Infix "<=" := EmptyHasLe.le.
46 Local Infix "<" := EmptyHasLt.lt.
47 Local Infix "==" := eq (at level 70).
48 Lemma le_lteq : forall x y, x <= y <-> x < y \/ x == y.
49 Proof. t. Qed.
50 End EmptyLeIsLtEq.
51
52 Module EmptyHasCmp.
53 Definition compare (x y : Empty_set) : comparison := Eq.
54 End EmptyHasCmp.
55
56 Module EmptyCmpNotation := Nop <+ CmpNotation EmptyTyp EmptyHasCmp.
57
58 Module EmptyCmpSpec.
59 Local Infix "<" := EmptyHasLt.lt.
60 Local Infix "==" := eq (at level 70).
61 Lemma compare_spec : forall x y, CompareSpec (x == y) (x < y) (y < x) Eq.
62 Proof. t. Qed.
63 End EmptyCmpSpec.
64
65 Module EmptyLtIsTotal.
66 Local Infix "<" := EmptyHasLt.lt.
67 Local Infix "==" := eq (at level 70).
68 Lemma lt_total : forall x y, x < y \/ x == y \/ y < x.
69 Proof. t. Qed.
70 End EmptyLtIsTotal.
71
72 Module EmptyLebNotation := Nop <+ LebNotation EmptyTyp EmptyHasLeb.
73 Module EmptyLtbNotation := Nop <+ LtbNotation EmptyTyp EmptyHasLtb.
74
75 Module EmptyLebSpec.
76 Lemma leb_le : forall x y, EmptyHasLeb.leb x y = true <-> EmptyHasLe.le x y.
77 Proof. t. Qed.
78 End EmptyLebSpec.
79
80 Module EmptyLtbSpec.
81 Lemma ltb_lt : forall x y, EmptyHasLtb.ltb x y = true <-> EmptyHasLt.lt x y.
82 Proof. t. Qed.
83 End EmptyLtbSpec.
84
85 Module EmptyLebIsTotal.
86 Local Infix "<=?" := EmptyHasLeb.leb (at level 70).
87 Lemma leb_total : forall x y, (x <=? y) = true \/ (y <=? x) = true.
88 Proof. t. Qed.
89 End EmptyLebIsTotal.
90
91 Module EmptyLebIsTransitive.
92 Local Coercion is_true : bool >-> Sortclass.
93 Lemma leb_trans : Transitive EmptyHasLeb.leb.
94 Proof. t. Qed.
95 End EmptyLebIsTransitive.
96
97 Module EmptyUsualIsStrOrder.
98 Global Instance lt_strorder : StrictOrder EmptyHasLt.lt | 1 := _.
99 Global Instance lt_compat : Proper (eq==>eq==>iff) EmptyHasLt.lt | 1 := _.
100 End EmptyUsualIsStrOrder.
101
102 Module EmptyIsStrOrderOrig.
103 Lemma lt_trans : forall x y z, EmptyHasLt.lt x y -> EmptyHasLt.lt y z -> EmptyHasLt.lt x z.
104 Proof. t. Qed.
105 Lemma lt_not_eq : forall x y, EmptyHasLt.lt x y -> ~ eq x y.
106 Proof. t. Qed.
107 End EmptyIsStrOrderOrig.
108
109 Module EmptyHasCompareOrig.
110 Definition compare : forall x y, OrderedType.Compare EmptyHasLt.lt eq x y.
111 Proof. intros []. Defined.
112 End EmptyHasCompareOrig.
113
114 Module EmptyUsualLeIsLtEq.
115 Local Infix "<=" := EmptyHasLe.le.
116 Local Infix "<" := EmptyHasLt.lt.
117 Lemma le_lteq : forall x y, x <= y <-> x < y \/ x = y.
118 Proof. t. Qed.
119 End EmptyUsualLeIsLtEq.
120
121 Module EmptyUsualCmpSpec.
122 Local Infix "<" := EmptyHasLt.lt.
123 Lemma compare_spec : forall x y, CompareSpec (x = y) (x < y) (y < x) Eq.
124 Proof. t. Qed.
125 End EmptyUsualCmpSpec.
126
127 Module EmptyUsualLtIsTotal.
128 Local Infix "<" := EmptyHasLt.lt.
129 Lemma lt_total : forall x y, x < y \/ x = y \/ y < x.
130 Proof. t. Qed.
131 End EmptyUsualLtIsTotal.
132
133 Local Coercion is_true : bool >-> Sortclass.
134
135 Module EmptyIsStrOrderBool.
136 Global Instance ltb_strorder : StrictOrder EmptyHasLtb.ltb | 10.
137 Proof. t. Qed.
138 Global Instance ltb_compat : Proper (EmptyHasEqb.eqb==>EmptyHasEqb.eqb==>eq) EmptyHasLtb.ltb | 10.
139 Proof. t. Qed.
140 End EmptyIsStrOrderBool.
141
142 Module EmptyLebIsLtbEqb.
143 Lemma leb_ltbeqb : forall x y, (EmptyHasLeb.leb x y = (EmptyHasLtb.ltb x y || EmptyHasEqb.eqb x y))%bool.
144 Proof. t. Qed.
145 End EmptyLebIsLtbEqb.
146
147 Module EmptyEqLt <: EqLt := EmptyEq <+ EmptyHasLt.
148 Module EmptyEqLe <: EqLe := EmptyEq <+ EmptyHasLe.
149 Module EmptyEqLtLe <: EqLtLe := EmptyEq <+ EmptyHasLt <+ EmptyHasLe.
150 Module EmptyEqLt' <: EqLt' := EmptyEq <+ EmptyHasLt <+ EqLtNotation.
151 Module EmptyEqLe' <: EqLe' := EmptyEq <+ EmptyHasLe <+ EqLeNotation.
152 Module EmptyEqLtLe' <: EqLtLe' := EmptyEq <+ EmptyHasLt <+ EmptyHasLe <+ EqLtLeNotation.
153 Module EmptyStrOrder <: StrOrder := EmptyEqualityType <+ EmptyHasLt <+ EmptyIsStrOrder.
154 Module EmptyStrOrder' <: StrOrder' := EmptyStrOrder <+ EqLtNotation.
155 Module EmptyHasCompare := EmptyHasCmp <+ EmptyCmpSpec.
156 Module EmptyDecStrOrder <: DecStrOrder := EmptyStrOrder <+ EmptyHasCompare.
157 Module EmptyDecStrOrder' <: DecStrOrder' := EmptyDecStrOrder <+ EqLtNotation <+ CmpNotation.
158 Module EmptyOrderedType <: OrderedType := EmptyDecStrOrder <+ EmptyHasEqDec.
159 Module EmptyOrderedType' <: OrderedType' := EmptyOrderedType <+ EqLtNotation <+ CmpNotation.
160 Module EmptyOrderedTypeFull <: OrderedTypeFull := EmptyOrderedType <+ EmptyHasLe <+ EmptyLeIsLtEq.
161 Module EmptyOrderedTypeFull' <: OrderedTypeFull' := EmptyOrderedTypeFull <+ EqLtLeNotation <+ CmpNotation.
162
163 Module EmptyUsualEqLt <: UsualEqLt := EmptyUsualEq <+ EmptyHasLt.
164 Module EmptyUsualEqLe <: UsualEqLe := EmptyUsualEq <+ EmptyHasLe.
165 Module EmptyUsualEqLtLe <: UsualEqLtLe := EmptyUsualEq <+ EmptyHasLt <+ EmptyHasLe.
166
167 Module EmptyUsualStrOrder <: UsualStrOrder := EmptyUsualEqualityType <+ EmptyHasLt <+ EmptyUsualIsStrOrder.
168
169 Module EmptyUsualHasCompare := EmptyHasCmp <+ EmptyUsualCmpSpec.
170
171 Module EmptyUsualDecStrOrder <: UsualDecStrOrder := EmptyUsualStrOrder <+ EmptyUsualHasCompare.
172 Module EmptyUsualOrderedType <: UsualOrderedType := EmptyUsualDecStrOrder <+ EmptyUsualHasEqDec.
173 Module EmptyUsualOrderedTypeFull <: UsualOrderedTypeFull := EmptyUsualOrderedType <+ EmptyHasLe <+ EmptyUsualLeIsLtEq.
174
175 Module EmptyUsualStrOrder' <: UsualStrOrder' := EmptyUsualStrOrder <+ LtNotation.
176 Module EmptyUsualDecStrOrder' <: UsualDecStrOrder' := EmptyUsualDecStrOrder <+ LtNotation.
177 Module EmptyUsualOrderedType' <: UsualOrderedType' := EmptyUsualOrderedType <+ LtNotation.
178 Module EmptyUsualOrderedTypeFull' <: UsualOrderedTypeFull' := EmptyUsualOrderedTypeFull <+ LtLeNotation.
179
180 Module EmptyTotalOrder <: TotalOrder := EmptyStrOrder <+ EmptyHasLe <+ EmptyLeIsLtEq <+ EmptyLtIsTotal.
181 Module EmptyUsualTotalOrder <: UsualTotalOrder
182 := EmptyUsualStrOrder <+ EmptyHasLe <+ EmptyUsualLeIsLtEq <+ EmptyUsualLtIsTotal.
183
184 Module EmptyTotalOrder' <: TotalOrder' := EmptyTotalOrder <+ EqLtLeNotation.
185 Module EmptyUsualTotalOrder' <: UsualTotalOrder' := EmptyUsualTotalOrder <+ LtLeNotation.
186
187 Module EmptyOrderedTypeOrig <: OrderedTypeOrig := OT_of_New EmptyOrderedType.
188 Module EmptyMiniOrderedType <: MiniOrderedType := EmptyOrderedTypeOrig.
189 Module EmptyUsualOrderedTypeOrig <: UsualOrderedTypeOrig := EmptyOrderedTypeOrig.
190 Module EmptyUsualMiniOrderedType <: UsualMiniOrderedType := EmptyOrderedTypeOrig.
191
192 Module EmptyLeBool <: LeBool := EmptyTyp <+ EmptyHasLeb.
193 Module EmptyLtBool <: LtBool := EmptyTyp <+ EmptyHasLtb.
194 Module EmptyLeBool' <: LeBool' := EmptyLeBool <+ LebNotation.
195 Module EmptyLtBool' <: LtBool' := EmptyLtBool <+ LtbNotation.
196 Module EmptyEqLeBool <: EqLeBool := EmptyTyp <+ EmptyHasEqb <+ EmptyHasLeb.
197 Module EmptyEqLtBool <: EqLtBool := EmptyTyp <+ EmptyHasEqb <+ EmptyHasLtb.
198 Module EmptyEqLeBool' <: EqLeBool' := EmptyEqLeBool <+ EqbNotation <+ LebNotation.
199 Module EmptyEqLtBool' <: EqLtBool' := EmptyEqLtBool <+ EqbNotation <+ LtbNotation.
200 Module EmptyEqLtLeBool <: EqLtLeBool := EmptyTyp <+ EmptyHasEqb <+ EmptyHasLtb <+ EmptyHasLeb.
201 Module EmptyEqLtLeBool' <: EqLtLeBool' := EmptyEqLtLeBool <+ EqbNotation <+ LtbNotation <+ LebNotation.
202
203 Module EmptyTotalLeBool <: TotalLeBool := EmptyLeBool <+ EmptyLebIsTotal.
204 Module EmptyTotalLeBool' <: TotalLeBool' := EmptyLeBool' <+ EmptyLebIsTotal.
205 Module EmptyTotalEqLeBool <: TotalEqLeBool := EmptyEqLeBool <+ EmptyLebIsTotal.
206 Module EmptyTotalEqLeBool' <: TotalEqLeBool' := EmptyEqLeBool' <+ EmptyLebIsTotal.
207 Module EmptyTotalEqLtLeBool <: TotalEqLtLeBool := EmptyEqLtLeBool <+ EmptyLebIsTotal.
208 Module EmptyTotalEqLtLeBool' <: TotalEqLtLeBool' := EmptyEqLtLeBool' <+ EmptyLebIsTotal.
209
210 Module EmptyTotalTransitiveLeBool <: TotalTransitiveLeBool := EmptyTotalLeBool <+ EmptyLebIsTransitive.
211 Module EmptyTotalTransitiveLeBool' <: TotalTransitiveLeBool' := EmptyTotalLeBool' <+ EmptyLebIsTransitive.
212 Module EmptyTotalTransitiveEqLeBool <: TotalTransitiveEqLeBool := EmptyTotalEqLeBool <+ EmptyLebIsTransitive.
213 Module EmptyTotalTransitiveEqLeBool' <: TotalTransitiveEqLeBool' := EmptyTotalEqLeBool' <+ EmptyLebIsTransitive.
214 Module EmptyTotalTransitiveEqLtLeBool <: TotalTransitiveEqLtLeBool := EmptyTotalEqLtLeBool <+ EmptyLebIsTransitive.
215 Module EmptyTotalTransitiveEqLtLeBool' <: TotalTransitiveEqLtLeBool' := EmptyTotalEqLtLeBool' <+ EmptyLebIsTransitive.
216
217 Module EmptyStrOrderBool <: StrOrderBool := EmptyEqbType <+ EmptyHasLtb <+ EmptyIsStrOrderBool.
218 Module EmptyStrOrderBool' <: StrOrderBool' := EmptyStrOrderBool <+ EqLtBoolNotation.
219
220 Module EmptyTotalOrderBool <: TotalOrderBool := EmptyStrOrderBool <+ EmptyHasLeb <+ EmptyLebIsLtbEqb <+ EmptyLebIsTotal.
221 Module EmptyTotalOrderBool' <: TotalOrderBool' := EmptyTotalOrderBool <+ EqLtLeBoolNotation.
222
223 Module EmptyHasBoolOrdFuns := EmptyHasEqb <+ EmptyHasLtb <+ EmptyHasLeb.
224
225 Module EmptyHasBoolOrdFuns' := EmptyHasBoolOrdFuns <+ EmptyEqbNotation <+ EmptyLtbNotation <+ EmptyLebNotation.
226
227 Module EmptyBoolOrdSpecs := EmptyEqbSpec <+ EmptyLtbSpec <+ EmptyLebSpec.
228
229 Module EmptyOrderFunctions := EmptyHasCompare <+ EmptyHasBoolOrdFuns <+ EmptyBoolOrdSpecs.
230 Module EmptyOrderFunctions' := EmptyHasCompare <+ EmptyCmpNotation <+ EmptyHasBoolOrdFuns' <+ EmptyBoolOrdSpecs.