11# Commands
22
3- Mathlib version: ` 5b4465844e3feb231af0edb5ef1ab8e2523b08a7 `
3+ Mathlib version: ` 6a54a80825b060ab20dc31751ebdce78b3a3b518 `
44
55## \# adaptation_note
66Defined in: ` adaptationNoteCmd `
@@ -407,6 +407,79 @@ The optional trailing `approx`, as in `#find_syntax "∘" approx`, is only inten
407407more stable: rather than outputting the exact count of the overall number of existing syntax
408408declarations, it returns its round-down to the previous multiple of 100.
409409
410+ ## \#grind_lint
411+ Defined in: `Lean.Grind.grindLintSkip`
412+
413+ `#grind_lint skip thm₁ …` marks the given theorem(s) to be skipped entirely by `#grind_lint check`.
414+ Skipped theorems are neither analyzed nor reported, but may still be used for
415+ instantiation when analyzing other theorems.
416+ Example:
417+ ```lean
418+ #grind_lint skip Array.range_succ
419+ ```
420+
421+ ## \# grind_lint
422+ Defined in: ` Lean.Grind.grindLintMute `
423+
424+ ` #grind_lint mute thm₁ … ` marks the given theorem(s) as * muted* during linting.
425+
426+ Muted theorems remain in the environment but are not instantiated when running
427+ ` #grind_lint check ` or ` #grind_lint inspect ` .
428+ This is useful for suppressing noisy or recursive lemmas that cause excessive
429+ E-matching without removing their annotations.
430+
431+ Example:
432+ ``` lean
433+ #grind_lint mute Array.zip_map Int.zero_shiftRight
434+ ```
435+
436+ ## \# grind_lint
437+ Defined in: ` Lean.Grind.grindLintInspect `
438+
439+ ` #grind_lint inspect thm₁ … ` analyzes the specified theorem(s) individually.
440+
441+ It always prints detailed statistics regardless of thresholds and is useful
442+ for investigating specific ` grind ` lemmas that may generate excessive
443+ instantiations.
444+ Examples:
445+ ``` lean
446+ #grind_lint inspect Array.zip_map
447+ ```
448+ You can use ` set_option trace.grind.ematch.instance true ` to instruct ` grind ` to display the
449+ actual instances it produces.
450+
451+ ## \# grind_lint
452+ Defined in: ` Lean.Grind.grindLintCheck `
453+
454+ ` #grind_lint check ` analyzes all theorems annotated for theorem instantiation using E-matching.
455+
456+ It creates artificial goals and reports the number of instances each theorem produces.
457+ The command helps detect long or unbounded theorem instantiation chains.
458+
459+ Usage examples:
460+ ``` lean
461+ #grind_lint check
462+ #grind_lint check (min:=10) (detailed:=50)
463+ #grind_lint check in Foo Bar -- restrict analysis to these namespaces
464+ #grind_lint check in module Foo -- restrict analysis to theorems defined in module `Foo` or any of its submodules
465+ ```
466+
467+ Options can include any valid ` grind ` configuration option, and ` min ` and ` detailed ` .
468+ - ` min ` : minimum number of instantiations to print a summary (default: 10)
469+ - ` detailed ` : minimum number of instantiations to print detailed breakdown (default: 50)
470+ If the option ` trace.grind.* ` is enabled, additional details are printed.
471+
472+ By default, ` #grind_lint ` uses the following ` grind ` configuration:
473+ ``` lean
474+ splits := 0
475+ lookahead := false
476+ mbtc := false
477+ ematch := 20
478+ instances := 100
479+ gen := 10
480+ ```
481+ Consider using ` #grind_lint inspect <thm> ` to focus on specific theorems.
482+
410483## \# guard
411484Defined in: ` Lean.Parser.Command.guardCmd `
412485
@@ -1527,6 +1600,10 @@ Defined in: `Lean.Elab.Tactic.commandConfigElab`
15271600Defined in: ` Lean.Elab.Tactic.configElab `
15281601
15291602
1603+ ## declare_config_getter
1604+ Defined in: ` Lean.Elab.elabConfigGetter `
1605+
1606+
15301607## declare_int_theorems
15311608Defined in: ` commandDeclare_int_theorems__ `
15321609
@@ -2310,6 +2387,14 @@ Registers a tactic tag, saving its user-facing name and docstring.
23102387
23112388Tactic tags can be used by documentation generation tools to classify related tactics.
23122389
2390+ ## register_try?_ tactic
2391+ Defined in: ` Lean.Parser.Command.registerTryTactic `
2392+
2393+ ` register_try?_tactic tac ` registers a tactic ` tac ` as a suggestion generator for the ` try? ` tactic.
2394+
2395+ An optional priority can be specified with ` register_try?_tactic (priority := 500) tac ` .
2396+ Higher priority generators are tried first. The default priority is 1000.
2397+
23132398## reprove
23142399Defined in: ` Lean.Elab.Command.reprove `
23152400
@@ -2379,6 +2464,13 @@ commands. Sections can be nested. `section <id>` provides a label to the section
23792464with the matching ` end ` . In either case, the ` end ` can be omitted, in which case the section is
23802465closed at the end of the file.
23812466
2467+ ## set_library_suggestions
2468+ Defined in: ` Lean.setLibrarySuggestionsCmd `
2469+
2470+ Specify a library suggestion engine.
2471+ Note that Lean does not ship a default library suggestion engine,
2472+ so this is only useful in conjunction with a downstream package which provides one.
2473+
23822474## set_option
23832475Defined in: ` Lean.Parser.Command.set_option `
23842476
@@ -2396,13 +2488,6 @@ set_option pp.all true in
23962488Similarly, ` set_option <id> <value> in ` can also be used inside terms and tactics to set an option
23972489only in a single term or tactic.
23982490
2399- ## set_premise_selector
2400- Defined in: ` Lean.setPremiseSelectorCmd `
2401-
2402- Specify a premise selection engine.
2403- Note that Lean does not ship a default premise selection engine,
2404- so this is only useful in conjunction with a downstream package which provides one.
2405-
24062491## show_panel_widgets
24072492Defined in: ` Lean.Widget.showPanelWidgetsCmd `
24082493
0 commit comments