Skip to content

Commit 92924c4

Browse files
author
Patrick Nicodemus
committed
Simpler definition of refine
1 parent 00702bf commit 92924c4

32 files changed

+65
-76
lines changed

theories/Algebra/AbGroups/Abelianization.v

+1-1
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ Section AbelGroup.
248248
intros x y z; cbn beta.
249249
lhs nrapply ap.
250250
2: rhs nrapply ap.
251-
1,3: lhs rapply inverse_sg_op; nrapply (ap (.* _)); rapply inverse_sg_op.
251+
1,3: lhs apply inverse_sg_op; nrapply (ap (.* _)); rapply inverse_sg_op.
252252
change (abel_in z^ * abel_in y^ * abel_in x^
253253
= abel_in y^ * abel_in z^ * abel_in x^).
254254
apply (ap (.* _)).

theories/Algebra/AbSES/Core.v

+1-1
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,7 @@ Proof.
734734
refine (ap _ p^ @ _).
735735
refine (cx_isexact _).
736736
- apply isequiv_surj_emb.
737-
1: rapply cancelR_conn_map.
737+
1: exact (cancelR_conn_map _ _ _).
738738
apply isembedding_isinj_hset.
739739
srapply Quotient_ind2_hprop; intros x y.
740740
intro p.

theories/Algebra/AbSES/PullbackFiberSequence.v

+1-1
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,6 @@ Proof.
396396
srapply (equiv_ind (equiv_hfiber_abses (abses_pullback (inclusion E)) (point (AbSES B A)))).
397397
intros [F p].
398398
rapply contr_equiv'.
399-
1: apply equiv_hfiber_cxfib'.
399+
2: apply equiv_hfiber_cxfib'.
400400
apply contr_hfiber_cxfib'.
401401
Defined.

theories/Algebra/AbSES/Pushout.v

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ Definition abses_pushout_morphism_rec `{Univalence} {A B X Y : AbGroup}
7777
Proof.
7878
snrapply (Build_AbSESMorphism grp_homo_id _ (component3 f)).
7979
- rapply ab_pushout_rec.
80-
apply left_square.
80+
3: apply left_square.
8181
- intro x; simpl.
8282
rewrite grp_homo_unit.
8383
exact (right_identity _)^.

theories/Algebra/AbSES/SixTerm.v

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Definition isexact_abses_sixterm_i `{Funext}
1818
Proof.
1919
apply isexact_purely_O.
2020
rapply isexact_homotopic_i.
21-
2: apply iff_grp_isexact_isembedding.
21+
3: apply iff_grp_isexact_isembedding.
2222
1: by apply phomotopy_homotopy_hset.
2323
exact _. (* [isembedding_precompose_surjection_ab] *)
2424
Defined.

theories/Algebra/Groups/FreeProduct.v

+7-9
Original file line numberDiff line numberDiff line change
@@ -367,8 +367,7 @@ Section FreeProduct.
367367
{ refine (word_inverse_ww _ _ @ _).
368368
apply ap; simpl.
369369
rapply (ap (fun s => [s])).
370-
apply ap.
371-
apply inverse_sg_op. }
370+
2:apply ap, inverse_sg_op. }
372371
simpl.
373372
refine (ap amal_eta _^ @ _ @ ap amal_eta _).
374373
1,3: apply app_assoc.
@@ -380,8 +379,7 @@ Section FreeProduct.
380379
{ refine (word_inverse_ww _ _ @ _).
381380
apply ap; simpl.
382381
rapply (ap (fun s => [s])).
383-
apply ap.
384-
apply inverse_sg_op. }
382+
2: apply ap, inverse_sg_op. }
385383
simpl.
386384
refine (ap amal_eta _^ @ _ @ ap amal_eta _).
387385
1,3: apply app_assoc.
@@ -391,7 +389,7 @@ Section FreeProduct.
391389
1,3: refine (word_inverse_ww _ _ @ ap (fun s => s ++ _) _).
392390
1,2: cbn; refine (ap _ _).
393391
1,2: rapply (ap (fun s => [s])).
394-
1,2: apply ap.
392+
2,4: apply ap.
395393
1,2: symmetry; apply grp_homo_inv.
396394
refine (ap amal_eta _^ @ _ @ ap amal_eta _).
397395
1,3: apply app_assoc.
@@ -482,8 +480,8 @@ Section FreeProduct.
482480
refine (_ @ _).
483481
{ apply ap, ap.
484482
rapply (ap (fun x => x ++ _)).
485-
rapply (ap (fun x => [x])).
486-
apply ap.
483+
2: rapply (ap (fun x => [x])).
484+
2: apply ap.
487485
apply right_inverse. }
488486
apply amal_omega_H.
489487
+ cbn.
@@ -499,8 +497,8 @@ Section FreeProduct.
499497
refine (_ @ _).
500498
{ apply ap, ap.
501499
rapply (ap (fun x => x ++ _)).
502-
rapply (ap (fun x => [x])).
503-
apply ap.
500+
2: rapply (ap (fun x => [x])).
501+
2: apply ap.
504502
apply right_inverse. }
505503
apply amal_omega_K.
506504
Defined.

theories/Algebra/Groups/ShortExactSequence.v

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Proposition grp_iso_cxfib_beta {A B C : Group} {i : A $-> B} {f : B $-> C}
2121
: i $o (grp_iso_inverse (grp_iso_cxfib ex)) $== subgroup_incl (grp_kernel f).
2222
Proof.
2323
rapply equiv_ind.
24-
1: exact (isequiv_cxfib ex).
24+
3: exact (isequiv_cxfib ex).
2525
intro x.
2626
exact (ap (fun y => i y) (eissect _ x)).
2727
Defined.

theories/Algebra/Rings/CRing.v

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Definition Build_CRing' (R : AbGroup) `(!One R, !Mult R)
2929
: CRing.
3030
Proof.
3131
snrapply Build_CRing.
32-
- rapply (Build_Ring R); only 1,2,4: exact _.
32+
- rapply (Build_Ring R).
3333
+ intros x y z.
3434
lhs nrapply comm.
3535
lhs rapply dist_l.
@@ -133,7 +133,7 @@ Section IdealCRing.
133133
2: rapply ideal_sum_self.
134134
etransitivity.
135135
2: rapply ideal_sum_subset_pres_r.
136-
2: rapply ideal_product_comm.
136+
3: rapply ideal_product_comm.
137137
apply ideal_product_intersection_sum_subset.
138138
Defined.
139139

theories/Algebra/Rings/ChineseRemainder.v

+2-2
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ Theorem chinese_remainder_prod `{Univalence}
147147
Proof.
148148
etransitivity.
149149
{ rapply rng_quotient_invar.
150-
symmetry.
151-
rapply ideal_intersection_is_product. }
150+
2: symmetry; rapply ideal_intersection_is_product.
151+
}
152152
rapply chinese_remainder.
153153
Defined.

theories/Algebra/Rings/Ideal.v

+4-4
Original file line numberDiff line numberDiff line change
@@ -1096,12 +1096,12 @@ Section IdealLemmas.
10961096
1: rapply ideal_dist_l.
10971097
etransitivity.
10981098
1: rapply ideal_sum_subset_pres_r.
1099-
1: rapply ideal_product_subset_pres_l.
1100-
1: apply ideal_intersection_subset_l.
1099+
2: rapply ideal_product_subset_pres_l.
1100+
2: apply ideal_intersection_subset_l.
11011101
etransitivity.
11021102
1: rapply ideal_sum_subset_pres_l.
1103-
1: rapply ideal_product_subset_pres_l.
1104-
1: apply ideal_intersection_subset_r.
1103+
2: rapply ideal_product_subset_pres_l.
1104+
2: apply ideal_intersection_subset_r.
11051105
rapply ideal_sum_comm.
11061106
Defined.
11071107

theories/Basics/Tactics.v

+1-1
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ Tactic Notation "snrefine" uconstr(term) := simple notypeclasses refine term; gl
320320

321321
(** Note that the Coq standard library has a [rapply], but it is like our [rapply'] with many-holes first. We prefer fewer-holes first, for instance so that a theorem producing an equivalence will by preference be used to produce an equivalence rather than to apply the coercion of that equivalence to a function. *)
322322
Tactic Notation "rapply" uconstr(term)
323-
:= do_with_holes ltac:(fun x => try (try (nrefine x || fail 2); fail); refine x) term.
323+
:= do_with_holes (ltac:(fun x => unshelve nrefine x; try typeclasses eauto)) term.
324324
Tactic Notation "rapply'" uconstr(term)
325325
:= do_with_holes' ltac:(fun x => refine x) term.
326326

theories/Classes/implementations/binary_naturals.v

+6-6
Original file line numberDiff line numberDiff line change
@@ -476,26 +476,26 @@ Section decidable.
476476
intros p.
477477
change ((fun x => match x with | double1 y => Unit | _ => Empty end) bzero).
478478
rapply (@transport binnat).
479-
- exact p^.
480-
- exact tt.
479+
2: exact p^.
480+
exact tt.
481481
Qed.
482482

483483
Local Definition ineq_bzero_double2 n : bzero <> double2 n.
484484
Proof.
485485
intros p.
486486
change ((fun x => match x with | double2 y => Unit | _ => Empty end) bzero).
487487
rapply (@transport binnat).
488-
- exact p^.
489-
- exact tt.
488+
2: exact p^.
489+
exact tt.
490490
Qed.
491491

492492
Local Definition ineq_double1_double2 m n : double1 m <> double2 n.
493493
Proof.
494494
intros p.
495495
change ((fun x => match x with | double2 y => Unit | _ => Empty end) (double1 m)).
496496
rapply (@transport binnat).
497-
- exact p^.
498-
- exact tt.
497+
2: exact p^.
498+
exact tt.
499499
Qed.
500500

501501
Local Definition undouble (m : binnat) : binnat :=

theories/Classes/theory/rings.v

+4-4
Original file line numberDiff line numberDiff line change
@@ -254,9 +254,9 @@ Section ring_props.
254254
Lemma negate_swap_r : forall x y, x - y = -(y - x).
255255
Proof.
256256
intros; symmetry.
257-
lhs rapply groups.inverse_sg_op.
258-
f_ap.
259-
apply involutive.
257+
Set Printing Implicit.
258+
lhs apply groups.inverse_sg_op.
259+
f_ap; apply involutive.
260260
Defined.
261261

262262
Lemma negate_swap_l x y : -x + y = -(x - y).
@@ -465,7 +465,7 @@ Section ringmor_props.
465465

466466
Definition preserves_negate x : f (- x) = - f x.
467467
Proof.
468-
rapply preserves_inverse.
468+
apply preserves_inverse.
469469
Defined.
470470

471471
Lemma preserves_minus x y : f (x - y) = f x - f y.

theories/Colimits/Coeq.v

+2-4
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ Definition Coeq_ind {B A f g} (P : @Coeq B A f g -> Type)
2626
: forall w, P w.
2727
Proof.
2828
rapply GraphQuotient_ind.
29-
intros a b [x [[] []]].
30-
exact (cglue' x).
29+
2: intros a b [x [[] []]]; exact (cglue' x).
3130
Defined.
3231

3332
Lemma Coeq_ind_beta_cglue {B A f g} (P : @Coeq B A f g -> Type)
@@ -43,8 +42,7 @@ Definition Coeq_rec {B A f g} (P : Type) (coeq' : A -> P)
4342
: @Coeq B A f g -> P.
4443
Proof.
4544
rapply GraphQuotient_rec.
46-
intros a b [x [[] []]].
47-
exact (cglue' x).
45+
2: intros a b [x [[] []]]; exact (cglue' x).
4846
Defined.
4947

5048
Definition Coeq_rec_beta_cglue {B A f g} (P : Type) (coeq' : A -> P)

theories/Colimits/CoeqUnivProp.v

+1-4
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,7 @@ Section UnivPropNat.
128128

129129
(** Help Coq find the same graph structure for the sigma-groupoid of [Coeq_ind_data] when precomposing with [functor_coeq]. *)
130130
Local Instance isgraph_Coeq_ind_data_total
131-
: IsGraph (sig (Coeq_ind_data f g (P o functor_coeq h k p q))).
132-
Proof.
133-
rapply isgraph_total.
134-
Defined.
131+
: IsGraph (sig (Coeq_ind_data f g (P o functor_coeq h k p q))) := isgraph_total _.
135132

136133
(** Given a map out of [A'] that coequalizes the parallel pair [f'] and [g'], we construct a map out of [A] that coequalizes [f] and [g]. Precomposing with [k] yields a dependent map [forall a : A, P (coeq (k a))], and [functor_coeq_beta_cglue] gives us a way to relate the paths. *)
137134
Definition functor_Coeq_ind_data

theories/Colimits/Colimit_Flattening.v

-1
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,6 @@ Section Flattening.
226226
srapply colimit_unicity.
227227
3: apply iscolimit_colimit.
228228
rapply Build_IsColimit.
229-
apply unicocone_cocone_E'.
230229
Defined.
231230

232231
End Flattening.

theories/Colimits/Sequential.v

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ Proof.
4242
intros n.
4343
exact (const (a n.+1)). }
4444
rapply contr_equiv'.
45-
1: rapply equiv_functor_colimit.
46-
1: rapply (equiv_sequence B A).
45+
2: rapply equiv_functor_colimit.
46+
2: rapply (equiv_sequence B A).
4747
1: reflexivity.
4848
{ intros n e.
4949
exists equiv_idmap.

theories/Extensions.v

+3-3
Original file line numberDiff line numberDiff line change
@@ -719,9 +719,9 @@ Proof.
719719
ExtendableAlong 1 cyl (fun x:Cyl h => DPath C' (cglue x) (u x) (v x))).
720720
{ intros u v.
721721
rapply extendable_postcompose'.
722-
2:{ rapply (cancelL_extendable 1 _ cyl pr_cyl).
723-
- rapply extendable_equiv.
724-
- exact (eh (fun x => cglue x # u (cyr x)) (v o cyr)). }
722+
3:{ rapply (cancelL_extendable 1 _ cyl pr_cyl).
723+
2: rapply extendable_equiv.
724+
2: exact (eh (fun x => cglue x # u (cyr x)) (v o cyr)). }
725725
intros x; subst C'.
726726
refine ((dp_compose (pr_cylcoeq p q) C _)^-1 oE _).
727727
symmetry; srapply equiv_ds_fill_lr.

theories/HFiber.v

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ Definition hfiber_functor_hfiber {A B C D}
126126
: hfiber (functor_hfiber p b) (c;q)
127127
<~> hfiber (functor_hfiber (fun x => (p x)^) c) (b;q^).
128128
Proof.
129-
rapply (equiv_functor_sigma_id _ oE _ oE (equiv_functor_sigma_id _)^-1).
129+
refine (equiv_functor_sigma_id _ oE _ oE (equiv_functor_sigma_id _)^-1).
130130
1,3:intros; rapply equiv_path_sigma.
131131
refine (equiv_sigma_assoc _ _ oE _ oE (equiv_sigma_assoc _ _)^-1).
132132
apply equiv_functor_sigma_id; intros a; cbn.

theories/Homotopy/BlakersMassey.v

+1-1
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ Now we claim that the left-hand map of this span is also an equivalence. Rather
266266
etransitivity.
267267
2:{ rapply equiv_functor_sigma_id; intros s.
268268
(** Here's frobnicate showing up again! *)
269-
apply frobnicate. }
269+
2: apply frobnicate. }
270270
make_equiv.
271271
Defined.
272272

theories/Homotopy/ClassifyingSpace.v

+5-5
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ Section Eliminators.
9696
intros x y.
9797
apply ds_const'.
9898
rapply sq_GGcc.
99-
2: refine (_ @ ap _ (dp_const_pp _ _)).
100-
1,2: symmetry; apply eissect.
99+
4: refine (_ @ ap _ (dp_const_pp _ _)).
100+
3, 4: symmetry; apply eissect.
101101
by apply sq_G1.
102102
Defined.
103103

@@ -479,7 +479,7 @@ Proof.
479479
intro x.
480480
rapply equiv_sq_dp^-1.
481481
simpl.
482-
rapply sq_ccGG.
482+
refine (sq_ccGG _ _ _).
483483
1,2: symmetry.
484484
2: refine (ap_compose (ClassifyingSpace_rec _ _ _ (fun x y =>
485485
ap bloop (grp_homo_op g x y) @ bloop_pp (g x) (g y))) _ (bloop x)
@@ -510,7 +510,7 @@ Proof.
510510
rapply equiv_sq_dp^-1.
511511
rewrite ClassifyingSpace_rec_beta_bloop.
512512
simpl.
513-
rapply sq_ccGc.
513+
refine (sq_ccGc _ _).
514514
1: symmetry; rapply decode_encode.
515515
apply equiv_sq_path.
516516
rewrite concat_pp_p.
@@ -566,7 +566,7 @@ Proof.
566566
snrapply (cancelR_isequiv bloop).
567567
1: exact _.
568568
rapply isequiv_homotopic'; symmetry.
569-
nrapply pClassifyingSpace_rec_beta_bloop.
569+
2: nrapply pClassifyingSpace_rec_beta_bloop.
570570
Defined.
571571

572572
Lemma natequiv_bg_pi1_adjoint `{Univalence} (X : pType) `{IsConnected 0 X}

theories/Homotopy/ExactSequence.v

+2-4
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,6 @@ Global Instance ishprop_isexact_hset `{Univalence} {F X Y : pType} `{IsHSet Y}
151151
: IsHProp (IsExact n i f).
152152
Proof.
153153
rapply (transport (fun A => IsHProp A) (x := { cx : IsComplex i f & IsConnMap n (cxfib cx) })).
154-
2: exact _.
155154
apply path_universe_uncurried; issig.
156155
Defined.
157156

@@ -288,7 +287,6 @@ Global Instance isequiv_cxfib {O : Modality} {F X Y : pType} {i : F ->* X} {f :
288287
: IsEquiv (cxfib cx_isexact).
289288
Proof.
290289
rapply isequiv_conn_ino_map.
291-
1: apply ex.
292290
rapply (cancelL_mapinO _ _ pr1).
293291
Defined.
294292

@@ -302,7 +300,7 @@ Proposition equiv_cxfib_beta {F X Y : pType} {i : F ->* X} {f : X ->* Y}
302300
: i o pequiv_inverse (equiv_cxfib ex) == pfib _.
303301
Proof.
304302
rapply equiv_ind.
305-
1: exact (isequiv_cxfib ex).
303+
3: exact (isequiv_cxfib ex).
306304
intro x.
307305
exact (ap (fun g => i g) (eissect _ x)).
308306
Defined.
@@ -555,7 +553,7 @@ Definition classify_fiberseq `{Univalence} {Y F : pType@{u}}
555553
Proof.
556554
refine (_ oE _).
557555
(** To apply [equiv_sigma_pfibration] we need to invert the equivalence on the fiber. *)
558-
{ do 2 (rapply equiv_functor_sigma_id; intro).
556+
{ do 2 (refine (equiv_functor_sigma_id _); intro).
559557
apply equiv_pequiv_inverse. }
560558
exact ((equiv_sigma_assoc _ _)^-1 oE equiv_sigma_pfibration).
561559
Defined.

theories/Homotopy/IdentitySystems.v

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ Definition contr_sigma_equiv_path {A : Type} {a0 : A}
7676
: Contr (sig R).
7777
Proof.
7878
rapply contr_equiv'.
79-
1: exact (equiv_functor_sigma_id f).
79+
2: exact (equiv_functor_sigma_id f).
8080
apply contr_basedpaths.
8181
Defined.
8282

theories/Limits/Pullback.v

+3-3
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ Proof.
187187
unfold IsPullback.
188188
apply isequiv_contr_map; intro x.
189189
rapply contr_equiv'.
190-
- symmetry; apply hfiber_pullback_corec.
190+
2: symmetry; apply hfiber_pullback_corec.
191191
- exact _.
192192
Defined.
193193

@@ -417,11 +417,11 @@ Section Pullback3x3.
417417
Theorem pullback3x3 : Pullback fX1 fX3 <~> Pullback f1X f3X.
418418
Proof.
419419
refine (_ oE _ oE _).
420-
1,3:do 2 (rapply equiv_functor_sigma_id; intro).
420+
1,3:do 2 (refine (equiv_functor_sigma_id _); intro).
421421
1:apply equiv_path_pullback.
422422
1:symmetry; apply equiv_path_pullback.
423423
refine (_ oE _).
424-
{ do 4 (rapply equiv_functor_sigma_id; intro).
424+
{ do 4 (refine (equiv_functor_sigma_id _); intro).
425425
refine (sq_tr oE _).
426426
refine (sq_move_14^-1 oE _).
427427
refine (sq_move_31 oE _).

0 commit comments

Comments
 (0)