Skip to content

Commit e383477

Browse files
authored
Merge pull request #547 from Seasawher/auto-update-branch
2 parents 31c80ae + 8ba7fe9 commit e383477

File tree

5 files changed

+147
-17
lines changed

5 files changed

+147
-17
lines changed

docs/attributes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Attributes
22

3-
Mathlib version: `14bfbad331fcd848aa37830a3fb4103af552de12`
3+
Mathlib version: `c0952c46eb2fda6a7909a689a8a371ed38503611`
44

55
## Std.Internal.tree_tac
66
simp theorems used by internal DTreeMap lemmas

docs/commands.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Commands
22

3-
Mathlib version: `14bfbad331fcd848aa37830a3fb4103af552de12`
3+
Mathlib version: `c0952c46eb2fda6a7909a689a8a371ed38503611`
44

55
## \#adaptation_note
66
Defined in: `adaptationNoteCmd`
@@ -376,6 +376,16 @@ have global scope anyway so detailed tracking is not necessary.)
376376
## \#find
377377
Defined in: `Mathlib.Tactic.Find.«command#find_»`
378378
379+
The `#find` command finds definitions & lemmas using pattern matching on the type. For instance:
380+
```lean
381+
#find _ + _ = _ + _
382+
#find ?n + _ = _ + ?n
383+
#find (_ : Nat) + _ = _ + _
384+
#find Nat → Nat
385+
```
386+
Inside tactic proofs, the `#find` tactic can be used instead.
387+
There is also the `find` tactic which looks for
388+
lemmas which are `apply`able against the current goal.
379389

380390
## \#find_home
381391
Defined in: `«command#find_home!_»`

docs/options.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Options
22

3-
Mathlib version: `14bfbad331fcd848aa37830a3fb4103af552de12`
3+
Mathlib version: `c0952c46eb2fda6a7909a689a8a371ed38503611`
44

55
## Elab.async
66
type: `Bool`

docs/tactics.md

Lines changed: 132 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Tactics
22

3-
Mathlib version: `14bfbad331fcd848aa37830a3fb4103af552de12`
3+
Mathlib version: `c0952c46eb2fda6a7909a689a8a371ed38503611`
44

55
## \#adaptation_note
66
Defined in: `«tactic#adaptation_note_»`
@@ -1129,6 +1129,20 @@ Create a `calc` proof.
11291129
## cancel_denoms
11301130
Defined in: `tacticCancel_denoms_`
11311131

1132+
`cancel_denoms` attempts to remove numerals from the denominators of fractions.
1133+
It works on propositions that are field-valued inequalities.
1134+
1135+
```lean
1136+
variable [LinearOrderedField α] (a b c : α)
1137+
1138+
example (h : a / 5 + b / 4 < c) : 4*a + 5*b < 20*c := by
1139+
cancel_denoms at h
1140+
exact h
1141+
1142+
example (h : a > 0) : a / 5 > 0 := by
1143+
cancel_denoms
1144+
exact h
1145+
```
11321146

11331147
## cancel_denoms
11341148
Defined in: `cancelDenoms`
@@ -2214,14 +2228,6 @@ Defined in: `tacticEconstructor`
22142228
(it calls `apply` using the first matching constructor of an inductive datatype)
22152229
except only non-dependent premises are added as new goals.
22162230

2217-
## elementwise
2218-
Defined in: `Tactic.Elementwise.tacticElementwise___`
2219-
2220-
2221-
## elementwise!
2222-
Defined in: `Tactic.Elementwise.tacticElementwise!___`
2223-
2224-
22252231
## else
22262232
Defined in: `Lean.Parser.Tactic.tacDepIfThenElse`
22272233

@@ -2592,6 +2598,14 @@ Note that this involves a lot of case splitting, so may be slow.
25922598
## find
25932599
Defined in: `Mathlib.Tactic.Find.tacticFind`
25942600

2601+
Display theorems (and definitions) whose result type matches the current goal,
2602+
i.e. which should be `apply`able.
2603+
```lean
2604+
example : True := by find
2605+
```
2606+
`find` will not affect the goal by itself and should be removed from the finished proof.
2607+
For a command that takes the type to search for as an argument,
2608+
see `#find`, which is also available as a tactic.
25952609

25962610
## finiteness
25972611
Defined in: `finiteness`
@@ -3281,6 +3295,31 @@ useful within `conv` mode.
32813295
## have
32823296
Defined in: `Mathlib.Tactic.tacticHave_`
32833297

3298+
The `have` tactic is for adding opaque definitions and hypotheses to the local context of the main goal.
3299+
The definitions forget their associated value and cannot be unfolded, unlike definitions added by the `let` tactic.
3300+
3301+
* `have h : t := e` adds the hypothesis `h : t` if `e` is a term of type `t`.
3302+
* `have h := e` uses the type of `e` for `t`.
3303+
* `have : t := e` and `have := e` use `this` for the name of the hypothesis.
3304+
* `have pat := e` for a pattern `pat` is equivalent to `match e with | pat => _`,
3305+
where `_` stands for the tactics that follow this one.
3306+
It is convenient for types that have only one applicable constructor.
3307+
For example, given `h : p ∧ q ∧ r`, `have ⟨h₁, h₂, h₃⟩ := h` produces the
3308+
hypotheses `h₁ : p`, `h₂ : q`, and `h₃ : r`.
3309+
* The syntax `have (eq := h) pat := e` is equivalent to `match h : e with | pat => _`,
3310+
which adds the equation `h : e = pat` to the local context.
3311+
3312+
The tactic supports all the same syntax variants and options as the `have` term.
3313+
3314+
## Properties and relations
3315+
3316+
* It is not possible to unfold a variable introduced using `have`, since the definition's value is forgotten.
3317+
The `let` tactic introduces definitions that can be unfolded.
3318+
* The `have h : t := e` is like doing `let h : t := e; clear_value h`.
3319+
* The `have` tactic is preferred for propositions, and `let` is preferred for non-propositions.
3320+
* Sometimes `have` is used for non-propositions to ensure that the variable is never unfolded,
3321+
which may be important for performance reasons.
3322+
Consider using the equivalent `let +nondep` to indicate the intent.
32843323

32853324
## have
32863325
Defined in: `Lean.Parser.Tactic.tacticHave__`
@@ -3697,6 +3736,31 @@ The syntax is the same as term-mode `let rec`.
36973736
## let
36983737
Defined in: `Mathlib.Tactic.tacticLet_`
36993738

3739+
The `let` tactic is for adding definitions to the local context of the main goal.
3740+
The definition can be unfolded, unlike definitions introduced by `have`.
3741+
3742+
* `let x : t := e` adds the definition `x : t := e` if `e` is a term of type `t`.
3743+
* `let x := e` uses the type of `e` for `t`.
3744+
* `let : t := e` and `let := e` use `this` for the name of the hypothesis.
3745+
* `let pat := e` for a pattern `pat` is equivalent to `match e with | pat => _`,
3746+
where `_` stands for the tactics that follow this one.
3747+
It is convenient for types that let only one applicable constructor.
3748+
For example, given `p : α × β × γ`, `let ⟨x, y, z⟩ := p` produces the
3749+
local variables `x : α`, `y : β`, and `z : γ`.
3750+
* The syntax `let (eq := h) pat := e` is equivalent to `match h : e with | pat => _`,
3751+
which adds the equation `h : e = pat` to the local context.
3752+
3753+
The tactic supports all the same syntax variants and options as the `let` term.
3754+
3755+
## Properties and relations
3756+
3757+
* Unlike `have`, it is possible to unfold definitions introduced using `let`, using tactics
3758+
such as `simp`, `dsimp`, `unfold`, and `subst`.
3759+
* The `clear_value` tactic turns a `let` definition into a `have` definition after the fact.
3760+
The tactic might fail if the local context depends on the value of the variable.
3761+
* The `let` tactic is preferred for data (non-propositions).
3762+
* Sometimes `have` is used for non-propositions to ensure that the variable is never unfolded,
3763+
which may be important for performance reasons.
37003764

37013765
## let'
37023766
Defined in: `Lean.Parser.Tactic.tacticLet'__`
@@ -4347,7 +4411,7 @@ Defined in: `Lean.Parser.Tactic.mdup`
43474411
Duplicate a stateful `Std.Do.SPred` hypothesis.
43484412

43494413
## measurability
4350-
Defined in: `tacticMeasurability`
4414+
Defined in: `Mathlib.Tactic.measurability`
43514415

43524416
The tactic `measurability` solves goals of the form `Measurable f`, `AEMeasurable f`,
43534417
`StronglyMeasurable f`, `AEStronglyMeasurable f μ`, or `MeasurableSet s` by applying lemmas tagged
@@ -4361,13 +4425,25 @@ with `fun_prop` rather that `measurability`. The `measurability` attribute is eq
43614425
## measurability!
43624426
Defined in: `measurability!`
43634427

4428+
The tactic `measurability` solves goals of the form `Measurable f`, `AEMeasurable f`,
4429+
`StronglyMeasurable f`, `AEStronglyMeasurable f μ`, or `MeasurableSet s` by applying lemmas tagged
4430+
with the `measurability` user attribute.
4431+
4432+
Note that `measurability` uses `fun_prop` for solving measurability of functions, so statements
4433+
about `Measurable`, `AEMeasurable`, `StronglyMeasurable` and `AEStronglyMeasurable` should be tagged
4434+
with `fun_prop` rather that `measurability`. The `measurability` attribute is equivalent to
4435+
`fun_prop` in these cases for backward compatibility with the earlier implementation.
43644436

43654437
## measurability!?
43664438
Defined in: `measurability!?`
43674439

4440+
The tactic `measurability?` solves goals of the form `Measurable f`, `AEMeasurable f`,
4441+
`StronglyMeasurable f`, `AEStronglyMeasurable f μ`, or `MeasurableSet s` by applying lemmas tagged
4442+
with the `measurability` user attribute, and suggests a faster proof script that can be substituted
4443+
for the tactic call in case of success.
43684444

43694445
## measurability?
4370-
Defined in: `tacticMeasurability?`
4446+
Defined in: `Mathlib.Tactic.measurability?`
43714447

43724448
The tactic `measurability?` solves goals of the form `Measurable f`, `AEMeasurable f`,
43734449
`StronglyMeasurable f`, `AEStronglyMeasurable f μ`, or `MeasurableSet s` by applying lemmas tagged
@@ -6711,10 +6787,48 @@ runs `X` and verifies that it still prints "Try this: Y".
67116787
## set
67126788
Defined in: `Mathlib.Tactic.setTactic`
67136789

6790+
`set a := t with h` is a variant of `let a := t`. It adds the hypothesis `h : a = t` to
6791+
the local context and replaces `t` with `a` everywhere it can.
6792+
6793+
`set a := t with ← h` will add `h : t = a` instead.
6794+
6795+
`set! a := t with h` does not do any replacing.
6796+
6797+
```lean
6798+
example (x : Nat) (h : x + x - x = 3) : x + x - x = 3 := by
6799+
set y := x with ← h2
6800+
sorry
6801+
/-
6802+
x : Nat
6803+
y : Nat := x
6804+
h : y + y - y = 3
6805+
h2 : x = y
6806+
⊢ y + y - y = 3
6807+
-/
6808+
```
67146809

67156810
## set!
67166811
Defined in: `Mathlib.Tactic.tacticSet!_`
67176812

6813+
`set a := t with h` is a variant of `let a := t`. It adds the hypothesis `h : a = t` to
6814+
the local context and replaces `t` with `a` everywhere it can.
6815+
6816+
`set a := t with ← h` will add `h : t = a` instead.
6817+
6818+
`set! a := t with h` does not do any replacing.
6819+
6820+
```lean
6821+
example (x : Nat) (h : x + x - x = 3) : x + x - x = 3 := by
6822+
set y := x with ← h2
6823+
sorry
6824+
/-
6825+
x : Nat
6826+
y : Nat := x
6827+
h : y + y - y = 3
6828+
h2 : x = y
6829+
⊢ y + y - y = 3
6830+
-/
6831+
```
67186832

67196833
## set_option
67206834
Defined in: `Lean.Parser.Tactic.set_option`
@@ -7235,6 +7349,11 @@ If `h :` is omitted, the name `this` is used.
72357349
## suffices
72367350
Defined in: `Mathlib.Tactic.tacticSuffices_`
72377351

7352+
Given a main goal `ctx ⊢ t`, `suffices h : t' from e` replaces the main goal with `ctx ⊢ t'`,
7353+
`e` must have type `t` in the context `ctx, h : t'`.
7354+
7355+
The variant `suffices h : t' by tac` is a shorthand for `suffices h : t' from by tac`.
7356+
If `h :` is omitted, the name `this` is used.
72387357

72397358
## suggestions
72407359
Defined in: `Lean.Parser.Tactic.suggestions`
@@ -7282,7 +7401,7 @@ Defined in: `Mathlib.Tactic.Tauto.tauto`
72827401

72837402
`tauto` breaks down assumptions of the form `_ ∧ _`, `_ ∨ _`, `_ ↔ _` and `∃ _, _`
72847403
and splits a goal of the form `_ ∧ _`, `_ ↔ _` or `∃ _, _` until it can be discharged
7285-
using `reflexivity` or `solve_by_elim`.
7404+
using `rfl` or `solve_by_elim`.
72867405
This is a finishing tactic: it either closes the goal or raises an error.
72877406

72887407
The Lean 3 version of this tactic by default attempted to avoid classical reasoning
@@ -7665,6 +7784,7 @@ This is similar to the `trivial` tactic but doesn't do things like `contradictio
76657784
## use_finite_instance
76667785
Defined in: `tacticUse_finite_instance`
76677786

7787+
Try using `Set.toFinite` to dispatch a `Set.Finite` goal.
76687788

76697789
## valid
76707790
Defined in: `CategoryTheory.ComposableArrows.tacticValid`

lake-manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"type": "git",
66
"subDir": null,
77
"scope": "",
8-
"rev": "14bfbad331fcd848aa37830a3fb4103af552de12",
8+
"rev": "c0952c46eb2fda6a7909a689a8a371ed38503611",
99
"name": "mathlib",
1010
"manifestFile": "lake-manifest.json",
1111
"inputRev": "master",
@@ -75,7 +75,7 @@
7575
"type": "git",
7676
"subDir": null,
7777
"scope": "leanprover-community",
78-
"rev": "e1c1e06b9cbfc873b309695c9e9584de88ec22ac",
78+
"rev": "6ac53033da7f895a7d7a8597d2455b5e68e296e6",
7979
"name": "batteries",
8080
"manifestFile": "lake-manifest.json",
8181
"inputRev": "main",

0 commit comments

Comments
 (0)