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

tactic: by_cases hs : x ∈ slitPlane
state_before: a x z : ℂ
h : x ≠ 0
⊢ ContinuousAt (Real.Angle.coe ∘ arg) x
state_after: case pos
a x z : ℂ
h : x ≠ 0
hs : x ∈ slitPlane
⊢ ContinuousAt (Real.Angle.coe ∘ arg) x

case neg
a x z : ℂ
h : x ≠ 0
hs : x ∉ slitPlane
⊢ ContinuousAt (Real.Angle.coe ∘ arg) x

tactic: exact Real.Angle.continuous_coe.continuousAt.comp (continuousAt_arg hs)
state_before: case pos
a x z : ℂ
h : x ≠ 0
hs : x ∈ slitPlane
⊢ ContinuousAt (Real.Angle.coe ∘ arg) x
state_after: no goals

tactic: rw [← Function.comp_id (((↑) : ℝ → Real.Angle) ∘ arg),
  (Function.funext_iff.2 fun _ => (neg_neg _).symm : (id : ℂ → ℂ) = Neg.neg ∘ Neg.neg), ←
  Function.comp.assoc]
state_before: case neg
a x z : ℂ
h : x ≠ 0
hs : x ∉ slitPlane
⊢ ContinuousAt (Real.Angle.coe ∘ arg) x
state_after: case neg
a x z : ℂ
h : x ≠ 0
hs : x ∉ slitPlane
⊢ ContinuousAt (((Real.Angle.coe ∘ arg) ∘ Neg.neg) ∘ Neg.neg) x

tactic: refine ContinuousAt.comp ?_ continuous_neg.continuousAt
state_before: case neg
a x z : ℂ
h : x ≠ 0
hs : x ∉ slitPlane
⊢ ContinuousAt (((Real.Angle.coe ∘ arg) ∘ Neg.neg) ∘ Neg.neg) x
state_after: case neg
a x z : ℂ
h : x ≠ 0
hs : x ∉ slitPlane
⊢ ContinuousAt ((Real.Angle.coe ∘ arg) ∘ Neg.neg) (-x)

tactic: suffices ContinuousAt (Function.update (((↑) ∘ arg) ∘ Neg.neg : ℂ → Real.Angle) 0 π) (-x) by
  rwa [continuousAt_update_of_ne (neg_ne_zero.2 h)] at this
state_before: case neg
a x z : ℂ
h : x ≠ 0
hs : x ∉ slitPlane
⊢ ContinuousAt ((Real.Angle.coe ∘ arg) ∘ Neg.neg) (-x)
state_after: case neg
a x z : ℂ
h : x ≠ 0
hs : x ∉ slitPlane
⊢ ContinuousAt (Function.update ((Real.Angle.coe ∘ arg) ∘ Neg.neg) 0 ↑π) (-x)

tactic: have ha :
  Function.update (((↑) ∘ arg) ∘ Neg.neg : ℂ → Real.Angle) 0 π = fun z =>
    (arg z : Real.Angle) + π := by
  rw [Function.update_eq_iff]
  exact ⟨by simp, fun z hz => arg_neg_coe_angle hz⟩
state_before: case neg
a x z : ℂ
h : x ≠ 0
hs : x ∉ slitPlane
⊢ ContinuousAt (Function.update ((Real.Angle.coe ∘ arg) ∘ Neg.neg) 0 ↑π) (-x)
state_after: case neg
a x z : ℂ
h : x ≠ 0
hs : x ∉ slitPlane
ha : Function.update ((Real.Angle.coe ∘ arg) ∘ Neg.neg) 0 ↑π = fun z => ↑z.arg + ↑π
⊢ ContinuousAt (Function.update ((Real.Angle.coe ∘ arg) ∘ Neg.neg) 0 ↑π) (-x)

tactic: rw [ha]
state_before: case neg
a x z : ℂ
h : x ≠ 0
hs : x ∉ slitPlane
ha : Function.update ((Real.Angle.coe ∘ arg) ∘ Neg.neg) 0 ↑π = fun z => ↑z.arg + ↑π
⊢ ContinuousAt (Function.update ((Real.Angle.coe ∘ arg) ∘ Neg.neg) 0 ↑π) (-x)
state_after: case neg
a x z : ℂ
h : x ≠ 0
hs : x ∉ slitPlane
ha : Function.update ((Real.Angle.coe ∘ arg) ∘ Neg.neg) 0 ↑π = fun z => ↑z.arg + ↑π
⊢ ContinuousAt (fun z => ↑z.arg + ↑π) (-x)

tactic: replace hs := mem_slitPlane_iff.mpr.mt hs
state_before: case neg
a x z : ℂ
h : x ≠ 0
hs : x ∉ slitPlane
ha : Function.update ((Real.Angle.coe ∘ arg) ∘ Neg.neg) 0 ↑π = fun z => ↑z.arg + ↑π
⊢ ContinuousAt (fun z => ↑z.arg + ↑π) (-x)
state_after: case neg
a x z : ℂ
h : x ≠ 0
ha : Function.update ((Real.Angle.coe ∘ arg) ∘ Neg.neg) 0 ↑π = fun z => ↑z.arg + ↑π
hs : ¬(0 < x.re ∨ x.im ≠ 0)
⊢ ContinuousAt (fun z => ↑z.arg + ↑π) (-x)

tactic: push_neg at hs
state_before: case neg
a x z : ℂ
h : x ≠ 0
ha : Function.update ((Real.Angle.coe ∘ arg) ∘ Neg.neg) 0 ↑π = fun z => ↑z.arg + ↑π
hs : ¬(0 < x.re ∨ x.im ≠ 0)
⊢ ContinuousAt (fun z => ↑z.arg + ↑π) (-x)
state_after: case neg
a x z : ℂ
h : x ≠ 0
ha : Function.update ((Real.Angle.coe ∘ arg) ∘ Neg.neg) 0 ↑π = fun z => ↑z.arg + ↑π
hs : x.re ≤ 0 ∧ x.im = 0
⊢ ContinuousAt (fun z => ↑z.arg + ↑π) (-x)

tactic: refine
  (Real.Angle.continuous_coe.continuousAt.comp (continuousAt_arg (Or.inl ?_))).add
    continuousAt_const
state_before: case neg
a x z : ℂ
h : x ≠ 0
ha : Function.update ((Real.Angle.coe ∘ arg) ∘ Neg.neg) 0 ↑π = fun z => ↑z.arg + ↑π
hs : x.re ≤ 0 ∧ x.im = 0
⊢ ContinuousAt (fun z => ↑z.arg + ↑π) (-x)
state_after: case neg
a x z : ℂ
h : x ≠ 0
ha : Function.update ((Real.Angle.coe ∘ arg) ∘ Neg.neg) 0 ↑π = fun z => ↑z.arg + ↑π
hs : x.re ≤ 0 ∧ x.im = 0
⊢ 0 < (-x).re

tactic: rw [neg_re, neg_pos]
state_before: case neg
a x z : ℂ
h : x ≠ 0
ha : Function.update ((Real.Angle.coe ∘ arg) ∘ Neg.neg) 0 ↑π = fun z => ↑z.arg + ↑π
hs : x.re ≤ 0 ∧ x.im = 0
⊢ 0 < (-x).re
state_after: case neg
a x z : ℂ
h : x ≠ 0
ha : Function.update ((Real.Angle.coe ∘ arg) ∘ Neg.neg) 0 ↑π = fun z => ↑z.arg + ↑π
hs : x.re ≤ 0 ∧ x.im = 0
⊢ x.re < 0

tactic: exact hs.1.lt_of_ne fun h0 => h (ext_iff.2 ⟨h0, hs.2⟩)
state_before: case neg
a x z : ℂ
h : x ≠ 0
ha : Function.update ((Real.Angle.coe ∘ arg) ∘ Neg.neg) 0 ↑π = fun z => ↑z.arg + ↑π
hs : x.re ≤ 0 ∧ x.im = 0
⊢ x.re < 0
state_after: no goals

tactic: rwa [continuousAt_update_of_ne (neg_ne_zero.2 h)] at this
state_before: a x z : ℂ
h : x ≠ 0
hs : x ∉ slitPlane
this : ContinuousAt (Function.update ((Real.Angle.coe ∘ arg) ∘ Neg.neg) 0 ↑π) (-x)
⊢ ContinuousAt ((Real.Angle.coe ∘ arg) ∘ Neg.neg) (-x)
state_after: no goals

tactic: rw [Function.update_eq_iff]
state_before: a x z : ℂ
h : x ≠ 0
hs : x ∉ slitPlane
⊢ Function.update ((Real.Angle.coe ∘ arg) ∘ Neg.neg) 0 ↑π = fun z => ↑z.arg + ↑π
state_after: a x z : ℂ
h : x ≠ 0
hs : x ∉ slitPlane
⊢ ↑π = ↑(arg 0) + ↑π ∧ ∀ (x : ℂ), x ≠ 0 → ((Real.Angle.coe ∘ arg) ∘ Neg.neg) x = ↑x.arg + ↑π

tactic: exact ⟨by simp, fun z hz => arg_neg_coe_angle hz⟩
state_before: a x z : ℂ
h : x ≠ 0
hs : x ∉ slitPlane
⊢ ↑π = ↑(arg 0) + ↑π ∧ ∀ (x : ℂ), x ≠ 0 → ((Real.Angle.coe ∘ arg) ∘ Neg.neg) x = ↑x.arg + ↑π
state_after: no goals

tactic: simp
state_before: a x z : ℂ
h : x ≠ 0
hs : x ∉ slitPlane
⊢ ↑π = ↑(arg 0) + ↑π
state_after: no goals