Skip to content

Commit ac1ee15

Browse files
author
mathlib4-bot
committed
Merge commit '5212dc478426d5caca02fc5aea6df6d211fbdd7e' into bump/nightly-2026-04-06
2 parents dd30058 + 5212dc4 commit ac1ee15

14 files changed

Lines changed: 75 additions & 25 deletions

File tree

Mathlib/Analysis/SpecialFunctions/ContinuousFunctionalCalculus/Rpow/RingInverseOrder.lean

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,22 @@ public lemma convexOn_ringInverse :
4848
by_cases ha' : a = 0
4949
· have hb' : b = 1 := by grind
5050
simp only [ha', hb', one_mul, zero_add, gt_iff_lt]
51-
grind
51+
#adaptation_note /-- Before nightly-2026-06-04, this was just `grind.
52+
`spectrum_pos` is not activating in `grind` despite the
53+
```
54+
grind_pattern IsStrictlyPositive.spectrum_pos => x ∈ spectrum 𝕜 a, IsStrictlyPositive a
55+
```
56+
rule, because `grind` will not fill in the `𝕜 := ℝ`. -/
57+
exact zpos.spectrum_pos hr
5258
· grind [add_pos_of_pos_of_nonneg, mul_nonneg]
5359
have h₂ : (a • 1 + b • z ^ (-1 : ℝ)) = cfc (fun r => (a + b * r ^ (-1 : ℝ))) z := by
5460
rw [CFC.rpow_eq_cfc_real zpos.nonneg]
5561
have hcont : ContinuousOn (fun r : ℝ => (r ^ (-1 : ℝ))) (spectrum ℝ z) :=
56-
ContinuousOn.rpow_const (f := id) (by fun_prop) (by grind)
62+
ContinuousOn.rpow_const (f := id) (by fun_prop) (by
63+
#adaptation_note /-- Before nightly-2026-06-04, this was just `grind. -/
64+
intro x h
65+
have := IsStrictlyPositive.spectrum_pos (𝕜 := ℝ) zpos h
66+
grind)
5767
rw [← cfc_smul b _ z hcont, ← Algebra.algebraMap_eq_smul_one, ← cfc_const_add a _ z]
5868
refine cfc_congr fun r hr => ?_
5969
simp
@@ -72,7 +82,11 @@ public lemma convexOn_ringInverse :
7282
have : 0 ≤ b * r := by positivity
7383
cases lt_or_eq_of_le ha <;> grind
7484
· refine ContinuousOn.const_add (ContinuousOn.const_mul ?_ _) _
75-
exact ContinuousOn.rpow_const (by fun_prop) (by grind)
85+
exact ContinuousOn.rpow_const (by fun_prop) (by
86+
#adaptation_note /-- Before nightly-2026-06-04, this was just `grind. -/
87+
intro x h
88+
have := IsStrictlyPositive.spectrum_pos (𝕜 := ℝ) zpos h
89+
grind)
7690
· intro r hr
7791
suffices (a • 1 + b • r) ^ (-1 : ℤ) ≤ a • 1 ^ (-1 : ℤ) + b • r ^ (-1 : ℤ) by
7892
simp_rw [← Real.rpow_intCast] at this

Mathlib/Analysis/SpecialFunctions/Pow/NthRootLemmas.lean

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,20 @@ private theorem nthRoot.lt_pow_go_succ_aux0 (hb : b ≠ 0) :
6464
rw [Nat.le_div_iff_mul_le (by positivity), Nat.mul_comm,
6565
← Nat.add_mul_div_right _ _ (by positivity),
6666
Nat.le_div_iff_mul_le (by positivity)]
67+
#adaptation_note /-- Prior to nightly-2026-04-06, this was
68+
```
6769
have := (Commute.all (b : ℤ) (a - b)).pow_add_mul_le_add_pow_of_sq_nonneg
6870
(by positivity) (sq_nonneg _) (sq_nonneg _) (by grind) (n + 1)
6971
grind
72+
```
73+
-/
74+
zify
75+
have h := pow_add_mul_le_add_pow_of_sq_nonneg (a := (b : ℤ)) (b := (a : ℤ) - b)
76+
(ha := by positivity) (Hsq := by positivity) (Hsq' := by positivity) (H := by omega)
77+
(n := n + 1)
78+
rw [← sub_nonneg] at h ⊢
79+
convert h using 1
80+
rw [pow_succ]; push_cast; ring1
7081

7182
private theorem nthRoot.always_exists (n a : ℕ) :
7283
∃ c, c ^ (n + 1) ≤ a ∧ a < (c + 1) ^ (n + 1) := by

Mathlib/Analysis/SpecialFunctions/Trigonometric/Chebyshev/RootsExtrema.lean

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,15 @@ theorem eval_T_real_mem_Icc (n : ℤ) {x : ℝ} (hx : x ∈ Set.Icc (-1) 1) :
4444
grind [T_real_cos, cos_mem_Icc]
4545

4646
theorem abs_eval_T_real_le_one (n : ℤ) {x : ℝ} (hx : |x| ≤ 1) :
47-
|(T ℝ n).eval x| ≤ 1 := by grind [eval_T_real_mem_Icc]
47+
|(T ℝ n).eval x| ≤ 1 := by
48+
#adaptation_note /-- Before nightly-2026-04-07, this was just
49+
`grind [eval_T_real_mem_Icc]`. `grind`'s e-matching now keeps the
50+
`Polynomial.eval` produced by the lemma (which uses `instCommSemiring.toSemiring`)
51+
and the `Polynomial.eval` propagated by abs unfolding (which uses `Real.semiring`)
52+
as distinct atoms, even though they are `rfl`-equal, so the contradiction is
53+
never found. -/
54+
have h := eval_T_real_mem_Icc n (Set.mem_Icc.mpr (abs_le.mp hx))
55+
exact abs_le.mpr (Set.mem_Icc.mp h)
4856

4957
theorem one_le_eval_T_real (n : ℤ) {x : ℝ} (hx : 1 ≤ x) : 1 ≤ (T ℝ n).eval x := by
5058
rw [← cosh_arcosh hx]

Mathlib/Computability/Partrec.lean

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -718,9 +718,6 @@ theorem fix_aux {α σ} (f : α →. σ ⊕ α) (a : α) (b : σ) :
718718
b ∈ PFun.fix f a := by
719719
intro F; refine ⟨fun h => ?_, fun h => ?_⟩
720720
· rcases h with ⟨n, ⟨_x, h₁⟩, h₂⟩
721-
#adaptation_note /-- Before leanprover/lean4#13166, the proof from here to the end of the
722-
first branch was:
723-
```
724721
have : ∀ m a', Sum.inr a' ∈ F a m → b ∈ PFun.fix f a' → b ∈ PFun.fix f a := by
725722
intro m a' am ba
726723
induction m generalizing a' with simp [F] at am
@@ -754,9 +751,9 @@ theorem fix_aux {α σ} (f : α →. σ ⊕ α) (a : α) (b : σ) :
754751
· simpa [F] using Or.inr ⟨_, hk, h₂⟩
755752
· rwa [le_antisymm (Nat.le_of_lt_succ mk) km]
756753
· rcases IH _ am₃ k.succ (by simpa [F] using ⟨_, hk, am₃⟩) with ⟨n, hn₁, hn₂⟩
757-
#adaptation_note /-- After leanprover/lean4#13166 which arrived in nightly-2026-03-28:
758-
This `clear_value` used to not be necessary.
759-
-/
754+
#adaptation_note /-- Before https://github.com/leanprover/lean4/pull/13166
755+
(replacing grind's canonicalizer with a type-directed normalizer),
756+
the `clear_value F` was not required here. -/
760757
clear_value F
761758
grind
762759

Mathlib/NumberTheory/ModularForms/EisensteinSeries/E2/Transform.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ lemma G2_eq_tsum_G2Term (z : ℍ) : G2 z = ∑' m, ∑' n, G2Term z ![m, n] := b
136136
exact tsum_congr (fun b ↦ by simp [eisSummand, G2Term, aux_identity z a b, zpow_ofNat])
137137
· simpa only [tsum_symmetricIco_linear_sub_linear_add_one_eq_zero z, add_zero]
138138
using (G2Term_prod_summable z).prod
139-
· grind [(G2Term_prod_summable z).prod.congr]
139+
· exact (G2Term_prod_summable z).prod
140140
· exact summable_zero.congr
141141
fun b ↦ by simp [← tsum_symmetricIco_linear_sub_linear_add_one_eq_zero z b]
142142

Mathlib/NumberTheory/Padics/MahlerBasis.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,12 +176,12 @@ private lemma bojanic_mahler_step2 {f : C(ℤ_[p], E)} {s t : ℕ}
176176
refine (nnnorm_smul_le _ _).trans <| mul_le_mul_of_nonneg_right ?_ (by simp only [zero_le])
177177
-- remains to show norm of binomial coeff is `≤ p⁻¹`
178178
rw [mem_range] at hi
179-
have : 0 < (p ^ t).choose (i + 1) := Nat.choose_pos (by lia)
179+
have : 0 < (p ^ t).choose (i + 1) := Nat.choose_pos (by omega)
180180
rw [← zpow_neg_one, ← coe_le_coe, coe_nnnorm, PadicInt.norm_eq_zpow_neg_valuation
181181
(mod_cast this.ne'), coe_zpow, NNReal.coe_natCast,
182182
zpow_le_zpow_iff_right₀ (mod_cast hp.out.one_lt), neg_le_neg_iff,
183183
← PadicInt.valuation_coe, PadicInt.coe_natCast, Padic.valuation_natCast, Nat.one_le_cast]
184-
exact one_le_padicValNat_of_dvd this.ne' <| hp.out.dvd_choose_pow (by lia) (by lia)
184+
exact one_le_padicValNat_of_dvd this.ne' <| hp.out.dvd_choose_pow (by lia) (by omega)
185185
· -- Bounding the sum over `range (n + 1)`: every term is small by the choice of `t`
186186
refine norm_sum_le_of_forall_le_of_nonempty nonempty_range_add_one (fun i _ ↦ ?_)
187187
calc ‖((-1 : ℤ) ^ (n - i) * n.choose i) • (f (i + ↑(p ^ t)) - f i)‖

Mathlib/RingTheory/LocalRing/ResidueField/Polynomial.lean

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ def residueFieldMapCAlgEquiv [J.LiesOver I] (hJ : J = I.map C) :
6060
apply_fun aeval (algebraMap R[X] J.ResidueField X) at hr
6161
simpa [hx, aeval_map_algebraMap, aeval_algebraMap_apply, Algebra.smul_def] using hr
6262
refine ((IsUnit.mk0 (algebraMap R I.ResidueField s) (by simpa)).map C).mul_right_injective ?_
63-
simp only [← algebraMap_eq, ← Algebra.smul_def, algebraMap_smul, ← hr]
63+
simp only [← algebraMap_eq, ← Algebra.smul_def]
64+
erw [algebraMap_smul]
65+
simp only [← hr]
6466
simpa [Polynomial.ext_iff, Ideal.mem_map_C_iff] using hJ.le hx
6567
· apply AlgHom.coe_ringHom_injective
6668
apply IsFractionRing.injective_comp_algebraMap (A := I.ResidueField[X])

Mathlib/RingTheory/Smooth/Local.lean

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,14 @@ theorem FormallySmooth.iff_injective_cotangentComplexBaseChange
8686
(cotangentComplexBaseChange R S P (ResidueField S)).baseChange K ∘ₗ
8787
(AlgebraTensorModule.cancelBaseChange _ _ _ _ _).symm.toLinearMap =
8888
(cotangentComplexBaseChange R S P K) := by
89-
ext; simp [cotangentComplexBaseChange_tmul]
89+
ext
90+
#adaptation_note /-- Prior to nightly-2026-04-06, this was just `simp`. -/
91+
simp_rw [AlgebraTensorModule.curry_apply, LinearMap.restrictScalars_comp, curry_apply,
92+
LinearMap.coe_comp, LinearMap.coe_restrictScalars, LinearEquiv.coe_coe, Function.comp_apply,
93+
AlgebraTensorModule.cancelBaseChange_symm_tmul, LinearMap.baseChange_tmul,
94+
cotangentComplexBaseChange_tmul, kerToTensor_apply, one_smul]
95+
erw [AlgebraTensorModule.cancelBaseChange_tmul]
96+
simp
9097
rw [← this]
9198
refine .trans ?_ ((AlgebraTensorModule.cancelBaseChange _ _ _ _ _).comp_injective _).symm
9299
exact ((AlgebraTensorModule.cancelBaseChange _ _ _ _ _).symm.injective_comp _).symm

Mathlib/RingTheory/Spectrum/Prime/FreeLocus.lean

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,8 @@ lemma rankAtStalk_eq (p : PrimeSpectrum R) :
363363
let e : k ⊗[Localization.AtPrime p.asIdeal] (Localization.AtPrime p.asIdeal ⊗[R] M) ≃ₗ[k]
364364
k ⊗[R] M :=
365365
AlgebraTensorModule.cancelBaseChange _ _ _ _ _
366-
rw [← e.finrank_eq, finrank_baseChange, rankAtStalk_eq_finrank_tensorProduct]
366+
rw [← e.finrank_eq]
367+
erw [finrank_baseChange]
368+
rw [rankAtStalk_eq_finrank_tensorProduct]
367369

368370
end Module

Mathlib/RingTheory/Spectrum/Prime/Polynomial.lean

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,16 @@ lemma isNilpotent_tensor_residueField_iff
4545
· have := (algebraMap R (A ⊗[R] I.ResidueField)).codomain_trivial
4646
simp [Subsingleton.elim I ⊤, Subsingleton.elim (f ⊗ₜ[R] (1 : I.ResidueField)) 0]
4747
have : Module.finrank I.ResidueField (I.ResidueField ⊗[R] A) = Module.finrank R A := by
48-
rw [Module.finrank_tensorProduct, Module.finrank_self, one_mul]
48+
rw [Module.finrank_tensorProduct]
49+
erw [Module.finrank_self]
50+
rw [one_mul]
4951
rw [← IsNilpotent.map_iff (Algebra.TensorProduct.comm R A I.ResidueField).injective]
5052
simp only [Algebra.TensorProduct.algebraMap_apply, Algebra.algebraMap_self, RingHom.id_apply,
5153
Algebra.coe_lmul_eq_mul, Algebra.TensorProduct.comm_tmul]
5254
rw [← IsNilpotent.map_iff (Algebra.lmul_injective (R := I.ResidueField)),
5355
LinearMap.isNilpotent_iff_charpoly, ← Algebra.baseChange_lmul, LinearMap.charpoly_baseChange]
54-
simp_rw [this, ← ((LinearMap.mul R A) f).charpoly_natDegree]
56+
erw [this]
57+
simp_rw [← ((LinearMap.mul R A) f).charpoly_natDegree]
5558
constructor
5659
· intro e i hi
5760
replace e := congr(($e).coeff i)
@@ -137,6 +140,7 @@ end PrimeSpectrum
137140

138141
namespace Polynomial
139142

143+
set_option backward.isDefEq.respectTransparency false in
140144
lemma mem_image_comap_C_basicOpen (f : R[X]) (x : PrimeSpectrum R) :
141145
x ∈ comap C '' basicOpen f ↔ ∃ i, f.coeff i ∉ x.asIdeal := by
142146
trans f.map (algebraMap R x.asIdeal.ResidueField) ≠ 0

0 commit comments

Comments
 (0)