-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathopenpr_E_v2_windowed.txt
More file actions
535 lines (493 loc) · 22.4 KB
/
Copy pathopenpr_E_v2_windowed.txt
File metadata and controls
535 lines (493 loc) · 22.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
====================================================================================================
CASE E PR #28349 (open-pr, v2 prompt, WINDOWED)
file: Mathlib/Tactic/Ring/NamePolyVars.lean line: 288.0
reviewer: @eric-wieser on 2025-08-19T09:01:40Z
advice_kind: design smell: string output
prompt_tokens: 5897 completion_tokens: 2020
HUMAN reviewer (ground truth):
> Returning this as a string feels like a wart to me; can you explain in a comment why `Syntax` is no good?
====================================================================================================
[SYSTEM]
----------------------------------------------------------------------------------------------------
You are an expert reviewer for the Lean 4 / mathlib4 mathematical library. Given a NEW code hunk from an open pull request and a set of historically retrieved (past_hunk, past_comment) pairs, your job is to identify which past reviewer feedback would also apply to the new hunk.
Compared to a naive matcher you must do TWO extra things, because the answer is often only derivable by combining evidence:
A. STRUCTURAL PATTERN EXTRACTION. Past comments often contain `suggestion` code blocks (```suggestion ... ```) or inline code-shape rewrites. These suggested code snippets ARE concrete advice, not just commentary. Treat them as first-class evidence about preferred Lean/mathlib idioms (e.g.: term-mode constructor `:= ⟨_, _, _⟩` vs `by use _; exact _`, `instance` vs `theorem` for class-membership statements, `refine ⟨..., ?_⟩` vs `use ...; constructor`, `@[simp]` / `@[to_additive]` attributes, naming conventions, docstring phrasing, etc.).
B. CROSS-CANDIDATE SYNTHESIS. The applicable advice for the new hunk may require combining evidence from multiple candidates. Example: candidate X's context tells you that an identifier in the new hunk is a `class`; candidate Y shows the term-mode `instance ... := ⟨...⟩` template for proving class membership. Together they support the conclusion: "the new theorem proving class membership should be rewritten as an `instance` with a term-mode constructor". List supporting PRs for any synthesised finding.
Reasoning protocol (do this internally before producing JSON):
1. STRUCTURAL FEATURES OF THE NEW HUNK. Identify each: tactic-mode vs term-mode? Uses `by use ...; exact ...`? Uses `use ...; constructor`? Declares an `instance` / a `theorem` / a `lemma` / a `def` / a `class`? Has `@[simp]`, `@[to_additive]`, `@[deprecated]`? Uses anonymous functions `fun x =>` vs `↦`? Has a docstring `/-- ... -/` of any specific shape?
2. PATTERN INVENTORY FROM CANDIDATES. For each candidate, note any concrete pattern shown in its suggested-code or comment (term-mode template, attribute recommendation, naming convention, idiomatic rewrite, terminology preference, etc.). Also note which candidates' past hunks define or use identifiers that appear in the new hunk (these are clues about whether something is a class, an instance, an alias, etc.).
3. APPLICABILITY CHECK. For each pattern from step 2, ask: does the new hunk's structure (step 1) instantiate the same shape that this pattern was applied to? If yes, that's a STRONG match. If two patterns combine to support a finding, list both supporting PRs.
4. STRICT REFUSAL. If after this analysis no candidate (alone or in combination) gives concrete, well-grounded advice for the specific code in the new hunk, output an empty `strong_matches` list. Do not paper over with generic advice. Generic style observations belong in `weak_observations`, clearly marked. Do not invent advice that isn't traceable to specific past PRs in the retrieval pool.
Confidence:
- "high" — at least one strong match is grounded in concrete suggested-code or explicit prose from a candidate, and the new hunk clearly fits the same shape
- "medium" — at least one strong match exists but requires synthesis or adaptation; OR a single candidate gives related but not identical advice
- "low" — only loose stylistic patterns; nothing actionable
- "none" — retrieved pool is unrelated; do not press an answer
Output JSON ONLY, matching this exact schema:
{
"summary": "<one sentence describing what we found>",
"confidence": "high"|"medium"|"low"|"none",
"strong_matches": [
{
"past_pr": <int>,
"past_file": "<string>",
"past_comment_excerpt": "<verbatim short quote from the past comment OR the relevant snippet from its suggestion block>",
"applies_because": "<one or two sentences linking past code/comment to the new hunk's structure>",
"suggested_adaptation": "<one sentence on what the reviewer might say on the new hunk>",
"supporting_past_prs": [<int>, ...]
}
],
"weak_observations": [
{
"observation": "<short string>",
"supporting_past_prs": [<int>, ...]
}
]
}
Quote short — under 40 words per excerpt. Be precise about which PR(s) support each finding via supporting_past_prs.
[USER]
----------------------------------------------------------------------------------------------------
NEW HUNK from open PR #28349 (file: Mathlib/Tactic/Ring/NamePolyVars.lean):
```
@@ -1,60 +1,346 @@
... [282 lines above hidden]
- let size := vars.size
- let sizeStx : TSyntax `term := quote size
- for h : idx in [:size] do
- let var := vars[idx]
- let var := quote s!"{var.getId}"
- let idx : TSyntax `term ← `(($(quote idx) : Fin $sizeStx))
- let cmd ← `(command|local notation3 $var:str =>
- MvPolynomial.X (R := $R) (σ := Fin $sizeStx) $idx)
- elabCommand cmd
-| _ => throwUnsupportedSyntax
-
-end Mathlib.Tactic
+syntax (name := declare) "name_poly_vars " polyesque : command
+
+/-- The table to store local polynomial-like notations, indexed by the raw string representation.
+If the head is a hole `_`, then the array of functors will be stored. Otherwise, we store the
+one resulting term.
+
+E.g. for `_[a,b][c]`, we store the array ``#[`(MvPolynomial (Fin 2)), `(Polynomial)]``;
+
+for `R[a,b][c]`, we store the one term `Polynomial (MvPolynomial (Fin 2) R))` -/
+abbrev Declared := Std.HashMap String (Term ⊕ Array Term)
+
+/-- The environmental extension to locally store polynomial-like notations. -/
+abbrev DeclaredExt := SimpleScopedEnvExtension (String × (Term ⊕ Array Term)) Declared
+
+/-- A local instance to help prove that `DeclaredExt` is inhabited. -/
+@[local instance] def inhabitedSum {α β : Type _} [Inhabited α] : Inhabited (α ⊕ β) :=
+ ⟨.inl default⟩
+
+/-- Initialise the environmental extension to locally store polynomial-like notations. -/
+initialize declaredExt : DeclaredExt ← registerSimpleScopedEnvExtension <|
+ { addEntry old new := insert new old
+ initial := {} }
+
+/-- Given a declaration of polynomial-like notation (e.g. `(Fin 37)[x,y,z][[t]]`), parse it fully to
+return the head (e.g. `(Fin 37)`), the raw body (e.g. `"[x,y,z][[t]]`"), the total type generated
+(e.g. `PowerSeries (MvPolynomial (Fin 3) (Fin 37))`), and the terms corresponding to each declared
+identifier (e.g. `x := PowerSeries.C (MvPolynomial.X 0)`). -/
+def _root_.Lean.TSyntax.parsePolyesqueFull (p : Polyesque) :
+ CoreM (String × String × Bool × Term × Array Term × Array (Ident × Term)) := do
```
RETRIEVED CANDIDATES (top-20 by hunk-embedding similarity, sorted by sim desc):
--- candidate 1 (sim=0.760, past_pr=#34582, file=Mathlib/Tactic/Ring/NamePolyVars.lean) ---
PAST HUNK:
```
@@ -44,7 +44,7 @@ name_poly_vars X, Y, Z over R
#check Y -- Y : MvPolynomial (Fin 3) R
```
-/
-syntax (name := namePolyVarsOver) "name_poly_vars " ident,+ " over " term : command
+syntax (name := namePolyVarsOver) "name_poly_vars" ppSpace (ident ppSpace),+ " over " term : command
```
PAST COMMENT (from reviewer):
Does `over` need the same treatment? Doesn't this lead to `ppSpace` followed by `" over "`, that is, two spaces?
--- candidate 2 (sim=0.669, past_pr=#9480, file=Mathlib/SetTheory/Cardinal/FieldEmb.lean) ---
PAST HUNK:
```
@@ -0,0 +1,606 @@
+/-
+Copyright (c) 2024 Junyan Xu. All rights reserved.
+Released under Apache 2.0 license as described in the file LICENSE.
+Authors: Junyan Xu
+-/
+import Mathlib.FieldTheory.MvPolynomial
```
PAST COMMENT (from reviewer):
I think this file should probably be somewhere in the `FieldTheory` folder rather than the `SetTheory` folder.
--- candidate 3 (sim=0.658, past_pr=#13845, file=Mathlib/Algebra/Polynomial/Bivariate.lean) ---
PAST HUNK:
```
@@ -0,0 +1,73 @@
+/-
+Copyright (c) 2024 Junyan Xu. All rights reserved.
+Released under Apache 2.0 license as described in the file LICENSE.
+Authors: Junyan Xu
+-/
+import Mathlib.Algebra.Polynomial.AlgebraMap
+
+/-!
+# Bivariate polynomials
+
+This file introduces the notation `R[X][Y]` for the polynomial ring `R[X][X]` in two variables,
+and the notation `Y` for the second variable, in the `PolynomialPolynomial` scope.
```
PAST COMMENT (from reviewer):
Maybe make a poll on Zulip, yeah
--- candidate 4 (sim=0.658, past_pr=#13845, file=Mathlib/Algebra/Polynomial/Bivariate.lean) ---
PAST HUNK:
```
@@ -0,0 +1,73 @@
+/-
+Copyright (c) 2024 Junyan Xu. All rights reserved.
+Released under Apache 2.0 license as described in the file LICENSE.
+Authors: Junyan Xu
+-/
+import Mathlib.Algebra.Polynomial.AlgebraMap
+
+/-!
+# Bivariate polynomials
+
+This file introduces the notation `R[X][Y]` for the polynomial ring `R[X][X]` in two variables,
+and the notation `Y` for the second variable, in the `PolynomialPolynomial` scope.
```
PAST COMMENT (from reviewer):
Ah, I just saw your other comment - now I think that we should definitely change `evalEval` to `eval2` if we want to change `PolynomialPolynomial` to `Polynomial2`....
--- candidate 5 (sim=0.657, past_pr=#80, file=Mathlib/Mathport/Syntax.lean) ---
PAST HUNK:
```
@@ -0,0 +1,737 @@
... [684 lines above hidden]
+syntax (name := lint) "#lint" Lint.args : command
+syntax (name := lintMathlib) "#lint_mathlib" Lint.args : command
+syntax (name := lintAll) "#lint_all" Lint.args : command
+syntax (name := listLinters) "#list_linters" : command
+
+syntax (name := copyDocString) "copy_doc_string " ident " → " ident* : command
+syntax (name := libraryNote) docComment "library_note " str : command
+syntax (name := addTacticDoc) (docComment)? "add_tactic_doc " term : command
+syntax (name := addDeclDoc) docComment "add_decl_doc " ident : command
+
+syntax (name := setupTacticParser) "setup_tactic_parser" : command
+-- See Mathlib.Tactic.OpenPrivate, which provides an alternative:
+-- syntax (name := importPrivate) "import_private " ident (" from " ident)? : command
```
PAST COMMENT (from reviewer):
It's not a match:
```lean
syntax (name := openPrivate) "open private" ident* ("in" ident*)? ("from" ident*)? : command
```
so instead you should leave this one uncommented until mathport is retargeted to use `open private` syntax instead.
--- candidate 6 (sim=0.656, past_pr=#10866, file=Mathlib/RingTheory/MvPowerSeries/Basic.lean) ---
PAST HUNK:
```
@@ -0,0 +1,946 @@
... [864 lines above hidden]
+#align mv_polynomial.coe_inj MvPolynomial.coe_inj
+
+@[simp]
+theorem coe_eq_zero_iff : (φ : MvPowerSeries σ R) = 0 ↔ φ = 0 := by rw [← coe_zero, coe_inj]
+#align mv_polynomial.coe_eq_zero_iff MvPolynomial.coe_eq_zero_iff
+
+@[simp]
+theorem coe_eq_one_iff : (φ : MvPowerSeries σ R) = 1 ↔ φ = 1 := by rw [← coe_one, coe_inj]
+#align mv_polynomial.coe_eq_one_iff MvPolynomial.coe_eq_one_iff
+
+/-- The coercion from multivariable polynomials to multivariable power series
+as a ring homomorphism.
+-/
```
PAST COMMENT (from reviewer):
```suggestion
/-- The coercion from multivariable polynomials to multivarite power series
as a ring homomorphism.
-/
```
Here and below, multivariable should become multivariate in accordance with the beginning of the file.
--- candidate 7 (sim=0.648, past_pr=#80, file=Mathlib/Mathport/Syntax.lean) ---
PAST HUNK:
```
@@ -0,0 +1,727 @@
... [618 lines above hidden]
+syntax (name := slice) "slice " num num : conv
+
+end Conv
+end Tactic
+
+namespace Attr
+
+syntax (name := intro) "intro" : attr
+syntax (name := intro!) "intro!" : attr
+
+syntax (name := nolint) "nolint" (ppSpace ident)* : attr
+
+syntax (name := ext) "ext" (ppSpace ident)? : tactic
```
PAST COMMENT (from reviewer):
```suggestion
syntax (name := ext) "ext" (ppSpace ident)? : attr
```
I know it's not used with a name right now, but this is part of the original tactic. Note that it is already simplified from the original syntax which used a list of names and `(->)`, this was PR leanprover-community/mathlib#8785 . But the name argument is actually useful in principle and I could not find a reason to drop the feature, although porting will be trivial since the feature isn't used.
In other words, this is a mathlib4 todo list for us to design the lean 4 tactic language we want to support with attention to lean 3 parity, not just a basis for synport. Removing the argument and erroring on any use of the with-argument form in synport is an option, but I don't want such decreases in functio
... [truncated]
--- candidate 8 (sim=0.631, past_pr=#33188, file=Mathlib/RingTheory/MvPowerSeries/Rename.lean) ---
PAST HUNK:
```
@@ -0,0 +1,309 @@
... [3 lines above hidden]
+Released under Apache 2.0 license as described in the file LICENSE.
+Authors: Bingyu Xia
+-/
+module
+
+public import Mathlib.Order.Filter.Cofinite
+public import Mathlib.RingTheory.MvPowerSeries.Basic
+public import Mathlib.Algebra.MvPolynomial.Rename
+
+/-!
+# Renaming variables of power series
+
+This file establishes the `rename` operation on multivariate power series
```
PAST COMMENT (from reviewer):
Can you add a comment explaining that a condition is needed? I like the example from power series of infinitely many variables to one variable power series. You cannot rename each `X_i` to `X` since `X_0 + X_1 + ...` is a power series.
--- candidate 9 (sim=0.629, past_pr=#14866, file=Mathlib/RingTheory/MvPowerSeries/Basic.lean) ---
PAST HUNK:
```
@@ -19,6 +21,34 @@ A formal power series is to a polynomial like an infinite sum is to a finite sum
We provide the natural inclusion from multivariate polynomials to multivariate formal power series.
+## Main definitions
```
PAST COMMENT (from reviewer):
I'm happy with the changes to this file. If you split it into a separate PR, then it could be merged already.
--- candidate 10 (sim=0.628, past_pr=#25925, file=Mathlib/Algebra/MvPolynomial/NoZeroDivisors.lean) ---
PAST HUNK:
```
+/-
+Copyright (c) 2025 Bolton Bailey. All rights reserved.
+Released under Apache 2.0 license as described in the file LICENSE.
+Authors: Bolton Bailey
+-/
+module
+
+public import Mathlib.Algebra.MvPolynomial.Variables
+public import Mathlib.Algebra.MvPolynomial.Equiv
+public import Mathlib.RingTheory.MvPolynomial.MonomialOrder.DegLex
+
+/-!
+# Multivariate polynomials over `NoZeroDivisors`
```
PAST COMMENT (from reviewer):
```suggestion
# Multivariate polynomials over integral domains
```
I know the title is not 100% accurate, but for a mathematician is surely fine.
--- candidate 11 (sim=0.626, past_pr=#10866, file=Mathlib/RingTheory/MvPowerSeries/Trunc.lean) ---
PAST HUNK:
```
+/-
+Copyright (c) 2019 Johan Commelin. All rights reserved.
+Released under Apache 2.0 license as described in the file LICENSE.
+Authors: Johan Commelin, Kenny Lau
+-/
+
+import Mathlib.RingTheory.MvPowerSeries.Basic
+import Mathlib.Data.Finsupp.Interval
+-- import Mathlib.LinearAlgebra.StdBasis
+-- import Mathlib.Tactic.Linarith
+-- import Mathlib.Data.MvPolynomial.Basic
+-- import Mathlib.RingTheory.Multiplicity
+-- import Mathlib.Data.Finset.PiAntidiagonal
```
PAST COMMENT (from reviewer):
Please remove these. And also elsewhere (I didn't check if this is the only place).
--- candidate 12 (sim=0.625, past_pr=#14454, file=Mathlib/RingTheory/MvPowerSeries/NoZeroDivisors.lean) ---
PAST HUNK:
```
@@ -0,0 +1,72 @@
+/-
+Copyright (c) 2024 Antoine Chambert-Loir. All rights reserved.
+Released under Apache 2.0 license as described in the file LICENSE.
+Authors: Antoine Chambert-Loir
+-/
+
+import Mathlib.RingTheory.MvPowerSeries.Basic
+import Mathlib.RingTheory.MvPolynomial.Homogeneous
```
PAST COMMENT (from reviewer):
```suggestion
```
--- candidate 13 (sim=0.624, past_pr=#17580, file=Mathlib/Tactic/Linter/Common.lean) ---
PAST HUNK:
```
@@ -0,0 +1,36 @@
+/-
+Copyright (c) 2024 Moritz Firsching All rights reserved.
+Released under Apache 2.0 license as described in the file LICENSE.
+Authors: Damiano Testa, Moritz Firsching
+-/
+
+import Lean.Elab.Command
+open Lean Parser Elab Command Meta
```
PAST COMMENT (from reviewer):
The style linter complains: you should put the module docstring before any open statements.
--- candidate 14 (sim=0.622, past_pr=#15158, file=Mathlib/RingTheory/MvPowerSeries/Substitution.lean) ---
PAST HUNK:
```
@@ -0,0 +1,977 @@
... [3 lines above hidden]
+Released under Apache 2.0 license as described in the file LICENSE.
+Authors: Antoine Chambert-Loir, María Inés de Frutos Fernández
+-/
+
+import Mathlib.Algebra.MvPolynomial.CommRing
+import Mathlib.LinearAlgebra.Finsupp.Pi
+import Mathlib.RingTheory.MvPowerSeries.Evaluation
+import Mathlib.RingTheory.MvPowerSeries.LinearTopology
+import Mathlib.RingTheory.MvPowerSeries.Trunc
+import Mathlib.RingTheory.PowerSeries.Basic
+import Mathlib.RingTheory.Nilpotent.Basic
+import Mathlib.Topology.Algebra.Algebra
+import Mathlib.Topology.UniformSpace.DiscreteUniformity
```
PAST COMMENT (from reviewer):
```suggestion
import Mathlib.LinearAlgebra.Finsupp.Pi
import Mathlib.RingTheory.MvPowerSeries.Evaluation
import Mathlib.RingTheory.MvPowerSeries.LinearTopology
import Mathlib.RingTheory.PowerSeries.Basic
import Mathlib.RingTheory.Nilpotent.Basic
import Mathlib.Topology.UniformSpace.DiscreteUniformity
```
--- candidate 15 (sim=0.617, past_pr=#21539, file=Mathlib/LinearAlgebra/SymmetricAlgebra/MvPolynomial.lean) ---
PAST HUNK:
```
@@ -0,0 +1,80 @@
+/-
+Copyright (c) 2025 Raphael Douglas Giles. All rights reserved.
+Released under Apache 2.0 license as described in the file LICENSE.
+Authors: Raphael Douglas Giles, Zhixuan Dai, Zhenyan Fu, Yiming Fu, Jingting Wang
+-/
+import Mathlib.LinearAlgebra.SymmetricAlgebra.Basic
+import Mathlib.LinearAlgebra.Dimension.Basic
+import Mathlib.RingTheory.MvPolynomial
+
+/-!
```
PAST COMMENT (from reviewer):
Sure! That's a good idea.
--- candidate 16 (sim=0.617, past_pr=#21539, file=Mathlib/LinearAlgebra/SymmetricAlgebra/MvPolynomial.lean) ---
PAST HUNK:
```
@@ -0,0 +1,80 @@
+/-
+Copyright (c) 2025 Raphael Douglas Giles. All rights reserved.
+Released under Apache 2.0 license as described in the file LICENSE.
+Authors: Raphael Douglas Giles, Zhixuan Dai, Zhenyan Fu, Yiming Fu, Jingting Wang
+-/
+import Mathlib.LinearAlgebra.SymmetricAlgebra.Basic
+import Mathlib.LinearAlgebra.Dimension.Basic
+import Mathlib.RingTheory.MvPolynomial
+
+/-!
+# Main Definitions
```
PAST COMMENT (from reviewer):
Well, I didn't remember having copied that from another file, and I'll fix this now according to your comment below. But since you mentioned this, I just ctrl+F `\n# Main Definitions` and ` #Main Definitions` in VS Code, and checked every file with this appearing.
I found only `Mathlib.FieldTheory.Galois.GaloisClosure` starting with the first title being `# Main definitions and results`.
--- candidate 17 (sim=0.616, past_pr=#7728, file=Mathlib/Data/Polynomial/Module.lean) ---
PAST HUNK:
```
@@ -3,28 +3,95 @@ Copyright (c) 2022 Andrew Yang. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Andrew Yang
-/
-import Mathlib.RingTheory.FiniteType
-
-#align_import data.polynomial.module from "leanprover-community/mathlib"@"63417e01fbc711beaf25fa73b6edb395c0cfddd0"
```
PAST COMMENT (from reviewer):
This line should be preserved
--- candidate 18 (sim=0.615, past_pr=#17580, file=Mathlib/Tactic/Linter/Common.lean) ---
PAST HUNK:
```
@@ -0,0 +1,32 @@
+/-
+Copyright (c) 2024 Moritz Firsching All rights reserved.
+Released under Apache 2.0 license as described in the file LICENSE.
+Authors: Damiano Testa, Moritz Firsching
+-/
+
+import Lean.Elab.Command
```
PAST COMMENT (from reviewer):
```suggestion
import Lean.DeclarationRange
```
not too important, since it is hard not to import `Lean.Elab.Command`, but this file seems to only need this earlier import.
--- candidate 19 (sim=0.613, past_pr=#23552, file=Mathlib/RingTheory/PowerSeries/Substitution.lean) ---
PAST HUNK:
```
@@ -0,0 +1,293 @@
+/-
+Copyright (c) 2025 Antoine Chambert-Loir, María Inés de Frutos Fernández. All rights reserved.
+Released under Apache 2.0 license as described in the file LICENSE.
+Authors: Antoine Chambert-Loir, María Inés de Frutos Fernández
+-/
+
+import Mathlib.LinearAlgebra.Finsupp.Pi
+import Mathlib.RingTheory.MvPowerSeries.Substitution
+import Mathlib.RingTheory.PowerSeries.Evaluation
+import Mathlib.RingTheory.PowerSeries.Basic
```
PAST COMMENT (from reviewer):
```suggestion
import Mathlib.RingTheory.MvPowerSeries.Substitution
import Mathlib.RingTheory.PowerSeries.Evaluation
```
I don't know why `shake` does not flag this.
--- candidate 20 (sim=0.612, past_pr=#12572, file=Mathlib/RingTheory/MvPolynomial/Symmetric.lean) ---
PAST HUNK:
```
@@ -3,17 +3,20 @@ Copyright (c) 2020 Hanting Zhang. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Hanting Zhang, Johan Commelin
-/
+
import Mathlib.Algebra.Algebra.Subalgebra.Basic
-import Mathlib.Algebra.MvPolynomial.Rename
import Mathlib.Algebra.MvPolynomial.CommRing
+import Mathlib.Algebra.MvPolynomial.Rename
+import Mathlib.Combinatorics.Enumerative.Partition
+import Mathlib.Data.Sym.Basic
```
PAST COMMENT (from reviewer):
```suggestion
import Mathlib.Combinatorics.Enumerative.Partition
```
Redundant imports?
Decide which candidates' comments genuinely apply to the NEW hunk. If none, say so. Output JSON only.
[ASSISTANT]
----------------------------------------------------------------------------------------------------
{
"summary": "Adjust the new syntax declaration to use ppSpace instead of a literal trailing space after the command name, consistent with prior feedback in this file.",
"confidence": "high",
"strong_matches": [
{
"past_pr": 34582,
"past_file": "Mathlib/Tactic/Ring/NamePolyVars.lean",
"past_comment_excerpt": "Does `over` need the same treatment? Doesn't this lead to `ppSpace` followed by ` over `, that is, two spaces?",
"applies_because": "The new syntax uses a literal trailing space in \"name_poly_vars \", similar to the earlier spacing issue addressed by switching to ppSpace.",
"suggested_adaptation": "Rewrite as: syntax (name := declare) \"name_poly_vars\" ppSpace polyesque : command to avoid hard-coded spaces and match the earlier adjustment.",
"supporting_past_prs": [
34582
]
}
],
"weak_observations": []
}