Theorem: Complex.continuousWithinAt_arg_of_re_neg_of_im_zero
File: Mathlib/Analysis/SpecialFunctions/Complex/Arg.lean

tactic: have : arg =ᶠ[𝓝[{ z : ℂ | 0 ≤ z.im }] z] fun x => Real.arcsin ((-x).im / abs x) + π := by
  have : ∀ᶠ x : ℂ in 𝓝 z, x.re < 0 := continuous_re.tendsto z (gt_mem_nhds hre)
  filter_upwards [self_mem_nhdsWithin (s := { z : ℂ | 0 ≤ z.im }),
    mem_nhdsWithin_of_mem_nhds this] with _ him hre
  rw [arg, if_neg hre.not_le, if_pos him]
state_before: a x z✝ z : ℂ
hre : z.re < 0
him : z.im = 0
⊢ ContinuousWithinAt arg {z | 0 ≤ z.im} z
state_after: a x z✝ z : ℂ
hre : z.re < 0
him : z.im = 0
this : arg =ᶠ[𝓝[{z | 0 ≤ z.im}] z] fun x => Real.arcsin ((-x).im / abs x) + π
⊢ ContinuousWithinAt arg {z | 0 ≤ z.im} z

tactic: refine ContinuousWithinAt.congr_of_eventuallyEq ?_ this ?_
state_before: a x z✝ z : ℂ
hre : z.re < 0
him : z.im = 0
this : arg =ᶠ[𝓝[{z | 0 ≤ z.im}] z] fun x => Real.arcsin ((-x).im / abs x) + π
⊢ ContinuousWithinAt arg {z | 0 ≤ z.im} z
state_after: case refine_1
a x z✝ z : ℂ
hre : z.re < 0
him : z.im = 0
this : arg =ᶠ[𝓝[{z | 0 ≤ z.im}] z] fun x => Real.arcsin ((-x).im / abs x) + π
⊢ ContinuousWithinAt (fun x => Real.arcsin ((-x).im / abs x) + π) {z | 0 ≤ z.im} z

case refine_2
a x z✝ z : ℂ
hre : z.re < 0
him : z.im = 0
this : arg =ᶠ[𝓝[{z | 0 ≤ z.im}] z] fun x => Real.arcsin ((-x).im / abs x) + π
⊢ z.arg = Real.arcsin ((-z).im / abs z) + π

tactic: have : ∀ᶠ x : ℂ in 𝓝 z, x.re < 0 := continuous_re.tendsto z (gt_mem_nhds hre)
state_before: a x z✝ z : ℂ
hre : z.re < 0
him : z.im = 0
⊢ arg =ᶠ[𝓝[{z | 0 ≤ z.im}] z] fun x => Real.arcsin ((-x).im / abs x) + π
state_after: a x z✝ z : ℂ
hre : z.re < 0
him : z.im = 0
this : ∀ᶠ (x : ℂ) in 𝓝 z, x.re < 0
⊢ arg =ᶠ[𝓝[{z | 0 ≤ z.im}] z] fun x => Real.arcsin ((-x).im / abs x) + π

tactic: filter_upwards [self_mem_nhdsWithin (s := { z : ℂ | 0 ≤ z.im }),
  mem_nhdsWithin_of_mem_nhds this] with _ him hre
state_before: a x z✝ z : ℂ
hre : z.re < 0
him : z.im = 0
this : ∀ᶠ (x : ℂ) in 𝓝 z, x.re < 0
⊢ arg =ᶠ[𝓝[{z | 0 ≤ z.im}] z] fun x => Real.arcsin ((-x).im / abs x) + π
state_after: case h
a x z✝ z : ℂ
hre✝ : z.re < 0
him✝ : z.im = 0
this : ∀ᶠ (x : ℂ) in 𝓝 z, x.re < 0
a✝ : ℂ
him : 0 ≤ a✝.im
hre : a✝.re < 0
⊢ a✝.arg = Real.arcsin ((-a✝).im / abs a✝) + π

tactic: rw [arg, if_neg hre.not_le, if_pos him]
state_before: case h
a x z✝ z : ℂ
hre✝ : z.re < 0
him✝ : z.im = 0
this : ∀ᶠ (x : ℂ) in 𝓝 z, x.re < 0
a✝ : ℂ
him : 0 ≤ a✝.im
hre : a✝.re < 0
⊢ a✝.arg = Real.arcsin ((-a✝).im / abs a✝) + π
state_after: no goals

tactic: refine
  (Real.continuousAt_arcsin.comp_continuousWithinAt
        ((continuous_im.continuousAt.comp_continuousWithinAt continuousWithinAt_neg).div
          continuous_abs.continuousWithinAt ?_)).add
    tendsto_const_nhds
state_before: case refine_1
a x z✝ z : ℂ
hre : z.re < 0
him : z.im = 0
this : arg =ᶠ[𝓝[{z | 0 ≤ z.im}] z] fun x => Real.arcsin ((-x).im / abs x) + π
⊢ ContinuousWithinAt (fun x => Real.arcsin ((-x).im / abs x) + π) {z | 0 ≤ z.im} z
state_after: case refine_1
a x z✝ z : ℂ
hre : z.re < 0
him : z.im = 0
this : arg =ᶠ[𝓝[{z | 0 ≤ z.im}] z] fun x => Real.arcsin ((-x).im / abs x) + π
⊢ abs z ≠ 0

tactic: lift z to ℝ using him
state_before: case refine_1
a x z✝ z : ℂ
hre : z.re < 0
him : z.im = 0
this : arg =ᶠ[𝓝[{z | 0 ≤ z.im}] z] fun x => Real.arcsin ((-x).im / abs x) + π
⊢ abs z ≠ 0
state_after: case refine_1.intro
a x z✝ : ℂ
z : ℝ
hre : (↑z).re < 0
this : arg =ᶠ[𝓝[{z | 0 ≤ z.im}] ↑z] fun x => Real.arcsin ((-x).im / abs x) + π
⊢ abs ↑z ≠ 0

tactic: simpa using hre.ne
state_before: case refine_1.intro
a x z✝ : ℂ
z : ℝ
hre : (↑z).re < 0
this : arg =ᶠ[𝓝[{z | 0 ≤ z.im}] ↑z] fun x => Real.arcsin ((-x).im / abs x) + π
⊢ abs ↑z ≠ 0
state_after: no goals

tactic: rw [arg, if_neg hre.not_le, if_pos him.ge]
state_before: case refine_2
a x z✝ z : ℂ
hre : z.re < 0
him : z.im = 0
this : arg =ᶠ[𝓝[{z | 0 ≤ z.im}] z] fun x => Real.arcsin ((-x).im / abs x) + π
⊢ z.arg = Real.arcsin ((-z).im / abs z) + π
state_after: no goals