Skip to content

Commit 315f49e

Browse files
authored
chore: adaptations for nightly-2025-12-13 (#142)
1 parent 388ed2a commit 315f49e

File tree

45 files changed

+140
-169
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+140
-169
lines changed

Archive/Imo/Imo2015Q6.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ lemma pool_subset_Icc : ∀ {t}, pool a t ⊆ Icc 0 2014
8585
| t + 1 => by
8686
intro x hx
8787
simp_rw [pool, mem_map, Equiv.coe_toEmbedding, Equiv.subRight_apply] at hx
88-
obtain ⟨y, my, ey⟩ := hx
88+
obtain ⟨y, my, rfl⟩ := hx
8989
suffices y ∈ Icc 1 2015 by rw [mem_Icc] at this ⊢; lia
9090
rw [mem_insert, mem_erase] at my; rcases my with h | ⟨h₁, h₂⟩
9191
· exact h ▸ ha.1 t

Mathlib/Algebra/GroupWithZero/Torsion.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ theorem IsMulTorsionFree.mk' (ih : ∀ x ≠ 0, ∀ y ≠ 0, ∀ n ≠ 0, (x ^ n
2727
refine ⟨fun n hn x y hxy ↦ ?_⟩
2828
by_cases h : x ≠ 0 ∧ y ≠ 0
2929
· exact ih x h.1 y h.2 n hn hxy
30-
grind [pow_eq_zero, zero_pow]
30+
grind [eq_zero_of_pow_eq_zero, zero_pow]
3131

3232
variable [UniqueFactorizationMonoid M] [NormalizationMonoid M] [IsMulTorsionFree Mˣ]
3333

Mathlib/Algebra/Polynomial/Coeff.lean

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,18 @@ end Fewnomials
225225
theorem coeff_mul_X_pow (p : R[X]) (n d : ℕ) :
226226
coeff (p * Polynomial.X ^ n) (d + n) = coeff p d := by
227227
rw [coeff_mul, Finset.sum_eq_single (d, n), coeff_X_pow, if_pos rfl, mul_one]
228-
all_goals grind [mem_antidiagonal, mul_zero]
228+
#adaptation_note
229+
/--
230+
It may be possible to change this back to
231+
`all_goals grind [mem_antidiagonal, mul_zero]`
232+
on nightly-2025-12-14 (or ideally without needing the `mul_zero`),
233+
but if not just remove this note.
234+
The proof by `grind` is a hack, doing arithmetic reasoning (i.e. `mul_zero`) by e-matching.
235+
-/
236+
· rintro ⟨i, j⟩ h1 h2
237+
rw [coeff_X_pow, if_neg, mul_zero]
238+
grind [mem_antidiagonal]
239+
· grind [mem_antidiagonal]
229240

230241
@[simp]
231242
theorem coeff_X_pow_mul (p : R[X]) (n d : ℕ) :

Mathlib/Algebra/Polynomial/RuleOfSigns.lean

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,15 @@ theorem succ_signVariations_le_X_sub_C_mul (hη : 0 < η) (hP : P ≠ 0) :
313313
· --P is zero degree, therefore a constant.
314314
have hcQ : 0 < coeff P 0 := by grind [leadingCoeff]
315315
have hxcQ : coeff ((X - C η) * P) 1 = coeff P 0 := by
316-
grind [coeff_X_sub_C_mul, mul_zero, coeff_eq_zero_of_natDegree_lt]
316+
#adaptation_note
317+
/--
318+
It may be possible to change this back to
319+
`grind [coeff_X_sub_C_mul, mul_zero, coeff_eq_zero_of_natDegree_lt]`
320+
on nightly-2025-12-14 (or ideally without needing the `mul_zero`),
321+
but if not just remove this note.
322+
The proof by `grind` is a hack, doing arithmetic reasoning (i.e. `mul_zero`) by e-matching.
323+
-/
324+
simp_all [coeff_X_sub_C_mul, coeff_eq_zero_of_natDegree_lt]
317325
dsimp [signVariations, coeffList]
318326
rw [withBotSucc_degree_eq_natDegree_add_one hP, withBotSucc_degree_eq_natDegree_add_one h_mul]
319327
simp [h_deg_mul, hxcQ, hη, hcQ, hd, List.range_succ]

Mathlib/AlgebraicTopology/SimplicialSet/Path.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def mk₂ {n : ℕ} {X : Truncated.{u} (n + 1)} (p q : X.Path 1)
104104

105105
/-- For `j + l ≤ m`, a path of length `m` restricts to a path of length `l`, namely
106106
the subpath spanned by the vertices `j ≤ i ≤ j + l` and edges `j ≤ i < j + l`. -/
107-
def interval (f : Path X m) (j l : ℕ) (h : j + l ≤ m := by lia) : Path X l where
107+
def interval (f : Path X m) (j l : ℕ) (h : j + l ≤ m := by omega) : Path X l where
108108
vertex i := f.vertex ⟨j + i, by lia⟩
109109
arrow i := f.arrow ⟨j + i, by lia⟩
110110
arrow_src i := f.arrow_src ⟨j + i, by lia⟩

Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/NonUnital.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ lemma cfcₙHom_eq_cfcₙ_extend {a : A} (g : R → R) (ha : p a) (f : C(σₙ R
259259
have hg0 : (Function.extend Subtype.val f g) 0 = 0 := by
260260
rw [← quasispectrum.coe_zero (R := R) a, Subtype.val_injective.extend_apply]
261261
exact map_zero f
262+
generalize Function.extend Subtype.val f g = f' at *
262263
rw [cfcₙ_apply ..]
263264
congr!
264265

Mathlib/CategoryTheory/Limits/Shapes/WideEqualizers.lean

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,18 +60,18 @@ variable {J : Type w}
6060
inductive WalkingParallelFamily (J : Type w) : Type w
6161
| zero : WalkingParallelFamily J
6262
| one : WalkingParallelFamily J
63+
deriving Inhabited
6364

6465
open WalkingParallelFamily
6566

67+
-- We do not use `deriving DecidableEq` here
68+
-- because it generates an instance with unnecessary hypotheses.
6669
instance : DecidableEq (WalkingParallelFamily J)
6770
| zero, zero => isTrue rfl
68-
| zero, one => isFalse fun t => WalkingParallelFamily.noConfusion t
69-
| one, zero => isFalse fun t => WalkingParallelFamily.noConfusion t
71+
| zero, one => isFalse fun t => by grind
72+
| one, zero => isFalse fun t => by grind
7073
| one, one => isTrue rfl
7174

72-
instance : Inhabited (WalkingParallelFamily J) :=
73-
⟨zero⟩
74-
7575
-- Don't generate unnecessary `sizeOf_spec` lemma which the `simpNF` linter will complain about.
7676
set_option genSizeOfSpec false in
7777
/-- The type family of morphisms for the diagram indexing a wide (co)equalizer. -/

Mathlib/CategoryTheory/Shift/CommShiftTwo.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ noncomputable def CommShift₂Setup.int [Preadditive D] [HasShift D ℤ]
6666
assoc _ _ _ := by
6767
dsimp
6868
rw [← zpow_add, ← zpow_add]
69-
cutsat
69+
lia
7070
commShift _ _ := ⟨by cat_disch⟩
7171
ε p q := (-1) ^ (p * q)
7272

Mathlib/Combinatorics/Quiver/Path.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ def decidableEqBddPathsOfDecidableEq (n : ℕ) (h₁ : DecidableEq V)
270270
| _, _, .nil, .nil => isTrue rfl
271271
| _, _, .nil, .cons _ _
272272
| _, _, .cons _ _, .nil =>
273-
isFalse fun h => Quiver.Path.noConfusion rfl (heq_of_eq (Subtype.mk.inj h))
273+
isFalse fun h => Quiver.Path.noConfusion rfl .rfl .rfl .rfl (heq_of_eq (Subtype.mk.inj h))
274274
| _, _, .cons (b := v') p' α, .cons (b := v'') q' β =>
275275
match v', v'', h₁ v' v'' with
276276
| _, _, isTrue (Eq.refl _) =>

Mathlib/Control/Lawful.lean

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -21,24 +21,6 @@ section
2121

2222
variable {σ : Type u} {m : Type u → Type v} {α β : Type u}
2323

24-
/--
25-
`StateT` doesn't require a constructor, but it appears confusing to declare the
26-
following theorem as a simp theorem.
27-
```lean
28-
@[simp]
29-
theorem run_fun (f : σ → m (α × σ)) (st : σ) : StateT.run (fun s => f s) st = f st :=
30-
rfl
31-
```
32-
If we declare this theorem as a simp theorem, `StateT.run f st` is simplified to `f st` by eta
33-
reduction. This breaks the structure of `StateT`.
34-
So, we declare a constructor-like definition `StateT.mk` and a simp theorem for it.
35-
-/
36-
protected def mk (f : σ → m (α × σ)) : StateT σ m α := f
37-
38-
@[simp]
39-
theorem run_mk (f : σ → m (α × σ)) (st : σ) : StateT.run (StateT.mk f) st = f st :=
40-
rfl
41-
4224
/-- A copy of `LawfulFunctor.map_const` for `StateT` that holds even if `m` is not lawful. -/
4325
protected lemma map_const [Monad m] :
4426
(Functor.mapConst : α → StateT σ m β → StateT σ m α) = Functor.map ∘ Function.const β :=
@@ -62,38 +44,4 @@ theorem run_monadLift {n} [Monad m] [MonadLiftT n m] (x : n α) :
6244
(monadLift x : ExceptT ε m α).run = Except.ok <$> (monadLift x : m α) :=
6345
rfl
6446

65-
@[simp]
66-
theorem run_monadMap {n} [MonadFunctorT n m] (f : ∀ {α}, n α → n α) :
67-
(monadMap (@f) x : ExceptT ε m α).run = monadMap (@f) x.run :=
68-
rfl
69-
7047
end ExceptT
71-
72-
namespace ReaderT
73-
74-
section
75-
76-
variable {m : Type u → Type v}
77-
variable {α σ : Type u}
78-
79-
/--
80-
`ReaderT` doesn't require a constructor, but it appears confusing to declare the
81-
following theorem as a simp theorem.
82-
```lean
83-
@[simp]
84-
theorem run_fun (f : σ → m α) (r : σ) : ReaderT.run (fun r' => f r') r = f r :=
85-
rfl
86-
```
87-
If we declare this theorem as a simp theorem, `ReaderT.run f st` is simplified to `f st` by eta
88-
reduction. This breaks the structure of `ReaderT`.
89-
So, we declare a constructor-like definition `ReaderT.mk` and a simp theorem for it.
90-
-/
91-
protected def mk (f : σ → m α) : ReaderT σ m α := f
92-
93-
@[simp]
94-
theorem run_mk (f : σ → m α) (r : σ) : ReaderT.run (ReaderT.mk f) r = f r :=
95-
rfl
96-
97-
end
98-
99-
end ReaderT

0 commit comments

Comments
 (0)