@@ -10,7 +10,7 @@ import Mathlib.Lean.LocalContext
10
10
import Mathlib.Tactic.Relation.Symm
11
11
import Mathlib.Control.Basic
12
12
import Mathlib.Data.Sum.Basic
13
- import Mathlib.Tactic.TagAttr
13
+ import Mathlib.Tactic.LabelAttr
14
14
15
15
/-!
16
16
A work-in-progress replacement for Lean3's `solve_by_elim` tactic.
@@ -294,7 +294,7 @@ def _root_.Lean.MVarId.applyRules (cfg : Config) (lemmas : List Expr) (only : Bo
294
294
solveByElim { cfg.noBackTracking with failAtMaxDepth := false } lemmas ctx [g]
295
295
296
296
open Lean.Parser.Tactic
297
- open Mathlib.Tactic.TagAttr
297
+ open Mathlib.Tactic.LabelAttr
298
298
299
299
/--
300
300
`mkAssumptionSet` builds a collection of lemmas for use in
@@ -351,12 +351,12 @@ def mkAssumptionSet (noDefaults star : Bool) (add remove : List Term) (use : Arr
351
351
352
352
let defaults : List (TermElabM Expr) :=
353
353
[← `(rfl), ← `(trivial), ← `(congrFun), ← `(congrArg)].map elab'
354
- let taggedLemmas := (← use.mapM (tagged ·.raw.getId)).flatten.toList
354
+ let labelledLemmas := (← use.mapM (labelled ·.raw.getId)).flatten.toList
355
355
|>.map (liftM <| mkConstWithFreshMVarLevels ·)
356
356
let lemmas := if noDefaults then
357
- add.map elab' ++ taggedLemmas
357
+ add.map elab' ++ labelledLemmas
358
358
else
359
- add.map elab' ++ taggedLemmas ++ defaults
359
+ add.map elab' ++ labelledLemmas ++ defaults
360
360
361
361
if !remove.isEmpty && noDefaults && !star then
362
362
throwError "It doesn't make sense to remove local hypotheses when using `only` without `*`."
@@ -378,7 +378,7 @@ syntax star := "*"
378
378
syntax arg := star <|> erase <|> term
379
379
/-- Syntax for adding and removing terms in `solve_by_elim`. -/
380
380
syntax args := " [" SolveByElim.arg,* "] "
381
- /-- Syntax for using all lemmas tagged with an attribute in `solve_by_elim`. -/
381
+ /-- Syntax for using all lemmas labelled with an attribute in `solve_by_elim`. -/
382
382
syntax using_ := " using " ident,*
383
383
384
384
open Syntax
@@ -431,8 +431,8 @@ The assumptions can be modified with similar syntax as for `simp`:
431
431
* `solve_by_elim only [h₁, h₂, ..., hᵣ]` does not include the local context,
432
432
`rfl`, `trivial`, `congrFun`, or `congrArg` unless they are explicitly included.
433
433
* `solve_by_elim [-h₁, ... -hₙ]` removes the given local hypotheses.
434
- * `solve_by_elim using [a₁, ...]` uses all lemmas which have been tagged
435
- with the attributes `aᵢ` (these attributes must be created using `register_tag_attr `).
434
+ * `solve_by_elim using [a₁, ...]` uses all lemmas which have been labelled
435
+ with the attributes `aᵢ` (these attributes must be created using `register_label_attr `).
436
436
437
437
`solve_by_elim*` tries to solve all goals together, using backtracking if a solution for one goal
438
438
makes other goals impossible.
@@ -484,8 +484,8 @@ You can specify additional rules to apply using `apply_assumption [...]`.
484
484
By default `apply_assumption` will also try `rfl`, `trivial`, `congrFun`, and `congrArg`.
485
485
If you don't want these, or don't want to use all hypotheses, use `apply_assumption only [...]`.
486
486
You can use `apply_assumption [-h]` to omit a local hypothesis.
487
- You can use `apply_assumption using [a₁, ...]` to use all lemmas which have been tagged
488
- with the attributes `aᵢ` (these attributes must be created using `register_tag_attr `).
487
+ You can use `apply_assumption using [a₁, ...]` to use all lemmas which have been labelled
488
+ with the attributes `aᵢ` (these attributes must be created using `register_label_attr `).
489
489
490
490
`apply_assumption` will use consequences of local hypotheses obtained via `symm`.
491
491
@@ -518,8 +518,8 @@ You can use `apply_rules [-h]` to omit a local hypothesis.
518
518
`apply_rules` will also use `rfl`, `trivial`, `congrFun` and `congrArg`.
519
519
These can be disabled, as can local hypotheses, by using `apply_rules only [...]`.
520
520
521
- You can use `apply_rules using [a₁, ...]` to use all lemmas which have been tagged
522
- with the attributes `aᵢ` (these attributes must be created using `register_tag_attr `).
521
+ You can use `apply_rules using [a₁, ...]` to use all lemmas which have been labelled
522
+ with the attributes `aᵢ` (these attributes must be created using `register_label_attr `).
523
523
524
524
You can pass a further configuration via the syntax `apply_rules (config := {...})`.
525
525
The options supported are the same as for `solve_by_elim` (and include all the options for `apply`).
0 commit comments