You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(** 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 _ _ _). *)
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
323
(** TODO: Find a nicer implementation of this tactic. *)
324
324
TacticNotation "rapply" uconstr(term)
325
325
:= do_with_holes ltac:(fun x => try (try (nrefine x || fail 2); fail); refine x) term.
326
326
TacticNotation "rapply'" uconstr(term)
327
327
:= do_with_holes' ltac:(fun x => try (try (nrefine x || fail 2); fail); refine x) term.
328
328
329
-
(** See comment for rapply. This cannot be simplified to snrefine x because we don't want the global_axiom tactic to run here. *)
329
+
(** See comment for [rapply]. This cannot be simplified to [snrefine x] because we don't want the [global_axiom] tactic to run here. *)
330
330
TacticNotation "srapply" uconstr(term)
331
331
:= do_with_holes ltac:(fun x => try (try (simple notypeclasses refine x || fail 2); fail); srefine x) term.
:= do_with_holes' ltac:(fun x => snrefine x) term.
344
344
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. *)
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
346
TacticNotation "tapply" uconstr(term)
347
347
:= do_with_holes ltac:(fun x => refine x) term.
348
348
TacticNotation "tapply'" uconstr(term)
349
349
:= do_with_holes' ltac:(fun x => refine x) term.
350
350
351
+
TacticNotation "stapply" uconstr(term)
352
+
:= do_with_holes ltac:(fun x => srefine x) term.
353
+
TacticNotation "stapply'" uconstr(term)
354
+
:= do_with_holes' ltac:(fun x => srefine x) term.
355
+
351
356
(** Apply a tactic to one side of an equation. For example, [lhs rapply lemma]. [tac] should produce a path. *)
Copy file name to clipboardExpand all lines: theories/Homotopy/CayleyDickson.v
+2-2
Original file line number
Diff line number
Diff line change
@@ -155,7 +155,7 @@ Defined.
155
155
GlobalInstance cdi_conjugate_susp_right_inverse {A} `(CayleyDicksonImaginaroid A)
156
156
: RightInverse hspace_op (conjugate_susp A cdi_negate) mon_unit.
157
157
Proof.
158
-
exact (cds_conjug_right_inv _).
158
+
stapply cds_conjug_right_inv.
159
159
Defined.
160
160
161
161
GlobalInstance cdi_susp_left_identity {A} `(CayleyDicksonImaginaroid A)
@@ -169,7 +169,7 @@ Global Instance cdi_susp_right_identity {A} `(CayleyDicksonImaginaroid A)
169
169
GlobalInstance cdi_negate_susp_factornegleft {A} `(CayleyDicksonImaginaroid A)
170
170
: FactorNegLeft (negate_susp A cdi_negate) hspace_op.
171
171
Proof.
172
-
exact (cds_factorneg_l _).
172
+
stapply cds_factorneg_l.
173
173
Defined.
174
174
175
175
(** 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. *)
0 commit comments