analysis.special_functions.trigonometric.seriesMathlib.Analysis.SpecialFunctions.Trigonometric.Series

This file has been ported!

Changes since the initial port

The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.

Changes in mathlib3

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(last sync)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -47,9 +47,9 @@ theorem Complex.hasSum_cos' (z : ℂ) :
   dsimp only
   convert hasSum_fintype (_ : Fin 2 → ℂ) using 1
   rw [Fin.sum_univ_two]
-  simp_rw [Fin.val_zero, Fin.val_one, add_zero, pow_succ', pow_mul, mul_pow, neg_sq, ← two_mul,
+  simp_rw [Fin.val_zero, Fin.val_one, add_zero, pow_succ, pow_mul, mul_pow, neg_sq, ← two_mul,
     neg_mul, mul_neg, neg_div, add_right_neg, zero_div, add_zero,
-    mul_div_cancel_left _ (two_ne_zero : (2 : ℂ) ≠ 0)]
+    mul_div_cancel_left₀ _ (two_ne_zero : (2 : ℂ) ≠ 0)]
 #align complex.has_sum_cos' Complex.hasSum_cos'
 -/
 
@@ -71,9 +71,9 @@ theorem Complex.hasSum_sin' (z : ℂ) :
   dsimp only
   convert hasSum_fintype (_ : Fin 2 → ℂ) using 1
   rw [Fin.sum_univ_two]
-  simp_rw [Fin.val_zero, Fin.val_one, add_zero, pow_succ', pow_mul, mul_pow, neg_sq, sub_self,
+  simp_rw [Fin.val_zero, Fin.val_one, add_zero, pow_succ, pow_mul, mul_pow, neg_sq, sub_self,
     MulZeroClass.zero_mul, zero_div, zero_add, neg_mul, mul_neg, neg_div, ← neg_add', ← two_mul,
-    neg_mul, neg_div, mul_assoc, mul_div_cancel_left _ (two_ne_zero : (2 : ℂ) ≠ 0), Complex.div_I]
+    neg_mul, neg_div, mul_assoc, mul_div_cancel_left₀ _ (two_ne_zero : (2 : ℂ) ≠ 0), Complex.div_I]
 #align complex.has_sum_sin' Complex.hasSum_sin'
 -/
 
@@ -93,7 +93,7 @@ theorem Complex.hasSum_sin (z : ℂ) :
     HasSum (fun n : ℕ => (-1) ^ n * z ^ (2 * n + 1) / ↑(2 * n + 1)!) (Complex.sin z) :=
   by
   convert Complex.hasSum_sin' z using 1
-  simp_rw [mul_pow, pow_succ', pow_mul, Complex.I_sq, ← mul_assoc, mul_div_assoc, div_right_comm,
+  simp_rw [mul_pow, pow_succ, pow_mul, Complex.I_sq, ← mul_assoc, mul_div_assoc, div_right_comm,
     div_self Complex.I_ne_zero, mul_comm _ ((-1 : ℂ) ^ _), mul_one_div, mul_div_assoc, mul_assoc]
 #align complex.has_sum_sin Complex.hasSum_sin
 -/
Diff
@@ -41,8 +41,8 @@ theorem Complex.hasSum_cos' (z : ℂ) :
           (NormedSpace.expSeries_div_hasSum_exp ℂ (-z * Complex.I))).div_const
       2
   replace := (Nat.divModEquiv 2).symm.hasSum_iff.mpr this
-  dsimp [Function.comp] at this 
-  simp_rw [← mul_comm 2 _] at this 
+  dsimp [Function.comp] at this
+  simp_rw [← mul_comm 2 _] at this
   refine' this.prod_fiberwise fun k => _
   dsimp only
   convert hasSum_fintype (_ : Fin 2 → ℂ) using 1
@@ -65,8 +65,8 @@ theorem Complex.hasSum_sin' (z : ℂ) :
           Complex.I).div_const
       2
   replace := (Nat.divModEquiv 2).symm.hasSum_iff.mpr this
-  dsimp [Function.comp] at this 
-  simp_rw [← mul_comm 2 _] at this 
+  dsimp [Function.comp] at this
+  simp_rw [← mul_comm 2 _] at this
   refine' this.prod_fiberwise fun k => _
   dsimp only
   convert hasSum_fintype (_ : Fin 2 → ℂ) using 1
Diff
@@ -37,8 +37,8 @@ theorem Complex.hasSum_cos' (z : ℂ) :
   by
   rw [Complex.cos, Complex.exp_eq_exp_ℂ]
   have :=
-    ((expSeries_div_hasSum_exp ℂ (z * Complex.I)).add
-          (expSeries_div_hasSum_exp ℂ (-z * Complex.I))).div_const
+    ((NormedSpace.expSeries_div_hasSum_exp ℂ (z * Complex.I)).add
+          (NormedSpace.expSeries_div_hasSum_exp ℂ (-z * Complex.I))).div_const
       2
   replace := (Nat.divModEquiv 2).symm.hasSum_iff.mpr this
   dsimp [Function.comp] at this 
@@ -60,8 +60,8 @@ theorem Complex.hasSum_sin' (z : ℂ) :
   by
   rw [Complex.sin, Complex.exp_eq_exp_ℂ]
   have :=
-    (((expSeries_div_hasSum_exp ℂ (-z * Complex.I)).sub
-              (expSeries_div_hasSum_exp ℂ (z * Complex.I))).hMul_right
+    (((NormedSpace.expSeries_div_hasSum_exp ℂ (-z * Complex.I)).sub
+              (NormedSpace.expSeries_div_hasSum_exp ℂ (z * Complex.I))).hMul_right
           Complex.I).div_const
       2
   replace := (Nat.divModEquiv 2).symm.hasSum_iff.mpr this
Diff
@@ -3,7 +3,7 @@ Copyright (c) 2023 Eric Wieser. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Eric Wieser
 -/
-import Mathbin.Analysis.SpecialFunctions.Exponential
+import Analysis.SpecialFunctions.Exponential
 
 #align_import analysis.special_functions.trigonometric.series from "leanprover-community/mathlib"@"c20927220ef87bb4962ba08bf6da2ce3cf50a6dd"
 
Diff
@@ -61,7 +61,7 @@ theorem Complex.hasSum_sin' (z : ℂ) :
   rw [Complex.sin, Complex.exp_eq_exp_ℂ]
   have :=
     (((expSeries_div_hasSum_exp ℂ (-z * Complex.I)).sub
-              (expSeries_div_hasSum_exp ℂ (z * Complex.I))).mul_right
+              (expSeries_div_hasSum_exp ℂ (z * Complex.I))).hMul_right
           Complex.I).div_const
       2
   replace := (Nat.divModEquiv 2).symm.hasSum_iff.mpr this
Diff
@@ -2,14 +2,11 @@
 Copyright (c) 2023 Eric Wieser. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Eric Wieser
-
-! This file was ported from Lean 3 source module analysis.special_functions.trigonometric.series
-! leanprover-community/mathlib commit c20927220ef87bb4962ba08bf6da2ce3cf50a6dd
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.Analysis.SpecialFunctions.Exponential
 
+#align_import analysis.special_functions.trigonometric.series from "leanprover-community/mathlib"@"c20927220ef87bb4962ba08bf6da2ce3cf50a6dd"
+
 /-!
 # Trigonometric functions as sums of infinite series
 
Diff
@@ -34,6 +34,7 @@ open scoped Nat
 
 section SinCos
 
+#print Complex.hasSum_cos' /-
 theorem Complex.hasSum_cos' (z : ℂ) :
     HasSum (fun n : ℕ => (z * Complex.I) ^ (2 * n) / ↑(2 * n)!) (Complex.cos z) :=
   by
@@ -53,7 +54,9 @@ theorem Complex.hasSum_cos' (z : ℂ) :
     neg_mul, mul_neg, neg_div, add_right_neg, zero_div, add_zero,
     mul_div_cancel_left _ (two_ne_zero : (2 : ℂ) ≠ 0)]
 #align complex.has_sum_cos' Complex.hasSum_cos'
+-/
 
+#print Complex.hasSum_sin' /-
 theorem Complex.hasSum_sin' (z : ℂ) :
     HasSum (fun n : ℕ => (z * Complex.I) ^ (2 * n + 1) / ↑(2 * n + 1)! / Complex.I)
       (Complex.sin z) :=
@@ -75,7 +78,9 @@ theorem Complex.hasSum_sin' (z : ℂ) :
     MulZeroClass.zero_mul, zero_div, zero_add, neg_mul, mul_neg, neg_div, ← neg_add', ← two_mul,
     neg_mul, neg_div, mul_assoc, mul_div_cancel_left _ (two_ne_zero : (2 : ℂ) ≠ 0), Complex.div_I]
 #align complex.has_sum_sin' Complex.hasSum_sin'
+-/
 
+#print Complex.hasSum_cos /-
 /-- The power series expansion of `complex.cos`. -/
 theorem Complex.hasSum_cos (z : ℂ) :
     HasSum (fun n : ℕ => (-1) ^ n * z ^ (2 * n) / ↑(2 * n)!) (Complex.cos z) :=
@@ -83,7 +88,9 @@ theorem Complex.hasSum_cos (z : ℂ) :
   convert Complex.hasSum_cos' z using 1
   simp_rw [mul_pow, pow_mul, Complex.I_sq, mul_comm]
 #align complex.has_sum_cos Complex.hasSum_cos
+-/
 
+#print Complex.hasSum_sin /-
 /-- The power series expansion of `complex.sin`. -/
 theorem Complex.hasSum_sin (z : ℂ) :
     HasSum (fun n : ℕ => (-1) ^ n * z ^ (2 * n + 1) / ↑(2 * n + 1)!) (Complex.sin z) :=
@@ -92,47 +99,64 @@ theorem Complex.hasSum_sin (z : ℂ) :
   simp_rw [mul_pow, pow_succ', pow_mul, Complex.I_sq, ← mul_assoc, mul_div_assoc, div_right_comm,
     div_self Complex.I_ne_zero, mul_comm _ ((-1 : ℂ) ^ _), mul_one_div, mul_div_assoc, mul_assoc]
 #align complex.has_sum_sin Complex.hasSum_sin
+-/
 
+#print Complex.cos_eq_tsum' /-
 theorem Complex.cos_eq_tsum' (z : ℂ) :
     Complex.cos z = ∑' n : ℕ, (z * Complex.I) ^ (2 * n) / ↑(2 * n)! :=
   (Complex.hasSum_cos' z).tsum_eq.symm
 #align complex.cos_eq_tsum' Complex.cos_eq_tsum'
+-/
 
+#print Complex.sin_eq_tsum' /-
 theorem Complex.sin_eq_tsum' (z : ℂ) :
     Complex.sin z = ∑' n : ℕ, (z * Complex.I) ^ (2 * n + 1) / ↑(2 * n + 1)! / Complex.I :=
   (Complex.hasSum_sin' z).tsum_eq.symm
 #align complex.sin_eq_tsum' Complex.sin_eq_tsum'
+-/
 
+#print Complex.cos_eq_tsum /-
 theorem Complex.cos_eq_tsum (z : ℂ) :
     Complex.cos z = ∑' n : ℕ, (-1) ^ n * z ^ (2 * n) / ↑(2 * n)! :=
   (Complex.hasSum_cos z).tsum_eq.symm
 #align complex.cos_eq_tsum Complex.cos_eq_tsum
+-/
 
+#print Complex.sin_eq_tsum /-
 theorem Complex.sin_eq_tsum (z : ℂ) :
     Complex.sin z = ∑' n : ℕ, (-1) ^ n * z ^ (2 * n + 1) / ↑(2 * n + 1)! :=
   (Complex.hasSum_sin z).tsum_eq.symm
 #align complex.sin_eq_tsum Complex.sin_eq_tsum
+-/
 
+#print Real.hasSum_cos /-
 /-- The power series expansion of `real.cos`. -/
 theorem Real.hasSum_cos (r : ℝ) :
     HasSum (fun n : ℕ => (-1) ^ n * r ^ (2 * n) / ↑(2 * n)!) (Real.cos r) := by
   exact_mod_cast Complex.hasSum_cos r
 #align real.has_sum_cos Real.hasSum_cos
+-/
 
+#print Real.hasSum_sin /-
 /-- The power series expansion of `real.sin`. -/
 theorem Real.hasSum_sin (r : ℝ) :
     HasSum (fun n : ℕ => (-1) ^ n * r ^ (2 * n + 1) / ↑(2 * n + 1)!) (Real.sin r) := by
   exact_mod_cast Complex.hasSum_sin r
 #align real.has_sum_sin Real.hasSum_sin
+-/
 
+#print Real.cos_eq_tsum /-
 theorem Real.cos_eq_tsum (r : ℝ) : Real.cos r = ∑' n : ℕ, (-1) ^ n * r ^ (2 * n) / ↑(2 * n)! :=
   (Real.hasSum_cos r).tsum_eq.symm
 #align real.cos_eq_tsum Real.cos_eq_tsum
+-/
 
+#print Real.sin_eq_tsum /-
 theorem Real.sin_eq_tsum (r : ℝ) :
     Real.sin r = ∑' n : ℕ, (-1) ^ n * r ^ (2 * n + 1) / ↑(2 * n + 1)! :=
   (Real.hasSum_sin r).tsum_eq.symm
 #align real.sin_eq_tsum Real.sin_eq_tsum
+-/
 
 end SinCos
 
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Eric Wieser
 
 ! This file was ported from Lean 3 source module analysis.special_functions.trigonometric.series
-! leanprover-community/mathlib commit ccf84e0d918668460a34aa19d02fe2e0e2286da0
+! leanprover-community/mathlib commit c20927220ef87bb4962ba08bf6da2ce3cf50a6dd
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -13,6 +13,9 @@ import Mathbin.Analysis.SpecialFunctions.Exponential
 /-!
 # Trigonometric functions as sums of infinite series
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 In this file we express trigonometric functions in terms of their series expansion.
 
 ## Main results
Diff
@@ -36,8 +36,8 @@ theorem Complex.hasSum_cos' (z : ℂ) :
   by
   rw [Complex.cos, Complex.exp_eq_exp_ℂ]
   have :=
-    ((exp_series_div_hasSum_exp ℂ (z * Complex.I)).add
-          (exp_series_div_hasSum_exp ℂ (-z * Complex.I))).div_const
+    ((expSeries_div_hasSum_exp ℂ (z * Complex.I)).add
+          (expSeries_div_hasSum_exp ℂ (-z * Complex.I))).div_const
       2
   replace := (Nat.divModEquiv 2).symm.hasSum_iff.mpr this
   dsimp [Function.comp] at this 
@@ -57,8 +57,8 @@ theorem Complex.hasSum_sin' (z : ℂ) :
   by
   rw [Complex.sin, Complex.exp_eq_exp_ℂ]
   have :=
-    (((exp_series_div_hasSum_exp ℂ (-z * Complex.I)).sub
-              (exp_series_div_hasSum_exp ℂ (z * Complex.I))).mul_right
+    (((expSeries_div_hasSum_exp ℂ (-z * Complex.I)).sub
+              (expSeries_div_hasSum_exp ℂ (z * Complex.I))).mul_right
           Complex.I).div_const
       2
   replace := (Nat.divModEquiv 2).symm.hasSum_iff.mpr this
Diff
@@ -40,8 +40,8 @@ theorem Complex.hasSum_cos' (z : ℂ) :
           (exp_series_div_hasSum_exp ℂ (-z * Complex.I))).div_const
       2
   replace := (Nat.divModEquiv 2).symm.hasSum_iff.mpr this
-  dsimp [Function.comp] at this
-  simp_rw [← mul_comm 2 _] at this
+  dsimp [Function.comp] at this 
+  simp_rw [← mul_comm 2 _] at this 
   refine' this.prod_fiberwise fun k => _
   dsimp only
   convert hasSum_fintype (_ : Fin 2 → ℂ) using 1
@@ -62,8 +62,8 @@ theorem Complex.hasSum_sin' (z : ℂ) :
           Complex.I).div_const
       2
   replace := (Nat.divModEquiv 2).symm.hasSum_iff.mpr this
-  dsimp [Function.comp] at this
-  simp_rw [← mul_comm 2 _] at this
+  dsimp [Function.comp] at this 
+  simp_rw [← mul_comm 2 _] at this 
   refine' this.prod_fiberwise fun k => _
   dsimp only
   convert hasSum_fintype (_ : Fin 2 → ℂ) using 1
Diff
@@ -24,7 +24,7 @@ In this file we express trigonometric functions in terms of their series expansi
 -/
 
 
-open Nat
+open scoped Nat
 
 /-! ### `cos` and `sin` for `ℝ` and `ℂ` -/
 
Diff
@@ -78,7 +78,7 @@ theorem Complex.hasSum_cos (z : ℂ) :
     HasSum (fun n : ℕ => (-1) ^ n * z ^ (2 * n) / ↑(2 * n)!) (Complex.cos z) :=
   by
   convert Complex.hasSum_cos' z using 1
-  simp_rw [mul_pow, pow_mul, Complex.i_sq, mul_comm]
+  simp_rw [mul_pow, pow_mul, Complex.I_sq, mul_comm]
 #align complex.has_sum_cos Complex.hasSum_cos
 
 /-- The power series expansion of `complex.sin`. -/
@@ -86,8 +86,8 @@ theorem Complex.hasSum_sin (z : ℂ) :
     HasSum (fun n : ℕ => (-1) ^ n * z ^ (2 * n + 1) / ↑(2 * n + 1)!) (Complex.sin z) :=
   by
   convert Complex.hasSum_sin' z using 1
-  simp_rw [mul_pow, pow_succ', pow_mul, Complex.i_sq, ← mul_assoc, mul_div_assoc, div_right_comm,
-    div_self Complex.i_ne_zero, mul_comm _ ((-1 : ℂ) ^ _), mul_one_div, mul_div_assoc, mul_assoc]
+  simp_rw [mul_pow, pow_succ', pow_mul, Complex.I_sq, ← mul_assoc, mul_div_assoc, div_right_comm,
+    div_self Complex.I_ne_zero, mul_comm _ ((-1 : ℂ) ^ _), mul_one_div, mul_div_assoc, mul_assoc]
 #align complex.has_sum_sin Complex.hasSum_sin
 
 theorem Complex.cos_eq_tsum' (z : ℂ) :
Diff
@@ -69,8 +69,8 @@ theorem Complex.hasSum_sin' (z : ℂ) :
   convert hasSum_fintype (_ : Fin 2 → ℂ) using 1
   rw [Fin.sum_univ_two]
   simp_rw [Fin.val_zero, Fin.val_one, add_zero, pow_succ', pow_mul, mul_pow, neg_sq, sub_self,
-    zero_mul, zero_div, zero_add, neg_mul, mul_neg, neg_div, ← neg_add', ← two_mul, neg_mul,
-    neg_div, mul_assoc, mul_div_cancel_left _ (two_ne_zero : (2 : ℂ) ≠ 0), Complex.div_I]
+    MulZeroClass.zero_mul, zero_div, zero_add, neg_mul, mul_neg, neg_div, ← neg_add', ← two_mul,
+    neg_mul, neg_div, mul_assoc, mul_div_cancel_left _ (two_ne_zero : (2 : ℂ) ≠ 0), Complex.div_I]
 #align complex.has_sum_sin' Complex.hasSum_sin'
 
 /-- The power series expansion of `complex.cos`. -/
Diff
@@ -32,12 +32,12 @@ open Nat
 section SinCos
 
 theorem Complex.hasSum_cos' (z : ℂ) :
-    HasSum (fun n : ℕ => (z * Complex.i) ^ (2 * n) / ↑(2 * n)!) (Complex.cos z) :=
+    HasSum (fun n : ℕ => (z * Complex.I) ^ (2 * n) / ↑(2 * n)!) (Complex.cos z) :=
   by
   rw [Complex.cos, Complex.exp_eq_exp_ℂ]
   have :=
-    ((exp_series_div_hasSum_exp ℂ (z * Complex.i)).add
-          (exp_series_div_hasSum_exp ℂ (-z * Complex.i))).div_const
+    ((exp_series_div_hasSum_exp ℂ (z * Complex.I)).add
+          (exp_series_div_hasSum_exp ℂ (-z * Complex.I))).div_const
       2
   replace := (Nat.divModEquiv 2).symm.hasSum_iff.mpr this
   dsimp [Function.comp] at this
@@ -52,14 +52,14 @@ theorem Complex.hasSum_cos' (z : ℂ) :
 #align complex.has_sum_cos' Complex.hasSum_cos'
 
 theorem Complex.hasSum_sin' (z : ℂ) :
-    HasSum (fun n : ℕ => (z * Complex.i) ^ (2 * n + 1) / ↑(2 * n + 1)! / Complex.i)
+    HasSum (fun n : ℕ => (z * Complex.I) ^ (2 * n + 1) / ↑(2 * n + 1)! / Complex.I)
       (Complex.sin z) :=
   by
   rw [Complex.sin, Complex.exp_eq_exp_ℂ]
   have :=
-    (((exp_series_div_hasSum_exp ℂ (-z * Complex.i)).sub
-              (exp_series_div_hasSum_exp ℂ (z * Complex.i))).mul_right
-          Complex.i).div_const
+    (((exp_series_div_hasSum_exp ℂ (-z * Complex.I)).sub
+              (exp_series_div_hasSum_exp ℂ (z * Complex.I))).mul_right
+          Complex.I).div_const
       2
   replace := (Nat.divModEquiv 2).symm.hasSum_iff.mpr this
   dsimp [Function.comp] at this
@@ -70,7 +70,7 @@ theorem Complex.hasSum_sin' (z : ℂ) :
   rw [Fin.sum_univ_two]
   simp_rw [Fin.val_zero, Fin.val_one, add_zero, pow_succ', pow_mul, mul_pow, neg_sq, sub_self,
     zero_mul, zero_div, zero_add, neg_mul, mul_neg, neg_div, ← neg_add', ← two_mul, neg_mul,
-    neg_div, mul_assoc, mul_div_cancel_left _ (two_ne_zero : (2 : ℂ) ≠ 0), Complex.div_i]
+    neg_div, mul_assoc, mul_div_cancel_left _ (two_ne_zero : (2 : ℂ) ≠ 0), Complex.div_I]
 #align complex.has_sum_sin' Complex.hasSum_sin'
 
 /-- The power series expansion of `complex.cos`. -/
@@ -91,12 +91,12 @@ theorem Complex.hasSum_sin (z : ℂ) :
 #align complex.has_sum_sin Complex.hasSum_sin
 
 theorem Complex.cos_eq_tsum' (z : ℂ) :
-    Complex.cos z = ∑' n : ℕ, (z * Complex.i) ^ (2 * n) / ↑(2 * n)! :=
+    Complex.cos z = ∑' n : ℕ, (z * Complex.I) ^ (2 * n) / ↑(2 * n)! :=
   (Complex.hasSum_cos' z).tsum_eq.symm
 #align complex.cos_eq_tsum' Complex.cos_eq_tsum'
 
 theorem Complex.sin_eq_tsum' (z : ℂ) :
-    Complex.sin z = ∑' n : ℕ, (z * Complex.i) ^ (2 * n + 1) / ↑(2 * n + 1)! / Complex.i :=
+    Complex.sin z = ∑' n : ℕ, (z * Complex.I) ^ (2 * n + 1) / ↑(2 * n + 1)! / Complex.I :=
   (Complex.hasSum_sin' z).tsum_eq.symm
 #align complex.sin_eq_tsum' Complex.sin_eq_tsum'
 

Changes in mathlib4

mathlib3
mathlib4
change the order of operation in zsmulRec and nsmulRec (#11451)

We change the following field in the definition of an additive commutative monoid:

 nsmul_succ : ∀ (n : ℕ) (x : G),
-  AddMonoid.nsmul (n + 1) x = x + AddMonoid.nsmul n x
+  AddMonoid.nsmul (n + 1) x = AddMonoid.nsmul n x + x

where the latter is more natural

We adjust the definitions of ^ in monoids, groups, etc. Originally there was a warning comment about why this natural order was preferred

use x * npowRec n x and not npowRec n x * x in the definition to make sure that definitional unfolding of npowRec is blocked, to avoid deep recursion issues.

but it seems to no longer apply.

Remarks on the PR :

  • pow_succ and pow_succ' have switched their meanings.
  • Most of the time, the proofs were adjusted by priming/unpriming one lemma, or exchanging left and right; a few proofs were more complicated to adjust.
  • In particular, [Mathlib/NumberTheory/RamificationInertia.lean] used Ideal.IsPrime.mul_mem_pow which is defined in [Mathlib/RingTheory/DedekindDomain/Ideal.lean]. Changing the order of operation forced me to add the symmetric lemma Ideal.IsPrime.mem_pow_mul.
  • the docstring for Cauchy condensation test in [Mathlib/Analysis/PSeries.lean] was mathematically incorrect, I added the mention that the function is antitone.
Diff
@@ -41,7 +41,7 @@ theorem Complex.hasSum_cos' (z : ℂ) :
   dsimp only
   convert hasSum_fintype (_ : Fin 2 → ℂ) using 1
   rw [Fin.sum_univ_two]
-  simp_rw [Fin.val_zero, Fin.val_one, add_zero, pow_succ', pow_mul, mul_pow, neg_sq, ← two_mul,
+  simp_rw [Fin.val_zero, Fin.val_one, add_zero, pow_succ, pow_mul, mul_pow, neg_sq, ← two_mul,
     neg_mul, mul_neg, neg_div, add_right_neg, zero_div, add_zero,
     mul_div_cancel_left₀ _ (two_ne_zero : (2 : ℂ) ≠ 0)]
 #align complex.has_sum_cos' Complex.hasSum_cos'
@@ -59,7 +59,7 @@ theorem Complex.hasSum_sin' (z : ℂ) :
   dsimp only
   convert hasSum_fintype (_ : Fin 2 → ℂ) using 1
   rw [Fin.sum_univ_two]
-  simp_rw [Fin.val_zero, Fin.val_one, add_zero, pow_succ', pow_mul, mul_pow, neg_sq, sub_self,
+  simp_rw [Fin.val_zero, Fin.val_one, add_zero, pow_succ, pow_mul, mul_pow, neg_sq, sub_self,
     zero_mul, zero_div, zero_add, neg_mul, mul_neg, neg_div, ← neg_add', ← two_mul,
     neg_mul, neg_div, mul_assoc, mul_div_cancel_left₀ _ (two_ne_zero : (2 : ℂ) ≠ 0), Complex.div_I]
 #align complex.has_sum_sin' Complex.hasSum_sin'
@@ -75,7 +75,7 @@ theorem Complex.hasSum_cos (z : ℂ) :
 theorem Complex.hasSum_sin (z : ℂ) :
     HasSum (fun n : ℕ => (-1) ^ n * z ^ (2 * n + 1) / ↑(2 * n + 1)!) (Complex.sin z) := by
   convert Complex.hasSum_sin' z using 1
-  simp_rw [mul_pow, pow_succ', pow_mul, Complex.I_sq, ← mul_assoc, mul_div_assoc, div_right_comm,
+  simp_rw [mul_pow, pow_succ, pow_mul, Complex.I_sq, ← mul_assoc, mul_div_assoc, div_right_comm,
     div_self Complex.I_ne_zero, mul_comm _ ((-1 : ℂ) ^ _), mul_one_div, mul_div_assoc, mul_assoc]
 #align complex.has_sum_sin Complex.hasSum_sin
 
chore: Rename mul-div cancellation lemmas (#11530)

Lemma names around cancellation of multiplication and division are a mess.

This PR renames a handful of them according to the following table (each big row contains the multiplicative statement, then the three rows contain the GroupWithZero lemma name, the Group lemma, the AddGroup lemma name).

| Statement | New name | Old name | |

Diff
@@ -43,7 +43,7 @@ theorem Complex.hasSum_cos' (z : ℂ) :
   rw [Fin.sum_univ_two]
   simp_rw [Fin.val_zero, Fin.val_one, add_zero, pow_succ', pow_mul, mul_pow, neg_sq, ← two_mul,
     neg_mul, mul_neg, neg_div, add_right_neg, zero_div, add_zero,
-    mul_div_cancel_left _ (two_ne_zero : (2 : ℂ) ≠ 0)]
+    mul_div_cancel_left₀ _ (two_ne_zero : (2 : ℂ) ≠ 0)]
 #align complex.has_sum_cos' Complex.hasSum_cos'
 
 theorem Complex.hasSum_sin' (z : ℂ) :
@@ -61,7 +61,7 @@ theorem Complex.hasSum_sin' (z : ℂ) :
   rw [Fin.sum_univ_two]
   simp_rw [Fin.val_zero, Fin.val_one, add_zero, pow_succ', pow_mul, mul_pow, neg_sq, sub_self,
     zero_mul, zero_div, zero_add, neg_mul, mul_neg, neg_div, ← neg_add', ← two_mul,
-    neg_mul, neg_div, mul_assoc, mul_div_cancel_left _ (two_ne_zero : (2 : ℂ) ≠ 0), Complex.div_I]
+    neg_mul, neg_div, mul_assoc, mul_div_cancel_left₀ _ (two_ne_zero : (2 : ℂ) ≠ 0), Complex.div_I]
 #align complex.has_sum_sin' Complex.hasSum_sin'
 
 /-- The power series expansion of `Complex.cos`. -/
chore(*): replace $ with <| (#9319)

See Zulip thread for the discussion.

Diff
@@ -160,7 +160,7 @@ lemma sinh_eq_tsum (r : ℝ) : sinh r = ∑' n, r ^ (2 * n + 1) / ↑(2 * n + 1)
 
 lemma cosh_le_exp_half_sq (x : ℝ) : cosh x ≤ exp (x ^ 2 / 2) := by
   rw [cosh_eq_tsum, exp_eq_exp_ℝ, exp_eq_tsum]
-  refine tsum_le_tsum (fun i ↦ ?_) x.hasSum_cosh.summable $ expSeries_summable' (x ^ 2 / 2)
+  refine tsum_le_tsum (fun i ↦ ?_) x.hasSum_cosh.summable <| expSeries_summable' (x ^ 2 / 2)
   simp only [div_pow, pow_mul, smul_eq_mul, inv_mul_eq_div, div_div]
   gcongr
   norm_cast
feat: Taylor series for cosh and sinh (#9100)

and derive cosh x ≤ exp (x ^ 2 / 2) as a corollary

Diff
@@ -1,7 +1,7 @@
 /-
 Copyright (c) 2023 Eric Wieser. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
-Authors: Eric Wieser
+Authors: Eric Wieser, Yaël Dillies
 -/
 import Mathlib.Analysis.SpecialFunctions.Exponential
 
@@ -121,3 +121,50 @@ theorem Real.sin_eq_tsum (r : ℝ) :
 #align real.sin_eq_tsum Real.sin_eq_tsum
 
 end SinCos
+
+/-! ### `cosh` and `sinh` for `ℝ` and `ℂ` -/
+
+section SinhCosh
+namespace Complex
+
+/-- The power series expansion of `Complex.cosh`. -/
+lemma hasSum_cosh (z : ℂ) : HasSum (fun n ↦ z ^ (2 * n) / ↑(2 * n)!) (cosh z) := by
+  simpa [mul_assoc, cos_mul_I] using hasSum_cos' (z * I)
+
+/-- The power series expansion of `Complex.sinh`. -/
+lemma hasSum_sinh (z : ℂ) : HasSum (fun n ↦ z ^ (2 * n + 1) / ↑(2 * n + 1)!) (sinh z) := by
+  simpa [mul_assoc, sin_mul_I, neg_pow z, pow_add, pow_mul, neg_mul, neg_div]
+    using (hasSum_sin' (z * I)).mul_right (-I)
+
+lemma cosh_eq_tsum (z : ℂ) : cosh z = ∑' n, z ^ (2 * n) / ↑(2 * n)! := z.hasSum_cosh.tsum_eq.symm
+
+lemma sinh_eq_tsum (z : ℂ) : sinh z = ∑' n, z ^ (2 * n + 1) / ↑(2 * n + 1)! :=
+  z.hasSum_sinh.tsum_eq.symm
+
+end Complex
+
+namespace Real
+
+/-- The power series expansion of `Real.cosh`. -/
+lemma hasSum_cosh (r : ℝ) : HasSum (fun n  ↦ r ^ (2 * n) / ↑(2 * n)!) (cosh r) :=
+  mod_cast Complex.hasSum_cosh r
+
+/-- The power series expansion of `Real.sinh`. -/
+lemma hasSum_sinh (r : ℝ) : HasSum (fun n ↦ r ^ (2 * n + 1) / ↑(2 * n + 1)!) (sinh r) :=
+  mod_cast Complex.hasSum_sinh r
+
+lemma cosh_eq_tsum (r : ℝ) : cosh r = ∑' n, r ^ (2 * n) / ↑(2 * n)! := r.hasSum_cosh.tsum_eq.symm
+
+lemma sinh_eq_tsum (r : ℝ) : sinh r = ∑' n, r ^ (2 * n + 1) / ↑(2 * n + 1)! :=
+  r.hasSum_sinh.tsum_eq.symm
+
+lemma cosh_le_exp_half_sq (x : ℝ) : cosh x ≤ exp (x ^ 2 / 2) := by
+  rw [cosh_eq_tsum, exp_eq_exp_ℝ, exp_eq_tsum]
+  refine tsum_le_tsum (fun i ↦ ?_) x.hasSum_cosh.summable $ expSeries_summable' (x ^ 2 / 2)
+  simp only [div_pow, pow_mul, smul_eq_mul, inv_mul_eq_div, div_div]
+  gcongr
+  norm_cast
+  exact Nat.two_pow_mul_factorial_le_factorial_two_mul _
+
+end Real
+end SinhCosh
chore: replace exact_mod_cast tactic with mod_cast elaborator where possible (#8404)

We still have the exact_mod_cast tactic, used in a few places, which somehow (?) works a little bit harder to prevent the expected type influencing the elaboration of the term. I would like to get to the bottom of this, and it will be easier once the only usages of exact_mod_cast are the ones that don't work using the term elaborator by itself.

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -101,14 +101,14 @@ theorem Complex.sin_eq_tsum (z : ℂ) :
 
 /-- The power series expansion of `Real.cos`. -/
 theorem Real.hasSum_cos (r : ℝ) :
-    HasSum (fun n : ℕ => (-1) ^ n * r ^ (2 * n) / ↑(2 * n)!) (Real.cos r) := by
-  exact_mod_cast Complex.hasSum_cos r
+    HasSum (fun n : ℕ => (-1) ^ n * r ^ (2 * n) / ↑(2 * n)!) (Real.cos r) :=
+  mod_cast Complex.hasSum_cos r
 #align real.has_sum_cos Real.hasSum_cos
 
 /-- The power series expansion of `Real.sin`. -/
 theorem Real.hasSum_sin (r : ℝ) :
-    HasSum (fun n : ℕ => (-1) ^ n * r ^ (2 * n + 1) / ↑(2 * n + 1)!) (Real.sin r) := by
-  exact_mod_cast Complex.hasSum_sin r
+    HasSum (fun n : ℕ => (-1) ^ n * r ^ (2 * n + 1) / ↑(2 * n + 1)!) (Real.sin r) :=
+  mod_cast Complex.hasSum_sin r
 #align real.has_sum_sin Real.hasSum_sin
 
 theorem Real.cos_eq_tsum (r : ℝ) : Real.cos r = ∑' n : ℕ, (-1) ^ n * r ^ (2 * n) / ↑(2 * n)! :=
chore: exp -> NormedSpace.exp (#8436)

Per discussion at zulip

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -20,6 +20,7 @@ In this file we express trigonometric functions in terms of their series expansi
 * `Real.hasSum_sin`, `Real.sin_eq_tsum`: `Real.sin` as the sum of an infinite series.
 -/
 
+open NormedSpace
 
 open scoped Nat
 
chore: bump to v4.3.0-rc2 (#8366)

PR contents

This is the supremum of

along with some minor fixes from failures on nightly-testing as Mathlib master is merged into it.

Note that some PRs for changes that are already compatible with the current toolchain and will be necessary have already been split out: #8380.

I am hopeful that in future we will be able to progressively merge adaptation PRs into a bump/v4.X.0 branch, so we never end up with a "big merge" like this. However one of these adaptation PRs (#8056) predates my new scheme for combined CI, and it wasn't possible to keep that PR viable in the meantime.

Lean PRs involved in this bump

In particular this includes adjustments for the Lean PRs

leanprover/lean4#2778

We can get rid of all the

local macro_rules | `($x ^ $y) => `(HPow.hPow $x $y) -- Porting note: See issue [lean4#2220](https://github.com/leanprover/lean4/pull/2220)

macros across Mathlib (and in any projects that want to write natural number powers of reals).

leanprover/lean4#2722

Changes the default behaviour of simp to (config := {decide := false}). This makes simp (and consequentially norm_num) less powerful, but also more consistent, and less likely to blow up in long failures. This requires a variety of changes: changing some previously by simp or norm_num to decide or rfl, or adding (config := {decide := true}).

leanprover/lean4#2783

This changed the behaviour of simp so that simp [f] will only unfold "fully applied" occurrences of f. The old behaviour can be recovered with simp (config := { unfoldPartialApp := true }). We may in future add a syntax for this, e.g. simp [!f]; please provide feedback! In the meantime, we have made the following changes:

  • switching to using explicit lemmas that have the intended level of application
  • (config := { unfoldPartialApp := true }) in some places, to recover the old behaviour
  • Using @[eqns] to manually adjust the equation lemmas for a particular definition, recovering the old behaviour just for that definition. See #8371, where we do this for Function.comp and Function.flip.

This change in Lean may require further changes down the line (e.g. adding the !f syntax, and/or upstreaming the special treatment for Function.comp and Function.flip, and/or removing this special treatment). Please keep an open and skeptical mind about these changes!

Co-authored-by: leanprover-community-mathlib4-bot <leanprover-community-mathlib4-bot@users.noreply.github.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Mauricio Collares <mauricio@collares.org>

Diff
@@ -34,7 +34,7 @@ theorem Complex.hasSum_cos' (z : ℂ) :
   have := ((expSeries_div_hasSum_exp ℂ (z * Complex.I)).add
     (expSeries_div_hasSum_exp ℂ (-z * Complex.I))).div_const 2
   replace := (Nat.divModEquiv 2).symm.hasSum_iff.mpr this
-  dsimp [Function.comp] at this
+  dsimp [Function.comp_def] at this
   simp_rw [← mul_comm 2 _] at this
   refine' this.prod_fiberwise fun k => _
   dsimp only
@@ -52,7 +52,7 @@ theorem Complex.hasSum_sin' (z : ℂ) :
   have := (((expSeries_div_hasSum_exp ℂ (-z * Complex.I)).sub
     (expSeries_div_hasSum_exp ℂ (z * Complex.I))).mul_right Complex.I).div_const 2
   replace := (Nat.divModEquiv 2).symm.hasSum_iff.mpr this
-  dsimp [Function.comp] at this
+  dsimp [Function.comp_def] at this
   simp_rw [← mul_comm 2 _] at this
   refine' this.prod_fiberwise fun k => _
   dsimp only
chore: drop MulZeroClass. in mul_zero/zero_mul (#6682)

Search&replace MulZeroClass.mul_zero -> mul_zero, MulZeroClass.zero_mul -> zero_mul.

These were introduced by Mathport, as the full name of mul_zero is actually MulZeroClass.mul_zero (it's exported with the short name).

Diff
@@ -59,7 +59,7 @@ theorem Complex.hasSum_sin' (z : ℂ) :
   convert hasSum_fintype (_ : Fin 2 → ℂ) using 1
   rw [Fin.sum_univ_two]
   simp_rw [Fin.val_zero, Fin.val_one, add_zero, pow_succ', pow_mul, mul_pow, neg_sq, sub_self,
-    MulZeroClass.zero_mul, zero_div, zero_add, neg_mul, mul_neg, neg_div, ← neg_add', ← two_mul,
+    zero_mul, zero_div, zero_add, neg_mul, mul_neg, neg_div, ← neg_add', ← two_mul,
     neg_mul, neg_div, mul_assoc, mul_div_cancel_left _ (two_ne_zero : (2 : ℂ) ≠ 0), Complex.div_I]
 #align complex.has_sum_sin' Complex.hasSum_sin'
 
chore: script to replace headers with #align_import statements (#5979)

Open in Gitpod

Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -2,14 +2,11 @@
 Copyright (c) 2023 Eric Wieser. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Eric Wieser
-
-! This file was ported from Lean 3 source module analysis.special_functions.trigonometric.series
-! leanprover-community/mathlib commit ccf84e0d918668460a34aa19d02fe2e0e2286da0
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.Analysis.SpecialFunctions.Exponential
 
+#align_import analysis.special_functions.trigonometric.series from "leanprover-community/mathlib"@"ccf84e0d918668460a34aa19d02fe2e0e2286da0"
+
 /-!
 # Trigonometric functions as sums of infinite series
 
chore: tidy various files (#5233)
Diff
@@ -66,14 +66,14 @@ theorem Complex.hasSum_sin' (z : ℂ) :
     neg_mul, neg_div, mul_assoc, mul_div_cancel_left _ (two_ne_zero : (2 : ℂ) ≠ 0), Complex.div_I]
 #align complex.has_sum_sin' Complex.hasSum_sin'
 
-/-- The power series expansion of `complex.cos`. -/
+/-- The power series expansion of `Complex.cos`. -/
 theorem Complex.hasSum_cos (z : ℂ) :
     HasSum (fun n : ℕ => (-1) ^ n * z ^ (2 * n) / ↑(2 * n)!) (Complex.cos z) := by
   convert Complex.hasSum_cos' z using 1
   simp_rw [mul_pow, pow_mul, Complex.I_sq, mul_comm]
 #align complex.has_sum_cos Complex.hasSum_cos
 
-/-- The power series expansion of `complex.sin`. -/
+/-- The power series expansion of `Complex.sin`. -/
 theorem Complex.hasSum_sin (z : ℂ) :
     HasSum (fun n : ℕ => (-1) ^ n * z ^ (2 * n + 1) / ↑(2 * n + 1)!) (Complex.sin z) := by
   convert Complex.hasSum_sin' z using 1
@@ -101,13 +101,13 @@ theorem Complex.sin_eq_tsum (z : ℂ) :
   (Complex.hasSum_sin z).tsum_eq.symm
 #align complex.sin_eq_tsum Complex.sin_eq_tsum
 
-/-- The power series expansion of `real.cos`. -/
+/-- The power series expansion of `Real.cos`. -/
 theorem Real.hasSum_cos (r : ℝ) :
     HasSum (fun n : ℕ => (-1) ^ n * r ^ (2 * n) / ↑(2 * n)!) (Real.cos r) := by
   exact_mod_cast Complex.hasSum_cos r
 #align real.has_sum_cos Real.hasSum_cos
 
-/-- The power series expansion of `real.sin`. -/
+/-- The power series expansion of `Real.sin`. -/
 theorem Real.hasSum_sin (r : ℝ) :
     HasSum (fun n : ℕ => (-1) ^ n * r ^ (2 * n + 1) / ↑(2 * n + 1)!) (Real.sin r) := by
   exact_mod_cast Complex.hasSum_sin r
feat: port Analysis.SpecialFunctions.Trigonometric.Series (#4717)

Dependencies 12 + 784

785 files ported (98.5%)
351653 lines ported (98.4%)
Show graph

The unported dependencies are

The following 1 dependencies have changed in mathlib3 since they were ported, which may complicate porting this file