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.fst ^ p.snd) (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.fst ^ p.snd) (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.fst, p.snd)) (x, y)
⊢ ContinuousAt (fun p => ↑p.fst ^ p.snd) (x, y)

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

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.fst ^ p.snd) (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.fst ^ p.snd) (↑0, y)
⊢ ContinuousAt (fun p => ↑p.fst ^ p.snd) (0, y)

tactic: exact @ContinuousAt.comp (ℝ × ℂ) (ℂ × ℂ) ℂ _ _ _ _ (fun p => ⟨↑p.1, p.2⟩) ⟨0, y⟩ A B
state_before: case inr.inl
y : ℂ
h : 0 < y.re ∨ 0 ≠ 0
A : ContinuousAt (fun p => p.fst ^ p.snd) (↑0, y)
B : ContinuousAt (fun p => (↑p.fst, p.snd)) (0, y)
⊢ ContinuousAt (fun p => ↑p.fst ^ p.snd) (0, y)

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

tactic: apply continuousAt_cpow_zero_of_re_pos
state_before: y : ℂ
h : 0 < y.re ∨ 0 ≠ 0
⊢ ContinuousAt (fun p => p.fst ^ p.snd) (0, y)

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

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.fst ^ p.snd) (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.fst) ^ p.snd * exp (↑π * I * p.snd)) (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.fst, p.snd)) (x, y)
⊢ ContinuousAt (fun p => (-↑p.fst) ^ p.snd * exp (↑π * I * p.snd)) (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.fst) ^ p.snd * exp (↑π * I * p.snd)) (x, y)
⊢ ContinuousAt (fun p => ↑p.fst ^ p.snd) (x, y)

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.fst) ^ p.snd * exp (↑π * I * p.snd)) (x, y)
⊢ ∀ (x : ℝ × ℂ),
    x ∈ Set.Iio 0 ×ˢ Set.univ → (fun p => (-↑p.fst) ^ p.snd * exp (↑π * I * p.snd)) x = (fun p => ↑p.fst ^ p.snd) x

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.fst, p.snd)) (x, y)
⊢ ContinuousAt (fun x => (-↑x.fst) ^ x.snd) (x, y)

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.fst, p.snd)) (x, y)
⊢ 0 < (-↑(x, y).fst, (x, y).snd).fst.re

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.fst, p.snd)) (x, y)
⊢ ContinuousAt (fun x => exp (↑π * I * x.snd)) (x, y)