Skip to content

Commit 5c605d7

Browse files
authored
Merge pull request #2254 from patrick-nicodemus/tc_fixes
Typeclass hints
2 parents d2f9b8c + 813bc57 commit 5c605d7

File tree

14 files changed

+44
-41
lines changed

14 files changed

+44
-41
lines changed

theories/Algebra/ooGroup.v

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,25 +218,25 @@ Section Subgroups.
218218
Definition in_coset : G -> G -> Type
219219
:= fun g1 g2 => hfiber incl (g1 @ g2^).
220220

221-
Instance ishprop_in_coset : is_mere_relation G in_coset.
221+
#[export] Instance ishprop_in_coset : is_mere_relation G in_coset.
222222
Proof.
223223
exact _.
224224
Defined.
225225

226-
Instance reflexive_coset : Reflexive in_coset.
226+
#[export] Instance reflexive_coset : Reflexive in_coset.
227227
Proof.
228228
intros g.
229229
exact (1 ; grouphom_1 incl @ (concat_pV g)^).
230230
Defined.
231231

232-
Instance symmetric_coset : Symmetric in_coset.
232+
#[export] Instance symmetric_coset : Symmetric in_coset.
233233
Proof.
234234
intros g1 g2 [h p].
235235
exists (h^).
236236
exact (grouphom_V incl h @ inverse2 p @ inv_pp _ _ @ whiskerR (inv_V _) _).
237237
Defined.
238238

239-
Instance transitive_coset : Transitive in_coset.
239+
#[export] Instance transitive_coset : Transitive in_coset.
240240
Proof.
241241
intros g1 g2 g3 [h1 p1] [h2 p2].
242242
exists (h1 @ h2).

theories/Classes/orders/lattices.v

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -279,15 +279,15 @@ Section meet_semilattice_order.
279279
- rewrite <-E. apply meet_lb_r.
280280
Qed.
281281

282-
#[export] Instance: forall z, OrderPreserving (z ⊓).
282+
#[export] Instance orderpreserving_left_meet : forall z, OrderPreserving (z ⊓).
283283
Proof.
284284
red;intros.
285285
apply meet_glb.
286286
- apply meet_lb_l.
287287
- apply meet_le_compat_l. trivial.
288288
Qed.
289289

290-
#[export] Instance: forall z, OrderPreserving (⊓ z).
290+
#[export] Instance orderpreserving_right_meet: forall z, OrderPreserving (⊓ z).
291291
Proof.
292292
intros. exact maps.order_preserving_flip.
293293
Qed.
@@ -346,10 +346,10 @@ End meet_semilattice_order.
346346
Section lattice_order.
347347
Context `{LatticeOrder L}.
348348

349-
Instance: IsJoinSemiLattice L := join_sl_order_join_sl.
350-
Instance: IsMeetSemiLattice L := meet_sl_order_meet_sl.
349+
Instance isjoinsemilattice_latticeorder : IsJoinSemiLattice L := join_sl_order_join_sl.
350+
Instance ismeetsemilattice_latticeorder : IsMeetSemiLattice L := meet_sl_order_meet_sl.
351351

352-
Instance: Absorption (⊓) (⊔).
352+
Instance absorption_join_meet : Absorption (⊓) (⊔).
353353
Proof.
354354
intros x y. apply (antisymmetry (≤)).
355355
- apply meet_lb_l.
@@ -358,7 +358,7 @@ Section lattice_order.
358358
+ apply join_ub_l.
359359
Qed.
360360

361-
Instance: Absorption (⊔) (⊓).
361+
Instance absorption_meet_join : Absorption (⊔) (⊓).
362362
Proof.
363363
intros x y. apply (antisymmetry (≤)).
364364
- apply join_le.

theories/Classes/orders/nat_int.v

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,15 +147,15 @@ Section another_semiring.
147147
`{PropHolds ((1 : R2) ≶ 0)}
148148
`{!IsSemiRingPreserving (f : R -> R2)}.
149149

150-
Instance: OrderPreserving f.
150+
Instance orderpreserving_semiring_homomorphism : OrderPreserving f.
151151
Proof.
152152
repeat (split; try exact _).
153153
intros x y E. apply nat_int_le_plus in E. destruct E as [z E].
154154
rewrite E, (preserves_plus (f:=f)), (naturals.to_semiring_twice f _ _).
155155
apply nonneg_plus_le_compat_r. apply to_semiring_nonneg.
156156
Qed.
157157

158-
#[export] Instance: StrictlyOrderPreserving f | 50.
158+
#[export] Instance strictlyorderpreserving_semiring_homomorphism : StrictlyOrderPreserving f | 50.
159159
Proof.
160160
repeat (split; try exact _).
161161
intros x y E. apply nat_int_lt_plus in E. destruct E as [z E].

theories/Classes/orders/naturals.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ etransitivity.
5959
- apply pos_ge_1.
6060
Qed.
6161

62-
#[export] Instance: forall (z : N), PropHolds (z <> 0) -> OrderReflecting (z *.).
62+
#[export] Instance orderreflecting_left_mult : forall (z : N), PropHolds (z <> 0) -> OrderReflecting (z *.).
6363
Proof.
6464
intros z ?. red. apply (order_reflecting_pos (.*.) z).
6565
apply nat_ne_0_pos. trivial.

theories/Classes/orders/orders.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,6 @@ Section pseudo.
558558
- destruct (pseudo_order_antisym y z (ltyz , ltzy)).
559559
Qed.
560560

561-
Existing Instance lt_transitive.
561+
#[export] Existing Instance lt_transitive.
562562

563563
End pseudo.

theories/Classes/orders/semirings.v

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ Section pseudo_semiring_order.
437437
exact strictly_order_reflecting_flip.
438438
Qed.
439439

440-
Global Instance apartzero_mult_strong_cancel_l
440+
#[export] Instance apartzero_mult_strong_cancel_l
441441
: forall z, PropHolds (z ≶ 0) -> StrongLeftCancellation (.*.) z.
442442
Proof.
443443
intros z Ez x y E. red in Ez.
@@ -602,12 +602,12 @@ Section full_pseudo_semiring_order.
602602
destruct (neg_mult_decompose x y E) as [[? ?]|[? ?]];auto.
603603
Qed.
604604

605-
#[export] Instance : forall (z : R), PropHolds (0 < z) -> OrderReflecting (z *.).
605+
#[export] Instance orderreflecting_left_mult : forall (z : R), PropHolds (0 < z) -> OrderReflecting (z *.).
606606
Proof.
607607
intros z E. exact full_pseudo_order_reflecting.
608608
Qed.
609609

610-
#[export] Instance: forall (z : R), PropHolds (0 < z) -> OrderReflecting (.* z).
610+
#[export] Instance orderreflecting_right_mult : forall (z : R), PropHolds (0 < z) -> OrderReflecting (.* z).
611611
Proof.
612612
intros. exact order_reflecting_flip.
613613
Qed.

theories/Classes/theory/apartness.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ intros ap e;revert ap.
1212
apply tight_apart. assumption.
1313
Qed.
1414

15-
#[export] Instance: forall x y : A, Stable (x = y).
15+
#[export] Instance stable_eq_apartness: forall x y : A, Stable (x = y).
1616
Proof.
1717
intros x y. unfold Stable.
1818
intros dn. apply tight_apart.

theories/Classes/theory/fields.v

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Proof.
5252
intros ? E. rewrite <-E. trivial.
5353
Qed.
5454

55-
#[export] Instance: IsStrongInjective (-).
55+
#[export] Instance isstronginjective_negation_field: IsStrongInjective (-).
5656
Proof.
5757
repeat (split; try exact _); intros x y E.
5858
- apply (strong_extensionality (+ x + y)).
@@ -67,7 +67,7 @@ repeat (split; try exact _); intros x y E.
6767
apply symmetry;trivial.
6868
Qed.
6969

70-
#[export] Instance: IsStrongInjective (//).
70+
#[export] Instance isstronginjective_recip_field: IsStrongInjective (//).
7171
Proof.
7272
repeat (split; try exact _); intros x y E.
7373
- apply (strong_extensionality (x.1 *.)).
@@ -82,20 +82,20 @@ repeat (split; try exact _); intros x y E.
8282
rewrite mult_1_l,mult_1_r. apply symmetry;trivial.
8383
Qed.
8484

85-
#[export] Instance: forall z, StrongLeftCancellation (+) z.
85+
#[export] Instance strongleftcancellation_plus_field: forall z, StrongLeftCancellation (+) z.
8686
Proof.
8787
intros z x y E. apply (strong_extensionality (+ -z)).
8888
do 2 rewrite (commutativity (f:=plus) z _),
8989
<-simple_associativity,right_inverse,plus_0_r.
9090
trivial.
9191
Qed.
9292

93-
#[export] Instance: forall z, StrongRightCancellation (+) z.
93+
#[export] Instance strongrightcancellation_plus_field : forall z, StrongRightCancellation (+) z.
9494
Proof.
9595
intros. exact (strong_right_cancel_from_left (+)).
9696
Qed.
9797

98-
#[export] Instance: forall z, PropHolds (z ≶ 0) -> StrongLeftCancellation (.*.) z.
98+
#[export] Instance strongleftcancellation_mult_field : forall z, PropHolds (z ≶ 0) -> StrongLeftCancellation (.*.) z.
9999
Proof.
100100
intros z Ez x y E. red in Ez.
101101
rewrite !(commutativity z).
@@ -104,7 +104,7 @@ rewrite <-!simple_associativity, !reciperse_alt.
104104
rewrite !mult_1_r;trivial.
105105
Qed.
106106

107-
#[export] Instance: forall z, PropHolds (z ≶ 0) -> StrongRightCancellation (.*.) z.
107+
#[export] Instance strongrightcancellation_mult_field : forall z, PropHolds (z ≶ 0) -> StrongRightCancellation (.*.) z.
108108
Proof.
109109
intros. exact (strong_right_cancel_from_left (.*.)).
110110
Qed.
@@ -130,7 +130,7 @@ rewrite <-simple_associativity, reciperse_alt, mult_1_r, mult_0_l.
130130
trivial.
131131
Qed.
132132

133-
Instance: NoZeroDivisors F.
133+
Instance nozerodivisors_field : NoZeroDivisors F.
134134
Proof.
135135
intros x [x_nonzero [y [y_nonzero E]]].
136136
assert (~ ~ apart y 0) as Ey.
@@ -142,9 +142,9 @@ assert (~ ~ apart y 0) as Ey.
142142
apply mult_0_l.
143143
Qed.
144144

145-
#[export] Instance : IsIntegralDomain F := {}.
145+
#[export] Instance isintegraldomain_field : IsIntegralDomain F := {}.
146146

147-
#[export] Instance apart_0_sig_apart_0: forall (x : ApartZero F), PropHolds (x.1 ≶ 0).
147+
#[export] Instance apart_0_sig_apart_0 : forall (x : ApartZero F), PropHolds (x.1 ≶ 0).
148148
Proof.
149149
intros [??];trivial.
150150
Qed.
@@ -296,7 +296,7 @@ Section morphisms.
296296

297297
(* We have the following for morphisms to non-trivial strong rings as well.
298298
However, since we do not have an interface for strong rings, we ignore it. *)
299-
#[export] Instance: IsStrongInjective f.
299+
#[export] Instance isstronginjective_field_homomorphism : IsStrongInjective f.
300300
Proof.
301301
apply strong_injective_preserves_0.
302302
intros x Ex.

theories/Classes/theory/naturals.v

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ Section retract_is_nat.
7676
Section for_another_semirings.
7777
Context `{IsSemiCRing R}.
7878

79-
Instance: IsSemiRingPreserving (naturals_to_semiring N R ∘ f^-1) := {}.
79+
Instance issemiringpreserving_naturals_to_semiring : IsSemiRingPreserving (naturals_to_semiring N R ∘ f^-1) := {}.
8080

8181
Context (h : SR -> R) `{!IsSemiRingPreserving h}.
8282

@@ -144,7 +144,7 @@ Section borrowed_from_nat.
144144
simpl. intros [|x];eauto.
145145
Qed.
146146

147-
#[export] Instance: Biinduction N.
147+
#[export] Instance biinduction_nat : Biinduction N.
148148
Proof.
149149
hnf. intros P E0 ES.
150150
apply induction;trivial.
@@ -158,20 +158,20 @@ Section borrowed_from_nat.
158158
simpl. first [exact nat_plus_cancel_l@{U i}|exact nat_plus_cancel_l@{U}].
159159
Qed.
160160

161-
#[export] Instance: forall z : N, RightCancellation (+) z.
161+
#[export] Instance rightcancellation_plus_nat : forall z : N, RightCancellation (+) z.
162162
Proof. intro. exact (right_cancel_from_left (+)). Qed.
163163

164-
#[export] Instance: forall z : N, PropHolds (z <> 0) -> LeftCancellation (.*.) z.
164+
#[export] Instance leftcancellation_plus_nat : forall z : N, PropHolds (z <> 0) -> LeftCancellation (.*.) z.
165165
Proof.
166166
refine (from_nat_stmt nat (fun s =>
167167
forall z : s, PropHolds (z <> 0) -> LeftCancellation mult z) _).
168168
simpl. exact nat_mult_cancel_l.
169169
Qed.
170170

171-
#[export] Instance: forall z : N, PropHolds (z <> 0) -> RightCancellation (.*.) z.
171+
#[export] Instance rightcancellation_mult_nat : forall z : N, PropHolds (z <> 0) -> RightCancellation (.*.) z.
172172
Proof. intros ? ?. exact (right_cancel_from_left (.*.)). Qed.
173173

174-
Instance nat_nontrivial: PropHolds ((1:N) <> 0).
174+
Instance nat_nontrivial : PropHolds ((1:N) <> 0).
175175
Proof.
176176
refine (from_nat_stmt nat (fun s => PropHolds ((1:s) <> 0)) _).
177177
exact _.
@@ -202,7 +202,7 @@ Section borrowed_from_nat.
202202
apply S_inj in E. destruct (S_neq_0 _ E).
203203
Qed.
204204

205-
#[export] Instance: ZeroProduct N.
205+
#[export] Instance zeroproduct_nat : ZeroProduct N.
206206
Proof.
207207
refine (from_nat_stmt nat (fun s => ZeroProduct s) _).
208208
simpl. red. exact mult_eq_zero.

theories/HIT/V.v

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ Defined.
277277

278278
Notation "u ~~ v" := (bisimulation u v) : set_scope.
279279

280-
Instance reflexive_bisimulation : Reflexive bisimulation.
280+
#[export] Instance reflexive_bisimulation : Reflexive bisimulation.
281281
Proof.
282282
refine (V_ind_hprop _ _ _).
283283
intros A f H_f. split.
@@ -443,7 +443,7 @@ Defined.
443443

444444
(** ** Two useful lemmas *)
445445

446-
Instance irreflexive_mem : Irreflexive mem.
446+
#[export] Instance irreflexive_mem : Irreflexive mem.
447447
Proof.
448448
assert (forall v, IsHProp (complement (fun x x0 : V => x ∈ x0) v v)). (* https://coq.inria.fr/bugs/show_bug.cgi?id=3854 *)
449449
{ intro.
@@ -478,7 +478,7 @@ Definition V_empty : V := set (Empty_ind (fun _ => V)).
478478
(** The singleton {u} *)
479479
Definition V_singleton (u : V) : V@{U' U} := set (Unit_ind u).
480480

481-
Instance isequiv_ap_V_singleton {u v : V}
481+
#[export] Instance isequiv_ap_V_singleton {u v : V}
482482
: IsEquiv (@ap _ _ V_singleton u v).
483483
Proof.
484484
simple refine (Build_IsEquiv _ _ _ _ _ _ _); try solve [ intro; apply path_ishprop ].

0 commit comments

Comments
 (0)