analysis.special_functions.integralsMathlib.Analysis.SpecialFunctions.Integrals

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)

(last sync)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -428,7 +428,7 @@ theorem integral_rpow {r : ℝ} (h : -1 < r ∨ r ≠ -1 ∧ (0 : ℝ) ∉ [a, b
     integral_cpow h'
   apply_fun Complex.re at this; convert this
   · simp_rw [interval_integral_eq_integral_uIoc, Complex.real_smul, Complex.re_ofReal_mul]
-    · change Complex.re with IsROrC.re
+    · change Complex.re with RCLike.re
       rw [← integral_re]; rfl
       refine' interval_integrable_iff.mp _
       cases h'
@@ -451,7 +451,7 @@ theorem integral_zpow {n : ℤ} (h : 0 ≤ n ∨ n ≠ -1 ∧ (0 : ℝ) ∉ [a,
 #print integral_pow /-
 @[simp]
 theorem integral_pow : ∫ x in a..b, x ^ n = (b ^ (n + 1) - a ^ (n + 1)) / (n + 1) := by
-  simpa only [← Int.ofNat_succ, zpow_coe_nat] using integral_zpow (Or.inl (Int.coe_nat_nonneg n))
+  simpa only [← Int.ofNat_succ, zpow_natCast] using integral_zpow (Or.inl (Int.natCast_nonneg n))
 #align integral_pow integral_pow
 -/
 
@@ -565,7 +565,7 @@ theorem integral_exp_mul_complex {c : ℂ} (hc : c ≠ 0) :
     conv =>
       congr
       skip
-      rw [← mul_div_cancel (Complex.exp (c * x)) hc]
+      rw [← mul_div_cancel_right₀ (Complex.exp (c * x)) hc]
     convert ((Complex.hasDerivAt_exp _).comp x _).div_const c using 1
     simpa only [mul_one] using ((hasDerivAt_id (x : ℂ)).const_mul _).comp_ofReal
   rw [integral_deriv_eq_sub' _ (funext fun x => (D x).deriv) fun x hx => (D x).DifferentiableAt]
@@ -633,7 +633,7 @@ theorem integral_cos_mul_complex {z : ℂ} (hz : z ≠ 0) (a b : ℝ) :
   have c : HasDerivAt (fun y : ℂ => Complex.sin (y * z)) _ ↑x := HasDerivAt.comp x a b
   convert HasDerivAt.comp_ofReal (c.div_const z)
   · simp_rw [mul_comm]
-  · rw [mul_div_cancel _ hz, mul_comm]
+  · rw [mul_div_cancel_right₀ _ hz, mul_comm]
 #align integral_cos_mul_complex integral_cos_mul_complex
 -/
 
@@ -743,7 +743,7 @@ theorem integral_sin_pow_aux :
     simpa only [neg_neg] using (has_deriv_at_cos x).neg
   have H := integral_mul_deriv_eq_deriv_mul hu hv _ _
   calc
-    ∫ x in a..b, sin x ^ (n + 2) = ∫ x in a..b, sin x ^ (n + 1) * sin x := by simp only [pow_succ']
+    ∫ x in a..b, sin x ^ (n + 2) = ∫ x in a..b, sin x ^ (n + 1) * sin x := by simp only [pow_succ]
     _ = C + (n + 1) * ∫ x in a..b, cos x ^ 2 * sin x ^ n := by simp [H, h, sq]
     _ = C + (n + 1) * ∫ x in a..b, sin x ^ n - sin x ^ (n + 2) := by
       simp [cos_sq', sub_mul, ← pow_add, add_comm]
@@ -838,7 +838,7 @@ theorem integral_cos_pow_aux :
   have hv : ∀ x ∈ [a, b], HasDerivAt sin (cos x) x := fun x hx => has_deriv_at_sin x
   have H := integral_mul_deriv_eq_deriv_mul hu hv _ _
   calc
-    ∫ x in a..b, cos x ^ (n + 2) = ∫ x in a..b, cos x ^ (n + 1) * cos x := by simp only [pow_succ']
+    ∫ x in a..b, cos x ^ (n + 2) = ∫ x in a..b, cos x ^ (n + 1) * cos x := by simp only [pow_succ]
     _ = C + (n + 1) * ∫ x in a..b, sin x ^ 2 * cos x ^ n := by simp [H, h, sq, -neg_add_rev]
     _ = C + (n + 1) * ∫ x in a..b, cos x ^ n - cos x ^ (n + 2) := by
       simp [sin_sq, sub_mul, ← pow_add, add_comm]
@@ -881,7 +881,7 @@ theorem integral_sin_pow_mul_cos_pow_odd (m n : ℕ) :
   calc
     ∫ x in a..b, sin x ^ m * cos x ^ (2 * n + 1) =
         ∫ x in a..b, sin x ^ m * (1 - sin x ^ 2) ^ n * cos x :=
-      by simp only [pow_succ', ← mul_assoc, pow_mul, cos_sq']
+      by simp only [pow_succ, ← mul_assoc, pow_mul, cos_sq']
     _ = ∫ u in sin a..sin b, u ^ m * (1 - u ^ 2) ^ n :=
       integral_comp_mul_deriv (fun x hx => hasDerivAt_sin x) continuousOn_cos hc
 #align integral_sin_pow_mul_cos_pow_odd integral_sin_pow_mul_cos_pow_odd
@@ -919,8 +919,7 @@ theorem integral_sin_pow_odd_mul_cos_pow (m n : ℕ) :
   calc
     ∫ x in a..b, sin x ^ (2 * m + 1) * cos x ^ n = -∫ x in b..a, sin x ^ (2 * m + 1) * cos x ^ n :=
       by rw [integral_symm]
-    _ = ∫ x in b..a, (1 - cos x ^ 2) ^ m * -sin x * cos x ^ n := by
-      simp [pow_succ', pow_mul, sin_sq]
+    _ = ∫ x in b..a, (1 - cos x ^ 2) ^ m * -sin x * cos x ^ n := by simp [pow_succ, pow_mul, sin_sq]
     _ = ∫ x in b..a, cos x ^ n * (1 - cos x ^ 2) ^ m * -sin x := by congr; ext; ring
     _ = ∫ u in cos b..cos a, u ^ n * (1 - u ^ 2) ^ m :=
       integral_comp_mul_deriv (fun x hx => hasDerivAt_cos x) continuousOn_sin.neg hc
Diff
@@ -100,7 +100,7 @@ theorem intervalIntegrable_rpow' {r : ℝ} (h : -1 < r) :
     have m := (this (-c) (by linarith)).smul (cos (r * π))
     rw [intervalIntegrable_iff] at m ⊢
     refine' m.congr_fun _ measurableSet_Ioc; intro x hx
-    rw [uIoc_of_le (by linarith : 0 ≤ -c)] at hx 
+    rw [uIoc_of_le (by linarith : 0 ≤ -c)] at hx
     simp only [Pi.smul_apply, Algebra.id.smul_eq_mul, log_neg_eq_log, mul_comm,
       rpow_def_of_pos hx.1, rpow_def_of_neg (by linarith [hx.1] : -x < 0)]
 #align interval_integral.interval_integrable_rpow' intervalIntegral.intervalIntegrable_rpow'
@@ -116,7 +116,7 @@ theorem intervalIntegrable_cpow {r : ℂ} (h : 0 ≤ r.re ∨ (0 : ℝ) ∉ [a,
   · -- Easy case #1: 0 ∉ [a, b] -- use continuity.
     refine' (ContinuousAt.continuousOn fun x hx => _).IntervalIntegrable
     exact Complex.continuousAt_ofReal_cpow_const _ _ (Or.inr <| ne_of_mem_of_not_mem hx h2)
-  rw [eq_false h2, or_false_iff] at h 
+  rw [eq_false h2, or_false_iff] at h
   rcases lt_or_eq_of_le h with (h' | h')
   ·-- Easy case #2: 0 < re r -- again use continuity
     exact (Complex.continuous_ofReal_cpow_const h').IntervalIntegrable _ _
@@ -179,13 +179,13 @@ theorem intervalIntegrable_cpow' {r : ℂ} (h : -1 < r.re) :
       apply integrable_on.congr_fun
       · rw [← intervalIntegrable_iff]; exact intervalIntegral.intervalIntegrable_rpow' h
       · intro x hx
-        rw [uIoc_of_le hc] at hx 
+        rw [uIoc_of_le hc] at hx
         dsimp only
         rw [Complex.norm_eq_abs, Complex.abs_cpow_eq_rpow_re_of_pos hx.1]
       · exact measurableSet_uIoc
     · refine' ContinuousOn.aestronglyMeasurable _ measurableSet_uIoc
       refine' ContinuousAt.continuousOn fun x hx => _
-      rw [uIoc_of_le hc] at hx 
+      rw [uIoc_of_le hc] at hx
       refine' (continuousAt_cpow_const (Or.inl _)).comp complex.continuous_of_real.continuous_at
       rw [Complex.ofReal_re]
       exact hx.1
@@ -389,7 +389,7 @@ theorem integral_cpow {r : ℂ} (h : -1 < r.re ∨ r ≠ -1 ∧ (0 : ℝ) ∉ [a
     · apply_fun Complex.re
       rw [Complex.add_re, Complex.one_re, Complex.zero_re, Ne.def, add_eq_zero_iff_eq_neg]
       exact h.ne'
-    · rw [Ne.def, ← add_eq_zero_iff_eq_neg] at h ; exact h.1
+    · rw [Ne.def, ← add_eq_zero_iff_eq_neg] at h; exact h.1
   by_cases hab : (0 : ℝ) ∉ [a, b]
   · refine' integral_eq_sub_of_has_deriv_at (fun x hx => _) (interval_integrable_cpow <| Or.inr hab)
     refine' hasDerivAt_ofReal_cpow (ne_of_mem_of_not_mem hx hab) _
@@ -408,7 +408,7 @@ theorem integral_cpow {r : ℂ} (h : -1 < r.re ∨ r ≠ -1 ∧ (0 : ℝ) ∉ [a
     rwa [Complex.add_re, Complex.one_re, ← neg_lt_iff_pos_add]
   · refine' fun x hx => (hasDerivAt_ofReal_cpow _ _).HasDerivWithinAt
     · rcases le_total c 0 with (hc | hc)
-      · rw [max_eq_left hc] at hx ; exact hx.2.Ne; · rw [min_eq_left hc] at hx ; exact hx.1.ne'
+      · rw [max_eq_left hc] at hx; exact hx.2.Ne; · rw [min_eq_left hc] at hx; exact hx.1.ne'
     · contrapose! hr; rw [hr]; ring
   · exact interval_integrable_cpow' h
 #align integral_cpow integral_cpow
@@ -426,7 +426,7 @@ theorem integral_rpow {r : ℝ} (h : -1 < r ∨ r ≠ -1 ∧ (0 : ℝ) ∉ [a, b
   have :
     ∫ x in a..b, (x : ℂ) ^ (r : ℂ) = ((b : ℂ) ^ (r + 1 : ℂ) - (a : ℂ) ^ (r + 1 : ℂ)) / (r + 1) :=
     integral_cpow h'
-  apply_fun Complex.re at this ; convert this
+  apply_fun Complex.re at this; convert this
   · simp_rw [interval_integral_eq_integral_uIoc, Complex.real_smul, Complex.re_ofReal_mul]
     · change Complex.re with IsROrC.re
       rw [← integral_re]; rfl
@@ -469,7 +469,7 @@ theorem integral_pow_abs_sub_uIoc : ∫ x in Ι a b, |x - a| ^ n = |b - a| ^ (n
         by
         simp only [integral_comp_sub_right fun x => |x| ^ n, sub_self]
         refine' integral_congr fun x hx => congr_arg₂ Pow.pow (abs_of_nonneg <| _) rfl
-        rw [uIcc_of_le (sub_nonneg.2 hab)] at hx 
+        rw [uIcc_of_le (sub_nonneg.2 hab)] at hx
         exact hx.1
       _ = |b - a| ^ (n + 1) / (n + 1) := by simp [abs_of_nonneg (sub_nonneg.2 hab)]
   ·
@@ -480,7 +480,7 @@ theorem integral_pow_abs_sub_uIoc : ∫ x in Ι a b, |x - a| ^ n = |b - a| ^ (n
         by
         simp only [integral_comp_sub_right fun x => |x| ^ n, sub_self]
         refine' integral_congr fun x hx => congr_arg₂ Pow.pow (abs_of_nonpos <| _) rfl
-        rw [uIcc_of_le (sub_nonpos.2 hab.le)] at hx 
+        rw [uIcc_of_le (sub_nonpos.2 hab.le)] at hx
         exact hx.2
       _ = |b - a| ^ (n + 1) / (n + 1) := by
         simp [integral_comp_neg fun x => x ^ n, abs_of_neg (sub_neg.2 hab)]
@@ -674,7 +674,7 @@ theorem integral_mul_cpow_one_add_sq {t : ℂ} (ht : t ≠ -1) :
     ∫ x : ℝ in a..b, (x : ℂ) * (1 + x ^ 2) ^ t =
       (1 + b ^ 2) ^ (t + 1) / (2 * (t + 1)) - (1 + a ^ 2) ^ (t + 1) / (2 * (t + 1)) :=
   by
-  have : t + 1 ≠ 0 := by contrapose! ht; rwa [add_eq_zero_iff_eq_neg] at ht 
+  have : t + 1 ≠ 0 := by contrapose! ht; rwa [add_eq_zero_iff_eq_neg] at ht
   apply integral_eq_sub_of_has_deriv_at
   · intro x hx
     have f : HasDerivAt (fun y : ℂ => 1 + y ^ 2) (2 * x) x := by
Diff
@@ -451,7 +451,7 @@ theorem integral_zpow {n : ℤ} (h : 0 ≤ n ∨ n ≠ -1 ∧ (0 : ℝ) ∉ [a,
 #print integral_pow /-
 @[simp]
 theorem integral_pow : ∫ x in a..b, x ^ n = (b ^ (n + 1) - a ^ (n + 1)) / (n + 1) := by
-  simpa only [← Int.ofNat_succ, zpow_ofNat] using integral_zpow (Or.inl (Int.coe_nat_nonneg n))
+  simpa only [← Int.ofNat_succ, zpow_coe_nat] using integral_zpow (Or.inl (Int.coe_nat_nonneg n))
 #align integral_pow integral_pow
 -/
 
Diff
@@ -427,14 +427,14 @@ theorem integral_rpow {r : ℝ} (h : -1 < r ∨ r ≠ -1 ∧ (0 : ℝ) ∉ [a, b
     ∫ x in a..b, (x : ℂ) ^ (r : ℂ) = ((b : ℂ) ^ (r + 1 : ℂ) - (a : ℂ) ^ (r + 1 : ℂ)) / (r + 1) :=
     integral_cpow h'
   apply_fun Complex.re at this ; convert this
-  · simp_rw [interval_integral_eq_integral_uIoc, Complex.real_smul, Complex.ofReal_mul_re]
+  · simp_rw [interval_integral_eq_integral_uIoc, Complex.real_smul, Complex.re_ofReal_mul]
     · change Complex.re with IsROrC.re
       rw [← integral_re]; rfl
       refine' interval_integrable_iff.mp _
       cases h'
       · exact interval_integrable_cpow' h'; · exact interval_integrable_cpow (Or.inr h'.2)
   · rw [(by push_cast : (r : ℂ) + 1 = ((r + 1 : ℝ) : ℂ))]
-    simp_rw [div_eq_inv_mul, ← Complex.ofReal_inv, Complex.ofReal_mul_re, Complex.sub_re]
+    simp_rw [div_eq_inv_mul, ← Complex.ofReal_inv, Complex.re_ofReal_mul, Complex.sub_re]
     rfl
 #align integral_rpow integral_rpow
 -/
Diff
@@ -132,13 +132,13 @@ theorem intervalIntegrable_cpow {r : ℂ} (h : 0 ≤ r.re ∨ (0 : ℝ) ∉ [a,
   rcases le_or_lt 0 c with (hc | hc)
   · -- case `0 ≤ c`: integrand is identically 1
     have : IntervalIntegrable (fun x => 1 : ℝ → ℝ) μ 0 c := intervalIntegrable_const
-    rw [intervalIntegrable_iff_integrable_Ioc_of_le hc] at this ⊢
+    rw [intervalIntegrable_iff_integrableOn_Ioc_of_le hc] at this ⊢
     refine' integrable_on.congr_fun this (fun x hx => _) measurableSet_Ioc
     dsimp only
     rw [Complex.norm_eq_abs, Complex.abs_cpow_eq_rpow_re_of_pos hx.1, ← h', rpow_zero]
   · -- case `c < 0`: integrand is identically constant, *except* at `x = 0` if `r ≠ 0`.
     apply IntervalIntegrable.symm
-    rw [intervalIntegrable_iff_integrable_Ioc_of_le hc.le]
+    rw [intervalIntegrable_iff_integrableOn_Ioc_of_le hc.le]
     have : Ioc c 0 = Ioo c 0 ∪ {(0 : ℝ)} :=
       by
       rw [← Ioo_union_Icc_eq_Ioc hc (le_refl 0), ← Icc_def]
Diff
@@ -551,7 +551,7 @@ theorem integral_one_div_of_neg (ha : a < 0) (hb : b < 0) : ∫ x : ℝ in a..b,
 #print integral_exp /-
 @[simp]
 theorem integral_exp : ∫ x in a..b, exp x = exp b - exp a := by
-  rw [integral_deriv_eq_sub'] <;> norm_num [continuousOn_exp]
+  rw [integral_deriv_eq_sub'] <;> norm_num [NormedSpace.continuousOn_exp]
 #align integral_exp integral_exp
 -/
 
Diff
@@ -3,8 +3,8 @@ Copyright (c) 2021 Benjamin Davidson. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Benjamin Davidson
 -/
-import Mathbin.MeasureTheory.Integral.FundThmCalculus
-import Mathbin.Analysis.SpecialFunctions.Trigonometric.ArctanDeriv
+import MeasureTheory.Integral.FundThmCalculus
+import Analysis.SpecialFunctions.Trigonometric.ArctanDeriv
 
 #align_import analysis.special_functions.integrals from "leanprover-community/mathlib"@"6b31d1eebd64eab86d5bd9936bfaada6ca8b5842"
 
Diff
@@ -2,15 +2,12 @@
 Copyright (c) 2021 Benjamin Davidson. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Benjamin Davidson
-
-! This file was ported from Lean 3 source module analysis.special_functions.integrals
-! leanprover-community/mathlib commit 6b31d1eebd64eab86d5bd9936bfaada6ca8b5842
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.MeasureTheory.Integral.FundThmCalculus
 import Mathbin.Analysis.SpecialFunctions.Trigonometric.ArctanDeriv
 
+#align_import analysis.special_functions.integrals from "leanprover-community/mathlib"@"6b31d1eebd64eab86d5bd9936bfaada6ca8b5842"
+
 /-!
 # Integration of specific interval integrals
 
Diff
@@ -61,11 +61,14 @@ theorem intervalIntegrable_pow : IntervalIntegrable (fun x => x ^ n) μ a b :=
 #align interval_integral.interval_integrable_pow intervalIntegral.intervalIntegrable_pow
 -/
 
+#print intervalIntegral.intervalIntegrable_zpow /-
 theorem intervalIntegrable_zpow {n : ℤ} (h : 0 ≤ n ∨ (0 : ℝ) ∉ [a, b]) :
     IntervalIntegrable (fun x => x ^ n) μ a b :=
   (continuousOn_id.zpow₀ n fun x hx => h.symm.imp (ne_of_mem_of_not_mem hx) id).IntervalIntegrable
 #align interval_integral.interval_integrable_zpow intervalIntegral.intervalIntegrable_zpow
+-/
 
+#print intervalIntegral.intervalIntegrable_rpow /-
 /-- See `interval_integrable_rpow'` for a version with a weaker hypothesis on `r`, but assuming the
 measure is volume. -/
 theorem intervalIntegrable_rpow {r : ℝ} (h : 0 ≤ r ∨ (0 : ℝ) ∉ [a, b]) :
@@ -73,7 +76,9 @@ theorem intervalIntegrable_rpow {r : ℝ} (h : 0 ≤ r ∨ (0 : ℝ) ∉ [a, b])
   (continuousOn_id.rpow_const fun x hx =>
       h.symm.imp (ne_of_mem_of_not_mem hx) id).IntervalIntegrable
 #align interval_integral.interval_integrable_rpow intervalIntegral.intervalIntegrable_rpow
+-/
 
+#print intervalIntegral.intervalIntegrable_rpow' /-
 /-- See `interval_integrable_rpow` for a version applying to any locally finite measure, but with a
 stronger hypothesis on `r`. -/
 theorem intervalIntegrable_rpow' {r : ℝ} (h : -1 < r) :
@@ -102,7 +107,9 @@ theorem intervalIntegrable_rpow' {r : ℝ} (h : -1 < r) :
     simp only [Pi.smul_apply, Algebra.id.smul_eq_mul, log_neg_eq_log, mul_comm,
       rpow_def_of_pos hx.1, rpow_def_of_neg (by linarith [hx.1] : -x < 0)]
 #align interval_integral.interval_integrable_rpow' intervalIntegral.intervalIntegrable_rpow'
+-/
 
+#print intervalIntegral.intervalIntegrable_cpow /-
 /-- See `interval_integrable_cpow'` for a version with a weaker hypothesis on `r`, but assuming the
 measure is volume. -/
 theorem intervalIntegrable_cpow {r : ℂ} (h : 0 ≤ r.re ∨ (0 : ℝ) ∉ [a, b]) :
@@ -157,7 +164,9 @@ theorem intervalIntegrable_cpow {r : ℂ} (h : 0 ≤ r.re ∨ (0 : ℝ) ∉ [a,
         is_finite_measure_on_compacts_of_is_locally_finite_measure.lt_top_of_is_compact
           is_compact_Icc
 #align interval_integral.interval_integrable_cpow intervalIntegral.intervalIntegrable_cpow
+-/
 
+#print intervalIntegral.intervalIntegrable_cpow' /-
 /-- See `interval_integrable_cpow` for a version applying to any locally finite measure, but with a
 stronger hypothesis on `r`. -/
 theorem intervalIntegrable_cpow' {r : ℂ} (h : -1 < r.re) :
@@ -194,6 +203,7 @@ theorem intervalIntegrable_cpow' {r : ℂ} (h : -1 < r.re) :
     rw [Complex.ofReal_cpow_of_nonpos this, mul_comm]
     simp
 #align interval_integral.interval_integrable_cpow' intervalIntegral.intervalIntegrable_cpow'
+-/
 
 #print intervalIntegral.intervalIntegrable_id /-
 @[simp]
@@ -209,16 +219,20 @@ theorem intervalIntegrable_const : IntervalIntegrable (fun x => c) μ a b :=
 #align interval_integral.interval_integrable_const intervalIntegral.intervalIntegrable_const
 -/
 
+#print intervalIntegral.intervalIntegrable_one_div /-
 theorem intervalIntegrable_one_div (h : ∀ x : ℝ, x ∈ [a, b] → f x ≠ 0)
     (hf : ContinuousOn f [a, b]) : IntervalIntegrable (fun x => 1 / f x) μ a b :=
   (continuousOn_const.div hf h).IntervalIntegrable
 #align interval_integral.interval_integrable_one_div intervalIntegral.intervalIntegrable_one_div
+-/
 
+#print intervalIntegral.intervalIntegrable_inv /-
 @[simp]
 theorem intervalIntegrable_inv (h : ∀ x : ℝ, x ∈ [a, b] → f x ≠ 0) (hf : ContinuousOn f [a, b]) :
     IntervalIntegrable (fun x => (f x)⁻¹) μ a b := by
   simpa only [one_div] using interval_integrable_one_div h hf
 #align interval_integral.interval_integrable_inv intervalIntegral.intervalIntegrable_inv
+-/
 
 #print intervalIntegral.intervalIntegrable_exp /-
 @[simp]
@@ -227,16 +241,20 @@ theorem intervalIntegrable_exp : IntervalIntegrable exp μ a b :=
 #align interval_integral.interval_integrable_exp intervalIntegral.intervalIntegrable_exp
 -/
 
+#print IntervalIntegrable.log /-
 @[simp]
 theorem IntervalIntegrable.log (hf : ContinuousOn f [a, b]) (h : ∀ x : ℝ, x ∈ [a, b] → f x ≠ 0) :
     IntervalIntegrable (fun x => log (f x)) μ a b :=
   (ContinuousOn.log hf h).IntervalIntegrable
 #align interval_integrable.log IntervalIntegrable.log
+-/
 
+#print intervalIntegral.intervalIntegrable_log /-
 @[simp]
 theorem intervalIntegrable_log (h : (0 : ℝ) ∉ [a, b]) : IntervalIntegrable log μ a b :=
   IntervalIntegrable.log continuousOn_id fun x hx => ne_of_mem_of_not_mem hx h
 #align interval_integral.interval_integrable_log intervalIntegral.intervalIntegrable_log
+-/
 
 #print intervalIntegral.intervalIntegrable_sin /-
 @[simp]
@@ -272,68 +290,90 @@ theorem intervalIntegrable_inv_one_add_sq : IntervalIntegrable (fun x : ℝ => (
 /-! ### Integrals of the form `c * ∫ x in a..b, f (c * x + d)` -/
 
 
+#print intervalIntegral.mul_integral_comp_mul_right /-
 @[simp]
 theorem mul_integral_comp_mul_right : c * ∫ x in a..b, f (x * c) = ∫ x in a * c..b * c, f x :=
   smul_integral_comp_mul_right f c
 #align interval_integral.mul_integral_comp_mul_right intervalIntegral.mul_integral_comp_mul_right
+-/
 
+#print intervalIntegral.mul_integral_comp_mul_left /-
 @[simp]
 theorem mul_integral_comp_mul_left : c * ∫ x in a..b, f (c * x) = ∫ x in c * a..c * b, f x :=
   smul_integral_comp_mul_left f c
 #align interval_integral.mul_integral_comp_mul_left intervalIntegral.mul_integral_comp_mul_left
+-/
 
+#print intervalIntegral.inv_mul_integral_comp_div /-
 @[simp]
 theorem inv_mul_integral_comp_div : c⁻¹ * ∫ x in a..b, f (x / c) = ∫ x in a / c..b / c, f x :=
   inv_smul_integral_comp_div f c
 #align interval_integral.inv_mul_integral_comp_div intervalIntegral.inv_mul_integral_comp_div
+-/
 
+#print intervalIntegral.mul_integral_comp_mul_add /-
 @[simp]
 theorem mul_integral_comp_mul_add :
     c * ∫ x in a..b, f (c * x + d) = ∫ x in c * a + d..c * b + d, f x :=
   smul_integral_comp_mul_add f c d
 #align interval_integral.mul_integral_comp_mul_add intervalIntegral.mul_integral_comp_mul_add
+-/
 
+#print intervalIntegral.mul_integral_comp_add_mul /-
 @[simp]
 theorem mul_integral_comp_add_mul :
     c * ∫ x in a..b, f (d + c * x) = ∫ x in d + c * a..d + c * b, f x :=
   smul_integral_comp_add_mul f c d
 #align interval_integral.mul_integral_comp_add_mul intervalIntegral.mul_integral_comp_add_mul
+-/
 
+#print intervalIntegral.inv_mul_integral_comp_div_add /-
 @[simp]
 theorem inv_mul_integral_comp_div_add :
     c⁻¹ * ∫ x in a..b, f (x / c + d) = ∫ x in a / c + d..b / c + d, f x :=
   inv_smul_integral_comp_div_add f c d
 #align interval_integral.inv_mul_integral_comp_div_add intervalIntegral.inv_mul_integral_comp_div_add
+-/
 
+#print intervalIntegral.inv_mul_integral_comp_add_div /-
 @[simp]
 theorem inv_mul_integral_comp_add_div :
     c⁻¹ * ∫ x in a..b, f (d + x / c) = ∫ x in d + a / c..d + b / c, f x :=
   inv_smul_integral_comp_add_div f c d
 #align interval_integral.inv_mul_integral_comp_add_div intervalIntegral.inv_mul_integral_comp_add_div
+-/
 
+#print intervalIntegral.mul_integral_comp_mul_sub /-
 @[simp]
 theorem mul_integral_comp_mul_sub :
     c * ∫ x in a..b, f (c * x - d) = ∫ x in c * a - d..c * b - d, f x :=
   smul_integral_comp_mul_sub f c d
 #align interval_integral.mul_integral_comp_mul_sub intervalIntegral.mul_integral_comp_mul_sub
+-/
 
+#print intervalIntegral.mul_integral_comp_sub_mul /-
 @[simp]
 theorem mul_integral_comp_sub_mul :
     c * ∫ x in a..b, f (d - c * x) = ∫ x in d - c * b..d - c * a, f x :=
   smul_integral_comp_sub_mul f c d
 #align interval_integral.mul_integral_comp_sub_mul intervalIntegral.mul_integral_comp_sub_mul
+-/
 
+#print intervalIntegral.inv_mul_integral_comp_div_sub /-
 @[simp]
 theorem inv_mul_integral_comp_div_sub :
     c⁻¹ * ∫ x in a..b, f (x / c - d) = ∫ x in a / c - d..b / c - d, f x :=
   inv_smul_integral_comp_div_sub f c d
 #align interval_integral.inv_mul_integral_comp_div_sub intervalIntegral.inv_mul_integral_comp_div_sub
+-/
 
+#print intervalIntegral.inv_mul_integral_comp_sub_div /-
 @[simp]
 theorem inv_mul_integral_comp_sub_div :
     c⁻¹ * ∫ x in a..b, f (d - x / c) = ∫ x in d - b / c..d - a / c, f x :=
   inv_smul_integral_comp_sub_div f c d
 #align interval_integral.inv_mul_integral_comp_sub_div intervalIntegral.inv_mul_integral_comp_sub_div
+-/
 
 end intervalIntegral
 
@@ -342,6 +382,7 @@ open intervalIntegral
 /-! ### Integrals of simple functions -/
 
 
+#print integral_cpow /-
 theorem integral_cpow {r : ℂ} (h : -1 < r.re ∨ r ≠ -1 ∧ (0 : ℝ) ∉ [a, b]) :
     ∫ x : ℝ in a..b, (x : ℂ) ^ r = (b ^ (r + 1) - a ^ (r + 1)) / (r + 1) :=
   by
@@ -374,7 +415,9 @@ theorem integral_cpow {r : ℂ} (h : -1 < r.re ∨ r ≠ -1 ∧ (0 : ℝ) ∉ [a
     · contrapose! hr; rw [hr]; ring
   · exact interval_integrable_cpow' h
 #align integral_cpow integral_cpow
+-/
 
+#print integral_rpow /-
 theorem integral_rpow {r : ℝ} (h : -1 < r ∨ r ≠ -1 ∧ (0 : ℝ) ∉ [a, b]) :
     ∫ x in a..b, x ^ r = (b ^ (r + 1) - a ^ (r + 1)) / (r + 1) :=
   by
@@ -397,19 +440,25 @@ theorem integral_rpow {r : ℝ} (h : -1 < r ∨ r ≠ -1 ∧ (0 : ℝ) ∉ [a, b
     simp_rw [div_eq_inv_mul, ← Complex.ofReal_inv, Complex.ofReal_mul_re, Complex.sub_re]
     rfl
 #align integral_rpow integral_rpow
+-/
 
+#print integral_zpow /-
 theorem integral_zpow {n : ℤ} (h : 0 ≤ n ∨ n ≠ -1 ∧ (0 : ℝ) ∉ [a, b]) :
     ∫ x in a..b, x ^ n = (b ^ (n + 1) - a ^ (n + 1)) / (n + 1) :=
   by
   replace h : -1 < (n : ℝ) ∨ (n : ℝ) ≠ -1 ∧ (0 : ℝ) ∉ [a, b]; · exact_mod_cast h
   exact_mod_cast integral_rpow h
 #align integral_zpow integral_zpow
+-/
 
+#print integral_pow /-
 @[simp]
 theorem integral_pow : ∫ x in a..b, x ^ n = (b ^ (n + 1) - a ^ (n + 1)) / (n + 1) := by
   simpa only [← Int.ofNat_succ, zpow_ofNat] using integral_zpow (Or.inl (Int.coe_nat_nonneg n))
 #align integral_pow integral_pow
+-/
 
+#print integral_pow_abs_sub_uIoc /-
 /-- Integral of `|x - a| ^ n` over `Ι a b`. This integral appears in the proof of the
 Picard-Lindelöf/Cauchy-Lipschitz theorem. -/
 theorem integral_pow_abs_sub_uIoc : ∫ x in Ι a b, |x - a| ^ n = |b - a| ^ (n + 1) / (n + 1) :=
@@ -439,21 +488,27 @@ theorem integral_pow_abs_sub_uIoc : ∫ x in Ι a b, |x - a| ^ n = |b - a| ^ (n
       _ = |b - a| ^ (n + 1) / (n + 1) := by
         simp [integral_comp_neg fun x => x ^ n, abs_of_neg (sub_neg.2 hab)]
 #align integral_pow_abs_sub_uIoc integral_pow_abs_sub_uIoc
+-/
 
+#print integral_id /-
 @[simp]
 theorem integral_id : ∫ x in a..b, x = (b ^ 2 - a ^ 2) / 2 := by simpa using integral_pow 1
 #align integral_id integral_id
+-/
 
+#print integral_one /-
 @[simp]
 theorem integral_one : ∫ x in a..b, (1 : ℝ) = b - a := by
   simp only [mul_one, smul_eq_mul, integral_const]
 #align integral_one integral_one
+-/
 
 #print integral_const_on_unit_interval /-
 theorem integral_const_on_unit_interval : ∫ x in a..a + 1, b = b := by simp
 #align integral_const_on_unit_interval integral_const_on_unit_interval
 -/
 
+#print integral_inv /-
 @[simp]
 theorem integral_inv (h : (0 : ℝ) ∉ [a, b]) : ∫ x in a..b, x⁻¹ = log (b / a) :=
   by
@@ -462,34 +517,48 @@ theorem integral_inv (h : (0 : ℝ) ∉ [a, b]) : ∫ x in a..b, x⁻¹ = log (b
       (continuous_on_inv₀.mono <| subset_compl_singleton_iff.mpr h),
     log_div (h' b right_mem_uIcc) (h' a left_mem_uIcc)]
 #align integral_inv integral_inv
+-/
 
+#print integral_inv_of_pos /-
 @[simp]
 theorem integral_inv_of_pos (ha : 0 < a) (hb : 0 < b) : ∫ x in a..b, x⁻¹ = log (b / a) :=
   integral_inv <| not_mem_uIcc_of_lt ha hb
 #align integral_inv_of_pos integral_inv_of_pos
+-/
 
+#print integral_inv_of_neg /-
 @[simp]
 theorem integral_inv_of_neg (ha : a < 0) (hb : b < 0) : ∫ x in a..b, x⁻¹ = log (b / a) :=
   integral_inv <| not_mem_uIcc_of_gt ha hb
 #align integral_inv_of_neg integral_inv_of_neg
+-/
 
+#print integral_one_div /-
 theorem integral_one_div (h : (0 : ℝ) ∉ [a, b]) : ∫ x : ℝ in a..b, 1 / x = log (b / a) := by
   simp only [one_div, integral_inv h]
 #align integral_one_div integral_one_div
+-/
 
+#print integral_one_div_of_pos /-
 theorem integral_one_div_of_pos (ha : 0 < a) (hb : 0 < b) : ∫ x : ℝ in a..b, 1 / x = log (b / a) :=
   by simp only [one_div, integral_inv_of_pos ha hb]
 #align integral_one_div_of_pos integral_one_div_of_pos
+-/
 
+#print integral_one_div_of_neg /-
 theorem integral_one_div_of_neg (ha : a < 0) (hb : b < 0) : ∫ x : ℝ in a..b, 1 / x = log (b / a) :=
   by simp only [one_div, integral_inv_of_neg ha hb]
 #align integral_one_div_of_neg integral_one_div_of_neg
+-/
 
+#print integral_exp /-
 @[simp]
 theorem integral_exp : ∫ x in a..b, exp x = exp b - exp a := by
   rw [integral_deriv_eq_sub'] <;> norm_num [continuousOn_exp]
 #align integral_exp integral_exp
+-/
 
+#print integral_exp_mul_complex /-
 theorem integral_exp_mul_complex {c : ℂ} (hc : c ≠ 0) :
     ∫ x in a..b, Complex.exp (c * x) = (Complex.exp (c * b) - Complex.exp (c * a)) / c :=
   by
@@ -506,7 +575,9 @@ theorem integral_exp_mul_complex {c : ℂ} (hc : c ≠ 0) :
   · ring_nf
   · apply Continuous.continuousOn; continuity
 #align integral_exp_mul_complex integral_exp_mul_complex
+-/
 
+#print integral_log /-
 @[simp]
 theorem integral_log (h : (0 : ℝ) ∉ [a, b]) : ∫ x in a..b, log x = b * log b - a * log a - b + a :=
   by
@@ -519,29 +590,39 @@ theorem integral_log (h : (0 : ℝ) ∉ [a, b]) : ∫ x in a..b, log x = b * log
       1 <;>
     simp [integral_congr HEq, mul_comm, ← sub_add]
 #align integral_log integral_log
+-/
 
+#print integral_log_of_pos /-
 @[simp]
 theorem integral_log_of_pos (ha : 0 < a) (hb : 0 < b) :
     ∫ x in a..b, log x = b * log b - a * log a - b + a :=
   integral_log <| not_mem_uIcc_of_lt ha hb
 #align integral_log_of_pos integral_log_of_pos
+-/
 
+#print integral_log_of_neg /-
 @[simp]
 theorem integral_log_of_neg (ha : a < 0) (hb : b < 0) :
     ∫ x in a..b, log x = b * log b - a * log a - b + a :=
   integral_log <| not_mem_uIcc_of_gt ha hb
 #align integral_log_of_neg integral_log_of_neg
+-/
 
+#print integral_sin /-
 @[simp]
 theorem integral_sin : ∫ x in a..b, sin x = cos a - cos b := by
   rw [integral_deriv_eq_sub' fun x => -cos x] <;> norm_num [continuous_on_sin]
 #align integral_sin integral_sin
+-/
 
+#print integral_cos /-
 @[simp]
 theorem integral_cos : ∫ x in a..b, cos x = sin b - sin a := by
   rw [integral_deriv_eq_sub'] <;> norm_num [continuous_on_cos]
 #align integral_cos integral_cos
+-/
 
+#print integral_cos_mul_complex /-
 theorem integral_cos_mul_complex {z : ℂ} (hz : z ≠ 0) (a b : ℝ) :
     ∫ x in a..b, Complex.cos (z * x) = Complex.sin (z * b) / z - Complex.sin (z * a) / z :=
   by
@@ -557,14 +638,18 @@ theorem integral_cos_mul_complex {z : ℂ} (hz : z ≠ 0) (a b : ℝ) :
   · simp_rw [mul_comm]
   · rw [mul_div_cancel _ hz, mul_comm]
 #align integral_cos_mul_complex integral_cos_mul_complex
+-/
 
+#print integral_cos_sq_sub_sin_sq /-
 theorem integral_cos_sq_sub_sin_sq :
     ∫ x in a..b, cos x ^ 2 - sin x ^ 2 = sin b * cos b - sin a * cos a := by
   simpa only [sq, sub_eq_add_neg, neg_mul_eq_mul_neg] using
     integral_deriv_mul_eq_sub (fun x hx => has_deriv_at_sin x) (fun x hx => has_deriv_at_cos x)
       continuous_on_cos.interval_integrable continuous_on_sin.neg.interval_integrable
 #align integral_cos_sq_sub_sin_sq integral_cos_sq_sub_sin_sq
+-/
 
+#print integral_inv_one_add_sq /-
 @[simp]
 theorem integral_inv_one_add_sq : ∫ x : ℝ in a..b, (1 + x ^ 2)⁻¹ = arctan b - arctan a :=
   by
@@ -575,15 +660,19 @@ theorem integral_inv_one_add_sq : ∫ x : ℝ in a..b, (1 + x ^ 2)⁻¹ = arctan
   · continuity
   · nlinarith
 #align integral_inv_one_add_sq integral_inv_one_add_sq
+-/
 
+#print integral_one_div_one_add_sq /-
 theorem integral_one_div_one_add_sq : ∫ x : ℝ in a..b, 1 / (1 + x ^ 2) = arctan b - arctan a := by
   simp only [one_div, integral_inv_one_add_sq]
 #align integral_one_div_one_add_sq integral_one_div_one_add_sq
+-/
 
 section RpowCpow
 
 open Complex
 
+#print integral_mul_cpow_one_add_sq /-
 theorem integral_mul_cpow_one_add_sq {t : ℂ} (ht : t ≠ -1) :
     ∫ x : ℝ in a..b, (x : ℂ) * (1 + x ^ 2) ^ t =
       (1 + b ^ 2) ^ (t + 1) / (2 * (t + 1)) - (1 + a ^ 2) ^ (t + 1) / (2 * (t + 1)) :=
@@ -614,7 +703,9 @@ theorem integral_mul_cpow_one_add_sq {t : ℂ} (ht : t ≠ -1) :
       rw [add_re, one_re, ← of_real_pow, of_real_re]
       exact Or.inl (add_pos_of_pos_of_nonneg zero_lt_one (sq_nonneg a))
 #align integral_mul_cpow_one_add_sq integral_mul_cpow_one_add_sq
+-/
 
+#print integral_mul_rpow_one_add_sq /-
 theorem integral_mul_rpow_one_add_sq {t : ℝ} (ht : t ≠ -1) :
     ∫ x : ℝ in a..b, x * (1 + x ^ 2) ^ t =
       (1 + b ^ 2) ^ (t + 1) / (2 * (t + 1)) - (1 + a ^ 2) ^ (t + 1) / (2 * (t + 1)) :=
@@ -634,12 +725,14 @@ theorem integral_mul_rpow_one_add_sq {t : ℝ} (ht : t ≠ -1) :
   · rw [← of_real_one, ← of_real_neg, Ne.def, of_real_inj]
     exact ht
 #align integral_mul_rpow_one_add_sq integral_mul_rpow_one_add_sq
+-/
 
 end RpowCpow
 
 /-! ### Integral of `sin x ^ n` -/
 
 
+#print integral_sin_pow_aux /-
 theorem integral_sin_pow_aux :
     ∫ x in a..b, sin x ^ (n + 2) =
       (sin a ^ (n + 1) * cos a - sin b ^ (n + 1) * cos b + (n + 1) * ∫ x in a..b, sin x ^ n) -
@@ -662,7 +755,9 @@ theorem integral_sin_pow_aux :
         continuity
   all_goals apply Continuous.intervalIntegrable; continuity
 #align integral_sin_pow_aux integral_sin_pow_aux
+-/
 
+#print integral_sin_pow /-
 /-- The reduction formula for the integral of `sin x ^ n` for any natural `n ≥ 2`. -/
 theorem integral_sin_pow :
     ∫ x in a..b, sin x ^ (n + 2) =
@@ -674,11 +769,14 @@ theorem integral_sin_pow :
   convert eq_sub_iff_add_eq.mp (integral_sin_pow_aux n)
   ring
 #align integral_sin_pow integral_sin_pow
+-/
 
+#print integral_sin_sq /-
 @[simp]
 theorem integral_sin_sq : ∫ x in a..b, sin x ^ 2 = (sin a * cos a - sin b * cos b + b - a) / 2 := by
   field_simp [integral_sin_pow, add_sub_assoc]
 #align integral_sin_sq integral_sin_sq
+-/
 
 #print integral_sin_pow_odd /-
 theorem integral_sin_pow_odd :
@@ -702,6 +800,7 @@ theorem integral_sin_pow_even :
 #align integral_sin_pow_even integral_sin_pow_even
 -/
 
+#print integral_sin_pow_pos /-
 theorem integral_sin_pow_pos : 0 < ∫ x in 0 ..π, sin x ^ n := by
   rcases even_or_odd' n with ⟨k, rfl | rfl⟩ <;>
           simp only [integral_sin_pow_even, integral_sin_pow_odd] <;>
@@ -709,12 +808,15 @@ theorem integral_sin_pow_pos : 0 < ∫ x in 0 ..π, sin x ^ n := by
       norm_cast <;>
     linarith
 #align integral_sin_pow_pos integral_sin_pow_pos
+-/
 
+#print integral_sin_pow_succ_le /-
 theorem integral_sin_pow_succ_le : ∫ x in 0 ..π, sin x ^ (n + 1) ≤ ∫ x in 0 ..π, sin x ^ n :=
   by
   let H x h := pow_le_pow_of_le_one (sin_nonneg_of_mem_Icc h) (sin_le_one x) (n.le_add_right 1)
   refine' integral_mono_on pi_pos.le _ _ H <;> exact (continuous_sin.pow _).IntervalIntegrable 0 π
 #align integral_sin_pow_succ_le integral_sin_pow_succ_le
+-/
 
 #print integral_sin_pow_antitone /-
 theorem integral_sin_pow_antitone : Antitone fun n : ℕ => ∫ x in 0 ..π, sin x ^ n :=
@@ -725,6 +827,7 @@ theorem integral_sin_pow_antitone : Antitone fun n : ℕ => ∫ x in 0 ..π, sin
 /-! ### Integral of `cos x ^ n` -/
 
 
+#print integral_cos_pow_aux /-
 theorem integral_cos_pow_aux :
     ∫ x in a..b, cos x ^ (n + 2) =
       (cos b ^ (n + 1) * sin b - cos a ^ (n + 1) * sin a + (n + 1) * ∫ x in a..b, cos x ^ n) -
@@ -747,7 +850,9 @@ theorem integral_cos_pow_aux :
         continuity
   all_goals apply Continuous.intervalIntegrable; continuity
 #align integral_cos_pow_aux integral_cos_pow_aux
+-/
 
+#print integral_cos_pow /-
 /-- The reduction formula for the integral of `cos x ^ n` for any natural `n ≥ 2`. -/
 theorem integral_cos_pow :
     ∫ x in a..b, cos x ^ (n + 2) =
@@ -759,15 +864,19 @@ theorem integral_cos_pow :
   convert eq_sub_iff_add_eq.mp (integral_cos_pow_aux n)
   ring
 #align integral_cos_pow integral_cos_pow
+-/
 
+#print integral_cos_sq /-
 @[simp]
 theorem integral_cos_sq : ∫ x in a..b, cos x ^ 2 = (cos b * sin b - cos a * sin a + b - a) / 2 := by
   field_simp [integral_cos_pow, add_sub_assoc]
 #align integral_cos_sq integral_cos_sq
+-/
 
 /-! ### Integral of `sin x ^ m * cos x ^ n` -/
 
 
+#print integral_sin_pow_mul_cos_pow_odd /-
 /-- Simplification of the integral of `sin x ^ m * cos x ^ n`, case `n` is odd. -/
 theorem integral_sin_pow_mul_cos_pow_odd (m n : ℕ) :
     ∫ x in a..b, sin x ^ m * cos x ^ (2 * n + 1) = ∫ u in sin a..sin b, u ^ m * (1 - u ^ 2) ^ n :=
@@ -779,25 +888,33 @@ theorem integral_sin_pow_mul_cos_pow_odd (m n : ℕ) :
     _ = ∫ u in sin a..sin b, u ^ m * (1 - u ^ 2) ^ n :=
       integral_comp_mul_deriv (fun x hx => hasDerivAt_sin x) continuousOn_cos hc
 #align integral_sin_pow_mul_cos_pow_odd integral_sin_pow_mul_cos_pow_odd
+-/
 
+#print integral_sin_mul_cos₁ /-
 /-- The integral of `sin x * cos x`, given in terms of sin².
   See `integral_sin_mul_cos₂` below for the integral given in terms of cos². -/
 @[simp]
 theorem integral_sin_mul_cos₁ : ∫ x in a..b, sin x * cos x = (sin b ^ 2 - sin a ^ 2) / 2 := by
   simpa using integral_sin_pow_mul_cos_pow_odd 1 0
 #align integral_sin_mul_cos₁ integral_sin_mul_cos₁
+-/
 
+#print integral_sin_sq_mul_cos /-
 @[simp]
 theorem integral_sin_sq_mul_cos : ∫ x in a..b, sin x ^ 2 * cos x = (sin b ^ 3 - sin a ^ 3) / 3 := by
   simpa using integral_sin_pow_mul_cos_pow_odd 2 0
 #align integral_sin_sq_mul_cos integral_sin_sq_mul_cos
+-/
 
+#print integral_cos_pow_three /-
 @[simp]
 theorem integral_cos_pow_three :
     ∫ x in a..b, cos x ^ 3 = sin b - sin a - (sin b ^ 3 - sin a ^ 3) / 3 := by
   simpa using integral_sin_pow_mul_cos_pow_odd 0 1
 #align integral_cos_pow_three integral_cos_pow_three
+-/
 
+#print integral_sin_pow_odd_mul_cos_pow /-
 /-- Simplification of the integral of `sin x ^ m * cos x ^ n`, case `m` is odd. -/
 theorem integral_sin_pow_odd_mul_cos_pow (m n : ℕ) :
     ∫ x in a..b, sin x ^ (2 * m + 1) * cos x ^ n = ∫ u in cos b..cos a, u ^ n * (1 - u ^ 2) ^ m :=
@@ -811,31 +928,41 @@ theorem integral_sin_pow_odd_mul_cos_pow (m n : ℕ) :
     _ = ∫ u in cos b..cos a, u ^ n * (1 - u ^ 2) ^ m :=
       integral_comp_mul_deriv (fun x hx => hasDerivAt_cos x) continuousOn_sin.neg hc
 #align integral_sin_pow_odd_mul_cos_pow integral_sin_pow_odd_mul_cos_pow
+-/
 
+#print integral_sin_mul_cos₂ /-
 /-- The integral of `sin x * cos x`, given in terms of cos².
 See `integral_sin_mul_cos₁` above for the integral given in terms of sin². -/
 theorem integral_sin_mul_cos₂ : ∫ x in a..b, sin x * cos x = (cos a ^ 2 - cos b ^ 2) / 2 := by
   simpa using integral_sin_pow_odd_mul_cos_pow 0 1
 #align integral_sin_mul_cos₂ integral_sin_mul_cos₂
+-/
 
+#print integral_sin_mul_cos_sq /-
 @[simp]
 theorem integral_sin_mul_cos_sq : ∫ x in a..b, sin x * cos x ^ 2 = (cos a ^ 3 - cos b ^ 3) / 3 := by
   simpa using integral_sin_pow_odd_mul_cos_pow 0 2
 #align integral_sin_mul_cos_sq integral_sin_mul_cos_sq
+-/
 
+#print integral_sin_pow_three /-
 @[simp]
 theorem integral_sin_pow_three :
     ∫ x in a..b, sin x ^ 3 = cos a - cos b - (cos a ^ 3 - cos b ^ 3) / 3 := by
   simpa using integral_sin_pow_odd_mul_cos_pow 1 0
 #align integral_sin_pow_three integral_sin_pow_three
+-/
 
+#print integral_sin_pow_even_mul_cos_pow_even /-
 /-- Simplification of the integral of `sin x ^ m * cos x ^ n`, case `m` and `n` are both even. -/
 theorem integral_sin_pow_even_mul_cos_pow_even (m n : ℕ) :
     ∫ x in a..b, sin x ^ (2 * m) * cos x ^ (2 * n) =
       ∫ x in a..b, ((1 - cos (2 * x)) / 2) ^ m * ((1 + cos (2 * x)) / 2) ^ n :=
   by field_simp [pow_mul, sin_sq, cos_sq, ← sub_sub, (by ring : (2 : ℝ) - 1 = 1)]
 #align integral_sin_pow_even_mul_cos_pow_even integral_sin_pow_even_mul_cos_pow_even
+-/
 
+#print integral_sin_sq_mul_cos_sq /-
 @[simp]
 theorem integral_sin_sq_mul_cos_sq :
     ∫ x in a..b, sin x ^ 2 * cos x ^ 2 = (b - a) / 8 - (sin (4 * b) - sin (4 * a)) / 32 :=
@@ -848,4 +975,5 @@ theorem integral_sin_sq_mul_cos_sq :
   simp [h1, h2.interval_integrable, integral_comp_mul_left fun x => cos x ^ 2, h3, h4]
   ring
 #align integral_sin_sq_mul_cos_sq integral_sin_sq_mul_cos_sq
+-/
 
Diff
@@ -273,65 +273,65 @@ theorem intervalIntegrable_inv_one_add_sq : IntervalIntegrable (fun x : ℝ => (
 
 
 @[simp]
-theorem mul_integral_comp_mul_right : (c * ∫ x in a..b, f (x * c)) = ∫ x in a * c..b * c, f x :=
+theorem mul_integral_comp_mul_right : c * ∫ x in a..b, f (x * c) = ∫ x in a * c..b * c, f x :=
   smul_integral_comp_mul_right f c
 #align interval_integral.mul_integral_comp_mul_right intervalIntegral.mul_integral_comp_mul_right
 
 @[simp]
-theorem mul_integral_comp_mul_left : (c * ∫ x in a..b, f (c * x)) = ∫ x in c * a..c * b, f x :=
+theorem mul_integral_comp_mul_left : c * ∫ x in a..b, f (c * x) = ∫ x in c * a..c * b, f x :=
   smul_integral_comp_mul_left f c
 #align interval_integral.mul_integral_comp_mul_left intervalIntegral.mul_integral_comp_mul_left
 
 @[simp]
-theorem inv_mul_integral_comp_div : (c⁻¹ * ∫ x in a..b, f (x / c)) = ∫ x in a / c..b / c, f x :=
+theorem inv_mul_integral_comp_div : c⁻¹ * ∫ x in a..b, f (x / c) = ∫ x in a / c..b / c, f x :=
   inv_smul_integral_comp_div f c
 #align interval_integral.inv_mul_integral_comp_div intervalIntegral.inv_mul_integral_comp_div
 
 @[simp]
 theorem mul_integral_comp_mul_add :
-    (c * ∫ x in a..b, f (c * x + d)) = ∫ x in c * a + d..c * b + d, f x :=
+    c * ∫ x in a..b, f (c * x + d) = ∫ x in c * a + d..c * b + d, f x :=
   smul_integral_comp_mul_add f c d
 #align interval_integral.mul_integral_comp_mul_add intervalIntegral.mul_integral_comp_mul_add
 
 @[simp]
 theorem mul_integral_comp_add_mul :
-    (c * ∫ x in a..b, f (d + c * x)) = ∫ x in d + c * a..d + c * b, f x :=
+    c * ∫ x in a..b, f (d + c * x) = ∫ x in d + c * a..d + c * b, f x :=
   smul_integral_comp_add_mul f c d
 #align interval_integral.mul_integral_comp_add_mul intervalIntegral.mul_integral_comp_add_mul
 
 @[simp]
 theorem inv_mul_integral_comp_div_add :
-    (c⁻¹ * ∫ x in a..b, f (x / c + d)) = ∫ x in a / c + d..b / c + d, f x :=
+    c⁻¹ * ∫ x in a..b, f (x / c + d) = ∫ x in a / c + d..b / c + d, f x :=
   inv_smul_integral_comp_div_add f c d
 #align interval_integral.inv_mul_integral_comp_div_add intervalIntegral.inv_mul_integral_comp_div_add
 
 @[simp]
 theorem inv_mul_integral_comp_add_div :
-    (c⁻¹ * ∫ x in a..b, f (d + x / c)) = ∫ x in d + a / c..d + b / c, f x :=
+    c⁻¹ * ∫ x in a..b, f (d + x / c) = ∫ x in d + a / c..d + b / c, f x :=
   inv_smul_integral_comp_add_div f c d
 #align interval_integral.inv_mul_integral_comp_add_div intervalIntegral.inv_mul_integral_comp_add_div
 
 @[simp]
 theorem mul_integral_comp_mul_sub :
-    (c * ∫ x in a..b, f (c * x - d)) = ∫ x in c * a - d..c * b - d, f x :=
+    c * ∫ x in a..b, f (c * x - d) = ∫ x in c * a - d..c * b - d, f x :=
   smul_integral_comp_mul_sub f c d
 #align interval_integral.mul_integral_comp_mul_sub intervalIntegral.mul_integral_comp_mul_sub
 
 @[simp]
 theorem mul_integral_comp_sub_mul :
-    (c * ∫ x in a..b, f (d - c * x)) = ∫ x in d - c * b..d - c * a, f x :=
+    c * ∫ x in a..b, f (d - c * x) = ∫ x in d - c * b..d - c * a, f x :=
   smul_integral_comp_sub_mul f c d
 #align interval_integral.mul_integral_comp_sub_mul intervalIntegral.mul_integral_comp_sub_mul
 
 @[simp]
 theorem inv_mul_integral_comp_div_sub :
-    (c⁻¹ * ∫ x in a..b, f (x / c - d)) = ∫ x in a / c - d..b / c - d, f x :=
+    c⁻¹ * ∫ x in a..b, f (x / c - d) = ∫ x in a / c - d..b / c - d, f x :=
   inv_smul_integral_comp_div_sub f c d
 #align interval_integral.inv_mul_integral_comp_div_sub intervalIntegral.inv_mul_integral_comp_div_sub
 
 @[simp]
 theorem inv_mul_integral_comp_sub_div :
-    (c⁻¹ * ∫ x in a..b, f (d - x / c)) = ∫ x in d - b / c..d - a / c, f x :=
+    c⁻¹ * ∫ x in a..b, f (d - x / c) = ∫ x in d - b / c..d - a / c, f x :=
   inv_smul_integral_comp_sub_div f c d
 #align interval_integral.inv_mul_integral_comp_sub_div intervalIntegral.inv_mul_integral_comp_sub_div
 
@@ -343,7 +343,7 @@ open intervalIntegral
 
 
 theorem integral_cpow {r : ℂ} (h : -1 < r.re ∨ r ≠ -1 ∧ (0 : ℝ) ∉ [a, b]) :
-    (∫ x : ℝ in a..b, (x : ℂ) ^ r) = (b ^ (r + 1) - a ^ (r + 1)) / (r + 1) :=
+    ∫ x : ℝ in a..b, (x : ℂ) ^ r = (b ^ (r + 1) - a ^ (r + 1)) / (r + 1) :=
   by
   rw [sub_div]
   have hr : r + 1 ≠ 0 := by
@@ -357,7 +357,7 @@ theorem integral_cpow {r : ℂ} (h : -1 < r.re ∨ r ≠ -1 ∧ (0 : ℝ) ∉ [a
     refine' hasDerivAt_ofReal_cpow (ne_of_mem_of_not_mem hx hab) _
     contrapose! hr; rwa [add_eq_zero_iff_eq_neg]
   replace h : -1 < r.re; · tauto
-  suffices ∀ c : ℝ, (∫ x : ℝ in 0 ..c, (x : ℂ) ^ r) = c ^ (r + 1) / (r + 1) - 0 ^ (r + 1) / (r + 1)
+  suffices ∀ c : ℝ, ∫ x : ℝ in 0 ..c, (x : ℂ) ^ r = c ^ (r + 1) / (r + 1) - 0 ^ (r + 1) / (r + 1)
     by
     rw [←
       integral_add_adjacent_intervals (@interval_integrable_cpow' a 0 r h)
@@ -376,7 +376,7 @@ theorem integral_cpow {r : ℂ} (h : -1 < r.re ∨ r ≠ -1 ∧ (0 : ℝ) ∉ [a
 #align integral_cpow integral_cpow
 
 theorem integral_rpow {r : ℝ} (h : -1 < r ∨ r ≠ -1 ∧ (0 : ℝ) ∉ [a, b]) :
-    (∫ x in a..b, x ^ r) = (b ^ (r + 1) - a ^ (r + 1)) / (r + 1) :=
+    ∫ x in a..b, x ^ r = (b ^ (r + 1) - a ^ (r + 1)) / (r + 1) :=
   by
   have h' : -1 < (r : ℂ).re ∨ (r : ℂ) ≠ -1 ∧ (0 : ℝ) ∉ [a, b] :=
     by
@@ -384,7 +384,7 @@ theorem integral_rpow {r : ℝ} (h : -1 < r ∨ r ≠ -1 ∧ (0 : ℝ) ∉ [a, b
     · left; rwa [Complex.ofReal_re]
     · right; rwa [← Complex.ofReal_one, ← Complex.ofReal_neg, Ne.def, Complex.ofReal_inj]
   have :
-    (∫ x in a..b, (x : ℂ) ^ (r : ℂ)) = ((b : ℂ) ^ (r + 1 : ℂ) - (a : ℂ) ^ (r + 1 : ℂ)) / (r + 1) :=
+    ∫ x in a..b, (x : ℂ) ^ (r : ℂ) = ((b : ℂ) ^ (r + 1 : ℂ) - (a : ℂ) ^ (r + 1 : ℂ)) / (r + 1) :=
     integral_cpow h'
   apply_fun Complex.re at this ; convert this
   · simp_rw [interval_integral_eq_integral_uIoc, Complex.real_smul, Complex.ofReal_mul_re]
@@ -399,25 +399,25 @@ theorem integral_rpow {r : ℝ} (h : -1 < r ∨ r ≠ -1 ∧ (0 : ℝ) ∉ [a, b
 #align integral_rpow integral_rpow
 
 theorem integral_zpow {n : ℤ} (h : 0 ≤ n ∨ n ≠ -1 ∧ (0 : ℝ) ∉ [a, b]) :
-    (∫ x in a..b, x ^ n) = (b ^ (n + 1) - a ^ (n + 1)) / (n + 1) :=
+    ∫ x in a..b, x ^ n = (b ^ (n + 1) - a ^ (n + 1)) / (n + 1) :=
   by
   replace h : -1 < (n : ℝ) ∨ (n : ℝ) ≠ -1 ∧ (0 : ℝ) ∉ [a, b]; · exact_mod_cast h
   exact_mod_cast integral_rpow h
 #align integral_zpow integral_zpow
 
 @[simp]
-theorem integral_pow : (∫ x in a..b, x ^ n) = (b ^ (n + 1) - a ^ (n + 1)) / (n + 1) := by
+theorem integral_pow : ∫ x in a..b, x ^ n = (b ^ (n + 1) - a ^ (n + 1)) / (n + 1) := by
   simpa only [← Int.ofNat_succ, zpow_ofNat] using integral_zpow (Or.inl (Int.coe_nat_nonneg n))
 #align integral_pow integral_pow
 
 /-- Integral of `|x - a| ^ n` over `Ι a b`. This integral appears in the proof of the
 Picard-Lindelöf/Cauchy-Lipschitz theorem. -/
-theorem integral_pow_abs_sub_uIoc : (∫ x in Ι a b, |x - a| ^ n) = |b - a| ^ (n + 1) / (n + 1) :=
+theorem integral_pow_abs_sub_uIoc : ∫ x in Ι a b, |x - a| ^ n = |b - a| ^ (n + 1) / (n + 1) :=
   by
   cases' le_or_lt a b with hab hab
   ·
     calc
-      (∫ x in Ι a b, |x - a| ^ n) = ∫ x in a..b, |x - a| ^ n := by
+      ∫ x in Ι a b, |x - a| ^ n = ∫ x in a..b, |x - a| ^ n := by
         rw [uIoc_of_le hab, ← integral_of_le hab]
       _ = ∫ x in 0 ..b - a, x ^ n :=
         by
@@ -428,7 +428,7 @@ theorem integral_pow_abs_sub_uIoc : (∫ x in Ι a b, |x - a| ^ n) = |b - a| ^ (
       _ = |b - a| ^ (n + 1) / (n + 1) := by simp [abs_of_nonneg (sub_nonneg.2 hab)]
   ·
     calc
-      (∫ x in Ι a b, |x - a| ^ n) = ∫ x in b..a, |x - a| ^ n := by
+      ∫ x in Ι a b, |x - a| ^ n = ∫ x in b..a, |x - a| ^ n := by
         rw [uIoc_of_lt hab, ← integral_of_le hab.le]
       _ = ∫ x in b - a..0, (-x) ^ n :=
         by
@@ -441,21 +441,21 @@ theorem integral_pow_abs_sub_uIoc : (∫ x in Ι a b, |x - a| ^ n) = |b - a| ^ (
 #align integral_pow_abs_sub_uIoc integral_pow_abs_sub_uIoc
 
 @[simp]
-theorem integral_id : (∫ x in a..b, x) = (b ^ 2 - a ^ 2) / 2 := by simpa using integral_pow 1
+theorem integral_id : ∫ x in a..b, x = (b ^ 2 - a ^ 2) / 2 := by simpa using integral_pow 1
 #align integral_id integral_id
 
 @[simp]
-theorem integral_one : (∫ x in a..b, (1 : ℝ)) = b - a := by
+theorem integral_one : ∫ x in a..b, (1 : ℝ) = b - a := by
   simp only [mul_one, smul_eq_mul, integral_const]
 #align integral_one integral_one
 
 #print integral_const_on_unit_interval /-
-theorem integral_const_on_unit_interval : (∫ x in a..a + 1, b) = b := by simp
+theorem integral_const_on_unit_interval : ∫ x in a..a + 1, b = b := by simp
 #align integral_const_on_unit_interval integral_const_on_unit_interval
 -/
 
 @[simp]
-theorem integral_inv (h : (0 : ℝ) ∉ [a, b]) : (∫ x in a..b, x⁻¹) = log (b / a) :=
+theorem integral_inv (h : (0 : ℝ) ∉ [a, b]) : ∫ x in a..b, x⁻¹ = log (b / a) :=
   by
   have h' := fun x hx => ne_of_mem_of_not_mem hx h
   rw [integral_deriv_eq_sub' _ deriv_log' (fun x hx => differentiable_at_log (h' x hx))
@@ -464,34 +464,34 @@ theorem integral_inv (h : (0 : ℝ) ∉ [a, b]) : (∫ x in a..b, x⁻¹) = log
 #align integral_inv integral_inv
 
 @[simp]
-theorem integral_inv_of_pos (ha : 0 < a) (hb : 0 < b) : (∫ x in a..b, x⁻¹) = log (b / a) :=
+theorem integral_inv_of_pos (ha : 0 < a) (hb : 0 < b) : ∫ x in a..b, x⁻¹ = log (b / a) :=
   integral_inv <| not_mem_uIcc_of_lt ha hb
 #align integral_inv_of_pos integral_inv_of_pos
 
 @[simp]
-theorem integral_inv_of_neg (ha : a < 0) (hb : b < 0) : (∫ x in a..b, x⁻¹) = log (b / a) :=
+theorem integral_inv_of_neg (ha : a < 0) (hb : b < 0) : ∫ x in a..b, x⁻¹ = log (b / a) :=
   integral_inv <| not_mem_uIcc_of_gt ha hb
 #align integral_inv_of_neg integral_inv_of_neg
 
-theorem integral_one_div (h : (0 : ℝ) ∉ [a, b]) : (∫ x : ℝ in a..b, 1 / x) = log (b / a) := by
+theorem integral_one_div (h : (0 : ℝ) ∉ [a, b]) : ∫ x : ℝ in a..b, 1 / x = log (b / a) := by
   simp only [one_div, integral_inv h]
 #align integral_one_div integral_one_div
 
-theorem integral_one_div_of_pos (ha : 0 < a) (hb : 0 < b) :
-    (∫ x : ℝ in a..b, 1 / x) = log (b / a) := by simp only [one_div, integral_inv_of_pos ha hb]
+theorem integral_one_div_of_pos (ha : 0 < a) (hb : 0 < b) : ∫ x : ℝ in a..b, 1 / x = log (b / a) :=
+  by simp only [one_div, integral_inv_of_pos ha hb]
 #align integral_one_div_of_pos integral_one_div_of_pos
 
-theorem integral_one_div_of_neg (ha : a < 0) (hb : b < 0) :
-    (∫ x : ℝ in a..b, 1 / x) = log (b / a) := by simp only [one_div, integral_inv_of_neg ha hb]
+theorem integral_one_div_of_neg (ha : a < 0) (hb : b < 0) : ∫ x : ℝ in a..b, 1 / x = log (b / a) :=
+  by simp only [one_div, integral_inv_of_neg ha hb]
 #align integral_one_div_of_neg integral_one_div_of_neg
 
 @[simp]
-theorem integral_exp : (∫ x in a..b, exp x) = exp b - exp a := by
+theorem integral_exp : ∫ x in a..b, exp x = exp b - exp a := by
   rw [integral_deriv_eq_sub'] <;> norm_num [continuousOn_exp]
 #align integral_exp integral_exp
 
 theorem integral_exp_mul_complex {c : ℂ} (hc : c ≠ 0) :
-    (∫ x in a..b, Complex.exp (c * x)) = (Complex.exp (c * b) - Complex.exp (c * a)) / c :=
+    ∫ x in a..b, Complex.exp (c * x) = (Complex.exp (c * b) - Complex.exp (c * a)) / c :=
   by
   have D : ∀ x : ℝ, HasDerivAt (fun y : ℝ => Complex.exp (c * y) / c) (Complex.exp (c * x)) x :=
     by
@@ -508,8 +508,7 @@ theorem integral_exp_mul_complex {c : ℂ} (hc : c ≠ 0) :
 #align integral_exp_mul_complex integral_exp_mul_complex
 
 @[simp]
-theorem integral_log (h : (0 : ℝ) ∉ [a, b]) :
-    (∫ x in a..b, log x) = b * log b - a * log a - b + a :=
+theorem integral_log (h : (0 : ℝ) ∉ [a, b]) : ∫ x in a..b, log x = b * log b - a * log a - b + a :=
   by
   obtain ⟨h', heq⟩ := fun x hx => ne_of_mem_of_not_mem hx h, fun x hx => mul_inv_cancel (h' x hx)
   convert
@@ -523,28 +522,28 @@ theorem integral_log (h : (0 : ℝ) ∉ [a, b]) :
 
 @[simp]
 theorem integral_log_of_pos (ha : 0 < a) (hb : 0 < b) :
-    (∫ x in a..b, log x) = b * log b - a * log a - b + a :=
+    ∫ x in a..b, log x = b * log b - a * log a - b + a :=
   integral_log <| not_mem_uIcc_of_lt ha hb
 #align integral_log_of_pos integral_log_of_pos
 
 @[simp]
 theorem integral_log_of_neg (ha : a < 0) (hb : b < 0) :
-    (∫ x in a..b, log x) = b * log b - a * log a - b + a :=
+    ∫ x in a..b, log x = b * log b - a * log a - b + a :=
   integral_log <| not_mem_uIcc_of_gt ha hb
 #align integral_log_of_neg integral_log_of_neg
 
 @[simp]
-theorem integral_sin : (∫ x in a..b, sin x) = cos a - cos b := by
+theorem integral_sin : ∫ x in a..b, sin x = cos a - cos b := by
   rw [integral_deriv_eq_sub' fun x => -cos x] <;> norm_num [continuous_on_sin]
 #align integral_sin integral_sin
 
 @[simp]
-theorem integral_cos : (∫ x in a..b, cos x) = sin b - sin a := by
+theorem integral_cos : ∫ x in a..b, cos x = sin b - sin a := by
   rw [integral_deriv_eq_sub'] <;> norm_num [continuous_on_cos]
 #align integral_cos integral_cos
 
 theorem integral_cos_mul_complex {z : ℂ} (hz : z ≠ 0) (a b : ℝ) :
-    (∫ x in a..b, Complex.cos (z * x)) = Complex.sin (z * b) / z - Complex.sin (z * a) / z :=
+    ∫ x in a..b, Complex.cos (z * x) = Complex.sin (z * b) / z - Complex.sin (z * a) / z :=
   by
   apply integral_eq_sub_of_has_deriv_at
   swap
@@ -560,14 +559,14 @@ theorem integral_cos_mul_complex {z : ℂ} (hz : z ≠ 0) (a b : ℝ) :
 #align integral_cos_mul_complex integral_cos_mul_complex
 
 theorem integral_cos_sq_sub_sin_sq :
-    (∫ x in a..b, cos x ^ 2 - sin x ^ 2) = sin b * cos b - sin a * cos a := by
+    ∫ x in a..b, cos x ^ 2 - sin x ^ 2 = sin b * cos b - sin a * cos a := by
   simpa only [sq, sub_eq_add_neg, neg_mul_eq_mul_neg] using
     integral_deriv_mul_eq_sub (fun x hx => has_deriv_at_sin x) (fun x hx => has_deriv_at_cos x)
       continuous_on_cos.interval_integrable continuous_on_sin.neg.interval_integrable
 #align integral_cos_sq_sub_sin_sq integral_cos_sq_sub_sin_sq
 
 @[simp]
-theorem integral_inv_one_add_sq : (∫ x : ℝ in a..b, (1 + x ^ 2)⁻¹) = arctan b - arctan a :=
+theorem integral_inv_one_add_sq : ∫ x : ℝ in a..b, (1 + x ^ 2)⁻¹ = arctan b - arctan a :=
   by
   simp only [← one_div]
   refine' integral_deriv_eq_sub' _ _ _ (continuous_const.div _ fun x => _).ContinuousOn
@@ -577,7 +576,7 @@ theorem integral_inv_one_add_sq : (∫ x : ℝ in a..b, (1 + x ^ 2)⁻¹) = arct
   · nlinarith
 #align integral_inv_one_add_sq integral_inv_one_add_sq
 
-theorem integral_one_div_one_add_sq : (∫ x : ℝ in a..b, 1 / (1 + x ^ 2)) = arctan b - arctan a := by
+theorem integral_one_div_one_add_sq : ∫ x : ℝ in a..b, 1 / (1 + x ^ 2) = arctan b - arctan a := by
   simp only [one_div, integral_inv_one_add_sq]
 #align integral_one_div_one_add_sq integral_one_div_one_add_sq
 
@@ -586,7 +585,7 @@ section RpowCpow
 open Complex
 
 theorem integral_mul_cpow_one_add_sq {t : ℂ} (ht : t ≠ -1) :
-    (∫ x : ℝ in a..b, (x : ℂ) * (1 + x ^ 2) ^ t) =
+    ∫ x : ℝ in a..b, (x : ℂ) * (1 + x ^ 2) ^ t =
       (1 + b ^ 2) ^ (t + 1) / (2 * (t + 1)) - (1 + a ^ 2) ^ (t + 1) / (2 * (t + 1)) :=
   by
   have : t + 1 ≠ 0 := by contrapose! ht; rwa [add_eq_zero_iff_eq_neg] at ht 
@@ -617,7 +616,7 @@ theorem integral_mul_cpow_one_add_sq {t : ℂ} (ht : t ≠ -1) :
 #align integral_mul_cpow_one_add_sq integral_mul_cpow_one_add_sq
 
 theorem integral_mul_rpow_one_add_sq {t : ℝ} (ht : t ≠ -1) :
-    (∫ x : ℝ in a..b, x * (1 + x ^ 2) ^ t) =
+    ∫ x : ℝ in a..b, x * (1 + x ^ 2) ^ t =
       (1 + b ^ 2) ^ (t + 1) / (2 * (t + 1)) - (1 + a ^ 2) ^ (t + 1) / (2 * (t + 1)) :=
   by
   have : ∀ x s : ℝ, (((1 + x ^ 2) ^ s : ℝ) : ℂ) = (1 + (x : ℂ) ^ 2) ^ ↑s :=
@@ -642,7 +641,7 @@ end RpowCpow
 
 
 theorem integral_sin_pow_aux :
-    (∫ x in a..b, sin x ^ (n + 2)) =
+    ∫ x in a..b, sin x ^ (n + 2) =
       (sin a ^ (n + 1) * cos a - sin b ^ (n + 1) * cos b + (n + 1) * ∫ x in a..b, sin x ^ n) -
         (n + 1) * ∫ x in a..b, sin x ^ (n + 2) :=
   by
@@ -654,8 +653,7 @@ theorem integral_sin_pow_aux :
     simpa only [neg_neg] using (has_deriv_at_cos x).neg
   have H := integral_mul_deriv_eq_deriv_mul hu hv _ _
   calc
-    (∫ x in a..b, sin x ^ (n + 2)) = ∫ x in a..b, sin x ^ (n + 1) * sin x := by
-      simp only [pow_succ']
+    ∫ x in a..b, sin x ^ (n + 2) = ∫ x in a..b, sin x ^ (n + 1) * sin x := by simp only [pow_succ']
     _ = C + (n + 1) * ∫ x in a..b, cos x ^ 2 * sin x ^ n := by simp [H, h, sq]
     _ = C + (n + 1) * ∫ x in a..b, sin x ^ n - sin x ^ (n + 2) := by
       simp [cos_sq', sub_mul, ← pow_add, add_comm]
@@ -667,7 +665,7 @@ theorem integral_sin_pow_aux :
 
 /-- The reduction formula for the integral of `sin x ^ n` for any natural `n ≥ 2`. -/
 theorem integral_sin_pow :
-    (∫ x in a..b, sin x ^ (n + 2)) =
+    ∫ x in a..b, sin x ^ (n + 2) =
       (sin a ^ (n + 1) * cos a - sin b ^ (n + 1) * cos b) / (n + 2) +
         (n + 1) / (n + 2) * ∫ x in a..b, sin x ^ n :=
   by
@@ -678,13 +676,13 @@ theorem integral_sin_pow :
 #align integral_sin_pow integral_sin_pow
 
 @[simp]
-theorem integral_sin_sq : (∫ x in a..b, sin x ^ 2) = (sin a * cos a - sin b * cos b + b - a) / 2 :=
-  by field_simp [integral_sin_pow, add_sub_assoc]
+theorem integral_sin_sq : ∫ x in a..b, sin x ^ 2 = (sin a * cos a - sin b * cos b + b - a) / 2 := by
+  field_simp [integral_sin_pow, add_sub_assoc]
 #align integral_sin_sq integral_sin_sq
 
 #print integral_sin_pow_odd /-
 theorem integral_sin_pow_odd :
-    (∫ x in 0 ..π, sin x ^ (2 * n + 1)) = 2 * ∏ i in range n, (2 * i + 2) / (2 * i + 3) :=
+    ∫ x in 0 ..π, sin x ^ (2 * n + 1) = 2 * ∏ i in range n, (2 * i + 2) / (2 * i + 3) :=
   by
   induction' n with k ih; · norm_num
   rw [prod_range_succ_comm, mul_left_comm, ← ih, mul_succ, integral_sin_pow]
@@ -695,7 +693,7 @@ theorem integral_sin_pow_odd :
 
 #print integral_sin_pow_even /-
 theorem integral_sin_pow_even :
-    (∫ x in 0 ..π, sin x ^ (2 * n)) = π * ∏ i in range n, (2 * i + 1) / (2 * i + 2) :=
+    ∫ x in 0 ..π, sin x ^ (2 * n) = π * ∏ i in range n, (2 * i + 1) / (2 * i + 2) :=
   by
   induction' n with k ih; · simp
   rw [prod_range_succ_comm, mul_left_comm, ← ih, mul_succ, integral_sin_pow]
@@ -712,7 +710,7 @@ theorem integral_sin_pow_pos : 0 < ∫ x in 0 ..π, sin x ^ n := by
     linarith
 #align integral_sin_pow_pos integral_sin_pow_pos
 
-theorem integral_sin_pow_succ_le : (∫ x in 0 ..π, sin x ^ (n + 1)) ≤ ∫ x in 0 ..π, sin x ^ n :=
+theorem integral_sin_pow_succ_le : ∫ x in 0 ..π, sin x ^ (n + 1) ≤ ∫ x in 0 ..π, sin x ^ n :=
   by
   let H x h := pow_le_pow_of_le_one (sin_nonneg_of_mem_Icc h) (sin_le_one x) (n.le_add_right 1)
   refine' integral_mono_on pi_pos.le _ _ H <;> exact (continuous_sin.pow _).IntervalIntegrable 0 π
@@ -728,7 +726,7 @@ theorem integral_sin_pow_antitone : Antitone fun n : ℕ => ∫ x in 0 ..π, sin
 
 
 theorem integral_cos_pow_aux :
-    (∫ x in a..b, cos x ^ (n + 2)) =
+    ∫ x in a..b, cos x ^ (n + 2) =
       (cos b ^ (n + 1) * sin b - cos a ^ (n + 1) * sin a + (n + 1) * ∫ x in a..b, cos x ^ n) -
         (n + 1) * ∫ x in a..b, cos x ^ (n + 2) :=
   by
@@ -740,8 +738,7 @@ theorem integral_cos_pow_aux :
   have hv : ∀ x ∈ [a, b], HasDerivAt sin (cos x) x := fun x hx => has_deriv_at_sin x
   have H := integral_mul_deriv_eq_deriv_mul hu hv _ _
   calc
-    (∫ x in a..b, cos x ^ (n + 2)) = ∫ x in a..b, cos x ^ (n + 1) * cos x := by
-      simp only [pow_succ']
+    ∫ x in a..b, cos x ^ (n + 2) = ∫ x in a..b, cos x ^ (n + 1) * cos x := by simp only [pow_succ']
     _ = C + (n + 1) * ∫ x in a..b, sin x ^ 2 * cos x ^ n := by simp [H, h, sq, -neg_add_rev]
     _ = C + (n + 1) * ∫ x in a..b, cos x ^ n - cos x ^ (n + 2) := by
       simp [sin_sq, sub_mul, ← pow_add, add_comm]
@@ -753,7 +750,7 @@ theorem integral_cos_pow_aux :
 
 /-- The reduction formula for the integral of `cos x ^ n` for any natural `n ≥ 2`. -/
 theorem integral_cos_pow :
-    (∫ x in a..b, cos x ^ (n + 2)) =
+    ∫ x in a..b, cos x ^ (n + 2) =
       (cos b ^ (n + 1) * sin b - cos a ^ (n + 1) * sin a) / (n + 2) +
         (n + 1) / (n + 2) * ∫ x in a..b, cos x ^ n :=
   by
@@ -764,8 +761,8 @@ theorem integral_cos_pow :
 #align integral_cos_pow integral_cos_pow
 
 @[simp]
-theorem integral_cos_sq : (∫ x in a..b, cos x ^ 2) = (cos b * sin b - cos a * sin a + b - a) / 2 :=
-  by field_simp [integral_cos_pow, add_sub_assoc]
+theorem integral_cos_sq : ∫ x in a..b, cos x ^ 2 = (cos b * sin b - cos a * sin a + b - a) / 2 := by
+  field_simp [integral_cos_pow, add_sub_assoc]
 #align integral_cos_sq integral_cos_sq
 
 /-! ### Integral of `sin x ^ m * cos x ^ n` -/
@@ -773,10 +770,10 @@ theorem integral_cos_sq : (∫ x in a..b, cos x ^ 2) = (cos b * sin b - cos a *
 
 /-- Simplification of the integral of `sin x ^ m * cos x ^ n`, case `n` is odd. -/
 theorem integral_sin_pow_mul_cos_pow_odd (m n : ℕ) :
-    (∫ x in a..b, sin x ^ m * cos x ^ (2 * n + 1)) = ∫ u in sin a..sin b, u ^ m * (1 - u ^ 2) ^ n :=
+    ∫ x in a..b, sin x ^ m * cos x ^ (2 * n + 1) = ∫ u in sin a..sin b, u ^ m * (1 - u ^ 2) ^ n :=
   have hc : Continuous fun u : ℝ => u ^ m * (1 - u ^ 2) ^ n := by continuity
   calc
-    (∫ x in a..b, sin x ^ m * cos x ^ (2 * n + 1)) =
+    ∫ x in a..b, sin x ^ m * cos x ^ (2 * n + 1) =
         ∫ x in a..b, sin x ^ m * (1 - sin x ^ 2) ^ n * cos x :=
       by simp only [pow_succ', ← mul_assoc, pow_mul, cos_sq']
     _ = ∫ u in sin a..sin b, u ^ m * (1 - u ^ 2) ^ n :=
@@ -786,28 +783,27 @@ theorem integral_sin_pow_mul_cos_pow_odd (m n : ℕ) :
 /-- The integral of `sin x * cos x`, given in terms of sin².
   See `integral_sin_mul_cos₂` below for the integral given in terms of cos². -/
 @[simp]
-theorem integral_sin_mul_cos₁ : (∫ x in a..b, sin x * cos x) = (sin b ^ 2 - sin a ^ 2) / 2 := by
+theorem integral_sin_mul_cos₁ : ∫ x in a..b, sin x * cos x = (sin b ^ 2 - sin a ^ 2) / 2 := by
   simpa using integral_sin_pow_mul_cos_pow_odd 1 0
 #align integral_sin_mul_cos₁ integral_sin_mul_cos₁
 
 @[simp]
-theorem integral_sin_sq_mul_cos : (∫ x in a..b, sin x ^ 2 * cos x) = (sin b ^ 3 - sin a ^ 3) / 3 :=
-  by simpa using integral_sin_pow_mul_cos_pow_odd 2 0
+theorem integral_sin_sq_mul_cos : ∫ x in a..b, sin x ^ 2 * cos x = (sin b ^ 3 - sin a ^ 3) / 3 := by
+  simpa using integral_sin_pow_mul_cos_pow_odd 2 0
 #align integral_sin_sq_mul_cos integral_sin_sq_mul_cos
 
 @[simp]
 theorem integral_cos_pow_three :
-    (∫ x in a..b, cos x ^ 3) = sin b - sin a - (sin b ^ 3 - sin a ^ 3) / 3 := by
+    ∫ x in a..b, cos x ^ 3 = sin b - sin a - (sin b ^ 3 - sin a ^ 3) / 3 := by
   simpa using integral_sin_pow_mul_cos_pow_odd 0 1
 #align integral_cos_pow_three integral_cos_pow_three
 
 /-- Simplification of the integral of `sin x ^ m * cos x ^ n`, case `m` is odd. -/
 theorem integral_sin_pow_odd_mul_cos_pow (m n : ℕ) :
-    (∫ x in a..b, sin x ^ (2 * m + 1) * cos x ^ n) = ∫ u in cos b..cos a, u ^ n * (1 - u ^ 2) ^ m :=
+    ∫ x in a..b, sin x ^ (2 * m + 1) * cos x ^ n = ∫ u in cos b..cos a, u ^ n * (1 - u ^ 2) ^ m :=
   have hc : Continuous fun u : ℝ => u ^ n * (1 - u ^ 2) ^ m := by continuity
   calc
-    (∫ x in a..b, sin x ^ (2 * m + 1) * cos x ^ n) =
-        -∫ x in b..a, sin x ^ (2 * m + 1) * cos x ^ n :=
+    ∫ x in a..b, sin x ^ (2 * m + 1) * cos x ^ n = -∫ x in b..a, sin x ^ (2 * m + 1) * cos x ^ n :=
       by rw [integral_symm]
     _ = ∫ x in b..a, (1 - cos x ^ 2) ^ m * -sin x * cos x ^ n := by
       simp [pow_succ', pow_mul, sin_sq]
@@ -818,31 +814,31 @@ theorem integral_sin_pow_odd_mul_cos_pow (m n : ℕ) :
 
 /-- The integral of `sin x * cos x`, given in terms of cos².
 See `integral_sin_mul_cos₁` above for the integral given in terms of sin². -/
-theorem integral_sin_mul_cos₂ : (∫ x in a..b, sin x * cos x) = (cos a ^ 2 - cos b ^ 2) / 2 := by
+theorem integral_sin_mul_cos₂ : ∫ x in a..b, sin x * cos x = (cos a ^ 2 - cos b ^ 2) / 2 := by
   simpa using integral_sin_pow_odd_mul_cos_pow 0 1
 #align integral_sin_mul_cos₂ integral_sin_mul_cos₂
 
 @[simp]
-theorem integral_sin_mul_cos_sq : (∫ x in a..b, sin x * cos x ^ 2) = (cos a ^ 3 - cos b ^ 3) / 3 :=
-  by simpa using integral_sin_pow_odd_mul_cos_pow 0 2
+theorem integral_sin_mul_cos_sq : ∫ x in a..b, sin x * cos x ^ 2 = (cos a ^ 3 - cos b ^ 3) / 3 := by
+  simpa using integral_sin_pow_odd_mul_cos_pow 0 2
 #align integral_sin_mul_cos_sq integral_sin_mul_cos_sq
 
 @[simp]
 theorem integral_sin_pow_three :
-    (∫ x in a..b, sin x ^ 3) = cos a - cos b - (cos a ^ 3 - cos b ^ 3) / 3 := by
+    ∫ x in a..b, sin x ^ 3 = cos a - cos b - (cos a ^ 3 - cos b ^ 3) / 3 := by
   simpa using integral_sin_pow_odd_mul_cos_pow 1 0
 #align integral_sin_pow_three integral_sin_pow_three
 
 /-- Simplification of the integral of `sin x ^ m * cos x ^ n`, case `m` and `n` are both even. -/
 theorem integral_sin_pow_even_mul_cos_pow_even (m n : ℕ) :
-    (∫ x in a..b, sin x ^ (2 * m) * cos x ^ (2 * n)) =
+    ∫ x in a..b, sin x ^ (2 * m) * cos x ^ (2 * n) =
       ∫ x in a..b, ((1 - cos (2 * x)) / 2) ^ m * ((1 + cos (2 * x)) / 2) ^ n :=
   by field_simp [pow_mul, sin_sq, cos_sq, ← sub_sub, (by ring : (2 : ℝ) - 1 = 1)]
 #align integral_sin_pow_even_mul_cos_pow_even integral_sin_pow_even_mul_cos_pow_even
 
 @[simp]
 theorem integral_sin_sq_mul_cos_sq :
-    (∫ x in a..b, sin x ^ 2 * cos x ^ 2) = (b - a) / 8 - (sin (4 * b) - sin (4 * a)) / 32 :=
+    ∫ x in a..b, sin x ^ 2 * cos x ^ 2 = (b - a) / 8 - (sin (4 * b) - sin (4 * a)) / 32 :=
   by
   convert integral_sin_pow_even_mul_cos_pow_even 1 1 using 1
   have h1 : ∀ c : ℝ, (1 - c) / 2 * ((1 + c) / 2) = (1 - c ^ 2) / 4 := fun c => by ring
Diff
@@ -111,16 +111,16 @@ theorem intervalIntegrable_cpow {r : ℂ} (h : 0 ≤ r.re ∨ (0 : ℝ) ∉ [a,
   by_cases h2 : (0 : ℝ) ∉ [a, b]
   · -- Easy case #1: 0 ∉ [a, b] -- use continuity.
     refine' (ContinuousAt.continuousOn fun x hx => _).IntervalIntegrable
-    exact Complex.continuousAt_of_real_cpow_const _ _ (Or.inr <| ne_of_mem_of_not_mem hx h2)
+    exact Complex.continuousAt_ofReal_cpow_const _ _ (Or.inr <| ne_of_mem_of_not_mem hx h2)
   rw [eq_false h2, or_false_iff] at h 
   rcases lt_or_eq_of_le h with (h' | h')
   ·-- Easy case #2: 0 < re r -- again use continuity
-    exact (Complex.continuous_of_real_cpow_const h').IntervalIntegrable _ _
+    exact (Complex.continuous_ofReal_cpow_const h').IntervalIntegrable _ _
   -- Now the hard case: re r = 0 and 0 is in the interval.
   refine' (IntervalIntegrable.intervalIntegrable_norm_iff _).mp _
   · refine' (measurable_of_continuousOn_compl_singleton (0 : ℝ) _).AEStronglyMeasurable
     exact
-      ContinuousAt.continuousOn fun x hx => Complex.continuousAt_of_real_cpow_const x r (Or.inr hx)
+      ContinuousAt.continuousOn fun x hx => Complex.continuousAt_ofReal_cpow_const x r (Or.inr hx)
   -- reduce to case of integral over `[0, c]`
   suffices : ∀ c : ℝ, IntervalIntegrable (fun x : ℝ => ‖↑x ^ r‖) μ 0 c
   exact (this a).symm.trans (this b)
@@ -147,7 +147,7 @@ theorem intervalIntegrable_cpow {r : ℂ} (h : 0 ≤ r.re ∨ (0 : ℝ) ∉ [a,
     · have : ∀ x : ℝ, x ∈ Ioo c 0 → ‖Complex.exp (↑π * Complex.I * r)‖ = ‖(x : ℂ) ^ r‖ :=
         by
         intro x hx
-        rw [Complex.of_real_cpow_of_nonpos hx.2.le, norm_mul, ← Complex.ofReal_neg,
+        rw [Complex.ofReal_cpow_of_nonpos hx.2.le, norm_mul, ← Complex.ofReal_neg,
           Complex.norm_eq_abs (_ ^ _), Complex.abs_cpow_eq_rpow_re_of_pos (neg_pos.mpr hx.2), ← h',
           rpow_zero, one_mul]
       refine' integrable_on.congr_fun _ this measurableSet_Ioo
@@ -191,7 +191,7 @@ theorem intervalIntegrable_cpow' {r : ℂ} (h : -1 < r.re) :
     refine' m.congr_fun (fun x hx => _) measurableSet_Ioc
     dsimp only
     have : -x ≤ 0 := by linarith [hx.1]
-    rw [Complex.of_real_cpow_of_nonpos this, mul_comm]
+    rw [Complex.ofReal_cpow_of_nonpos this, mul_comm]
     simp
 #align interval_integral.interval_integrable_cpow' intervalIntegral.intervalIntegrable_cpow'
 
@@ -354,7 +354,7 @@ theorem integral_cpow {r : ℂ} (h : -1 < r.re ∨ r ≠ -1 ∧ (0 : ℝ) ∉ [a
     · rw [Ne.def, ← add_eq_zero_iff_eq_neg] at h ; exact h.1
   by_cases hab : (0 : ℝ) ∉ [a, b]
   · refine' integral_eq_sub_of_has_deriv_at (fun x hx => _) (interval_integrable_cpow <| Or.inr hab)
-    refine' hasDerivAt_of_real_cpow (ne_of_mem_of_not_mem hx hab) _
+    refine' hasDerivAt_ofReal_cpow (ne_of_mem_of_not_mem hx hab) _
     contrapose! hr; rwa [add_eq_zero_iff_eq_neg]
   replace h : -1 < r.re; · tauto
   suffices ∀ c : ℝ, (∫ x : ℝ in 0 ..c, (x : ℂ) ^ r) = c ^ (r + 1) / (r + 1) - 0 ^ (r + 1) / (r + 1)
@@ -366,9 +366,9 @@ theorem integral_cpow {r : ℂ} (h : -1 < r.re ∨ r ≠ -1 ∧ (0 : ℝ) ∉ [a
     ring
   intro c
   apply integral_eq_sub_of_has_deriv_right
-  · refine' ((Complex.continuous_of_real_cpow_const _).div_const _).ContinuousOn
+  · refine' ((Complex.continuous_ofReal_cpow_const _).div_const _).ContinuousOn
     rwa [Complex.add_re, Complex.one_re, ← neg_lt_iff_pos_add]
-  · refine' fun x hx => (hasDerivAt_of_real_cpow _ _).HasDerivWithinAt
+  · refine' fun x hx => (hasDerivAt_ofReal_cpow _ _).HasDerivWithinAt
     · rcases le_total c 0 with (hc | hc)
       · rw [max_eq_left hc] at hx ; exact hx.2.Ne; · rw [min_eq_left hc] at hx ; exact hx.1.ne'
     · contrapose! hr; rw [hr]; ring
@@ -501,7 +501,7 @@ theorem integral_exp_mul_complex {c : ℂ} (hc : c ≠ 0) :
       skip
       rw [← mul_div_cancel (Complex.exp (c * x)) hc]
     convert ((Complex.hasDerivAt_exp _).comp x _).div_const c using 1
-    simpa only [mul_one] using ((hasDerivAt_id (x : ℂ)).const_mul _).comp_of_real
+    simpa only [mul_one] using ((hasDerivAt_id (x : ℂ)).const_mul _).comp_ofReal
   rw [integral_deriv_eq_sub' _ (funext fun x => (D x).deriv) fun x hx => (D x).DifferentiableAt]
   · ring_nf
   · apply Continuous.continuousOn; continuity
@@ -554,7 +554,7 @@ theorem integral_cos_mul_complex {z : ℂ} (hz : z ≠ 0) (a b : ℝ) :
   have a := Complex.hasDerivAt_sin (↑x * z)
   have b : HasDerivAt (fun y => y * z : ℂ → ℂ) z ↑x := hasDerivAt_mul_const _
   have c : HasDerivAt (fun y : ℂ => Complex.sin (y * z)) _ ↑x := HasDerivAt.comp x a b
-  convert HasDerivAt.comp_of_real (c.div_const z)
+  convert HasDerivAt.comp_ofReal (c.div_const z)
   · simp_rw [mul_comm]
   · rw [mul_div_cancel _ hz, mul_comm]
 #align integral_cos_mul_complex integral_cos_mul_complex
@@ -602,7 +602,7 @@ theorem integral_mul_cpow_one_add_sq {t : ℂ} (ht : t ≠ -1) :
       convert (HasDerivAt.cpow_const (hasDerivAt_id _) (Or.inl hz)).div_const (2 * (t + 1)) using 1
       field_simp
       ring
-    convert (HasDerivAt.comp (↑x) (g _) f).comp_of_real using 1
+    convert (HasDerivAt.comp (↑x) (g _) f).comp_ofReal using 1
     · field_simp; ring
     · rw [add_re, one_re, ← of_real_pow, of_real_re]
       exact add_pos_of_pos_of_nonneg zero_lt_one (sq_nonneg x)
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Benjamin Davidson
 
 ! This file was ported from Lean 3 source module analysis.special_functions.integrals
-! leanprover-community/mathlib commit 011cafb4a5bc695875d186e245d6b3df03bf6c40
+! leanprover-community/mathlib commit 6b31d1eebd64eab86d5bd9936bfaada6ca8b5842
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -14,6 +14,9 @@ import Mathbin.Analysis.SpecialFunctions.Trigonometric.ArctanDeriv
 /-!
 # Integration of specific interval integrals
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 This file contains proofs of the integrals of various specific functions. This includes:
 * Integrals of simple functions, such as `id`, `pow`, `inv`, `exp`, `log`
 * Integrals of some trigonometric functions, such as `sin`, `cos`, `1 / (1 + x^2)`
Diff
@@ -423,7 +423,6 @@ theorem integral_pow_abs_sub_uIoc : (∫ x in Ι a b, |x - a| ^ n) = |b - a| ^ (
         rw [uIcc_of_le (sub_nonneg.2 hab)] at hx 
         exact hx.1
       _ = |b - a| ^ (n + 1) / (n + 1) := by simp [abs_of_nonneg (sub_nonneg.2 hab)]
-      
   ·
     calc
       (∫ x in Ι a b, |x - a| ^ n) = ∫ x in b..a, |x - a| ^ n := by
@@ -436,7 +435,6 @@ theorem integral_pow_abs_sub_uIoc : (∫ x in Ι a b, |x - a| ^ n) = |b - a| ^ (
         exact hx.2
       _ = |b - a| ^ (n + 1) / (n + 1) := by
         simp [integral_comp_neg fun x => x ^ n, abs_of_neg (sub_neg.2 hab)]
-      
 #align integral_pow_abs_sub_uIoc integral_pow_abs_sub_uIoc
 
 @[simp]
@@ -661,7 +659,6 @@ theorem integral_sin_pow_aux :
     _ = (C + (n + 1) * ∫ x in a..b, sin x ^ n) - (n + 1) * ∫ x in a..b, sin x ^ (n + 2) := by
       rw [integral_sub, mul_sub, add_sub_assoc] <;> apply Continuous.intervalIntegrable <;>
         continuity
-    
   all_goals apply Continuous.intervalIntegrable; continuity
 #align integral_sin_pow_aux integral_sin_pow_aux
 
@@ -748,7 +745,6 @@ theorem integral_cos_pow_aux :
     _ = (C + (n + 1) * ∫ x in a..b, cos x ^ n) - (n + 1) * ∫ x in a..b, cos x ^ (n + 2) := by
       rw [integral_sub, mul_sub, add_sub_assoc] <;> apply Continuous.intervalIntegrable <;>
         continuity
-    
   all_goals apply Continuous.intervalIntegrable; continuity
 #align integral_cos_pow_aux integral_cos_pow_aux
 
@@ -782,7 +778,6 @@ theorem integral_sin_pow_mul_cos_pow_odd (m n : ℕ) :
       by simp only [pow_succ', ← mul_assoc, pow_mul, cos_sq']
     _ = ∫ u in sin a..sin b, u ^ m * (1 - u ^ 2) ^ n :=
       integral_comp_mul_deriv (fun x hx => hasDerivAt_sin x) continuousOn_cos hc
-    
 #align integral_sin_pow_mul_cos_pow_odd integral_sin_pow_mul_cos_pow_odd
 
 /-- The integral of `sin x * cos x`, given in terms of sin².
@@ -816,7 +811,6 @@ theorem integral_sin_pow_odd_mul_cos_pow (m n : ℕ) :
     _ = ∫ x in b..a, cos x ^ n * (1 - cos x ^ 2) ^ m * -sin x := by congr; ext; ring
     _ = ∫ u in cos b..cos a, u ^ n * (1 - u ^ 2) ^ m :=
       integral_comp_mul_deriv (fun x hx => hasDerivAt_cos x) continuousOn_sin.neg hc
-    
 #align integral_sin_pow_odd_mul_cos_pow integral_sin_pow_odd_mul_cos_pow
 
 /-- The integral of `sin x * cos x`, given in terms of cos².
Diff
@@ -51,10 +51,12 @@ variable {f : ℝ → ℝ} {μ ν : Measure ℝ} [IsLocallyFiniteMeasure μ] (c
 /-! ### Interval integrability -/
 
 
+#print intervalIntegral.intervalIntegrable_pow /-
 @[simp]
 theorem intervalIntegrable_pow : IntervalIntegrable (fun x => x ^ n) μ a b :=
   (continuous_pow n).IntervalIntegrable a b
 #align interval_integral.interval_integrable_pow intervalIntegral.intervalIntegrable_pow
+-/
 
 theorem intervalIntegrable_zpow {n : ℤ} (h : 0 ≤ n ∨ (0 : ℝ) ∉ [a, b]) :
     IntervalIntegrable (fun x => x ^ n) μ a b :=
@@ -190,15 +192,19 @@ theorem intervalIntegrable_cpow' {r : ℂ} (h : -1 < r.re) :
     simp
 #align interval_integral.interval_integrable_cpow' intervalIntegral.intervalIntegrable_cpow'
 
+#print intervalIntegral.intervalIntegrable_id /-
 @[simp]
 theorem intervalIntegrable_id : IntervalIntegrable (fun x => x) μ a b :=
   continuous_id.IntervalIntegrable a b
 #align interval_integral.interval_integrable_id intervalIntegral.intervalIntegrable_id
+-/
 
+#print intervalIntegral.intervalIntegrable_const /-
 @[simp]
 theorem intervalIntegrable_const : IntervalIntegrable (fun x => c) μ a b :=
   continuous_const.IntervalIntegrable a b
 #align interval_integral.interval_integrable_const intervalIntegral.intervalIntegrable_const
+-/
 
 theorem intervalIntegrable_one_div (h : ∀ x : ℝ, x ∈ [a, b] → f x ≠ 0)
     (hf : ContinuousOn f [a, b]) : IntervalIntegrable (fun x => 1 / f x) μ a b :=
@@ -211,10 +217,12 @@ theorem intervalIntegrable_inv (h : ∀ x : ℝ, x ∈ [a, b] → f x ≠ 0) (hf
   simpa only [one_div] using interval_integrable_one_div h hf
 #align interval_integral.interval_integrable_inv intervalIntegral.intervalIntegrable_inv
 
+#print intervalIntegral.intervalIntegrable_exp /-
 @[simp]
 theorem intervalIntegrable_exp : IntervalIntegrable exp μ a b :=
   continuous_exp.IntervalIntegrable a b
 #align interval_integral.interval_integrable_exp intervalIntegral.intervalIntegrable_exp
+-/
 
 @[simp]
 theorem IntervalIntegrable.log (hf : ContinuousOn f [a, b]) (h : ∀ x : ℝ, x ∈ [a, b] → f x ≠ 0) :
@@ -227,16 +235,21 @@ theorem intervalIntegrable_log (h : (0 : ℝ) ∉ [a, b]) : IntervalIntegrable l
   IntervalIntegrable.log continuousOn_id fun x hx => ne_of_mem_of_not_mem hx h
 #align interval_integral.interval_integrable_log intervalIntegral.intervalIntegrable_log
 
+#print intervalIntegral.intervalIntegrable_sin /-
 @[simp]
 theorem intervalIntegrable_sin : IntervalIntegrable sin μ a b :=
   continuous_sin.IntervalIntegrable a b
 #align interval_integral.interval_integrable_sin intervalIntegral.intervalIntegrable_sin
+-/
 
+#print intervalIntegral.intervalIntegrable_cos /-
 @[simp]
 theorem intervalIntegrable_cos : IntervalIntegrable cos μ a b :=
   continuous_cos.IntervalIntegrable a b
 #align interval_integral.interval_integrable_cos intervalIntegral.intervalIntegrable_cos
+-/
 
+#print intervalIntegral.intervalIntegrable_one_div_one_add_sq /-
 theorem intervalIntegrable_one_div_one_add_sq :
     IntervalIntegrable (fun x : ℝ => 1 / (1 + x ^ 2)) μ a b :=
   by
@@ -244,11 +257,14 @@ theorem intervalIntegrable_one_div_one_add_sq :
   · continuity
   · nlinarith
 #align interval_integral.interval_integrable_one_div_one_add_sq intervalIntegral.intervalIntegrable_one_div_one_add_sq
+-/
 
+#print intervalIntegral.intervalIntegrable_inv_one_add_sq /-
 @[simp]
 theorem intervalIntegrable_inv_one_add_sq : IntervalIntegrable (fun x : ℝ => (1 + x ^ 2)⁻¹) μ a b :=
   by simpa only [one_div] using interval_integrable_one_div_one_add_sq
 #align interval_integral.interval_integrable_inv_one_add_sq intervalIntegral.intervalIntegrable_inv_one_add_sq
+-/
 
 /-! ### Integrals of the form `c * ∫ x in a..b, f (c * x + d)` -/
 
@@ -432,8 +448,10 @@ theorem integral_one : (∫ x in a..b, (1 : ℝ)) = b - a := by
   simp only [mul_one, smul_eq_mul, integral_const]
 #align integral_one integral_one
 
+#print integral_const_on_unit_interval /-
 theorem integral_const_on_unit_interval : (∫ x in a..a + 1, b) = b := by simp
 #align integral_const_on_unit_interval integral_const_on_unit_interval
+-/
 
 @[simp]
 theorem integral_inv (h : (0 : ℝ) ∉ [a, b]) : (∫ x in a..b, x⁻¹) = log (b / a) :=
@@ -664,6 +682,7 @@ theorem integral_sin_sq : (∫ x in a..b, sin x ^ 2) = (sin a * cos a - sin b *
   by field_simp [integral_sin_pow, add_sub_assoc]
 #align integral_sin_sq integral_sin_sq
 
+#print integral_sin_pow_odd /-
 theorem integral_sin_pow_odd :
     (∫ x in 0 ..π, sin x ^ (2 * n + 1)) = 2 * ∏ i in range n, (2 * i + 2) / (2 * i + 3) :=
   by
@@ -672,7 +691,9 @@ theorem integral_sin_pow_odd :
   norm_cast
   simp [-cast_add, field_simps]
 #align integral_sin_pow_odd integral_sin_pow_odd
+-/
 
+#print integral_sin_pow_even /-
 theorem integral_sin_pow_even :
     (∫ x in 0 ..π, sin x ^ (2 * n)) = π * ∏ i in range n, (2 * i + 1) / (2 * i + 2) :=
   by
@@ -681,6 +702,7 @@ theorem integral_sin_pow_even :
   norm_cast
   simp [-cast_add, field_simps]
 #align integral_sin_pow_even integral_sin_pow_even
+-/
 
 theorem integral_sin_pow_pos : 0 < ∫ x in 0 ..π, sin x ^ n := by
   rcases even_or_odd' n with ⟨k, rfl | rfl⟩ <;>
@@ -696,9 +718,11 @@ theorem integral_sin_pow_succ_le : (∫ x in 0 ..π, sin x ^ (n + 1)) ≤ ∫ x
   refine' integral_mono_on pi_pos.le _ _ H <;> exact (continuous_sin.pow _).IntervalIntegrable 0 π
 #align integral_sin_pow_succ_le integral_sin_pow_succ_le
 
+#print integral_sin_pow_antitone /-
 theorem integral_sin_pow_antitone : Antitone fun n : ℕ => ∫ x in 0 ..π, sin x ^ n :=
   antitone_nat_of_succ_le integral_sin_pow_succ_le
 #align integral_sin_pow_antitone integral_sin_pow_antitone
+-/
 
 /-! ### Integral of `cos x ^ n` -/
 
Diff
@@ -608,7 +608,7 @@ theorem integral_mul_rpow_one_add_sq {t : ℝ} (ht : t ≠ -1) :
     exact add_nonneg zero_le_one (sq_nonneg x)
   rw [← of_real_inj]
   convert integral_mul_cpow_one_add_sq (_ : (t : ℂ) ≠ -1)
-  · rw [← intervalIntegral.integral_of_real]
+  · rw [← intervalIntegral.integral_ofReal]
     congr with x : 1
     rw [of_real_mul, this x t]
   · simp_rw [of_real_sub, of_real_div, this a (t + 1), this b (t + 1)]
Diff
@@ -46,7 +46,7 @@ namespace intervalIntegral
 
 open MeasureTheory
 
-variable {f : ℝ → ℝ} {μ ν : Measure ℝ} [LocallyFiniteMeasure μ] (c d : ℝ)
+variable {f : ℝ → ℝ} {μ ν : Measure ℝ} [IsLocallyFiniteMeasure μ] (c d : ℝ)
 
 /-! ### Interval integrability -/
 
@@ -82,7 +82,7 @@ theorem intervalIntegrable_rpow' {r : ℝ} (h : -1 < r) :
     rw [intervalIntegrable_iff, uIoc_of_le hc]
     have hderiv : ∀ x ∈ Ioo 0 c, HasDerivAt (fun x : ℝ => x ^ (r + 1) / (r + 1)) (x ^ r) x :=
       by
-      intro x hx; convert(Real.hasDerivAt_rpow_const (Or.inl hx.1.ne')).div_const (r + 1)
+      intro x hx; convert (Real.hasDerivAt_rpow_const (Or.inl hx.1.ne')).div_const (r + 1)
       field_simp [(by linarith : r + 1 ≠ 0)]; ring
     apply integrable_on_deriv_of_nonneg _ hderiv
     · intro x hx; apply rpow_nonneg_of_nonneg hx.1.le
@@ -367,7 +367,7 @@ theorem integral_rpow {r : ℝ} (h : -1 < r ∨ r ≠ -1 ∧ (0 : ℝ) ∉ [a, b
   have :
     (∫ x in a..b, (x : ℂ) ^ (r : ℂ)) = ((b : ℂ) ^ (r + 1 : ℂ) - (a : ℂ) ^ (r + 1 : ℂ)) / (r + 1) :=
     integral_cpow h'
-  apply_fun Complex.re  at this ; convert this
+  apply_fun Complex.re at this ; convert this
   · simp_rw [interval_integral_eq_integral_uIoc, Complex.real_smul, Complex.ofReal_mul_re]
     · change Complex.re with IsROrC.re
       rw [← integral_re]; rfl
@@ -468,7 +468,7 @@ theorem integral_one_div_of_neg (ha : a < 0) (hb : b < 0) :
 
 @[simp]
 theorem integral_exp : (∫ x in a..b, exp x) = exp b - exp a := by
-  rw [integral_deriv_eq_sub'] <;> norm_num [continuous_on_exp]
+  rw [integral_deriv_eq_sub'] <;> norm_num [continuousOn_exp]
 #align integral_exp integral_exp
 
 theorem integral_exp_mul_complex {c : ℂ} (hc : c ≠ 0) :
@@ -481,7 +481,7 @@ theorem integral_exp_mul_complex {c : ℂ} (hc : c ≠ 0) :
       congr
       skip
       rw [← mul_div_cancel (Complex.exp (c * x)) hc]
-    convert((Complex.hasDerivAt_exp _).comp x _).div_const c using 1
+    convert ((Complex.hasDerivAt_exp _).comp x _).div_const c using 1
     simpa only [mul_one] using ((hasDerivAt_id (x : ℂ)).const_mul _).comp_of_real
   rw [integral_deriv_eq_sub' _ (funext fun x => (D x).deriv) fun x hx => (D x).DifferentiableAt]
   · ring_nf
@@ -493,7 +493,8 @@ theorem integral_log (h : (0 : ℝ) ∉ [a, b]) :
     (∫ x in a..b, log x) = b * log b - a * log a - b + a :=
   by
   obtain ⟨h', heq⟩ := fun x hx => ne_of_mem_of_not_mem hx h, fun x hx => mul_inv_cancel (h' x hx)
-  convert integral_mul_deriv_eq_deriv_mul (fun x hx => has_deriv_at_log (h' x hx))
+  convert
+      integral_mul_deriv_eq_deriv_mul (fun x hx => has_deriv_at_log (h' x hx))
         (fun x hx => hasDerivAt_id x)
         (continuous_on_inv₀.mono <| subset_compl_singleton_iff.mpr h).IntervalIntegrable
         continuous_on_const.interval_integrable using
@@ -573,16 +574,16 @@ theorem integral_mul_cpow_one_add_sq {t : ℂ} (ht : t ≠ -1) :
   apply integral_eq_sub_of_has_deriv_at
   · intro x hx
     have f : HasDerivAt (fun y : ℂ => 1 + y ^ 2) (2 * x) x := by
-      convert(hasDerivAt_pow 2 (x : ℂ)).const_add 1; · norm_cast; · simp
+      convert (hasDerivAt_pow 2 (x : ℂ)).const_add 1; · norm_cast; · simp
     have g :
       ∀ {z : ℂ}, 0 < z.re → HasDerivAt (fun z => z ^ (t + 1) / (2 * (t + 1))) (z ^ t / 2) z :=
       by
       intro z hz
       have : z ≠ 0 := by contrapose! hz; rw [hz, zero_re]
-      convert(HasDerivAt.cpow_const (hasDerivAt_id _) (Or.inl hz)).div_const (2 * (t + 1)) using 1
+      convert (HasDerivAt.cpow_const (hasDerivAt_id _) (Or.inl hz)).div_const (2 * (t + 1)) using 1
       field_simp
       ring
-    convert(HasDerivAt.comp (↑x) (g _) f).comp_of_real using 1
+    convert (HasDerivAt.comp (↑x) (g _) f).comp_of_real using 1
     · field_simp; ring
     · rw [add_re, one_re, ← of_real_pow, of_real_re]
       exact add_pos_of_pos_of_nonneg zero_lt_one (sq_nonneg x)
Diff
@@ -83,7 +83,7 @@ theorem intervalIntegrable_rpow' {r : ℝ} (h : -1 < r) :
     have hderiv : ∀ x ∈ Ioo 0 c, HasDerivAt (fun x : ℝ => x ^ (r + 1) / (r + 1)) (x ^ r) x :=
       by
       intro x hx; convert(Real.hasDerivAt_rpow_const (Or.inl hx.1.ne')).div_const (r + 1)
-      field_simp [(by linarith : r + 1 ≠ 0)] ; ring
+      field_simp [(by linarith : r + 1 ≠ 0)]; ring
     apply integrable_on_deriv_of_nonneg _ hderiv
     · intro x hx; apply rpow_nonneg_of_nonneg hx.1.le
     · refine' (continuous_on_id.rpow_const _).div_const _; intro x hx; right; linarith
@@ -91,9 +91,9 @@ theorem intervalIntegrable_rpow' {r : ℝ} (h : -1 < r) :
   · exact this c hc
   · rw [IntervalIntegrable.iff_comp_neg, neg_zero]
     have m := (this (-c) (by linarith)).smul (cos (r * π))
-    rw [intervalIntegrable_iff] at m⊢
+    rw [intervalIntegrable_iff] at m ⊢
     refine' m.congr_fun _ measurableSet_Ioc; intro x hx
-    rw [uIoc_of_le (by linarith : 0 ≤ -c)] at hx
+    rw [uIoc_of_le (by linarith : 0 ≤ -c)] at hx 
     simp only [Pi.smul_apply, Algebra.id.smul_eq_mul, log_neg_eq_log, mul_comm,
       rpow_def_of_pos hx.1, rpow_def_of_neg (by linarith [hx.1] : -x < 0)]
 #align interval_integral.interval_integrable_rpow' intervalIntegral.intervalIntegrable_rpow'
@@ -107,7 +107,7 @@ theorem intervalIntegrable_cpow {r : ℂ} (h : 0 ≤ r.re ∨ (0 : ℝ) ∉ [a,
   · -- Easy case #1: 0 ∉ [a, b] -- use continuity.
     refine' (ContinuousAt.continuousOn fun x hx => _).IntervalIntegrable
     exact Complex.continuousAt_of_real_cpow_const _ _ (Or.inr <| ne_of_mem_of_not_mem hx h2)
-  rw [eq_false h2, or_false_iff] at h
+  rw [eq_false h2, or_false_iff] at h 
   rcases lt_or_eq_of_le h with (h' | h')
   ·-- Easy case #2: 0 < re r -- again use continuity
     exact (Complex.continuous_of_real_cpow_const h').IntervalIntegrable _ _
@@ -123,7 +123,7 @@ theorem intervalIntegrable_cpow {r : ℂ} (h : 0 ≤ r.re ∨ (0 : ℝ) ∉ [a,
   rcases le_or_lt 0 c with (hc | hc)
   · -- case `0 ≤ c`: integrand is identically 1
     have : IntervalIntegrable (fun x => 1 : ℝ → ℝ) μ 0 c := intervalIntegrable_const
-    rw [intervalIntegrable_iff_integrable_Ioc_of_le hc] at this⊢
+    rw [intervalIntegrable_iff_integrable_Ioc_of_le hc] at this ⊢
     refine' integrable_on.congr_fun this (fun x hx => _) measurableSet_Ioc
     dsimp only
     rw [Complex.norm_eq_abs, Complex.abs_cpow_eq_rpow_re_of_pos hx.1, ← h', rpow_zero]
@@ -168,13 +168,13 @@ theorem intervalIntegrable_cpow' {r : ℂ} (h : -1 < r.re) :
       apply integrable_on.congr_fun
       · rw [← intervalIntegrable_iff]; exact intervalIntegral.intervalIntegrable_rpow' h
       · intro x hx
-        rw [uIoc_of_le hc] at hx
+        rw [uIoc_of_le hc] at hx 
         dsimp only
         rw [Complex.norm_eq_abs, Complex.abs_cpow_eq_rpow_re_of_pos hx.1]
       · exact measurableSet_uIoc
     · refine' ContinuousOn.aestronglyMeasurable _ measurableSet_uIoc
       refine' ContinuousAt.continuousOn fun x hx => _
-      rw [uIoc_of_le hc] at hx
+      rw [uIoc_of_le hc] at hx 
       refine' (continuousAt_cpow_const (Or.inl _)).comp complex.continuous_of_real.continuous_at
       rw [Complex.ofReal_re]
       exact hx.1
@@ -182,7 +182,7 @@ theorem intervalIntegrable_cpow' {r : ℂ} (h : -1 < r.re) :
   · exact this c hc
   · rw [IntervalIntegrable.iff_comp_neg, neg_zero]
     have m := (this (-c) (by linarith)).const_mul (Complex.exp (π * Complex.I * r))
-    rw [intervalIntegrable_iff, uIoc_of_le (by linarith : 0 ≤ -c)] at m⊢
+    rw [intervalIntegrable_iff, uIoc_of_le (by linarith : 0 ≤ -c)] at m ⊢
     refine' m.congr_fun (fun x hx => _) measurableSet_Ioc
     dsimp only
     have : -x ≤ 0 := by linarith [hx.1]
@@ -332,7 +332,7 @@ theorem integral_cpow {r : ℂ} (h : -1 < r.re ∨ r ≠ -1 ∧ (0 : ℝ) ∉ [a
     · apply_fun Complex.re
       rw [Complex.add_re, Complex.one_re, Complex.zero_re, Ne.def, add_eq_zero_iff_eq_neg]
       exact h.ne'
-    · rw [Ne.def, ← add_eq_zero_iff_eq_neg] at h; exact h.1
+    · rw [Ne.def, ← add_eq_zero_iff_eq_neg] at h ; exact h.1
   by_cases hab : (0 : ℝ) ∉ [a, b]
   · refine' integral_eq_sub_of_has_deriv_at (fun x hx => _) (interval_integrable_cpow <| Or.inr hab)
     refine' hasDerivAt_of_real_cpow (ne_of_mem_of_not_mem hx hab) _
@@ -351,7 +351,7 @@ theorem integral_cpow {r : ℂ} (h : -1 < r.re ∨ r ≠ -1 ∧ (0 : ℝ) ∉ [a
     rwa [Complex.add_re, Complex.one_re, ← neg_lt_iff_pos_add]
   · refine' fun x hx => (hasDerivAt_of_real_cpow _ _).HasDerivWithinAt
     · rcases le_total c 0 with (hc | hc)
-      · rw [max_eq_left hc] at hx; exact hx.2.Ne; · rw [min_eq_left hc] at hx; exact hx.1.ne'
+      · rw [max_eq_left hc] at hx ; exact hx.2.Ne; · rw [min_eq_left hc] at hx ; exact hx.1.ne'
     · contrapose! hr; rw [hr]; ring
   · exact interval_integrable_cpow' h
 #align integral_cpow integral_cpow
@@ -367,7 +367,7 @@ theorem integral_rpow {r : ℝ} (h : -1 < r ∨ r ≠ -1 ∧ (0 : ℝ) ∉ [a, b
   have :
     (∫ x in a..b, (x : ℂ) ^ (r : ℂ)) = ((b : ℂ) ^ (r + 1 : ℂ) - (a : ℂ) ^ (r + 1 : ℂ)) / (r + 1) :=
     integral_cpow h'
-  apply_fun Complex.re  at this; convert this
+  apply_fun Complex.re  at this ; convert this
   · simp_rw [interval_integral_eq_integral_uIoc, Complex.real_smul, Complex.ofReal_mul_re]
     · change Complex.re with IsROrC.re
       rw [← integral_re]; rfl
@@ -404,7 +404,7 @@ theorem integral_pow_abs_sub_uIoc : (∫ x in Ι a b, |x - a| ^ n) = |b - a| ^ (
         by
         simp only [integral_comp_sub_right fun x => |x| ^ n, sub_self]
         refine' integral_congr fun x hx => congr_arg₂ Pow.pow (abs_of_nonneg <| _) rfl
-        rw [uIcc_of_le (sub_nonneg.2 hab)] at hx
+        rw [uIcc_of_le (sub_nonneg.2 hab)] at hx 
         exact hx.1
       _ = |b - a| ^ (n + 1) / (n + 1) := by simp [abs_of_nonneg (sub_nonneg.2 hab)]
       
@@ -416,7 +416,7 @@ theorem integral_pow_abs_sub_uIoc : (∫ x in Ι a b, |x - a| ^ n) = |b - a| ^ (
         by
         simp only [integral_comp_sub_right fun x => |x| ^ n, sub_self]
         refine' integral_congr fun x hx => congr_arg₂ Pow.pow (abs_of_nonpos <| _) rfl
-        rw [uIcc_of_le (sub_nonpos.2 hab.le)] at hx
+        rw [uIcc_of_le (sub_nonpos.2 hab.le)] at hx 
         exact hx.2
       _ = |b - a| ^ (n + 1) / (n + 1) := by
         simp [integral_comp_neg fun x => x ^ n, abs_of_neg (sub_neg.2 hab)]
@@ -569,7 +569,7 @@ theorem integral_mul_cpow_one_add_sq {t : ℂ} (ht : t ≠ -1) :
     (∫ x : ℝ in a..b, (x : ℂ) * (1 + x ^ 2) ^ t) =
       (1 + b ^ 2) ^ (t + 1) / (2 * (t + 1)) - (1 + a ^ 2) ^ (t + 1) / (2 * (t + 1)) :=
   by
-  have : t + 1 ≠ 0 := by contrapose! ht; rwa [add_eq_zero_iff_eq_neg] at ht
+  have : t + 1 ≠ 0 := by contrapose! ht; rwa [add_eq_zero_iff_eq_neg] at ht 
   apply integral_eq_sub_of_has_deriv_at
   · intro x hx
     have f : HasDerivAt (fun y : ℂ => 1 + y ^ 2) (2 * x) x := by
@@ -684,7 +684,7 @@ theorem integral_sin_pow_even :
 theorem integral_sin_pow_pos : 0 < ∫ x in 0 ..π, sin x ^ n := by
   rcases even_or_odd' n with ⟨k, rfl | rfl⟩ <;>
           simp only [integral_sin_pow_even, integral_sin_pow_odd] <;>
-        refine' mul_pos (by norm_num [pi_pos] ) (prod_pos fun n hn => div_pos _ _) <;>
+        refine' mul_pos (by norm_num [pi_pos]) (prod_pos fun n hn => div_pos _ _) <;>
       norm_cast <;>
     linarith
 #align integral_sin_pow_pos integral_sin_pow_pos
@@ -788,7 +788,7 @@ theorem integral_sin_pow_odd_mul_cos_pow (m n : ℕ) :
       by rw [integral_symm]
     _ = ∫ x in b..a, (1 - cos x ^ 2) ^ m * -sin x * cos x ^ n := by
       simp [pow_succ', pow_mul, sin_sq]
-    _ = ∫ x in b..a, cos x ^ n * (1 - cos x ^ 2) ^ m * -sin x := by congr ; ext; ring
+    _ = ∫ x in b..a, cos x ^ n * (1 - cos x ^ 2) ^ m * -sin x := by congr; ext; ring
     _ = ∫ u in cos b..cos a, u ^ n * (1 - u ^ 2) ^ m :=
       integral_comp_mul_deriv (fun x hx => hasDerivAt_cos x) continuousOn_sin.neg hc
     
@@ -825,7 +825,7 @@ theorem integral_sin_sq_mul_cos_sq :
   convert integral_sin_pow_even_mul_cos_pow_even 1 1 using 1
   have h1 : ∀ c : ℝ, (1 - c) / 2 * ((1 + c) / 2) = (1 - c ^ 2) / 4 := fun c => by ring
   have h2 : Continuous fun x => cos (2 * x) ^ 2 := by continuity
-  have h3 : ∀ x, cos x * sin x = sin (2 * x) / 2 := by intro ; rw [sin_two_mul]; ring
+  have h3 : ∀ x, cos x * sin x = sin (2 * x) / 2 := by intro; rw [sin_two_mul]; ring
   have h4 : ∀ d : ℝ, 2 * (2 * d) = 4 * d := fun d => by ring
   simp [h1, h2.interval_integrable, integral_comp_mul_left fun x => cos x ^ 2, h3, h4]
   ring
Diff
@@ -172,7 +172,7 @@ theorem intervalIntegrable_cpow' {r : ℂ} (h : -1 < r.re) :
         dsimp only
         rw [Complex.norm_eq_abs, Complex.abs_cpow_eq_rpow_re_of_pos hx.1]
       · exact measurableSet_uIoc
-    · refine' ContinuousOn.aEStronglyMeasurable _ measurableSet_uIoc
+    · refine' ContinuousOn.aestronglyMeasurable _ measurableSet_uIoc
       refine' ContinuousAt.continuousOn fun x hx => _
       rw [uIoc_of_le hc] at hx
       refine' (continuousAt_cpow_const (Or.inl _)).comp complex.continuous_of_real.continuous_at
Diff
@@ -38,7 +38,7 @@ integrate, integration, integrable, integrability
 
 open Real Nat Set Finset
 
-open Real BigOperators Interval
+open scoped Real BigOperators Interval
 
 variable {a b : ℝ} (n : ℕ)
 
Diff
@@ -82,25 +82,17 @@ theorem intervalIntegrable_rpow' {r : ℝ} (h : -1 < r) :
     rw [intervalIntegrable_iff, uIoc_of_le hc]
     have hderiv : ∀ x ∈ Ioo 0 c, HasDerivAt (fun x : ℝ => x ^ (r + 1) / (r + 1)) (x ^ r) x :=
       by
-      intro x hx
-      convert(Real.hasDerivAt_rpow_const (Or.inl hx.1.ne')).div_const (r + 1)
-      field_simp [(by linarith : r + 1 ≠ 0)]
-      ring
+      intro x hx; convert(Real.hasDerivAt_rpow_const (Or.inl hx.1.ne')).div_const (r + 1)
+      field_simp [(by linarith : r + 1 ≠ 0)] ; ring
     apply integrable_on_deriv_of_nonneg _ hderiv
-    · intro x hx
-      apply rpow_nonneg_of_nonneg hx.1.le
-    · refine' (continuous_on_id.rpow_const _).div_const _
-      intro x hx
-      right
-      linarith
-  intro c
-  rcases le_total 0 c with (hc | hc)
+    · intro x hx; apply rpow_nonneg_of_nonneg hx.1.le
+    · refine' (continuous_on_id.rpow_const _).div_const _; intro x hx; right; linarith
+  intro c; rcases le_total 0 c with (hc | hc)
   · exact this c hc
   · rw [IntervalIntegrable.iff_comp_neg, neg_zero]
     have m := (this (-c) (by linarith)).smul (cos (r * π))
     rw [intervalIntegrable_iff] at m⊢
-    refine' m.congr_fun _ measurableSet_Ioc
-    intro x hx
+    refine' m.congr_fun _ measurableSet_Ioc; intro x hx
     rw [uIoc_of_le (by linarith : 0 ≤ -c)] at hx
     simp only [Pi.smul_apply, Algebra.id.smul_eq_mul, log_neg_eq_log, mul_comm,
       rpow_def_of_pos hx.1, rpow_def_of_neg (by linarith [hx.1] : -x < 0)]
@@ -142,8 +134,7 @@ theorem intervalIntegrable_cpow {r : ℂ} (h : 0 ≤ r.re ∨ (0 : ℝ) ∉ [a,
       by
       rw [← Ioo_union_Icc_eq_Ioc hc (le_refl 0), ← Icc_def]
       simp_rw [← le_antisymm_iff, set_of_eq_eq_singleton']
-    rw [this, integrable_on_union, and_comm]
-    constructor
+    rw [this, integrable_on_union, and_comm]; constructor
     · refine' integrable_on_singleton_iff.mpr (Or.inr _)
       exact
         is_finite_measure_on_compacts_of_is_locally_finite_measure.lt_top_of_is_compact
@@ -175,8 +166,7 @@ theorem intervalIntegrable_cpow' {r : ℂ} (h : -1 < r.re) :
     rw [← IntervalIntegrable.intervalIntegrable_norm_iff]
     · rw [intervalIntegrable_iff]
       apply integrable_on.congr_fun
-      · rw [← intervalIntegrable_iff]
-        exact intervalIntegral.intervalIntegrable_rpow' h
+      · rw [← intervalIntegrable_iff]; exact intervalIntegral.intervalIntegrable_rpow' h
       · intro x hx
         rw [uIoc_of_le hc] at hx
         dsimp only
@@ -188,8 +178,7 @@ theorem intervalIntegrable_cpow' {r : ℂ} (h : -1 < r.re) :
       refine' (continuousAt_cpow_const (Or.inl _)).comp complex.continuous_of_real.continuous_at
       rw [Complex.ofReal_re]
       exact hx.1
-  intro c
-  rcases le_total 0 c with (hc | hc)
+  intro c; rcases le_total 0 c with (hc | hc)
   · exact this c hc
   · rw [IntervalIntegrable.iff_comp_neg, neg_zero]
     have m := (this (-c) (by linarith)).const_mul (Complex.exp (π * Complex.I * r))
@@ -343,15 +332,12 @@ theorem integral_cpow {r : ℂ} (h : -1 < r.re ∨ r ≠ -1 ∧ (0 : ℝ) ∉ [a
     · apply_fun Complex.re
       rw [Complex.add_re, Complex.one_re, Complex.zero_re, Ne.def, add_eq_zero_iff_eq_neg]
       exact h.ne'
-    · rw [Ne.def, ← add_eq_zero_iff_eq_neg] at h
-      exact h.1
+    · rw [Ne.def, ← add_eq_zero_iff_eq_neg] at h; exact h.1
   by_cases hab : (0 : ℝ) ∉ [a, b]
   · refine' integral_eq_sub_of_has_deriv_at (fun x hx => _) (interval_integrable_cpow <| Or.inr hab)
     refine' hasDerivAt_of_real_cpow (ne_of_mem_of_not_mem hx hab) _
-    contrapose! hr
-    rwa [add_eq_zero_iff_eq_neg]
-  replace h : -1 < r.re
-  · tauto
+    contrapose! hr; rwa [add_eq_zero_iff_eq_neg]
+  replace h : -1 < r.re; · tauto
   suffices ∀ c : ℝ, (∫ x : ℝ in 0 ..c, (x : ℂ) ^ r) = c ^ (r + 1) / (r + 1) - 0 ^ (r + 1) / (r + 1)
     by
     rw [←
@@ -365,13 +351,8 @@ theorem integral_cpow {r : ℂ} (h : -1 < r.re ∨ r ≠ -1 ∧ (0 : ℝ) ∉ [a
     rwa [Complex.add_re, Complex.one_re, ← neg_lt_iff_pos_add]
   · refine' fun x hx => (hasDerivAt_of_real_cpow _ _).HasDerivWithinAt
     · rcases le_total c 0 with (hc | hc)
-      · rw [max_eq_left hc] at hx
-        exact hx.2.Ne
-      · rw [min_eq_left hc] at hx
-        exact hx.1.ne'
-    · contrapose! hr
-      rw [hr]
-      ring
+      · rw [max_eq_left hc] at hx; exact hx.2.Ne; · rw [min_eq_left hc] at hx; exact hx.1.ne'
+    · contrapose! hr; rw [hr]; ring
   · exact interval_integrable_cpow' h
 #align integral_cpow integral_cpow
 
@@ -381,23 +362,18 @@ theorem integral_rpow {r : ℝ} (h : -1 < r ∨ r ≠ -1 ∧ (0 : ℝ) ∉ [a, b
   have h' : -1 < (r : ℂ).re ∨ (r : ℂ) ≠ -1 ∧ (0 : ℝ) ∉ [a, b] :=
     by
     cases h
-    · left
-      rwa [Complex.ofReal_re]
-    · right
-      rwa [← Complex.ofReal_one, ← Complex.ofReal_neg, Ne.def, Complex.ofReal_inj]
+    · left; rwa [Complex.ofReal_re]
+    · right; rwa [← Complex.ofReal_one, ← Complex.ofReal_neg, Ne.def, Complex.ofReal_inj]
   have :
     (∫ x in a..b, (x : ℂ) ^ (r : ℂ)) = ((b : ℂ) ^ (r + 1 : ℂ) - (a : ℂ) ^ (r + 1 : ℂ)) / (r + 1) :=
     integral_cpow h'
-  apply_fun Complex.re  at this
-  convert this
+  apply_fun Complex.re  at this; convert this
   · simp_rw [interval_integral_eq_integral_uIoc, Complex.real_smul, Complex.ofReal_mul_re]
     · change Complex.re with IsROrC.re
-      rw [← integral_re]
-      rfl
+      rw [← integral_re]; rfl
       refine' interval_integrable_iff.mp _
       cases h'
-      · exact interval_integrable_cpow' h'
-      · exact interval_integrable_cpow (Or.inr h'.2)
+      · exact interval_integrable_cpow' h'; · exact interval_integrable_cpow (Or.inr h'.2)
   · rw [(by push_cast : (r : ℂ) + 1 = ((r + 1 : ℝ) : ℂ))]
     simp_rw [div_eq_inv_mul, ← Complex.ofReal_inv, Complex.ofReal_mul_re, Complex.sub_re]
     rfl
@@ -509,8 +485,7 @@ theorem integral_exp_mul_complex {c : ℂ} (hc : c ≠ 0) :
     simpa only [mul_one] using ((hasDerivAt_id (x : ℂ)).const_mul _).comp_of_real
   rw [integral_deriv_eq_sub' _ (funext fun x => (D x).deriv) fun x hx => (D x).DifferentiableAt]
   · ring_nf
-  · apply Continuous.continuousOn
-    continuity
+  · apply Continuous.continuousOn; continuity
 #align integral_exp_mul_complex integral_exp_mul_complex
 
 @[simp]
@@ -594,29 +569,21 @@ theorem integral_mul_cpow_one_add_sq {t : ℂ} (ht : t ≠ -1) :
     (∫ x : ℝ in a..b, (x : ℂ) * (1 + x ^ 2) ^ t) =
       (1 + b ^ 2) ^ (t + 1) / (2 * (t + 1)) - (1 + a ^ 2) ^ (t + 1) / (2 * (t + 1)) :=
   by
-  have : t + 1 ≠ 0 := by
-    contrapose! ht
-    rwa [add_eq_zero_iff_eq_neg] at ht
+  have : t + 1 ≠ 0 := by contrapose! ht; rwa [add_eq_zero_iff_eq_neg] at ht
   apply integral_eq_sub_of_has_deriv_at
   · intro x hx
-    have f : HasDerivAt (fun y : ℂ => 1 + y ^ 2) (2 * x) x :=
-      by
-      convert(hasDerivAt_pow 2 (x : ℂ)).const_add 1
-      · norm_cast
-      · simp
+    have f : HasDerivAt (fun y : ℂ => 1 + y ^ 2) (2 * x) x := by
+      convert(hasDerivAt_pow 2 (x : ℂ)).const_add 1; · norm_cast; · simp
     have g :
       ∀ {z : ℂ}, 0 < z.re → HasDerivAt (fun z => z ^ (t + 1) / (2 * (t + 1))) (z ^ t / 2) z :=
       by
       intro z hz
-      have : z ≠ 0 := by
-        contrapose! hz
-        rw [hz, zero_re]
+      have : z ≠ 0 := by contrapose! hz; rw [hz, zero_re]
       convert(HasDerivAt.cpow_const (hasDerivAt_id _) (Or.inl hz)).div_const (2 * (t + 1)) using 1
       field_simp
       ring
     convert(HasDerivAt.comp (↑x) (g _) f).comp_of_real using 1
-    · field_simp
-      ring
+    · field_simp; ring
     · rw [add_re, one_re, ← of_real_pow, of_real_re]
       exact add_pos_of_pos_of_nonneg zero_lt_one (sq_nonneg x)
   · apply Continuous.intervalIntegrable
@@ -821,11 +788,7 @@ theorem integral_sin_pow_odd_mul_cos_pow (m n : ℕ) :
       by rw [integral_symm]
     _ = ∫ x in b..a, (1 - cos x ^ 2) ^ m * -sin x * cos x ^ n := by
       simp [pow_succ', pow_mul, sin_sq]
-    _ = ∫ x in b..a, cos x ^ n * (1 - cos x ^ 2) ^ m * -sin x :=
-      by
-      congr
-      ext
-      ring
+    _ = ∫ x in b..a, cos x ^ n * (1 - cos x ^ 2) ^ m * -sin x := by congr ; ext; ring
     _ = ∫ u in cos b..cos a, u ^ n * (1 - u ^ 2) ^ m :=
       integral_comp_mul_deriv (fun x hx => hasDerivAt_cos x) continuousOn_sin.neg hc
     
@@ -862,11 +825,7 @@ theorem integral_sin_sq_mul_cos_sq :
   convert integral_sin_pow_even_mul_cos_pow_even 1 1 using 1
   have h1 : ∀ c : ℝ, (1 - c) / 2 * ((1 + c) / 2) = (1 - c ^ 2) / 4 := fun c => by ring
   have h2 : Continuous fun x => cos (2 * x) ^ 2 := by continuity
-  have h3 : ∀ x, cos x * sin x = sin (2 * x) / 2 :=
-    by
-    intro
-    rw [sin_two_mul]
-    ring
+  have h3 : ∀ x, cos x * sin x = sin (2 * x) / 2 := by intro ; rw [sin_two_mul]; ring
   have h4 : ∀ d : ℝ, 2 * (2 * d) = 4 * d := fun d => by ring
   simp [h1, h2.interval_integrable, integral_comp_mul_left fun x => cos x ^ 2, h3, h4]
   ring
Diff
@@ -121,7 +121,7 @@ theorem intervalIntegrable_cpow {r : ℂ} (h : 0 ≤ r.re ∨ (0 : ℝ) ∉ [a,
     exact (Complex.continuous_of_real_cpow_const h').IntervalIntegrable _ _
   -- Now the hard case: re r = 0 and 0 is in the interval.
   refine' (IntervalIntegrable.intervalIntegrable_norm_iff _).mp _
-  · refine' (measurable_of_continuousOn_compl_singleton (0 : ℝ) _).AeStronglyMeasurable
+  · refine' (measurable_of_continuousOn_compl_singleton (0 : ℝ) _).AEStronglyMeasurable
     exact
       ContinuousAt.continuousOn fun x hx => Complex.continuousAt_of_real_cpow_const x r (Or.inr hx)
   -- reduce to case of integral over `[0, c]`
@@ -182,7 +182,7 @@ theorem intervalIntegrable_cpow' {r : ℂ} (h : -1 < r.re) :
         dsimp only
         rw [Complex.norm_eq_abs, Complex.abs_cpow_eq_rpow_re_of_pos hx.1]
       · exact measurableSet_uIoc
-    · refine' ContinuousOn.aeStronglyMeasurable _ measurableSet_uIoc
+    · refine' ContinuousOn.aEStronglyMeasurable _ measurableSet_uIoc
       refine' ContinuousAt.continuousOn fun x hx => _
       rw [uIoc_of_le hc] at hx
       refine' (continuousAt_cpow_const (Or.inl _)).comp complex.continuous_of_real.continuous_at
Diff
@@ -554,7 +554,7 @@ theorem integral_cos_mul_complex {z : ℂ} (hz : z ≠ 0) (a b : ℝ) :
   apply integral_eq_sub_of_has_deriv_at
   swap
   · apply Continuous.intervalIntegrable
-    exact complex.continuous_cos.comp (continuous_const.mul Complex.continuous_of_real)
+    exact complex.continuous_cos.comp (continuous_const.mul Complex.continuous_ofReal)
   intro x hx
   have a := Complex.hasDerivAt_sin (↑x * z)
   have b : HasDerivAt (fun y => y * z : ℂ → ℂ) z ↑x := hasDerivAt_mul_const _
Diff
@@ -46,7 +46,7 @@ namespace intervalIntegral
 
 open MeasureTheory
 
-variable {f : ℝ → ℝ} {μ ν : Measure ℝ} [IsLocallyFiniteMeasure μ] (c d : ℝ)
+variable {f : ℝ → ℝ} {μ ν : Measure ℝ} [LocallyFiniteMeasure μ] (c d : ℝ)
 
 /-! ### Interval integrability -/
 
Diff
@@ -52,26 +52,26 @@ variable {f : ℝ → ℝ} {μ ν : Measure ℝ} [IsLocallyFiniteMeasure μ] (c
 
 
 @[simp]
-theorem intervalIntegrablePow : IntervalIntegrable (fun x => x ^ n) μ a b :=
+theorem intervalIntegrable_pow : IntervalIntegrable (fun x => x ^ n) μ a b :=
   (continuous_pow n).IntervalIntegrable a b
-#align interval_integral.interval_integrable_pow intervalIntegral.intervalIntegrablePow
+#align interval_integral.interval_integrable_pow intervalIntegral.intervalIntegrable_pow
 
-theorem intervalIntegrableZpow {n : ℤ} (h : 0 ≤ n ∨ (0 : ℝ) ∉ [a, b]) :
+theorem intervalIntegrable_zpow {n : ℤ} (h : 0 ≤ n ∨ (0 : ℝ) ∉ [a, b]) :
     IntervalIntegrable (fun x => x ^ n) μ a b :=
   (continuousOn_id.zpow₀ n fun x hx => h.symm.imp (ne_of_mem_of_not_mem hx) id).IntervalIntegrable
-#align interval_integral.interval_integrable_zpow intervalIntegral.intervalIntegrableZpow
+#align interval_integral.interval_integrable_zpow intervalIntegral.intervalIntegrable_zpow
 
 /-- See `interval_integrable_rpow'` for a version with a weaker hypothesis on `r`, but assuming the
 measure is volume. -/
-theorem intervalIntegrableRpow {r : ℝ} (h : 0 ≤ r ∨ (0 : ℝ) ∉ [a, b]) :
+theorem intervalIntegrable_rpow {r : ℝ} (h : 0 ≤ r ∨ (0 : ℝ) ∉ [a, b]) :
     IntervalIntegrable (fun x => x ^ r) μ a b :=
   (continuousOn_id.rpow_const fun x hx =>
       h.symm.imp (ne_of_mem_of_not_mem hx) id).IntervalIntegrable
-#align interval_integral.interval_integrable_rpow intervalIntegral.intervalIntegrableRpow
+#align interval_integral.interval_integrable_rpow intervalIntegral.intervalIntegrable_rpow
 
 /-- See `interval_integrable_rpow` for a version applying to any locally finite measure, but with a
 stronger hypothesis on `r`. -/
-theorem intervalIntegrableRpow' {r : ℝ} (h : -1 < r) :
+theorem intervalIntegrable_rpow' {r : ℝ} (h : -1 < r) :
     IntervalIntegrable (fun x => x ^ r) volume a b :=
   by
   suffices ∀ c : ℝ, IntervalIntegrable (fun x => x ^ r) volume 0 c by
@@ -104,11 +104,11 @@ theorem intervalIntegrableRpow' {r : ℝ} (h : -1 < r) :
     rw [uIoc_of_le (by linarith : 0 ≤ -c)] at hx
     simp only [Pi.smul_apply, Algebra.id.smul_eq_mul, log_neg_eq_log, mul_comm,
       rpow_def_of_pos hx.1, rpow_def_of_neg (by linarith [hx.1] : -x < 0)]
-#align interval_integral.interval_integrable_rpow' intervalIntegral.intervalIntegrableRpow'
+#align interval_integral.interval_integrable_rpow' intervalIntegral.intervalIntegrable_rpow'
 
 /-- See `interval_integrable_cpow'` for a version with a weaker hypothesis on `r`, but assuming the
 measure is volume. -/
-theorem intervalIntegrableCpow {r : ℂ} (h : 0 ≤ r.re ∨ (0 : ℝ) ∉ [a, b]) :
+theorem intervalIntegrable_cpow {r : ℂ} (h : 0 ≤ r.re ∨ (0 : ℝ) ∉ [a, b]) :
     IntervalIntegrable (fun x : ℝ => (x : ℂ) ^ r) μ a b :=
   by
   by_cases h2 : (0 : ℝ) ∉ [a, b]
@@ -130,7 +130,7 @@ theorem intervalIntegrableCpow {r : ℂ} (h : 0 ≤ r.re ∨ (0 : ℝ) ∉ [a, b
   intro c
   rcases le_or_lt 0 c with (hc | hc)
   · -- case `0 ≤ c`: integrand is identically 1
-    have : IntervalIntegrable (fun x => 1 : ℝ → ℝ) μ 0 c := intervalIntegrableConst
+    have : IntervalIntegrable (fun x => 1 : ℝ → ℝ) μ 0 c := intervalIntegrable_const
     rw [intervalIntegrable_iff_integrable_Ioc_of_le hc] at this⊢
     refine' integrable_on.congr_fun this (fun x hx => _) measurableSet_Ioc
     dsimp only
@@ -160,11 +160,11 @@ theorem intervalIntegrableCpow {r : ℂ} (h : 0 ≤ r.re ∨ (0 : ℝ) ∉ [a, b
       exact
         is_finite_measure_on_compacts_of_is_locally_finite_measure.lt_top_of_is_compact
           is_compact_Icc
-#align interval_integral.interval_integrable_cpow intervalIntegral.intervalIntegrableCpow
+#align interval_integral.interval_integrable_cpow intervalIntegral.intervalIntegrable_cpow
 
 /-- See `interval_integrable_cpow` for a version applying to any locally finite measure, but with a
 stronger hypothesis on `r`. -/
-theorem intervalIntegrableCpow' {r : ℂ} (h : -1 < r.re) :
+theorem intervalIntegrable_cpow' {r : ℂ} (h : -1 < r.re) :
     IntervalIntegrable (fun x : ℝ => (x : ℂ) ^ r) volume a b :=
   by
   suffices ∀ c : ℝ, IntervalIntegrable (fun x => (x : ℂ) ^ r) volume 0 c by
@@ -176,7 +176,7 @@ theorem intervalIntegrableCpow' {r : ℂ} (h : -1 < r.re) :
     · rw [intervalIntegrable_iff]
       apply integrable_on.congr_fun
       · rw [← intervalIntegrable_iff]
-        exact intervalIntegral.intervalIntegrableRpow' h
+        exact intervalIntegral.intervalIntegrable_rpow' h
       · intro x hx
         rw [uIoc_of_le hc] at hx
         dsimp only
@@ -199,33 +199,33 @@ theorem intervalIntegrableCpow' {r : ℂ} (h : -1 < r.re) :
     have : -x ≤ 0 := by linarith [hx.1]
     rw [Complex.of_real_cpow_of_nonpos this, mul_comm]
     simp
-#align interval_integral.interval_integrable_cpow' intervalIntegral.intervalIntegrableCpow'
+#align interval_integral.interval_integrable_cpow' intervalIntegral.intervalIntegrable_cpow'
 
 @[simp]
-theorem intervalIntegrableId : IntervalIntegrable (fun x => x) μ a b :=
+theorem intervalIntegrable_id : IntervalIntegrable (fun x => x) μ a b :=
   continuous_id.IntervalIntegrable a b
-#align interval_integral.interval_integrable_id intervalIntegral.intervalIntegrableId
+#align interval_integral.interval_integrable_id intervalIntegral.intervalIntegrable_id
 
 @[simp]
-theorem intervalIntegrableConst : IntervalIntegrable (fun x => c) μ a b :=
+theorem intervalIntegrable_const : IntervalIntegrable (fun x => c) μ a b :=
   continuous_const.IntervalIntegrable a b
-#align interval_integral.interval_integrable_const intervalIntegral.intervalIntegrableConst
+#align interval_integral.interval_integrable_const intervalIntegral.intervalIntegrable_const
 
-theorem intervalIntegrableOneDiv (h : ∀ x : ℝ, x ∈ [a, b] → f x ≠ 0) (hf : ContinuousOn f [a, b]) :
-    IntervalIntegrable (fun x => 1 / f x) μ a b :=
+theorem intervalIntegrable_one_div (h : ∀ x : ℝ, x ∈ [a, b] → f x ≠ 0)
+    (hf : ContinuousOn f [a, b]) : IntervalIntegrable (fun x => 1 / f x) μ a b :=
   (continuousOn_const.div hf h).IntervalIntegrable
-#align interval_integral.interval_integrable_one_div intervalIntegral.intervalIntegrableOneDiv
+#align interval_integral.interval_integrable_one_div intervalIntegral.intervalIntegrable_one_div
 
 @[simp]
-theorem intervalIntegrableInv (h : ∀ x : ℝ, x ∈ [a, b] → f x ≠ 0) (hf : ContinuousOn f [a, b]) :
+theorem intervalIntegrable_inv (h : ∀ x : ℝ, x ∈ [a, b] → f x ≠ 0) (hf : ContinuousOn f [a, b]) :
     IntervalIntegrable (fun x => (f x)⁻¹) μ a b := by
   simpa only [one_div] using interval_integrable_one_div h hf
-#align interval_integral.interval_integrable_inv intervalIntegral.intervalIntegrableInv
+#align interval_integral.interval_integrable_inv intervalIntegral.intervalIntegrable_inv
 
 @[simp]
-theorem intervalIntegrableExp : IntervalIntegrable exp μ a b :=
+theorem intervalIntegrable_exp : IntervalIntegrable exp μ a b :=
   continuous_exp.IntervalIntegrable a b
-#align interval_integral.interval_integrable_exp intervalIntegral.intervalIntegrableExp
+#align interval_integral.interval_integrable_exp intervalIntegral.intervalIntegrable_exp
 
 @[simp]
 theorem IntervalIntegrable.log (hf : ContinuousOn f [a, b]) (h : ∀ x : ℝ, x ∈ [a, b] → f x ≠ 0) :
@@ -234,32 +234,32 @@ theorem IntervalIntegrable.log (hf : ContinuousOn f [a, b]) (h : ∀ x : ℝ, x
 #align interval_integrable.log IntervalIntegrable.log
 
 @[simp]
-theorem intervalIntegrableLog (h : (0 : ℝ) ∉ [a, b]) : IntervalIntegrable log μ a b :=
+theorem intervalIntegrable_log (h : (0 : ℝ) ∉ [a, b]) : IntervalIntegrable log μ a b :=
   IntervalIntegrable.log continuousOn_id fun x hx => ne_of_mem_of_not_mem hx h
-#align interval_integral.interval_integrable_log intervalIntegral.intervalIntegrableLog
+#align interval_integral.interval_integrable_log intervalIntegral.intervalIntegrable_log
 
 @[simp]
-theorem intervalIntegrableSin : IntervalIntegrable sin μ a b :=
+theorem intervalIntegrable_sin : IntervalIntegrable sin μ a b :=
   continuous_sin.IntervalIntegrable a b
-#align interval_integral.interval_integrable_sin intervalIntegral.intervalIntegrableSin
+#align interval_integral.interval_integrable_sin intervalIntegral.intervalIntegrable_sin
 
 @[simp]
-theorem intervalIntegrableCos : IntervalIntegrable cos μ a b :=
+theorem intervalIntegrable_cos : IntervalIntegrable cos μ a b :=
   continuous_cos.IntervalIntegrable a b
-#align interval_integral.interval_integrable_cos intervalIntegral.intervalIntegrableCos
+#align interval_integral.interval_integrable_cos intervalIntegral.intervalIntegrable_cos
 
-theorem intervalIntegrableOneDivOneAddSq :
+theorem intervalIntegrable_one_div_one_add_sq :
     IntervalIntegrable (fun x : ℝ => 1 / (1 + x ^ 2)) μ a b :=
   by
   refine' (continuous_const.div _ fun x => _).IntervalIntegrable a b
   · continuity
   · nlinarith
-#align interval_integral.interval_integrable_one_div_one_add_sq intervalIntegral.intervalIntegrableOneDivOneAddSq
+#align interval_integral.interval_integrable_one_div_one_add_sq intervalIntegral.intervalIntegrable_one_div_one_add_sq
 
 @[simp]
-theorem intervalIntegrableInvOneAddSq : IntervalIntegrable (fun x : ℝ => (1 + x ^ 2)⁻¹) μ a b := by
-  simpa only [one_div] using interval_integrable_one_div_one_add_sq
-#align interval_integral.interval_integrable_inv_one_add_sq intervalIntegral.intervalIntegrableInvOneAddSq
+theorem intervalIntegrable_inv_one_add_sq : IntervalIntegrable (fun x : ℝ => (1 + x ^ 2)⁻¹) μ a b :=
+  by simpa only [one_div] using interval_integrable_one_div_one_add_sq
+#align interval_integral.interval_integrable_inv_one_add_sq intervalIntegral.intervalIntegrable_inv_one_add_sq
 
 /-! ### Integrals of the form `c * ∫ x in a..b, f (c * x + d)` -/
 
Diff
@@ -4,11 +4,11 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Benjamin Davidson
 
 ! This file was ported from Lean 3 source module analysis.special_functions.integrals
-! leanprover-community/mathlib commit d4817f8867c368d6c5571f7379b3888aaec1d95a
+! leanprover-community/mathlib commit 011cafb4a5bc695875d186e245d6b3df03bf6c40
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
-import Mathbin.MeasureTheory.Integral.IntervalIntegral
+import Mathbin.MeasureTheory.Integral.FundThmCalculus
 import Mathbin.Analysis.SpecialFunctions.Trigonometric.ArctanDeriv
 
 /-!
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Benjamin Davidson
 
 ! This file was ported from Lean 3 source module analysis.special_functions.integrals
-! leanprover-community/mathlib commit 8c8c544bf24ced19b1e76c34bb3262bdae620f82
+! leanprover-community/mathlib commit d4817f8867c368d6c5571f7379b3888aaec1d95a
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -86,7 +86,7 @@ theorem intervalIntegrableRpow' {r : ℝ} (h : -1 < r) :
       convert(Real.hasDerivAt_rpow_const (Or.inl hx.1.ne')).div_const (r + 1)
       field_simp [(by linarith : r + 1 ≠ 0)]
       ring
-    apply integrable_on_deriv_of_nonneg hc _ hderiv
+    apply integrable_on_deriv_of_nonneg _ hderiv
     · intro x hx
       apply rpow_nonneg_of_nonneg hx.1.le
     · refine' (continuous_on_id.rpow_const _).div_const _
Diff
@@ -83,7 +83,7 @@ theorem intervalIntegrableRpow' {r : ℝ} (h : -1 < r) :
     have hderiv : ∀ x ∈ Ioo 0 c, HasDerivAt (fun x : ℝ => x ^ (r + 1) / (r + 1)) (x ^ r) x :=
       by
       intro x hx
-      convert (Real.hasDerivAt_rpow_const (Or.inl hx.1.ne')).div_const (r + 1)
+      convert(Real.hasDerivAt_rpow_const (Or.inl hx.1.ne')).div_const (r + 1)
       field_simp [(by linarith : r + 1 ≠ 0)]
       ring
     apply integrable_on_deriv_of_nonneg hc _ hderiv
@@ -505,7 +505,7 @@ theorem integral_exp_mul_complex {c : ℂ} (hc : c ≠ 0) :
       congr
       skip
       rw [← mul_div_cancel (Complex.exp (c * x)) hc]
-    convert ((Complex.hasDerivAt_exp _).comp x _).div_const c using 1
+    convert((Complex.hasDerivAt_exp _).comp x _).div_const c using 1
     simpa only [mul_one] using ((hasDerivAt_id (x : ℂ)).const_mul _).comp_of_real
   rw [integral_deriv_eq_sub' _ (funext fun x => (D x).deriv) fun x hx => (D x).DifferentiableAt]
   · ring_nf
@@ -518,8 +518,7 @@ theorem integral_log (h : (0 : ℝ) ∉ [a, b]) :
     (∫ x in a..b, log x) = b * log b - a * log a - b + a :=
   by
   obtain ⟨h', heq⟩ := fun x hx => ne_of_mem_of_not_mem hx h, fun x hx => mul_inv_cancel (h' x hx)
-  convert
-      integral_mul_deriv_eq_deriv_mul (fun x hx => has_deriv_at_log (h' x hx))
+  convert integral_mul_deriv_eq_deriv_mul (fun x hx => has_deriv_at_log (h' x hx))
         (fun x hx => hasDerivAt_id x)
         (continuous_on_inv₀.mono <| subset_compl_singleton_iff.mpr h).IntervalIntegrable
         continuous_on_const.interval_integrable using
@@ -602,7 +601,7 @@ theorem integral_mul_cpow_one_add_sq {t : ℂ} (ht : t ≠ -1) :
   · intro x hx
     have f : HasDerivAt (fun y : ℂ => 1 + y ^ 2) (2 * x) x :=
       by
-      convert (hasDerivAt_pow 2 (x : ℂ)).const_add 1
+      convert(hasDerivAt_pow 2 (x : ℂ)).const_add 1
       · norm_cast
       · simp
     have g :
@@ -612,10 +611,10 @@ theorem integral_mul_cpow_one_add_sq {t : ℂ} (ht : t ≠ -1) :
       have : z ≠ 0 := by
         contrapose! hz
         rw [hz, zero_re]
-      convert (HasDerivAt.cpow_const (hasDerivAt_id _) (Or.inl hz)).div_const (2 * (t + 1)) using 1
+      convert(HasDerivAt.cpow_const (hasDerivAt_id _) (Or.inl hz)).div_const (2 * (t + 1)) using 1
       field_simp
       ring
-    convert (HasDerivAt.comp (↑x) (g _) f).comp_of_real using 1
+    convert(HasDerivAt.comp (↑x) (g _) f).comp_of_real using 1
     · field_simp
       ring
     · rw [add_re, one_re, ← of_real_pow, of_real_re]
Diff
@@ -148,10 +148,10 @@ theorem intervalIntegrableCpow {r : ℂ} (h : 0 ≤ r.re ∨ (0 : ℝ) ∉ [a, b
       exact
         is_finite_measure_on_compacts_of_is_locally_finite_measure.lt_top_of_is_compact
           isCompact_singleton
-    · have : ∀ x : ℝ, x ∈ Ioo c 0 → ‖Complex.exp (↑π * Complex.i * r)‖ = ‖(x : ℂ) ^ r‖ :=
+    · have : ∀ x : ℝ, x ∈ Ioo c 0 → ‖Complex.exp (↑π * Complex.I * r)‖ = ‖(x : ℂ) ^ r‖ :=
         by
         intro x hx
-        rw [Complex.of_real_cpow_of_nonpos hx.2.le, norm_mul, ← Complex.of_real_neg,
+        rw [Complex.of_real_cpow_of_nonpos hx.2.le, norm_mul, ← Complex.ofReal_neg,
           Complex.norm_eq_abs (_ ^ _), Complex.abs_cpow_eq_rpow_re_of_pos (neg_pos.mpr hx.2), ← h',
           rpow_zero, one_mul]
       refine' integrable_on.congr_fun _ this measurableSet_Ioo
@@ -186,13 +186,13 @@ theorem intervalIntegrableCpow' {r : ℂ} (h : -1 < r.re) :
       refine' ContinuousAt.continuousOn fun x hx => _
       rw [uIoc_of_le hc] at hx
       refine' (continuousAt_cpow_const (Or.inl _)).comp complex.continuous_of_real.continuous_at
-      rw [Complex.of_real_re]
+      rw [Complex.ofReal_re]
       exact hx.1
   intro c
   rcases le_total 0 c with (hc | hc)
   · exact this c hc
   · rw [IntervalIntegrable.iff_comp_neg, neg_zero]
-    have m := (this (-c) (by linarith)).const_mul (Complex.exp (π * Complex.i * r))
+    have m := (this (-c) (by linarith)).const_mul (Complex.exp (π * Complex.I * r))
     rw [intervalIntegrable_iff, uIoc_of_le (by linarith : 0 ≤ -c)] at m⊢
     refine' m.congr_fun (fun x hx => _) measurableSet_Ioc
     dsimp only
@@ -382,15 +382,15 @@ theorem integral_rpow {r : ℝ} (h : -1 < r ∨ r ≠ -1 ∧ (0 : ℝ) ∉ [a, b
     by
     cases h
     · left
-      rwa [Complex.of_real_re]
+      rwa [Complex.ofReal_re]
     · right
-      rwa [← Complex.of_real_one, ← Complex.of_real_neg, Ne.def, Complex.of_real_inj]
+      rwa [← Complex.ofReal_one, ← Complex.ofReal_neg, Ne.def, Complex.ofReal_inj]
   have :
     (∫ x in a..b, (x : ℂ) ^ (r : ℂ)) = ((b : ℂ) ^ (r + 1 : ℂ) - (a : ℂ) ^ (r + 1 : ℂ)) / (r + 1) :=
     integral_cpow h'
   apply_fun Complex.re  at this
   convert this
-  · simp_rw [interval_integral_eq_integral_uIoc, Complex.real_smul, Complex.of_real_mul_re]
+  · simp_rw [interval_integral_eq_integral_uIoc, Complex.real_smul, Complex.ofReal_mul_re]
     · change Complex.re with IsROrC.re
       rw [← integral_re]
       rfl
@@ -399,7 +399,7 @@ theorem integral_rpow {r : ℝ} (h : -1 < r ∨ r ≠ -1 ∧ (0 : ℝ) ∉ [a, b
       · exact interval_integrable_cpow' h'
       · exact interval_integrable_cpow (Or.inr h'.2)
   · rw [(by push_cast : (r : ℂ) + 1 = ((r + 1 : ℝ) : ℂ))]
-    simp_rw [div_eq_inv_mul, ← Complex.of_real_inv, Complex.of_real_mul_re, Complex.sub_re]
+    simp_rw [div_eq_inv_mul, ← Complex.ofReal_inv, Complex.ofReal_mul_re, Complex.sub_re]
     rfl
 #align integral_rpow integral_rpow
 

Changes in mathlib4

mathlib3
mathlib4
chore: adapt to multiple goal linter 2 (#12361)

A PR analogous to #12338: reformatting proofs following the multiple goals linter of #12339.

Diff
@@ -390,7 +390,8 @@ theorem integral_rpow {r : ℝ} (h : -1 < r ∨ r ≠ -1 ∧ (0 : ℝ) ∉ [[a,
   · simp_rw [intervalIntegral_eq_integral_uIoc, Complex.real_smul, Complex.re_ofReal_mul]
     · -- Porting note: was `change ... with ...`
       have : Complex.re = RCLike.re := rfl
-      rw [this, ← integral_re]; rfl
+      rw [this, ← integral_re]
+      · rfl
       refine' intervalIntegrable_iff.mp _
       cases' h' with h' h'
       · exact intervalIntegrable_cpow' h'
@@ -652,13 +653,13 @@ theorem integral_sin_pow_aux :
   have hv : ∀ x ∈ [[a, b]], HasDerivAt (-cos) (sin x) x := fun x _ => by
     simpa only [neg_neg] using (hasDerivAt_cos x).neg
   have H := integral_mul_deriv_eq_deriv_mul hu hv ?_ ?_
-  calc
-    (∫ x in a..b, sin x ^ (n + 2)) = ∫ x in a..b, sin x ^ (n + 1) * sin x := by
-      simp only [_root_.pow_succ]
-    _ = C + (↑n + 1) * ∫ x in a..b, cos x ^ 2 * sin x ^ n := by simp [H, h, sq]; ring
-    _ = C + (↑n + 1) * ∫ x in a..b, sin x ^ n - sin x ^ (n + 2) := by
-      simp [cos_sq', sub_mul, ← pow_add, add_comm]
-    _ = (C + (↑n + 1) * ∫ x in a..b, sin x ^ n) - (↑n + 1) * ∫ x in a..b, sin x ^ (n + 2) := by
+  · calc
+      (∫ x in a..b, sin x ^ (n + 2)) = ∫ x in a..b, sin x ^ (n + 1) * sin x := by
+        simp only [_root_.pow_succ]
+      _ = C + (↑n + 1) * ∫ x in a..b, cos x ^ 2 * sin x ^ n := by simp [H, h, sq]; ring
+      _ = C + (↑n + 1) * ∫ x in a..b, sin x ^ n - sin x ^ (n + 2) := by
+        simp [cos_sq', sub_mul, ← pow_add, add_comm]
+      _ = (C + (↑n + 1) * ∫ x in a..b, sin x ^ n) - (↑n + 1) * ∫ x in a..b, sin x ^ (n + 2) := by
         rw [integral_sub, mul_sub, add_sub_assoc] <;>
           apply Continuous.intervalIntegrable <;> continuity
   all_goals apply Continuous.intervalIntegrable; continuity
@@ -731,15 +732,15 @@ theorem integral_cos_pow_aux :
       simpa only [mul_right_comm, neg_mul, mul_neg] using (hasDerivAt_cos x).pow (n + 1)
   have hv : ∀ x ∈ [[a, b]], HasDerivAt sin (cos x) x := fun x _ => hasDerivAt_sin x
   have H := integral_mul_deriv_eq_deriv_mul hu hv ?_ ?_
-  calc
-    (∫ x in a..b, cos x ^ (n + 2)) = ∫ x in a..b, cos x ^ (n + 1) * cos x := by
-      simp only [_root_.pow_succ]
-    _ = C + (n + 1) * ∫ x in a..b, sin x ^ 2 * cos x ^ n := by simp [H, h, sq, -neg_add_rev]
-    _ = C + (n + 1) * ∫ x in a..b, cos x ^ n - cos x ^ (n + 2) := by
-      simp [sin_sq, sub_mul, ← pow_add, add_comm]
-    _ = (C + (n + 1) * ∫ x in a..b, cos x ^ n) - (n + 1) * ∫ x in a..b, cos x ^ (n + 2) := by
-      rw [integral_sub, mul_sub, add_sub_assoc] <;>
-        apply Continuous.intervalIntegrable <;> continuity
+  · calc
+      (∫ x in a..b, cos x ^ (n + 2)) = ∫ x in a..b, cos x ^ (n + 1) * cos x := by
+        simp only [_root_.pow_succ]
+      _ = C + (n + 1) * ∫ x in a..b, sin x ^ 2 * cos x ^ n := by simp [H, h, sq, -neg_add_rev]
+      _ = C + (n + 1) * ∫ x in a..b, cos x ^ n - cos x ^ (n + 2) := by
+        simp [sin_sq, sub_mul, ← pow_add, add_comm]
+      _ = (C + (n + 1) * ∫ x in a..b, cos x ^ n) - (n + 1) * ∫ x in a..b, cos x ^ (n + 2) := by
+        rw [integral_sub, mul_sub, add_sub_assoc] <;>
+          apply Continuous.intervalIntegrable <;> continuity
   all_goals apply Continuous.intervalIntegrable; continuity
 #align integral_cos_pow_aux integral_cos_pow_aux
 
feat: Axiomatise b ≠ 0 → a * b / b = a (#12424)

This lets us unify a few lemmas between GroupWithZero and EuclideanDomain and two lemmas that were previously proved separately for Nat, Int, Polynomial.

Diff
@@ -80,7 +80,7 @@ theorem intervalIntegrable_rpow' {r : ℝ} (h : -1 < r) :
     have hderiv : ∀ x ∈ Ioo 0 c, HasDerivAt (fun x : ℝ => x ^ (r + 1) / (r + 1)) (x ^ r) x := by
       intro x hx
       convert (Real.hasDerivAt_rpow_const (p := r + 1) (Or.inl hx.1.ne')).div_const (r + 1) using 1
-      field_simp [(by linarith : r + 1 ≠ 0)]; ring
+      field_simp [(by linarith : r + 1 ≠ 0)]
     apply integrableOn_deriv_of_nonneg _ hderiv
     · intro x hx; apply rpow_nonneg hx.1.le
     · refine' (continuousOn_id.rpow_const _).div_const _; intro x _; right; linarith
chore: remove 4 porting notes about continuity (#12358)
Diff
@@ -659,15 +659,9 @@ theorem integral_sin_pow_aux :
     _ = C + (↑n + 1) * ∫ x in a..b, sin x ^ n - sin x ^ (n + 2) := by
       simp [cos_sq', sub_mul, ← pow_add, add_comm]
     _ = (C + (↑n + 1) * ∫ x in a..b, sin x ^ n) - (↑n + 1) * ∫ x in a..b, sin x ^ (n + 2) := by
-      rw [integral_sub, mul_sub, add_sub_assoc] <;> apply Continuous.intervalIntegrable
-      -- Porting note: was `... <;> continuity`
-      · exact continuous_sin_pow n
-      · exact continuous_sin_pow (n + 2)
-  all_goals apply Continuous.intervalIntegrable
-  -- Porting note: was `... <;> continuity`
-  · have : Continuous fun x ↦ ↑(n + 1) * cos x := by continuity
-    exact this.mul (continuous_sin_pow n)
-  · exact continuous_sin
+        rw [integral_sub, mul_sub, add_sub_assoc] <;>
+          apply Continuous.intervalIntegrable <;> continuity
+  all_goals apply Continuous.intervalIntegrable; continuity
 #align integral_sin_pow_aux integral_sin_pow_aux
 
 /-- The reduction formula for the integral of `sin x ^ n` for any natural `n ≥ 2`. -/
@@ -772,8 +766,7 @@ theorem integral_cos_sq : ∫ x in a..b, cos x ^ 2 = (cos b * sin b - cos a * si
 /-- Simplification of the integral of `sin x ^ m * cos x ^ n`, case `n` is odd. -/
 theorem integral_sin_pow_mul_cos_pow_odd (m n : ℕ) :
     (∫ x in a..b, sin x ^ m * cos x ^ (2 * n + 1)) = ∫ u in sin a..sin b, u^m * (↑1 - u ^ 2) ^ n :=
-  have hc : Continuous fun u : ℝ => u ^ m * (↑1 - u ^ 2) ^ n := -- Porting note: was `by continuity`
-    (continuous_pow m).mul ((continuous_const.sub (continuous_pow 2)).pow n)
+  have hc : Continuous fun u : ℝ => u ^ m * (↑1 - u ^ 2) ^ n := by continuity
   calc
     (∫ x in a..b, sin x ^ m * cos x ^ (2 * n + 1)) =
         ∫ x in a..b, sin x ^ m * (↑1 - sin x ^ 2) ^ n * cos x := by
@@ -809,8 +802,7 @@ theorem integral_cos_pow_three :
 /-- Simplification of the integral of `sin x ^ m * cos x ^ n`, case `m` is odd. -/
 theorem integral_sin_pow_odd_mul_cos_pow (m n : ℕ) :
     (∫ x in a..b, sin x ^ (2 * m + 1) * cos x ^ n) = ∫ u in cos b..cos a, u^n * (↑1 - u ^ 2) ^ m :=
-  have hc : Continuous fun u : ℝ => u ^ n * (↑1 - u ^ 2) ^ m := -- Porting note: was `by continuity`
-    (continuous_pow n).mul ((continuous_const.sub (continuous_pow 2)).pow m)
+  have hc : Continuous fun u : ℝ => u ^ n * (↑1 - u ^ 2) ^ m := by continuity
   calc
     (∫ x in a..b, sin x ^ (2 * m + 1) * cos x ^ n) =
         -∫ x in b..a, sin x ^ (2 * m + 1) * cos x ^ n :=
feat: add notation for Real.sqrt (#12056)

This adds the notation √r for Real.sqrt r. The precedence is such that √x⁻¹ is parsed as √(x⁻¹); not because this is particularly desirable, but because it's the default and the choice doesn't really matter.

This is extracted from #7907, which adds a more general nth root typeclass. The idea is to perform all the boring substitutions downstream quickly, so that we can play around with custom elaborators with a much slower rate of code-rot. This PR also won't rot as quickly, as it does not forbid writing x.sqrt as that PR does.

While perhaps claiming for Real.sqrt is greedy; it:

  • Is far more common thatn NNReal.sqrt and Nat.sqrt
  • Is far more interesting to mathlib than sqrt on Float
  • Can be overloaded anyway, so this does not prevent downstream code using the notation on their own types.
  • Will be replaced by a more general typeclass in a future PR.

Zulip

Co-authored-by: Yury G. Kudryashov <urkud@urkud.name>

Diff
@@ -873,10 +873,10 @@ theorem integral_sin_sq_mul_cos_sq :
 /-! ### Integral of misc. functions -/
 
 
-theorem integral_sqrt_one_sub_sq : ∫ x in (-1 : ℝ)..1, sqrt (1 - x ^ 2 : ℝ) = π / 2 :=
+theorem integral_sqrt_one_sub_sq : ∫ x in (-1 : ℝ)..1, √(1 - x ^ 2 : ℝ) = π / 2 :=
   calc
-    _ = ∫ x in sin (-(π / 2)).. sin (π / 2), sqrt (1 - x ^ 2 : ℝ) := by rw [sin_neg, sin_pi_div_two]
-    _ = ∫ x in (-(π / 2))..(π / 2), sqrt (1 - sin x ^ 2 : ℝ) * cos x :=
+    _ = ∫ x in sin (-(π / 2)).. sin (π / 2), √(1 - x ^ 2 : ℝ) := by rw [sin_neg, sin_pi_div_two]
+    _ = ∫ x in (-(π / 2))..(π / 2), √(1 - sin x ^ 2 : ℝ) * cos x :=
           (integral_comp_mul_deriv (fun x _ => hasDerivAt_sin x) continuousOn_cos
             (by continuity)).symm
     _ = ∫ x in (-(π / 2))..(π / 2), cos x ^ 2 := by
chore(Data/Int): Rename coe_nat to natCast (#11637)

Reduce the diff of #11499

Renames

All in the Int namespace:

  • ofNat_eq_castofNat_eq_natCast
  • cast_eq_cast_iff_NatnatCast_inj
  • natCast_eq_ofNatofNat_eq_natCast
  • coe_nat_subnatCast_sub
  • coe_nat_nonnegnatCast_nonneg
  • sign_coe_add_onesign_natCast_add_one
  • nat_succ_eq_int_succnatCast_succ
  • succ_neg_nat_succsucc_neg_natCast_succ
  • coe_pred_of_posnatCast_pred_of_pos
  • coe_nat_divnatCast_div
  • coe_nat_edivnatCast_ediv
  • sign_coe_nat_of_nonzerosign_natCast_of_ne_zero
  • toNat_coe_nattoNat_natCast
  • toNat_coe_nat_add_onetoNat_natCast_add_one
  • coe_nat_dvdnatCast_dvd_natCast
  • coe_nat_dvd_leftnatCast_dvd
  • coe_nat_dvd_rightdvd_natCast
  • le_coe_nat_suble_natCast_sub
  • succ_coe_nat_possucc_natCast_pos
  • coe_nat_modEq_iffnatCast_modEq_iff
  • coe_natAbsnatCast_natAbs
  • coe_nat_eq_zeronatCast_eq_zero
  • coe_nat_ne_zeronatCast_ne_zero
  • coe_nat_ne_zero_iff_posnatCast_ne_zero_iff_pos
  • abs_coe_natabs_natCast
  • coe_nat_nonpos_iffnatCast_nonpos_iff

Also rename Nat.coe_nat_dvd to Nat.cast_dvd_cast

Diff
@@ -408,7 +408,7 @@ theorem integral_zpow {n : ℤ} (h : 0 ≤ n ∨ n ≠ -1 ∧ (0 : ℝ) ∉ [[a,
 
 @[simp]
 theorem integral_pow : ∫ x in a..b, x ^ n = (b ^ (n + 1) - a ^ (n + 1)) / (n + 1) := by
-  simpa only [← Int.ofNat_succ, zpow_natCast] using integral_zpow (Or.inl (Int.coe_nat_nonneg n))
+  simpa only [← Int.ofNat_succ, zpow_natCast] using integral_zpow (Or.inl n.cast_nonneg)
 #align integral_pow integral_pow
 
 /-- Integral of `|x - a| ^ n` over `Ι a b`. This integral appears in the proof of the
chore: avoid Ne.def (adaptation for nightly-2024-03-27) (#11801)
Diff
@@ -351,9 +351,9 @@ theorem integral_cpow {r : ℂ} (h : -1 < r.re ∨ r ≠ -1 ∧ (0 : ℝ) ∉ [[
   have hr : r + 1 ≠ 0 := by
     cases' h with h h
     · apply_fun Complex.re
-      rw [Complex.add_re, Complex.one_re, Complex.zero_re, Ne.def, add_eq_zero_iff_eq_neg]
+      rw [Complex.add_re, Complex.one_re, Complex.zero_re, Ne, add_eq_zero_iff_eq_neg]
       exact h.ne'
-    · rw [Ne.def, ← add_eq_zero_iff_eq_neg] at h; exact h.1
+    · rw [Ne, ← add_eq_zero_iff_eq_neg] at h; exact h.1
   by_cases hab : (0 : ℝ) ∉ [[a, b]]
   · apply integral_eq_sub_of_hasDerivAt (fun x hx => ?_)
       (intervalIntegrable_cpow (r := r) <| Or.inr hab)
@@ -382,7 +382,7 @@ theorem integral_rpow {r : ℝ} (h : -1 < r ∨ r ≠ -1 ∧ (0 : ℝ) ∉ [[a,
   have h' : -1 < (r : ℂ).re ∨ (r : ℂ) ≠ -1 ∧ (0 : ℝ) ∉ [[a, b]] := by
     cases h
     · left; rwa [Complex.ofReal_re]
-    · right; rwa [← Complex.ofReal_one, ← Complex.ofReal_neg, Ne.def, Complex.ofReal_inj]
+    · right; rwa [← Complex.ofReal_one, ← Complex.ofReal_neg, Ne, Complex.ofReal_inj]
   have :
     (∫ x in a..b, (x : ℂ) ^ (r : ℂ)) = ((b : ℂ) ^ (r + 1 : ℂ) - (a : ℂ) ^ (r + 1 : ℂ)) / (r + 1) :=
     integral_cpow h'
@@ -629,7 +629,7 @@ theorem integral_mul_rpow_one_add_sq {t : ℝ} (ht : t ≠ -1) :
     rw [ofReal_mul, this x t]
   · simp_rw [ofReal_sub, ofReal_div, this a (t + 1), this b (t + 1)]
     push_cast; rfl
-  · rw [← ofReal_one, ← ofReal_neg, Ne.def, ofReal_inj]
+  · rw [← ofReal_one, ← ofReal_neg, Ne, ofReal_inj]
     exact ht
 #align integral_mul_rpow_one_add_sq integral_mul_rpow_one_add_sq
 
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
@@ -654,7 +654,7 @@ theorem integral_sin_pow_aux :
   have H := integral_mul_deriv_eq_deriv_mul hu hv ?_ ?_
   calc
     (∫ x in a..b, sin x ^ (n + 2)) = ∫ x in a..b, sin x ^ (n + 1) * sin x := by
-      simp only [_root_.pow_succ']
+      simp only [_root_.pow_succ]
     _ = C + (↑n + 1) * ∫ x in a..b, cos x ^ 2 * sin x ^ n := by simp [H, h, sq]; ring
     _ = C + (↑n + 1) * ∫ x in a..b, sin x ^ n - sin x ^ (n + 2) := by
       simp [cos_sq', sub_mul, ← pow_add, add_comm]
@@ -739,15 +739,13 @@ theorem integral_cos_pow_aux :
   have H := integral_mul_deriv_eq_deriv_mul hu hv ?_ ?_
   calc
     (∫ x in a..b, cos x ^ (n + 2)) = ∫ x in a..b, cos x ^ (n + 1) * cos x := by
-      simp only [_root_.pow_succ']
+      simp only [_root_.pow_succ]
     _ = C + (n + 1) * ∫ x in a..b, sin x ^ 2 * cos x ^ n := by simp [H, h, sq, -neg_add_rev]
     _ = C + (n + 1) * ∫ x in a..b, cos x ^ n - cos x ^ (n + 2) := by
       simp [sin_sq, sub_mul, ← pow_add, add_comm]
     _ = (C + (n + 1) * ∫ x in a..b, cos x ^ n) - (n + 1) * ∫ x in a..b, cos x ^ (n + 2) := by
-      rw [integral_sub, mul_sub, add_sub_assoc] <;> apply Continuous.intervalIntegrable
-      -- Porting note: was `... <;> continuity`
-      · exact continuous_cos_pow n
-      · exact continuous_cos_pow (n + 2)
+      rw [integral_sub, mul_sub, add_sub_assoc] <;>
+        apply Continuous.intervalIntegrable <;> continuity
   all_goals apply Continuous.intervalIntegrable; continuity
 #align integral_cos_pow_aux integral_cos_pow_aux
 
@@ -779,7 +777,7 @@ theorem integral_sin_pow_mul_cos_pow_odd (m n : ℕ) :
   calc
     (∫ x in a..b, sin x ^ m * cos x ^ (2 * n + 1)) =
         ∫ x in a..b, sin x ^ m * (↑1 - sin x ^ 2) ^ n * cos x := by
-      simp only [_root_.pow_zero, _root_.pow_succ', mul_assoc, pow_mul, one_mul]
+      simp only [_root_.pow_zero, _root_.pow_succ, mul_assoc, pow_mul, one_mul]
       congr! 5
       rw [← sq, ← sq, cos_sq']
     _ = ∫ u in sin a..sin b, u ^ m * (1 - u ^ 2) ^ n := by
@@ -818,7 +816,7 @@ theorem integral_sin_pow_odd_mul_cos_pow (m n : ℕ) :
         -∫ x in b..a, sin x ^ (2 * m + 1) * cos x ^ n :=
       by rw [integral_symm]
     _ = ∫ x in b..a, (↑1 - cos x ^ 2) ^ m * -sin x * cos x ^ n := by
-      simp only [_root_.pow_succ', pow_mul, _root_.pow_zero, one_mul, mul_neg, neg_mul,
+      simp only [_root_.pow_succ, pow_mul, _root_.pow_zero, one_mul, mul_neg, neg_mul,
         integral_neg, neg_inj]
       congr! 5
       rw [← sq, ← sq, sin_sq]
chore: Rename IsROrC to RCLike (#10819)

IsROrC contains data, which goes against the expectation that classes prefixed with Is are prop-valued. People have been complaining about this on and off, so this PR renames IsROrC to RCLike.

Diff
@@ -389,7 +389,7 @@ theorem integral_rpow {r : ℝ} (h : -1 < r ∨ r ≠ -1 ∧ (0 : ℝ) ∉ [[a,
   apply_fun Complex.re at this; convert this
   · simp_rw [intervalIntegral_eq_integral_uIoc, Complex.real_smul, Complex.re_ofReal_mul]
     · -- Porting note: was `change ... with ...`
-      have : Complex.re = IsROrC.re := rfl
+      have : Complex.re = RCLike.re := rfl
       rw [this, ← integral_re]; rfl
       refine' intervalIntegrable_iff.mp _
       cases' h' with h' h'
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
@@ -494,7 +494,7 @@ theorem integral_exp_mul_complex {c : ℂ} (hc : c ≠ 0) :
   have D : ∀ x : ℝ, HasDerivAt (fun y : ℝ => Complex.exp (c * y) / c) (Complex.exp (c * x)) x := by
     intro x
     conv => congr
-    rw [← mul_div_cancel (Complex.exp (c * x)) hc]
+    rw [← mul_div_cancel_right₀ (Complex.exp (c * x)) hc]
     apply ((Complex.hasDerivAt_exp _).comp x _).div_const c
     simpa only [mul_one] using ((hasDerivAt_id (x : ℂ)).const_mul _).comp_ofReal
   rw [integral_deriv_eq_sub' _ (funext fun x => (D x).deriv) fun x _ => (D x).differentiableAt]
@@ -557,7 +557,7 @@ theorem integral_cos_mul_complex {z : ℂ} (hz : z ≠ 0) (a b : ℝ) :
   simp only [mul_comm] at d
   convert d using 1
   conv_rhs => arg 1; rw [mul_comm]
-  rw [mul_div_cancel _ hz]
+  rw [mul_div_cancel_right₀ _ hz]
 #align integral_cos_mul_complex integral_cos_mul_complex
 
 theorem integral_cos_sq_sub_sin_sq :
chore: Rename zpow_coe_nat to zpow_natCast (#11528)

... and add a deprecated alias for the old name. This is mostly just me discovering the power of F2

Diff
@@ -408,7 +408,7 @@ theorem integral_zpow {n : ℤ} (h : 0 ≤ n ∨ n ≠ -1 ∧ (0 : ℝ) ∉ [[a,
 
 @[simp]
 theorem integral_pow : ∫ x in a..b, x ^ n = (b ^ (n + 1) - a ^ (n + 1)) / (n + 1) := by
-  simpa only [← Int.ofNat_succ, zpow_coe_nat] using integral_zpow (Or.inl (Int.coe_nat_nonneg n))
+  simpa only [← Int.ofNat_succ, zpow_natCast] using integral_zpow (Or.inl (Int.coe_nat_nonneg n))
 #align integral_pow integral_pow
 
 /-- Integral of `|x - a| ^ n` over `Ι a b`. This integral appears in the proof of the
refactor: optimize proofs with omega (#11093)

I ran tryAtEachStep on all files under Mathlib to find all locations where omega succeeds. For each that was a linarith without an only, I tried replacing it with omega, and I verified that elaboration time got smaller. (In almost all cases, there was a noticeable speedup.) I also replaced some slow aesops along the way.

Diff
@@ -675,7 +675,7 @@ theorem integral_sin_pow :
     (∫ x in a..b, sin x ^ (n + 2)) =
       (sin a ^ (n + 1) * cos a - sin b ^ (n + 1) * cos b) / (n + 2) +
         (n + 1) / (n + 2) * ∫ x in a..b, sin x ^ n := by
-  have : n + 2 ≠ 0 := by linarith
+  have : n + 2 ≠ 0 := by omega
   have : (n : ℝ) + 2 ≠ 0 := by norm_cast
   field_simp
   convert eq_sub_iff_add_eq.mp (integral_sin_pow_aux n) using 1
@@ -708,7 +708,7 @@ theorem integral_sin_pow_pos : 0 < ∫ x in (0)..π, sin x ^ n := by
   simp only [integral_sin_pow_even, integral_sin_pow_odd] <;>
   refine' mul_pos (by norm_num [pi_pos]) (prod_pos fun n _ => div_pos _ _) <;>
   norm_cast <;>
-  linarith
+  omega
 #align integral_sin_pow_pos integral_sin_pow_pos
 
 theorem integral_sin_pow_succ_le : (∫ x in (0)..π, sin x ^ (n + 1)) ≤ ∫ x in (0)..π, sin x ^ n := by
@@ -756,7 +756,7 @@ theorem integral_cos_pow :
     (∫ x in a..b, cos x ^ (n + 2)) =
       (cos b ^ (n + 1) * sin b - cos a ^ (n + 1) * sin a) / (n + 2) +
         (n + 1) / (n + 2) * ∫ x in a..b, cos x ^ n := by
-  have : n + 2 ≠ 0 := by linarith
+  have : n + 2 ≠ 0 := by omega
   have : (n : ℝ) + 2 ≠ 0 := by norm_cast
   field_simp
   convert eq_sub_iff_add_eq.mp (integral_cos_pow_aux n) using 1
fix: correct statement of zpow_ofNat and ofNat_zsmul (#10969)

Previously these were syntactically identical to the corresponding zpow_coe_nat and coe_nat_zsmul lemmas, now they are about OfNat.ofNat.

Unfortunately, almost every call site uses the ofNat name to refer to Nat.cast, so the downstream proofs had to be adjusted too.

Diff
@@ -408,7 +408,7 @@ theorem integral_zpow {n : ℤ} (h : 0 ≤ n ∨ n ≠ -1 ∧ (0 : ℝ) ∉ [[a,
 
 @[simp]
 theorem integral_pow : ∫ x in a..b, x ^ n = (b ^ (n + 1) - a ^ (n + 1)) / (n + 1) := by
-  simpa only [← Int.ofNat_succ, zpow_ofNat] using integral_zpow (Or.inl (Int.coe_nat_nonneg n))
+  simpa only [← Int.ofNat_succ, zpow_coe_nat] using integral_zpow (Or.inl (Int.coe_nat_nonneg n))
 #align integral_pow integral_pow
 
 /-- Integral of `|x - a| ^ n` over `Ι a b`. This integral appears in the proof of the
chore: classify simp can prove porting notes (#10930)

Classify by adding issue number (#10618) to porting notes claiming anything semantically equivalent to

  • "simp can prove this"
  • "simp can simplify this`"
  • "was @[simp], now can be proved by simp"
  • "was @[simp], but simp can prove it"
  • "removed simp attribute as the equality can already be obtained by simp"
  • "simp can already prove this"
  • "simp already proves this"
  • "simp can prove these"
Diff
@@ -274,64 +274,65 @@ theorem intervalIntegrable_inv_one_add_sq :
 /-! ### Integrals of the form `c * ∫ x in a..b, f (c * x + d)` -/
 
 
--- Porting note: was @[simp]; simpNF says LHS does not simplify when applying lemma on itself
+-- Porting note (#10618): was @[simp];
+-- simpNF says LHS does not simplify when applying lemma on itself
 theorem mul_integral_comp_mul_right : (c * ∫ x in a..b, f (x * c)) = ∫ x in a * c..b * c, f x :=
   smul_integral_comp_mul_right f c
 #align interval_integral.mul_integral_comp_mul_right intervalIntegral.mul_integral_comp_mul_right
 
--- Porting note: was @[simp]
+-- Porting note (#10618): was @[simp]
 theorem mul_integral_comp_mul_left : (c * ∫ x in a..b, f (c * x)) = ∫ x in c * a..c * b, f x :=
   smul_integral_comp_mul_left f c
 #align interval_integral.mul_integral_comp_mul_left intervalIntegral.mul_integral_comp_mul_left
 
--- Porting note: was @[simp]
+-- Porting note (#10618): was @[simp]
 theorem inv_mul_integral_comp_div : (c⁻¹ * ∫ x in a..b, f (x / c)) = ∫ x in a / c..b / c, f x :=
   inv_smul_integral_comp_div f c
 #align interval_integral.inv_mul_integral_comp_div intervalIntegral.inv_mul_integral_comp_div
 
--- Porting note: was @[simp]
+-- Porting note (#10618): was @[simp]
 theorem mul_integral_comp_mul_add :
     (c * ∫ x in a..b, f (c * x + d)) = ∫ x in c * a + d..c * b + d, f x :=
   smul_integral_comp_mul_add f c d
 #align interval_integral.mul_integral_comp_mul_add intervalIntegral.mul_integral_comp_mul_add
 
--- Porting note: was @[simp]
+-- Porting note (#10618): was @[simp]
 theorem mul_integral_comp_add_mul :
     (c * ∫ x in a..b, f (d + c * x)) = ∫ x in d + c * a..d + c * b, f x :=
   smul_integral_comp_add_mul f c d
 #align interval_integral.mul_integral_comp_add_mul intervalIntegral.mul_integral_comp_add_mul
 
--- Porting note: was @[simp]
+-- Porting note (#10618): was @[simp]
 theorem inv_mul_integral_comp_div_add :
     (c⁻¹ * ∫ x in a..b, f (x / c + d)) = ∫ x in a / c + d..b / c + d, f x :=
   inv_smul_integral_comp_div_add f c d
 #align interval_integral.inv_mul_integral_comp_div_add intervalIntegral.inv_mul_integral_comp_div_add
 
--- Porting note: was @[simp]
+-- Porting note (#10618): was @[simp]
 theorem inv_mul_integral_comp_add_div :
     (c⁻¹ * ∫ x in a..b, f (d + x / c)) = ∫ x in d + a / c..d + b / c, f x :=
   inv_smul_integral_comp_add_div f c d
 #align interval_integral.inv_mul_integral_comp_add_div intervalIntegral.inv_mul_integral_comp_add_div
 
--- Porting note: was @[simp]
+-- Porting note (#10618): was @[simp]
 theorem mul_integral_comp_mul_sub :
     (c * ∫ x in a..b, f (c * x - d)) = ∫ x in c * a - d..c * b - d, f x :=
   smul_integral_comp_mul_sub f c d
 #align interval_integral.mul_integral_comp_mul_sub intervalIntegral.mul_integral_comp_mul_sub
 
--- Porting note: was @[simp]
+-- Porting note (#10618): was @[simp]
 theorem mul_integral_comp_sub_mul :
     (c * ∫ x in a..b, f (d - c * x)) = ∫ x in d - c * b..d - c * a, f x :=
   smul_integral_comp_sub_mul f c d
 #align interval_integral.mul_integral_comp_sub_mul intervalIntegral.mul_integral_comp_sub_mul
 
--- Porting note: was @[simp]
+-- Porting note (#10618): was @[simp]
 theorem inv_mul_integral_comp_div_sub :
     (c⁻¹ * ∫ x in a..b, f (x / c - d)) = ∫ x in a / c - d..b / c - d, f x :=
   inv_smul_integral_comp_div_sub f c d
 #align interval_integral.inv_mul_integral_comp_div_sub intervalIntegral.inv_mul_integral_comp_div_sub
 
--- Porting note: was @[simp]
+-- Porting note (#10618): was @[simp]
 theorem inv_mul_integral_comp_sub_div :
     (c⁻¹ * ∫ x in a..b, f (d - x / c)) = ∫ x in d - b / c..d - a / c, f x :=
   inv_smul_integral_comp_sub_div f c d
chore: classify simp can do this porting notes (#10619)

Classify by adding issue number (#10618) to porting notes claiming anything semantically equivalent to simp can prove this or simp can simplify this.

Diff
@@ -215,7 +215,7 @@ theorem intervalIntegrable_id : IntervalIntegrable (fun x => x) μ a b :=
   continuous_id.intervalIntegrable a b
 #align interval_integral.interval_integrable_id intervalIntegral.intervalIntegrable_id
 
--- @[simp] -- Porting note: simp can prove this
+-- @[simp] -- Porting note (#10618): simp can prove this
 theorem intervalIntegrable_const : IntervalIntegrable (fun _ => c) μ a b :=
   continuous_const.intervalIntegrable a b
 #align interval_integral.interval_integrable_const intervalIntegral.intervalIntegrable_const
@@ -442,7 +442,7 @@ theorem integral_id : ∫ x in a..b, x = (b ^ 2 - a ^ 2) / 2 := by
   exact this
 #align integral_id integral_id
 
--- @[simp] -- Porting note: simp can prove this
+-- @[simp] -- Porting note (#10618): simp can prove this
 theorem integral_one : (∫ _ in a..b, (1 : ℝ)) = b - a := by
   simp only [mul_one, smul_eq_mul, integral_const]
 #align integral_one integral_one
chore: remove stream-of-consciousness uses of have, replace and suffices (#10640)

No changes to tactic file, it's just boring fixes throughout the library.

This follows on from #6964.

Co-authored-by: sgouezel <sebastien.gouezel@univ-rennes1.fr> Co-authored-by: Eric Wieser <wieser.eric@gmail.com>

Diff
@@ -133,8 +133,8 @@ theorem intervalIntegrable_cpow {r : ℂ} (h : 0 ≤ r.re ∨ (0 : ℝ) ∉ [[a,
     exact ContinuousAt.continuousOn fun x hx =>
       Complex.continuousAt_ofReal_cpow_const x r (Or.inr hx)
   -- reduce to case of integral over `[0, c]`
-  suffices : ∀ c : ℝ, IntervalIntegrable (fun x : ℝ => ‖(x:ℂ) ^ r‖) μ 0 c
-  exact (this a).symm.trans (this b)
+  suffices ∀ c : ℝ, IntervalIntegrable (fun x : ℝ => ‖(x:ℂ) ^ r‖) μ 0 c from
+    (this a).symm.trans (this b)
   intro c
   rcases le_or_lt 0 c with (hc | hc)
   · -- case `0 ≤ c`: integrand is identically 1
@@ -358,7 +358,7 @@ theorem integral_cpow {r : ℂ} (h : -1 < r.re ∨ r ≠ -1 ∧ (0 : ℝ) ∉ [[
       (intervalIntegrable_cpow (r := r) <| Or.inr hab)
     refine' hasDerivAt_ofReal_cpow (ne_of_mem_of_not_mem hx hab) _
     contrapose! hr; rwa [add_eq_zero_iff_eq_neg]
-  replace h : -1 < r.re; · tauto
+  replace h : -1 < r.re := by tauto
   suffices ∀ c : ℝ, (∫ x : ℝ in (0)..c, (x : ℂ) ^ r) =
       (c:ℂ) ^ (r + 1) / (r + 1) - (0:ℂ) ^ (r + 1) / (r + 1) by
     rw [← integral_add_adjacent_intervals (@intervalIntegrable_cpow' a 0 r h)
@@ -401,7 +401,7 @@ theorem integral_rpow {r : ℝ} (h : -1 < r ∨ r ≠ -1 ∧ (0 : ℝ) ∉ [[a,
 
 theorem integral_zpow {n : ℤ} (h : 0 ≤ n ∨ n ≠ -1 ∧ (0 : ℝ) ∉ [[a, b]]) :
     ∫ x in a..b, x ^ n = (b ^ (n + 1) - a ^ (n + 1)) / (n + 1) := by
-  replace h : -1 < (n : ℝ) ∨ (n : ℝ) ≠ -1 ∧ (0 : ℝ) ∉ [[a, b]]; · exact mod_cast h
+  replace h : -1 < (n : ℝ) ∨ (n : ℝ) ≠ -1 ∧ (0 : ℝ) ∉ [[a, b]] := mod_cast h
   exact mod_cast integral_rpow h
 #align integral_zpow integral_zpow
 
chore: golf integral_inv_one_add_sq (#10184)
Diff
@@ -566,21 +566,19 @@ theorem integral_cos_sq_sub_sin_sq :
       continuousOn_cos.intervalIntegrable continuousOn_sin.neg.intervalIntegrable
 #align integral_cos_sq_sub_sin_sq integral_cos_sq_sub_sin_sq
 
-@[simp]
-theorem integral_inv_one_add_sq : (∫ x : ℝ in a..b, (↑1 + x ^ 2)⁻¹) = arctan b - arctan a := by
-  simp only [← one_div]
-  refine' integral_deriv_eq_sub' _ _ _ (continuous_const.div _ fun x => _).continuousOn
-  · norm_num
-  · exact fun _ _ => differentiableAt_arctan _
-  · continuity
-  · nlinarith
-#align integral_inv_one_add_sq integral_inv_one_add_sq
-
 theorem integral_one_div_one_add_sq :
     (∫ x : ℝ in a..b, ↑1 / (↑1 + x ^ 2)) = arctan b - arctan a := by
-  simp only [one_div, integral_inv_one_add_sq]
+  refine integral_deriv_eq_sub' _ Real.deriv_arctan (fun _ _ => differentiableAt_arctan _)
+    (continuous_const.div ?_ fun x => ?_).continuousOn
+  · continuity
+  · nlinarith
 #align integral_one_div_one_add_sq integral_one_div_one_add_sq
 
+@[simp]
+theorem integral_inv_one_add_sq : (∫ x : ℝ in a..b, (↑1 + x ^ 2)⁻¹) = arctan b - arctan a := by
+  simp only [← one_div, integral_one_div_one_add_sq]
+#align integral_inv_one_add_sq integral_inv_one_add_sq
+
 section RpowCpow
 
 open Complex
chore: reduce imports (#9830)

This uses the improved shake script from #9772 to reduce imports across mathlib. The corresponding noshake.json file has been added to #9772.

Co-authored-by: Mario Carneiro <di.gama@gmail.com>

Diff
@@ -6,6 +6,7 @@ Authors: Benjamin Davidson
 import Mathlib.MeasureTheory.Integral.FundThmCalculus
 import Mathlib.Analysis.SpecialFunctions.Trigonometric.ArctanDeriv
 import Mathlib.Analysis.SpecialFunctions.NonIntegrable
+import Mathlib.Analysis.SpecialFunctions.Pow.Deriv
 
 #align_import analysis.special_functions.integrals from "leanprover-community/mathlib"@"011cafb4a5bc695875d186e245d6b3df03bf6c40"
 
feat: Basic Complex lemmas (#9527)

and rename ofReal_mul_re → re_mul_ofReal, ofReal_mul_im → im_mul_ofReal.

From LeanAPAP

Diff
@@ -385,7 +385,7 @@ theorem integral_rpow {r : ℝ} (h : -1 < r ∨ r ≠ -1 ∧ (0 : ℝ) ∉ [[a,
     (∫ x in a..b, (x : ℂ) ^ (r : ℂ)) = ((b : ℂ) ^ (r + 1 : ℂ) - (a : ℂ) ^ (r + 1 : ℂ)) / (r + 1) :=
     integral_cpow h'
   apply_fun Complex.re at this; convert this
-  · simp_rw [intervalIntegral_eq_integral_uIoc, Complex.real_smul, Complex.ofReal_mul_re]
+  · simp_rw [intervalIntegral_eq_integral_uIoc, Complex.real_smul, Complex.re_ofReal_mul]
     · -- Porting note: was `change ... with ...`
       have : Complex.re = IsROrC.re := rfl
       rw [this, ← integral_re]; rfl
@@ -394,7 +394,7 @@ theorem integral_rpow {r : ℝ} (h : -1 < r ∨ r ≠ -1 ∧ (0 : ℝ) ∉ [[a,
       · exact intervalIntegrable_cpow' h'
       · exact intervalIntegrable_cpow (Or.inr h'.2)
   · rw [(by push_cast; rfl : (r : ℂ) + 1 = ((r + 1 : ℝ) : ℂ))]
-    simp_rw [div_eq_inv_mul, ← Complex.ofReal_inv, Complex.ofReal_mul_re, Complex.sub_re]
+    simp_rw [div_eq_inv_mul, ← Complex.ofReal_inv, Complex.re_ofReal_mul, Complex.sub_re]
     rfl
 #align integral_rpow integral_rpow
 
chore: Rename rpow_nonneg_of_nonneg to rpow_nonneg (#9518)

This better matches other lemma names.

From LeanAPAP

Diff
@@ -81,7 +81,7 @@ theorem intervalIntegrable_rpow' {r : ℝ} (h : -1 < r) :
       convert (Real.hasDerivAt_rpow_const (p := r + 1) (Or.inl hx.1.ne')).div_const (r + 1) using 1
       field_simp [(by linarith : r + 1 ≠ 0)]; ring
     apply integrableOn_deriv_of_nonneg _ hderiv
-    · intro x hx; apply rpow_nonneg_of_nonneg hx.1.le
+    · intro x hx; apply rpow_nonneg hx.1.le
     · refine' (continuousOn_id.rpow_const _).div_const _; intro x _; right; linarith
   intro c; rcases le_total 0 c with (hc | hc)
   · exact this c hc
feat(Analysis/SpecialFunctions/Complex/Arg): add definition for slit plane and API, and use it (#9116)

In preparation of future PRs dealing with estimates of the complex logarithm and its Taylor series, this introduces Complex.slitPlane for the set of complex numbers not on the closed negative real axis (in Analysis.SpecialFunctions.Complex.Arg), adds a bunch of API lemmas, and replaces hypotheses of the form 0 < x.re ∨ x.im ≠ 0 by x ∈ slitPlane in several other files.

(We do not introduce a new file for that to avoid circular imports with Analysis.SpecialFunctions.Complex.Arg.)

Co-authored-by: Yury G. Kudryashov <urkud@urkud.name>

Diff
@@ -610,8 +610,8 @@ theorem integral_mul_cpow_one_add_sq {t : ℂ} (ht : t ≠ -1) :
     · exact continuous_const.add (continuous_ofReal.pow 2)
     · exact continuous_const
     · intro a
-      rw [add_re, one_re, ← ofReal_pow, ofReal_re]
-      exact Or.inl (add_pos_of_pos_of_nonneg zero_lt_one (sq_nonneg a))
+      norm_cast
+      exact ofReal_mem_slitPlane.2 <| add_pos_of_pos_of_nonneg one_pos <| sq_nonneg a
 #align integral_mul_cpow_one_add_sq integral_mul_cpow_one_add_sq
 
 theorem integral_mul_rpow_one_add_sq {t : ℝ} (ht : t ≠ -1) :
chore: remove uses of cases' (#9171)

I literally went through and regex'd some uses of cases', replacing them with rcases; this is meant to be a low effort PR as I hope that tools can do this in the future.

rcases is an easier replacement than cases, though with better tools we could in future do a second pass converting simple rcases added here (and existing ones) to cases.

Diff
@@ -412,7 +412,7 @@ theorem integral_pow : ∫ x in a..b, x ^ n = (b ^ (n + 1) - a ^ (n + 1)) / (n +
 /-- Integral of `|x - a| ^ n` over `Ι a b`. This integral appears in the proof of the
 Picard-Lindelöf/Cauchy-Lipschitz theorem. -/
 theorem integral_pow_abs_sub_uIoc : ∫ x in Ι a b, |x - a| ^ n = |b - a| ^ (n + 1) / (n + 1) := by
-  cases' le_or_lt a b with hab hab
+  rcases le_or_lt a b with hab | hab
   · calc
       ∫ x in Ι a b, |x - a| ^ n = ∫ x in a..b, |x - a| ^ n := by
         rw [uIoc_of_le hab, ← integral_of_le hab]
feat: non-integrability results of derivatives on [a, +oo) (#8712)

We have in the library the lemma not_intervalIntegrable_of_tendsto_norm_atTop_of_deriv_isBigO_filter, saying that if a function tends to infinity at a point in an interval [a, b], then its derivative is not interval-integrable on [a, b]. We generalize this result to allow for any set instead of [a, b], and apply it to half-infinite intervals.

In particular, we characterize integrability of x^s on [a, +oo), and deduce that x^s is never integrable on [0, +oo). This makes it possible to remove one assumption in Lemma mellin_comp_rpow on the Mellin transform.

Diff
@@ -5,6 +5,7 @@ Authors: Benjamin Davidson
 -/
 import Mathlib.MeasureTheory.Integral.FundThmCalculus
 import Mathlib.Analysis.SpecialFunctions.Trigonometric.ArctanDeriv
+import Mathlib.Analysis.SpecialFunctions.NonIntegrable
 
 #align_import analysis.special_functions.integrals from "leanprover-community/mathlib"@"011cafb4a5bc695875d186e245d6b3df03bf6c40"
 
@@ -93,6 +94,26 @@ theorem intervalIntegrable_rpow' {r : ℝ} (h : -1 < r) :
       rpow_def_of_pos hx.1, rpow_def_of_neg (by linarith [hx.1] : -x < 0)]
 #align interval_integral.interval_integrable_rpow' intervalIntegral.intervalIntegrable_rpow'
 
+/-- The power function `x ↦ x^s` is integrable on `(0, t)` iff `-1 < s`. -/
+lemma integrableOn_Ioo_rpow_iff {s t : ℝ} (ht : 0 < t) :
+    IntegrableOn (fun x ↦ x ^ s) (Ioo (0 : ℝ) t) ↔ -1 < s := by
+  refine ⟨fun h ↦ ?_, fun h ↦ by simpa [intervalIntegrable_iff_integrableOn_Ioo_of_le ht.le]
+    using intervalIntegrable_rpow' h (a := 0) (b := t)⟩
+  contrapose! h
+  intro H
+  have I : 0 < min 1 t := lt_min zero_lt_one ht
+  have H' : IntegrableOn (fun x ↦ x ^ s) (Ioo 0 (min 1 t)) :=
+    H.mono (Set.Ioo_subset_Ioo le_rfl (min_le_right _ _)) le_rfl
+  have : IntegrableOn (fun x ↦ x⁻¹) (Ioo 0 (min 1 t)) := by
+    apply H'.mono' measurable_inv.aestronglyMeasurable
+    filter_upwards [ae_restrict_mem measurableSet_Ioo] with x hx
+    simp only [norm_inv, Real.norm_eq_abs, abs_of_nonneg (le_of_lt hx.1)]
+    rwa [← Real.rpow_neg_one x, Real.rpow_le_rpow_left_iff_of_base_lt_one hx.1]
+    exact lt_of_lt_of_le hx.2 (min_le_left _ _)
+  have : IntervalIntegrable (fun x ↦ x⁻¹) volume 0 (min 1 t) := by
+    rwa [intervalIntegrable_iff_integrableOn_Ioo_of_le I.le]
+  simp [intervalIntegrable_inv_iff, I.ne] at this
+
 /-- See `intervalIntegrable_cpow'` for a version with a weaker hypothesis on `r`, but assuming the
 measure is volume. -/
 theorem intervalIntegrable_cpow {r : ℂ} (h : 0 ≤ r.re ∨ (0 : ℝ) ∉ [[a, b]]) :
@@ -117,13 +138,13 @@ theorem intervalIntegrable_cpow {r : ℂ} (h : 0 ≤ r.re ∨ (0 : ℝ) ∉ [[a,
   rcases le_or_lt 0 c with (hc | hc)
   · -- case `0 ≤ c`: integrand is identically 1
     have : IntervalIntegrable (fun _ => 1 : ℝ → ℝ) μ 0 c := intervalIntegrable_const
-    rw [intervalIntegrable_iff_integrable_Ioc_of_le hc] at this ⊢
+    rw [intervalIntegrable_iff_integrableOn_Ioc_of_le hc] at this ⊢
     refine' IntegrableOn.congr_fun this (fun x hx => _) measurableSet_Ioc
     dsimp only
     rw [Complex.norm_eq_abs, Complex.abs_cpow_eq_rpow_re_of_pos hx.1, ← h', rpow_zero]
   · -- case `c < 0`: integrand is identically constant, *except* at `x = 0` if `r ≠ 0`.
     apply IntervalIntegrable.symm
-    rw [intervalIntegrable_iff_integrable_Ioc_of_le hc.le]
+    rw [intervalIntegrable_iff_integrableOn_Ioc_of_le hc.le]
     have : Ioc c 0 = Ioo c 0 ∪ {(0 : ℝ)} := by
       rw [← Ioo_union_Icc_eq_Ioc hc (le_refl 0), ← Icc_def]
       simp_rw [← le_antisymm_iff, setOf_eq_eq_singleton']
@@ -177,6 +198,17 @@ theorem intervalIntegrable_cpow' {r : ℂ} (h : -1 < r.re) :
     simp
 #align interval_integral.interval_integrable_cpow' intervalIntegral.intervalIntegrable_cpow'
 
+/-- The complex power function `x ↦ x^s` is integrable on `(0, t)` iff `-1 < s.re`. -/
+theorem integrableOn_Ioo_cpow_iff {s : ℂ} {t : ℝ} (ht : 0 < t) :
+    IntegrableOn (fun x : ℝ ↦ (x : ℂ) ^ s) (Ioo (0 : ℝ) t) ↔ -1 < s.re := by
+  refine ⟨fun h ↦ ?_, fun h ↦ by simpa [intervalIntegrable_iff_integrableOn_Ioo_of_le ht.le]
+    using intervalIntegrable_cpow' h (a := 0) (b := t)⟩
+  have B : IntegrableOn (fun a ↦ a ^ s.re) (Ioo 0 t) := by
+    apply (integrableOn_congr_fun _ measurableSet_Ioo).1 h.norm
+    intro a ha
+    simp [Complex.abs_cpow_eq_rpow_re_of_pos ha.1]
+  rwa [integrableOn_Ioo_rpow_iff ht] at B
+
 @[simp]
 theorem intervalIntegrable_id : IntervalIntegrable (fun x => x) μ a b :=
   continuous_id.intervalIntegrable a b
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
@@ -235,7 +235,7 @@ theorem intervalIntegrable_one_div_one_add_sq :
 @[simp]
 theorem intervalIntegrable_inv_one_add_sq :
     IntervalIntegrable (fun x : ℝ => (↑1 + x ^ 2)⁻¹) μ a b := by
-  field_simp; exact_mod_cast intervalIntegrable_one_div_one_add_sq
+  field_simp; exact mod_cast intervalIntegrable_one_div_one_add_sq
 #align interval_integral.interval_integrable_inv_one_add_sq intervalIntegral.intervalIntegrable_inv_one_add_sq
 
 /-! ### Integrals of the form `c * ∫ x in a..b, f (c * x + d)` -/
@@ -368,8 +368,8 @@ theorem integral_rpow {r : ℝ} (h : -1 < r ∨ r ≠ -1 ∧ (0 : ℝ) ∉ [[a,
 
 theorem integral_zpow {n : ℤ} (h : 0 ≤ n ∨ n ≠ -1 ∧ (0 : ℝ) ∉ [[a, b]]) :
     ∫ x in a..b, x ^ n = (b ^ (n + 1) - a ^ (n + 1)) / (n + 1) := by
-  replace h : -1 < (n : ℝ) ∨ (n : ℝ) ≠ -1 ∧ (0 : ℝ) ∉ [[a, b]]; · exact_mod_cast h
-  exact_mod_cast integral_rpow h
+  replace h : -1 < (n : ℝ) ∨ (n : ℝ) ≠ -1 ∧ (0 : ℝ) ∉ [[a, b]]; · exact mod_cast h
+  exact mod_cast integral_rpow h
 #align integral_zpow integral_zpow
 
 @[simp]
@@ -571,7 +571,7 @@ theorem integral_mul_cpow_one_add_sq {t : ℂ} (ht : t ≠ -1) :
       ring
     convert (HasDerivAt.comp (↑x) (g _) f).comp_ofReal using 1
     · field_simp; ring
-    · exact_mod_cast add_pos_of_pos_of_nonneg zero_lt_one (sq_nonneg x)
+    · exact mod_cast add_pos_of_pos_of_nonneg zero_lt_one (sq_nonneg x)
   · apply Continuous.intervalIntegrable
     refine' continuous_ofReal.mul _
     apply Continuous.cpow
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
@@ -37,8 +37,6 @@ open Real Nat Set Finset
 
 open scoped Real BigOperators Interval
 
-local macro_rules | `($x ^ $y) => `(HPow.hPow $x $y) -- Porting note: See issue lean4#2220
-
 variable {a b : ℝ} (n : ℕ)
 
 namespace intervalIntegral
@@ -561,10 +559,9 @@ theorem integral_mul_cpow_one_add_sq {t : ℂ} (ht : t ≠ -1) :
   have : t + 1 ≠ 0 := by contrapose! ht; rwa [add_eq_zero_iff_eq_neg] at ht
   apply integral_eq_sub_of_hasDerivAt
   · intro x _
-    have f : HasDerivAt (fun y : ℂ => 1 + y ^ 2) (2 * x) x := by
+    have f : HasDerivAt (fun y : ℂ => 1 + y ^ 2) (2 * x : ℂ) x := by
       convert (hasDerivAt_pow 2 (x : ℂ)).const_add 1
-      · norm_cast
-      · simp
+      simp
     have g :
       ∀ {z : ℂ}, 0 < z.re → HasDerivAt (fun z => z ^ (t + 1) / (2 * (t + 1))) (z ^ t / 2) z := by
       intro z hz
@@ -573,7 +570,6 @@ theorem integral_mul_cpow_one_add_sq {t : ℂ} (ht : t ≠ -1) :
       field_simp
       ring
     convert (HasDerivAt.comp (↑x) (g _) f).comp_ofReal using 1
-    · simp
     · field_simp; ring
     · exact_mod_cast add_pos_of_pos_of_nonneg zero_lt_one (sq_nonneg x)
   · apply Continuous.intervalIntegrable
@@ -599,7 +595,6 @@ theorem integral_mul_rpow_one_add_sq {t : ℝ} (ht : t ≠ -1) :
   · rw [← intervalIntegral.integral_ofReal]
     congr with x : 1
     rw [ofReal_mul, this x t]
-    norm_cast
   · simp_rw [ofReal_sub, ofReal_div, this a (t + 1), this b (t + 1)]
     push_cast; rfl
   · rw [← ofReal_one, ← ofReal_neg, Ne.def, ofReal_inj]
@@ -755,8 +750,9 @@ theorem integral_sin_pow_mul_cos_pow_odd (m n : ℕ) :
       simp only [_root_.pow_zero, _root_.pow_succ', mul_assoc, pow_mul, one_mul]
       congr! 5
       rw [← sq, ← sq, cos_sq']
-    _ = ∫ u in sin a..sin b, u ^ m * (↑1 - u ^ 2) ^ n :=
-      integral_comp_mul_deriv (fun x _ => hasDerivAt_sin x) continuousOn_cos hc
+    _ = ∫ u in sin a..sin b, u ^ m * (1 - u ^ 2) ^ n := by
+      -- Note(kmill): Didn't need `by exact`, but elaboration order seems to matter here.
+      exact integral_comp_mul_deriv (fun x _ => hasDerivAt_sin x) continuousOn_cos hc
 #align integral_sin_pow_mul_cos_pow_odd integral_sin_pow_mul_cos_pow_odd
 
 /-- The integral of `sin x * cos x`, given in terms of sin².
@@ -847,10 +843,10 @@ theorem integral_sin_sq_mul_cos_sq :
 /-! ### Integral of misc. functions -/
 
 
-theorem integral_sqrt_one_sub_sq : ∫ x in (-1 : ℝ)..1, sqrt ((1 : ℝ) - x ^ 2) = π / 2 :=
+theorem integral_sqrt_one_sub_sq : ∫ x in (-1 : ℝ)..1, sqrt (1 - x ^ 2 : ℝ) = π / 2 :=
   calc
-    _ = ∫ x in sin (-(π / 2)).. sin (π / 2), sqrt (↑1 - x ^ 2) := by rw [sin_neg, sin_pi_div_two]
-    _ = ∫ x in (-(π / 2))..(π / 2), sqrt (↑1 - sin x ^ 2) * cos x :=
+    _ = ∫ x in sin (-(π / 2)).. sin (π / 2), sqrt (1 - x ^ 2 : ℝ) := by rw [sin_neg, sin_pi_div_two]
+    _ = ∫ x in (-(π / 2))..(π / 2), sqrt (1 - sin x ^ 2 : ℝ) * cos x :=
           (integral_comp_mul_deriv (fun x _ => hasDerivAt_sin x) continuousOn_cos
             (by continuity)).symm
     _ = ∫ x in (-(π / 2))..(π / 2), cos x ^ 2 := by
chore: simplify by rfl (#7039)

Co-authored-by: Moritz Firsching <firsching@google.com>

Diff
@@ -357,7 +357,7 @@ theorem integral_rpow {r : ℝ} (h : -1 < r ∨ r ≠ -1 ∧ (0 : ℝ) ∉ [[a,
   apply_fun Complex.re at this; convert this
   · simp_rw [intervalIntegral_eq_integral_uIoc, Complex.real_smul, Complex.ofReal_mul_re]
     · -- Porting note: was `change ... with ...`
-      have : Complex.re = IsROrC.re := by rfl
+      have : Complex.re = IsROrC.re := rfl
       rw [this, ← integral_re]; rfl
       refine' intervalIntegrable_iff.mp _
       cases' h' with h' h'
feat: compute the integral of sqrt (1 - x ^ 2) (#6905)

We prove

theorem integral_sqrt_one_sub_sq : ∫ x in (-1 : ℝ)..1, sqrt (1 - x ^ 2) = π / 2

which will in turn be used to compute the area of the disc and then the volume of the unit complex ball in #6907

Diff
@@ -843,3 +843,18 @@ theorem integral_sin_sq_mul_cos_sq :
   · exact intervalIntegrable_const
   · exact h2.intervalIntegrable a b
 #align integral_sin_sq_mul_cos_sq integral_sin_sq_mul_cos_sq
+
+/-! ### Integral of misc. functions -/
+
+
+theorem integral_sqrt_one_sub_sq : ∫ x in (-1 : ℝ)..1, sqrt ((1 : ℝ) - x ^ 2) = π / 2 :=
+  calc
+    _ = ∫ x in sin (-(π / 2)).. sin (π / 2), sqrt (↑1 - x ^ 2) := by rw [sin_neg, sin_pi_div_two]
+    _ = ∫ x in (-(π / 2))..(π / 2), sqrt (↑1 - sin x ^ 2) * cos x :=
+          (integral_comp_mul_deriv (fun x _ => hasDerivAt_sin x) continuousOn_cos
+            (by continuity)).symm
+    _ = ∫ x in (-(π / 2))..(π / 2), cos x ^ 2 := by
+          refine integral_congr_ae (MeasureTheory.ae_of_all _ fun _ h => ?_)
+          rw [uIoc_of_le (neg_le_self (le_of_lt (half_pos Real.pi_pos))), Set.mem_Ioc] at h
+          rw [ ← Real.cos_eq_sqrt_one_sub_sin_sq (le_of_lt h.1) h.2, pow_two]
+    _ = π / 2 := by simp
feat: fix norm num with arguments (#6600)

norm_num was passing the wrong syntax node to elabSimpArgs when elaborating, which essentially had the effect of ignoring all arguments it was passed, i.e. norm_num [add_comm] would not try to commute addition in the simp step. The fix itself is very simple (though not obvious to debug!), probably using TSyntax more would help avoid such issues in future.

Due to this bug many norm_num [blah] became rw [blah]; norm_num or similar, sometimes with porting notes, sometimes not, we fix these porting notes and other regressions during the port also.

Interestingly cancel_denoms uses norm_num [<- mul_assoc] internally, so cancel_denoms also got stronger with this change.

Diff
@@ -452,7 +452,7 @@ theorem integral_one_div_of_neg (ha : a < 0) (hb : b < 0) :
 @[simp]
 theorem integral_exp : ∫ x in a..b, exp x = exp b - exp a := by
   rw [integral_deriv_eq_sub']
-  · norm_num
+  · simp
   · exact fun _ _ => differentiableAt_exp
   · exact continuousOn_exp
 #align integral_exp integral_exp
@@ -679,7 +679,7 @@ theorem integral_sin_pow_even :
 theorem integral_sin_pow_pos : 0 < ∫ x in (0)..π, sin x ^ n := by
   rcases even_or_odd' n with ⟨k, rfl | rfl⟩ <;>
   simp only [integral_sin_pow_even, integral_sin_pow_odd] <;>
-  refine' mul_pos (by norm_num <;> exact pi_pos) (prod_pos fun n _ => div_pos _ _) <;>
+  refine' mul_pos (by norm_num [pi_pos]) (prod_pos fun n _ => div_pos _ _) <;>
   norm_cast <;>
   linarith
 #align integral_sin_pow_pos integral_sin_pow_pos
chore: regularize HPow.hPow porting notes (#6465)
Diff
@@ -37,7 +37,7 @@ open Real Nat Set Finset
 
 open scoped Real BigOperators Interval
 
-local macro_rules | `($x ^ $y) => `(HPow.hPow $x $y) -- Porting note: See issue #2220
+local macro_rules | `($x ^ $y) => `(HPow.hPow $x $y) -- Porting note: See issue lean4#2220
 
 variable {a b : ℝ} (n : ℕ)
 
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,15 +2,12 @@
 Copyright (c) 2021 Benjamin Davidson. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Benjamin Davidson
-
-! This file was ported from Lean 3 source module analysis.special_functions.integrals
-! leanprover-community/mathlib commit 011cafb4a5bc695875d186e245d6b3df03bf6c40
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.MeasureTheory.Integral.FundThmCalculus
 import Mathlib.Analysis.SpecialFunctions.Trigonometric.ArctanDeriv
 
+#align_import analysis.special_functions.integrals from "leanprover-community/mathlib"@"011cafb4a5bc695875d186e245d6b3df03bf6c40"
+
 /-!
 # Integration of specific interval integrals
 
chore: remove superfluous parentheses around integrals (#5591)
Diff
@@ -349,7 +349,7 @@ theorem integral_cpow {r : ℂ} (h : -1 < r.re ∨ r ≠ -1 ∧ (0 : ℝ) ∉ [[
 #align integral_cpow integral_cpow
 
 theorem integral_rpow {r : ℝ} (h : -1 < r ∨ r ≠ -1 ∧ (0 : ℝ) ∉ [[a, b]]) :
-    (∫ x in a..b, x ^ r) = (b ^ (r + 1) - a ^ (r + 1)) / (r + 1) := by
+    ∫ x in a..b, x ^ r = (b ^ (r + 1) - a ^ (r + 1)) / (r + 1) := by
   have h' : -1 < (r : ℂ).re ∨ (r : ℂ) ≠ -1 ∧ (0 : ℝ) ∉ [[a, b]] := by
     cases h
     · left; rwa [Complex.ofReal_re]
@@ -372,22 +372,22 @@ theorem integral_rpow {r : ℝ} (h : -1 < r ∨ r ≠ -1 ∧ (0 : ℝ) ∉ [[a,
 #align integral_rpow integral_rpow
 
 theorem integral_zpow {n : ℤ} (h : 0 ≤ n ∨ n ≠ -1 ∧ (0 : ℝ) ∉ [[a, b]]) :
-    (∫ x in a..b, x ^ n) = (b ^ (n + 1) - a ^ (n + 1)) / (n + 1) := by
+    ∫ x in a..b, x ^ n = (b ^ (n + 1) - a ^ (n + 1)) / (n + 1) := by
   replace h : -1 < (n : ℝ) ∨ (n : ℝ) ≠ -1 ∧ (0 : ℝ) ∉ [[a, b]]; · exact_mod_cast h
   exact_mod_cast integral_rpow h
 #align integral_zpow integral_zpow
 
 @[simp]
-theorem integral_pow : (∫ x in a..b, x ^ n) = (b ^ (n + 1) - a ^ (n + 1)) / (n + 1) := by
+theorem integral_pow : ∫ x in a..b, x ^ n = (b ^ (n + 1) - a ^ (n + 1)) / (n + 1) := by
   simpa only [← Int.ofNat_succ, zpow_ofNat] using integral_zpow (Or.inl (Int.coe_nat_nonneg n))
 #align integral_pow integral_pow
 
 /-- Integral of `|x - a| ^ n` over `Ι a b`. This integral appears in the proof of the
 Picard-Lindelöf/Cauchy-Lipschitz theorem. -/
-theorem integral_pow_abs_sub_uIoc : (∫ x in Ι a b, |x - a| ^ n) = |b - a| ^ (n + 1) / (n + 1) := by
+theorem integral_pow_abs_sub_uIoc : ∫ x in Ι a b, |x - a| ^ n = |b - a| ^ (n + 1) / (n + 1) := by
   cases' le_or_lt a b with hab hab
   · calc
-      (∫ x in Ι a b, |x - a| ^ n) = ∫ x in a..b, |x - a| ^ n := by
+      ∫ x in Ι a b, |x - a| ^ n = ∫ x in a..b, |x - a| ^ n := by
         rw [uIoc_of_le hab, ← integral_of_le hab]
       _ = ∫ x in (0)..(b - a), x ^ n := by
         simp only [integral_comp_sub_right fun x => |x| ^ n, sub_self]
@@ -396,7 +396,7 @@ theorem integral_pow_abs_sub_uIoc : (∫ x in Ι a b, |x - a| ^ n) = |b - a| ^ (
         exact hx.1
       _ = |b - a| ^ (n + 1) / (n + 1) := by simp [abs_of_nonneg (sub_nonneg.2 hab)]
   · calc
-      (∫ x in Ι a b, |x - a| ^ n) = ∫ x in b..a, |x - a| ^ n := by
+      ∫ x in Ι a b, |x - a| ^ n = ∫ x in b..a, |x - a| ^ n := by
         rw [uIoc_of_lt hab, ← integral_of_le hab.le]
       _ = ∫ x in b - a..0, (-x) ^ n := by
         simp only [integral_comp_sub_right fun x => |x| ^ n, sub_self]
@@ -408,7 +408,7 @@ theorem integral_pow_abs_sub_uIoc : (∫ x in Ι a b, |x - a| ^ n) = |b - a| ^ (
 #align integral_pow_abs_sub_uIoc integral_pow_abs_sub_uIoc
 
 @[simp]
-theorem integral_id : (∫ x in a..b, x) = (b ^ 2 - a ^ 2) / 2 := by
+theorem integral_id : ∫ x in a..b, x = (b ^ 2 - a ^ 2) / 2 := by
   have := @integral_pow a b 1
   norm_num at this
   exact this
@@ -419,11 +419,11 @@ theorem integral_one : (∫ _ in a..b, (1 : ℝ)) = b - a := by
   simp only [mul_one, smul_eq_mul, integral_const]
 #align integral_one integral_one
 
-theorem integral_const_on_unit_interval : (∫ _ in a..a + 1, b) = b := by simp
+theorem integral_const_on_unit_interval : ∫ _ in a..a + 1, b = b := by simp
 #align integral_const_on_unit_interval integral_const_on_unit_interval
 
 @[simp]
-theorem integral_inv (h : (0 : ℝ) ∉ [[a, b]]) : (∫ x in a..b, x⁻¹) = log (b / a) := by
+theorem integral_inv (h : (0 : ℝ) ∉ [[a, b]]) : ∫ x in a..b, x⁻¹ = log (b / a) := by
   have h' := fun x (hx : x ∈ [[a, b]]) => ne_of_mem_of_not_mem hx h
   rw [integral_deriv_eq_sub' _ deriv_log' (fun x hx => differentiableAt_log (h' x hx))
       (continuousOn_inv₀.mono <| subset_compl_singleton_iff.mpr h),
@@ -431,29 +431,29 @@ theorem integral_inv (h : (0 : ℝ) ∉ [[a, b]]) : (∫ x in a..b, x⁻¹) = lo
 #align integral_inv integral_inv
 
 @[simp]
-theorem integral_inv_of_pos (ha : 0 < a) (hb : 0 < b) : (∫ x in a..b, x⁻¹) = log (b / a) :=
+theorem integral_inv_of_pos (ha : 0 < a) (hb : 0 < b) : ∫ x in a..b, x⁻¹ = log (b / a) :=
   integral_inv <| not_mem_uIcc_of_lt ha hb
 #align integral_inv_of_pos integral_inv_of_pos
 
 @[simp]
-theorem integral_inv_of_neg (ha : a < 0) (hb : b < 0) : (∫ x in a..b, x⁻¹) = log (b / a) :=
+theorem integral_inv_of_neg (ha : a < 0) (hb : b < 0) : ∫ x in a..b, x⁻¹ = log (b / a) :=
   integral_inv <| not_mem_uIcc_of_gt ha hb
 #align integral_inv_of_neg integral_inv_of_neg
 
-theorem integral_one_div (h : (0 : ℝ) ∉ [[a, b]]) : (∫ x : ℝ in a..b, 1 / x) = log (b / a) := by
+theorem integral_one_div (h : (0 : ℝ) ∉ [[a, b]]) : ∫ x : ℝ in a..b, 1 / x = log (b / a) := by
   simp only [one_div, integral_inv h]
 #align integral_one_div integral_one_div
 
 theorem integral_one_div_of_pos (ha : 0 < a) (hb : 0 < b) :
-    (∫ x : ℝ in a..b, 1 / x) = log (b / a) := by simp only [one_div, integral_inv_of_pos ha hb]
+    ∫ x : ℝ in a..b, 1 / x = log (b / a) := by simp only [one_div, integral_inv_of_pos ha hb]
 #align integral_one_div_of_pos integral_one_div_of_pos
 
 theorem integral_one_div_of_neg (ha : a < 0) (hb : b < 0) :
-    (∫ x : ℝ in a..b, 1 / x) = log (b / a) := by simp only [one_div, integral_inv_of_neg ha hb]
+    ∫ x : ℝ in a..b, 1 / x = log (b / a) := by simp only [one_div, integral_inv_of_neg ha hb]
 #align integral_one_div_of_neg integral_one_div_of_neg
 
 @[simp]
-theorem integral_exp : (∫ x in a..b, exp x) = exp b - exp a := by
+theorem integral_exp : ∫ x in a..b, exp x = exp b - exp a := by
   rw [integral_deriv_eq_sub']
   · norm_num
   · exact fun _ _ => differentiableAt_exp
@@ -475,7 +475,7 @@ theorem integral_exp_mul_complex {c : ℂ} (hc : c ≠ 0) :
 
 @[simp]
 theorem integral_log (h : (0 : ℝ) ∉ [[a, b]]) :
-    (∫ x in a..b, log x) = b * log b - a * log a - b + a := by
+    ∫ x in a..b, log x = b * log b - a * log a - b + a := by
   have h' := fun x (hx : x ∈ [[a, b]]) => ne_of_mem_of_not_mem hx h
   have heq := fun x hx => mul_inv_cancel (h' x hx)
   convert integral_mul_deriv_eq_deriv_mul (fun x hx => hasDerivAt_log (h' x hx))
@@ -487,18 +487,18 @@ theorem integral_log (h : (0 : ℝ) ∉ [[a, b]]) :
 
 @[simp]
 theorem integral_log_of_pos (ha : 0 < a) (hb : 0 < b) :
-    (∫ x in a..b, log x) = b * log b - a * log a - b + a :=
+    ∫ x in a..b, log x = b * log b - a * log a - b + a :=
   integral_log <| not_mem_uIcc_of_lt ha hb
 #align integral_log_of_pos integral_log_of_pos
 
 @[simp]
 theorem integral_log_of_neg (ha : a < 0) (hb : b < 0) :
-    (∫ x in a..b, log x) = b * log b - a * log a - b + a :=
+    ∫ x in a..b, log x = b * log b - a * log a - b + a :=
   integral_log <| not_mem_uIcc_of_gt ha hb
 #align integral_log_of_neg integral_log_of_neg
 
 @[simp]
-theorem integral_sin : (∫ x in a..b, sin x) = cos a - cos b := by
+theorem integral_sin : ∫ x in a..b, sin x = cos a - cos b := by
   rw [integral_deriv_eq_sub' fun x => -cos x]
   · ring
   · norm_num
@@ -507,7 +507,7 @@ theorem integral_sin : (∫ x in a..b, sin x) = cos a - cos b := by
 #align integral_sin integral_sin
 
 @[simp]
-theorem integral_cos : (∫ x in a..b, cos x) = sin b - sin a := by
+theorem integral_cos : ∫ x in a..b, cos x = sin b - sin a := by
   rw [integral_deriv_eq_sub']
   · norm_num
   · simp only [differentiableAt_sin, implies_true]
@@ -532,7 +532,7 @@ theorem integral_cos_mul_complex {z : ℂ} (hz : z ≠ 0) (a b : ℝ) :
 #align integral_cos_mul_complex integral_cos_mul_complex
 
 theorem integral_cos_sq_sub_sin_sq :
-    (∫ x in a..b, cos x ^ 2 - sin x ^ 2) = sin b * cos b - sin a * cos a := by
+    ∫ x in a..b, cos x ^ 2 - sin x ^ 2 = sin b * cos b - sin a * cos a := by
   simpa only [sq, sub_eq_add_neg, neg_mul_eq_mul_neg] using
     integral_deriv_mul_eq_sub (fun x _ => hasDerivAt_sin x) (fun x _ => hasDerivAt_cos x)
       continuousOn_cos.intervalIntegrable continuousOn_sin.neg.intervalIntegrable
@@ -659,7 +659,7 @@ theorem integral_sin_pow :
 #align integral_sin_pow integral_sin_pow
 
 @[simp]
-theorem integral_sin_sq : (∫ x in a..b, sin x ^ 2) = (sin a * cos a - sin b * cos b + b - a) / 2 :=
+theorem integral_sin_sq : ∫ x in a..b, sin x ^ 2 = (sin a * cos a - sin b * cos b + b - a) / 2 :=
   by field_simp [integral_sin_pow, add_sub_assoc]
 #align integral_sin_sq integral_sin_sq
 
@@ -740,7 +740,7 @@ theorem integral_cos_pow :
 #align integral_cos_pow integral_cos_pow
 
 @[simp]
-theorem integral_cos_sq : (∫ x in a..b, cos x ^ 2) = (cos b * sin b - cos a * sin a + b - a) / 2 :=
+theorem integral_cos_sq : ∫ x in a..b, cos x ^ 2 = (cos b * sin b - cos a * sin a + b - a) / 2 :=
   by field_simp [integral_cos_pow, add_sub_assoc]
 #align integral_cos_sq integral_cos_sq
 
@@ -765,20 +765,20 @@ theorem integral_sin_pow_mul_cos_pow_odd (m n : ℕ) :
 /-- The integral of `sin x * cos x`, given in terms of sin².
   See `integral_sin_mul_cos₂` below for the integral given in terms of cos². -/
 @[simp]
-theorem integral_sin_mul_cos₁ : (∫ x in a..b, sin x * cos x) = (sin b ^ 2 - sin a ^ 2) / 2 := by
+theorem integral_sin_mul_cos₁ : ∫ x in a..b, sin x * cos x = (sin b ^ 2 - sin a ^ 2) / 2 := by
   simpa using integral_sin_pow_mul_cos_pow_odd 1 0
 #align integral_sin_mul_cos₁ integral_sin_mul_cos₁
 
 @[simp]
 theorem integral_sin_sq_mul_cos :
-    (∫ x in a..b, sin x ^ 2 * cos x) = (sin b ^ 3 - sin a ^ 3) / 3 := by
+    ∫ x in a..b, sin x ^ 2 * cos x = (sin b ^ 3 - sin a ^ 3) / 3 := by
   have := @integral_sin_pow_mul_cos_pow_odd a b 2 0
   norm_num at this; exact this
 #align integral_sin_sq_mul_cos integral_sin_sq_mul_cos
 
 @[simp]
 theorem integral_cos_pow_three :
-    (∫ x in a..b, cos x ^ 3) = sin b - sin a - (sin b ^ 3 - sin a ^ 3) / 3 := by
+    ∫ x in a..b, cos x ^ 3 = sin b - sin a - (sin b ^ 3 - sin a ^ 3) / 3 := by
   have := @integral_sin_pow_mul_cos_pow_odd a b 0 1
   norm_num at this; exact this
 #align integral_cos_pow_three integral_cos_pow_three
@@ -804,20 +804,20 @@ theorem integral_sin_pow_odd_mul_cos_pow (m n : ℕ) :
 
 /-- The integral of `sin x * cos x`, given in terms of cos².
 See `integral_sin_mul_cos₁` above for the integral given in terms of sin². -/
-theorem integral_sin_mul_cos₂ : (∫ x in a..b, sin x * cos x) = (cos a ^ 2 - cos b ^ 2) / 2 := by
+theorem integral_sin_mul_cos₂ : ∫ x in a..b, sin x * cos x = (cos a ^ 2 - cos b ^ 2) / 2 := by
   simpa using integral_sin_pow_odd_mul_cos_pow 0 1
 #align integral_sin_mul_cos₂ integral_sin_mul_cos₂
 
 @[simp]
 theorem integral_sin_mul_cos_sq :
-    (∫ x in a..b, sin x * cos x ^ 2) = (cos a ^ 3 - cos b ^ 3) / 3 := by
+    ∫ x in a..b, sin x * cos x ^ 2 = (cos a ^ 3 - cos b ^ 3) / 3 := by
   have := @integral_sin_pow_odd_mul_cos_pow a b 0 2
   norm_num at this; exact this
 #align integral_sin_mul_cos_sq integral_sin_mul_cos_sq
 
 @[simp]
 theorem integral_sin_pow_three :
-    (∫ x in a..b, sin x ^ 3) = cos a - cos b - (cos a ^ 3 - cos b ^ 3) / 3 := by
+    ∫ x in a..b, sin x ^ 3 = cos a - cos b - (cos a ^ 3 - cos b ^ 3) / 3 := by
   have := @integral_sin_pow_odd_mul_cos_pow a b 1 0
   norm_num at this; exact this
 #align integral_sin_pow_three integral_sin_pow_three
@@ -831,7 +831,7 @@ theorem integral_sin_pow_even_mul_cos_pow_even (m n : ℕ) :
 
 @[simp]
 theorem integral_sin_sq_mul_cos_sq :
-    (∫ x in a..b, sin x ^ 2 * cos x ^ 2) = (b - a) / 8 - (sin (4 * b) - sin (4 * a)) / 32 := by
+    ∫ x in a..b, sin x ^ 2 * cos x ^ 2 = (b - a) / 8 - (sin (4 * b) - sin (4 * a)) / 32 := by
   convert integral_sin_pow_even_mul_cos_pow_even 1 1 using 1
   have h1 : ∀ c : ℝ, (↑1 - c) / ↑2 * ((↑1 + c) / ↑2) = (↑1 - c ^ 2) / 4 := fun c => by ring
   have h2 : Continuous fun x => cos (2 * x) ^ 2 := by continuity
chore: use ofReal instead of of_real in lemma names (#4934)
Diff
@@ -105,16 +105,16 @@ theorem intervalIntegrable_cpow {r : ℂ} (h : 0 ≤ r.re ∨ (0 : ℝ) ∉ [[a,
   by_cases h2 : (0 : ℝ) ∉ [[a, b]]
   · -- Easy case #1: 0 ∉ [a, b] -- use continuity.
     refine' (ContinuousAt.continuousOn fun x hx => _).intervalIntegrable
-    exact Complex.continuousAt_of_real_cpow_const _ _ (Or.inr <| ne_of_mem_of_not_mem hx h2)
+    exact Complex.continuousAt_ofReal_cpow_const _ _ (Or.inr <| ne_of_mem_of_not_mem hx h2)
   rw [eq_false h2, or_false_iff] at h
   rcases lt_or_eq_of_le h with (h' | h')
   · -- Easy case #2: 0 < re r -- again use continuity
-    exact (Complex.continuous_of_real_cpow_const h').intervalIntegrable _ _
+    exact (Complex.continuous_ofReal_cpow_const h').intervalIntegrable _ _
   -- Now the hard case: re r = 0 and 0 is in the interval.
   refine' (IntervalIntegrable.intervalIntegrable_norm_iff _).mp _
   · refine' (measurable_of_continuousOn_compl_singleton (0 : ℝ) _).aestronglyMeasurable
     exact ContinuousAt.continuousOn fun x hx =>
-      Complex.continuousAt_of_real_cpow_const x r (Or.inr hx)
+      Complex.continuousAt_ofReal_cpow_const x r (Or.inr hx)
   -- reduce to case of integral over `[0, c]`
   suffices : ∀ c : ℝ, IntervalIntegrable (fun x : ℝ => ‖(x:ℂ) ^ r‖) μ 0 c
   exact (this a).symm.trans (this b)
@@ -138,7 +138,7 @@ theorem intervalIntegrable_cpow {r : ℂ} (h : 0 ≤ r.re ∨ (0 : ℝ) ∉ [[a,
         isCompact_singleton
     · have : ∀ x : ℝ, x ∈ Ioo c 0 → ‖Complex.exp (↑π * Complex.I * r)‖ = ‖(x : ℂ) ^ r‖ := by
         intro x hx
-        rw [Complex.of_real_cpow_of_nonpos hx.2.le, norm_mul, ← Complex.ofReal_neg,
+        rw [Complex.ofReal_cpow_of_nonpos hx.2.le, norm_mul, ← Complex.ofReal_neg,
           Complex.norm_eq_abs (_ ^ _), Complex.abs_cpow_eq_rpow_re_of_pos (neg_pos.mpr hx.2), ← h',
           rpow_zero, one_mul]
       refine' IntegrableOn.congr_fun _ this measurableSet_Ioo
@@ -178,7 +178,7 @@ theorem intervalIntegrable_cpow' {r : ℂ} (h : -1 < r.re) :
     refine' m.congr_fun (fun x hx => _) measurableSet_Ioc
     dsimp only
     have : -x ≤ 0 := by linarith [hx.1]
-    rw [Complex.of_real_cpow_of_nonpos this, mul_comm]
+    rw [Complex.ofReal_cpow_of_nonpos this, mul_comm]
     simp
 #align interval_integral.interval_integrable_cpow' intervalIntegral.intervalIntegrable_cpow'
 
@@ -328,7 +328,7 @@ theorem integral_cpow {r : ℂ} (h : -1 < r.re ∨ r ≠ -1 ∧ (0 : ℝ) ∉ [[
   by_cases hab : (0 : ℝ) ∉ [[a, b]]
   · apply integral_eq_sub_of_hasDerivAt (fun x hx => ?_)
       (intervalIntegrable_cpow (r := r) <| Or.inr hab)
-    refine' hasDerivAt_of_real_cpow (ne_of_mem_of_not_mem hx hab) _
+    refine' hasDerivAt_ofReal_cpow (ne_of_mem_of_not_mem hx hab) _
     contrapose! hr; rwa [add_eq_zero_iff_eq_neg]
   replace h : -1 < r.re; · tauto
   suffices ∀ c : ℝ, (∫ x : ℝ in (0)..c, (x : ℂ) ^ r) =
@@ -338,9 +338,9 @@ theorem integral_cpow {r : ℂ} (h : -1 < r.re ∨ r ≠ -1 ∧ (0 : ℝ) ∉ [[
     ring
   intro c
   apply integral_eq_sub_of_hasDeriv_right
-  · refine' ((Complex.continuous_of_real_cpow_const _).div_const _).continuousOn
+  · refine' ((Complex.continuous_ofReal_cpow_const _).div_const _).continuousOn
     rwa [Complex.add_re, Complex.one_re, ← neg_lt_iff_pos_add]
-  · refine' fun x hx => (hasDerivAt_of_real_cpow _ _).hasDerivWithinAt
+  · refine' fun x hx => (hasDerivAt_ofReal_cpow _ _).hasDerivWithinAt
     · rcases le_total c 0 with (hc | hc)
       · rw [max_eq_left hc] at hx; exact hx.2.ne
       · rw [min_eq_left hc] at hx; exact hx.1.ne'
@@ -467,7 +467,7 @@ theorem integral_exp_mul_complex {c : ℂ} (hc : c ≠ 0) :
     conv => congr
     rw [← mul_div_cancel (Complex.exp (c * x)) hc]
     apply ((Complex.hasDerivAt_exp _).comp x _).div_const c
-    simpa only [mul_one] using ((hasDerivAt_id (x : ℂ)).const_mul _).comp_of_real
+    simpa only [mul_one] using ((hasDerivAt_id (x : ℂ)).const_mul _).comp_ofReal
   rw [integral_deriv_eq_sub' _ (funext fun x => (D x).deriv) fun x _ => (D x).differentiableAt]
   · ring
   · apply Continuous.continuousOn; continuity
@@ -524,7 +524,7 @@ theorem integral_cos_mul_complex {z : ℂ} (hz : z ≠ 0) (a b : ℝ) :
   have a := Complex.hasDerivAt_sin (↑x * z)
   have b : HasDerivAt (fun y => y * z : ℂ → ℂ) z ↑x := hasDerivAt_mul_const _
   have c : HasDerivAt (fun y : ℂ => Complex.sin (y * z)) _ ↑x := HasDerivAt.comp (𝕜 := ℂ) x a b
-  have d := HasDerivAt.comp_of_real (c.div_const z)
+  have d := HasDerivAt.comp_ofReal (c.div_const z)
   simp only [mul_comm] at d
   convert d using 1
   conv_rhs => arg 1; rw [mul_comm]
@@ -575,7 +575,7 @@ theorem integral_mul_cpow_one_add_sq {t : ℂ} (ht : t ≠ -1) :
         (Or.inl hz)).div_const (2 * (t + 1)) using 1
       field_simp
       ring
-    convert (HasDerivAt.comp (↑x) (g _) f).comp_of_real using 1
+    convert (HasDerivAt.comp (↑x) (g _) f).comp_ofReal using 1
     · simp
     · field_simp; ring
     · exact_mod_cast add_pos_of_pos_of_nonneg zero_lt_one (sq_nonneg x)
@@ -595,7 +595,7 @@ theorem integral_mul_rpow_one_add_sq {t : ℝ} (ht : t ≠ -1) :
   have : ∀ x s : ℝ, (((↑1 + x ^ 2) ^ s : ℝ) : ℂ) = (1 + (x : ℂ) ^ 2) ^ (s:ℂ) := by
     intro x s
     norm_cast
-    rw [of_real_cpow, ofReal_add, ofReal_pow, ofReal_one]
+    rw [ofReal_cpow, ofReal_add, ofReal_pow, ofReal_one]
     exact add_nonneg zero_le_one (sq_nonneg x)
   rw [← ofReal_inj]
   convert integral_mul_cpow_one_add_sq (_ : (t : ℂ) ≠ -1)
feat: port Analysis.SpecialFunctions.Integrals (#4860)

Co-authored-by: Jeremy Tan Jie Rui <reddeloostw@gmail.com>

Dependencies 12 + 1068

1069 files ported (98.9%)
483101 lines ported (98.9%)
Show graph

The unported dependencies are

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