Skip to content

Commit 4db4b98

Browse files
committed
chore(Tactic): document remaining undocumented tactics
Write documentation for the few tactics in Mathlib that have no documentation at all. After this PR and a few related ones are merged, every tactic defined in Mathlib should now have a docstring or a `@[tactic_alt]` attribute. The documentation for `mem_tac` is pending a Zulip discussion: https://leanprover.zulipchat.com/#narrow/channel/287929-mathlib4/topic/Proj.20as.20a.20scheme.3A.20.60mem_tac.60.20works.20accidentally.3F/with/563193768
1 parent 31c0612 commit 4db4b98

2 files changed

Lines changed: 28 additions & 0 deletions

File tree

Mathlib/Tactic/Conv.lean

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,33 @@ public meta section
1818
namespace Mathlib.Tactic.Conv
1919
open Lean Parser.Tactic Parser.Tactic.Conv Elab.Tactic Meta
2020

21+
/--
22+
`conv_lhs => cs` runs the `conv` tactic sequence `cs` on the left hand side of the target.
23+
24+
In general, for an `n`-ary operator as the target, it traverses into the second to last argument.
25+
It is a synonym for `conv => arg -2; cs`.
26+
27+
* `conv_lhs at h => cs` runs `cs` on the left hand side of hypothesis `h`.
28+
* `conv_lhs in pat => cs` first looks for a subexpression matching `pat` (see also the `pattern`
29+
conv tactic) and then traverses into the left hand side of this subexpression.
30+
This syntax also supports the `occs` clause for the pattern.
31+
-/
2132
syntax (name := convLHS) "conv_lhs" (" at " ident)? (" in " (occs)? term)? " => " convSeq : tactic
2233
macro_rules
2334
| `(tactic| conv_lhs $[at $id]? $[in $[$occs]? $pat]? => $seq) =>
2435
`(tactic| conv $[at $id]? $[in $[$occs]? $pat]? => lhs; ($seq:convSeq))
2536

37+
/--
38+
`conv_rhs => cs` runs the `conv` tactic sequence `cs` on the right hand side of the target.
39+
40+
In general, for an `n`-ary operator as the target, it traverses into the second to last argument.
41+
It is a synonym for `conv => arg -2; cs`.
42+
43+
* `conv_lhs at h => cs` runs `cs` on the right hand side of hypothesis `h`.
44+
* `conv_lhs in pat => cs` first looks for a subexpression matching `pat` (see the `pattern`
45+
conv tactic) and then traverses into the right hand side of this subexpression.
46+
This syntax also supports the `occs` clause for the pattern.
47+
-/
2648
syntax (name := convRHS) "conv_rhs" (" at " ident)? (" in " (occs)? term)? " => " convSeq : tactic
2749
macro_rules
2850
| `(tactic| conv_rhs $[at $id]? $[in $[$occs]? $pat]? => $seq) =>

Mathlib/Tactic/GCongr/Core.lean

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,12 @@ initialize registerBuiltinAttribute {
346346

347347
initialize registerTraceClass `Meta.gcongr
348348

349+
/-- `gcongr_discharger` is used by `gconger` to discharge side goals.
350+
351+
This is an extensible tactic using [`macro_rules`](lean-manual://section/tactic-macro-extension).
352+
By default it calls `positivity` (after importing the `positivity` tactic).
353+
Example: ``macro_rules | `(tactic| gcongr_discharger) => `(tactic| positivity)``.
354+
-/
349355
syntax "gcongr_discharger" : tactic
350356

351357
/--

0 commit comments

Comments
 (0)