Skip to content

Commit

Permalink
chore: use ofReal instead of of_real in lemma names (#4934)
Browse files Browse the repository at this point in the history
  • Loading branch information
urkud committed Jun 10, 2023
1 parent 3280dcc commit 9dd22b8
Show file tree
Hide file tree
Showing 15 changed files with 101 additions and 105 deletions.
8 changes: 4 additions & 4 deletions Mathlib/Analysis/Complex/RealDeriv.lean
Expand Up @@ -135,17 +135,17 @@ theorem HasDerivWithinAt.complexToReal_fderiv {f : ℂ → ℂ} {s : Set ℂ} {f

/-- If a complex function `e` is differentiable at a real point, then its restriction to `ℝ` is
differentiable there as a function `ℝ → ℂ`, with the same derivative. -/
theorem HasDerivAt.comp_of_real (hf : HasDerivAt e e' ↑z) : HasDerivAt (fun y : ℝ => e ↑y) e' z :=
theorem HasDerivAt.comp_ofReal (hf : HasDerivAt e e' ↑z) : HasDerivAt (fun y : ℝ => e ↑y) e' z :=
by simpa only [ofRealClm_apply, ofReal_one, mul_one] using hf.comp z ofRealClm.hasDerivAt
#align has_deriv_at.comp_of_real HasDerivAt.comp_of_real
#align has_deriv_at.comp_of_real HasDerivAt.comp_ofReal

/-- If a function `f : ℝ → ℝ` is differentiable at a (real) point `x`, then it is also
differentiable as a function `ℝ → ℂ`. -/
theorem HasDerivAt.of_real_comp {f : ℝ → ℝ} {u : ℝ} (hf : HasDerivAt f u z) :
theorem HasDerivAt.ofReal_comp {f : ℝ → ℝ} {u : ℝ} (hf : HasDerivAt f u z) :
HasDerivAt (fun y : ℝ => ↑(f y) : ℝ → ℂ) u z := by
simpa only [ofRealClm_apply, ofReal_one, real_smul, mul_one] using
ofRealClm.hasDerivAt.scomp z hf
#align has_deriv_at.of_real_comp HasDerivAt.of_real_comp
#align has_deriv_at.of_real_comp HasDerivAt.ofReal_comp

end RealDerivOfComplex

Expand Down
24 changes: 11 additions & 13 deletions Mathlib/Analysis/SpecialFunctions/Complex/Arg.lean
Expand Up @@ -218,16 +218,16 @@ theorem tan_arg (x : ℂ) : Real.tan (arg x) = x.im / x.re := by
rw [Real.tan_eq_sin_div_cos, sin_arg, cos_arg h, div_div_div_cancel_right _ (abs.ne_zero h)]
#align complex.tan_arg Complex.tan_arg

theorem arg_of_real_of_nonneg {x : ℝ} (hx : 0 ≤ x) : arg x = 0 := by simp [arg, hx]
#align complex.arg_of_real_of_nonneg Complex.arg_of_real_of_nonneg
theorem arg_ofReal_of_nonneg {x : ℝ} (hx : 0 ≤ x) : arg x = 0 := by simp [arg, hx]
#align complex.arg_of_real_of_nonneg Complex.arg_ofReal_of_nonneg

theorem arg_eq_zero_iff {z : ℂ} : arg z = 00 ≤ z.re ∧ z.im = 0 := by
refine' ⟨fun h => _, _⟩
· rw [← abs_mul_cos_add_sin_mul_I z, h]
simp [abs.nonneg]
· cases' z with x y
rintro ⟨h, rfl : y = 0
exact arg_of_real_of_nonneg h
exact arg_ofReal_of_nonneg h
#align complex.arg_eq_zero_iff Complex.arg_eq_zero_iff

theorem arg_eq_pi_iff {z : ℂ} : arg z = π ↔ z.re < 0 ∧ z.im = 0 := by
Expand All @@ -246,9 +246,9 @@ theorem arg_lt_pi_iff {z : ℂ} : arg z < π ↔ 0 ≤ z.re ∨ z.im ≠ 0 := by
rw [(arg_le_pi z).lt_iff_ne, not_iff_comm, not_or, not_le, Classical.not_not, arg_eq_pi_iff]
#align complex.arg_lt_pi_iff Complex.arg_lt_pi_iff

theorem arg_of_real_of_neg {x : ℝ} (hx : x < 0) : arg x = π :=
theorem arg_ofReal_of_neg {x : ℝ} (hx : x < 0) : arg x = π :=
arg_eq_pi_iff.2 ⟨hx, rfl⟩
#align complex.arg_of_real_of_neg Complex.arg_of_real_of_neg
#align complex.arg_of_real_of_neg Complex.arg_ofReal_of_neg

theorem arg_eq_pi_div_two_iff {z : ℂ} : arg z = π / 2 ↔ z.re = 00 < z.im := by
by_cases h₀ : z = 0; · simp [h₀, lt_irrefl, Real.pi_div_two_pos.ne]
Expand Down Expand Up @@ -390,10 +390,10 @@ theorem arg_neg_eq_arg_sub_pi_iff {x : ℂ} :
add_eq_zero_iff_eq_neg, Real.pi_ne_zero]
· rw [(ext rfl hi : x = x.re)]
rcases lt_trichotomy x.re 0 with (hr | hr | hr)
· rw [arg_of_real_of_neg hr, ← ofReal_neg, arg_of_real_of_nonneg (Left.neg_pos_iff.2 hr).le]
· rw [arg_ofReal_of_neg hr, ← ofReal_neg, arg_ofReal_of_nonneg (Left.neg_pos_iff.2 hr).le]
simp [hr]
· simp [hr, hi, Real.pi_ne_zero]
· rw [arg_of_real_of_nonneg hr.le, ← ofReal_neg, arg_of_real_of_neg (Left.neg_neg_iff.2 hr)]
· rw [arg_ofReal_of_nonneg hr.le, ← ofReal_neg, arg_ofReal_of_neg (Left.neg_neg_iff.2 hr)]
simp [hr.not_lt, ← add_eq_zero_iff_eq_neg, Real.pi_ne_zero]
· simp [hi, arg_neg_eq_arg_sub_pi_of_im_pos]
#align complex.arg_neg_eq_arg_sub_pi_iff Complex.arg_neg_eq_arg_sub_pi_iff
Expand All @@ -404,10 +404,10 @@ theorem arg_neg_eq_arg_add_pi_iff {x : ℂ} :
· simp [hi, arg_neg_eq_arg_add_pi_of_im_neg]
· rw [(ext rfl hi : x = x.re)]
rcases lt_trichotomy x.re 0 with (hr | hr | hr)
· rw [arg_of_real_of_neg hr, ← ofReal_neg, arg_of_real_of_nonneg (Left.neg_pos_iff.2 hr).le]
· rw [arg_ofReal_of_neg hr, ← ofReal_neg, arg_ofReal_of_nonneg (Left.neg_pos_iff.2 hr).le]
simp [hr.not_lt, ← two_mul, Real.pi_ne_zero]
· simp [hr, hi, Real.pi_ne_zero.symm]
· rw [arg_of_real_of_nonneg hr.le, ← ofReal_neg, arg_of_real_of_neg (Left.neg_neg_iff.2 hr)]
· rw [arg_ofReal_of_nonneg hr.le, ← ofReal_neg, arg_ofReal_of_neg (Left.neg_neg_iff.2 hr)]
simp [hr]
·
simp [hi, hi.ne.symm, hi.not_lt, arg_neg_eq_arg_sub_pi_of_im_pos, sub_eq_add_neg, ←
Expand All @@ -419,12 +419,10 @@ theorem arg_neg_coe_angle {x : ℂ} (hx : x ≠ 0) : (arg (-x) : Real.Angle) = a
· rw [arg_neg_eq_arg_add_pi_of_im_neg hi, Real.Angle.coe_add]
· rw [(ext rfl hi : x = x.re)]
rcases lt_trichotomy x.re 0 with (hr | hr | hr)
·
rw [arg_of_real_of_neg hr, ← ofReal_neg, arg_of_real_of_nonneg (Left.neg_pos_iff.2 hr).le, ←
· rw [arg_ofReal_of_neg hr, ← ofReal_neg, arg_ofReal_of_nonneg (Left.neg_pos_iff.2 hr).le, ←
Real.Angle.coe_add, ← two_mul, Real.Angle.coe_two_pi, Real.Angle.coe_zero]
· exact False.elim (hx (ext hr hi))
·
rw [arg_of_real_of_nonneg hr.le, ← ofReal_neg, arg_of_real_of_neg (Left.neg_neg_iff.2 hr),
· rw [arg_ofReal_of_nonneg hr.le, ← ofReal_neg, arg_ofReal_of_neg (Left.neg_neg_iff.2 hr),
Real.Angle.coe_zero, zero_add]
· rw [arg_neg_eq_arg_sub_pi_of_im_pos hi, Real.Angle.coe_sub, Real.Angle.sub_coe_pi_eq_add_coe_pi]
#align complex.arg_neg_coe_angle Complex.arg_neg_coe_angle
Expand Down
22 changes: 11 additions & 11 deletions Mathlib/Analysis/SpecialFunctions/Complex/Log.lean
Expand Up @@ -70,24 +70,24 @@ theorem exp_inj_of_neg_pi_lt_of_le_pi {x y : ℂ} (hx₁ : -π < x.im) (hx₂ :
rw [← log_exp hx₁ hx₂, ← log_exp hy₁ hy₂, hxy]
#align complex.exp_inj_of_neg_pi_lt_of_le_pi Complex.exp_inj_of_neg_pi_lt_of_le_pi

theorem of_real_log {x : ℝ} (hx : 0 ≤ x) : (x.log : ℂ) = log x :=
theorem ofReal_log {x : ℝ} (hx : 0 ≤ x) : (x.log : ℂ) = log x :=
Complex.ext (by rw [log_re, ofReal_re, abs_of_nonneg hx])
(by rw [ofReal_im, log_im, arg_of_real_of_nonneg hx])
#align complex.of_real_log Complex.of_real_log
(by rw [ofReal_im, log_im, arg_ofReal_of_nonneg hx])
#align complex.of_real_log Complex.ofReal_log

theorem log_of_real_re (x : ℝ) : (log (x : ℂ)).re = Real.log x := by simp [log_re]
#align complex.log_of_real_re Complex.log_of_real_re
theorem log_ofReal_re (x : ℝ) : (log (x : ℂ)).re = Real.log x := by simp [log_re]
#align complex.log_of_real_re Complex.log_ofReal_re

theorem log_of_real_mul {r : ℝ} (hr : 0 < r) {x : ℂ} (hx : x ≠ 0) :
theorem log_ofReal_mul {r : ℝ} (hr : 0 < r) {x : ℂ} (hx : x ≠ 0) :
log (r * x) = Real.log r + log x := by
replace hx := Complex.abs.ne_zero_iff.mpr hx
simp_rw [log, map_mul, abs_ofReal, arg_real_mul _ hr, abs_of_pos hr, Real.log_mul hr.ne' hx,
ofReal_add, add_assoc]
#align complex.log_of_real_mul Complex.log_of_real_mul
#align complex.log_of_real_mul Complex.log_ofReal_mul

theorem log_mul_of_real (r : ℝ) (hr : 0 < r) (x : ℂ) (hx : x ≠ 0) :
log (x * r) = Real.log r + log x := by rw [mul_comm, log_of_real_mul hr hx, add_comm]
#align complex.log_mul_of_real Complex.log_mul_of_real
theorem log_mul_ofReal (r : ℝ) (hr : 0 < r) (x : ℂ) (hx : x ≠ 0) :
log (x * r) = Real.log r + log x := by rw [mul_comm, log_ofReal_mul hr hx, add_comm]
#align complex.log_mul_of_real Complex.log_mul_ofReal

@[simp]
theorem log_zero : log 0 = 0 := by simp [log]
Expand Down Expand Up @@ -122,7 +122,7 @@ theorem log_conj (x : ℂ) (h : x.arg ≠ π) : log (conj x) = conj (log x) := b
theorem log_inv_eq_ite (x : ℂ) : log x⁻¹ = if x.arg = π then -conj (log x) else -log x := by
by_cases hx : x = 0
· simp [hx]
rw [inv_def, log_mul_of_real, Real.log_inv, ofReal_neg, ← sub_eq_neg_add, log_conj_eq_ite]
rw [inv_def, log_mul_ofReal, Real.log_inv, ofReal_neg, ← sub_eq_neg_add, log_conj_eq_ite]
· simp_rw [log, map_add, map_mul, conj_ofReal, conj_I, normSq_eq_abs, Real.log_pow,
Nat.cast_two, ofReal_mul, ofReal_bit0, ofReal_one, neg_add, mul_neg, two_mul, neg_neg]
norm_num; rw [two_mul] -- Porting note: added to simplify `↑2`
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Analysis/SpecialFunctions/ImproperIntegrals.lean
Expand Up @@ -97,7 +97,7 @@ theorem integrableOn_Ioi_cpow_of_lt {a : ℂ} (ha : a.re < -1) {c : ℝ} (hc : 0
rw [Complex.norm_eq_abs, Complex.abs_cpow_eq_rpow_re_of_pos (hc.trans hx)]
· refine' ContinuousOn.aestronglyMeasurable (fun t ht => _) measurableSet_Ioi
exact
(Complex.continuousAt_of_real_cpow_const _ _ (Or.inr (hc.trans ht).ne')).continuousWithinAt
(Complex.continuousAt_ofReal_cpow_const _ _ (Or.inr (hc.trans ht).ne')).continuousWithinAt
#align integrable_on_Ioi_cpow_of_lt integrableOn_Ioi_cpow_of_lt

theorem integral_Ioi_cpow_of_lt {a : ℂ} (ha : a.re < -1) {c : ℝ} (hc : 0 < c) :
Expand Down
24 changes: 12 additions & 12 deletions Mathlib/Analysis/SpecialFunctions/Integrals.lean
Expand Up @@ -105,16 +105,16 @@ theorem intervalIntegrable_cpow {r : ℂ} (h : 0 ≤ r.re ∨ (0 : ℝ) ∉ [[a,
by_cases h2 : (0 : ℝ) ∉ [[a, b]]
· -- Easy case #1: 0 ∉ [a, b] -- use continuity.
refine' (ContinuousAt.continuousOn fun x hx => _).intervalIntegrable
exact Complex.continuousAt_of_real_cpow_const _ _ (Or.inr <| ne_of_mem_of_not_mem hx h2)
exact Complex.continuousAt_ofReal_cpow_const _ _ (Or.inr <| ne_of_mem_of_not_mem hx h2)
rw [eq_false h2, or_false_iff] at h
rcases lt_or_eq_of_le h with (h' | h')
· -- Easy case #2: 0 < re r -- again use continuity
exact (Complex.continuous_of_real_cpow_const h').intervalIntegrable _ _
exact (Complex.continuous_ofReal_cpow_const h').intervalIntegrable _ _
-- Now the hard case: re r = 0 and 0 is in the interval.
refine' (IntervalIntegrable.intervalIntegrable_norm_iff _).mp _
· refine' (measurable_of_continuousOn_compl_singleton (0 : ℝ) _).aestronglyMeasurable
exact ContinuousAt.continuousOn fun x hx =>
Complex.continuousAt_of_real_cpow_const x r (Or.inr hx)
Complex.continuousAt_ofReal_cpow_const x r (Or.inr hx)
-- reduce to case of integral over `[0, c]`
suffices : ∀ c : ℝ, IntervalIntegrable (fun x : ℝ => ‖(x:ℂ) ^ r‖) μ 0 c
exact (this a).symm.trans (this b)
Expand All @@ -138,7 +138,7 @@ theorem intervalIntegrable_cpow {r : ℂ} (h : 0 ≤ r.re ∨ (0 : ℝ) ∉ [[a,
isCompact_singleton
· have : ∀ x : ℝ, x ∈ Ioo c 0 → ‖Complex.exp (↑π * Complex.I * r)‖ = ‖(x : ℂ) ^ r‖ := by
intro x hx
rw [Complex.of_real_cpow_of_nonpos hx.2.le, norm_mul, ← Complex.ofReal_neg,
rw [Complex.ofReal_cpow_of_nonpos hx.2.le, norm_mul, ← Complex.ofReal_neg,
Complex.norm_eq_abs (_ ^ _), Complex.abs_cpow_eq_rpow_re_of_pos (neg_pos.mpr hx.2), ← h',
rpow_zero, one_mul]
refine' IntegrableOn.congr_fun _ this measurableSet_Ioo
Expand Down Expand Up @@ -178,7 +178,7 @@ theorem intervalIntegrable_cpow' {r : ℂ} (h : -1 < r.re) :
refine' m.congr_fun (fun x hx => _) measurableSet_Ioc
dsimp only
have : -x ≤ 0 := by linarith [hx.1]
rw [Complex.of_real_cpow_of_nonpos this, mul_comm]
rw [Complex.ofReal_cpow_of_nonpos this, mul_comm]
simp
#align interval_integral.interval_integrable_cpow' intervalIntegral.intervalIntegrable_cpow'

Expand Down Expand Up @@ -328,7 +328,7 @@ theorem integral_cpow {r : ℂ} (h : -1 < r.re ∨ r ≠ -1 ∧ (0 : ℝ) ∉ [[
by_cases hab : (0 : ℝ) ∉ [[a, b]]
· apply integral_eq_sub_of_hasDerivAt (fun x hx => ?_)
(intervalIntegrable_cpow (r := r) <| Or.inr hab)
refine' hasDerivAt_of_real_cpow (ne_of_mem_of_not_mem hx hab) _
refine' hasDerivAt_ofReal_cpow (ne_of_mem_of_not_mem hx hab) _
contrapose! hr; rwa [add_eq_zero_iff_eq_neg]
replace h : -1 < r.re; · tauto
suffices ∀ c : ℝ, (∫ x : ℝ in (0)..c, (x : ℂ) ^ r) =
Expand All @@ -338,9 +338,9 @@ theorem integral_cpow {r : ℂ} (h : -1 < r.re ∨ r ≠ -1 ∧ (0 : ℝ) ∉ [[
ring
intro c
apply integral_eq_sub_of_hasDeriv_right
· refine' ((Complex.continuous_of_real_cpow_const _).div_const _).continuousOn
· refine' ((Complex.continuous_ofReal_cpow_const _).div_const _).continuousOn
rwa [Complex.add_re, Complex.one_re, ← neg_lt_iff_pos_add]
· refine' fun x hx => (hasDerivAt_of_real_cpow _ _).hasDerivWithinAt
· refine' fun x hx => (hasDerivAt_ofReal_cpow _ _).hasDerivWithinAt
· rcases le_total c 0 with (hc | hc)
· rw [max_eq_left hc] at hx; exact hx.2.ne
· rw [min_eq_left hc] at hx; exact hx.1.ne'
Expand Down Expand Up @@ -467,7 +467,7 @@ theorem integral_exp_mul_complex {c : ℂ} (hc : c ≠ 0) :
conv => congr
rw [← mul_div_cancel (Complex.exp (c * x)) hc]
apply ((Complex.hasDerivAt_exp _).comp x _).div_const c
simpa only [mul_one] using ((hasDerivAt_id (x : ℂ)).const_mul _).comp_of_real
simpa only [mul_one] using ((hasDerivAt_id (x : ℂ)).const_mul _).comp_ofReal
rw [integral_deriv_eq_sub' _ (funext fun x => (D x).deriv) fun x _ => (D x).differentiableAt]
· ring
· apply Continuous.continuousOn; continuity
Expand Down Expand Up @@ -524,7 +524,7 @@ theorem integral_cos_mul_complex {z : ℂ} (hz : z ≠ 0) (a b : ℝ) :
have a := Complex.hasDerivAt_sin (↑x * z)
have b : HasDerivAt (fun y => y * z : ℂ → ℂ) z ↑x := hasDerivAt_mul_const _
have c : HasDerivAt (fun y : ℂ => Complex.sin (y * z)) _ ↑x := HasDerivAt.comp (𝕜 := ℂ) x a b
have d := HasDerivAt.comp_of_real (c.div_const z)
have d := HasDerivAt.comp_ofReal (c.div_const z)
simp only [mul_comm] at d
convert d using 1
conv_rhs => arg 1; rw [mul_comm]
Expand Down Expand Up @@ -575,7 +575,7 @@ theorem integral_mul_cpow_one_add_sq {t : ℂ} (ht : t ≠ -1) :
(Or.inl hz)).div_const (2 * (t + 1)) using 1
field_simp
ring
convert (HasDerivAt.comp (↑x) (g _) f).comp_of_real using 1
convert (HasDerivAt.comp (↑x) (g _) f).comp_ofReal using 1
· simp
· field_simp; ring
· exact_mod_cast add_pos_of_pos_of_nonneg zero_lt_one (sq_nonneg x)
Expand All @@ -595,7 +595,7 @@ theorem integral_mul_rpow_one_add_sq {t : ℝ} (ht : t ≠ -1) :
have : ∀ x s : ℝ, (((↑1 + x ^ 2) ^ s : ℝ) : ℂ) = (1 + (x : ℂ) ^ 2) ^ (s:ℂ) := by
intro x s
norm_cast
rw [of_real_cpow, ofReal_add, ofReal_pow, ofReal_one]
rw [ofReal_cpow, ofReal_add, ofReal_pow, ofReal_one]
exact add_nonneg zero_le_one (sq_nonneg x)
rw [← ofReal_inj]
convert integral_mul_cpow_one_add_sq (_ : (t : ℂ) ≠ -1)
Expand Down
8 changes: 3 additions & 5 deletions Mathlib/Analysis/SpecialFunctions/Pow/Complex.lean
Expand Up @@ -164,9 +164,7 @@ theorem cpow_nat_inv_pow (x : ℂ) {n : ℕ} (hn : n ≠ 0) : HPow.hPow (x ^ (n

#align complex.cpow_nat_inv_pow Complex.cpow_nat_inv_pow

-- TODO: should log_of_real_mul and of_real_log use ofReal in their names?

theorem mul_cpow_of_real_nonneg {a b : ℝ} (ha : 0 ≤ a) (hb : 0 ≤ b) (r : ℂ) :
theorem mul_cpow_ofReal_nonneg {a b : ℝ} (ha : 0 ≤ a) (hb : 0 ≤ b) (r : ℂ) :
((a : ℂ) * (b : ℂ)) ^ r = (a : ℂ) ^ r * (b : ℂ) ^ r := by
rcases eq_or_ne r 0 with (rfl | hr)
· simp only [cpow_zero, mul_one]
Expand All @@ -176,9 +174,9 @@ theorem mul_cpow_of_real_nonneg {a b : ℝ} (ha : 0 ≤ a) (hb : 0 ≤ b) (r :
· rw [ofReal_zero, MulZeroClass.mul_zero, zero_cpow hr, MulZeroClass.mul_zero]
have ha'' : (a : ℂ) ≠ 0 := ofReal_ne_zero.mpr ha'.ne'
have hb'' : (b : ℂ) ≠ 0 := ofReal_ne_zero.mpr hb'.ne'
rw [cpow_def_of_ne_zero (mul_ne_zero ha'' hb''), log_of_real_mul ha' hb'', of_real_log ha,
rw [cpow_def_of_ne_zero (mul_ne_zero ha'' hb''), log_ofReal_mul ha' hb'', ofReal_log ha,
add_mul, exp_add, ← cpow_def_of_ne_zero ha'', ← cpow_def_of_ne_zero hb'']
#align complex.mul_cpow_of_real_nonneg Complex.mul_cpow_of_real_nonneg
#align complex.mul_cpow_of_real_nonneg Complex.mul_cpow_ofReal_nonneg

theorem inv_cpow_eq_ite (x : ℂ) (n : ℂ) :
x⁻¹ ^ n = if x.arg = π then conj (x ^ conj n)⁻¹ else (x ^ n)⁻¹ := by
Expand Down
18 changes: 9 additions & 9 deletions Mathlib/Analysis/SpecialFunctions/Pow/Continuity.lean
Expand Up @@ -385,7 +385,7 @@ theorem continuousAt_cpow_const_of_re_pos {z w : ℂ} (hz : 0 ≤ re z ∨ im z
#align complex.continuous_at_cpow_const_of_re_pos Complex.continuousAt_cpow_const_of_re_pos

/-- Continuity of `(x, y) ↦ x ^ y` as a function on `ℝ × ℂ`. -/
theorem continuousAt_of_real_cpow (x : ℝ) (y : ℂ) (h : 0 < y.re ∨ x ≠ 0) :
theorem continuousAt_ofReal_cpow (x : ℝ) (y : ℂ) (h : 0 < y.re ∨ x ≠ 0) :
ContinuousAt (fun p => (p.1 : ℂ) ^ p.2 : ℝ × ℂ → ℂ) (x, y) := by
rcases lt_trichotomy (0 : ℝ) x with (hx | rfl | hx)
· -- x > 0 : easy case
Expand All @@ -404,25 +404,25 @@ theorem continuousAt_of_real_cpow (x : ℝ) (y : ℂ) (h : 0 < y.re ∨ x ≠ 0)
· -- x < 0 : difficult case
suffices ContinuousAt (fun p => (-(p.1 : ℂ)) ^ p.2 * exp (π * I * p.2) : ℝ × ℂ → ℂ) (x, y) by
refine' this.congr (eventually_of_mem (prod_mem_nhds (Iio_mem_nhds hx) univ_mem) _)
exact fun p hp => (of_real_cpow_of_nonpos (le_of_lt hp.1) p.2).symm
exact fun p hp => (ofReal_cpow_of_nonpos (le_of_lt hp.1) p.2).symm
have A : ContinuousAt (fun p => ⟨-↑p.1, p.2⟩ : ℝ × ℂ → ℂ × ℂ) (x, y) :=
ContinuousAt.prod_map continuous_ofReal.continuousAt.neg continuousAt_id
apply ContinuousAt.mul
· refine' (continuousAt_cpow (Or.inl _)).comp A
rwa [neg_re, ofReal_re, neg_pos]
· exact (continuous_exp.comp (continuous_const.mul continuous_snd)).continuousAt
#align complex.continuous_at_of_real_cpow Complex.continuousAt_of_real_cpow
#align complex.continuous_at_of_real_cpow Complex.continuousAt_ofReal_cpow

theorem continuousAt_of_real_cpow_const (x : ℝ) (y : ℂ) (h : 0 < y.re ∨ x ≠ 0) :
theorem continuousAt_ofReal_cpow_const (x : ℝ) (y : ℂ) (h : 0 < y.re ∨ x ≠ 0) :
ContinuousAt (fun a => (a : ℂ) ^ y : ℝ → ℂ) x :=
@ContinuousAt.comp _ _ _ _ _ _ _ _ x (continuousAt_of_real_cpow x y h)
@ContinuousAt.comp _ _ _ _ _ _ _ _ x (continuousAt_ofReal_cpow x y h)
(continuous_id.prod_mk continuous_const).continuousAt
#align complex.continuous_at_of_real_cpow_const Complex.continuousAt_of_real_cpow_const
#align complex.continuous_at_of_real_cpow_const Complex.continuousAt_ofReal_cpow_const

theorem continuous_of_real_cpow_const {y : ℂ} (hs : 0 < y.re) :
theorem continuous_ofReal_cpow_const {y : ℂ} (hs : 0 < y.re) :
Continuous (fun x => (x : ℂ) ^ y : ℝ → ℂ) :=
continuous_iff_continuousAt.mpr fun x => continuousAt_of_real_cpow_const x y (Or.inl hs)
#align complex.continuous_of_real_cpow_const Complex.continuous_of_real_cpow_const
continuous_iff_continuousAt.mpr fun x => continuousAt_ofReal_cpow_const x y (Or.inl hs)
#align complex.continuous_of_real_cpow_const Complex.continuous_ofReal_cpow_const

end Complex

Expand Down

0 comments on commit 9dd22b8

Please sign in to comment.