Skip to content

Commit 4309186

Browse files
committed
Merge branch 'bump/v4.22.0' of github.com:leanprover-community/mathlib4-nightly-testing into bump/v4.22.0
2 parents 10f477a + d342911 commit 4309186

36 files changed

+424
-226
lines changed

Mathlib/Algebra/CharP/Defs.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ lemma cast_eq_mod (k : ℕ) : (k : R) = (k % p : ℕ) :=
6363
exact Nat.dvd_mul_right p a
6464
calc
6565
(k : R) = ↑(k % p + p * (k / p)) := by rw [Nat.mod_add_div]
66-
_ = ↑(k % p) := by simp [cast_eq_zero, this]
66+
_ = ↑(k % p) := by simp [this]
6767

6868
lemma cast_eq_iff_mod_eq [IsLeftCancelAdd R] : (a:R) = (b:R) ↔ a % p = b % p := by
6969
wlog hle : a ≤ b

Mathlib/Data/Complex/Basic.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,10 +340,10 @@ instance addGroupWithOne : AddGroupWithOne ℂ :=
340340
intCast_ofNat := fun _ => by ext <;> rfl
341341
intCast_negSucc := fun n => by
342342
ext
343-
· simp [AddGroupWithOne.intCast_negSucc]
343+
· simp only [Int.cast_negSucc, Nat.cast_add, Nat.cast_one, neg_add_rev, neg_re]
344344
change -(1 : ℝ) + (-n) = -(↑(n + 1))
345345
simp [Nat.cast_add, add_comm]
346-
· simp [AddGroupWithOne.intCast_negSucc]
346+
· simp only [neg_im, zero_eq_neg]
347347
change im ⟨n, 0⟩ = 0
348348
rfl
349349
one := 1 }

Mathlib/Tactic/DeclarationNames.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,5 @@ def getAliasSyntax {m} [Monad m] [MonadResolveName m] (stx : Syntax) : m (Array
5151
/-- Used for linters which use `0` instead of `false` for disabling. -/
5252
def logLint0Disable {m} [Monad m] [MonadLog m] [AddMessageContext m] [MonadOptions m]
5353
(linterOption : Lean.Option Nat) (stx : Syntax) (msg : MessageData) : m Unit :=
54-
let disable := m!"note: this linter can be disabled with `set_option {linterOption.name} 0`"
55-
logWarningAt stx (.tagged linterOption.name m!"{msg}\n{disable}")
54+
let disable := .note m!"This linter can be disabled with `set_option {linterOption.name} 0`"
55+
logWarningAt stx (.tagged linterOption.name m!"{msg}{disable}")

Mathlib/Tactic/Linter/DeprecatedSyntaxLinter.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ def getDeprecatedSyntax : Syntax → Array (SyntaxNodeKind × Syntax × MessageD
169169
if trailing.toString.trimLeft.isEmpty then
170170
rargs.push (`MaxHeartbeats, stx,
171171
s!"Please, add a comment explaining the need for modifying the maxHeartbeat limit, \
172-
as in\nset_option {opt} {n} in\n-- reason for change\n...\n")
172+
as in\nset_option {opt} {n} in\n-- reason for change\n...")
173173
else
174174
rargs
175175
| _ => rargs

MathlibTest/CategoryTheory/MonoidalComp.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ example {W X Y Z : C} (f : W ⟶ (X ⊗ Y) ⊗ Z) : W ⟶ X ⊗ (Y ⊗ Z) := f
2525

2626
example {U V W X Y : C} (f : U ⟶ V ⊗ (W ⊗ X)) (g : (V ⊗ W) ⊗ X ⟶ Y) :
2727
f ⊗≫ g = f ≫ (α_ _ _ _).inv ≫ g := by
28-
simp [MonoidalCategory.tensorHom_def, monoidalComp]
28+
simp [monoidalComp]
2929

3030
end CategoryTheory

MathlibTest/CommandStart.lean

Lines changed: 54 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ This part of the code
3030
should be written as
3131
'field1 : Nat'
3232
33-
note: this linter can be disabled with `set_option linter.style.commandStart false`
33+
34+
Note: This linter can be disabled with `set_option linter.style.commandStart false`
3435
-/
3536
#guard_msgs in
3637
structure A where
@@ -57,7 +58,8 @@ This part of the code
5758
should be written as
5859
'field1 : Nat'
5960
60-
note: this linter can be disabled with `set_option linter.style.commandStart false`
61+
62+
Note: This linter can be disabled with `set_option linter.style.commandStart false`
6163
-/
6264
#guard_msgs in
6365
structure D where
@@ -75,7 +77,8 @@ This part of the code
7577
should be written as
7678
'instance {R} :'
7779
78-
note: this linter can be disabled with `set_option linter.style.commandStart false`
80+
81+
Note: This linter can be disabled with `set_option linter.style.commandStart false`
7982
-/
8083
#guard_msgs in
8184
instance {R} : Add R := sorry
@@ -89,7 +92,8 @@ This part of the code
8992
should be written as
9093
'instance {R} :'
9194
92-
note: this linter can be disabled with `set_option linter.style.commandStart false`
95+
96+
Note: This linter can be disabled with `set_option linter.style.commandStart false`
9397
-/
9498
#guard_msgs in
9599
instance {R} : Add R := sorry
@@ -163,7 +167,8 @@ local infixl:50 " ≼ " => s
163167

164168
/--
165169
warning: The `commandStart` linter had some parsing issues: feel free to silence it and report this error!
166-
note: this linter can be disabled with `set_option linter.style.commandStart.verbose false`
170+
171+
Note: This linter can be disabled with `set_option linter.style.commandStart.verbose false`
167172
-/
168173
#guard_msgs in
169174
set_option linter.style.commandStart.verbose true in
@@ -186,7 +191,8 @@ This part of the code
186191
should be written as
187192
'variable [h :'
188193
189-
note: this linter can be disabled with `set_option linter.style.commandStart false`
194+
195+
Note: This linter can be disabled with `set_option linter.style.commandStart false`
190196
---
191197
warning: extra space in the source
192198
@@ -195,7 +201,8 @@ This part of the code
195201
should be written as
196202
'[h : Add'
197203
198-
note: this linter can be disabled with `set_option linter.style.commandStart false`
204+
205+
Note: This linter can be disabled with `set_option linter.style.commandStart false`
199206
---
200207
warning: extra space in the source
201208
@@ -204,7 +211,8 @@ This part of the code
204211
should be written as
205212
'[h : Add'
206213
207-
note: this linter can be disabled with `set_option linter.style.commandStart false`
214+
215+
Note: This linter can be disabled with `set_option linter.style.commandStart false`
208216
---
209217
warning: extra space in the source
210218
@@ -213,7 +221,8 @@ This part of the code
213221
should be written as
214222
'Nat] [Add'
215223
216-
note: this linter can be disabled with `set_option linter.style.commandStart false`
224+
225+
Note: This linter can be disabled with `set_option linter.style.commandStart false`
217226
---
218227
warning: extra space in the source
219228
@@ -222,7 +231,8 @@ This part of the code
222231
should be written as
223232
'[Add Nat]'
224233
225-
note: this linter can be disabled with `set_option linter.style.commandStart false`
234+
235+
Note: This linter can be disabled with `set_option linter.style.commandStart false`
226236
-/
227237
#guard_msgs in
228238
variable [ h : Add Nat ] [ Add Nat]
@@ -235,7 +245,8 @@ This part of the code
235245
should be written as
236246
'omit [h :'
237247
238-
note: this linter can be disabled with `set_option linter.style.commandStart false`
248+
249+
Note: This linter can be disabled with `set_option linter.style.commandStart false`
239250
---
240251
warning: extra space in the source
241252
@@ -244,7 +255,8 @@ This part of the code
244255
should be written as
245256
' [Add'
246257
247-
note: this linter can be disabled with `set_option linter.style.commandStart false`
258+
259+
Note: This linter can be disabled with `set_option linter.style.commandStart false`
248260
-/
249261
#guard_msgs in
250262
omit [h : Add Nat] [Add Nat]
@@ -260,7 +272,8 @@ This part of the code
260272
should be written as
261273
'@[aesop (rule_sets'
262274
263-
note: this linter can be disabled with `set_option linter.style.commandStart false`
275+
276+
Note: This linter can be disabled with `set_option linter.style.commandStart false`
264277
-/
265278
#guard_msgs in
266279
@[aesop (rule_sets := [builtin]) safe apply] example : True := trivial
@@ -269,7 +282,8 @@ end misc
269282

270283
/--
271284
warning: 'section' starts on column 1, but all commands should start at the beginning of the line.
272-
note: this linter can be disabled with `set_option linter.style.commandStart false`
285+
286+
Note: This linter can be disabled with `set_option linter.style.commandStart false`
273287
-/
274288
#guard_msgs in
275289
section
@@ -282,7 +296,8 @@ This part of the code
282296
should be written as
283297
'example : True'
284298
285-
note: this linter can be disabled with `set_option linter.style.commandStart false`
299+
300+
Note: This linter can be disabled with `set_option linter.style.commandStart false`
286301
-/
287302
#guard_msgs in
288303
example : True := trivial
@@ -299,7 +314,8 @@ This part of the code
299314
should be written as
300315
'example : True'
301316
302-
note: this linter can be disabled with `set_option linter.style.commandStart false`
317+
318+
Note: This linter can be disabled with `set_option linter.style.commandStart false`
303319
-/
304320
#guard_msgs in
305321
example : True :=trivial
@@ -312,7 +328,8 @@ This part of the code
312328
should be written as
313329
'(a : Nat)'
314330
315-
note: this linter can be disabled with `set_option linter.style.commandStart false`
331+
332+
Note: This linter can be disabled with `set_option linter.style.commandStart false`
316333
-/
317334
#guard_msgs in
318335
variable (a: Nat)
@@ -325,7 +342,8 @@ This part of the code
325342
should be written as
326343
'(_a : Nat)'
327344
328-
note: this linter can be disabled with `set_option linter.style.commandStart false`
345+
346+
Note: This linter can be disabled with `set_option linter.style.commandStart false`
329347
-/
330348
#guard_msgs in
331349
example (_a: Nat) : True := trivial
@@ -338,7 +356,8 @@ This part of the code
338356
should be written as
339357
'{a : Nat}'
340358
341-
note: this linter can be disabled with `set_option linter.style.commandStart false`
359+
360+
Note: This linter can be disabled with `set_option linter.style.commandStart false`
342361
-/
343362
#guard_msgs in
344363
example {a: Nat} : a = a := rfl
@@ -358,7 +377,8 @@ This part of the code
358377
should be written as
359378
': Nat}'
360379
361-
note: this linter can be disabled with `set_option linter.style.commandStart false`
380+
381+
Note: This linter can be disabled with `set_option linter.style.commandStart false`
362382
-/
363383
#guard_msgs in
364384
example {a :Nat} : a = a := rfl
@@ -371,7 +391,8 @@ This part of the code
371391
should be written as
372392
'example {a :'
373393
374-
note: this linter can be disabled with `set_option linter.style.commandStart false`
394+
395+
Note: This linter can be disabled with `set_option linter.style.commandStart false`
375396
---
376397
warning: missing space in the source
377398
@@ -380,14 +401,16 @@ This part of the code
380401
should be written as
381402
': Nat}'
382403
383-
note: this linter can be disabled with `set_option linter.style.commandStart false`
404+
405+
Note: This linter can be disabled with `set_option linter.style.commandStart false`
384406
-/
385407
#guard_msgs in
386408
example {a :Nat} : a = a := rfl
387409

388410
/--
389411
warning: unused variable `b`
390-
note: this linter can be disabled with `set_option linter.unusedVariables false`
412+
413+
Note: This linter can be disabled with `set_option linter.unusedVariables false`
391414
---
392415
warning: missing space in the source
393416
@@ -396,7 +419,8 @@ This part of the code
396419
should be written as
397420
'Nat} {b :'
398421
399-
note: this linter can be disabled with `set_option linter.style.commandStart false`
422+
423+
Note: This linter can be disabled with `set_option linter.style.commandStart false`
400424
-/
401425
#guard_msgs in
402426
example {a : Nat}{b : Nat} : a = a := rfl
@@ -409,7 +433,8 @@ This part of the code
409433
should be written as
410434
'Nat} : a ='
411435
412-
note: this linter can be disabled with `set_option linter.style.commandStart false`
436+
437+
Note: This linter can be disabled with `set_option linter.style.commandStart false`
413438
-/
414439
#guard_msgs in
415440
example {a : Nat} : a = a := rfl
@@ -422,7 +447,8 @@ This part of the code
422447
should be written as
423448
'alpha] {a'
424449
425-
note: this linter can be disabled with `set_option linter.style.commandStart false`
450+
451+
Note: This linter can be disabled with `set_option linter.style.commandStart false`
426452
-/
427453
#guard_msgs in
428454
example {alpha} [Neg alpha ] {a : Nat} : a = a := rfl
@@ -435,7 +461,8 @@ This part of the code
435461
should be written as
436462
'example : True'
437463
438-
note: this linter can be disabled with `set_option linter.style.commandStart false`
464+
465+
Note: This linter can be disabled with `set_option linter.style.commandStart false`
439466
-/
440467
#guard_msgs in
441468
/-- Check that doc/strings do not get removed as comments. -/

MathlibTest/DeprecatedModuleTest.lean

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,17 @@ warning: We can also give more details about the deprecation
77
import Mathlib.Tactic.Linter.DocPrime
88
import Mathlib.Tactic.Linter.DocString
99
10-
note: this linter can be disabled with `set_option linter.deprecated.module false`
10+
11+
Note: This linter can be disabled with `set_option linter.deprecated.module false`
1112
---
1213
warning:
1314
'MathlibTest.DeprecatedModule' has been deprecated: please replace this import by
1415
1516
import Mathlib.Tactic.Linter.DocPrime
1617
import Mathlib.Tactic.Linter.DocString
1718
18-
note: this linter can be disabled with `set_option linter.deprecated.module false`
19+
20+
Note: This linter can be disabled with `set_option linter.deprecated.module false`
1921
-/
2022
#guard_msgs in
2123
/-!

0 commit comments

Comments
 (0)