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 _ _ _). *)
323
+
(** TODO: Find a nicer implementation of this tactic. *)
322
324
TacticNotation "rapply" uconstr(term)
323
325
:= do_with_holes ltac:(fun x => try (try (nrefine x || fail 2); fail); refine x) term.
324
326
TacticNotation "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.
326
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. *)
327
330
TacticNotation "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.
329
332
TacticNotation "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.
:= do_with_holes' ltac:(fun x => snrefine x) term.
341
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. *)
346
+
TacticNotation "tapply" uconstr(term)
347
+
:= do_with_holes ltac:(fun x => refine x) term.
348
+
TacticNotation "tapply'" uconstr(term)
349
+
:= do_with_holes' ltac:(fun x => refine x) term.
350
+
342
351
(** 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
+3-3
Original file line number
Diff line number
Diff line change
@@ -149,13 +149,13 @@ Global Instance cds_susp_cdi {A} `(CayleyDicksonImaginaroid A)
149
149
GlobalInstance cdi_conjugate_susp_left_inverse {A} `(CayleyDicksonImaginaroid A)
150
150
: LeftInverse hspace_op (conjugate_susp A cdi_negate) mon_unit.
151
151
Proof.
152
-
srapply cds_conjug_left_inv.
152
+
exact cds_conjug_left_inv.
153
153
Defined.
154
154
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
-
srapply cds_conjug_right_inv.
158
+
exact (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
-
srapply cds_factorneg_l.
172
+
exact (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