Theorem: Complex.continuousAt_ofReal_cpow
File: Mathlib/Analysis/SpecialFunctions/Pow/Continuity.lean

tactic: rcases lt_trichotomy (0 : ℝ) x with (hx | rfl | hx)
state_before: x : ℝ
y : ℂ
h : 0 < y.re ∨ x ≠ 0
⊢ ContinuousAt (fun p => ↑p.1 ^ p.2) (x, y)
state_after: case inl
x : ℝ
y : ℂ
h : 0 < y.re ∨ x ≠ 0
hx : 0 < x
⊢ ContinuousAt (fun p => ↑p.1 ^ p.2) (x, y)

case inr.inl
y : ℂ
h : 0 < y.re ∨ 0 ≠ 0
⊢ ContinuousAt (fun p => ↑p.1 ^ p.2) (0, y)

case inr.inr
x : ℝ
y : ℂ
h : 0 < y.re ∨ x ≠ 0
hx : x < 0
⊢ ContinuousAt (fun p => ↑p.1 ^ p.2) (x, y)

tactic: have : ContinuousAt (fun p => ⟨↑p.1, p.2⟩ : ℝ × ℂ → ℂ × ℂ) (x, y) :=
  continuous_ofReal.continuousAt.prod_map continuousAt_id
state_before: case inl
x : ℝ
y : ℂ
h : 0 < y.re ∨ x ≠ 0
hx : 0 < x
⊢ ContinuousAt (fun p => ↑p.1 ^ p.2) (x, y)
state_after: case inl
x : ℝ
y : ℂ
h : 0 < y.re ∨ x ≠ 0
hx : 0 < x
this : ContinuousAt (fun p => (↑p.1, p.2)) (x, y)
⊢ ContinuousAt (fun p => ↑p.1 ^ p.2) (x, y)

tactic: refine (continuousAt_cpow (Or.inl ?_)).comp this
state_before: case inl
x : ℝ
y : ℂ
h : 0 < y.re ∨ x ≠ 0
hx : 0 < x
this : ContinuousAt (fun p => (↑p.1, p.2)) (x, y)
⊢ ContinuousAt (fun p => ↑p.1 ^ p.2) (x, y)
state_after: case inl
x : ℝ
y : ℂ
h : 0 < y.re ∨ x ≠ 0
hx : 0 < x
this : ContinuousAt (fun p => (↑p.1, p.2)) (x, y)
⊢ 0 < (↑(x, y).1, (x, y).2).1.re

tactic: rwa [ofReal_re]
state_before: case inl
x : ℝ
y : ℂ
h : 0 < y.re ∨ x ≠ 0
hx : 0 < x
this : ContinuousAt (fun p => (↑p.1, p.2)) (x, y)
⊢ 0 < (↑(x, y).1, (x, y).2).1.re
state_after: no goals

tactic: have A : ContinuousAt (fun p => p.1 ^ p.2 : ℂ × ℂ → ℂ) ⟨↑(0 : ℝ), y⟩ := by
  rw [ofReal_zero]
  apply continuousAt_cpow_zero_of_re_pos
  tauto
state_before: case inr.inl
y : ℂ
h : 0 < y.re ∨ 0 ≠ 0
⊢ ContinuousAt (fun p => ↑p.1 ^ p.2) (0, y)
state_after: case inr.inl
y : ℂ
h : 0 < y.re ∨ 0 ≠ 0
A : ContinuousAt (fun p => p.1 ^ p.2) (↑0, y)
⊢ ContinuousAt (fun p => ↑p.1 ^ p.2) (0, y)

tactic: have B : ContinuousAt (fun p => ⟨↑p.1, p.2⟩ : ℝ × ℂ → ℂ × ℂ) ⟨0, y⟩ :=
  continuous_ofReal.continuousAt.prod_map continuousAt_id
state_before: case inr.inl
y : ℂ
h : 0 < y.re ∨ 0 ≠ 0
A : ContinuousAt (fun p => p.1 ^ p.2) (↑0, y)
⊢ ContinuousAt (fun p => ↑p.1 ^ p.2) (0, y)
state_after: case inr.inl
y : ℂ
h : 0 < y.re ∨ 0 ≠ 0
A : ContinuousAt (fun p => p.1 ^ p.2) (↑0, y)
B : ContinuousAt (fun p => (↑p.1, p.2)) (0, y)
⊢ ContinuousAt (fun p => ↑p.1 ^ p.2) (0, y)

tactic: exact A.comp_of_eq B rfl
state_before: case inr.inl
y : ℂ
h : 0 < y.re ∨ 0 ≠ 0
A : ContinuousAt (fun p => p.1 ^ p.2) (↑0, y)
B : ContinuousAt (fun p => (↑p.1, p.2)) (0, y)
⊢ ContinuousAt (fun p => ↑p.1 ^ p.2) (0, y)
state_after: no goals

tactic: rw [ofReal_zero]
state_before: y : ℂ
h : 0 < y.re ∨ 0 ≠ 0
⊢ ContinuousAt (fun p => p.1 ^ p.2) (↑0, y)
state_after: y : ℂ
h : 0 < y.re ∨ 0 ≠ 0
⊢ ContinuousAt (fun p => p.1 ^ p.2) (0, y)

tactic: apply continuousAt_cpow_zero_of_re_pos
state_before: y : ℂ
h : 0 < y.re ∨ 0 ≠ 0
⊢ ContinuousAt (fun p => p.1 ^ p.2) (0, y)
state_after: case hz
y : ℂ
h : 0 < y.re ∨ 0 ≠ 0
⊢ 0 < y.re

tactic: tauto
state_before: case hz
y : ℂ
h : 0 < y.re ∨ 0 ≠ 0
⊢ 0 < y.re
state_after: no goals

tactic: 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 => (ofReal_cpow_of_nonpos (le_of_lt hp.1) p.2).symm
state_before: case inr.inr
x : ℝ
y : ℂ
h : 0 < y.re ∨ x ≠ 0
hx : x < 0
⊢ ContinuousAt (fun p => ↑p.1 ^ p.2) (x, y)
state_after: case inr.inr
x : ℝ
y : ℂ
h : 0 < y.re ∨ x ≠ 0
hx : x < 0
⊢ ContinuousAt (fun p => (-↑p.1) ^ p.2 * cexp (↑π * I * p.2)) (x, y)

tactic: have A : ContinuousAt (fun p => ⟨-↑p.1, p.2⟩ : ℝ × ℂ → ℂ × ℂ) (x, y) :=
  ContinuousAt.prod_map continuous_ofReal.continuousAt.neg continuousAt_id
state_before: case inr.inr
x : ℝ
y : ℂ
h : 0 < y.re ∨ x ≠ 0
hx : x < 0
⊢ ContinuousAt (fun p => (-↑p.1) ^ p.2 * cexp (↑π * I * p.2)) (x, y)
state_after: case inr.inr
x : ℝ
y : ℂ
h : 0 < y.re ∨ x ≠ 0
hx : x < 0
A : ContinuousAt (fun p => (-↑p.1, p.2)) (x, y)
⊢ ContinuousAt (fun p => (-↑p.1) ^ p.2 * cexp (↑π * I * p.2)) (x, y)

tactic: apply ContinuousAt.mul
state_before: case inr.inr
x : ℝ
y : ℂ
h : 0 < y.re ∨ x ≠ 0
hx : x < 0
A : ContinuousAt (fun p => (-↑p.1, p.2)) (x, y)
⊢ ContinuousAt (fun p => (-↑p.1) ^ p.2 * cexp (↑π * I * p.2)) (x, y)
state_after: case inr.inr.hf
x : ℝ
y : ℂ
h : 0 < y.re ∨ x ≠ 0
hx : x < 0
A : ContinuousAt (fun p => (-↑p.1, p.2)) (x, y)
⊢ ContinuousAt (fun x => (-↑x.1) ^ x.2) (x, y)

case inr.inr.hg
x : ℝ
y : ℂ
h : 0 < y.re ∨ x ≠ 0
hx : x < 0
A : ContinuousAt (fun p => (-↑p.1, p.2)) (x, y)
⊢ ContinuousAt (fun x => cexp (↑π * I * x.2)) (x, y)

tactic: refine this.congr (eventually_of_mem (prod_mem_nhds (Iio_mem_nhds hx) univ_mem) ?_)
state_before: x : ℝ
y : ℂ
h : 0 < y.re ∨ x ≠ 0
hx : x < 0
this : ContinuousAt (fun p => (-↑p.1) ^ p.2 * cexp (↑π * I * p.2)) (x, y)
⊢ ContinuousAt (fun p => ↑p.1 ^ p.2) (x, y)
state_after: x : ℝ
y : ℂ
h : 0 < y.re ∨ x ≠ 0
hx : x < 0
this : ContinuousAt (fun p => (-↑p.1) ^ p.2 * cexp (↑π * I * p.2)) (x, y)
⊢ ∀ x ∈ Set.Iio 0 ×ˢ Set.univ, (fun p => (-↑p.1) ^ p.2 * cexp (↑π * I * p.2)) x = (fun p => ↑p.1 ^ p.2) x

tactic: exact fun p hp => (ofReal_cpow_of_nonpos (le_of_lt hp.1) p.2).symm
state_before: x : ℝ
y : ℂ
h : 0 < y.re ∨ x ≠ 0
hx : x < 0
this : ContinuousAt (fun p => (-↑p.1) ^ p.2 * cexp (↑π * I * p.2)) (x, y)
⊢ ∀ x ∈ Set.Iio 0 ×ˢ Set.univ, (fun p => (-↑p.1) ^ p.2 * cexp (↑π * I * p.2)) x = (fun p => ↑p.1 ^ p.2) x
state_after: no goals

tactic: refine (continuousAt_cpow (Or.inl ?_)).comp A
state_before: case inr.inr.hf
x : ℝ
y : ℂ
h : 0 < y.re ∨ x ≠ 0
hx : x < 0
A : ContinuousAt (fun p => (-↑p.1, p.2)) (x, y)
⊢ ContinuousAt (fun x => (-↑x.1) ^ x.2) (x, y)
state_after: case inr.inr.hf
x : ℝ
y : ℂ
h : 0 < y.re ∨ x ≠ 0
hx : x < 0
A : ContinuousAt (fun p => (-↑p.1, p.2)) (x, y)
⊢ 0 < (-↑(x, y).1, (x, y).2).1.re

tactic: rwa [neg_re, ofReal_re, neg_pos]
state_before: case inr.inr.hf
x : ℝ
y : ℂ
h : 0 < y.re ∨ x ≠ 0
hx : x < 0
A : ContinuousAt (fun p => (-↑p.1, p.2)) (x, y)
⊢ 0 < (-↑(x, y).1, (x, y).2).1.re
state_after: no goals

tactic: exact (continuous_exp.comp (continuous_const.mul continuous_snd)).continuousAt
state_before: case inr.inr.hg
x : ℝ
y : ℂ
h : 0 < y.re ∨ x ≠ 0
hx : x < 0
A : ContinuousAt (fun p => (-↑p.1, p.2)) (x, y)
⊢ ContinuousAt (fun x => cexp (↑π * I * x.2)) (x, y)
state_after: no goals