Skip to content

Commit 9c3e874

Browse files
author
Patrick Nicodemus
committed
Changed other tactics.
1 parent 00702bf commit 9c3e874

File tree

7 files changed

+22
-13
lines changed

7 files changed

+22
-13
lines changed

theories/Algebra/AbGroups/AbHom.v

+2-2
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,10 @@ Proof.
150150
- exact (functor_ab_coeq a^-1$ b^-1$ (hinverse _ _ p) (hinverse _ _ q)).
151151
- nrefine (functor_ab_coeq_compose _ _ _ _ _ _ _ _
152152
$@ functor2_ab_coeq _ _ _ _ _ $@ functor_ab_coeq_id _ _).
153-
exact (cate_isretr _).
153+
exact (cate_isretr _).
154154
- nrefine (functor_ab_coeq_compose _ _ _ _ _ _ _ _
155155
$@ functor2_ab_coeq _ _ _ _ _ $@ functor_ab_coeq_id _ _).
156-
exact (cate_issect _).
156+
exact (cate_issect _).
157157
Defined.
158158

159159
(** ** The bifunctor [ab_hom] *)

theories/Algebra/AbGroups/TensorProduct.v

+1-1
Original file line numberDiff line numberDiff line change
@@ -811,7 +811,7 @@ Definition ab_tensor_prod_dist_l {A B C : AbGroup}
811811
: ab_tensor_prod A (ab_biprod B C)
812812
$<~> ab_biprod (ab_tensor_prod A B) (ab_tensor_prod A C).
813813
Proof.
814-
srapply (let f := _ in let g := _ in cate_adjointify f g _ _).
814+
srapply (let f := _ in let g := _ in cate_adjointify (A:=AbGroup) f g _ _).
815815
- snrapply ab_tensor_prod_rec.
816816
+ intros a bc.
817817
exact (tensor a (fst bc), tensor a (snd bc)).

theories/Algebra/AbSES/Core.v

+1-1
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,7 @@ Lemma abses_kernel_iso `{Funext} {A E B : AbGroup} (i : A $-> E) (p : E $-> B)
686686
Proof.
687687
snrapply Build_GroupIsomorphism.
688688
- apply (grp_kernel_corec i).
689-
refine cx_isexact.
689+
exact cx_isexact.
690690
- apply isequiv_surj_emb.
691691
2: refine (cancelL_mapinO _ (grp_kernel_corec _ _) _ _ _).
692692
intros [y q].

theories/Basics/Tactics.v

+12-3
Original file line numberDiff line numberDiff line change
@@ -319,15 +319,18 @@ Tactic Notation "nrefine" uconstr(term) := notypeclasses refine term; global_axi
319319
Tactic Notation "snrefine" uconstr(term) := simple notypeclasses refine term; global_axiom.
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. *)
322+
(** This tactic is weaker than tapply, and equivalent in strength to nrapply, i.e., it should succeed iff nrapply succeeds, but it solves all possible typeclasses afterward. The implementation is: try nrefine t, t _, t _ _, ... until success; upon success, revert the last (successful) application of nrefine and call refine (t _ _ _). *)
323+
(** TODO: Find a nicer implementation of this tactic. *)
322324
Tactic Notation "rapply" uconstr(term)
323325
:= do_with_holes ltac:(fun x => try (try (nrefine x || fail 2); fail); refine x) term.
324326
Tactic Notation "rapply'" uconstr(term)
325-
:= do_with_holes' ltac:(fun x => refine x) term.
327+
:= do_with_holes' ltac:(fun x => try (try (nrefine x || fail 2); fail); refine x) term.
326328

329+
(** See comment for rapply. This cannot be simplified to snrefine x because we don't want the global_axiom tactic to run here. *)
327330
Tactic Notation "srapply" uconstr(term)
328-
:= do_with_holes ltac:(fun x => srefine x) term.
331+
:= do_with_holes ltac:(fun x => try (try (simple notypeclasses refine x || fail 2); fail); srefine x) term.
329332
Tactic Notation "srapply'" uconstr(term)
330-
:= do_with_holes' ltac:(fun x => srefine x) term.
333+
:= do_with_holes' ltac:(fun x => try (try (simple notypeclasses refine x || fail 2); fail); srefine x) term.
331334

332335
Tactic Notation "nrapply" uconstr(term)
333336
:= do_with_holes ltac:(fun x => nrefine x) term.
@@ -339,6 +342,12 @@ Tactic Notation "snrapply" uconstr(term)
339342
Tactic Notation "snrapply'" uconstr(term)
340343
:= do_with_holes' ltac:(fun x => snrefine x) term.
341344

345+
(** This tactic is strictly stronger than rapply, because if the type of the argument term t (with holes) cannot be unified with the goal type, it calls typeclass search on all typeclass holes within t (independently of the goal) and then tries to unify with the goal again. Our implementation of rapply requires that the type (with holes) of the argument term unifies with the goal directly, without any help from typeclass search to fill in the holes in the type. The typeclass search after unification is more robust than the typeclass search before unification, because there is more information available to guide the typeclass search. *)
346+
Tactic Notation "tapply" uconstr(term)
347+
:= do_with_holes ltac:(fun x => refine x) term.
348+
Tactic Notation "tapply'" uconstr(term)
349+
:= do_with_holes' ltac:(fun x => refine x) term.
350+
342351
(** Apply a tactic to one side of an equation. For example, [lhs rapply lemma]. [tac] should produce a path. *)
343352

344353
Tactic Notation "lhs" tactic3(tac) := nrefine (ltac:(tac) @ _).

theories/Homotopy/CayleyDickson.v

+3-3
Original file line numberDiff line numberDiff line change
@@ -149,13 +149,13 @@ Global Instance cds_susp_cdi {A} `(CayleyDicksonImaginaroid A)
149149
Global Instance cdi_conjugate_susp_left_inverse {A} `(CayleyDicksonImaginaroid A)
150150
: LeftInverse hspace_op (conjugate_susp A cdi_negate) mon_unit.
151151
Proof.
152-
srapply cds_conjug_left_inv.
152+
exact cds_conjug_left_inv.
153153
Defined.
154154

155155
Global Instance cdi_conjugate_susp_right_inverse {A} `(CayleyDicksonImaginaroid A)
156156
: RightInverse hspace_op (conjugate_susp A cdi_negate) mon_unit.
157157
Proof.
158-
srapply cds_conjug_right_inv.
158+
exact (cds_conjug_right_inv _).
159159
Defined.
160160

161161
Global Instance cdi_susp_left_identity {A} `(CayleyDicksonImaginaroid A)
@@ -169,7 +169,7 @@ Global Instance cdi_susp_right_identity {A} `(CayleyDicksonImaginaroid A)
169169
Global Instance cdi_negate_susp_factornegleft {A} `(CayleyDicksonImaginaroid A)
170170
: FactorNegLeft (negate_susp A cdi_negate) hspace_op.
171171
Proof.
172-
srapply cds_factorneg_l.
172+
exact (cds_factorneg_l _).
173173
Defined.
174174

175175
(** A Cayley-Dickson imaginaroid [A] whose multiplciation on the suspension is associative gives rise to an H-space structure on the join of the suspension of [A] with itself. *)

theories/Pointed/Core.v

+2-2
Original file line numberDiff line numberDiff line change
@@ -994,8 +994,8 @@ Defined.
994994
(** pType has equivalences *)
995995
Global Instance hasequivs_ptype : HasEquivs pType.
996996
Proof.
997-
srapply (
998-
Build_HasEquivs _ _ _ _ _ pEquiv (fun A B f => IsEquiv f));
997+
snrapply (
998+
Build_HasEquivs _ isgraph_ptype _ _ _ pEquiv (fun A B f => IsEquiv f));
999999
intros A B f; cbn; intros.
10001000
- exact f.
10011001
- exact _.

theories/WildCat/ZeroGroupoid.v

+1-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ Definition isequiv_0gpd_issurjinj {G H : ZeroGpd} (F : G $-> H)
129129
: Cat_IsBiInv F.
130130
Proof.
131131
destruct e as [e0 e1]; unfold SplEssSurj in e0.
132-
srapply catie_adjointify.
132+
srapply (catie_adjointify (H0:=hasequivs_0gpd)).
133133
- snrapply Build_Morphism_0Gpd.
134134
1: exact (fun y => (e0 y).1).
135135
snrapply Build_Is0Functor; cbn beta.

0 commit comments

Comments
 (0)