Skip to content

Commit 276bbda

Browse files
committed
chore: bump toolchain to v4.29.0-rc7 (#37034)
This brings the new `inferInstanceAs` implementation.
1 parent 5215e9b commit 276bbda

File tree

319 files changed

+712
-777
lines changed

Some content is hidden

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

319 files changed

+712
-777
lines changed

Archive/Imo/Imo1982Q1.lean

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ lemma f₃ : f 3 = 1 := by
7070

7171
lemma superadditive {m n : ℕ+} : f m + f n ≤ f (m + n) := by have h := hf.rel m n; grind
7272

73+
set_option backward.isDefEq.respectTransparency false in
7374
lemma superhomogeneous {m n : ℕ+} : ↑n * f m ≤ f (n * m) := by
7475
induction n with
7576
| one => simp
@@ -83,6 +84,7 @@ lemma superhomogeneous {m n : ℕ+} : ↑n * f m ≤ f (n * m) := by
8384
lemma superlinear {a b c d : ℕ+} : a * f b + c * f d ≤ f (a * b + c * d) :=
8485
(add_le_add hf.superhomogeneous hf.superhomogeneous).trans hf.superadditive
8586

87+
set_option backward.isDefEq.respectTransparency false in
8688
lemma le_mul_three_apply (n : ℕ+) : n ≤ f (3 * n) := by
8789
rw [← mul_one (n : ℕ), ← hf.f₃, mul_comm 3]
8890
exact hf.superhomogeneous

Counterexamples/SorgenfreyLine.lean

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ theorem nhds_basis_Ico_rat (a : ℝₗ) :
8787
rcases exists_rat_btwn hb with ⟨r, har, hrb⟩
8888
exact ⟨r, har, Ico_subset_Ico_right hrb.le⟩
8989

90-
set_option backward.isDefEq.respectTransparency false in
9190
theorem nhds_basis_Ico_inv_pnat (a : ℝₗ) :
9291
(𝓝 a).HasBasis (fun _ : ℕ+ => True) fun n => Ico a (a + (n : ℝₗ)⁻¹) := by
9392
refine (nhds_basis_Ico a).to_hasBasis (fun b hb => ?_) fun n hn =>
@@ -101,7 +100,6 @@ theorem nhds_countable_basis_Ico_inv_pnat (a : ℝₗ) :
101100
(𝓝 a).HasCountableBasis (fun _ : ℕ+ => True) fun n => Ico a (a + (n : ℝₗ)⁻¹) :=
102101
⟨nhds_basis_Ico_inv_pnat a, Set.to_countable _⟩
103102

104-
set_option backward.isDefEq.respectTransparency false in
105103
theorem nhds_antitone_basis_Ico_inv_pnat (a : ℝₗ) :
106104
(𝓝 a).HasAntitoneBasis fun n : ℕ+ => Ico a (a + (n : ℝₗ)⁻¹) :=
107105
⟨nhds_basis_Ico_inv_pnat a, monotone_const.Ico <| Antitone.const_add
@@ -214,7 +212,6 @@ theorem cardinal_antidiagonal (c : ℝₗ) : #{x : ℝₗ × ℝₗ | x.1 + x.2
214212
fun x ↦ ⟨(toReal.symm x, c - toReal.symm x), by simp⟩,
215213
fun ⟨x, hx⟩ ↦ by ext <;> simp [← hx.out], fun x ↦ rfl⟩
216214

217-
set_option backward.isDefEq.respectTransparency false in
218215
/-- Any subset of an antidiagonal `{(x, y) : ℝₗ × ℝₗ| x + y = c}` is a closed set. -/
219216
theorem isClosed_of_subset_antidiagonal {s : Set (ℝₗ × ℝₗ)} {c : ℝₗ} (hs : ∀ x ∈ s, x.1 + x.2 = c) :
220217
IsClosed s := by

Mathlib/Algebra/Algebra/Subalgebra/Lattice.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ instance _root_.AlgEquiv.subsingleton_right [Subsingleton (Subalgebra R B)] :
335335
fun f g => by rw [← f.symm_symm, Subsingleton.elim f.symm g.symm, g.symm_symm]⟩
336336

337337
instance : Unique (Subalgebra R R) :=
338-
{ inferInstanceAs (Inhabited (Subalgebra R R)) with
338+
{ (inferInstance : Inhabited (Subalgebra R R)) with
339339
uniq := by
340340
intro S
341341
refine le_antisymm ?_ bot_le

Mathlib/Algebra/Algebra/ZMod.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def algebraOfModule (n : ℕ) (R : Type*) [Ring R] [Module (ZMod n) R] : Algebra
5555
Algebra.ofModule' (proof · · |>.1) (proof · · |>.2) where
5656
proof (r : ZMod n) (x : R) : r • 1 * x = r • x ∧ x * r • 1 = r • x := by
5757
obtain _ | n := n
58-
· obtain rfl : (inferInstanceAs (Module ℤ R)) = ‹_› := Subsingleton.elim _ _
58+
· obtain rfl : ((inferInstance : Module ℤ R)) = ‹_› := Subsingleton.elim _ _
5959
simp [ZMod, Int.cast_comm]
6060
· obtain ⟨r, rfl⟩ := ZMod.natCast_zmod_surjective r
6161
simp [Nat.cast_smul_eq_nsmul, Nat.cast_comm]

Mathlib/Algebra/BigOperators/Expect.lean

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ lemma expect_univ [Fintype ι] : 𝔼 i, f i = (∑ i, f i) /ℚ Fintype.card ι
122122

123123
@[simp] lemma expect_empty (f : ι → M) : 𝔼 i ∈ ∅, f i = 0 := by simp [expect]
124124

125-
set_option backward.isDefEq.respectTransparency false in
126125
@[simp] lemma expect_singleton (f : ι → M) (i : ι) : 𝔼 j ∈ {i}, f j = f i := by simp [expect]
127126

128127
@[simp] lemma expect_const_zero (s : Finset ι) : 𝔼 _i ∈ s, (0 : M) = 0 := by simp [expect]
@@ -169,7 +168,6 @@ lemma expect_ite_zero (s : Finset ι) (p : ι → Prop) [DecidablePred p]
169168
section DecidableEq
170169
variable [DecidableEq ι]
171170

172-
set_option backward.isDefEq.respectTransparency false in
173171
lemma expect_ite_mem (s t : Finset ι) (f : ι → M) :
174172
𝔼 i ∈ s, (if i ∈ t then f i else 0) = (#(s ∩ t) / #s : ℚ≥0) • 𝔼 i ∈ s ∩ t, f i := by
175173
obtain hst | hst := (s ∩ t).eq_empty_or_nonempty
@@ -255,15 +253,13 @@ most arguments. -/
255253
lemma expect_equiv (e : ι ≃ κ) (hst : ∀ i, i ∈ s ↔ e i ∈ t) (hfg : ∀ i ∈ s, f i = g (e i)) :
256254
𝔼 i ∈ s, f i = 𝔼 i ∈ t, g i := by simp_rw [expect, card_equiv e hst, sum_equiv e hst hfg]
257255

258-
set_option backward.isDefEq.respectTransparency false in
259256
/-- Expectation over a product set equals the expectation of the fiberwise expectations.
260257
261258
For rewriting in the reverse direction, use `Finset.expect_product'`. -/
262259
lemma expect_product (s : Finset ι) (t : Finset κ) (f : ι × κ → M) :
263260
𝔼 x ∈ s ×ˢ t, f x = 𝔼 i ∈ s, 𝔼 j ∈ t, f (i, j) := by
264261
simp only [expect, card_product, sum_product, smul_sum, mul_inv, mul_smul, Nat.cast_mul]
265262

266-
set_option backward.isDefEq.respectTransparency false in
267263
/-- Expectation over a product set equals the expectation of the fiberwise expectations.
268264
269265
For rewriting in the reverse direction, use `Finset.expect_product`. -/
@@ -346,7 +342,6 @@ end Semiring
346342
section CommSemiring
347343
variable [CommSemiring M] [Module ℚ≥0 M] [IsScalarTower ℚ≥0 M M] [SMulCommClass ℚ≥0 M M]
348344

349-
set_option backward.isDefEq.respectTransparency false in
350345
lemma expect_pow (s : Finset ι) (f : ι → M) (n : ℕ) :
351346
(𝔼 i ∈ s, f i) ^ n = 𝔼 p ∈ Fintype.piFinset fun _ : Fin n ↦ s, ∏ i, f (p i) := by
352347
classical

Mathlib/Algebra/BigOperators/Field.lean

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,26 +31,22 @@ lemma Finset.sum_div (s : Finset ι) (f : ι → K) (a : K) :
3131
namespace Finset
3232
variable {α β : Type*} [Fintype β]
3333

34-
set_option backward.isDefEq.respectTransparency false in
3534
@[simp]
3635
lemma dens_disjiUnion (s : Finset α) (t : α → Finset β) (h) :
3736
(s.disjiUnion t h).dens = ∑ a ∈ s, (t a).dens := by
3837
simp [dens, sum_div]
3938

4039
variable {s : Finset α} {t : α → Finset β}
4140

42-
set_option backward.isDefEq.respectTransparency false in
4341
lemma dens_biUnion [DecidableEq β] (h : (s : Set α).PairwiseDisjoint t) :
4442
(s.biUnion t).dens = ∑ u ∈ s, (t u).dens := by
4543
simp [dens, card_biUnion h, sum_div]
4644

47-
set_option backward.isDefEq.respectTransparency false in
4845
lemma dens_biUnion_le [DecidableEq β] : (s.biUnion t).dens ≤ ∑ a ∈ s, (t a).dens := by
4946
simp only [dens, ← sum_div]
5047
gcongr
5148
exact mod_cast card_biUnion_le
5249

53-
set_option backward.isDefEq.respectTransparency false in
5450
lemma dens_eq_sum_dens_fiberwise [DecidableEq α] {f : β → α} {t : Finset β}
5551
(h : (t : Set β).MapsTo f s) : t.dens = ∑ a ∈ s, {b ∈ t | f b = a}.dens := by
5652
simp [dens, ← sum_div, card_eq_sum_card_fiberwise h]

Mathlib/Algebra/Category/AlgCat/Limits.lean

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@ lemma hasLimitsOfSize [UnivLE.{v, w}] : HasLimitsOfSize.{t, v} (AlgCat.{w} R) :=
153153
instance hasLimits : HasLimits (AlgCat.{w} R) :=
154154
AlgCat.hasLimitsOfSize.{w, w, u}
155155

156-
#adaptation_note /-- After nightly-2026-02-23 we need this to avoid timeouts. -/
157156
/-- The forgetful functor from R-algebras to rings preserves all limits.
158157
-/
159158
instance forget₂Ring_preservesLimitsOfSize [UnivLE.{v, w}] :

Mathlib/Algebra/Category/FGModuleCat/Basic.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,15 +196,15 @@ variable (K : Type u) [Field K]
196196

197197
set_option backward.isDefEq.respectTransparency false in
198198
instance (V W : FGModuleCat.{v} K) : Module.Finite K (V.obj ⟶ W.obj) :=
199-
(inferInstanceAs <| Module.Finite K (V →ₗ[K] W)).equiv ModuleCat.homLinearEquiv.symm
199+
((inferInstance : Module.Finite K (V →ₗ[K] W))).equiv ModuleCat.homLinearEquiv.symm
200200

201201
instance (V W : FGModuleCat.{v} K) : Module.Finite K (V ⟶ W) :=
202-
(inferInstanceAs (Module.Finite K (V.obj ⟶ W.obj))).equiv
202+
((inferInstance : Module.Finite K (V.obj ⟶ W.obj))).equiv
203203
InducedCategory.homLinearEquiv.symm
204204

205205
instance : (ModuleCat.isFG K).IsMonoidalClosed where
206206
prop_ihom {X Y} (_ : Module.Finite _ _) (_ : Module.Finite _ _) :=
207-
(inferInstanceAs <| Module.Finite K (X →ₗ[K] Y)).equiv ModuleCat.homLinearEquiv.symm
207+
((inferInstance : Module.Finite K (X →ₗ[K] Y))).equiv ModuleCat.homLinearEquiv.symm
208208

209209
variable (V W : FGModuleCat K)
210210

Mathlib/Algebra/Category/Grp/Limits.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ noncomputable instance limitGroup :
7474
instance : Small.{u} (Functor.sections ((F ⋙ forget₂ GrpCat MonCat) ⋙ forget MonCat)) :=
7575
inferInstanceAs <| Small.{u} (Functor.sections (F ⋙ forget GrpCat))
7676

77+
set_option backward.inferInstanceAs.wrap false in
7778
/-- We show that the forgetful functor `GrpCat ⥤ MonCat` creates limits.
7879
7980
All we need to do is notice that the limit point has a `Group` instance available, and then reuse

Mathlib/Algebra/Category/ModuleCat/ChangeOfRings.lean

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,7 @@ scalar multiplication defined by `s • l := x ↦ l (x • s)` -/
470470
def obj' : ModuleCat S :=
471471
of _ ((restrictScalars f).obj (of _ S) →ₗ[R] M)
472472

473+
set_option backward.inferInstanceAs.wrap.data false in
473474
instance : CoeFun (obj' f M) fun _ => S → M :=
474475
inferInstanceAs <| CoeFun ((restrictScalars f).obj (of _ S) →ₗ[R] M) _
475476

@@ -500,6 +501,7 @@ namespace CoextendScalars
500501

501502
variable {R : Type u₁} {S : Type u₂} [Ring R] [Ring S] (f : R →+* S)
502503

504+
set_option backward.inferInstanceAs.wrap.data false in
503505
instance (M : ModuleCat R) : CoeFun ((coextendScalars f).obj M) fun _ => S → M :=
504506
inferInstanceAs <| CoeFun (CoextendScalars.obj' f M) _
505507

@@ -1040,7 +1042,6 @@ lemma extendScalars_id_comp :
10401042
erw [extendScalarsId_hom_app_one_tmul]
10411043
rfl
10421044

1043-
#adaptation_note /-- After nightly-2026-02-23 we need this to avoid a strange error. -/
10441045
@[reassoc]
10451046
lemma extendScalars_comp_id :
10461047
(extendScalarsComp f₁₂ (RingHom.id R₂)).hom ≫ Functor.whiskerLeft _ (extendScalarsId R₂).hom ≫

0 commit comments

Comments
 (0)