l3lab/ntp-mathlib huggingface dataset:
theorem arg_neg_coe_angle {x : ℂ} (hx : x ≠ 0) : (arg (-x) : Real.Angle) = arg x + π := by
  rcases lt_trichotomy x.im 0 with (hi | hi | hi)
  · rw [arg_neg_eq_arg_add_pi_of_im_neg hi, Real.Angle.coe_add]
  · rw [(ext rfl hi : x = x.re)]
    rcases lt_trichotomy x.re 0 with (hr | hr | hr)
    · rw [arg_ofReal_of_neg hr, ← ofReal_neg, arg_ofReal_of_nonneg (Left.neg_pos_iff.2 hr).le, ←
        Real.Angle.coe_add, ← two_mul, Real.Angle.coe_two_pi, Real.Angle.coe_zero]
    · exact False.elim (hx (ext hr hi))
    · 

Proof state:
case inr.inl.inr.inr
x : ℂ
hx : x ≠ 0
hi : x.im = 0
hr : 0 < x.re
⊢ ↑(arg (-↑x.re)) = ↑(arg ↑x.re) + ↑π

Next tactic:
rw [arg_ofReal_of_nonneg hr.le, ← ofReal_neg, arg_ofReal_of_neg (Left.neg_neg_iff.2 hr),
        Real.Angle.coe_zero, zero_add]
theorem arg_neg_coe_angle {x : ℂ} (hx : x ≠ 0) : (arg (-x) : Real.Angle) = arg x + π := by
  rcases lt_trichotomy x.im 0 with (hi | hi | hi)
  · rw [arg_neg_eq_arg_add_pi_of_im_neg hi, Real.Angle.coe_add]
  · rw [(ext rfl hi : x = x.re)]
    rcases lt_trichotomy x.re 0 with (hr | hr | hr)
    · rw [arg_ofReal_of_neg hr, ← ofReal_neg, arg_ofReal_of_nonneg (Left.neg_pos_iff.2 hr).le, ←
        Real.Angle.coe_add, ← two_mul, Real.Angle.coe_two_pi, Real.Angle.coe_zero]
    · exact False.elim (hx (ext hr hi))
    · rw [arg_ofReal_of_nonneg hr.le, ← ofReal_neg, arg_ofReal_of_neg (Left.neg_neg_iff.2 hr),
        Real.Angle.coe_zero, zero_add]
  · 

Proof state:
case inr.inr
x : ℂ
hx : x ≠ 0
hi : 0 < x.im
⊢ ↑(arg (-x)) = ↑(arg x) + ↑π

Next tactic:
rw [arg_neg_eq_arg_sub_pi_of_im_pos hi, Real.Angle.coe_sub, Real.Angle.sub_coe_pi_eq_add_coe_pi]
theorem arg_mul_cos_add_sin_mul_I_eq_toIocMod {r : ℝ} (hr : 0 < r) (θ : ℝ) :
    arg (r * (cos θ + sin θ * I)) = toIocMod Real.two_pi_pos (-π) θ := by
  

Proof state:
r : ℝ
hr : 0 < r
θ : ℝ
⊢ arg (↑r * (cos ↑θ + sin ↑θ * I)) = toIocMod two_pi_pos (-π) θ

Next tactic:
have hi : toIocMod Real.two_pi_pos (-π) θ ∈ Set.Ioc (-π) π := by
    convert toIocMod_mem_Ioc _ _ θ
    ring
theorem arg_mul_cos_add_sin_mul_I_eq_toIocMod {r : ℝ} (hr : 0 < r) (θ : ℝ) :
    arg (r * (cos θ + sin θ * I)) = toIocMod Real.two_pi_pos (-π) θ := by
  have hi : toIocMod Real.two_pi_pos (-π) θ ∈ Set.Ioc (-π) π := by
    

Proof state:
r : ℝ
hr : 0 < r
θ : ℝ
⊢ toIocMod two_pi_pos (-π) θ ∈ Set.Ioc (-π) π

Next tactic:
convert toIocMod_mem_Ioc _ _ θ
theorem arg_mul_cos_add_sin_mul_I_eq_toIocMod {r : ℝ} (hr : 0 < r) (θ : ℝ) :
    arg (r * (cos θ + sin θ * I)) = toIocMod Real.two_pi_pos (-π) θ := by
  have hi : toIocMod Real.two_pi_pos (-π) θ ∈ Set.Ioc (-π) π := by
    convert toIocMod_mem_Ioc _ _ θ
    

Proof state:
case h.e'_5.h.e'_4
r : ℝ
hr : 0 < r
θ : ℝ
⊢ π = -π + 2 * π

Next tactic:
ring
theorem arg_mul_cos_add_sin_mul_I_eq_toIocMod {r : ℝ} (hr : 0 < r) (θ : ℝ) :
    arg (r * (cos θ + sin θ * I)) = toIocMod Real.two_pi_pos (-π) θ := by
  have hi : toIocMod Real.two_pi_pos (-π) θ ∈ Set.Ioc (-π) π := by
    convert toIocMod_mem_Ioc _ _ θ
    ring
  

Proof state:
r : ℝ
hr : 0 < r
θ : ℝ
hi : toIocMod two_pi_pos (-π) θ ∈ Set.Ioc (-π) π
⊢ arg (↑r * (cos ↑θ + sin ↑θ * I)) = toIocMod two_pi_pos (-π) θ

Next tactic:
convert arg_mul_cos_add_sin_mul_I hr hi using 3
theorem arg_mul_cos_add_sin_mul_I_eq_toIocMod {r : ℝ} (hr : 0 < r) (θ : ℝ) :
    arg (r * (cos θ + sin θ * I)) = toIocMod Real.two_pi_pos (-π) θ := by
  have hi : toIocMod Real.two_pi_pos (-π) θ ∈ Set.Ioc (-π) π := by
    convert toIocMod_mem_Ioc _ _ θ
    ring
  convert arg_mul_cos_add_sin_mul_I hr hi using 3
  

Proof state:
case h.e'_2.h.e'_1.h.e'_6
r : ℝ
hr : 0 < r
θ : ℝ
hi : toIocMod two_pi_pos (-π) θ ∈ Set.Ioc (-π) π
⊢ cos ↑θ + sin ↑θ * I = cos ↑(toIocMod two_pi_pos (-π) θ) + sin ↑(toIocMod two_pi_pos (-π) θ) * I

Next tactic:
simp [toIocMod, cos_sub_int_mul_two_pi, sin_sub_int_mul_two_pi]
theorem arg_cos_add_sin_mul_I_eq_toIocMod (θ : ℝ) :
    arg (cos θ + sin θ * I) = toIocMod Real.two_pi_pos (-π) θ := by
  

Proof state:
θ : ℝ
⊢ arg (cos ↑θ + sin ↑θ * I) = toIocMod two_pi_pos (-π) θ

Next tactic:
rw [← one_mul (_ + _), ← ofReal_one, arg_mul_cos_add_sin_mul_I_eq_toIocMod zero_lt_one]
theorem arg_mul_cos_add_sin_mul_I_sub {r : ℝ} (hr : 0 < r) (θ : ℝ) :
    arg (r * (cos θ + sin θ * I)) - θ = 2 * π * ⌊(π - θ) / (2 * π)⌋ := by
  

Proof state:
r : ℝ
hr : 0 < r
θ : ℝ
⊢ arg (↑r * (cos ↑θ + sin ↑θ * I)) - θ = 2 * π * ↑⌊(π - θ) / (2 * π)⌋

Next tactic:
rw [arg_mul_cos_add_sin_mul_I_eq_toIocMod hr, toIocMod_sub_self, toIocDiv_eq_neg_floor,
    zsmul_eq_mul]
theorem arg_mul_cos_add_sin_mul_I_sub {r : ℝ} (hr : 0 < r) (θ : ℝ) :
    arg (r * (cos θ + sin θ * I)) - θ = 2 * π * ⌊(π - θ) / (2 * π)⌋ := by
  rw [arg_mul_cos_add_sin_mul_I_eq_toIocMod hr, toIocMod_sub_self, toIocDiv_eq_neg_floor,
    zsmul_eq_mul]
  

Proof state:
r : ℝ
hr : 0 < r
θ : ℝ
⊢ ↑(- -⌊(-π + 2 * π - θ) / (2 * π)⌋) * (2 * π) = 2 * π * ↑⌊(π - θ) / (2 * π)⌋

Next tactic:
ring_nf
theorem arg_cos_add_sin_mul_I_sub (θ : ℝ) :
    arg (cos θ + sin θ * I) - θ = 2 * π * ⌊(π - θ) / (2 * π)⌋ := by
  

Proof state:
θ : ℝ
⊢ arg (cos ↑θ + sin ↑θ * I) - θ = 2 * π * ↑⌊(π - θ) / (2 * π)⌋

Next tactic:
rw [← one_mul (_ + _), ← ofReal_one, arg_mul_cos_add_sin_mul_I_sub zero_lt_one]
theorem arg_mul_cos_add_sin_mul_I_coe_angle {r : ℝ} (hr : 0 < r) (θ : Real.Angle) :
    (arg (r * (Real.Angle.cos θ + Real.Angle.sin θ * I)) : Real.Angle) = θ := by
  

Proof state:
r : ℝ
hr : 0 < r
θ : Angle
⊢ ↑(arg (↑r * (↑(Angle.cos θ) + ↑(Angle.sin θ) * I))) = θ

Next tactic:
induction' θ using Real.Angle.induction_on with θ
theorem arg_mul_cos_add_sin_mul_I_coe_angle {r : ℝ} (hr : 0 < r) (θ : Real.Angle) :
    (arg (r * (Real.Angle.cos θ + Real.Angle.sin θ * I)) : Real.Angle) = θ := by
  induction' θ using Real.Angle.induction_on with θ
  

Proof state:
case h
r : ℝ
hr : 0 < r
θ : ℝ
⊢ ↑(arg (↑r * (↑(Angle.cos ↑θ) + ↑(Angle.sin ↑θ) * I))) = ↑θ

Next tactic:
rw [Real.Angle.cos_coe, Real.Angle.sin_coe, Real.Angle.angle_eq_iff_two_pi_dvd_sub]
theorem arg_mul_cos_add_sin_mul_I_coe_angle {r : ℝ} (hr : 0 < r) (θ : Real.Angle) :
    (arg (r * (Real.Angle.cos θ + Real.Angle.sin θ * I)) : Real.Angle) = θ := by
  induction' θ using Real.Angle.induction_on with θ
  rw [Real.Angle.cos_coe, Real.Angle.sin_coe, Real.Angle.angle_eq_iff_two_pi_dvd_sub]
  

Proof state:
case h
r : ℝ
hr : 0 < r
θ : ℝ
⊢ ∃ k, arg (↑r * (↑(Real.cos θ) + ↑(Real.sin θ) * I)) - θ = 2 * π * ↑k

Next tactic:
use ⌊(π - θ) / (2 * π)⌋
theorem arg_mul_cos_add_sin_mul_I_coe_angle {r : ℝ} (hr : 0 < r) (θ : Real.Angle) :
    (arg (r * (Real.Angle.cos θ + Real.Angle.sin θ * I)) : Real.Angle) = θ := by
  induction' θ using Real.Angle.induction_on with θ
  rw [Real.Angle.cos_coe, Real.Angle.sin_coe, Real.Angle.angle_eq_iff_two_pi_dvd_sub]
  use ⌊(π - θ) / (2 * π)⌋
  

Proof state:
case h
r : ℝ
hr : 0 < r
θ : ℝ
⊢ arg (↑r * (↑(Real.cos θ) + ↑(Real.sin θ) * I)) - θ = 2 * π * ↑⌊(π - θ) / (2 * π)⌋

Next tactic:
exact mod_cast arg_mul_cos_add_sin_mul_I_sub hr θ
theorem arg_cos_add_sin_mul_I_coe_angle (θ : Real.Angle) :
    (arg (Real.Angle.cos θ + Real.Angle.sin θ * I) : Real.Angle) = θ := by
  

Proof state:
θ : Angle
⊢ ↑(arg (↑(Angle.cos θ) + ↑(Angle.sin θ) * I)) = θ

Next tactic:
rw [← one_mul (_ + _), ← ofReal_one, arg_mul_cos_add_sin_mul_I_coe_angle zero_lt_one]
theorem arg_mul_coe_angle {x y : ℂ} (hx : x ≠ 0) (hy : y ≠ 0) :
    (arg (x * y) : Real.Angle) = arg x + arg y := by
  

Proof state:
x y : ℂ
hx : x ≠ 0
hy : y ≠ 0
⊢ ↑(arg (x * y)) = ↑(arg x) + ↑(arg y)

Next tactic:
convert arg_mul_cos_add_sin_mul_I_coe_angle (mul_pos (abs.pos hx) (abs.pos hy))
      (arg x + arg y : Real.Angle) using
    3
theorem arg_mul_coe_angle {x y : ℂ} (hx : x ≠ 0) (hy : y ≠ 0) :
    (arg (x * y) : Real.Angle) = arg x + arg y := by
  convert arg_mul_cos_add_sin_mul_I_coe_angle (mul_pos (abs.pos hx) (abs.pos hy))
      (arg x + arg y : Real.Angle) using
    3
  

Proof state:
case h.e'_2.h.e'_1.h.e'_1
x y : ℂ
hx : x ≠ 0
hy : y ≠ 0
⊢ x * y = ↑(abs x * abs y) * (↑(Angle.cos (↑(arg x) + ↑(arg y))) + ↑(Angle.sin (↑(arg x) + ↑(arg y))) * I)

Next tactic:
simp_rw [← Real.Angle.coe_add, Real.Angle.sin_coe, Real.Angle.cos_coe, ofReal_cos, ofReal_sin,
    cos_add_sin_I, ofReal_add, add_mul, exp_add, ofReal_mul]
theorem arg_mul_coe_angle {x y : ℂ} (hx : x ≠ 0) (hy : y ≠ 0) :
    (arg (x * y) : Real.Angle) = arg x + arg y := by
  convert arg_mul_cos_add_sin_mul_I_coe_angle (mul_pos (abs.pos hx) (abs.pos hy))
      (arg x + arg y : Real.Angle) using
    3
  simp_rw [← Real.Angle.coe_add, Real.Angle.sin_coe, Real.Angle.cos_coe, ofReal_cos, ofReal_sin,
    cos_add_sin_I, ofReal_add, add_mul, exp_add, ofReal_mul]
  

Proof state:
case h.e'_2.h.e'_1.h.e'_1
x y : ℂ
hx : x ≠ 0
hy : y ≠ 0
⊢ x * y = ↑(abs x) * ↑(abs y) * (cexp (↑(arg x) * I) * cexp (↑(arg y) * I))

Next tactic:
rw [mul_assoc, mul_comm (exp _), ← mul_assoc (abs y : ℂ), abs_mul_exp_arg_mul_I, mul_comm y, ←
    mul_assoc, abs_mul_exp_arg_mul_I]
theorem arg_div_coe_angle {x y : ℂ} (hx : x ≠ 0) (hy : y ≠ 0) :
    (arg (x / y) : Real.Angle) = arg x - arg y := by
  

Proof state:
x y : ℂ
hx : x ≠ 0
hy : y ≠ 0
⊢ ↑(arg (x / y)) = ↑(arg x) - ↑(arg y)

Next tactic:
rw [div_eq_mul_inv, arg_mul_coe_angle hx (inv_ne_zero hy), arg_inv_coe_angle, sub_eq_add_neg]
@[simp]
theorem arg_coe_angle_toReal_eq_arg (z : ℂ) : (arg z : Real.Angle).toReal = arg z := by
  

Proof state:
z : ℂ
⊢ Angle.toReal ↑(arg z) = arg z

Next tactic:
rw [Real.Angle.toReal_coe_eq_self_iff_mem_Ioc]
@[simp]
theorem arg_coe_angle_toReal_eq_arg (z : ℂ) : (arg z : Real.Angle).toReal = arg z := by
  rw [Real.Angle.toReal_coe_eq_self_iff_mem_Ioc]
  

Proof state:
z : ℂ
⊢ arg z ∈ Set.Ioc (-π) π

Next tactic:
exact arg_mem_Ioc _
theorem arg_coe_angle_eq_iff_eq_toReal {z : ℂ} {θ : Real.Angle} :
    (arg z : Real.Angle) = θ ↔ arg z = θ.toReal := by
  

Proof state:
z : ℂ
θ : Angle
⊢ ↑(arg z) = θ ↔ arg z = Angle.toReal θ

Next tactic:
rw [← Real.Angle.toReal_inj, arg_coe_angle_toReal_eq_arg]
@[simp]
theorem arg_coe_angle_eq_iff {x y : ℂ} : (arg x : Real.Angle) = arg y ↔ arg x = arg y := by
  

Proof state:
x y : ℂ
⊢ ↑(arg x) = ↑(arg y) ↔ arg x = arg y

Next tactic:
simp_rw [← Real.Angle.toReal_inj, arg_coe_angle_toReal_eq_arg]
lemma arg_mul_eq_add_arg_iff {x y : ℂ} (hx₀ : x ≠ 0) (hy₀ : y ≠ 0) :
    (x * y).arg = x.arg + y.arg ↔ arg x + arg y ∈ Set.Ioc (-π) π := by
  

Proof state:
x y : ℂ
hx₀ : x ≠ 0
hy₀ : y ≠ 0
⊢ arg (x * y) = arg x + arg y ↔ arg x + arg y ∈ Set.Ioc (-π) π

Next tactic:
rw [← arg_coe_angle_toReal_eq_arg, arg_mul_coe_angle hx₀ hy₀, ← Real.Angle.coe_add,
      Real.Angle.toReal_coe_eq_self_iff_mem_Ioc]
theorem arg_eq_nhds_of_re_neg_of_im_pos (hx_re : x.re < 0) (hx_im : 0 < x.im) :
    arg =ᶠ[𝓝 x] fun x => Real.arcsin ((-x).im / abs x) + π := by
  

Proof state:
x z : ℂ
hx_re : x.re < 0
hx_im : 0 < x.im
⊢ arg =ᶠ[𝓝 x] fun x => arcsin ((-x).im / abs x) + π

Next tactic:
suffices h_forall_nhds : ∀ᶠ y : ℂ in 𝓝 x, y.re < 0 ∧ 0 < y.im
theorem arg_eq_nhds_of_re_neg_of_im_pos (hx_re : x.re < 0) (hx_im : 0 < x.im) :
    arg =ᶠ[𝓝 x] fun x => Real.arcsin ((-x).im / abs x) + π := by
  suffices h_forall_nhds : ∀ᶠ y : ℂ in 𝓝 x, y.re < 0 ∧ 0 < y.im
  

Proof state:
x z : ℂ
hx_re : x.re < 0
hx_im : 0 < x.im
h_forall_nhds : ∀ᶠ (y : ℂ) in 𝓝 x, y.re < 0 ∧ 0 < y.im
⊢ arg =ᶠ[𝓝 x] fun x => arcsin ((-x).im / abs x) + π
case h_forall_nhds x z : ℂ hx_re : x.re < 0 hx_im : 0 < x.im ⊢ ∀ᶠ (y : ℂ) in 𝓝 x, y.re < 0 ∧ 0 < y.im

Next tactic:
exact h_forall_nhds.mono fun y hy => arg_of_re_neg_of_im_nonneg hy.1 hy.2.le
theorem arg_eq_nhds_of_re_neg_of_im_pos (hx_re : x.re < 0) (hx_im : 0 < x.im) :
    arg =ᶠ[𝓝 x] fun x => Real.arcsin ((-x).im / abs x) + π := by
  suffices h_forall_nhds : ∀ᶠ y : ℂ in 𝓝 x, y.re < 0 ∧ 0 < y.im
  exact h_forall_nhds.mono fun y hy => arg_of_re_neg_of_im_nonneg hy.1 hy.2.le
  

Proof state:
case h_forall_nhds
x z : ℂ
hx_re : x.re < 0
hx_im : 0 < x.im
⊢ ∀ᶠ (y : ℂ) in 𝓝 x, y.re < 0 ∧ 0 < y.im

Next tactic:
refine' IsOpen.eventually_mem _ (⟨hx_re, hx_im⟩ : x.re < 0 ∧ 0 < x.im)
theorem arg_eq_nhds_of_re_neg_of_im_pos (hx_re : x.re < 0) (hx_im : 0 < x.im) :
    arg =ᶠ[𝓝 x] fun x => Real.arcsin ((-x).im / abs x) + π := by
  suffices h_forall_nhds : ∀ᶠ y : ℂ in 𝓝 x, y.re < 0 ∧ 0 < y.im
  exact h_forall_nhds.mono fun y hy => arg_of_re_neg_of_im_nonneg hy.1 hy.2.le
  refine' IsOpen.eventually_mem _ (⟨hx_re, hx_im⟩ : x.re < 0 ∧ 0 < x.im)
  

Proof state:
case h_forall_nhds
x z : ℂ
hx_re : x.re < 0
hx_im : 0 < x.im
⊢ IsOpen fun y => y.re < 0 ∧ 0 < y.im

Next tactic:
exact
    IsOpen.and (isOpen_lt continuous_re continuous_zero) (isOpen_lt continuous_zero continuous_im)
theorem arg_eq_nhds_of_re_neg_of_im_neg (hx_re : x.re < 0) (hx_im : x.im < 0) :
    arg =ᶠ[𝓝 x] fun x => Real.arcsin ((-x).im / abs x) - π := by
  

Proof state:
x z : ℂ
hx_re : x.re < 0
hx_im : x.im < 0
⊢ arg =ᶠ[𝓝 x] fun x => arcsin ((-x).im / abs x) - π

Next tactic:
suffices h_forall_nhds : ∀ᶠ y : ℂ in 𝓝 x, y.re < 0 ∧ y.im < 0
theorem arg_eq_nhds_of_re_neg_of_im_neg (hx_re : x.re < 0) (hx_im : x.im < 0) :
    arg =ᶠ[𝓝 x] fun x => Real.arcsin ((-x).im / abs x) - π := by
  suffices h_forall_nhds : ∀ᶠ y : ℂ in 𝓝 x, y.re < 0 ∧ y.im < 0
  

Proof state:
x z : ℂ
hx_re : x.re < 0
hx_im : x.im < 0
h_forall_nhds : ∀ᶠ (y : ℂ) in 𝓝 x, y.re < 0 ∧ y.im < 0
⊢ arg =ᶠ[𝓝 x] fun x => arcsin ((-x).im / abs x) - π
case h_forall_nhds x z : ℂ hx_re : x.re < 0 hx_im : x.im < 0 ⊢ ∀ᶠ (y : ℂ) in 𝓝 x, y.re < 0 ∧ y.im < 0

Next tactic:
exact h_forall_nhds.mono fun y hy => arg_of_re_neg_of_im_neg hy.1 hy.2
theorem arg_eq_nhds_of_re_neg_of_im_neg (hx_re : x.re < 0) (hx_im : x.im < 0) :
    arg =ᶠ[𝓝 x] fun x => Real.arcsin ((-x).im / abs x) - π := by
  suffices h_forall_nhds : ∀ᶠ y : ℂ in 𝓝 x, y.re < 0 ∧ y.im < 0
  exact h_forall_nhds.mono fun y hy => arg_of_re_neg_of_im_neg hy.1 hy.2
  

Proof state:
case h_forall_nhds
x z : ℂ
hx_re : x.re < 0
hx_im : x.im < 0
⊢ ∀ᶠ (y : ℂ) in 𝓝 x, y.re < 0 ∧ y.im < 0

Next tactic:
refine' IsOpen.eventually_mem _ (⟨hx_re, hx_im⟩ : x.re < 0 ∧ x.im < 0)
theorem arg_eq_nhds_of_re_neg_of_im_neg (hx_re : x.re < 0) (hx_im : x.im < 0) :
    arg =ᶠ[𝓝 x] fun x => Real.arcsin ((-x).im / abs x) - π := by
  suffices h_forall_nhds : ∀ᶠ y : ℂ in 𝓝 x, y.re < 0 ∧ y.im < 0
  exact h_forall_nhds.mono fun y hy => arg_of_re_neg_of_im_neg hy.1 hy.2
  refine' IsOpen.eventually_mem _ (⟨hx_re, hx_im⟩ : x.re < 0 ∧ x.im < 0)
  

Proof state:
case h_forall_nhds
x z : ℂ
hx_re : x.re < 0
hx_im : x.im < 0
⊢ IsOpen fun y => y.re < 0 ∧ y.im < 0

Next tactic:
exact
    IsOpen.and (isOpen_lt continuous_re continuous_zero) (isOpen_lt continuous_im continuous_zero)
theorem continuousAt_arg (h : 0 < x.re ∨ x.im ≠ 0) : ContinuousAt arg x := by
  

Proof state:
x z : ℂ
h : 0 < x.re ∨ x.im ≠ 0
⊢ ContinuousAt arg x

Next tactic:
have h₀ : abs x ≠ 0 := by
    rw [abs.ne_zero_iff]
    rintro rfl
    simp at h
theorem continuousAt_arg (h : 0 < x.re ∨ x.im ≠ 0) : ContinuousAt arg x := by
  have h₀ : abs x ≠ 0 := by
    

Proof state:
x z : ℂ
h : 0 < x.re ∨ x.im ≠ 0
⊢ abs x ≠ 0

Next tactic:
rw [abs.ne_zero_iff]
theorem continuousAt_arg (h : 0 < x.re ∨ x.im ≠ 0) : ContinuousAt arg x := by
  have h₀ : abs x ≠ 0 := by
    rw [abs.ne_zero_iff]
    

Proof state:
x z : ℂ
h : 0 < x.re ∨ x.im ≠ 0
⊢ x ≠ 0

Next tactic:
rintro rfl
theorem continuousAt_arg (h : 0 < x.re ∨ x.im ≠ 0) : ContinuousAt arg x := by
  have h₀ : abs x ≠ 0 := by
    rw [abs.ne_zero_iff]
    rintro rfl
    

Proof state:
z : ℂ
h : 0 < 0.re ∨ 0.im ≠ 0
⊢ False

Next tactic:
simp at h
theorem continuousAt_arg (h : 0 < x.re ∨ x.im ≠ 0) : ContinuousAt arg x := by
  have h₀ : abs x ≠ 0 := by
    rw [abs.ne_zero_iff]
    rintro rfl
    simp at h
  

Proof state:
x z : ℂ
h : 0 < x.re ∨ x.im ≠ 0
h₀ : abs x ≠ 0
⊢ ContinuousAt arg x

Next tactic:
rw [← lt_or_lt_iff_ne] at h
theorem continuousAt_arg (h : 0 < x.re ∨ x.im ≠ 0) : ContinuousAt arg x := by
  have h₀ : abs x ≠ 0 := by
    rw [abs.ne_zero_iff]
    rintro rfl
    simp at h
  rw [← lt_or_lt_iff_ne] at h
  

Proof state:
x z : ℂ
h : 0 < x.re ∨ x.im < 0 ∨ 0 < x.im
h₀ : abs x ≠ 0
⊢ ContinuousAt arg x

Next tactic:
rcases h with (hx_re | hx_im | hx_im)
theorem continuousAt_arg (h : 0 < x.re ∨ x.im ≠ 0) : ContinuousAt arg x := by
  have h₀ : abs x ≠ 0 := by
    rw [abs.ne_zero_iff]
    rintro rfl
    simp at h
  rw [← lt_or_lt_iff_ne] at h
  rcases h with (hx_re | hx_im | hx_im)
  

Proof state:
case inl
x z : ℂ
h₀ : abs x ≠ 0
hx_re : 0 < x.re
⊢ ContinuousAt arg x
case inr.inl
x z : ℂ
h₀ : abs x ≠ 0
hx_im : x.im < 0
⊢ ContinuousAt arg x
case inr.inr x z : ℂ h₀ : abs x ≠ 0 hx_im : 0 < x.im ⊢ ContinuousAt arg x

Next tactic:
exacts [(Real.continuousAt_arcsin.comp
          (continuous_im.continuousAt.div continuous_abs.continuousAt h₀)).congr
      (arg_eq_nhds_of_re_pos hx_re).symm,
    (Real.continuous_arccos.continuousAt.comp
            (continuous_re.continuousAt.div continuous_abs.continuousAt h₀)).neg.congr
      (arg_eq_nhds_of_im_neg hx_im).symm,
    (Real.continuous_arccos.continuousAt.comp
          (continuous_re.continuousAt.div continuous_abs.continuousAt h₀)).congr
      (arg_eq_nhds_of_im_pos hx_im).symm]
theorem tendsto_arg_nhdsWithin_im_neg_of_re_neg_of_im_zero {z : ℂ} (hre : z.re < 0)
    (him : z.im = 0) : Tendsto arg (𝓝[{ z : ℂ | z.im < 0 }] z) (𝓝 (-π)) := by
  

Proof state:
x z✝ z : ℂ
hre : z.re < 0
him : z.im = 0
⊢ Tendsto arg (𝓝[{z | z.im < 0}] z) (𝓝 (-π))

Next tactic:
suffices H :
    Tendsto (fun x : ℂ => Real.arcsin ((-x).im / abs x) - π) (𝓝[{ z : ℂ | z.im < 0 }] z) (𝓝 (-π))
theorem tendsto_arg_nhdsWithin_im_neg_of_re_neg_of_im_zero {z : ℂ} (hre : z.re < 0)
    (him : z.im = 0) : Tendsto arg (𝓝[{ z : ℂ | z.im < 0 }] z) (𝓝 (-π)) := by
  suffices H :
    Tendsto (fun x : ℂ => Real.arcsin ((-x).im / abs x) - π) (𝓝[{ z : ℂ | z.im < 0 }] z) (𝓝 (-π))
  · 

Proof state:
x z✝ z : ℂ
hre : z.re < 0
him : z.im = 0
H : Tendsto (fun x => arcsin ((-x).im / abs x) - π) (𝓝[{z | z.im < 0}] z) (𝓝 (-π))
⊢ Tendsto arg (𝓝[{z | z.im < 0}] z) (𝓝 (-π))

Next tactic:
refine' H.congr' _
theorem tendsto_arg_nhdsWithin_im_neg_of_re_neg_of_im_zero {z : ℂ} (hre : z.re < 0)
    (him : z.im = 0) : Tendsto arg (𝓝[{ z : ℂ | z.im < 0 }] z) (𝓝 (-π)) := by
  suffices H :
    Tendsto (fun x : ℂ => Real.arcsin ((-x).im / abs x) - π) (𝓝[{ z : ℂ | z.im < 0 }] z) (𝓝 (-π))
  · refine' H.congr' _
    

Proof state:
x z✝ z : ℂ
hre : z.re < 0
him : z.im = 0
H : Tendsto (fun x => arcsin ((-x).im / abs x) - π) (𝓝[{z | z.im < 0}] z) (𝓝 (-π))
⊢ (fun x => arcsin ((-x).im / abs x) - π) =ᶠ[𝓝[{z | z.im < 0}] z] arg

Next tactic:
have : ∀ᶠ x : ℂ in 𝓝 z, x.re < 0 := continuous_re.tendsto z (gt_mem_nhds hre)
theorem tendsto_arg_nhdsWithin_im_neg_of_re_neg_of_im_zero {z : ℂ} (hre : z.re < 0)
    (him : z.im = 0) : Tendsto arg (𝓝[{ z : ℂ | z.im < 0 }] z) (𝓝 (-π)) := by
  suffices H :
    Tendsto (fun x : ℂ => Real.arcsin ((-x).im / abs x) - π) (𝓝[{ z : ℂ | z.im < 0 }] z) (𝓝 (-π))
  · refine' H.congr' _
    have : ∀ᶠ x : ℂ in 𝓝 z, x.re < 0 := continuous_re.tendsto z (gt_mem_nhds hre)
    -- Porting note: need to specify the `nhdsWithin` set
    

Proof state:
x z✝ z : ℂ
hre : z.re < 0
him : z.im = 0
H : Tendsto (fun x => arcsin ((-x).im / abs x) - π) (𝓝[{z | z.im < 0}] z) (𝓝 (-π))
this : ∀ᶠ (x : ℂ) in 𝓝 z, x.re < 0
⊢ (fun x => arcsin ((-x).im / abs x) - π) =ᶠ[𝓝[{z | z.im < 0}] z] arg

Next tactic:
filter_upwards [self_mem_nhdsWithin (s := { z : ℂ | z.im < 0 }),
      mem_nhdsWithin_of_mem_nhds this] with _ him hre
theorem tendsto_arg_nhdsWithin_im_neg_of_re_neg_of_im_zero {z : ℂ} (hre : z.re < 0)
    (him : z.im = 0) : Tendsto arg (𝓝[{ z : ℂ | z.im < 0 }] z) (𝓝 (-π)) := by
  suffices H :
    Tendsto (fun x : ℂ => Real.arcsin ((-x).im / abs x) - π) (𝓝[{ z : ℂ | z.im < 0 }] z) (𝓝 (-π))
  · refine' H.congr' _
    have : ∀ᶠ x : ℂ in 𝓝 z, x.re < 0 := continuous_re.tendsto z (gt_mem_nhds hre)
    -- Porting note: need to specify the `nhdsWithin` set
    filter_upwards [self_mem_nhdsWithin (s := { z : ℂ | z.im < 0 }),
      mem_nhdsWithin_of_mem_nhds this] with _ him hre
    

Proof state:
case h
x z✝ z : ℂ
hre✝ : z.re < 0
him✝ : z.im = 0
H : Tendsto (fun x => arcsin ((-x).im / abs x) - π) (𝓝[{z | z.im < 0}] z) (𝓝 (-π))
this : ∀ᶠ (x : ℂ) in 𝓝 z, x.re < 0
a✝ : ℂ
him : a✝.im < 0
hre : a✝.re < 0
⊢ arcsin ((-a✝).im / abs a✝) - π = arg a✝

Next tactic:
rw [arg, if_neg hre.not_le, if_neg him.not_le]
theorem tendsto_arg_nhdsWithin_im_neg_of_re_neg_of_im_zero {z : ℂ} (hre : z.re < 0)
    (him : z.im = 0) : Tendsto arg (𝓝[{ z : ℂ | z.im < 0 }] z) (𝓝 (-π)) := by
  suffices H :
    Tendsto (fun x : ℂ => Real.arcsin ((-x).im / abs x) - π) (𝓝[{ z : ℂ | z.im < 0 }] z) (𝓝 (-π))
  · refine' H.congr' _
    have : ∀ᶠ x : ℂ in 𝓝 z, x.re < 0 := continuous_re.tendsto z (gt_mem_nhds hre)
    -- Porting note: need to specify the `nhdsWithin` set
    filter_upwards [self_mem_nhdsWithin (s := { z : ℂ | z.im < 0 }),
      mem_nhdsWithin_of_mem_nhds this] with _ him hre
    rw [arg, if_neg hre.not_le, if_neg him.not_le]
  

Proof state:
case H
x z✝ z : ℂ
hre : z.re < 0
him : z.im = 0
⊢ Tendsto (fun x => arcsin ((-x).im / abs x) - π) (𝓝[{z | z.im < 0}] z) (𝓝 (-π))

Next tactic:
convert (Real.continuousAt_arcsin.comp_continuousWithinAt
          ((continuous_im.continuousAt.comp_continuousWithinAt continuousWithinAt_neg).div
            -- Porting note: added type hint to assist in goal state below
            continuous_abs.continuousWithinAt (s := { z : ℂ | z.im < 0 }) (_ : abs z ≠ 0))
          -- Porting note: specify constant precisely to assist in goal below
          ).sub_const π using 1
theorem tendsto_arg_nhdsWithin_im_neg_of_re_neg_of_im_zero {z : ℂ} (hre : z.re < 0)
    (him : z.im = 0) : Tendsto arg (𝓝[{ z : ℂ | z.im < 0 }] z) (𝓝 (-π)) := by
  suffices H :
    Tendsto (fun x : ℂ => Real.arcsin ((-x).im / abs x) - π) (𝓝[{ z : ℂ | z.im < 0 }] z) (𝓝 (-π))
  · refine' H.congr' _
    have : ∀ᶠ x : ℂ in 𝓝 z, x.re < 0 := continuous_re.tendsto z (gt_mem_nhds hre)
    -- Porting note: need to specify the `nhdsWithin` set
    filter_upwards [self_mem_nhdsWithin (s := { z : ℂ | z.im < 0 }),
      mem_nhdsWithin_of_mem_nhds this] with _ him hre
    rw [arg, if_neg hre.not_le, if_neg him.not_le]
  convert (Real.continuousAt_arcsin.comp_continuousWithinAt
          ((continuous_im.continuousAt.comp_continuousWithinAt continuousWithinAt_neg).div
            -- Porting note: added type hint to assist in goal state below
            continuous_abs.continuousWithinAt (s := { z : ℂ | z.im < 0 }) (_ : abs z ≠ 0))
          -- Porting note: specify constant precisely to assist in goal below
          ).sub_const π using 1
  · 

Proof state:
case h.e'_5
x z✝ z : ℂ
hre : z.re < 0
him : z.im = 0
⊢ 𝓝 (-π) = 𝓝 ((arcsin ∘ (im ∘ Neg.neg / ⇑abs)) z - π)

Next tactic:
simp [him]
theorem tendsto_arg_nhdsWithin_im_neg_of_re_neg_of_im_zero {z : ℂ} (hre : z.re < 0)
    (him : z.im = 0) : Tendsto arg (𝓝[{ z : ℂ | z.im < 0 }] z) (𝓝 (-π)) := by
  suffices H :
    Tendsto (fun x : ℂ => Real.arcsin ((-x).im / abs x) - π) (𝓝[{ z : ℂ | z.im < 0 }] z) (𝓝 (-π))
  · refine' H.congr' _
    have : ∀ᶠ x : ℂ in 𝓝 z, x.re < 0 := continuous_re.tendsto z (gt_mem_nhds hre)
    -- Porting note: need to specify the `nhdsWithin` set
    filter_upwards [self_mem_nhdsWithin (s := { z : ℂ | z.im < 0 }),
      mem_nhdsWithin_of_mem_nhds this] with _ him hre
    rw [arg, if_neg hre.not_le, if_neg him.not_le]
  convert (Real.continuousAt_arcsin.comp_continuousWithinAt
          ((continuous_im.continuousAt.comp_continuousWithinAt continuousWithinAt_neg).div
            -- Porting note: added type hint to assist in goal state below
            continuous_abs.continuousWithinAt (s := { z : ℂ | z.im < 0 }) (_ : abs z ≠ 0))
          -- Porting note: specify constant precisely to assist in goal below
          ).sub_const π using 1
  · simp [him]
  · 

Proof state:
case H
x z✝ z : ℂ
hre : z.re < 0
him : z.im = 0
⊢ abs z ≠ 0

Next tactic:
lift z to ℝ using him