Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: the unusedVariableCommand linter #17715

Draft
wants to merge 274 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
274 commits
Select commit Hold shift + click to select a range
da4e908
Merge remote-tracking branch 'origin/master' into adomani/unused_vari…
adomani Sep 30, 2024
9822744
add shadow
adomani Sep 30, 2024
d8a2c5a
disable unusedVariable
adomani Sep 30, 2024
0ea86b1
search for decls inside syntax
adomani Sep 30, 2024
c5afcfb
enable both
adomani Sep 30, 2024
bebc090
comment inspect
adomani Sep 30, 2024
f3f2846
hack toFalse
adomani Oct 1, 2024
cc8d4a3
Merge branch 'adomani/unused_variable_command_linter' of github.com:l…
adomani Oct 1, 2024
8e85f4f
use mkIdent
adomani Oct 1, 2024
e12128a
replace declValsEqns and whereStruct
adomani Oct 1, 2024
f297b44
doc
adomani Oct 1, 2024
691f10e
shadow also finds repeated variables
adomani Oct 1, 2024
17ebf8c
restore the unuvar
adomani Oct 1, 2024
c11fe0f
shadow docs
adomani Oct 1, 2024
9bbcb2e
Merge branch 'adomani/unused_variable_command_linter' of github.com:l…
adomani Oct 1, 2024
387bc51
remove some variables
adomani Oct 3, 2024
a336e14
Merge remote-tracking branch 'origin/master' into adomani/unused_vari…
adomani Oct 3, 2024
00d748d
fewer variables
adomani Oct 3, 2024
23f0713
Merge remote-tracking branch 'origin/master' into adomani/unused_vari…
adomani Oct 4, 2024
fb7735f
add (find)binders and mkThmWithHyps
adomani Oct 4, 2024
d5abd54
plumb
adomani Oct 4, 2024
ee1dc37
add mkThmCore
adomani Oct 5, 2024
ee5556f
Merge branch 'adomani/unused_variable_command_linter' of github.com:l…
adomani Oct 6, 2024
27e1b3b
Merge remote-tracking branch 'origin/master' into adomani/unused_vari…
adomani Oct 6, 2024
05083b6
add syntax filters
adomani Oct 6, 2024
93f1e92
extract getPropValue
adomani Oct 6, 2024
65dfb6d
small fix
adomani Oct 6, 2024
1d5b0c6
extract more binders
adomani Oct 6, 2024
674f420
def and use in linter
adomani Oct 6, 2024
554d688
some vars
adomani Oct 6, 2024
1450a3c
Merge branch 'adomani/unused_variable_command_linter' of github.com:l…
adomani Oct 6, 2024
ad2f74c
some vars
adomani Oct 6, 2024
36f8961
improve def
adomani Oct 7, 2024
6e90ead
more disappearing vars
adomani Oct 7, 2024
1af6ee0
more disappearing vars
adomani Oct 7, 2024
c6602fc
adjust
adomani Oct 7, 2024
35b6dc0
merge lines
adomani Oct 7, 2024
24482e5
Merge branch 'adomani/unused_vars2' into adomani/unused_variable_comm…
adomani Oct 7, 2024
996bc7b
more vars
adomani Oct 7, 2024
7f66476
Merge remote-tracking branch 'origin/master' into adomani/unused_vari…
adomani Oct 7, 2024
a407457
some more unused variables
adomani Oct 7, 2024
406dc45
some more unused variables
adomani Oct 7, 2024
ab7614e
syntax matching
adomani Oct 8, 2024
c05fab0
Merge branch 'adomani/unused_variable_command_linter' of github.com:l…
adomani Oct 8, 2024
3368d9b
fewer variables
adomani Oct 8, 2024
0f5a0af
fewer variables
adomani Oct 8, 2024
597971c
fewer vars in linearalgebra
adomani Oct 8, 2024
e54e551
match better on instance
adomani Oct 8, 2024
358fe46
fewer vars in linearalgebra
adomani Oct 8, 2024
91c0f2e
Merge remote-tracking branch 'origin/master' into adomani/unused_vars4
adomani Oct 8, 2024
7bf4d57
remove import
adomani Oct 8, 2024
1002655
remove import
adomani Oct 8, 2024
6c46c7f
another batch
adomani Oct 8, 2024
2bce19a
another batch
adomani Oct 8, 2024
77b632f
many more
adomani Oct 8, 2024
99a4432
many more
adomani Oct 8, 2024
4b78d88
fix
adomani Oct 8, 2024
f858b5c
rename universe
adomani Oct 8, 2024
d69bda9
renames
adomani Oct 8, 2024
9accaf6
Merge branch 'nightly-testing' of github.com:leanprover-community/mat…
adomani Oct 8, 2024
cf09b26
another universe rename
adomani Oct 8, 2024
57987c3
upstream beta
adomani Oct 8, 2024
7bdc0c7
another universe
adomani Oct 8, 2024
9acc67e
Merge branch 'adomani/unused_vars4' into adomani/unused_variable_comm…
adomani Oct 8, 2024
281b01a
more at the end
adomani Oct 9, 2024
14f79cc
Merge branch 'master' into adomani/unused_variable_command_linter
adomani Oct 9, 2024
13eaa48
Merge branch 'adomani/unused_variable_command_linter' of github.com:l…
adomani Oct 9, 2024
db486de
chore: another batch of variable removals
adomani Oct 9, 2024
4e20fe5
Merge branch 'adomani/unused_vars6' into adomani/unused_variable_comm…
adomani Oct 9, 2024
0807596
second batch
adomani Oct 9, 2024
ab4a5eb
Merge branch 'adomani/unused_vars6' into adomani/unused_variable_comm…
adomani Oct 9, 2024
1106474
chore: remove a few more variables
adomani Oct 9, 2024
631e06a
Merge branch 'adomani/unused_vars7' into adomani/unused_variable_comm…
adomani Oct 9, 2024
f15ecd4
a few more
adomani Oct 9, 2024
a3b9857
Merge branch 'adomani/unused_vars7' into adomani/unused_variable_comm…
adomani Oct 9, 2024
cfd5388
Merge remote-tracking branch 'origin/master' into adomani/unused_vari…
adomani Oct 9, 2024
d398e62
differentiable
adomani Oct 9, 2024
890eb7f
chore: remove some variables
adomani Oct 9, 2024
e2f2e51
Merge branch 'adomani/unused_vars8' into adomani/unused_variable_comm…
adomani Oct 9, 2024
9389d28
extract some ref management
adomani Oct 10, 2024
92df74c
simplify `ref` and add doc
adomani Oct 10, 2024
e86b481
rename `addVarName` to `addUsedVarName`
adomani Oct 10, 2024
d4a0a87
more docs
adomani Oct 10, 2024
ac9c4c0
algebra ring divisibility
adomani Oct 10, 2024
cd134d5
docs and reconstruct `in`s before the declaration
adomani Oct 10, 2024
1dbd9f0
print string of variables
adomani Oct 11, 2024
a537fef
Merge remote-tracking branch 'origin/master' into adomani/unused_vari…
adomani Oct 13, 2024
9c00a4a
hack for `def`s
adomani Oct 13, 2024
ca2250f
remove some comments
adomani Oct 13, 2024
337ee09
remove some unused vars
adomani Oct 13, 2024
c177120
Merge remote-tracking branch 'origin/master' into adomani/unused_vari…
adomani Oct 13, 2024
89d05ea
remove some unused vars
adomani Oct 13, 2024
013bc2e
two more
adomani Oct 13, 2024
822822c
revert one
adomani Oct 13, 2024
7313a4b
Merge branch 'adomani/more_removed_vars' into adomani/unused_variable…
adomani Oct 13, 2024
01f6eab
remove test class
adomani Oct 13, 2024
2093b24
Merge branch 'adomani/more_removed_vars' into adomani/unused_variable…
adomani Oct 13, 2024
88c7ca4
remove test class
adomani Oct 13, 2024
dfffb9a
another batch
adomani Oct 13, 2024
d2a75c3
Merge branch 'adomani/more_removed_vars' into adomani/unused_variable…
adomani Oct 13, 2024
788a27f
feat: the unusedVariableCommand linter
adomani Oct 14, 2024
91d8e01
set the linter to true
adomani Oct 14, 2024
a5e23e5
fix declIds
adomani Oct 14, 2024
ac69f5c
more
adomani Oct 14, 2024
dd8b86d
Merge branch 'adomani/more_removed_vars' into adomani/unused_variable…
adomani Oct 14, 2024
1548ed1
fix test
adomani Oct 14, 2024
713a1fa
Merge remote-tracking branch 'origin/master' into adomani/more_remove…
adomani Oct 14, 2024
c09409b
yet more
adomani Oct 14, 2024
9879944
Merge branch 'adomani/more_removed_vars' into adomani/unused_variable…
adomani Oct 14, 2024
90dafae
fix "lemma" issue
adomani Oct 14, 2024
0c3cb71
two more
adomani Oct 14, 2024
47991f1
Merge branch 'adomani/more_removed_vars' into adomani/unused_variable…
adomani Oct 14, 2024
058b076
deal with examples
adomani Oct 14, 2024
4077180
chore: remove unused variables
adomani Oct 14, 2024
0d0e356
get state earlier
adomani Oct 14, 2024
737f1d4
more vars
adomani Oct 14, 2024
8d7ce3d
Merge remote-tracking branch 'origin/master' into adomani/more_remove…
adomani Oct 14, 2024
4105586
Merge branch 'adomani/more_removed_vars2' into adomani/unused_variabl…
adomani Oct 14, 2024
85a41f2
yet more
adomani Oct 15, 2024
f83dd88
Merge branch 'adomani/more_removed_vars2' into adomani/unused_variabl…
adomani Oct 15, 2024
8c6476f
chore: remove and rename variables
adomani Oct 15, 2024
dd5c4b6
new inclusion mechanism
adomani Oct 15, 2024
8e1ccb8
Merge branch 'adomani/remove_variables_3' into adomani/unused_variabl…
adomani Oct 15, 2024
3cfb376
more and more
adomani Oct 15, 2024
ed4825d
more and more
adomani Oct 15, 2024
2c8390e
Merge branch 'adomani/unused_variable_command_linter' into adomani/un…
adomani Oct 15, 2024
344b591
Merge remote-tracking branch 'origin/master' into adomani/unused_vari…
adomani Oct 15, 2024
189bb40
two more
adomani Oct 15, 2024
3b746a6
Merge branch 'adomani/more_unused_vars0' into adomani/unused_variable…
adomani Oct 15, 2024
fed1f3b
more
adomani Oct 15, 2024
a935eed
Merge remote-tracking branch 'origin/master' into adomani/more_remove…
adomani Oct 15, 2024
b142a54
Merge branch 'adomani/more_removed_vars2' into adomani/unused_variabl…
adomani Oct 15, 2024
8a89bdd
chore: more unused variables
adomani Oct 15, 2024
2aaf36c
Merge branch 'adomani/batch_n' into adomani/unused_variable_only
adomani Oct 15, 2024
8f20661
Merge remote-tracking branch 'origin/master' into adomani/unused_vari…
adomani Oct 15, 2024
c9ffd10
Add telescope, better printing, #show_used and showDefs
adomani Oct 15, 2024
8372d2c
another round
adomani Oct 15, 2024
cdae7cc
Merge branch 'adomani/batch_n' into adomani/unused_variable_only
adomani Oct 15, 2024
763ca58
one more
adomani Oct 15, 2024
caa47da
Merge remote-tracking branch 'origin/master' into adomani/batch_n
adomani Oct 15, 2024
d90c43f
docs
adomani Oct 15, 2024
e068aff
Merge branch 'adomani/batch_n' into adomani/unused_variable_only
adomani Oct 15, 2024
6dd2ac0
more at the bottom
adomani Oct 16, 2024
c90ebee
Merge branch 'adomani/batch_n' into adomani/unused_variable_only
adomani Oct 16, 2024
4d4caed
plant test
adomani Oct 16, 2024
ddb1906
print less
adomani Oct 16, 2024
49553d8
chore: remove more unused variables
adomani Oct 16, 2024
e8c7da8
another batch
adomani Oct 16, 2024
36a6933
another batch
adomani Oct 16, 2024
f48a704
third batch
adomani Oct 16, 2024
0f621fc
third batch
adomani Oct 16, 2024
693f0c4
Merge branch 'adomani/batch_m' into adomani/unused_variable_only
adomani Oct 16, 2024
483d625
more and more
adomani Oct 16, 2024
9b71c33
combining lines
adomani Oct 16, 2024
dcf567b
more and more
adomani Oct 16, 2024
425bf93
Merge branch 'adomani/more_removed_vars2' into adomani/unused_variabl…
adomani Oct 16, 2024
5d7e5c9
Merge branch 'adomani/batch_m' into adomani/unused_variable_only
adomani Oct 16, 2024
8f4ecec
Merge remote-tracking branch 'origin/master' into adomani/unused_vari…
adomani Oct 16, 2024
1633d77
Merge remote-tracking branch 'origin/master' into adomani/unused_vari…
adomani Oct 16, 2024
80b62d9
add tests
adomani Oct 17, 2024
4b32234
Merge remote-tracking branch 'origin/master' into adomani/unused_vari…
adomani Oct 17, 2024
1666f6f
use a structure, rather than a product
adomani Oct 18, 2024
ca7dab6
docs
adomani Oct 18, 2024
3375b4f
Merge remote-tracking branch 'origin/master' into adomani/unused_vari…
adomani Oct 19, 2024
69b9d55
chore: removed unused variables
adomani Oct 20, 2024
7be0eae
Merge branch 'adomani/unused_fixes' into adomani/unused_variable_only
adomani Oct 20, 2024
f103ec6
Merge branch 'master' into adomani/unused_variable_only
adomani Oct 21, 2024
aab3e9a
chore: remove variables
adomani Oct 24, 2024
1cda137
chore: remove a variable and collapse rest
adomani Oct 24, 2024
ce0745f
Merge remote-tracking branch 'origin/master' into adomani/unused_vari…
adomani Oct 24, 2024
e8ffcdd
wrong removal
adomani Oct 24, 2024
daa67e5
Merge branch 'adomani/more_rm_vars' into adomani/unused_variable_only
adomani Oct 24, 2024
75d1dc6
Merge branch 'adomani/remove_and_rename_finiteDimension' into adomani…
adomani Oct 24, 2024
a3765a3
n to i
adomani Oct 25, 2024
74b0041
Merge branch 'adomani/more_rm_vars' into adomani/unused_variable_only
adomani Oct 25, 2024
ea6a1b5
Merge remote-tracking branch 'origin/master' into adomani/unused_vari…
adomani Oct 25, 2024
1b5a224
Merge branch 'master' into adomani/unused_variable_only
adomani Oct 25, 2024
ac2ec7b
chore: remove unused variables
adomani Oct 25, 2024
a0c7a2f
Merge branch 'adomani/remove_n_vars_n' into adomani/unused_variable_only
adomani Oct 25, 2024
6e76d49
Merge remote-tracking branch 'origin/master' into adomani/unused_vari…
adomani Oct 27, 2024
115b024
chore: remove more variables
adomani Oct 28, 2024
4e6a34e
Merge branch 'adomani/remove_more_and_more_vars' into adomani/unused_…
adomani Oct 28, 2024
4ea489c
chore: remove unused vars
adomani Oct 28, 2024
d9974be
Merge branch 'adomani/remove_another_batch_of_vars' into adomani/unus…
adomani Oct 28, 2024
3a54c50
Update Mathlib/Computability/Partrec.lean
adomani Oct 28, 2024
ea4fd1c
Merge remote-tracking branch 'origin/adomani/remove_another_batch_of_…
adomani Oct 28, 2024
7a11068
Merge remote-tracking branch 'origin/master' into adomani/unused_vari…
adomani Oct 28, 2024
269b7b4
awareness of modifications, try only for theorem/lemma
adomani Oct 28, 2024
d888b9d
chore: remove a few unused variables
adomani Oct 28, 2024
4df66b8
Merge branch 'adomani/remove_few_vars' into adomani/unused_variable_only
adomani Oct 28, 2024
e24e554
remove mkThm'. as `catch` never caught successfully
adomani Oct 29, 2024
428f454
un-monadize getBracketedBinderIds
adomani Oct 29, 2024
d909c77
add dependency on name finder
adomani Oct 29, 2024
dcfc400
process theorem/lemma separately from rest, strip universe annotation…
adomani Oct 29, 2024
dbd8915
docs
adomani Oct 29, 2024
7b46399
long line
adomani Oct 29, 2024
c0e1004
add test
adomani Oct 30, 2024
d71adac
chore: remove more unused variables
adomani Oct 30, 2024
80a9f2b
chore: remove more unused variables
adomani Oct 30, 2024
194bd25
Merge branch 'adomani/remove_variables' into adomani/unused_variable_…
adomani Oct 30, 2024
aa84497
fix git mess
adomani Oct 30, 2024
3c832c1
Merge branch 'adomani/remove_variables' into adomani/unused_variable_…
adomani Oct 30, 2024
c5c608a
Merge remote-tracking branch 'origin/master' into adomani/unused_vari…
adomani Oct 30, 2024
0ffaf15
chore: remove unused variables
adomani Oct 30, 2024
3ee1c17
Merge branch 'adomani/remove_un_variables' into adomani/unused_variab…
adomani Oct 30, 2024
07e63f7
Merge remote-tracking branch 'origin/master' into adomani/unused_vari…
adomani Oct 31, 2024
58056c5
chore: more unused variables
adomani Oct 31, 2024
c536a2b
second batch
adomani Oct 31, 2024
98c154b
Merge branch 'adomani/more_removed_variables_i' into adomani/unused_v…
adomani Oct 31, 2024
2ec98d2
add defDict
adomani Nov 7, 2024
d80cbd4
Merge remote-tracking branch 'origin/master' into adomani/unused_vari…
adomani Nov 7, 2024
becf331
Merge remote-tracking branch 'origin/master' into adomani/unused_vari…
adomani Nov 11, 2024
020150d
deprecation
adomani Nov 11, 2024
c833612
chore: more unused variables
adomani Nov 11, 2024
e6b78b3
Merge remote-tracking branch 'origin/master' into adomani/unused_vari…
adomani Nov 11, 2024
2d1de52
chore: more unused variables
adomani Nov 11, 2024
60e2050
combine lines
adomani Nov 12, 2024
ab3db65
Merge branch 'adomani/more_removed_variables' into adomani/unused_var…
adomani Nov 12, 2024
541501a
Merge remote-tracking branch 'origin/master' into adomani/unused_vari…
adomani Nov 12, 2024
ecfcad7
chore: remove unused variables
adomani Nov 12, 2024
cee438a
Merge branch 'adomani/remove_more_variables' into adomani/unused_vari…
adomani Nov 12, 2024
407ce59
one more
adomani Nov 12, 2024
623819d
more changes
adomani Nov 12, 2024
edfb735
revert file
adomani Nov 12, 2024
cce7890
Merge branch 'adomani/remove_more_variables' into adomani/unused_vari…
adomani Nov 12, 2024
9e43a84
more removals
adomani Nov 12, 2024
40a3e6e
Merge branch 'adomani/remove_more_variables' into adomani/unused_vari…
adomani Nov 12, 2024
a7d6d59
chore: remove unused variables
adomani Nov 15, 2024
d8ec9a7
chore: remove unused variables
adomani Nov 15, 2024
320c627
Merge branch 'adomani/remove_un_vars' into adomani/unused_variable_only
adomani Nov 15, 2024
3b1049e
second batch
adomani Nov 15, 2024
4389ff6
Merge branch 'adomani/remove_un_vars' into adomani/unused_variable_only
adomani Nov 15, 2024
9fa3374
another batch
adomani Nov 23, 2024
4317454
another batch
adomani Nov 23, 2024
7a7e773
Merge remote-tracking branch 'origin/master' into adomani/unused_vari…
adomani Nov 23, 2024
ab40bd6
FTaylorSeries
adomani Nov 23, 2024
6ee1852
another batch
adomani Nov 23, 2024
7920340
yet another
adomani Nov 23, 2024
82cf9f9
Merge branch 'adomani/remove_unused_variabless' into adomani/unused_v…
adomani Nov 23, 2024
fc8be24
fix test
adomani Nov 23, 2024
a351207
final included batch
adomani Nov 23, 2024
8374c2a
Merge branch 'adomani/remove_unused_variabless' into adomani/unused_v…
adomani Nov 23, 2024
1c2b8ad
non PRed unused variables
adomani Nov 25, 2024
3fd779d
Merge remote-tracking branch 'origin/master' into adomani/unused_vari…
adomani Nov 25, 2024
9163209
Merge branch 'master' into adomani/unused_variable_only
grunweg Jan 16, 2025
20d38d3
Simplify
grunweg Jan 16, 2025
5a889fe
Fix
grunweg Jan 16, 2025
798854c
Fix merge
grunweg Jan 16, 2025
1147b15
chore: remove some unused variables
grunweg Jan 16, 2025
ea5f56a
chore: set Elab.async to false globally
grunweg Jan 16, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Mathlib.lean
Original file line number Diff line number Diff line change
Expand Up @@ -4979,6 +4979,7 @@ import Mathlib.Tactic.Linter.RefineLinter
import Mathlib.Tactic.Linter.Style
import Mathlib.Tactic.Linter.TextBased
import Mathlib.Tactic.Linter.UnusedTactic
import Mathlib.Tactic.Linter.UnusedVariableCommand
import Mathlib.Tactic.Linter.UpstreamableDecl
import Mathlib.Tactic.Measurability
import Mathlib.Tactic.Measurability.Init
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Algebra/Group/Idempotent.lean
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ projection, idempotent

assert_not_exists GroupWithZero

variable {M N S : Type*}
variable {M S : Type*}

/-- An element `a` is said to be idempotent if `a * a = a`. -/
def IsIdempotentElem [Mul M] (a : M) : Prop := a * a = a
Expand Down
7 changes: 4 additions & 3 deletions Mathlib/Algebra/GroupWithZero/Idempotent.lean
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import Mathlib.Algebra.GroupWithZero.Defs

assert_not_exists Ring

variable {M N S M₀ M₁ R G G₀ : Type*}
variable [MulOneClass M₁] [CancelMonoidWithZero G₀]
variable {M₀ G₀ : Type*}

namespace IsIdempotentElem

section MulZeroClass
variable [MulZeroClass M₀]

Expand All @@ -28,7 +28,8 @@ instance : Zero { p : M₀ // IsIdempotentElem p } where zero := ⟨0, zero⟩
end MulZeroClass

section CancelMonoidWithZero
variable [CancelMonoidWithZero M₀]

variable [CancelMonoidWithZero G₀]

@[simp]
lemma iff_eq_zero_or_one {p : G₀} : IsIdempotentElem p ↔ p = 0 ∨ p = 1 where
Expand Down
2 changes: 0 additions & 2 deletions Mathlib/Data/Finite/Defs.lean
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,6 @@ namespace Set

/-! ### Infinite sets -/

variable {s t : Set α}

theorem infinite_coe_iff {s : Set α} : Infinite s ↔ s.Infinite :=
not_finite_iff_infinite.symm.trans finite_coe_iff.not

Expand Down
10 changes: 5 additions & 5 deletions Mathlib/Data/Int/Cast/Field.lean
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,24 @@ This file concerns the canonical homomorphism `ℤ → F`, where `F` is a field.
* `Int.cast_div`: if `n` divides `m`, then `↑(m / n) = ↑m / ↑n`
-/


namespace Int

open Nat

variable {α : Type*}
variable {R : Type*} [DivisionRing R]

/-- Auxiliary lemma for norm_cast to move the cast `-↑n` upwards to `↑-↑n`.

(The restriction to `DivisionRing` is necessary, otherwise this would also apply in the case where
`R = ℤ` and cause nontermination.)
-/
@[norm_cast]
theorem cast_neg_natCast {R} [DivisionRing R] (n : ℕ) : ((-n : ℤ) : R) = -n := by simp
theorem cast_neg_natCast (n : ℕ) : ((-n : ℤ) : R) = -n := by simp


@[simp]
theorem cast_div [DivisionRing α] {m n : ℤ} (n_dvd : n ∣ m) (hn : (n : α) ≠ 0) :
((m / n : ℤ) : α) = m / n := by
theorem cast_div {m n : ℤ} (n_dvd : n ∣ m) (hn : (n : R) ≠ 0) :
((m / n : ℤ) : R) = m / n := by
rcases n_dvd with ⟨k, rfl⟩
have : n ≠ 0 := by rintro rfl; simp at hn
rw [Int.mul_ediv_cancel_left _ this, mul_comm n, Int.cast_mul, mul_div_cancel_right₀ _ hn]
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Geometry/Manifold/IntegralCurve/ExistUnique.lean
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ variable
{E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
{H : Type*} [TopologicalSpace H] {I : ModelWithCorners ℝ E H}
{M : Type*} [TopologicalSpace M] [ChartedSpace H M] [IsManifold I 1 M]
{γ γ' : ℝ → M} {v : (x : M) → TangentSpace I x} {s s' : Set ℝ} (t₀ : ℝ) {x₀ : M}
{γ γ' : ℝ → M} {v : (x : M) → TangentSpace I x} (t₀ : ℝ) {x₀ : M}

/-- Existence of local integral curves for a $C^1$ vector field at interior points of a `C^1`
manifold. -/
Expand Down
3 changes: 2 additions & 1 deletion Mathlib/Init.lean
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ import Mathlib.Tactic.Linter.Lint
import Mathlib.Tactic.Linter.Multigoal
import Mathlib.Tactic.Linter.OldObtain
import Mathlib.Tactic.Linter.RefineLinter
import Mathlib.Tactic.Linter.UnusedTactic
import Mathlib.Tactic.Linter.Style
import Mathlib.Tactic.Linter.UnusedTactic
import Mathlib.Tactic.Linter.UnusedVariableCommand

/-!
This is the root file in Mathlib: it is imported by virtually *all* Mathlib files.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ namespace MeasureTheory

variable {X M E : Type*}
[TopologicalSpace X] [R1Space X] [MeasurableSpace X] [BorelSpace X]
[Monoid M] [TopologicalSpace M] [MeasurableSpace M] [OpensMeasurableSpace M]
[TopologicalSpace M] [MeasurableSpace M] [OpensMeasurableSpace M]
[SMul M X] [ContinuousSMul M X]
[NormedAddCommGroup E]
{μ : Measure X} [IsLocallyFiniteMeasure μ] [μ.InnerRegularCompactLTTop]
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/NumberTheory/LSeries/PrimesInAP.lean
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ as an iterated product or sum over primes and natural numbers.

section auxiliary

variable {α β γ : Type*} [CommGroup α] [UniformSpace α] [UniformGroup α] [CompleteSpace α]
variable {α : Type*} [CommGroup α] [UniformSpace α] [UniformGroup α] [CompleteSpace α]
[T0Space α]

open Nat.Primes in
Expand Down
4 changes: 2 additions & 2 deletions Mathlib/Order/BoundedOrder/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ attribute [aesop (rule_sets := [finiteness]) unsafe 20%] ne_top_of_lt

end Preorder

variable [PartialOrder α] [OrderTop α] [Preorder β] {f : α → β} {a b : α}
variable [PartialOrder α] [OrderTop α] {f : α → β} {a b : α}

@[simp]
theorem isMax_iff_eq_top : IsMax a ↔ a = ⊤ :=
Expand Down Expand Up @@ -253,7 +253,7 @@ alias LT.lt.bot_lt := bot_lt_of_lt

end Preorder

variable [PartialOrder α] [OrderBot α] [Preorder β] {f : α → β} {a b : α}
variable [PartialOrder α] [OrderBot α] {f : α → β} {a b : α}

@[simp]
theorem isMin_iff_eq_bot : IsMin a ↔ a = ⊥ :=
Expand Down
4 changes: 2 additions & 2 deletions Mathlib/Order/BoundedOrder/Lattice.lean
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ instances for `Prop` and `fun`.

open Function OrderDual

universe u v
universe u

variable {α : Type u} {β : Type v}
variable {α : Type u}

/-! ### Top, bottom element -/

Expand Down
4 changes: 2 additions & 2 deletions Mathlib/Order/BoundedOrder/Monotone.lean
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ variable {α : Type u} {β : Type v}

section OrderTop

variable [PartialOrder α] [OrderTop α] [Preorder β] {f : α → β} {a b : α}
variable [PartialOrder α] [OrderTop α] [Preorder β] {f : α → β} {a : α}

theorem StrictMono.apply_eq_top_iff (hf : StrictMono f) : f a = f ⊤ ↔ a = ⊤ :=
⟨fun h => not_lt_top_iff.1 fun ha => (hf ha).ne h, congr_arg _⟩
Expand All @@ -43,7 +43,7 @@ theorem StrictMono.maximal_preimage_top [LinearOrder α] [Preorder β] [OrderTop

section OrderBot

variable [PartialOrder α] [OrderBot α] [Preorder β] {f : α → β} {a b : α}
variable [PartialOrder α] [OrderBot α] [Preorder β] {f : α → β} {a : α}

theorem StrictMono.apply_eq_bot_iff (hf : StrictMono f) : f a = f ⊥ ↔ a = ⊥ :=
hf.dual.apply_eq_top_iff
Expand Down
1 change: 0 additions & 1 deletion Mathlib/Order/Monotone/Monovary.lean
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ This condition comes up in the rearrangement inequality. See `Algebra.Order.Rear
* `AntivaryOn f g s`: `f` antivaries with `g` on `s`.
-/


open Function Set

variable {ι ι' α β γ : Type*}
Expand Down
1 change: 1 addition & 0 deletions Mathlib/Tactic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ import Mathlib.Tactic.Linter.RefineLinter
import Mathlib.Tactic.Linter.Style
import Mathlib.Tactic.Linter.TextBased
import Mathlib.Tactic.Linter.UnusedTactic
import Mathlib.Tactic.Linter.UnusedVariableCommand
import Mathlib.Tactic.Linter.UpstreamableDecl
import Mathlib.Tactic.Measurability
import Mathlib.Tactic.Measurability.Init
Expand Down
Loading
Loading