Skip to content

Commit

Permalink
feat(special_functions/pow): continuity of real to complex power (#13244
Browse files Browse the repository at this point in the history
)

Some lemmas excised from my Gamma-function project. The main result is that for a complex `s` with `re s > 0`, the function `(λ x, x ^ s : ℝ → ℂ)` is continuous on all of `ℝ`. 



Co-authored-by: Yury G. Kudryashov <urkud@urkud.name>
  • Loading branch information
loefflerd and urkud committed Apr 21, 2022
1 parent cf3b996 commit ba455ea
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 2 deletions.
48 changes: 46 additions & 2 deletions src/analysis/special_functions/pow.lean
Expand Up @@ -387,6 +387,17 @@ namespace complex
lemma of_real_cpow {x : ℝ} (hx : 0 ≤ x) (y : ℝ) : ((x ^ y : ℝ) : ℂ) = (x : ℂ) ^ (y : ℂ) :=
by simp [real.rpow_def_of_nonneg hx, complex.cpow_def]; split_ifs; simp [complex.of_real_log hx]

lemma of_real_cpow_of_nonpos {x : ℝ} (hx : x ≤ 0) (y : ℂ) :
(x : ℂ) ^ y = ((-x) : ℂ) ^ y * exp (π * I * y) :=
begin
rcases hx.eq_or_lt with rfl|hlt,
{ rcases eq_or_ne y 0 with rfl|hy; simp * },
have hne : (x : ℂ) ≠ 0, from of_real_ne_zero.mpr hlt.ne,
rw [cpow_def_of_ne_zero hne, cpow_def_of_ne_zero (neg_ne_zero.2 hne), ← exp_add, ← add_mul,
log, log, abs_neg, arg_of_real_of_neg hlt, ← of_real_neg,
arg_of_real_of_nonneg (neg_nonneg.2 hx), of_real_zero, zero_mul, add_zero]
end

lemma abs_cpow_of_ne_zero {z : ℂ} (hz : z ≠ 0) (w : ℂ) :
abs (z ^ w) = abs z ^ w.re / real.exp (arg z * im w) :=
by rw [cpow_def_of_ne_zero hz, abs_exp, mul_re, log_re, log_im, real.exp_sub,
Expand All @@ -412,7 +423,7 @@ by rw [abs_cpow_of_ne_zero (of_real_ne_zero.mpr hx.ne'), arg_of_real_of_nonneg h
real.exp_zero, div_one, abs_of_nonneg hx.le]

lemma abs_cpow_eq_rpow_re_of_nonneg {x : ℝ} (hx : 0 ≤ x) {y : ℂ} (hy : re y ≠ 0) :
abs (x ^ y) = x ^ y.re :=
abs (x ^ y) = x ^ re y :=
begin
rcases hx.eq_or_lt with rfl|hlt,
{ rw [of_real_zero, zero_cpow, abs_zero, real.zero_rpow hy],
Expand Down Expand Up @@ -966,7 +977,7 @@ end limits

namespace complex

/-- See also `complex.continuous_at_cpow`. -/
/-- See also `complex.continuous_at_cpow` and `complex.continuous_at_cpow_of_re_pos`. -/
lemma continuous_at_cpow_zero_of_re_pos {z : ℂ} (hz : 0 < z.re) :
continuous_at (λ x : ℂ × ℂ, x.1 ^ x.2) (0, z) :=
begin
Expand All @@ -987,6 +998,39 @@ begin
(_root_.abs_nonneg _) real.pi_pos.le }
end

/-- See also `complex.continuous_at_cpow` for a version that assumes `p.1 ≠ 0` but makes no
assumptions about `p.2`. -/
lemma continuous_at_cpow_of_re_pos {p : ℂ × ℂ} (h₁ : 0 ≤ p.1.re ∨ p.1.im ≠ 0) (h₂ : 0 < p.2.re) :
continuous_at (λ x : ℂ × ℂ, x.1 ^ x.2) p :=
begin
cases p with z w,
rw [← not_lt_zero_iff, lt_iff_le_and_ne, not_and_distrib, ne.def, not_not, not_le_zero_iff] at h₁,
rcases h₁ with h₁|(rfl : z = 0),
exacts [continuous_at_cpow h₁, continuous_at_cpow_zero_of_re_pos h₂]
end

/-- See also `complex.continuous_at_cpow_const` for a version that assumes `z ≠ 0` but makes no
assumptions about `w`. -/
lemma continuous_at_cpow_const_of_re_pos {z w : ℂ} (hz : 0 ≤ re z ∨ im z ≠ 0) (hw : 0 < re w) :
continuous_at (λ x, x ^ w) z :=
tendsto.comp (@continuous_at_cpow_of_re_pos (z, w) hz hw)
(continuous_at_id.prod continuous_at_const)

lemma continuous_of_real_cpow_const {y : ℂ} (hs : 0 < y.re) : continuous (λ x, x ^ y : ℝ → ℂ) :=
begin
rw continuous_iff_continuous_at, intro x,
cases le_or_lt 0 x with hx hx,
{ refine (continuous_at_cpow_const_of_re_pos _ hs).comp continuous_of_real.continuous_at,
exact or.inl hx },
{ suffices : continuous_on (λ x, x ^ y : ℝ → ℂ) (set.Iio 0),
from continuous_on.continuous_at this (Iio_mem_nhds hx),
have : eq_on (λ x, x ^ y : ℝ → ℂ) (λ x, ((-x) : ℂ) ^ y * exp (π * I * y)) (set.Iio 0),
from λ y hy, of_real_cpow_of_nonpos (le_of_lt hy) _,
refine (continuous_on.mul (λ y hy, _) continuous_on_const).congr this,
refine continuous_of_real.continuous_within_at.neg.cpow continuous_within_at_const _,
left, simpa using hy }
end

end complex

namespace nnreal
Expand Down
4 changes: 4 additions & 0 deletions src/data/complex/basic.lean
Expand Up @@ -599,7 +599,11 @@ lemma lt_def {z w : ℂ} : z < w ↔ z.re < w.re ∧ z.im = w.im := iff.rfl
lemma not_le_iff {z w : ℂ} : ¬(z ≤ w) ↔ w.re < z.re ∨ z.im ≠ w.im :=
by rw [le_def, not_and_distrib, not_le]

lemma not_lt_iff {z w : ℂ} : ¬(z < w) ↔ w.re ≤ z.re ∨ z.im ≠ w.im :=
by rw [lt_def, not_and_distrib, not_lt]

lemma not_le_zero_iff {z : ℂ} : ¬z ≤ 00 < z.re ∨ z.im ≠ 0 := not_le_iff
lemma not_lt_zero_iff {z : ℂ} : ¬z < 00 ≤ z.re ∨ z.im ≠ 0 := not_lt_iff

/--
With `z ≤ w` iff `w - z` is real and nonnegative, `ℂ` is an ordered ring.
Expand Down

0 comments on commit ba455ea

Please sign in to comment.