analysis.special_functions.pow.derivMathlib.Analysis.SpecialFunctions.Pow.Deriv

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)

(last sync)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -816,7 +816,7 @@ theorem tendsto_one_plus_div_rpow_exp (t : ℝ) :
 /-- The function `(1 + t/x) ^ x` tends to `exp t` at `+∞` for naturals `x`. -/
 theorem tendsto_one_plus_div_pow_exp (t : ℝ) :
     Tendsto (fun x : ℕ => (1 + t / (x : ℝ)) ^ x) atTop (𝓝 (Real.exp t)) :=
-  ((tendsto_one_plus_div_rpow_exp t).comp tendsto_nat_cast_atTop_atTop).congr (by simp)
+  ((tendsto_one_plus_div_rpow_exp t).comp tendsto_natCast_atTop_atTop).congr (by simp)
 #align tendsto_one_plus_div_pow_exp tendsto_one_plus_div_pow_exp
 -/
 
Diff
@@ -6,7 +6,7 @@ Authors: Chris Hughes, Abhimanyu Pallavi Sudhir, Jean Lo, Calle Sönne, Sébasti
 -/
 import Analysis.SpecialFunctions.Pow.Continuity
 import Analysis.SpecialFunctions.Complex.LogDeriv
-import Analysis.Calculus.ExtendDeriv
+import Analysis.Calculus.FDeriv.Extend
 import Analysis.Calculus.Deriv.Prod
 import Analysis.SpecialFunctions.Log.Deriv
 import Analysis.SpecialFunctions.Trigonometric.Deriv
@@ -280,7 +280,7 @@ theorem hasDerivAt_ofReal_cpow {x : ℝ} (hx : x ≠ 0) {r : ℂ} (hr : r ≠ -1
   rcases lt_or_gt_of_ne hx.symm with (hx | hx)
   · -- easy case : `0 < x`
     convert (((hasDerivAt_id (x : ℂ)).cpow_const _).div_const (r + 1)).comp_ofReal
-    · rw [add_sub_cancel, id.def, mul_one, mul_comm, mul_div_cancel _ hr]
+    · rw [add_sub_cancel_right, id.def, mul_one, mul_comm, mul_div_cancel_right₀ _ hr]
     · rw [id.def, of_real_re]; exact Or.inl hx
   · -- harder case : `x < 0`
     have :
@@ -297,7 +297,7 @@ theorem hasDerivAt_ofReal_cpow {x : ℝ} (hx : x ≠ 0) {r : ℂ} (hr : r ≠ -1
         ((r + 1) * (-↑x) ^ r * NormedSpace.exp (↑π * I * r)) x
       by
       convert this.div_const (r + 1) using 1
-      conv_rhs => rw [mul_assoc, mul_comm, mul_div_cancel _ hr]
+      conv_rhs => rw [mul_assoc, mul_comm, mul_div_cancel_right₀ _ hr]
     rw [mul_add ((π : ℂ) * _), mul_one, NormedSpace.exp_add, exp_pi_mul_I,
       mul_comm (_ : ℂ) (-1 : ℂ), neg_one_mul]
     simp_rw [mul_neg, ← neg_mul, ← of_real_neg]
Diff
@@ -276,7 +276,7 @@ line, it is still real-differentiable, and the derivative is what one would form
 theorem hasDerivAt_ofReal_cpow {x : ℝ} (hx : x ≠ 0) {r : ℂ} (hr : r ≠ -1) :
     HasDerivAt (fun y : ℝ => (y : ℂ) ^ (r + 1) / (r + 1)) (x ^ r) x :=
   by
-  rw [Ne.def, ← add_eq_zero_iff_eq_neg, ← Ne.def] at hr 
+  rw [Ne.def, ← add_eq_zero_iff_eq_neg, ← Ne.def] at hr
   rcases lt_or_gt_of_ne hx.symm with (hx | hx)
   · -- easy case : `0 < x`
     convert (((hasDerivAt_id (x : ℂ)).cpow_const _).div_const (r + 1)).comp_ofReal
@@ -484,7 +484,7 @@ theorem contDiff_rpow_const_of_le {p : ℝ} {n : ℕ} (h : ↑n ≤ p) : ContDif
   induction' n with n ihn generalizing p
   · exact contDiff_zero.2 (continuous_id.rpow_const fun x => by exact_mod_cast Or.inr h)
   · have h1 : 1 ≤ p := le_trans (by simp) h
-    rw [Nat.cast_succ, ← le_sub_iff_add_le] at h 
+    rw [Nat.cast_succ, ← le_sub_iff_add_le] at h
     rw [contDiff_succ_iff_deriv, deriv_rpow_const' h1]
     refine' ⟨differentiable_rpow_const h1, cont_diff_const.mul (ihn h)⟩
 #align real.cont_diff_rpow_const_of_le Real.contDiff_rpow_const_of_le
Diff
@@ -39,7 +39,7 @@ theorem hasStrictFDerivAt_cpow {p : ℂ × ℂ} (hp : 0 < p.1.re ∨ p.1.im ≠
       p :=
   by
   have A : p.1 ≠ 0 := by intro h; simpa [h, lt_irrefl] using hp
-  have : (fun x : ℂ × ℂ => x.1 ^ x.2) =ᶠ[𝓝 p] fun x => exp (log x.1 * x.2) :=
+  have : (fun x : ℂ × ℂ => x.1 ^ x.2) =ᶠ[𝓝 p] fun x => NormedSpace.exp (log x.1 * x.2) :=
     ((is_open_ne.preimage continuous_fst).eventually_mem A).mono fun p hp =>
       cpow_def_of_ne_zero hp _
   rw [cpow_sub _ _ A, cpow_one, mul_div_left_comm, mul_smul, mul_smul, ← smul_add]
@@ -285,20 +285,21 @@ theorem hasDerivAt_ofReal_cpow {x : ℝ} (hx : x ≠ 0) {r : ℂ} (hr : r ≠ -1
   · -- harder case : `x < 0`
     have :
       ∀ᶠ y : ℝ in nhds x,
-        (y : ℂ) ^ (r + 1) / (r + 1) = (-y : ℂ) ^ (r + 1) * exp (π * I * (r + 1)) / (r + 1) :=
+        (y : ℂ) ^ (r + 1) / (r + 1) =
+          (-y : ℂ) ^ (r + 1) * NormedSpace.exp (π * I * (r + 1)) / (r + 1) :=
       by
       refine' Filter.eventually_of_mem (Iio_mem_nhds hx) fun y hy => _
       rw [of_real_cpow_of_nonpos (le_of_lt hy)]
     refine' HasDerivAt.congr_of_eventuallyEq _ this
     rw [of_real_cpow_of_nonpos (le_of_lt hx)]
     suffices
-      HasDerivAt (fun y : ℝ => (-↑y) ^ (r + 1) * exp (↑π * I * (r + 1)))
-        ((r + 1) * (-↑x) ^ r * exp (↑π * I * r)) x
+      HasDerivAt (fun y : ℝ => (-↑y) ^ (r + 1) * NormedSpace.exp (↑π * I * (r + 1)))
+        ((r + 1) * (-↑x) ^ r * NormedSpace.exp (↑π * I * r)) x
       by
       convert this.div_const (r + 1) using 1
       conv_rhs => rw [mul_assoc, mul_comm, mul_div_cancel _ hr]
-    rw [mul_add ((π : ℂ) * _), mul_one, exp_add, exp_pi_mul_I, mul_comm (_ : ℂ) (-1 : ℂ),
-      neg_one_mul]
+    rw [mul_add ((π : ℂ) * _), mul_one, NormedSpace.exp_add, exp_pi_mul_I,
+      mul_comm (_ : ℂ) (-1 : ℂ), neg_one_mul]
     simp_rw [mul_neg, ← neg_mul, ← of_real_neg]
     suffices HasDerivAt (fun y : ℝ => ↑(-y) ^ (r + 1)) (-(r + 1) * ↑(-x) ^ r) x by
       convert this.neg.mul_const _; ring
@@ -329,7 +330,7 @@ theorem hasStrictFDerivAt_rpow_of_pos (p : ℝ × ℝ) (hp : 0 < p.1) :
         (p.1 ^ p.2 * log p.1) • ContinuousLinearMap.snd ℝ ℝ ℝ)
       p :=
   by
-  have : (fun x : ℝ × ℝ => x.1 ^ x.2) =ᶠ[𝓝 p] fun x => exp (log x.1 * x.2) :=
+  have : (fun x : ℝ × ℝ => x.1 ^ x.2) =ᶠ[𝓝 p] fun x => NormedSpace.exp (log x.1 * x.2) :=
     (continuous_at_fst.eventually (lt_mem_nhds hp)).mono fun p hp => rpow_def_of_pos hp _
   refine' HasStrictFDerivAt.congr_of_eventuallyEq _ this.symm
   convert ((has_strict_fderiv_at_fst.log hp.ne').mul hasStrictFDerivAt_snd).exp
@@ -347,7 +348,8 @@ theorem hasStrictFDerivAt_rpow_of_neg (p : ℝ × ℝ) (hp : p.1 < 0) :
           ContinuousLinearMap.snd ℝ ℝ ℝ)
       p :=
   by
-  have : (fun x : ℝ × ℝ => x.1 ^ x.2) =ᶠ[𝓝 p] fun x => exp (log x.1 * x.2) * cos (x.2 * π) :=
+  have :
+    (fun x : ℝ × ℝ => x.1 ^ x.2) =ᶠ[𝓝 p] fun x => NormedSpace.exp (log x.1 * x.2) * cos (x.2 * π) :=
     (continuous_at_fst.eventually (gt_mem_nhds hp)).mono fun p hp => rpow_def_of_neg hp _
   refine' HasStrictFDerivAt.congr_of_eventuallyEq _ this.symm
   convert
Diff
@@ -4,12 +4,12 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Chris Hughes, Abhimanyu Pallavi Sudhir, Jean Lo, Calle Sönne, Sébastien Gouëzel,
   Rémy Degenne
 -/
-import Mathbin.Analysis.SpecialFunctions.Pow.Continuity
-import Mathbin.Analysis.SpecialFunctions.Complex.LogDeriv
-import Mathbin.Analysis.Calculus.ExtendDeriv
-import Mathbin.Analysis.Calculus.Deriv.Prod
-import Mathbin.Analysis.SpecialFunctions.Log.Deriv
-import Mathbin.Analysis.SpecialFunctions.Trigonometric.Deriv
+import Analysis.SpecialFunctions.Pow.Continuity
+import Analysis.SpecialFunctions.Complex.LogDeriv
+import Analysis.Calculus.ExtendDeriv
+import Analysis.Calculus.Deriv.Prod
+import Analysis.SpecialFunctions.Log.Deriv
+import Analysis.SpecialFunctions.Trigonometric.Deriv
 
 #align_import analysis.special_functions.pow.deriv from "leanprover-community/mathlib"@"c20927220ef87bb4962ba08bf6da2ce3cf50a6dd"
 
Diff
@@ -3,11 +3,6 @@ Copyright (c) 2018 Chris Hughes. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Chris Hughes, Abhimanyu Pallavi Sudhir, Jean Lo, Calle Sönne, Sébastien Gouëzel,
   Rémy Degenne
-
-! This file was ported from Lean 3 source module analysis.special_functions.pow.deriv
-! leanprover-community/mathlib commit c20927220ef87bb4962ba08bf6da2ce3cf50a6dd
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.Analysis.SpecialFunctions.Pow.Continuity
 import Mathbin.Analysis.SpecialFunctions.Complex.LogDeriv
@@ -16,6 +11,8 @@ import Mathbin.Analysis.Calculus.Deriv.Prod
 import Mathbin.Analysis.SpecialFunctions.Log.Deriv
 import Mathbin.Analysis.SpecialFunctions.Trigonometric.Deriv
 
+#align_import analysis.special_functions.pow.deriv from "leanprover-community/mathlib"@"c20927220ef87bb4962ba08bf6da2ce3cf50a6dd"
+
 /-!
 # Derivatives of power function on `ℂ`, `ℝ`, `ℝ≥0`, and `ℝ≥0∞`
 
Diff
@@ -34,6 +34,7 @@ open Filter
 
 namespace Complex
 
+#print Complex.hasStrictFDerivAt_cpow /-
 theorem hasStrictFDerivAt_cpow {p : ℂ × ℂ} (hp : 0 < p.1.re ∨ p.1.im ≠ 0) :
     HasStrictFDerivAt (fun x : ℂ × ℂ => x.1 ^ x.2)
       ((p.2 * p.1 ^ (p.2 - 1)) • ContinuousLinearMap.fst ℂ ℂ ℂ +
@@ -49,7 +50,9 @@ theorem hasStrictFDerivAt_cpow {p : ℂ × ℂ} (hp : 0 < p.1.re ∨ p.1.im ≠
   simpa only [cpow_def_of_ne_zero A, div_eq_mul_inv, mul_smul, add_comm] using
     ((has_strict_fderiv_at_fst.clog hp).mul hasStrictFDerivAt_snd).cexp
 #align complex.has_strict_fderiv_at_cpow Complex.hasStrictFDerivAt_cpow
+-/
 
+#print Complex.hasStrictFDerivAt_cpow' /-
 theorem hasStrictFDerivAt_cpow' {x y : ℂ} (hp : 0 < x.re ∨ x.im ≠ 0) :
     HasStrictFDerivAt (fun x : ℂ × ℂ => x.1 ^ x.2)
       ((y * x ^ (y - 1)) • ContinuousLinearMap.fst ℂ ℂ ℂ +
@@ -57,7 +60,9 @@ theorem hasStrictFDerivAt_cpow' {x y : ℂ} (hp : 0 < x.re ∨ x.im ≠ 0) :
       (x, y) :=
   @hasStrictFDerivAt_cpow (x, y) hp
 #align complex.has_strict_fderiv_at_cpow' Complex.hasStrictFDerivAt_cpow'
+-/
 
+#print Complex.hasStrictDerivAt_const_cpow /-
 theorem hasStrictDerivAt_const_cpow {x y : ℂ} (h : x ≠ 0 ∨ y ≠ 0) :
     HasStrictDerivAt (fun y => x ^ y) (x ^ y * log x) y :=
   by
@@ -70,7 +75,9 @@ theorem hasStrictDerivAt_const_cpow {x y : ℂ} (h : x ≠ 0 ∨ y ≠ 0) :
     simpa only [cpow_def_of_ne_zero hx, mul_one] using
       ((hasStrictDerivAt_id y).const_mul (log x)).cexp
 #align complex.has_strict_deriv_at_const_cpow Complex.hasStrictDerivAt_const_cpow
+-/
 
+#print Complex.hasFDerivAt_cpow /-
 theorem hasFDerivAt_cpow {p : ℂ × ℂ} (hp : 0 < p.1.re ∨ p.1.im ≠ 0) :
     HasFDerivAt (fun x : ℂ × ℂ => x.1 ^ x.2)
       ((p.2 * p.1 ^ (p.2 - 1)) • ContinuousLinearMap.fst ℂ ℂ ℂ +
@@ -78,6 +85,7 @@ theorem hasFDerivAt_cpow {p : ℂ × ℂ} (hp : 0 < p.1.re ∨ p.1.im ≠ 0) :
       p :=
   (hasStrictFDerivAt_cpow hp).HasFDerivAt
 #align complex.has_fderiv_at_cpow Complex.hasFDerivAt_cpow
+-/
 
 end Complex
 
@@ -88,30 +96,39 @@ open Complex
 variable {E : Type _} [NormedAddCommGroup E] [NormedSpace ℂ E] {f g : E → ℂ} {f' g' : E →L[ℂ] ℂ}
   {x : E} {s : Set E} {c : ℂ}
 
+#print HasStrictFDerivAt.cpow /-
 theorem HasStrictFDerivAt.cpow (hf : HasStrictFDerivAt f f' x) (hg : HasStrictFDerivAt g g' x)
     (h0 : 0 < (f x).re ∨ (f x).im ≠ 0) :
     HasStrictFDerivAt (fun x => f x ^ g x)
       ((g x * f x ^ (g x - 1)) • f' + (f x ^ g x * log (f x)) • g') x :=
   by convert (@has_strict_fderiv_at_cpow ((fun x => (f x, g x)) x) h0).comp x (hf.prod hg)
 #align has_strict_fderiv_at.cpow HasStrictFDerivAt.cpow
+-/
 
+#print HasStrictFDerivAt.const_cpow /-
 theorem HasStrictFDerivAt.const_cpow (hf : HasStrictFDerivAt f f' x) (h0 : c ≠ 0 ∨ f x ≠ 0) :
     HasStrictFDerivAt (fun x => c ^ f x) ((c ^ f x * log c) • f') x :=
   (hasStrictDerivAt_const_cpow h0).comp_hasStrictFDerivAt x hf
 #align has_strict_fderiv_at.const_cpow HasStrictFDerivAt.const_cpow
+-/
 
+#print HasFDerivAt.cpow /-
 theorem HasFDerivAt.cpow (hf : HasFDerivAt f f' x) (hg : HasFDerivAt g g' x)
     (h0 : 0 < (f x).re ∨ (f x).im ≠ 0) :
     HasFDerivAt (fun x => f x ^ g x) ((g x * f x ^ (g x - 1)) • f' + (f x ^ g x * log (f x)) • g')
       x :=
   by convert (@Complex.hasFDerivAt_cpow ((fun x => (f x, g x)) x) h0).comp x (hf.prod hg)
 #align has_fderiv_at.cpow HasFDerivAt.cpow
+-/
 
+#print HasFDerivAt.const_cpow /-
 theorem HasFDerivAt.const_cpow (hf : HasFDerivAt f f' x) (h0 : c ≠ 0 ∨ f x ≠ 0) :
     HasFDerivAt (fun x => c ^ f x) ((c ^ f x * log c) • f') x :=
   (hasStrictDerivAt_const_cpow h0).HasDerivAt.comp_hasFDerivAt x hf
 #align has_fderiv_at.const_cpow HasFDerivAt.const_cpow
+-/
 
+#print HasFDerivWithinAt.cpow /-
 theorem HasFDerivWithinAt.cpow (hf : HasFDerivWithinAt f f' s x) (hg : HasFDerivWithinAt g g' s x)
     (h0 : 0 < (f x).re ∨ (f x).im ≠ 0) :
     HasFDerivWithinAt (fun x => f x ^ g x)
@@ -120,32 +137,43 @@ theorem HasFDerivWithinAt.cpow (hf : HasFDerivWithinAt f f' s x) (hg : HasFDeriv
   convert
     (@Complex.hasFDerivAt_cpow ((fun x => (f x, g x)) x) h0).comp_hasFDerivWithinAt x (hf.prod hg)
 #align has_fderiv_within_at.cpow HasFDerivWithinAt.cpow
+-/
 
+#print HasFDerivWithinAt.const_cpow /-
 theorem HasFDerivWithinAt.const_cpow (hf : HasFDerivWithinAt f f' s x) (h0 : c ≠ 0 ∨ f x ≠ 0) :
     HasFDerivWithinAt (fun x => c ^ f x) ((c ^ f x * log c) • f') s x :=
   (hasStrictDerivAt_const_cpow h0).HasDerivAt.comp_hasFDerivWithinAt x hf
 #align has_fderiv_within_at.const_cpow HasFDerivWithinAt.const_cpow
+-/
 
+#print DifferentiableAt.cpow /-
 theorem DifferentiableAt.cpow (hf : DifferentiableAt ℂ f x) (hg : DifferentiableAt ℂ g x)
     (h0 : 0 < (f x).re ∨ (f x).im ≠ 0) : DifferentiableAt ℂ (fun x => f x ^ g x) x :=
   (hf.HasFDerivAt.cpow hg.HasFDerivAt h0).DifferentiableAt
 #align differentiable_at.cpow DifferentiableAt.cpow
+-/
 
+#print DifferentiableAt.const_cpow /-
 theorem DifferentiableAt.const_cpow (hf : DifferentiableAt ℂ f x) (h0 : c ≠ 0 ∨ f x ≠ 0) :
     DifferentiableAt ℂ (fun x => c ^ f x) x :=
   (hf.HasFDerivAt.const_cpow h0).DifferentiableAt
 #align differentiable_at.const_cpow DifferentiableAt.const_cpow
+-/
 
+#print DifferentiableWithinAt.cpow /-
 theorem DifferentiableWithinAt.cpow (hf : DifferentiableWithinAt ℂ f s x)
     (hg : DifferentiableWithinAt ℂ g s x) (h0 : 0 < (f x).re ∨ (f x).im ≠ 0) :
     DifferentiableWithinAt ℂ (fun x => f x ^ g x) s x :=
   (hf.HasFDerivWithinAt.cpow hg.HasFDerivWithinAt h0).DifferentiableWithinAt
 #align differentiable_within_at.cpow DifferentiableWithinAt.cpow
+-/
 
+#print DifferentiableWithinAt.const_cpow /-
 theorem DifferentiableWithinAt.const_cpow (hf : DifferentiableWithinAt ℂ f s x)
     (h0 : c ≠ 0 ∨ f x ≠ 0) : DifferentiableWithinAt ℂ (fun x => c ^ f x) s x :=
   (hf.HasFDerivWithinAt.const_cpow h0).DifferentiableWithinAt
 #align differentiable_within_at.const_cpow DifferentiableWithinAt.const_cpow
+-/
 
 end fderiv
 
@@ -167,64 +195,85 @@ private theorem aux :
     ContinuousLinearMap.smulRight_apply, ContinuousLinearMap.add_apply, Pi.smul_apply,
     ContinuousLinearMap.coe_smul']
 
+#print HasStrictDerivAt.cpow /-
 theorem HasStrictDerivAt.cpow (hf : HasStrictDerivAt f f' x) (hg : HasStrictDerivAt g g' x)
     (h0 : 0 < (f x).re ∨ (f x).im ≠ 0) :
     HasStrictDerivAt (fun x => f x ^ g x) (g x * f x ^ (g x - 1) * f' + f x ^ g x * log (f x) * g')
       x :=
   by simpa only [aux] using (hf.cpow hg h0).HasStrictDerivAt
 #align has_strict_deriv_at.cpow HasStrictDerivAt.cpow
+-/
 
+#print HasStrictDerivAt.const_cpow /-
 theorem HasStrictDerivAt.const_cpow (hf : HasStrictDerivAt f f' x) (h : c ≠ 0 ∨ f x ≠ 0) :
     HasStrictDerivAt (fun x => c ^ f x) (c ^ f x * log c * f') x :=
   (hasStrictDerivAt_const_cpow h).comp x hf
 #align has_strict_deriv_at.const_cpow HasStrictDerivAt.const_cpow
+-/
 
+#print Complex.hasStrictDerivAt_cpow_const /-
 theorem Complex.hasStrictDerivAt_cpow_const (h : 0 < x.re ∨ x.im ≠ 0) :
     HasStrictDerivAt (fun z : ℂ => z ^ c) (c * x ^ (c - 1)) x := by
   simpa only [MulZeroClass.mul_zero, add_zero, mul_one] using
     (hasStrictDerivAt_id x).cpow (hasStrictDerivAt_const x c) h
 #align complex.has_strict_deriv_at_cpow_const Complex.hasStrictDerivAt_cpow_const
+-/
 
+#print HasStrictDerivAt.cpow_const /-
 theorem HasStrictDerivAt.cpow_const (hf : HasStrictDerivAt f f' x)
     (h0 : 0 < (f x).re ∨ (f x).im ≠ 0) :
     HasStrictDerivAt (fun x => f x ^ c) (c * f x ^ (c - 1) * f') x :=
   (Complex.hasStrictDerivAt_cpow_const h0).comp x hf
 #align has_strict_deriv_at.cpow_const HasStrictDerivAt.cpow_const
+-/
 
+#print HasDerivAt.cpow /-
 theorem HasDerivAt.cpow (hf : HasDerivAt f f' x) (hg : HasDerivAt g g' x)
     (h0 : 0 < (f x).re ∨ (f x).im ≠ 0) :
     HasDerivAt (fun x => f x ^ g x) (g x * f x ^ (g x - 1) * f' + f x ^ g x * log (f x) * g') x :=
   by simpa only [aux] using (hf.has_fderiv_at.cpow hg h0).HasDerivAt
 #align has_deriv_at.cpow HasDerivAt.cpow
+-/
 
+#print HasDerivAt.const_cpow /-
 theorem HasDerivAt.const_cpow (hf : HasDerivAt f f' x) (h0 : c ≠ 0 ∨ f x ≠ 0) :
     HasDerivAt (fun x => c ^ f x) (c ^ f x * log c * f') x :=
   (hasStrictDerivAt_const_cpow h0).HasDerivAt.comp x hf
 #align has_deriv_at.const_cpow HasDerivAt.const_cpow
+-/
 
+#print HasDerivAt.cpow_const /-
 theorem HasDerivAt.cpow_const (hf : HasDerivAt f f' x) (h0 : 0 < (f x).re ∨ (f x).im ≠ 0) :
     HasDerivAt (fun x => f x ^ c) (c * f x ^ (c - 1) * f') x :=
   (Complex.hasStrictDerivAt_cpow_const h0).HasDerivAt.comp x hf
 #align has_deriv_at.cpow_const HasDerivAt.cpow_const
+-/
 
+#print HasDerivWithinAt.cpow /-
 theorem HasDerivWithinAt.cpow (hf : HasDerivWithinAt f f' s x) (hg : HasDerivWithinAt g g' s x)
     (h0 : 0 < (f x).re ∨ (f x).im ≠ 0) :
     HasDerivWithinAt (fun x => f x ^ g x) (g x * f x ^ (g x - 1) * f' + f x ^ g x * log (f x) * g')
       s x :=
   by simpa only [aux] using (hf.has_fderiv_within_at.cpow hg h0).HasDerivWithinAt
 #align has_deriv_within_at.cpow HasDerivWithinAt.cpow
+-/
 
+#print HasDerivWithinAt.const_cpow /-
 theorem HasDerivWithinAt.const_cpow (hf : HasDerivWithinAt f f' s x) (h0 : c ≠ 0 ∨ f x ≠ 0) :
     HasDerivWithinAt (fun x => c ^ f x) (c ^ f x * log c * f') s x :=
   (hasStrictDerivAt_const_cpow h0).HasDerivAt.comp_hasDerivWithinAt x hf
 #align has_deriv_within_at.const_cpow HasDerivWithinAt.const_cpow
+-/
 
+#print HasDerivWithinAt.cpow_const /-
 theorem HasDerivWithinAt.cpow_const (hf : HasDerivWithinAt f f' s x)
     (h0 : 0 < (f x).re ∨ (f x).im ≠ 0) :
     HasDerivWithinAt (fun x => f x ^ c) (c * f x ^ (c - 1) * f') s x :=
   (Complex.hasStrictDerivAt_cpow_const h0).HasDerivAt.comp_hasDerivWithinAt x hf
 #align has_deriv_within_at.cpow_const HasDerivWithinAt.cpow_const
+-/
 
+#print hasDerivAt_ofReal_cpow /-
 /-- Although `λ x, x ^ r` for fixed `r` is *not* complex-differentiable along the negative real
 line, it is still real-differentiable, and the derivative is what one would formally expect. -/
 theorem hasDerivAt_ofReal_cpow {x : ℝ} (hx : x ≠ 0) {r : ℂ} (hr : r ≠ -1) :
@@ -267,6 +316,7 @@ theorem hasDerivAt_ofReal_cpow {x : ℝ} (hx : x ≠ 0) {r : ℂ} (hr : r ≠ -1
     · simp
     · left; rwa [id.def, of_real_re, neg_pos]
 #align has_deriv_at_of_real_cpow hasDerivAt_ofReal_cpow
+-/
 
 end deriv
 
@@ -274,6 +324,7 @@ namespace Real
 
 variable {x y z : ℝ}
 
+#print Real.hasStrictFDerivAt_rpow_of_pos /-
 /-- `(x, y) ↦ x ^ y` is strictly differentiable at `p : ℝ × ℝ` such that `0 < p.fst`. -/
 theorem hasStrictFDerivAt_rpow_of_pos (p : ℝ × ℝ) (hp : 0 < p.1) :
     HasStrictFDerivAt (fun x : ℝ × ℝ => x.1 ^ x.2)
@@ -288,7 +339,9 @@ theorem hasStrictFDerivAt_rpow_of_pos (p : ℝ × ℝ) (hp : 0 < p.1) :
   rw [rpow_sub_one hp.ne', ← rpow_def_of_pos hp, smul_add, smul_smul, mul_div_left_comm,
     div_eq_mul_inv, smul_smul, smul_smul, mul_assoc, add_comm]
 #align real.has_strict_fderiv_at_rpow_of_pos Real.hasStrictFDerivAt_rpow_of_pos
+-/
 
+#print Real.hasStrictFDerivAt_rpow_of_neg /-
 /-- `(x, y) ↦ x ^ y` is strictly differentiable at `p : ℝ × ℝ` such that `p.fst < 0`. -/
 theorem hasStrictFDerivAt_rpow_of_neg (p : ℝ × ℝ) (hp : p.1 < 0) :
     HasStrictFDerivAt (fun x : ℝ × ℝ => x.1 ^ x.2)
@@ -308,7 +361,9 @@ theorem hasStrictFDerivAt_rpow_of_neg (p : ℝ × ℝ) (hp : p.1 < 0) :
     mul_comm (cos _), ← rpow_def_of_neg hp]
   rw [div_eq_mul_inv, add_comm]; congr 2 <;> ring
 #align real.has_strict_fderiv_at_rpow_of_neg Real.hasStrictFDerivAt_rpow_of_neg
+-/
 
+#print Real.contDiffAt_rpow_of_ne /-
 /-- The function `λ (x, y), x ^ y` is infinitely smooth at `(x, y)` unless `x = 0`. -/
 theorem contDiffAt_rpow_of_ne (p : ℝ × ℝ) (hp : p.1 ≠ 0) {n : ℕ∞} :
     ContDiffAt ℝ n (fun p : ℝ × ℝ => p.1 ^ p.2) p :=
@@ -321,12 +376,16 @@ theorem contDiffAt_rpow_of_ne (p : ℝ × ℝ) (hp : p.1 ≠ 0) {n : ℕ∞} :
     ((cont_diff_at_fst.log hpos.ne').mul contDiffAt_snd).exp.congr_of_eventuallyEq
       ((continuous_at_fst.eventually (lt_mem_nhds hpos)).mono fun p hp => rpow_def_of_pos hp _)]
 #align real.cont_diff_at_rpow_of_ne Real.contDiffAt_rpow_of_ne
+-/
 
+#print Real.differentiableAt_rpow_of_ne /-
 theorem differentiableAt_rpow_of_ne (p : ℝ × ℝ) (hp : p.1 ≠ 0) :
     DifferentiableAt ℝ (fun p : ℝ × ℝ => p.1 ^ p.2) p :=
   (contDiffAt_rpow_of_ne p hp).DifferentiableAt le_rfl
 #align real.differentiable_at_rpow_of_ne Real.differentiableAt_rpow_of_ne
+-/
 
+#print HasStrictDerivAt.rpow /-
 theorem HasStrictDerivAt.rpow {f g : ℝ → ℝ} {f' g' : ℝ} (hf : HasStrictDerivAt f f' x)
     (hg : HasStrictDerivAt g g' x) (h : 0 < f x) :
     HasStrictDerivAt (fun x => f x ^ g x) (f' * g x * f x ^ (g x - 1) + g' * f x ^ g x * log (f x))
@@ -338,7 +397,9 @@ theorem HasStrictDerivAt.rpow {f g : ℝ → ℝ} {f' g' : ℝ} (hf : HasStrictD
     1
   simp [mul_assoc, mul_comm, mul_left_comm]
 #align has_strict_deriv_at.rpow HasStrictDerivAt.rpow
+-/
 
+#print Real.hasStrictDerivAt_rpow_const_of_ne /-
 theorem hasStrictDerivAt_rpow_const_of_ne {x : ℝ} (hx : x ≠ 0) (p : ℝ) :
     HasStrictDerivAt (fun x => x ^ p) (p * x ^ (p - 1)) x :=
   by
@@ -349,12 +410,16 @@ theorem hasStrictDerivAt_rpow_const_of_ne {x : ℝ} (hx : x ≠ 0) (p : ℝ) :
     convert this; simp
   · simpa using (hasStrictDerivAt_id x).rpow (hasStrictDerivAt_const x p) hx
 #align real.has_strict_deriv_at_rpow_const_of_ne Real.hasStrictDerivAt_rpow_const_of_ne
+-/
 
+#print Real.hasStrictDerivAt_const_rpow /-
 theorem hasStrictDerivAt_const_rpow {a : ℝ} (ha : 0 < a) (x : ℝ) :
     HasStrictDerivAt (fun x => a ^ x) (a ^ x * log a) x := by
   simpa using (hasStrictDerivAt_const _ _).rpow (hasStrictDerivAt_id x) ha
 #align real.has_strict_deriv_at_const_rpow Real.hasStrictDerivAt_const_rpow
+-/
 
+#print Real.hasStrictDerivAt_const_rpow_of_neg /-
 /-- This lemma says that `λ x, a ^ x` is strictly differentiable for `a < 0`. Note that these
 values of `a` are outside of the "official" domain of `a ^ x`, and we may redefine `a ^ x`
 for negative `a` if some other definition will be more convenient. -/
@@ -364,6 +429,7 @@ theorem hasStrictDerivAt_const_rpow_of_neg {a x : ℝ} (ha : a < 0) :
     (has_strict_fderiv_at_rpow_of_neg (a, x) ha).comp_hasStrictDerivAt x
       ((hasStrictDerivAt_const _ _).Prod (hasStrictDerivAt_id _))
 #align real.has_strict_deriv_at_const_rpow_of_neg Real.hasStrictDerivAt_const_rpow_of_neg
+-/
 
 end Real
 
@@ -371,6 +437,7 @@ namespace Real
 
 variable {z x y : ℝ}
 
+#print Real.hasDerivAt_rpow_const /-
 theorem hasDerivAt_rpow_const {x p : ℝ} (h : x ≠ 0 ∨ 1 ≤ p) :
     HasDerivAt (fun x => x ^ p) (p * x ^ (p - 1)) x :=
   by
@@ -383,26 +450,36 @@ theorem hasDerivAt_rpow_const {x p : ℝ} (h : x ≠ 0 ∨ 1 ≤ p) :
   exacts [continuous_at_id.rpow_const (Or.inr (zero_le_one.trans h)),
     continuous_at_const.mul (continuous_at_id.rpow_const (Or.inr (sub_nonneg.2 h)))]
 #align real.has_deriv_at_rpow_const Real.hasDerivAt_rpow_const
+-/
 
+#print Real.differentiable_rpow_const /-
 theorem differentiable_rpow_const {p : ℝ} (hp : 1 ≤ p) : Differentiable ℝ fun x : ℝ => x ^ p :=
   fun x => (hasDerivAt_rpow_const (Or.inr hp)).DifferentiableAt
 #align real.differentiable_rpow_const Real.differentiable_rpow_const
+-/
 
+#print Real.deriv_rpow_const /-
 theorem deriv_rpow_const {x p : ℝ} (h : x ≠ 0 ∨ 1 ≤ p) :
     deriv (fun x : ℝ => x ^ p) x = p * x ^ (p - 1) :=
   (hasDerivAt_rpow_const h).deriv
 #align real.deriv_rpow_const Real.deriv_rpow_const
+-/
 
+#print Real.deriv_rpow_const' /-
 theorem deriv_rpow_const' {p : ℝ} (h : 1 ≤ p) :
     (deriv fun x : ℝ => x ^ p) = fun x => p * x ^ (p - 1) :=
   funext fun x => deriv_rpow_const (Or.inr h)
 #align real.deriv_rpow_const' Real.deriv_rpow_const'
+-/
 
+#print Real.contDiffAt_rpow_const_of_ne /-
 theorem contDiffAt_rpow_const_of_ne {x p : ℝ} {n : ℕ∞} (h : x ≠ 0) :
     ContDiffAt ℝ n (fun x => x ^ p) x :=
   (contDiffAt_rpow_of_ne (x, p) h).comp x (contDiffAt_id.Prod contDiffAt_const)
 #align real.cont_diff_at_rpow_const_of_ne Real.contDiffAt_rpow_const_of_ne
+-/
 
+#print Real.contDiff_rpow_const_of_le /-
 theorem contDiff_rpow_const_of_le {p : ℝ} {n : ℕ} (h : ↑n ≤ p) : ContDiff ℝ n fun x : ℝ => x ^ p :=
   by
   induction' n with n ihn generalizing p
@@ -412,22 +489,29 @@ theorem contDiff_rpow_const_of_le {p : ℝ} {n : ℕ} (h : ↑n ≤ p) : ContDif
     rw [contDiff_succ_iff_deriv, deriv_rpow_const' h1]
     refine' ⟨differentiable_rpow_const h1, cont_diff_const.mul (ihn h)⟩
 #align real.cont_diff_rpow_const_of_le Real.contDiff_rpow_const_of_le
+-/
 
+#print Real.contDiffAt_rpow_const_of_le /-
 theorem contDiffAt_rpow_const_of_le {x p : ℝ} {n : ℕ} (h : ↑n ≤ p) :
     ContDiffAt ℝ n (fun x : ℝ => x ^ p) x :=
   (contDiff_rpow_const_of_le h).ContDiffAt
 #align real.cont_diff_at_rpow_const_of_le Real.contDiffAt_rpow_const_of_le
+-/
 
+#print Real.contDiffAt_rpow_const /-
 theorem contDiffAt_rpow_const {x p : ℝ} {n : ℕ} (h : x ≠ 0 ∨ ↑n ≤ p) :
     ContDiffAt ℝ n (fun x : ℝ => x ^ p) x :=
   h.elim contDiffAt_rpow_const_of_ne contDiffAt_rpow_const_of_le
 #align real.cont_diff_at_rpow_const Real.contDiffAt_rpow_const
+-/
 
+#print Real.hasStrictDerivAt_rpow_const /-
 theorem hasStrictDerivAt_rpow_const {x p : ℝ} (hx : x ≠ 0 ∨ 1 ≤ p) :
     HasStrictDerivAt (fun x => x ^ p) (p * x ^ (p - 1)) x :=
   ContDiffAt.hasStrictDerivAt' (contDiffAt_rpow_const (by rwa [Nat.cast_one]))
     (hasDerivAt_rpow_const hx) le_rfl
 #align real.has_strict_deriv_at_rpow_const Real.hasStrictDerivAt_rpow_const
+-/
 
 end Real
 
@@ -440,153 +524,211 @@ section fderiv
 variable {E : Type _} [NormedAddCommGroup E] [NormedSpace ℝ E] {f g : E → ℝ} {f' g' : E →L[ℝ] ℝ}
   {x : E} {s : Set E} {c p : ℝ} {n : ℕ∞}
 
+#print HasFDerivWithinAt.rpow /-
 theorem HasFDerivWithinAt.rpow (hf : HasFDerivWithinAt f f' s x) (hg : HasFDerivWithinAt g g' s x)
     (h : 0 < f x) :
     HasFDerivWithinAt (fun x => f x ^ g x)
       ((g x * f x ^ (g x - 1)) • f' + (f x ^ g x * log (f x)) • g') s x :=
   (hasStrictFDerivAt_rpow_of_pos (f x, g x) h).HasFDerivAt.comp_hasFDerivWithinAt x (hf.Prod hg)
 #align has_fderiv_within_at.rpow HasFDerivWithinAt.rpow
+-/
 
+#print HasFDerivAt.rpow /-
 theorem HasFDerivAt.rpow (hf : HasFDerivAt f f' x) (hg : HasFDerivAt g g' x) (h : 0 < f x) :
     HasFDerivAt (fun x => f x ^ g x) ((g x * f x ^ (g x - 1)) • f' + (f x ^ g x * log (f x)) • g')
       x :=
   (hasStrictFDerivAt_rpow_of_pos (f x, g x) h).HasFDerivAt.comp x (hf.Prod hg)
 #align has_fderiv_at.rpow HasFDerivAt.rpow
+-/
 
+#print HasStrictFDerivAt.rpow /-
 theorem HasStrictFDerivAt.rpow (hf : HasStrictFDerivAt f f' x) (hg : HasStrictFDerivAt g g' x)
     (h : 0 < f x) :
     HasStrictFDerivAt (fun x => f x ^ g x)
       ((g x * f x ^ (g x - 1)) • f' + (f x ^ g x * log (f x)) • g') x :=
   (hasStrictFDerivAt_rpow_of_pos (f x, g x) h).comp x (hf.Prod hg)
 #align has_strict_fderiv_at.rpow HasStrictFDerivAt.rpow
+-/
 
+#print DifferentiableWithinAt.rpow /-
 theorem DifferentiableWithinAt.rpow (hf : DifferentiableWithinAt ℝ f s x)
     (hg : DifferentiableWithinAt ℝ g s x) (h : f x ≠ 0) :
     DifferentiableWithinAt ℝ (fun x => f x ^ g x) s x :=
   (differentiableAt_rpow_of_ne (f x, g x) h).comp_differentiableWithinAt x (hf.Prod hg)
 #align differentiable_within_at.rpow DifferentiableWithinAt.rpow
+-/
 
+#print DifferentiableAt.rpow /-
 theorem DifferentiableAt.rpow (hf : DifferentiableAt ℝ f x) (hg : DifferentiableAt ℝ g x)
     (h : f x ≠ 0) : DifferentiableAt ℝ (fun x => f x ^ g x) x :=
   (differentiableAt_rpow_of_ne (f x, g x) h).comp x (hf.Prod hg)
 #align differentiable_at.rpow DifferentiableAt.rpow
+-/
 
+#print DifferentiableOn.rpow /-
 theorem DifferentiableOn.rpow (hf : DifferentiableOn ℝ f s) (hg : DifferentiableOn ℝ g s)
     (h : ∀ x ∈ s, f x ≠ 0) : DifferentiableOn ℝ (fun x => f x ^ g x) s := fun x hx =>
   (hf x hx).rpow (hg x hx) (h x hx)
 #align differentiable_on.rpow DifferentiableOn.rpow
+-/
 
+#print Differentiable.rpow /-
 theorem Differentiable.rpow (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) (h : ∀ x, f x ≠ 0) :
     Differentiable ℝ fun x => f x ^ g x := fun x => (hf x).rpow (hg x) (h x)
 #align differentiable.rpow Differentiable.rpow
+-/
 
+#print HasFDerivWithinAt.rpow_const /-
 theorem HasFDerivWithinAt.rpow_const (hf : HasFDerivWithinAt f f' s x) (h : f x ≠ 0 ∨ 1 ≤ p) :
     HasFDerivWithinAt (fun x => f x ^ p) ((p * f x ^ (p - 1)) • f') s x :=
   (hasDerivAt_rpow_const h).comp_hasFDerivWithinAt x hf
 #align has_fderiv_within_at.rpow_const HasFDerivWithinAt.rpow_const
+-/
 
+#print HasFDerivAt.rpow_const /-
 theorem HasFDerivAt.rpow_const (hf : HasFDerivAt f f' x) (h : f x ≠ 0 ∨ 1 ≤ p) :
     HasFDerivAt (fun x => f x ^ p) ((p * f x ^ (p - 1)) • f') x :=
   (hasDerivAt_rpow_const h).comp_hasFDerivAt x hf
 #align has_fderiv_at.rpow_const HasFDerivAt.rpow_const
+-/
 
+#print HasStrictFDerivAt.rpow_const /-
 theorem HasStrictFDerivAt.rpow_const (hf : HasStrictFDerivAt f f' x) (h : f x ≠ 0 ∨ 1 ≤ p) :
     HasStrictFDerivAt (fun x => f x ^ p) ((p * f x ^ (p - 1)) • f') x :=
   (hasStrictDerivAt_rpow_const h).comp_hasStrictFDerivAt x hf
 #align has_strict_fderiv_at.rpow_const HasStrictFDerivAt.rpow_const
+-/
 
+#print DifferentiableWithinAt.rpow_const /-
 theorem DifferentiableWithinAt.rpow_const (hf : DifferentiableWithinAt ℝ f s x)
     (h : f x ≠ 0 ∨ 1 ≤ p) : DifferentiableWithinAt ℝ (fun x => f x ^ p) s x :=
   (hf.HasFDerivWithinAt.rpow_const h).DifferentiableWithinAt
 #align differentiable_within_at.rpow_const DifferentiableWithinAt.rpow_const
+-/
 
+#print DifferentiableAt.rpow_const /-
 @[simp]
 theorem DifferentiableAt.rpow_const (hf : DifferentiableAt ℝ f x) (h : f x ≠ 0 ∨ 1 ≤ p) :
     DifferentiableAt ℝ (fun x => f x ^ p) x :=
   (hf.HasFDerivAt.rpow_const h).DifferentiableAt
 #align differentiable_at.rpow_const DifferentiableAt.rpow_const
+-/
 
+#print DifferentiableOn.rpow_const /-
 theorem DifferentiableOn.rpow_const (hf : DifferentiableOn ℝ f s) (h : ∀ x ∈ s, f x ≠ 0 ∨ 1 ≤ p) :
     DifferentiableOn ℝ (fun x => f x ^ p) s := fun x hx => (hf x hx).rpow_const (h x hx)
 #align differentiable_on.rpow_const DifferentiableOn.rpow_const
+-/
 
+#print Differentiable.rpow_const /-
 theorem Differentiable.rpow_const (hf : Differentiable ℝ f) (h : ∀ x, f x ≠ 0 ∨ 1 ≤ p) :
     Differentiable ℝ fun x => f x ^ p := fun x => (hf x).rpow_const (h x)
 #align differentiable.rpow_const Differentiable.rpow_const
+-/
 
+#print HasFDerivWithinAt.const_rpow /-
 theorem HasFDerivWithinAt.const_rpow (hf : HasFDerivWithinAt f f' s x) (hc : 0 < c) :
     HasFDerivWithinAt (fun x => c ^ f x) ((c ^ f x * log c) • f') s x :=
   (hasStrictDerivAt_const_rpow hc (f x)).HasDerivAt.comp_hasFDerivWithinAt x hf
 #align has_fderiv_within_at.const_rpow HasFDerivWithinAt.const_rpow
+-/
 
+#print HasFDerivAt.const_rpow /-
 theorem HasFDerivAt.const_rpow (hf : HasFDerivAt f f' x) (hc : 0 < c) :
     HasFDerivAt (fun x => c ^ f x) ((c ^ f x * log c) • f') x :=
   (hasStrictDerivAt_const_rpow hc (f x)).HasDerivAt.comp_hasFDerivAt x hf
 #align has_fderiv_at.const_rpow HasFDerivAt.const_rpow
+-/
 
+#print HasStrictFDerivAt.const_rpow /-
 theorem HasStrictFDerivAt.const_rpow (hf : HasStrictFDerivAt f f' x) (hc : 0 < c) :
     HasStrictFDerivAt (fun x => c ^ f x) ((c ^ f x * log c) • f') x :=
   (hasStrictDerivAt_const_rpow hc (f x)).comp_hasStrictFDerivAt x hf
 #align has_strict_fderiv_at.const_rpow HasStrictFDerivAt.const_rpow
+-/
 
+#print ContDiffWithinAt.rpow /-
 theorem ContDiffWithinAt.rpow (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x)
     (h : f x ≠ 0) : ContDiffWithinAt ℝ n (fun x => f x ^ g x) s x :=
   (contDiffAt_rpow_of_ne (f x, g x) h).comp_contDiffWithinAt x (hf.Prod hg)
 #align cont_diff_within_at.rpow ContDiffWithinAt.rpow
+-/
 
+#print ContDiffAt.rpow /-
 theorem ContDiffAt.rpow (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) (h : f x ≠ 0) :
     ContDiffAt ℝ n (fun x => f x ^ g x) x :=
   (contDiffAt_rpow_of_ne (f x, g x) h).comp x (hf.Prod hg)
 #align cont_diff_at.rpow ContDiffAt.rpow
+-/
 
+#print ContDiffOn.rpow /-
 theorem ContDiffOn.rpow (hf : ContDiffOn ℝ n f s) (hg : ContDiffOn ℝ n g s) (h : ∀ x ∈ s, f x ≠ 0) :
     ContDiffOn ℝ n (fun x => f x ^ g x) s := fun x hx => (hf x hx).rpow (hg x hx) (h x hx)
 #align cont_diff_on.rpow ContDiffOn.rpow
+-/
 
+#print ContDiff.rpow /-
 theorem ContDiff.rpow (hf : ContDiff ℝ n f) (hg : ContDiff ℝ n g) (h : ∀ x, f x ≠ 0) :
     ContDiff ℝ n fun x => f x ^ g x :=
   contDiff_iff_contDiffAt.mpr fun x => hf.ContDiffAt.rpow hg.ContDiffAt (h x)
 #align cont_diff.rpow ContDiff.rpow
+-/
 
+#print ContDiffWithinAt.rpow_const_of_ne /-
 theorem ContDiffWithinAt.rpow_const_of_ne (hf : ContDiffWithinAt ℝ n f s x) (h : f x ≠ 0) :
     ContDiffWithinAt ℝ n (fun x => f x ^ p) s x :=
   hf.rpow contDiffWithinAt_const h
 #align cont_diff_within_at.rpow_const_of_ne ContDiffWithinAt.rpow_const_of_ne
+-/
 
+#print ContDiffAt.rpow_const_of_ne /-
 theorem ContDiffAt.rpow_const_of_ne (hf : ContDiffAt ℝ n f x) (h : f x ≠ 0) :
     ContDiffAt ℝ n (fun x => f x ^ p) x :=
   hf.rpow contDiffAt_const h
 #align cont_diff_at.rpow_const_of_ne ContDiffAt.rpow_const_of_ne
+-/
 
+#print ContDiffOn.rpow_const_of_ne /-
 theorem ContDiffOn.rpow_const_of_ne (hf : ContDiffOn ℝ n f s) (h : ∀ x ∈ s, f x ≠ 0) :
     ContDiffOn ℝ n (fun x => f x ^ p) s := fun x hx => (hf x hx).rpow_const_of_ne (h x hx)
 #align cont_diff_on.rpow_const_of_ne ContDiffOn.rpow_const_of_ne
+-/
 
+#print ContDiff.rpow_const_of_ne /-
 theorem ContDiff.rpow_const_of_ne (hf : ContDiff ℝ n f) (h : ∀ x, f x ≠ 0) :
     ContDiff ℝ n fun x => f x ^ p :=
   hf.rpow contDiff_const h
 #align cont_diff.rpow_const_of_ne ContDiff.rpow_const_of_ne
+-/
 
 variable {m : ℕ}
 
+#print ContDiffWithinAt.rpow_const_of_le /-
 theorem ContDiffWithinAt.rpow_const_of_le (hf : ContDiffWithinAt ℝ m f s x) (h : ↑m ≤ p) :
     ContDiffWithinAt ℝ m (fun x => f x ^ p) s x :=
   (contDiffAt_rpow_const_of_le h).comp_contDiffWithinAt x hf
 #align cont_diff_within_at.rpow_const_of_le ContDiffWithinAt.rpow_const_of_le
+-/
 
+#print ContDiffAt.rpow_const_of_le /-
 theorem ContDiffAt.rpow_const_of_le (hf : ContDiffAt ℝ m f x) (h : ↑m ≤ p) :
     ContDiffAt ℝ m (fun x => f x ^ p) x := by rw [← contDiffWithinAt_univ] at *;
   exact hf.rpow_const_of_le h
 #align cont_diff_at.rpow_const_of_le ContDiffAt.rpow_const_of_le
+-/
 
+#print ContDiffOn.rpow_const_of_le /-
 theorem ContDiffOn.rpow_const_of_le (hf : ContDiffOn ℝ m f s) (h : ↑m ≤ p) :
     ContDiffOn ℝ m (fun x => f x ^ p) s := fun x hx => (hf x hx).rpow_const_of_le h
 #align cont_diff_on.rpow_const_of_le ContDiffOn.rpow_const_of_le
+-/
 
+#print ContDiff.rpow_const_of_le /-
 theorem ContDiff.rpow_const_of_le (hf : ContDiff ℝ m f) (h : ↑m ≤ p) :
     ContDiff ℝ m fun x => f x ^ p :=
   contDiff_iff_contDiffAt.mpr fun x => hf.ContDiffAt.rpow_const_of_le h
 #align cont_diff.rpow_const_of_le ContDiff.rpow_const_of_le
+-/
 
 end fderiv
 
@@ -594,6 +736,7 @@ section deriv
 
 variable {f g : ℝ → ℝ} {f' g' x y p : ℝ} {s : Set ℝ}
 
+#print HasDerivWithinAt.rpow /-
 theorem HasDerivWithinAt.rpow (hf : HasDerivWithinAt f f' s x) (hg : HasDerivWithinAt g g' s x)
     (h : 0 < f x) :
     HasDerivWithinAt (fun x => f x ^ g x) (f' * g x * f x ^ (g x - 1) + g' * f x ^ g x * log (f x))
@@ -602,39 +745,50 @@ theorem HasDerivWithinAt.rpow (hf : HasDerivWithinAt f f' s x) (hg : HasDerivWit
   convert (hf.has_fderiv_within_at.rpow hg.has_fderiv_within_at h).HasDerivWithinAt using 1
   dsimp; ring
 #align has_deriv_within_at.rpow HasDerivWithinAt.rpow
+-/
 
+#print HasDerivAt.rpow /-
 theorem HasDerivAt.rpow (hf : HasDerivAt f f' x) (hg : HasDerivAt g g' x) (h : 0 < f x) :
     HasDerivAt (fun x => f x ^ g x) (f' * g x * f x ^ (g x - 1) + g' * f x ^ g x * log (f x)) x :=
   by
   rw [← hasDerivWithinAt_univ] at *
   exact hf.rpow hg h
 #align has_deriv_at.rpow HasDerivAt.rpow
+-/
 
+#print HasDerivWithinAt.rpow_const /-
 theorem HasDerivWithinAt.rpow_const (hf : HasDerivWithinAt f f' s x) (hx : f x ≠ 0 ∨ 1 ≤ p) :
     HasDerivWithinAt (fun y => f y ^ p) (f' * p * f x ^ (p - 1)) s x :=
   by
   convert (has_deriv_at_rpow_const hx).comp_hasDerivWithinAt x hf using 1
   ring
 #align has_deriv_within_at.rpow_const HasDerivWithinAt.rpow_const
+-/
 
+#print HasDerivAt.rpow_const /-
 theorem HasDerivAt.rpow_const (hf : HasDerivAt f f' x) (hx : f x ≠ 0 ∨ 1 ≤ p) :
     HasDerivAt (fun y => f y ^ p) (f' * p * f x ^ (p - 1)) x :=
   by
   rw [← hasDerivWithinAt_univ] at *
   exact hf.rpow_const hx
 #align has_deriv_at.rpow_const HasDerivAt.rpow_const
+-/
 
+#print derivWithin_rpow_const /-
 theorem derivWithin_rpow_const (hf : DifferentiableWithinAt ℝ f s x) (hx : f x ≠ 0 ∨ 1 ≤ p)
     (hxs : UniqueDiffWithinAt ℝ s x) :
     derivWithin (fun x => f x ^ p) s x = derivWithin f s x * p * f x ^ (p - 1) :=
   (hf.HasDerivWithinAt.rpow_const hx).derivWithin hxs
 #align deriv_within_rpow_const derivWithin_rpow_const
+-/
 
+#print deriv_rpow_const /-
 @[simp]
 theorem deriv_rpow_const (hf : DifferentiableAt ℝ f x) (hx : f x ≠ 0 ∨ 1 ≤ p) :
     deriv (fun x => f x ^ p) x = deriv f x * p * f x ^ (p - 1) :=
   (hf.HasDerivAt.rpow_const hx).deriv
 #align deriv_rpow_const deriv_rpow_const
+-/
 
 end deriv
 
@@ -659,11 +813,13 @@ theorem tendsto_one_plus_div_rpow_exp (t : ℝ) :
 #align tendsto_one_plus_div_rpow_exp tendsto_one_plus_div_rpow_exp
 -/
 
+#print tendsto_one_plus_div_pow_exp /-
 /-- The function `(1 + t/x) ^ x` tends to `exp t` at `+∞` for naturals `x`. -/
 theorem tendsto_one_plus_div_pow_exp (t : ℝ) :
     Tendsto (fun x : ℕ => (1 + t / (x : ℝ)) ^ x) atTop (𝓝 (Real.exp t)) :=
   ((tendsto_one_plus_div_rpow_exp t).comp tendsto_nat_cast_atTop_atTop).congr (by simp)
 #align tendsto_one_plus_div_pow_exp tendsto_one_plus_div_pow_exp
+-/
 
 end Limits
 
Diff
@@ -227,13 +227,13 @@ theorem HasDerivWithinAt.cpow_const (hf : HasDerivWithinAt f f' s x)
 
 /-- Although `λ x, x ^ r` for fixed `r` is *not* complex-differentiable along the negative real
 line, it is still real-differentiable, and the derivative is what one would formally expect. -/
-theorem hasDerivAt_of_real_cpow {x : ℝ} (hx : x ≠ 0) {r : ℂ} (hr : r ≠ -1) :
+theorem hasDerivAt_ofReal_cpow {x : ℝ} (hx : x ≠ 0) {r : ℂ} (hr : r ≠ -1) :
     HasDerivAt (fun y : ℝ => (y : ℂ) ^ (r + 1) / (r + 1)) (x ^ r) x :=
   by
   rw [Ne.def, ← add_eq_zero_iff_eq_neg, ← Ne.def] at hr 
   rcases lt_or_gt_of_ne hx.symm with (hx | hx)
   · -- easy case : `0 < x`
-    convert (((hasDerivAt_id (x : ℂ)).cpow_const _).div_const (r + 1)).comp_of_real
+    convert (((hasDerivAt_id (x : ℂ)).cpow_const _).div_const (r + 1)).comp_ofReal
     · rw [add_sub_cancel, id.def, mul_one, mul_comm, mul_div_cancel _ hr]
     · rw [id.def, of_real_re]; exact Or.inl hx
   · -- harder case : `x < 0`
@@ -266,7 +266,7 @@ theorem hasDerivAt_of_real_cpow {x : ℝ} (hx : x ≠ 0) {r : ℂ} (hr : r ≠ -
     convert (hasDerivAt_id ((-x : ℝ) : ℂ)).cpow_const _ using 1
     · simp
     · left; rwa [id.def, of_real_re, neg_pos]
-#align has_deriv_at_of_real_cpow hasDerivAt_of_real_cpow
+#align has_deriv_at_of_real_cpow hasDerivAt_ofReal_cpow
 
 end deriv
 
Diff
@@ -5,7 +5,7 @@ Authors: Chris Hughes, Abhimanyu Pallavi Sudhir, Jean Lo, Calle Sönne, Sébasti
   Rémy Degenne
 
 ! This file was ported from Lean 3 source module analysis.special_functions.pow.deriv
-! leanprover-community/mathlib commit 3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe
+! leanprover-community/mathlib commit c20927220ef87bb4962ba08bf6da2ce3cf50a6dd
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -19,6 +19,9 @@ import Mathbin.Analysis.SpecialFunctions.Trigonometric.Deriv
 /-!
 # Derivatives of power function on `ℂ`, `ℝ`, `ℝ≥0`, and `ℝ≥0∞`
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 We also prove differentiability and provide derivatives for the power functions `x ^ y`.
 -/
 
Diff
@@ -641,6 +641,7 @@ section Limits
 
 open Real Filter
 
+#print tendsto_one_plus_div_rpow_exp /-
 /-- The function `(1 + t/x) ^ x` tends to `exp t` at `+∞`. -/
 theorem tendsto_one_plus_div_rpow_exp (t : ℝ) :
     Tendsto (fun x : ℝ => (1 + t / x) ^ x) atTop (𝓝 (exp t)) :=
@@ -653,6 +654,7 @@ theorem tendsto_one_plus_div_rpow_exp (t : ℝ) :
   have hx' : 0 < 1 + t / x := by linarith
   simp [mul_comm x, exp_mul, exp_log hx']
 #align tendsto_one_plus_div_rpow_exp tendsto_one_plus_div_rpow_exp
+-/
 
 /-- The function `(1 + t/x) ^ x` tends to `exp t` at `+∞` for naturals `x`. -/
 theorem tendsto_one_plus_div_pow_exp (t : ℝ) :
Diff
@@ -89,7 +89,7 @@ theorem HasStrictFDerivAt.cpow (hf : HasStrictFDerivAt f f' x) (hg : HasStrictFD
     (h0 : 0 < (f x).re ∨ (f x).im ≠ 0) :
     HasStrictFDerivAt (fun x => f x ^ g x)
       ((g x * f x ^ (g x - 1)) • f' + (f x ^ g x * log (f x)) • g') x :=
-  by convert(@has_strict_fderiv_at_cpow ((fun x => (f x, g x)) x) h0).comp x (hf.prod hg)
+  by convert (@has_strict_fderiv_at_cpow ((fun x => (f x, g x)) x) h0).comp x (hf.prod hg)
 #align has_strict_fderiv_at.cpow HasStrictFDerivAt.cpow
 
 theorem HasStrictFDerivAt.const_cpow (hf : HasStrictFDerivAt f f' x) (h0 : c ≠ 0 ∨ f x ≠ 0) :
@@ -101,7 +101,7 @@ theorem HasFDerivAt.cpow (hf : HasFDerivAt f f' x) (hg : HasFDerivAt g g' x)
     (h0 : 0 < (f x).re ∨ (f x).im ≠ 0) :
     HasFDerivAt (fun x => f x ^ g x) ((g x * f x ^ (g x - 1)) • f' + (f x ^ g x * log (f x)) • g')
       x :=
-  by convert(@Complex.hasFDerivAt_cpow ((fun x => (f x, g x)) x) h0).comp x (hf.prod hg)
+  by convert (@Complex.hasFDerivAt_cpow ((fun x => (f x, g x)) x) h0).comp x (hf.prod hg)
 #align has_fderiv_at.cpow HasFDerivAt.cpow
 
 theorem HasFDerivAt.const_cpow (hf : HasFDerivAt f f' x) (h0 : c ≠ 0 ∨ f x ≠ 0) :
@@ -114,8 +114,8 @@ theorem HasFDerivWithinAt.cpow (hf : HasFDerivWithinAt f f' s x) (hg : HasFDeriv
     HasFDerivWithinAt (fun x => f x ^ g x)
       ((g x * f x ^ (g x - 1)) • f' + (f x ^ g x * log (f x)) • g') s x :=
   by
-  convert(@Complex.hasFDerivAt_cpow ((fun x => (f x, g x)) x) h0).comp_hasFDerivWithinAt x
-      (hf.prod hg)
+  convert
+    (@Complex.hasFDerivAt_cpow ((fun x => (f x, g x)) x) h0).comp_hasFDerivWithinAt x (hf.prod hg)
 #align has_fderiv_within_at.cpow HasFDerivWithinAt.cpow
 
 theorem HasFDerivWithinAt.const_cpow (hf : HasFDerivWithinAt f f' s x) (h0 : c ≠ 0 ∨ f x ≠ 0) :
@@ -230,7 +230,7 @@ theorem hasDerivAt_of_real_cpow {x : ℝ} (hx : x ≠ 0) {r : ℂ} (hr : r ≠ -
   rw [Ne.def, ← add_eq_zero_iff_eq_neg, ← Ne.def] at hr 
   rcases lt_or_gt_of_ne hx.symm with (hx | hx)
   · -- easy case : `0 < x`
-    convert(((hasDerivAt_id (x : ℂ)).cpow_const _).div_const (r + 1)).comp_of_real
+    convert (((hasDerivAt_id (x : ℂ)).cpow_const _).div_const (r + 1)).comp_of_real
     · rw [add_sub_cancel, id.def, mul_one, mul_comm, mul_div_cancel _ hr]
     · rw [id.def, of_real_re]; exact Or.inl hx
   · -- harder case : `x < 0`
@@ -255,12 +255,12 @@ theorem hasDerivAt_of_real_cpow {x : ℝ} (hx : x ≠ 0) {r : ℂ} (hr : r ≠ -
       convert this.neg.mul_const _; ring
     suffices HasDerivAt (fun y : ℝ => ↑y ^ (r + 1)) ((r + 1) * ↑(-x) ^ r) (-x)
       by
-      convert@HasDerivAt.scomp ℝ _ ℂ _ _ x ℝ _ _ _ _ _ _ _ _ this (hasDerivAt_neg x) using 1
+      convert @HasDerivAt.scomp ℝ _ ℂ _ _ x ℝ _ _ _ _ _ _ _ _ this (hasDerivAt_neg x) using 1
       rw [real_smul, of_real_neg 1, of_real_one]; ring
     suffices HasDerivAt (fun y : ℂ => y ^ (r + 1)) ((r + 1) * ↑(-x) ^ r) ↑(-x) by
       exact this.comp_of_real
     conv in ↑_ ^ _ => rw [(by ring : r = r + 1 - 1)]
-    convert(hasDerivAt_id ((-x : ℝ) : ℂ)).cpow_const _ using 1
+    convert (hasDerivAt_id ((-x : ℝ) : ℂ)).cpow_const _ using 1
     · simp
     · left; rwa [id.def, of_real_re, neg_pos]
 #align has_deriv_at_of_real_cpow hasDerivAt_of_real_cpow
@@ -281,7 +281,7 @@ theorem hasStrictFDerivAt_rpow_of_pos (p : ℝ × ℝ) (hp : 0 < p.1) :
   have : (fun x : ℝ × ℝ => x.1 ^ x.2) =ᶠ[𝓝 p] fun x => exp (log x.1 * x.2) :=
     (continuous_at_fst.eventually (lt_mem_nhds hp)).mono fun p hp => rpow_def_of_pos hp _
   refine' HasStrictFDerivAt.congr_of_eventuallyEq _ this.symm
-  convert((has_strict_fderiv_at_fst.log hp.ne').mul hasStrictFDerivAt_snd).exp
+  convert ((has_strict_fderiv_at_fst.log hp.ne').mul hasStrictFDerivAt_snd).exp
   rw [rpow_sub_one hp.ne', ← rpow_def_of_pos hp, smul_add, smul_smul, mul_div_left_comm,
     div_eq_mul_inv, smul_smul, smul_smul, mul_assoc, add_comm]
 #align real.has_strict_fderiv_at_rpow_of_pos Real.hasStrictFDerivAt_rpow_of_pos
@@ -297,7 +297,8 @@ theorem hasStrictFDerivAt_rpow_of_neg (p : ℝ × ℝ) (hp : p.1 < 0) :
   have : (fun x : ℝ × ℝ => x.1 ^ x.2) =ᶠ[𝓝 p] fun x => exp (log x.1 * x.2) * cos (x.2 * π) :=
     (continuous_at_fst.eventually (gt_mem_nhds hp)).mono fun p hp => rpow_def_of_neg hp _
   refine' HasStrictFDerivAt.congr_of_eventuallyEq _ this.symm
-  convert((has_strict_fderiv_at_fst.log hp.ne).mul hasStrictFDerivAt_snd).exp.mul
+  convert
+    ((has_strict_fderiv_at_fst.log hp.ne).mul hasStrictFDerivAt_snd).exp.mul
       (has_strict_fderiv_at_snd.mul_const _).cos using
     1
   simp_rw [rpow_sub_one hp.ne, smul_add, ← add_assoc, smul_smul, ← add_smul, ← mul_assoc,
@@ -328,7 +329,8 @@ theorem HasStrictDerivAt.rpow {f g : ℝ → ℝ} {f' g' : ℝ} (hf : HasStrictD
     HasStrictDerivAt (fun x => f x ^ g x) (f' * g x * f x ^ (g x - 1) + g' * f x ^ g x * log (f x))
       x :=
   by
-  convert(has_strict_fderiv_at_rpow_of_pos ((fun x => (f x, g x)) x) h).comp_hasStrictDerivAt _
+  convert
+    (has_strict_fderiv_at_rpow_of_pos ((fun x => (f x, g x)) x) h).comp_hasStrictDerivAt _
       (hf.prod hg) using
     1
   simp [mul_assoc, mul_comm, mul_left_comm]
@@ -420,7 +422,7 @@ theorem contDiffAt_rpow_const {x p : ℝ} {n : ℕ} (h : x ≠ 0 ∨ ↑n ≤ p)
 
 theorem hasStrictDerivAt_rpow_const {x p : ℝ} (hx : x ≠ 0 ∨ 1 ≤ p) :
     HasStrictDerivAt (fun x => x ^ p) (p * x ^ (p - 1)) x :=
-  ContDiffAt.has_strict_deriv_at' (contDiffAt_rpow_const (by rwa [Nat.cast_one]))
+  ContDiffAt.hasStrictDerivAt' (contDiffAt_rpow_const (by rwa [Nat.cast_one]))
     (hasDerivAt_rpow_const hx) le_rfl
 #align real.has_strict_deriv_at_rpow_const Real.hasStrictDerivAt_rpow_const
 
@@ -594,7 +596,7 @@ theorem HasDerivWithinAt.rpow (hf : HasDerivWithinAt f f' s x) (hg : HasDerivWit
     HasDerivWithinAt (fun x => f x ^ g x) (f' * g x * f x ^ (g x - 1) + g' * f x ^ g x * log (f x))
       s x :=
   by
-  convert(hf.has_fderiv_within_at.rpow hg.has_fderiv_within_at h).HasDerivWithinAt using 1
+  convert (hf.has_fderiv_within_at.rpow hg.has_fderiv_within_at h).HasDerivWithinAt using 1
   dsimp; ring
 #align has_deriv_within_at.rpow HasDerivWithinAt.rpow
 
@@ -608,7 +610,7 @@ theorem HasDerivAt.rpow (hf : HasDerivAt f f' x) (hg : HasDerivAt g g' x) (h : 0
 theorem HasDerivWithinAt.rpow_const (hf : HasDerivWithinAt f f' s x) (hx : f x ≠ 0 ∨ 1 ≤ p) :
     HasDerivWithinAt (fun y => f y ^ p) (f' * p * f x ^ (p - 1)) s x :=
   by
-  convert(has_deriv_at_rpow_const hx).comp_hasDerivWithinAt x hf using 1
+  convert (has_deriv_at_rpow_const hx).comp_hasDerivWithinAt x hf using 1
   ring
 #align has_deriv_within_at.rpow_const HasDerivWithinAt.rpow_const
 
Diff
@@ -227,7 +227,7 @@ line, it is still real-differentiable, and the derivative is what one would form
 theorem hasDerivAt_of_real_cpow {x : ℝ} (hx : x ≠ 0) {r : ℂ} (hr : r ≠ -1) :
     HasDerivAt (fun y : ℝ => (y : ℂ) ^ (r + 1) / (r + 1)) (x ^ r) x :=
   by
-  rw [Ne.def, ← add_eq_zero_iff_eq_neg, ← Ne.def] at hr
+  rw [Ne.def, ← add_eq_zero_iff_eq_neg, ← Ne.def] at hr 
   rcases lt_or_gt_of_ne hx.symm with (hx | hx)
   · -- easy case : `0 < x`
     convert(((hasDerivAt_id (x : ℂ)).cpow_const _).div_const (r + 1)).comp_of_real
@@ -310,7 +310,8 @@ theorem contDiffAt_rpow_of_ne (p : ℝ × ℝ) (hp : p.1 ≠ 0) {n : ℕ∞} :
     ContDiffAt ℝ n (fun p : ℝ × ℝ => p.1 ^ p.2) p :=
   by
   cases' hp.lt_or_lt with hneg hpos
-  exacts[(((cont_diff_at_fst.log hneg.ne).mul contDiffAt_snd).exp.mul
+  exacts
+    [(((cont_diff_at_fst.log hneg.ne).mul contDiffAt_snd).exp.mul
           (cont_diff_at_snd.mul contDiffAt_const).cos).congr_of_eventuallyEq
       ((continuous_at_fst.eventually (gt_mem_nhds hneg)).mono fun p hp => rpow_def_of_neg hp _),
     ((cont_diff_at_fst.log hpos.ne').mul contDiffAt_snd).exp.congr_of_eventuallyEq
@@ -374,7 +375,7 @@ theorem hasDerivAt_rpow_const {x p : ℝ} (h : x ≠ 0 ∨ 1 ≤ p) :
   apply
     hasDerivAt_of_hasDerivAt_of_ne fun x hx =>
       (has_strict_deriv_at_rpow_const_of_ne hx p).HasDerivAt
-  exacts[continuous_at_id.rpow_const (Or.inr (zero_le_one.trans h)),
+  exacts [continuous_at_id.rpow_const (Or.inr (zero_le_one.trans h)),
     continuous_at_const.mul (continuous_at_id.rpow_const (Or.inr (sub_nonneg.2 h)))]
 #align real.has_deriv_at_rpow_const Real.hasDerivAt_rpow_const
 
@@ -402,7 +403,7 @@ theorem contDiff_rpow_const_of_le {p : ℝ} {n : ℕ} (h : ↑n ≤ p) : ContDif
   induction' n with n ihn generalizing p
   · exact contDiff_zero.2 (continuous_id.rpow_const fun x => by exact_mod_cast Or.inr h)
   · have h1 : 1 ≤ p := le_trans (by simp) h
-    rw [Nat.cast_succ, ← le_sub_iff_add_le] at h
+    rw [Nat.cast_succ, ← le_sub_iff_add_le] at h 
     rw [contDiff_succ_iff_deriv, deriv_rpow_const' h1]
     refine' ⟨differentiable_rpow_const h1, cont_diff_const.mul (ihn h)⟩
 #align real.cont_diff_rpow_const_of_le Real.contDiff_rpow_const_of_le
Diff
@@ -25,7 +25,7 @@ We also prove differentiability and provide derivatives for the power functions
 
 noncomputable section
 
-open Classical Real Topology NNReal ENNReal Filter
+open scoped Classical Real Topology NNReal ENNReal Filter
 
 open Filter
 
Diff
@@ -37,9 +37,7 @@ theorem hasStrictFDerivAt_cpow {p : ℂ × ℂ} (hp : 0 < p.1.re ∨ p.1.im ≠
         (p.1 ^ p.2 * log p.1) • ContinuousLinearMap.snd ℂ ℂ ℂ)
       p :=
   by
-  have A : p.1 ≠ 0 := by
-    intro h
-    simpa [h, lt_irrefl] using hp
+  have A : p.1 ≠ 0 := by intro h; simpa [h, lt_irrefl] using hp
   have : (fun x : ℂ × ℂ => x.1 ^ x.2) =ᶠ[𝓝 p] fun x => exp (log x.1 * x.2) :=
     ((is_open_ne.preimage continuous_fst).eventually_mem A).mono fun p hp =>
       cpow_def_of_ne_zero hp _
@@ -234,8 +232,7 @@ theorem hasDerivAt_of_real_cpow {x : ℝ} (hx : x ≠ 0) {r : ℂ} (hr : r ≠ -
   · -- easy case : `0 < x`
     convert(((hasDerivAt_id (x : ℂ)).cpow_const _).div_const (r + 1)).comp_of_real
     · rw [add_sub_cancel, id.def, mul_one, mul_comm, mul_div_cancel _ hr]
-    · rw [id.def, of_real_re]
-      exact Or.inl hx
+    · rw [id.def, of_real_re]; exact Or.inl hx
   · -- harder case : `x < 0`
     have :
       ∀ᶠ y : ℝ in nhds x,
@@ -254,22 +251,18 @@ theorem hasDerivAt_of_real_cpow {x : ℝ} (hx : x ≠ 0) {r : ℂ} (hr : r ≠ -
     rw [mul_add ((π : ℂ) * _), mul_one, exp_add, exp_pi_mul_I, mul_comm (_ : ℂ) (-1 : ℂ),
       neg_one_mul]
     simp_rw [mul_neg, ← neg_mul, ← of_real_neg]
-    suffices HasDerivAt (fun y : ℝ => ↑(-y) ^ (r + 1)) (-(r + 1) * ↑(-x) ^ r) x
-      by
-      convert this.neg.mul_const _
-      ring
+    suffices HasDerivAt (fun y : ℝ => ↑(-y) ^ (r + 1)) (-(r + 1) * ↑(-x) ^ r) x by
+      convert this.neg.mul_const _; ring
     suffices HasDerivAt (fun y : ℝ => ↑y ^ (r + 1)) ((r + 1) * ↑(-x) ^ r) (-x)
       by
       convert@HasDerivAt.scomp ℝ _ ℂ _ _ x ℝ _ _ _ _ _ _ _ _ this (hasDerivAt_neg x) using 1
-      rw [real_smul, of_real_neg 1, of_real_one]
-      ring
+      rw [real_smul, of_real_neg 1, of_real_one]; ring
     suffices HasDerivAt (fun y : ℂ => y ^ (r + 1)) ((r + 1) * ↑(-x) ^ r) ↑(-x) by
       exact this.comp_of_real
     conv in ↑_ ^ _ => rw [(by ring : r = r + 1 - 1)]
     convert(hasDerivAt_id ((-x : ℝ) : ℂ)).cpow_const _ using 1
     · simp
-    · left
-      rwa [id.def, of_real_re, neg_pos]
+    · left; rwa [id.def, of_real_re, neg_pos]
 #align has_deriv_at_of_real_cpow hasDerivAt_of_real_cpow
 
 end deriv
@@ -309,8 +302,7 @@ theorem hasStrictFDerivAt_rpow_of_neg (p : ℝ × ℝ) (hp : p.1 < 0) :
     1
   simp_rw [rpow_sub_one hp.ne, smul_add, ← add_assoc, smul_smul, ← add_smul, ← mul_assoc,
     mul_comm (cos _), ← rpow_def_of_neg hp]
-  rw [div_eq_mul_inv, add_comm]
-  congr 2 <;> ring
+  rw [div_eq_mul_inv, add_comm]; congr 2 <;> ring
 #align real.has_strict_fderiv_at_rpow_of_neg Real.hasStrictFDerivAt_rpow_of_neg
 
 /-- The function `λ (x, y), x ^ y` is infinitely smooth at `(x, y)` unless `x = 0`. -/
@@ -348,8 +340,7 @@ theorem hasStrictDerivAt_rpow_const_of_ne {x : ℝ} (hx : x ≠ 0) (p : ℝ) :
   · have :=
       (has_strict_fderiv_at_rpow_of_neg (x, p) hx).comp_hasStrictDerivAt x
         ((hasStrictDerivAt_id x).Prod (hasStrictDerivAt_const _ _))
-    convert this
-    simp
+    convert this; simp
   · simpa using (hasStrictDerivAt_id x).rpow (hasStrictDerivAt_const x p) hx
 #align real.has_strict_deriv_at_rpow_const_of_ne Real.hasStrictDerivAt_rpow_const_of_ne
 
@@ -578,9 +569,7 @@ theorem ContDiffWithinAt.rpow_const_of_le (hf : ContDiffWithinAt ℝ m f s x) (h
 #align cont_diff_within_at.rpow_const_of_le ContDiffWithinAt.rpow_const_of_le
 
 theorem ContDiffAt.rpow_const_of_le (hf : ContDiffAt ℝ m f x) (h : ↑m ≤ p) :
-    ContDiffAt ℝ m (fun x => f x ^ p) x :=
-  by
-  rw [← contDiffWithinAt_univ] at *
+    ContDiffAt ℝ m (fun x => f x ^ p) x := by rw [← contDiffWithinAt_univ] at *;
   exact hf.rpow_const_of_le h
 #align cont_diff_at.rpow_const_of_le ContDiffAt.rpow_const_of_le
 
Diff
@@ -5,13 +5,14 @@ Authors: Chris Hughes, Abhimanyu Pallavi Sudhir, Jean Lo, Calle Sönne, Sébasti
   Rémy Degenne
 
 ! This file was ported from Lean 3 source module analysis.special_functions.pow.deriv
-! leanprover-community/mathlib commit 0b9eaaa7686280fad8cce467f5c3c57ee6ce77f8
+! leanprover-community/mathlib commit 3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
 import Mathbin.Analysis.SpecialFunctions.Pow.Continuity
 import Mathbin.Analysis.SpecialFunctions.Complex.LogDeriv
 import Mathbin.Analysis.Calculus.ExtendDeriv
+import Mathbin.Analysis.Calculus.Deriv.Prod
 import Mathbin.Analysis.SpecialFunctions.Log.Deriv
 import Mathbin.Analysis.SpecialFunctions.Trigonometric.Deriv
 
@@ -164,7 +165,6 @@ private theorem aux :
   simp only [Algebra.id.smul_eq_mul, one_mul, ContinuousLinearMap.one_apply,
     ContinuousLinearMap.smulRight_apply, ContinuousLinearMap.add_apply, Pi.smul_apply,
     ContinuousLinearMap.coe_smul']
-#align aux aux
 
 theorem HasStrictDerivAt.cpow (hf : HasStrictDerivAt f f' x) (hg : HasStrictDerivAt g g' x)
     (h0 : 0 < (f x).re ∨ (f x).im ≠ 0) :
Diff
@@ -30,8 +30,8 @@ open Filter
 
 namespace Complex
 
-theorem hasStrictFderivAt_cpow {p : ℂ × ℂ} (hp : 0 < p.1.re ∨ p.1.im ≠ 0) :
-    HasStrictFderivAt (fun x : ℂ × ℂ => x.1 ^ x.2)
+theorem hasStrictFDerivAt_cpow {p : ℂ × ℂ} (hp : 0 < p.1.re ∨ p.1.im ≠ 0) :
+    HasStrictFDerivAt (fun x : ℂ × ℂ => x.1 ^ x.2)
       ((p.2 * p.1 ^ (p.2 - 1)) • ContinuousLinearMap.fst ℂ ℂ ℂ +
         (p.1 ^ p.2 * log p.1) • ContinuousLinearMap.snd ℂ ℂ ℂ)
       p :=
@@ -43,18 +43,18 @@ theorem hasStrictFderivAt_cpow {p : ℂ × ℂ} (hp : 0 < p.1.re ∨ p.1.im ≠
     ((is_open_ne.preimage continuous_fst).eventually_mem A).mono fun p hp =>
       cpow_def_of_ne_zero hp _
   rw [cpow_sub _ _ A, cpow_one, mul_div_left_comm, mul_smul, mul_smul, ← smul_add]
-  refine' HasStrictFderivAt.congr_of_eventuallyEq _ this.symm
+  refine' HasStrictFDerivAt.congr_of_eventuallyEq _ this.symm
   simpa only [cpow_def_of_ne_zero A, div_eq_mul_inv, mul_smul, add_comm] using
-    ((has_strict_fderiv_at_fst.clog hp).mul hasStrictFderivAt_snd).cexp
-#align complex.has_strict_fderiv_at_cpow Complex.hasStrictFderivAt_cpow
+    ((has_strict_fderiv_at_fst.clog hp).mul hasStrictFDerivAt_snd).cexp
+#align complex.has_strict_fderiv_at_cpow Complex.hasStrictFDerivAt_cpow
 
-theorem hasStrictFderivAt_cpow' {x y : ℂ} (hp : 0 < x.re ∨ x.im ≠ 0) :
-    HasStrictFderivAt (fun x : ℂ × ℂ => x.1 ^ x.2)
+theorem hasStrictFDerivAt_cpow' {x y : ℂ} (hp : 0 < x.re ∨ x.im ≠ 0) :
+    HasStrictFDerivAt (fun x : ℂ × ℂ => x.1 ^ x.2)
       ((y * x ^ (y - 1)) • ContinuousLinearMap.fst ℂ ℂ ℂ +
         (x ^ y * log x) • ContinuousLinearMap.snd ℂ ℂ ℂ)
       (x, y) :=
-  @hasStrictFderivAt_cpow (x, y) hp
-#align complex.has_strict_fderiv_at_cpow' Complex.hasStrictFderivAt_cpow'
+  @hasStrictFDerivAt_cpow (x, y) hp
+#align complex.has_strict_fderiv_at_cpow' Complex.hasStrictFDerivAt_cpow'
 
 theorem hasStrictDerivAt_const_cpow {x y : ℂ} (h : x ≠ 0 ∨ y ≠ 0) :
     HasStrictDerivAt (fun y => x ^ y) (x ^ y * log x) y :=
@@ -69,13 +69,13 @@ theorem hasStrictDerivAt_const_cpow {x y : ℂ} (h : x ≠ 0 ∨ y ≠ 0) :
       ((hasStrictDerivAt_id y).const_mul (log x)).cexp
 #align complex.has_strict_deriv_at_const_cpow Complex.hasStrictDerivAt_const_cpow
 
-theorem hasFderivAt_cpow {p : ℂ × ℂ} (hp : 0 < p.1.re ∨ p.1.im ≠ 0) :
-    HasFderivAt (fun x : ℂ × ℂ => x.1 ^ x.2)
+theorem hasFDerivAt_cpow {p : ℂ × ℂ} (hp : 0 < p.1.re ∨ p.1.im ≠ 0) :
+    HasFDerivAt (fun x : ℂ × ℂ => x.1 ^ x.2)
       ((p.2 * p.1 ^ (p.2 - 1)) • ContinuousLinearMap.fst ℂ ℂ ℂ +
         (p.1 ^ p.2 * log p.1) • ContinuousLinearMap.snd ℂ ℂ ℂ)
       p :=
-  (hasStrictFderivAt_cpow hp).HasFderivAt
-#align complex.has_fderiv_at_cpow Complex.hasFderivAt_cpow
+  (hasStrictFDerivAt_cpow hp).HasFDerivAt
+#align complex.has_fderiv_at_cpow Complex.hasFDerivAt_cpow
 
 end Complex
 
@@ -86,63 +86,63 @@ open Complex
 variable {E : Type _} [NormedAddCommGroup E] [NormedSpace ℂ E] {f g : E → ℂ} {f' g' : E →L[ℂ] ℂ}
   {x : E} {s : Set E} {c : ℂ}
 
-theorem HasStrictFderivAt.cpow (hf : HasStrictFderivAt f f' x) (hg : HasStrictFderivAt g g' x)
+theorem HasStrictFDerivAt.cpow (hf : HasStrictFDerivAt f f' x) (hg : HasStrictFDerivAt g g' x)
     (h0 : 0 < (f x).re ∨ (f x).im ≠ 0) :
-    HasStrictFderivAt (fun x => f x ^ g x)
+    HasStrictFDerivAt (fun x => f x ^ g x)
       ((g x * f x ^ (g x - 1)) • f' + (f x ^ g x * log (f x)) • g') x :=
   by convert(@has_strict_fderiv_at_cpow ((fun x => (f x, g x)) x) h0).comp x (hf.prod hg)
-#align has_strict_fderiv_at.cpow HasStrictFderivAt.cpow
+#align has_strict_fderiv_at.cpow HasStrictFDerivAt.cpow
 
-theorem HasStrictFderivAt.const_cpow (hf : HasStrictFderivAt f f' x) (h0 : c ≠ 0 ∨ f x ≠ 0) :
-    HasStrictFderivAt (fun x => c ^ f x) ((c ^ f x * log c) • f') x :=
-  (hasStrictDerivAt_const_cpow h0).comp_hasStrictFderivAt x hf
-#align has_strict_fderiv_at.const_cpow HasStrictFderivAt.const_cpow
+theorem HasStrictFDerivAt.const_cpow (hf : HasStrictFDerivAt f f' x) (h0 : c ≠ 0 ∨ f x ≠ 0) :
+    HasStrictFDerivAt (fun x => c ^ f x) ((c ^ f x * log c) • f') x :=
+  (hasStrictDerivAt_const_cpow h0).comp_hasStrictFDerivAt x hf
+#align has_strict_fderiv_at.const_cpow HasStrictFDerivAt.const_cpow
 
-theorem HasFderivAt.cpow (hf : HasFderivAt f f' x) (hg : HasFderivAt g g' x)
+theorem HasFDerivAt.cpow (hf : HasFDerivAt f f' x) (hg : HasFDerivAt g g' x)
     (h0 : 0 < (f x).re ∨ (f x).im ≠ 0) :
-    HasFderivAt (fun x => f x ^ g x) ((g x * f x ^ (g x - 1)) • f' + (f x ^ g x * log (f x)) • g')
+    HasFDerivAt (fun x => f x ^ g x) ((g x * f x ^ (g x - 1)) • f' + (f x ^ g x * log (f x)) • g')
       x :=
-  by convert(@Complex.hasFderivAt_cpow ((fun x => (f x, g x)) x) h0).comp x (hf.prod hg)
-#align has_fderiv_at.cpow HasFderivAt.cpow
+  by convert(@Complex.hasFDerivAt_cpow ((fun x => (f x, g x)) x) h0).comp x (hf.prod hg)
+#align has_fderiv_at.cpow HasFDerivAt.cpow
 
-theorem HasFderivAt.const_cpow (hf : HasFderivAt f f' x) (h0 : c ≠ 0 ∨ f x ≠ 0) :
-    HasFderivAt (fun x => c ^ f x) ((c ^ f x * log c) • f') x :=
-  (hasStrictDerivAt_const_cpow h0).HasDerivAt.comp_hasFderivAt x hf
-#align has_fderiv_at.const_cpow HasFderivAt.const_cpow
+theorem HasFDerivAt.const_cpow (hf : HasFDerivAt f f' x) (h0 : c ≠ 0 ∨ f x ≠ 0) :
+    HasFDerivAt (fun x => c ^ f x) ((c ^ f x * log c) • f') x :=
+  (hasStrictDerivAt_const_cpow h0).HasDerivAt.comp_hasFDerivAt x hf
+#align has_fderiv_at.const_cpow HasFDerivAt.const_cpow
 
-theorem HasFderivWithinAt.cpow (hf : HasFderivWithinAt f f' s x) (hg : HasFderivWithinAt g g' s x)
+theorem HasFDerivWithinAt.cpow (hf : HasFDerivWithinAt f f' s x) (hg : HasFDerivWithinAt g g' s x)
     (h0 : 0 < (f x).re ∨ (f x).im ≠ 0) :
-    HasFderivWithinAt (fun x => f x ^ g x)
+    HasFDerivWithinAt (fun x => f x ^ g x)
       ((g x * f x ^ (g x - 1)) • f' + (f x ^ g x * log (f x)) • g') s x :=
   by
-  convert(@Complex.hasFderivAt_cpow ((fun x => (f x, g x)) x) h0).comp_hasFderivWithinAt x
+  convert(@Complex.hasFDerivAt_cpow ((fun x => (f x, g x)) x) h0).comp_hasFDerivWithinAt x
       (hf.prod hg)
-#align has_fderiv_within_at.cpow HasFderivWithinAt.cpow
+#align has_fderiv_within_at.cpow HasFDerivWithinAt.cpow
 
-theorem HasFderivWithinAt.const_cpow (hf : HasFderivWithinAt f f' s x) (h0 : c ≠ 0 ∨ f x ≠ 0) :
-    HasFderivWithinAt (fun x => c ^ f x) ((c ^ f x * log c) • f') s x :=
-  (hasStrictDerivAt_const_cpow h0).HasDerivAt.comp_hasFderivWithinAt x hf
-#align has_fderiv_within_at.const_cpow HasFderivWithinAt.const_cpow
+theorem HasFDerivWithinAt.const_cpow (hf : HasFDerivWithinAt f f' s x) (h0 : c ≠ 0 ∨ f x ≠ 0) :
+    HasFDerivWithinAt (fun x => c ^ f x) ((c ^ f x * log c) • f') s x :=
+  (hasStrictDerivAt_const_cpow h0).HasDerivAt.comp_hasFDerivWithinAt x hf
+#align has_fderiv_within_at.const_cpow HasFDerivWithinAt.const_cpow
 
 theorem DifferentiableAt.cpow (hf : DifferentiableAt ℂ f x) (hg : DifferentiableAt ℂ g x)
     (h0 : 0 < (f x).re ∨ (f x).im ≠ 0) : DifferentiableAt ℂ (fun x => f x ^ g x) x :=
-  (hf.HasFderivAt.cpow hg.HasFderivAt h0).DifferentiableAt
+  (hf.HasFDerivAt.cpow hg.HasFDerivAt h0).DifferentiableAt
 #align differentiable_at.cpow DifferentiableAt.cpow
 
 theorem DifferentiableAt.const_cpow (hf : DifferentiableAt ℂ f x) (h0 : c ≠ 0 ∨ f x ≠ 0) :
     DifferentiableAt ℂ (fun x => c ^ f x) x :=
-  (hf.HasFderivAt.const_cpow h0).DifferentiableAt
+  (hf.HasFDerivAt.const_cpow h0).DifferentiableAt
 #align differentiable_at.const_cpow DifferentiableAt.const_cpow
 
 theorem DifferentiableWithinAt.cpow (hf : DifferentiableWithinAt ℂ f s x)
     (hg : DifferentiableWithinAt ℂ g s x) (h0 : 0 < (f x).re ∨ (f x).im ≠ 0) :
     DifferentiableWithinAt ℂ (fun x => f x ^ g x) s x :=
-  (hf.HasFderivWithinAt.cpow hg.HasFderivWithinAt h0).DifferentiableWithinAt
+  (hf.HasFDerivWithinAt.cpow hg.HasFDerivWithinAt h0).DifferentiableWithinAt
 #align differentiable_within_at.cpow DifferentiableWithinAt.cpow
 
 theorem DifferentiableWithinAt.const_cpow (hf : DifferentiableWithinAt ℂ f s x)
     (h0 : c ≠ 0 ∨ f x ≠ 0) : DifferentiableWithinAt ℂ (fun x => c ^ f x) s x :=
-  (hf.HasFderivWithinAt.const_cpow h0).DifferentiableWithinAt
+  (hf.HasFDerivWithinAt.const_cpow h0).DifferentiableWithinAt
 #align differentiable_within_at.const_cpow DifferentiableWithinAt.const_cpow
 
 end fderiv
@@ -279,23 +279,23 @@ namespace Real
 variable {x y z : ℝ}
 
 /-- `(x, y) ↦ x ^ y` is strictly differentiable at `p : ℝ × ℝ` such that `0 < p.fst`. -/
-theorem hasStrictFderivAt_rpow_of_pos (p : ℝ × ℝ) (hp : 0 < p.1) :
-    HasStrictFderivAt (fun x : ℝ × ℝ => x.1 ^ x.2)
+theorem hasStrictFDerivAt_rpow_of_pos (p : ℝ × ℝ) (hp : 0 < p.1) :
+    HasStrictFDerivAt (fun x : ℝ × ℝ => x.1 ^ x.2)
       ((p.2 * p.1 ^ (p.2 - 1)) • ContinuousLinearMap.fst ℝ ℝ ℝ +
         (p.1 ^ p.2 * log p.1) • ContinuousLinearMap.snd ℝ ℝ ℝ)
       p :=
   by
   have : (fun x : ℝ × ℝ => x.1 ^ x.2) =ᶠ[𝓝 p] fun x => exp (log x.1 * x.2) :=
     (continuous_at_fst.eventually (lt_mem_nhds hp)).mono fun p hp => rpow_def_of_pos hp _
-  refine' HasStrictFderivAt.congr_of_eventuallyEq _ this.symm
-  convert((has_strict_fderiv_at_fst.log hp.ne').mul hasStrictFderivAt_snd).exp
+  refine' HasStrictFDerivAt.congr_of_eventuallyEq _ this.symm
+  convert((has_strict_fderiv_at_fst.log hp.ne').mul hasStrictFDerivAt_snd).exp
   rw [rpow_sub_one hp.ne', ← rpow_def_of_pos hp, smul_add, smul_smul, mul_div_left_comm,
     div_eq_mul_inv, smul_smul, smul_smul, mul_assoc, add_comm]
-#align real.has_strict_fderiv_at_rpow_of_pos Real.hasStrictFderivAt_rpow_of_pos
+#align real.has_strict_fderiv_at_rpow_of_pos Real.hasStrictFDerivAt_rpow_of_pos
 
 /-- `(x, y) ↦ x ^ y` is strictly differentiable at `p : ℝ × ℝ` such that `p.fst < 0`. -/
-theorem hasStrictFderivAt_rpow_of_neg (p : ℝ × ℝ) (hp : p.1 < 0) :
-    HasStrictFderivAt (fun x : ℝ × ℝ => x.1 ^ x.2)
+theorem hasStrictFDerivAt_rpow_of_neg (p : ℝ × ℝ) (hp : p.1 < 0) :
+    HasStrictFDerivAt (fun x : ℝ × ℝ => x.1 ^ x.2)
       ((p.2 * p.1 ^ (p.2 - 1)) • ContinuousLinearMap.fst ℝ ℝ ℝ +
         (p.1 ^ p.2 * log p.1 - exp (log p.1 * p.2) * sin (p.2 * π) * π) •
           ContinuousLinearMap.snd ℝ ℝ ℝ)
@@ -303,15 +303,15 @@ theorem hasStrictFderivAt_rpow_of_neg (p : ℝ × ℝ) (hp : p.1 < 0) :
   by
   have : (fun x : ℝ × ℝ => x.1 ^ x.2) =ᶠ[𝓝 p] fun x => exp (log x.1 * x.2) * cos (x.2 * π) :=
     (continuous_at_fst.eventually (gt_mem_nhds hp)).mono fun p hp => rpow_def_of_neg hp _
-  refine' HasStrictFderivAt.congr_of_eventuallyEq _ this.symm
-  convert((has_strict_fderiv_at_fst.log hp.ne).mul hasStrictFderivAt_snd).exp.mul
+  refine' HasStrictFDerivAt.congr_of_eventuallyEq _ this.symm
+  convert((has_strict_fderiv_at_fst.log hp.ne).mul hasStrictFDerivAt_snd).exp.mul
       (has_strict_fderiv_at_snd.mul_const _).cos using
     1
   simp_rw [rpow_sub_one hp.ne, smul_add, ← add_assoc, smul_smul, ← add_smul, ← mul_assoc,
     mul_comm (cos _), ← rpow_def_of_neg hp]
   rw [div_eq_mul_inv, add_comm]
   congr 2 <;> ring
-#align real.has_strict_fderiv_at_rpow_of_neg Real.hasStrictFderivAt_rpow_of_neg
+#align real.has_strict_fderiv_at_rpow_of_neg Real.hasStrictFDerivAt_rpow_of_neg
 
 /-- The function `λ (x, y), x ^ y` is infinitely smooth at `(x, y)` unless `x = 0`. -/
 theorem contDiffAt_rpow_of_ne (p : ℝ × ℝ) (hp : p.1 ≠ 0) {n : ℕ∞} :
@@ -443,25 +443,25 @@ section fderiv
 variable {E : Type _} [NormedAddCommGroup E] [NormedSpace ℝ E] {f g : E → ℝ} {f' g' : E →L[ℝ] ℝ}
   {x : E} {s : Set E} {c p : ℝ} {n : ℕ∞}
 
-theorem HasFderivWithinAt.rpow (hf : HasFderivWithinAt f f' s x) (hg : HasFderivWithinAt g g' s x)
+theorem HasFDerivWithinAt.rpow (hf : HasFDerivWithinAt f f' s x) (hg : HasFDerivWithinAt g g' s x)
     (h : 0 < f x) :
-    HasFderivWithinAt (fun x => f x ^ g x)
+    HasFDerivWithinAt (fun x => f x ^ g x)
       ((g x * f x ^ (g x - 1)) • f' + (f x ^ g x * log (f x)) • g') s x :=
-  (hasStrictFderivAt_rpow_of_pos (f x, g x) h).HasFderivAt.comp_hasFderivWithinAt x (hf.Prod hg)
-#align has_fderiv_within_at.rpow HasFderivWithinAt.rpow
+  (hasStrictFDerivAt_rpow_of_pos (f x, g x) h).HasFDerivAt.comp_hasFDerivWithinAt x (hf.Prod hg)
+#align has_fderiv_within_at.rpow HasFDerivWithinAt.rpow
 
-theorem HasFderivAt.rpow (hf : HasFderivAt f f' x) (hg : HasFderivAt g g' x) (h : 0 < f x) :
-    HasFderivAt (fun x => f x ^ g x) ((g x * f x ^ (g x - 1)) • f' + (f x ^ g x * log (f x)) • g')
+theorem HasFDerivAt.rpow (hf : HasFDerivAt f f' x) (hg : HasFDerivAt g g' x) (h : 0 < f x) :
+    HasFDerivAt (fun x => f x ^ g x) ((g x * f x ^ (g x - 1)) • f' + (f x ^ g x * log (f x)) • g')
       x :=
-  (hasStrictFderivAt_rpow_of_pos (f x, g x) h).HasFderivAt.comp x (hf.Prod hg)
-#align has_fderiv_at.rpow HasFderivAt.rpow
+  (hasStrictFDerivAt_rpow_of_pos (f x, g x) h).HasFDerivAt.comp x (hf.Prod hg)
+#align has_fderiv_at.rpow HasFDerivAt.rpow
 
-theorem HasStrictFderivAt.rpow (hf : HasStrictFderivAt f f' x) (hg : HasStrictFderivAt g g' x)
+theorem HasStrictFDerivAt.rpow (hf : HasStrictFDerivAt f f' x) (hg : HasStrictFDerivAt g g' x)
     (h : 0 < f x) :
-    HasStrictFderivAt (fun x => f x ^ g x)
+    HasStrictFDerivAt (fun x => f x ^ g x)
       ((g x * f x ^ (g x - 1)) • f' + (f x ^ g x * log (f x)) • g') x :=
-  (hasStrictFderivAt_rpow_of_pos (f x, g x) h).comp x (hf.Prod hg)
-#align has_strict_fderiv_at.rpow HasStrictFderivAt.rpow
+  (hasStrictFDerivAt_rpow_of_pos (f x, g x) h).comp x (hf.Prod hg)
+#align has_strict_fderiv_at.rpow HasStrictFDerivAt.rpow
 
 theorem DifferentiableWithinAt.rpow (hf : DifferentiableWithinAt ℝ f s x)
     (hg : DifferentiableWithinAt ℝ g s x) (h : f x ≠ 0) :
@@ -483,30 +483,30 @@ theorem Differentiable.rpow (hf : Differentiable ℝ f) (hg : Differentiable ℝ
     Differentiable ℝ fun x => f x ^ g x := fun x => (hf x).rpow (hg x) (h x)
 #align differentiable.rpow Differentiable.rpow
 
-theorem HasFderivWithinAt.rpow_const (hf : HasFderivWithinAt f f' s x) (h : f x ≠ 0 ∨ 1 ≤ p) :
-    HasFderivWithinAt (fun x => f x ^ p) ((p * f x ^ (p - 1)) • f') s x :=
-  (hasDerivAt_rpow_const h).comp_hasFderivWithinAt x hf
-#align has_fderiv_within_at.rpow_const HasFderivWithinAt.rpow_const
+theorem HasFDerivWithinAt.rpow_const (hf : HasFDerivWithinAt f f' s x) (h : f x ≠ 0 ∨ 1 ≤ p) :
+    HasFDerivWithinAt (fun x => f x ^ p) ((p * f x ^ (p - 1)) • f') s x :=
+  (hasDerivAt_rpow_const h).comp_hasFDerivWithinAt x hf
+#align has_fderiv_within_at.rpow_const HasFDerivWithinAt.rpow_const
 
-theorem HasFderivAt.rpow_const (hf : HasFderivAt f f' x) (h : f x ≠ 0 ∨ 1 ≤ p) :
-    HasFderivAt (fun x => f x ^ p) ((p * f x ^ (p - 1)) • f') x :=
-  (hasDerivAt_rpow_const h).comp_hasFderivAt x hf
-#align has_fderiv_at.rpow_const HasFderivAt.rpow_const
+theorem HasFDerivAt.rpow_const (hf : HasFDerivAt f f' x) (h : f x ≠ 0 ∨ 1 ≤ p) :
+    HasFDerivAt (fun x => f x ^ p) ((p * f x ^ (p - 1)) • f') x :=
+  (hasDerivAt_rpow_const h).comp_hasFDerivAt x hf
+#align has_fderiv_at.rpow_const HasFDerivAt.rpow_const
 
-theorem HasStrictFderivAt.rpow_const (hf : HasStrictFderivAt f f' x) (h : f x ≠ 0 ∨ 1 ≤ p) :
-    HasStrictFderivAt (fun x => f x ^ p) ((p * f x ^ (p - 1)) • f') x :=
-  (hasStrictDerivAt_rpow_const h).comp_hasStrictFderivAt x hf
-#align has_strict_fderiv_at.rpow_const HasStrictFderivAt.rpow_const
+theorem HasStrictFDerivAt.rpow_const (hf : HasStrictFDerivAt f f' x) (h : f x ≠ 0 ∨ 1 ≤ p) :
+    HasStrictFDerivAt (fun x => f x ^ p) ((p * f x ^ (p - 1)) • f') x :=
+  (hasStrictDerivAt_rpow_const h).comp_hasStrictFDerivAt x hf
+#align has_strict_fderiv_at.rpow_const HasStrictFDerivAt.rpow_const
 
 theorem DifferentiableWithinAt.rpow_const (hf : DifferentiableWithinAt ℝ f s x)
     (h : f x ≠ 0 ∨ 1 ≤ p) : DifferentiableWithinAt ℝ (fun x => f x ^ p) s x :=
-  (hf.HasFderivWithinAt.rpow_const h).DifferentiableWithinAt
+  (hf.HasFDerivWithinAt.rpow_const h).DifferentiableWithinAt
 #align differentiable_within_at.rpow_const DifferentiableWithinAt.rpow_const
 
 @[simp]
 theorem DifferentiableAt.rpow_const (hf : DifferentiableAt ℝ f x) (h : f x ≠ 0 ∨ 1 ≤ p) :
     DifferentiableAt ℝ (fun x => f x ^ p) x :=
-  (hf.HasFderivAt.rpow_const h).DifferentiableAt
+  (hf.HasFDerivAt.rpow_const h).DifferentiableAt
 #align differentiable_at.rpow_const DifferentiableAt.rpow_const
 
 theorem DifferentiableOn.rpow_const (hf : DifferentiableOn ℝ f s) (h : ∀ x ∈ s, f x ≠ 0 ∨ 1 ≤ p) :
@@ -517,20 +517,20 @@ theorem Differentiable.rpow_const (hf : Differentiable ℝ f) (h : ∀ x, f x 
     Differentiable ℝ fun x => f x ^ p := fun x => (hf x).rpow_const (h x)
 #align differentiable.rpow_const Differentiable.rpow_const
 
-theorem HasFderivWithinAt.const_rpow (hf : HasFderivWithinAt f f' s x) (hc : 0 < c) :
-    HasFderivWithinAt (fun x => c ^ f x) ((c ^ f x * log c) • f') s x :=
-  (hasStrictDerivAt_const_rpow hc (f x)).HasDerivAt.comp_hasFderivWithinAt x hf
-#align has_fderiv_within_at.const_rpow HasFderivWithinAt.const_rpow
+theorem HasFDerivWithinAt.const_rpow (hf : HasFDerivWithinAt f f' s x) (hc : 0 < c) :
+    HasFDerivWithinAt (fun x => c ^ f x) ((c ^ f x * log c) • f') s x :=
+  (hasStrictDerivAt_const_rpow hc (f x)).HasDerivAt.comp_hasFDerivWithinAt x hf
+#align has_fderiv_within_at.const_rpow HasFDerivWithinAt.const_rpow
 
-theorem HasFderivAt.const_rpow (hf : HasFderivAt f f' x) (hc : 0 < c) :
-    HasFderivAt (fun x => c ^ f x) ((c ^ f x * log c) • f') x :=
-  (hasStrictDerivAt_const_rpow hc (f x)).HasDerivAt.comp_hasFderivAt x hf
-#align has_fderiv_at.const_rpow HasFderivAt.const_rpow
+theorem HasFDerivAt.const_rpow (hf : HasFDerivAt f f' x) (hc : 0 < c) :
+    HasFDerivAt (fun x => c ^ f x) ((c ^ f x * log c) • f') x :=
+  (hasStrictDerivAt_const_rpow hc (f x)).HasDerivAt.comp_hasFDerivAt x hf
+#align has_fderiv_at.const_rpow HasFDerivAt.const_rpow
 
-theorem HasStrictFderivAt.const_rpow (hf : HasStrictFderivAt f f' x) (hc : 0 < c) :
-    HasStrictFderivAt (fun x => c ^ f x) ((c ^ f x * log c) • f') x :=
-  (hasStrictDerivAt_const_rpow hc (f x)).comp_hasStrictFderivAt x hf
-#align has_strict_fderiv_at.const_rpow HasStrictFderivAt.const_rpow
+theorem HasStrictFDerivAt.const_rpow (hf : HasStrictFDerivAt f f' x) (hc : 0 < c) :
+    HasStrictFDerivAt (fun x => c ^ f x) ((c ^ f x * log c) • f') x :=
+  (hasStrictDerivAt_const_rpow hc (f x)).comp_hasStrictFDerivAt x hf
+#align has_strict_fderiv_at.const_rpow HasStrictFDerivAt.const_rpow
 
 theorem ContDiffWithinAt.rpow (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x)
     (h : f x ≠ 0) : ContDiffWithinAt ℝ n (fun x => f x ^ g x) s x :=
Diff
@@ -4,12 +4,12 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Chris Hughes, Abhimanyu Pallavi Sudhir, Jean Lo, Calle Sönne, Sébastien Gouëzel,
   Rémy Degenne
 
-! This file was ported from Lean 3 source module analysis.special_functions.pow_deriv
-! leanprover-community/mathlib commit da1d134ab55eb58347924920695d8200f4740694
+! This file was ported from Lean 3 source module analysis.special_functions.pow.deriv
+! leanprover-community/mathlib commit 0b9eaaa7686280fad8cce467f5c3c57ee6ce77f8
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
-import Mathbin.Analysis.SpecialFunctions.Pow
+import Mathbin.Analysis.SpecialFunctions.Pow.Continuity
 import Mathbin.Analysis.SpecialFunctions.Complex.LogDeriv
 import Mathbin.Analysis.Calculus.ExtendDeriv
 import Mathbin.Analysis.SpecialFunctions.Log.Deriv

Changes in mathlib4

mathlib3
mathlib4
chore: Rename nat_cast/int_cast/rat_cast to natCast/intCast/ratCast (#11486)

Now that I am defining NNRat.cast, I want a definitive answer to this naming issue. Plenty of lemmas in mathlib already use natCast/intCast/ratCast over nat_cast/int_cast/rat_cast, and this matches with the general expectation that underscore-separated name parts correspond to a single declaration.

Diff
@@ -659,7 +659,7 @@ theorem tendsto_one_plus_div_rpow_exp (t : ℝ) :
 /-- The function `(1 + t/x) ^ x` tends to `exp t` at `+∞` for naturals `x`. -/
 theorem tendsto_one_plus_div_pow_exp (t : ℝ) :
     Tendsto (fun x : ℕ => (1 + t / (x : ℝ)) ^ x) atTop (𝓝 (Real.exp t)) :=
-  ((tendsto_one_plus_div_rpow_exp t).comp tendsto_nat_cast_atTop_atTop).congr (by simp)
+  ((tendsto_one_plus_div_rpow_exp t).comp tendsto_natCast_atTop_atTop).congr (by simp)
 #align tendsto_one_plus_div_pow_exp tendsto_one_plus_div_pow_exp
 
 end Limits
chore: avoid Ne.def (adaptation for nightly-2024-03-27) (#11801)
Diff
@@ -224,7 +224,7 @@ theorem HasDerivWithinAt.cpow_const (hf : HasDerivWithinAt f f' s x)
 line, it is still real-differentiable, and the derivative is what one would formally expect. -/
 theorem hasDerivAt_ofReal_cpow {x : ℝ} (hx : x ≠ 0) {r : ℂ} (hr : r ≠ -1) :
     HasDerivAt (fun y : ℝ => (y : ℂ) ^ (r + 1) / (r + 1)) (x ^ r) x := by
-  rw [Ne.def, ← add_eq_zero_iff_eq_neg, ← Ne.def] at hr
+  rw [Ne, ← add_eq_zero_iff_eq_neg, ← Ne] at hr
   rcases lt_or_gt_of_ne hx.symm with (hx | hx)
   · -- easy case : `0 < x`
     -- Porting note: proof used to be
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
@@ -233,9 +233,9 @@ theorem hasDerivAt_ofReal_cpow {x : ℝ} (hx : x ≠ 0) {r : ℂ} (hr : r ≠ -1
     -- · rw [id.def, ofReal_re]; exact Or.inl hx
     apply HasDerivAt.comp_ofReal (e := fun y => (y : ℂ) ^ (r + 1) / (r + 1))
     convert HasDerivAt.div_const (𝕜 := ℂ) ?_ (r + 1) using 1
-    · exact (mul_div_cancel _ hr).symm
+    · exact (mul_div_cancel_right₀ _ hr).symm
     · convert HasDerivAt.cpow_const ?_ ?_ using 1
-      · rw [add_sub_cancel, mul_comm]; exact (mul_one _).symm
+      · rw [add_sub_cancel_right, mul_comm]; exact (mul_one _).symm
       · exact hasDerivAt_id (x : ℂ)
       · simp [hx]
   · -- harder case : `x < 0`
@@ -248,7 +248,7 @@ theorem hasDerivAt_ofReal_cpow {x : ℝ} (hx : x ≠ 0) {r : ℂ} (hr : r ≠ -1
     suffices HasDerivAt (fun y : ℝ => (-↑y) ^ (r + 1) * exp (↑π * I * (r + 1)))
         ((r + 1) * (-↑x) ^ r * exp (↑π * I * r)) x by
       convert this.div_const (r + 1) using 1
-      conv_rhs => rw [mul_assoc, mul_comm, mul_div_cancel _ hr]
+      conv_rhs => rw [mul_assoc, mul_comm, mul_div_cancel_right₀ _ hr]
     rw [mul_add ((π : ℂ) * _), mul_one, exp_add, exp_pi_mul_I, mul_comm (_ : ℂ) (-1 : ℂ),
       neg_one_mul]
     simp_rw [mul_neg, ← neg_mul, ← ofReal_neg]
@@ -261,7 +261,7 @@ theorem hasDerivAt_ofReal_cpow {x : ℝ} (hx : x ≠ 0) {r : ℂ} (hr : r ≠ -1
       exact this.comp_ofReal
     conv in ↑_ ^ _ => rw [(by ring : r = r + 1 - 1)]
     convert HasDerivAt.cpow_const ?_ ?_ using 1
-    · rw [add_sub_cancel, add_sub_cancel]; exact (mul_one _).symm
+    · rw [add_sub_cancel_right, add_sub_cancel_right]; exact (mul_one _).symm
     · exact hasDerivAt_id ((-x : ℝ) : ℂ)
     · simp [hx]
 #align has_deriv_at_of_real_cpow hasDerivAt_ofReal_cpow
chore: remove terminal, terminal refines (#10762)

I replaced a few "terminal" refine/refine's with exact.

The strategy was very simple-minded: essentially any refine whose following line had smaller indentation got replaced by exact and then I cleaned up the mess.

This PR certainly leaves some further terminal refines, but maybe the current change is beneficial.

Diff
@@ -400,7 +400,7 @@ theorem contDiff_rpow_const_of_le {p : ℝ} {n : ℕ} (h : ↑n ≤ p) :
   · have h1 : 1 ≤ p := le_trans (by simp) h
     rw [Nat.cast_succ, ← le_sub_iff_add_le] at h
     rw [contDiff_succ_iff_deriv, deriv_rpow_const' h1]
-    refine' ⟨differentiable_rpow_const h1, contDiff_const.mul (ihn h)⟩
+    exact ⟨differentiable_rpow_const h1, contDiff_const.mul (ihn h)⟩
 #align real.cont_diff_rpow_const_of_le Real.contDiff_rpow_const_of_le
 
 theorem contDiffAt_rpow_const_of_le {x p : ℝ} {n : ℕ} (h : ↑n ≤ p) :
feat: DifferentiableOn.cpow (#10203)

direct application of the content above it.

Co-authored-by: L Lllvvuu <git@llllvvuu.dev>

Diff
@@ -131,6 +131,22 @@ theorem DifferentiableWithinAt.const_cpow (hf : DifferentiableWithinAt ℂ f s x
   (hf.hasFDerivWithinAt.const_cpow h0).differentiableWithinAt
 #align differentiable_within_at.const_cpow DifferentiableWithinAt.const_cpow
 
+theorem DifferentiableOn.cpow (hf : DifferentiableOn ℂ f s) (hg : DifferentiableOn ℂ g s)
+    (h0 : Set.MapsTo f s slitPlane) : DifferentiableOn ℂ (fun x ↦ f x ^ g x) s :=
+  fun x hx ↦ (hf x hx).cpow (hg x hx) (h0 hx)
+
+theorem DifferentiableOn.const_cpow (hf : DifferentiableOn ℂ f s)
+    (h0 : c ≠ 0 ∨ ∀ x ∈ s, f x ≠ 0) : DifferentiableOn ℂ (fun x ↦ c ^ f x) s :=
+  fun x hx ↦ (hf x hx).const_cpow (h0.imp_right fun h ↦ h x hx)
+
+theorem Differentiable.cpow (hf : Differentiable ℂ f) (hg : Differentiable ℂ g)
+    (h0 : ∀ x, f x ∈ slitPlane) : Differentiable ℂ (fun x ↦ f x ^ g x) :=
+  fun x ↦ (hf x).cpow (hg x) (h0 x)
+
+theorem Differentiable.const_cpow (hf : Differentiable ℂ f)
+    (h0 : c ≠ 0 ∨ ∀ x, f x ≠ 0) : Differentiable ℂ (fun x ↦ c ^ f x) :=
+  fun x ↦ (hf x).const_cpow (h0.imp_right fun h ↦ h x)
+
 end fderiv
 
 section deriv
chore(*): use notation for nhds (#10416)

Also fix GeneralizedContinuedFraction.of_convergence: it worked for the Preorder.topology only.

Diff
@@ -223,7 +223,7 @@ theorem hasDerivAt_ofReal_cpow {x : ℝ} (hx : x ≠ 0) {r : ℂ} (hr : r ≠ -1
       · exact hasDerivAt_id (x : ℂ)
       · simp [hx]
   · -- harder case : `x < 0`
-    have : ∀ᶠ y : ℝ in nhds x,
+    have : ∀ᶠ y : ℝ in 𝓝 x,
         (y : ℂ) ^ (r + 1) / (r + 1) = (-y : ℂ) ^ (r + 1) * exp (π * I * (r + 1)) / (r + 1) := by
       refine' Filter.eventually_of_mem (Iio_mem_nhds hx) fun y hy => _
       rw [ofReal_cpow_of_nonpos (le_of_lt hy)]
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
@@ -28,11 +28,11 @@ open Filter
 
 namespace Complex
 
-theorem hasStrictFDerivAt_cpow {p : ℂ × ℂ} (hp : 0 < p.1.re ∨ p.1.im ≠ 0) :
+theorem hasStrictFDerivAt_cpow {p : ℂ × ℂ} (hp : p.1 ∈ slitPlane) :
     HasStrictFDerivAt (fun x : ℂ × ℂ => x.1 ^ x.2)
       ((p.2 * p.1 ^ (p.2 - 1)) • ContinuousLinearMap.fst ℂ ℂ ℂ +
         (p.1 ^ p.2 * log p.1) • ContinuousLinearMap.snd ℂ ℂ ℂ) p := by
-  have A : p.1 ≠ 0 := by intro h; simp [h, lt_irrefl] at hp
+  have A : p.1 ≠ 0 := slitPlane_ne_zero hp
   have : (fun x : ℂ × ℂ => x.1 ^ x.2) =ᶠ[𝓝 p] fun x => exp (log x.1 * x.2) :=
     ((isOpen_ne.preimage continuous_fst).eventually_mem A).mono fun p hp =>
       cpow_def_of_ne_zero hp _
@@ -42,7 +42,7 @@ theorem hasStrictFDerivAt_cpow {p : ℂ × ℂ} (hp : 0 < p.1.re ∨ p.1.im ≠
     ((hasStrictFDerivAt_fst.clog hp).mul hasStrictFDerivAt_snd).cexp
 #align complex.has_strict_fderiv_at_cpow Complex.hasStrictFDerivAt_cpow
 
-theorem hasStrictFDerivAt_cpow' {x y : ℂ} (hp : 0 < x.re ∨ x.im ≠ 0) :
+theorem hasStrictFDerivAt_cpow' {x y : ℂ} (hp : x ∈ slitPlane) :
     HasStrictFDerivAt (fun x : ℂ × ℂ => x.1 ^ x.2)
       ((y * x ^ (y - 1)) • ContinuousLinearMap.fst ℂ ℂ ℂ +
         (x ^ y * log x) • ContinuousLinearMap.snd ℂ ℂ ℂ) (x, y) :=
@@ -60,7 +60,7 @@ theorem hasStrictDerivAt_const_cpow {x y : ℂ} (h : x ≠ 0 ∨ y ≠ 0) :
       ((hasStrictDerivAt_id y).const_mul (log x)).cexp
 #align complex.has_strict_deriv_at_const_cpow Complex.hasStrictDerivAt_const_cpow
 
-theorem hasFDerivAt_cpow {p : ℂ × ℂ} (hp : 0 < p.1.re ∨ p.1.im ≠ 0) :
+theorem hasFDerivAt_cpow {p : ℂ × ℂ} (hp : p.1 ∈ slitPlane) :
     HasFDerivAt (fun x : ℂ × ℂ => x.1 ^ x.2)
       ((p.2 * p.1 ^ (p.2 - 1)) • ContinuousLinearMap.fst ℂ ℂ ℂ +
         (p.1 ^ p.2 * log p.1) • ContinuousLinearMap.snd ℂ ℂ ℂ) p :=
@@ -77,7 +77,7 @@ variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℂ E] {f g : E → ℂ
   {x : E} {s : Set E} {c : ℂ}
 
 theorem HasStrictFDerivAt.cpow (hf : HasStrictFDerivAt f f' x) (hg : HasStrictFDerivAt g g' x)
-    (h0 : 0 < (f x).re ∨ (f x).im ≠ 0) : HasStrictFDerivAt (fun x => f x ^ g x)
+    (h0 : f x ∈ slitPlane) : HasStrictFDerivAt (fun x => f x ^ g x)
       ((g x * f x ^ (g x - 1)) • f' + (f x ^ g x * Complex.log (f x)) • g') x := by
   convert (@hasStrictFDerivAt_cpow ((fun x => (f x, g x)) x) h0).comp x (hf.prod hg)
 #align has_strict_fderiv_at.cpow HasStrictFDerivAt.cpow
@@ -88,7 +88,7 @@ theorem HasStrictFDerivAt.const_cpow (hf : HasStrictFDerivAt f f' x) (h0 : c ≠
 #align has_strict_fderiv_at.const_cpow HasStrictFDerivAt.const_cpow
 
 theorem HasFDerivAt.cpow (hf : HasFDerivAt f f' x) (hg : HasFDerivAt g g' x)
-    (h0 : 0 < (f x).re ∨ (f x).im ≠ 0) : HasFDerivAt (fun x => f x ^ g x)
+    (h0 : f x ∈ slitPlane) : HasFDerivAt (fun x => f x ^ g x)
       ((g x * f x ^ (g x - 1)) • f' + (f x ^ g x * Complex.log (f x)) • g') x := by
   convert (@Complex.hasFDerivAt_cpow ((fun x => (f x, g x)) x) h0).comp x (hf.prod hg)
 #align has_fderiv_at.cpow HasFDerivAt.cpow
@@ -99,7 +99,7 @@ theorem HasFDerivAt.const_cpow (hf : HasFDerivAt f f' x) (h0 : c ≠ 0 ∨ f x 
 #align has_fderiv_at.const_cpow HasFDerivAt.const_cpow
 
 theorem HasFDerivWithinAt.cpow (hf : HasFDerivWithinAt f f' s x) (hg : HasFDerivWithinAt g g' s x)
-    (h0 : 0 < (f x).re ∨ (f x).im ≠ 0) : HasFDerivWithinAt (fun x => f x ^ g x)
+    (h0 : f x ∈ slitPlane) : HasFDerivWithinAt (fun x => f x ^ g x)
       ((g x * f x ^ (g x - 1)) • f' + (f x ^ g x * Complex.log (f x)) • g') s x := by
   convert
     (@Complex.hasFDerivAt_cpow ((fun x => (f x, g x)) x) h0).comp_hasFDerivWithinAt x (hf.prod hg)
@@ -111,7 +111,7 @@ theorem HasFDerivWithinAt.const_cpow (hf : HasFDerivWithinAt f f' s x) (h0 : c 
 #align has_fderiv_within_at.const_cpow HasFDerivWithinAt.const_cpow
 
 theorem DifferentiableAt.cpow (hf : DifferentiableAt ℂ f x) (hg : DifferentiableAt ℂ g x)
-    (h0 : 0 < (f x).re ∨ (f x).im ≠ 0) : DifferentiableAt ℂ (fun x => f x ^ g x) x :=
+    (h0 : f x ∈ slitPlane) : DifferentiableAt ℂ (fun x => f x ^ g x) x :=
   (hf.hasFDerivAt.cpow hg.hasFDerivAt h0).differentiableAt
 #align differentiable_at.cpow DifferentiableAt.cpow
 
@@ -121,7 +121,7 @@ theorem DifferentiableAt.const_cpow (hf : DifferentiableAt ℂ f x) (h0 : c ≠
 #align differentiable_at.const_cpow DifferentiableAt.const_cpow
 
 theorem DifferentiableWithinAt.cpow (hf : DifferentiableWithinAt ℂ f s x)
-    (hg : DifferentiableWithinAt ℂ g s x) (h0 : 0 < (f x).re ∨ (f x).im ≠ 0) :
+    (hg : DifferentiableWithinAt ℂ g s x) (h0 : f x ∈ slitPlane) :
     DifferentiableWithinAt ℂ (fun x => f x ^ g x) s x :=
   (hf.hasFDerivWithinAt.cpow hg.hasFDerivWithinAt h0).differentiableWithinAt
 #align differentiable_within_at.cpow DifferentiableWithinAt.cpow
@@ -149,7 +149,7 @@ private theorem aux : ((g x * f x ^ (g x - 1)) • (1 : ℂ →L[ℂ] ℂ).smulR
     ContinuousLinearMap.coe_smul']
 
 nonrec theorem HasStrictDerivAt.cpow (hf : HasStrictDerivAt f f' x) (hg : HasStrictDerivAt g g' x)
-    (h0 : 0 < (f x).re ∨ (f x).im ≠ 0) : HasStrictDerivAt (fun x => f x ^ g x)
+    (h0 : f x ∈ slitPlane) : HasStrictDerivAt (fun x => f x ^ g x)
       (g x * f x ^ (g x - 1) * f' + f x ^ g x * Complex.log (f x) * g') x := by
   simpa using (hf.cpow hg h0).hasStrictDerivAt
 #align has_strict_deriv_at.cpow HasStrictDerivAt.cpow
@@ -159,20 +159,20 @@ theorem HasStrictDerivAt.const_cpow (hf : HasStrictDerivAt f f' x) (h : c ≠ 0
   (hasStrictDerivAt_const_cpow h).comp x hf
 #align has_strict_deriv_at.const_cpow HasStrictDerivAt.const_cpow
 
-theorem Complex.hasStrictDerivAt_cpow_const (h : 0 < x.re ∨ x.im ≠ 0) :
+theorem Complex.hasStrictDerivAt_cpow_const (h : x ∈ slitPlane) :
     HasStrictDerivAt (fun z : ℂ => z ^ c) (c * x ^ (c - 1)) x := by
   simpa only [mul_zero, add_zero, mul_one] using
     (hasStrictDerivAt_id x).cpow (hasStrictDerivAt_const x c) h
 #align complex.has_strict_deriv_at_cpow_const Complex.hasStrictDerivAt_cpow_const
 
 theorem HasStrictDerivAt.cpow_const (hf : HasStrictDerivAt f f' x)
-    (h0 : 0 < (f x).re ∨ (f x).im ≠ 0) :
+    (h0 : f x ∈ slitPlane) :
     HasStrictDerivAt (fun x => f x ^ c) (c * f x ^ (c - 1) * f') x :=
   (Complex.hasStrictDerivAt_cpow_const h0).comp x hf
 #align has_strict_deriv_at.cpow_const HasStrictDerivAt.cpow_const
 
 theorem HasDerivAt.cpow (hf : HasDerivAt f f' x) (hg : HasDerivAt g g' x)
-    (h0 : 0 < (f x).re ∨ (f x).im ≠ 0) : HasDerivAt (fun x => f x ^ g x)
+    (h0 : f x ∈ slitPlane) : HasDerivAt (fun x => f x ^ g x)
       (g x * f x ^ (g x - 1) * f' + f x ^ g x * Complex.log (f x) * g') x := by
   simpa only [aux] using (hf.hasFDerivAt.cpow hg h0).hasDerivAt
 #align has_deriv_at.cpow HasDerivAt.cpow
@@ -182,13 +182,13 @@ theorem HasDerivAt.const_cpow (hf : HasDerivAt f f' x) (h0 : c ≠ 0 ∨ f x ≠
   (hasStrictDerivAt_const_cpow h0).hasDerivAt.comp x hf
 #align has_deriv_at.const_cpow HasDerivAt.const_cpow
 
-theorem HasDerivAt.cpow_const (hf : HasDerivAt f f' x) (h0 : 0 < (f x).re ∨ (f x).im ≠ 0) :
+theorem HasDerivAt.cpow_const (hf : HasDerivAt f f' x) (h0 : f x ∈ slitPlane) :
     HasDerivAt (fun x => f x ^ c) (c * f x ^ (c - 1) * f') x :=
   (Complex.hasStrictDerivAt_cpow_const h0).hasDerivAt.comp x hf
 #align has_deriv_at.cpow_const HasDerivAt.cpow_const
 
 theorem HasDerivWithinAt.cpow (hf : HasDerivWithinAt f f' s x) (hg : HasDerivWithinAt g g' s x)
-    (h0 : 0 < (f x).re ∨ (f x).im ≠ 0) : HasDerivWithinAt (fun x => f x ^ g x)
+    (h0 : f x ∈ slitPlane) : HasDerivWithinAt (fun x => f x ^ g x)
       (g x * f x ^ (g x - 1) * f' + f x ^ g x * Complex.log (f x) * g') s x := by
   simpa only [aux] using (hf.hasFDerivWithinAt.cpow hg h0).hasDerivWithinAt
 #align has_deriv_within_at.cpow HasDerivWithinAt.cpow
@@ -199,7 +199,7 @@ theorem HasDerivWithinAt.const_cpow (hf : HasDerivWithinAt f f' s x) (h0 : c ≠
 #align has_deriv_within_at.const_cpow HasDerivWithinAt.const_cpow
 
 theorem HasDerivWithinAt.cpow_const (hf : HasDerivWithinAt f f' s x)
-    (h0 : 0 < (f x).re ∨ (f x).im ≠ 0) :
+    (h0 : f x ∈ slitPlane) :
     HasDerivWithinAt (fun x => f x ^ c) (c * f x ^ (c - 1) * f') s x :=
   (Complex.hasStrictDerivAt_cpow_const h0).hasDerivAt.comp_hasDerivWithinAt x hf
 #align has_deriv_within_at.cpow_const HasDerivWithinAt.cpow_const
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
@@ -236,9 +236,9 @@ theorem hasDerivAt_ofReal_cpow {x : ℝ} (hx : x ≠ 0) {r : ℂ} (hr : r ≠ -1
     rw [mul_add ((π : ℂ) * _), mul_one, exp_add, exp_pi_mul_I, mul_comm (_ : ℂ) (-1 : ℂ),
       neg_one_mul]
     simp_rw [mul_neg, ← neg_mul, ← ofReal_neg]
-    suffices HasDerivAt (fun y : ℝ => ↑(-y) ^ (r + 1)) (-(r + 1) * ↑(-x) ^ r) x by
+    suffices HasDerivAt (fun y : ℝ => (↑(-y) : ℂ) ^ (r + 1)) (-(r + 1) * ↑(-x) ^ r) x by
       convert this.neg.mul_const _ using 1; ring
-    suffices HasDerivAt (fun y : ℝ => ↑y ^ (r + 1)) ((r + 1) * ↑(-x) ^ r) (-x) by
+    suffices HasDerivAt (fun y : ℝ => (y : ℂ) ^ (r + 1)) ((r + 1) * ↑(-x) ^ r) (-x) by
       convert @HasDerivAt.scomp ℝ _ ℂ _ _ x ℝ _ _ _ _ _ _ _ _ this (hasDerivAt_neg x) using 1
       rw [real_smul, ofReal_neg 1, ofReal_one]; ring
     suffices HasDerivAt (fun y : ℂ => y ^ (r + 1)) ((r + 1) * ↑(-x) ^ r) ↑(-x) by
@@ -329,7 +329,7 @@ lemma differentiableAt_rpow_const_of_ne (p : ℝ) {x : ℝ} (hx : x ≠ 0) :
   (hasStrictDerivAt_rpow_const_of_ne hx p).differentiableAt
 
 lemma differentiableOn_rpow_const (p : ℝ) :
-    DifferentiableOn ℝ (fun x => x ^ p) {0}ᶜ :=
+    DifferentiableOn ℝ (fun x => (x : ℝ) ^ p) {0}ᶜ :=
   fun _ hx => (Real.differentiableAt_rpow_const_of_ne p hx).differentiableWithinAt
 
 /-- This lemma says that `fun x => a ^ x` is strictly differentiable for `a < 0`. Note that these
chore: update/remove heart beat bumps (#6860)

We clean up heart beat bumps after #6474.

Diff
@@ -204,7 +204,6 @@ theorem HasDerivWithinAt.cpow_const (hf : HasDerivWithinAt f f' s x)
   (Complex.hasStrictDerivAt_cpow_const h0).hasDerivAt.comp_hasDerivWithinAt x hf
 #align has_deriv_within_at.cpow_const HasDerivWithinAt.cpow_const
 
-set_option maxHeartbeats 1000000 in
 /-- Although `fun x => x ^ r` for fixed `r` is *not* complex-differentiable along the negative real
 line, it is still real-differentiable, and the derivative is what one would formally expect. -/
 theorem hasDerivAt_ofReal_cpow {x : ℝ} (hx : x ≠ 0) {r : ℂ} (hr : r ≠ -1) :
@@ -270,7 +269,6 @@ theorem hasStrictFDerivAt_rpow_of_pos (p : ℝ × ℝ) (hp : 0 < p.1) :
     div_eq_mul_inv, smul_smul, smul_smul, mul_assoc, add_comm]
 #align real.has_strict_fderiv_at_rpow_of_pos Real.hasStrictFDerivAt_rpow_of_pos
 
-set_option maxHeartbeats 1000000 in
 /-- `(x, y) ↦ x ^ y` is strictly differentiable at `p : ℝ × ℝ` such that `p.fst < 0`. -/
 theorem hasStrictFDerivAt_rpow_of_neg (p : ℝ × ℝ) (hp : p.1 < 0) :
     HasStrictFDerivAt (fun x : ℝ × ℝ => x.1 ^ x.2)
chore: drop MulZeroClass. in mul_zero/zero_mul (#6682)

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

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

Diff
@@ -53,7 +53,7 @@ theorem hasStrictDerivAt_const_cpow {x y : ℂ} (h : x ≠ 0 ∨ y ≠ 0) :
     HasStrictDerivAt (fun y => x ^ y) (x ^ y * log x) y := by
   rcases em (x = 0) with (rfl | hx)
   · replace h := h.neg_resolve_left rfl
-    rw [log_zero, MulZeroClass.mul_zero]
+    rw [log_zero, mul_zero]
     refine' (hasStrictDerivAt_const _ 0).congr_of_eventuallyEq _
     exact (isOpen_ne.eventually_mem h).mono fun y hy => (zero_cpow hy).symm
   · simpa only [cpow_def_of_ne_zero hx, mul_one] using
@@ -161,7 +161,7 @@ theorem HasStrictDerivAt.const_cpow (hf : HasStrictDerivAt f f' x) (h : c ≠ 0
 
 theorem Complex.hasStrictDerivAt_cpow_const (h : 0 < x.re ∨ x.im ≠ 0) :
     HasStrictDerivAt (fun z : ℂ => z ^ c) (c * x ^ (c - 1)) x := by
-  simpa only [MulZeroClass.mul_zero, add_zero, mul_one] using
+  simpa only [mul_zero, add_zero, mul_one] using
     (hasStrictDerivAt_id x).cpow (hasStrictDerivAt_const x c) h
 #align complex.has_strict_deriv_at_cpow_const Complex.hasStrictDerivAt_cpow_const
 
chore: banish Type _ and Sort _ (#6499)

We remove all possible occurences of Type _ and Sort _ in favor of Type* and Sort*.

This has nice performance benefits.

Diff
@@ -73,7 +73,7 @@ section fderiv
 
 open Complex
 
-variable {E : Type _} [NormedAddCommGroup E] [NormedSpace ℂ E] {f g : E → ℂ} {f' g' : E →L[ℂ] ℂ}
+variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℂ E] {f g : E → ℂ} {f' g' : E →L[ℂ] ℂ}
   {x : E} {s : Set E} {c : ℂ}
 
 theorem HasStrictFDerivAt.cpow (hf : HasStrictFDerivAt f f' x) (hg : HasStrictFDerivAt g g' x)
@@ -413,7 +413,7 @@ open Real
 
 section fderiv
 
-variable {E : Type _} [NormedAddCommGroup E] [NormedSpace ℝ E] {f g : E → ℝ} {f' g' : E →L[ℝ] ℝ}
+variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] {f g : E → ℝ} {f' g' : E →L[ℝ] ℝ}
   {x : E} {s : Set E} {c p : ℝ} {n : ℕ∞}
 
 theorem HasFDerivWithinAt.rpow (hf : HasFDerivWithinAt f f' s x) (hg : HasFDerivWithinAt g g' s x)
chore(Deriv): rename some files (#6167)

Move some files to Analysis/Calculus/FDeriv

Diff
@@ -6,7 +6,7 @@ Authors: Chris Hughes, Abhimanyu Pallavi Sudhir, Jean Lo, Calle Sönne, Sébasti
 -/
 import Mathlib.Analysis.SpecialFunctions.Pow.Continuity
 import Mathlib.Analysis.SpecialFunctions.Complex.LogDeriv
-import Mathlib.Analysis.Calculus.ExtendDeriv
+import Mathlib.Analysis.Calculus.FDeriv.Extend
 import Mathlib.Analysis.Calculus.Deriv.Prod
 import Mathlib.Analysis.SpecialFunctions.Log.Deriv
 import Mathlib.Analysis.SpecialFunctions.Trigonometric.Deriv
feat: miscellaneous lemmas about properties of log and rpow (#5987)
Diff
@@ -326,6 +326,14 @@ theorem hasStrictDerivAt_const_rpow {a : ℝ} (ha : 0 < a) (x : ℝ) :
   simpa using (hasStrictDerivAt_const _ _).rpow (hasStrictDerivAt_id x) ha
 #align real.has_strict_deriv_at_const_rpow Real.hasStrictDerivAt_const_rpow
 
+lemma differentiableAt_rpow_const_of_ne (p : ℝ) {x : ℝ} (hx : x ≠ 0) :
+    DifferentiableAt ℝ (fun x => x ^ p) x :=
+  (hasStrictDerivAt_rpow_const_of_ne hx p).differentiableAt
+
+lemma differentiableOn_rpow_const (p : ℝ) :
+    DifferentiableOn ℝ (fun x => x ^ p) {0}ᶜ :=
+  fun _ hx => (Real.differentiableAt_rpow_const_of_ne p hx).differentiableWithinAt
+
 /-- This lemma says that `fun x => a ^ x` is strictly differentiable for `a < 0`. Note that these
 values of `a` are outside of the "official" domain of `a ^ x`, and we may redefine `a ^ x`
 for negative `a` if some other definition will be more convenient. -/
@@ -598,6 +606,22 @@ theorem deriv_rpow_const (hf : DifferentiableAt ℝ f x) (hx : f x ≠ 0 ∨ 1 
   (hf.hasDerivAt.rpow_const hx).deriv
 #align deriv_rpow_const deriv_rpow_const
 
+lemma isTheta_deriv_rpow_const_atTop {p : ℝ} (hp : p ≠ 0) :
+    deriv (fun (x:ℝ) => x ^ p) =Θ[atTop] fun x => x ^ (p-1) := by
+  calc deriv (fun (x:ℝ) => x ^ p) =ᶠ[atTop] fun x => p * x ^ (p - 1) := by
+              filter_upwards [eventually_ne_atTop 0] with x hx
+              rw [Real.deriv_rpow_const (Or.inl hx)]
+       _ =Θ[atTop] fun x => x ^ (p-1) :=
+              Asymptotics.IsTheta.const_mul_left hp Asymptotics.isTheta_rfl
+
+lemma isBigO_deriv_rpow_const_atTop (p : ℝ) :
+    deriv (fun (x:ℝ) => x ^ p) =O[atTop] fun x => x ^ (p-1) := by
+  rcases eq_or_ne p 0 with rfl | hp
+  case inl =>
+    simp [zero_sub, Real.rpow_neg_one, Real.rpow_zero, deriv_const', Asymptotics.isBigO_zero]
+  case inr =>
+    exact (isTheta_deriv_rpow_const_atTop hp).1
+
 end deriv
 
 end Differentiability
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
@@ -3,11 +3,6 @@ Copyright (c) 2018 Chris Hughes. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Chris Hughes, Abhimanyu Pallavi Sudhir, Jean Lo, Calle Sönne, Sébastien Gouëzel,
   Rémy Degenne
-
-! This file was ported from Lean 3 source module analysis.special_functions.pow.deriv
-! leanprover-community/mathlib commit 3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.Analysis.SpecialFunctions.Pow.Continuity
 import Mathlib.Analysis.SpecialFunctions.Complex.LogDeriv
@@ -16,6 +11,8 @@ import Mathlib.Analysis.Calculus.Deriv.Prod
 import Mathlib.Analysis.SpecialFunctions.Log.Deriv
 import Mathlib.Analysis.SpecialFunctions.Trigonometric.Deriv
 
+#align_import analysis.special_functions.pow.deriv from "leanprover-community/mathlib"@"3bce8d800a6f2b8f63fe1e588fd76a9ff4adcebe"
+
 /-!
 # Derivatives of power function on `ℂ`, `ℝ`, `ℝ≥0`, and `ℝ≥0∞`
 
chore: use ofReal instead of of_real in lemma names (#4934)
Diff
@@ -210,16 +210,16 @@ theorem HasDerivWithinAt.cpow_const (hf : HasDerivWithinAt f f' s x)
 set_option maxHeartbeats 1000000 in
 /-- Although `fun x => x ^ r` for fixed `r` is *not* complex-differentiable along the negative real
 line, it is still real-differentiable, and the derivative is what one would formally expect. -/
-theorem hasDerivAt_of_real_cpow {x : ℝ} (hx : x ≠ 0) {r : ℂ} (hr : r ≠ -1) :
+theorem hasDerivAt_ofReal_cpow {x : ℝ} (hx : x ≠ 0) {r : ℂ} (hr : r ≠ -1) :
     HasDerivAt (fun y : ℝ => (y : ℂ) ^ (r + 1) / (r + 1)) (x ^ r) x := by
   rw [Ne.def, ← add_eq_zero_iff_eq_neg, ← Ne.def] at hr
   rcases lt_or_gt_of_ne hx.symm with (hx | hx)
   · -- easy case : `0 < x`
     -- Porting note: proof used to be
-    -- convert (((hasDerivAt_id (x : ℂ)).cpow_const _).div_const (r + 1)).comp_of_real using 1
+    -- convert (((hasDerivAt_id (x : ℂ)).cpow_const _).div_const (r + 1)).comp_ofReal using 1
     -- · rw [add_sub_cancel, id.def, mul_one, mul_comm, mul_div_cancel _ hr]
-    -- · rw [id.def, of_real_re]; exact Or.inl hx
-    apply HasDerivAt.comp_of_real (e := fun y => (y : ℂ) ^ (r + 1) / (r + 1))
+    -- · rw [id.def, ofReal_re]; exact Or.inl hx
+    apply HasDerivAt.comp_ofReal (e := fun y => (y : ℂ) ^ (r + 1) / (r + 1))
     convert HasDerivAt.div_const (𝕜 := ℂ) ?_ (r + 1) using 1
     · exact (mul_div_cancel _ hr).symm
     · convert HasDerivAt.cpow_const ?_ ?_ using 1
@@ -230,9 +230,9 @@ theorem hasDerivAt_of_real_cpow {x : ℝ} (hx : x ≠ 0) {r : ℂ} (hr : r ≠ -
     have : ∀ᶠ y : ℝ in nhds x,
         (y : ℂ) ^ (r + 1) / (r + 1) = (-y : ℂ) ^ (r + 1) * exp (π * I * (r + 1)) / (r + 1) := by
       refine' Filter.eventually_of_mem (Iio_mem_nhds hx) fun y hy => _
-      rw [of_real_cpow_of_nonpos (le_of_lt hy)]
+      rw [ofReal_cpow_of_nonpos (le_of_lt hy)]
     refine' HasDerivAt.congr_of_eventuallyEq _ this
-    rw [of_real_cpow_of_nonpos (le_of_lt hx)]
+    rw [ofReal_cpow_of_nonpos (le_of_lt hx)]
     suffices HasDerivAt (fun y : ℝ => (-↑y) ^ (r + 1) * exp (↑π * I * (r + 1)))
         ((r + 1) * (-↑x) ^ r * exp (↑π * I * r)) x by
       convert this.div_const (r + 1) using 1
@@ -246,13 +246,13 @@ theorem hasDerivAt_of_real_cpow {x : ℝ} (hx : x ≠ 0) {r : ℂ} (hr : r ≠ -
       convert @HasDerivAt.scomp ℝ _ ℂ _ _ x ℝ _ _ _ _ _ _ _ _ this (hasDerivAt_neg x) using 1
       rw [real_smul, ofReal_neg 1, ofReal_one]; ring
     suffices HasDerivAt (fun y : ℂ => y ^ (r + 1)) ((r + 1) * ↑(-x) ^ r) ↑(-x) by
-      exact this.comp_of_real
+      exact this.comp_ofReal
     conv in ↑_ ^ _ => rw [(by ring : r = r + 1 - 1)]
     convert HasDerivAt.cpow_const ?_ ?_ using 1
     · rw [add_sub_cancel, add_sub_cancel]; exact (mul_one _).symm
     · exact hasDerivAt_id ((-x : ℝ) : ℂ)
     · simp [hx]
-#align has_deriv_at_of_real_cpow hasDerivAt_of_real_cpow
+#align has_deriv_at_of_real_cpow hasDerivAt_ofReal_cpow
 
 end deriv
 
feat: port Analysis.SpecialFunctions.Pow.Deriv (#4689)

Co-authored-by: Moritz Firsching <firsching@google.com> Co-authored-by: Johan Commelin <johan@commelin.net>

Dependencies 12 + 941

942 files ported (98.7%)
411696 lines ported (98.7%)
Show graph

The unported dependencies are

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