l3lab/ntp-mathlib huggingface dataset:
theorem arg_eq_pi_div_two_iff {z : ℂ} : arg z = π / 2 ↔ z.re = 0 ∧ 0 < z.im := by
  by_cases h₀ : z = 0; · simp [h₀, lt_irrefl, Real.pi_div_two_pos.ne]
  constructor
  · 

Proof state:
case neg.mp
z : ℂ
h₀ : ¬z = 0
⊢ arg z = π / 2 → z.re = 0 ∧ 0 < z.im

Next tactic:
intro h
theorem arg_eq_pi_div_two_iff {z : ℂ} : arg z = π / 2 ↔ z.re = 0 ∧ 0 < z.im := by
  by_cases h₀ : z = 0; · simp [h₀, lt_irrefl, Real.pi_div_two_pos.ne]
  constructor
  · intro h
    

Proof state:
case neg.mp
z : ℂ
h₀ : ¬z = 0
h : arg z = π / 2
⊢ z.re = 0 ∧ 0 < z.im

Next tactic:
rw [← abs_mul_cos_add_sin_mul_I z, h]
theorem arg_eq_pi_div_two_iff {z : ℂ} : arg z = π / 2 ↔ z.re = 0 ∧ 0 < z.im := by
  by_cases h₀ : z = 0; · simp [h₀, lt_irrefl, Real.pi_div_two_pos.ne]
  constructor
  · intro h
    rw [← abs_mul_cos_add_sin_mul_I z, h]
    

Proof state:
case neg.mp
z : ℂ
h₀ : ¬z = 0
h : arg z = π / 2
⊢ (↑(abs z) * (cos ↑(π / 2) + sin ↑(π / 2) * I)).re = 0 ∧ 0 < (↑(abs z) * (cos ↑(π / 2) + sin ↑(π / 2) * I)).im

Next tactic:
simp [h₀]
theorem arg_eq_pi_div_two_iff {z : ℂ} : arg z = π / 2 ↔ z.re = 0 ∧ 0 < z.im := by
  by_cases h₀ : z = 0; · simp [h₀, lt_irrefl, Real.pi_div_two_pos.ne]
  constructor
  · intro h
    rw [← abs_mul_cos_add_sin_mul_I z, h]
    simp [h₀]
  · 

Proof state:
case neg.mpr
z : ℂ
h₀ : ¬z = 0
⊢ z.re = 0 ∧ 0 < z.im → arg z = π / 2

Next tactic:
cases' z with x y
theorem arg_eq_pi_div_two_iff {z : ℂ} : arg z = π / 2 ↔ z.re = 0 ∧ 0 < z.im := by
  by_cases h₀ : z = 0; · simp [h₀, lt_irrefl, Real.pi_div_two_pos.ne]
  constructor
  · intro h
    rw [← abs_mul_cos_add_sin_mul_I z, h]
    simp [h₀]
  · cases' z with x y
    

Proof state:
case neg.mpr.mk
x y : ℝ
h₀ : ¬{ re := x, im := y } = 0
⊢ { re := x, im := y }.re = 0 ∧ 0 < { re := x, im := y }.im → arg { re := x, im := y } = π / 2

Next tactic:
rintro ⟨rfl : x = 0, hy : 0 < y⟩
theorem arg_eq_pi_div_two_iff {z : ℂ} : arg z = π / 2 ↔ z.re = 0 ∧ 0 < z.im := by
  by_cases h₀ : z = 0; · simp [h₀, lt_irrefl, Real.pi_div_two_pos.ne]
  constructor
  · intro h
    rw [← abs_mul_cos_add_sin_mul_I z, h]
    simp [h₀]
  · cases' z with x y
    rintro ⟨rfl : x = 0, hy : 0 < y⟩
    

Proof state:
case neg.mpr.mk.intro
y : ℝ
h₀ : ¬{ re := 0, im := y } = 0
hy : 0 < y
⊢ arg { re := 0, im := y } = π / 2

Next tactic:
rw [← arg_I, ← arg_real_mul I hy, ofReal_mul', I_re, I_im, mul_zero, mul_one]
theorem arg_eq_neg_pi_div_two_iff {z : ℂ} : arg z = -(π / 2) ↔ z.re = 0 ∧ z.im < 0 := by
  

Proof state:
z : ℂ
⊢ arg z = -(π / 2) ↔ z.re = 0 ∧ z.im < 0

Next tactic:
by_cases h₀ : z = 0
theorem arg_eq_neg_pi_div_two_iff {z : ℂ} : arg z = -(π / 2) ↔ z.re = 0 ∧ z.im < 0 := by
  by_cases h₀ : z = 0; · 

Proof state:
case pos
z : ℂ
h₀ : z = 0
⊢ arg z = -(π / 2) ↔ z.re = 0 ∧ z.im < 0

Next tactic:
simp [h₀, lt_irrefl, Real.pi_ne_zero]
theorem arg_eq_neg_pi_div_two_iff {z : ℂ} : arg z = -(π / 2) ↔ z.re = 0 ∧ z.im < 0 := by
  by_cases h₀ : z = 0; · simp [h₀, lt_irrefl, Real.pi_ne_zero]
  

Proof state:
case neg
z : ℂ
h₀ : ¬z = 0
⊢ arg z = -(π / 2) ↔ z.re = 0 ∧ z.im < 0

Next tactic:
constructor
theorem arg_eq_neg_pi_div_two_iff {z : ℂ} : arg z = -(π / 2) ↔ z.re = 0 ∧ z.im < 0 := by
  by_cases h₀ : z = 0; · simp [h₀, lt_irrefl, Real.pi_ne_zero]
  constructor
  · 

Proof state:
case neg.mp
z : ℂ
h₀ : ¬z = 0
⊢ arg z = -(π / 2) → z.re = 0 ∧ z.im < 0

Next tactic:
intro h
theorem arg_eq_neg_pi_div_two_iff {z : ℂ} : arg z = -(π / 2) ↔ z.re = 0 ∧ z.im < 0 := by
  by_cases h₀ : z = 0; · simp [h₀, lt_irrefl, Real.pi_ne_zero]
  constructor
  · intro h
    

Proof state:
case neg.mp
z : ℂ
h₀ : ¬z = 0
h : arg z = -(π / 2)
⊢ z.re = 0 ∧ z.im < 0

Next tactic:
rw [← abs_mul_cos_add_sin_mul_I z, h]
theorem arg_eq_neg_pi_div_two_iff {z : ℂ} : arg z = -(π / 2) ↔ z.re = 0 ∧ z.im < 0 := by
  by_cases h₀ : z = 0; · simp [h₀, lt_irrefl, Real.pi_ne_zero]
  constructor
  · intro h
    rw [← abs_mul_cos_add_sin_mul_I z, h]
    

Proof state:
case neg.mp
z : ℂ
h₀ : ¬z = 0
h : arg z = -(π / 2)
⊢ (↑(abs z) * (cos ↑(-(π / 2)) + sin ↑(-(π / 2)) * I)).re = 0 ∧
    (↑(abs z) * (cos ↑(-(π / 2)) + sin ↑(-(π / 2)) * I)).im < 0

Next tactic:
simp [h₀]
theorem arg_eq_neg_pi_div_two_iff {z : ℂ} : arg z = -(π / 2) ↔ z.re = 0 ∧ z.im < 0 := by
  by_cases h₀ : z = 0; · simp [h₀, lt_irrefl, Real.pi_ne_zero]
  constructor
  · intro h
    rw [← abs_mul_cos_add_sin_mul_I z, h]
    simp [h₀]
  · 

Proof state:
case neg.mpr
z : ℂ
h₀ : ¬z = 0
⊢ z.re = 0 ∧ z.im < 0 → arg z = -(π / 2)

Next tactic:
cases' z with x y
theorem arg_eq_neg_pi_div_two_iff {z : ℂ} : arg z = -(π / 2) ↔ z.re = 0 ∧ z.im < 0 := by
  by_cases h₀ : z = 0; · simp [h₀, lt_irrefl, Real.pi_ne_zero]
  constructor
  · intro h
    rw [← abs_mul_cos_add_sin_mul_I z, h]
    simp [h₀]
  · cases' z with x y
    

Proof state:
case neg.mpr.mk
x y : ℝ
h₀ : ¬{ re := x, im := y } = 0
⊢ { re := x, im := y }.re = 0 ∧ { re := x, im := y }.im < 0 → arg { re := x, im := y } = -(π / 2)

Next tactic:
rintro ⟨rfl : x = 0, hy : y < 0⟩
theorem arg_eq_neg_pi_div_two_iff {z : ℂ} : arg z = -(π / 2) ↔ z.re = 0 ∧ z.im < 0 := by
  by_cases h₀ : z = 0; · simp [h₀, lt_irrefl, Real.pi_ne_zero]
  constructor
  · intro h
    rw [← abs_mul_cos_add_sin_mul_I z, h]
    simp [h₀]
  · cases' z with x y
    rintro ⟨rfl : x = 0, hy : y < 0⟩
    

Proof state:
case neg.mpr.mk.intro
y : ℝ
h₀ : ¬{ re := 0, im := y } = 0
hy : y < 0
⊢ arg { re := 0, im := y } = -(π / 2)

Next tactic:
rw [← arg_neg_I, ← arg_real_mul (-I) (neg_pos.2 hy), mk_eq_add_mul_I]
theorem arg_eq_neg_pi_div_two_iff {z : ℂ} : arg z = -(π / 2) ↔ z.re = 0 ∧ z.im < 0 := by
  by_cases h₀ : z = 0; · simp [h₀, lt_irrefl, Real.pi_ne_zero]
  constructor
  · intro h
    rw [← abs_mul_cos_add_sin_mul_I z, h]
    simp [h₀]
  · cases' z with x y
    rintro ⟨rfl : x = 0, hy : y < 0⟩
    rw [← arg_neg_I, ← arg_real_mul (-I) (neg_pos.2 hy), mk_eq_add_mul_I]
    

Proof state:
case neg.mpr.mk.intro
y : ℝ
h₀ : ¬{ re := 0, im := y } = 0
hy : y < 0
⊢ arg (↑0 + ↑y * I) = arg (↑(-y) * -I)

Next tactic:
simp
theorem arg_of_re_neg_of_im_nonneg {x : ℂ} (hx_re : x.re < 0) (hx_im : 0 ≤ x.im) :
    arg x = Real.arcsin ((-x).im / abs x) + π := by
  

Proof state:
x : ℂ
hx_re : x.re < 0
hx_im : 0 ≤ x.im
⊢ arg x = arcsin ((-x).im / abs x) + π

Next tactic:
simp only [arg, hx_re.not_le, hx_im, if_true, if_false]
theorem arg_of_re_neg_of_im_neg {x : ℂ} (hx_re : x.re < 0) (hx_im : x.im < 0) :
    arg x = Real.arcsin ((-x).im / abs x) - π := by
  

Proof state:
x : ℂ
hx_re : x.re < 0
hx_im : x.im < 0
⊢ arg x = arcsin ((-x).im / abs x) - π

Next tactic:
simp only [arg, hx_re.not_le, hx_im.not_le, if_false]
theorem arg_of_im_nonneg_of_ne_zero {z : ℂ} (h₁ : 0 ≤ z.im) (h₂ : z ≠ 0) :
    arg z = Real.arccos (z.re / abs z) := by
  

Proof state:
z : ℂ
h₁ : 0 ≤ z.im
h₂ : z ≠ 0
⊢ arg z = arccos (z.re / abs z)

Next tactic:
rw [← cos_arg h₂, Real.arccos_cos (arg_nonneg_iff.2 h₁) (arg_le_pi _)]
theorem arg_of_im_neg {z : ℂ} (hz : z.im < 0) : arg z = -Real.arccos (z.re / abs z) := by
  

Proof state:
z : ℂ
hz : z.im < 0
⊢ arg z = -arccos (z.re / abs z)

Next tactic:
have h₀ : z ≠ 0 := mt (congr_arg im) hz.ne
theorem arg_of_im_neg {z : ℂ} (hz : z.im < 0) : arg z = -Real.arccos (z.re / abs z) := by
  have h₀ : z ≠ 0 := mt (congr_arg im) hz.ne
  

Proof state:
z : ℂ
hz : z.im < 0
h₀ : z ≠ 0
⊢ arg z = -arccos (z.re / abs z)

Next tactic:
rw [← cos_arg h₀, ← Real.cos_neg, Real.arccos_cos, neg_neg]
theorem arg_of_im_neg {z : ℂ} (hz : z.im < 0) : arg z = -Real.arccos (z.re / abs z) := by
  have h₀ : z ≠ 0 := mt (congr_arg im) hz.ne
  rw [← cos_arg h₀, ← Real.cos_neg, Real.arccos_cos, neg_neg]
  

Proof state:
case hx₁
z : ℂ
hz : z.im < 0
h₀ : z ≠ 0
⊢ 0 ≤ -arg z
case hx₂ z : ℂ hz : z.im < 0 h₀ : z ≠ 0 ⊢ -arg z ≤ π

Next tactic:
exacts [neg_nonneg.2 (arg_neg_iff.2 hz).le, neg_le.2 (neg_pi_lt_arg z).le]
theorem arg_conj (x : ℂ) : arg (conj x) = if arg x = π then π else -arg x := by
  

Proof state:
x : ℂ
⊢ arg ((starRingEnd ℂ) x) = if arg x = π then π else -arg x

Next tactic:
simp_rw [arg_eq_pi_iff, arg, neg_im, conj_im, conj_re, abs_conj, neg_div, neg_neg,
    Real.arcsin_neg]
theorem arg_conj (x : ℂ) : arg (conj x) = if arg x = π then π else -arg x := by
  simp_rw [arg_eq_pi_iff, arg, neg_im, conj_im, conj_re, abs_conj, neg_div, neg_neg,
    Real.arcsin_neg]
  

Proof state:
x : ℂ
⊢ (if 0 ≤ x.re then -arcsin (x.im / abs x)
    else if 0 ≤ -x.im then arcsin (x.im / abs x) + π else arcsin (x.im / abs x) - π) =
    if x.re < 0 ∧ x.im = 0 then π
    else
      -if 0 ≤ x.re then arcsin (x.im / abs x)
        else if 0 ≤ x.im then -arcsin (x.im / abs x) + π else -arcsin (x.im / abs x) - π

Next tactic:
rcases lt_trichotomy x.re 0 with (hr | hr | hr)
theorem arg_conj (x : ℂ) : arg (conj x) = if arg x = π then π else -arg x := by
  simp_rw [arg_eq_pi_iff, arg, neg_im, conj_im, conj_re, abs_conj, neg_div, neg_neg,
    Real.arcsin_neg]
  rcases lt_trichotomy x.re 0 with (hr | hr | hr) <;>
    

Proof state:
case inl
x : ℂ
hr : x.re < 0
⊢ (if 0 ≤ x.re then -arcsin (x.im / abs x)
    else if 0 ≤ -x.im then arcsin (x.im / abs x) + π else arcsin (x.im / abs x) - π) =
    if x.re < 0 ∧ x.im = 0 then π
    else
      -if 0 ≤ x.re then arcsin (x.im / abs x)
        else if 0 ≤ x.im then -arcsin (x.im / abs x) + π else -arcsin (x.im / abs x) - π

Next tactic:
rcases lt_trichotomy x.im 0 with (hi | hi | hi)
theorem arg_conj (x : ℂ) : arg (conj x) = if arg x = π then π else -arg x := by
  simp_rw [arg_eq_pi_iff, arg, neg_im, conj_im, conj_re, abs_conj, neg_div, neg_neg,
    Real.arcsin_neg]
  rcases lt_trichotomy x.re 0 with (hr | hr | hr) <;>
    

Proof state:
case inr.inl
x : ℂ
hr : x.re = 0
⊢ (if 0 ≤ x.re then -arcsin (x.im / abs x)
    else if 0 ≤ -x.im then arcsin (x.im / abs x) + π else arcsin (x.im / abs x) - π) =
    if x.re < 0 ∧ x.im = 0 then π
    else
      -if 0 ≤ x.re then arcsin (x.im / abs x)
        else if 0 ≤ x.im then -arcsin (x.im / abs x) + π else -arcsin (x.im / abs x) - π

Next tactic:
rcases lt_trichotomy x.im 0 with (hi | hi | hi)
theorem arg_conj (x : ℂ) : arg (conj x) = if arg x = π then π else -arg x := by
  simp_rw [arg_eq_pi_iff, arg, neg_im, conj_im, conj_re, abs_conj, neg_div, neg_neg,
    Real.arcsin_neg]
  rcases lt_trichotomy x.re 0 with (hr | hr | hr) <;>
    

Proof state:
case inr.inr
x : ℂ
hr : 0 < x.re
⊢ (if 0 ≤ x.re then -arcsin (x.im / abs x)
    else if 0 ≤ -x.im then arcsin (x.im / abs x) + π else arcsin (x.im / abs x) - π) =
    if x.re < 0 ∧ x.im = 0 then π
    else
      -if 0 ≤ x.re then arcsin (x.im / abs x)
        else if 0 ≤ x.im then -arcsin (x.im / abs x) + π else -arcsin (x.im / abs x) - π

Next tactic:
rcases lt_trichotomy x.im 0 with (hi | hi | hi)
theorem arg_conj (x : ℂ) : arg (conj x) = if arg x = π then π else -arg x := by
  simp_rw [arg_eq_pi_iff, arg, neg_im, conj_im, conj_re, abs_conj, neg_div, neg_neg,
    Real.arcsin_neg]
  rcases lt_trichotomy x.re 0 with (hr | hr | hr) <;>
    rcases lt_trichotomy x.im 0 with (hi | hi | hi)
  · 

Proof state:
case inl.inl
x : ℂ
hr : x.re < 0
hi : x.im < 0
⊢ (if 0 ≤ x.re then -arcsin (x.im / abs x)
    else if 0 ≤ -x.im then arcsin (x.im / abs x) + π else arcsin (x.im / abs x) - π) =
    if x.re < 0 ∧ x.im = 0 then π
    else
      -if 0 ≤ x.re then arcsin (x.im / abs x)
        else if 0 ≤ x.im then -arcsin (x.im / abs x) + π else -arcsin (x.im / abs x) - π

Next tactic:
simp [hr, hr.not_le, hi.le, hi.ne, not_le.2 hi, add_comm]
theorem arg_conj (x : ℂ) : arg (conj x) = if arg x = π then π else -arg x := by
  simp_rw [arg_eq_pi_iff, arg, neg_im, conj_im, conj_re, abs_conj, neg_div, neg_neg,
    Real.arcsin_neg]
  rcases lt_trichotomy x.re 0 with (hr | hr | hr) <;>
    rcases lt_trichotomy x.im 0 with (hi | hi | hi)
  · simp [hr, hr.not_le, hi.le, hi.ne, not_le.2 hi, add_comm]
  · 

Proof state:
case inl.inr.inl
x : ℂ
hr : x.re < 0
hi : x.im = 0
⊢ (if 0 ≤ x.re then -arcsin (x.im / abs x)
    else if 0 ≤ -x.im then arcsin (x.im / abs x) + π else arcsin (x.im / abs x) - π) =
    if x.re < 0 ∧ x.im = 0 then π
    else
      -if 0 ≤ x.re then arcsin (x.im / abs x)
        else if 0 ≤ x.im then -arcsin (x.im / abs x) + π else -arcsin (x.im / abs x) - π

Next tactic:
simp [hr, hr.not_le, hi]
theorem arg_conj (x : ℂ) : arg (conj x) = if arg x = π then π else -arg x := by
  simp_rw [arg_eq_pi_iff, arg, neg_im, conj_im, conj_re, abs_conj, neg_div, neg_neg,
    Real.arcsin_neg]
  rcases lt_trichotomy x.re 0 with (hr | hr | hr) <;>
    rcases lt_trichotomy x.im 0 with (hi | hi | hi)
  · simp [hr, hr.not_le, hi.le, hi.ne, not_le.2 hi, add_comm]
  · simp [hr, hr.not_le, hi]
  · 

Proof state:
case inl.inr.inr
x : ℂ
hr : x.re < 0
hi : 0 < x.im
⊢ (if 0 ≤ x.re then -arcsin (x.im / abs x)
    else if 0 ≤ -x.im then arcsin (x.im / abs x) + π else arcsin (x.im / abs x) - π) =
    if x.re < 0 ∧ x.im = 0 then π
    else
      -if 0 ≤ x.re then arcsin (x.im / abs x)
        else if 0 ≤ x.im then -arcsin (x.im / abs x) + π else -arcsin (x.im / abs x) - π

Next tactic:
simp [hr, hr.not_le, hi.ne.symm, hi.le, not_le.2 hi, sub_eq_neg_add]
theorem arg_conj (x : ℂ) : arg (conj x) = if arg x = π then π else -arg x := by
  simp_rw [arg_eq_pi_iff, arg, neg_im, conj_im, conj_re, abs_conj, neg_div, neg_neg,
    Real.arcsin_neg]
  rcases lt_trichotomy x.re 0 with (hr | hr | hr) <;>
    rcases lt_trichotomy x.im 0 with (hi | hi | hi)
  · simp [hr, hr.not_le, hi.le, hi.ne, not_le.2 hi, add_comm]
  · simp [hr, hr.not_le, hi]
  · simp [hr, hr.not_le, hi.ne.symm, hi.le, not_le.2 hi, sub_eq_neg_add]
  · 

Proof state:
case inr.inl.inl
x : ℂ
hr : x.re = 0
hi : x.im < 0
⊢ (if 0 ≤ x.re then -arcsin (x.im / abs x)
    else if 0 ≤ -x.im then arcsin (x.im / abs x) + π else arcsin (x.im / abs x) - π) =
    if x.re < 0 ∧ x.im = 0 then π
    else
      -if 0 ≤ x.re then arcsin (x.im / abs x)
        else if 0 ≤ x.im then -arcsin (x.im / abs x) + π else -arcsin (x.im / abs x) - π

Next tactic:
simp [hr]
theorem arg_conj (x : ℂ) : arg (conj x) = if arg x = π then π else -arg x := by
  simp_rw [arg_eq_pi_iff, arg, neg_im, conj_im, conj_re, abs_conj, neg_div, neg_neg,
    Real.arcsin_neg]
  rcases lt_trichotomy x.re 0 with (hr | hr | hr) <;>
    rcases lt_trichotomy x.im 0 with (hi | hi | hi)
  · simp [hr, hr.not_le, hi.le, hi.ne, not_le.2 hi, add_comm]
  · simp [hr, hr.not_le, hi]
  · simp [hr, hr.not_le, hi.ne.symm, hi.le, not_le.2 hi, sub_eq_neg_add]
  · simp [hr]
  · 

Proof state:
case inr.inl.inr.inl
x : ℂ
hr : x.re = 0
hi : x.im = 0
⊢ (if 0 ≤ x.re then -arcsin (x.im / abs x)
    else if 0 ≤ -x.im then arcsin (x.im / abs x) + π else arcsin (x.im / abs x) - π) =
    if x.re < 0 ∧ x.im = 0 then π
    else
      -if 0 ≤ x.re then arcsin (x.im / abs x)
        else if 0 ≤ x.im then -arcsin (x.im / abs x) + π else -arcsin (x.im / abs x) - π

Next tactic:
simp [hr]
theorem arg_conj (x : ℂ) : arg (conj x) = if arg x = π then π else -arg x := by
  simp_rw [arg_eq_pi_iff, arg, neg_im, conj_im, conj_re, abs_conj, neg_div, neg_neg,
    Real.arcsin_neg]
  rcases lt_trichotomy x.re 0 with (hr | hr | hr) <;>
    rcases lt_trichotomy x.im 0 with (hi | hi | hi)
  · simp [hr, hr.not_le, hi.le, hi.ne, not_le.2 hi, add_comm]
  · simp [hr, hr.not_le, hi]
  · simp [hr, hr.not_le, hi.ne.symm, hi.le, not_le.2 hi, sub_eq_neg_add]
  · simp [hr]
  · simp [hr]
  · 

Proof state:
case inr.inl.inr.inr
x : ℂ
hr : x.re = 0
hi : 0 < x.im
⊢ (if 0 ≤ x.re then -arcsin (x.im / abs x)
    else if 0 ≤ -x.im then arcsin (x.im / abs x) + π else arcsin (x.im / abs x) - π) =
    if x.re < 0 ∧ x.im = 0 then π
    else
      -if 0 ≤ x.re then arcsin (x.im / abs x)
        else if 0 ≤ x.im then -arcsin (x.im / abs x) + π else -arcsin (x.im / abs x) - π

Next tactic:
simp [hr]
theorem arg_conj (x : ℂ) : arg (conj x) = if arg x = π then π else -arg x := by
  simp_rw [arg_eq_pi_iff, arg, neg_im, conj_im, conj_re, abs_conj, neg_div, neg_neg,
    Real.arcsin_neg]
  rcases lt_trichotomy x.re 0 with (hr | hr | hr) <;>
    rcases lt_trichotomy x.im 0 with (hi | hi | hi)
  · simp [hr, hr.not_le, hi.le, hi.ne, not_le.2 hi, add_comm]
  · simp [hr, hr.not_le, hi]
  · simp [hr, hr.not_le, hi.ne.symm, hi.le, not_le.2 hi, sub_eq_neg_add]
  · simp [hr]
  · simp [hr]
  · simp [hr]
  · 

Proof state:
case inr.inr.inl
x : ℂ
hr : 0 < x.re
hi : x.im < 0
⊢ (if 0 ≤ x.re then -arcsin (x.im / abs x)
    else if 0 ≤ -x.im then arcsin (x.im / abs x) + π else arcsin (x.im / abs x) - π) =
    if x.re < 0 ∧ x.im = 0 then π
    else
      -if 0 ≤ x.re then arcsin (x.im / abs x)
        else if 0 ≤ x.im then -arcsin (x.im / abs x) + π else -arcsin (x.im / abs x) - π

Next tactic:
simp [hr, hr.le, hi.ne]
theorem arg_conj (x : ℂ) : arg (conj x) = if arg x = π then π else -arg x := by
  simp_rw [arg_eq_pi_iff, arg, neg_im, conj_im, conj_re, abs_conj, neg_div, neg_neg,
    Real.arcsin_neg]
  rcases lt_trichotomy x.re 0 with (hr | hr | hr) <;>
    rcases lt_trichotomy x.im 0 with (hi | hi | hi)
  · simp [hr, hr.not_le, hi.le, hi.ne, not_le.2 hi, add_comm]
  · simp [hr, hr.not_le, hi]
  · simp [hr, hr.not_le, hi.ne.symm, hi.le, not_le.2 hi, sub_eq_neg_add]
  · simp [hr]
  · simp [hr]
  · simp [hr]
  · simp [hr, hr.le, hi.ne]
  · 

Proof state:
case inr.inr.inr.inl
x : ℂ
hr : 0 < x.re
hi : x.im = 0
⊢ (if 0 ≤ x.re then -arcsin (x.im / abs x)
    else if 0 ≤ -x.im then arcsin (x.im / abs x) + π else arcsin (x.im / abs x) - π) =
    if x.re < 0 ∧ x.im = 0 then π
    else
      -if 0 ≤ x.re then arcsin (x.im / abs x)
        else if 0 ≤ x.im then -arcsin (x.im / abs x) + π else -arcsin (x.im / abs x) - π

Next tactic:
simp [hr, hr.le, hr.le.not_lt]
theorem arg_conj (x : ℂ) : arg (conj x) = if arg x = π then π else -arg x := by
  simp_rw [arg_eq_pi_iff, arg, neg_im, conj_im, conj_re, abs_conj, neg_div, neg_neg,
    Real.arcsin_neg]
  rcases lt_trichotomy x.re 0 with (hr | hr | hr) <;>
    rcases lt_trichotomy x.im 0 with (hi | hi | hi)
  · simp [hr, hr.not_le, hi.le, hi.ne, not_le.2 hi, add_comm]
  · simp [hr, hr.not_le, hi]
  · simp [hr, hr.not_le, hi.ne.symm, hi.le, not_le.2 hi, sub_eq_neg_add]
  · simp [hr]
  · simp [hr]
  · simp [hr]
  · simp [hr, hr.le, hi.ne]
  · simp [hr, hr.le, hr.le.not_lt]
  · 

Proof state:
case inr.inr.inr.inr
x : ℂ
hr : 0 < x.re
hi : 0 < x.im
⊢ (if 0 ≤ x.re then -arcsin (x.im / abs x)
    else if 0 ≤ -x.im then arcsin (x.im / abs x) + π else arcsin (x.im / abs x) - π) =
    if x.re < 0 ∧ x.im = 0 then π
    else
      -if 0 ≤ x.re then arcsin (x.im / abs x)
        else if 0 ≤ x.im then -arcsin (x.im / abs x) + π else -arcsin (x.im / abs x) - π

Next tactic:
simp [hr, hr.le, hr.le.not_lt]
theorem arg_inv (x : ℂ) : arg x⁻¹ = if arg x = π then π else -arg x := by
  

Proof state:
x : ℂ
⊢ arg x⁻¹ = if arg x = π then π else -arg x

Next tactic:
rw [← arg_conj, inv_def, mul_comm]
theorem arg_inv (x : ℂ) : arg x⁻¹ = if arg x = π then π else -arg x := by
  rw [← arg_conj, inv_def, mul_comm]
  

Proof state:
x : ℂ
⊢ arg (↑(normSq x)⁻¹ * (starRingEnd ℂ) x) = arg ((starRingEnd ℂ) x)

Next tactic:
by_cases hx : x = 0
theorem arg_inv (x : ℂ) : arg x⁻¹ = if arg x = π then π else -arg x := by
  rw [← arg_conj, inv_def, mul_comm]
  by_cases hx : x = 0
  · 

Proof state:
case pos
x : ℂ
hx : x = 0
⊢ arg (↑(normSq x)⁻¹ * (starRingEnd ℂ) x) = arg ((starRingEnd ℂ) x)

Next tactic:
simp [hx]
theorem arg_inv (x : ℂ) : arg x⁻¹ = if arg x = π then π else -arg x := by
  rw [← arg_conj, inv_def, mul_comm]
  by_cases hx : x = 0
  · simp [hx]
  · 

Proof state:
case neg
x : ℂ
hx : ¬x = 0
⊢ arg (↑(normSq x)⁻¹ * (starRingEnd ℂ) x) = arg ((starRingEnd ℂ) x)

Next tactic:
exact arg_real_mul (conj x) (by simp [hx])
theorem arg_inv (x : ℂ) : arg x⁻¹ = if arg x = π then π else -arg x := by
  rw [← arg_conj, inv_def, mul_comm]
  by_cases hx : x = 0
  · simp [hx]
  · exact arg_real_mul (conj x) (by 

Proof state:
x : ℂ
hx : ¬x = 0
⊢ 0 < (normSq x)⁻¹

Next tactic:
simp [hx]
theorem arg_le_pi_div_two_iff {z : ℂ} : arg z ≤ π / 2 ↔ 0 ≤ re z ∨ im z < 0 := by
  

Proof state:
z : ℂ
⊢ arg z ≤ π / 2 ↔ 0 ≤ z.re ∨ z.im < 0

Next tactic:
rcases le_or_lt 0 (re z) with hre | hre
theorem arg_le_pi_div_two_iff {z : ℂ} : arg z ≤ π / 2 ↔ 0 ≤ re z ∨ im z < 0 := by
  rcases le_or_lt 0 (re z) with hre | hre
  · 

Proof state:
case inl
z : ℂ
hre : 0 ≤ z.re
⊢ arg z ≤ π / 2 ↔ 0 ≤ z.re ∨ z.im < 0

Next tactic:
simp only [hre, arg_of_re_nonneg hre, Real.arcsin_le_pi_div_two, true_or_iff]
theorem arg_le_pi_div_two_iff {z : ℂ} : arg z ≤ π / 2 ↔ 0 ≤ re z ∨ im z < 0 := by
  rcases le_or_lt 0 (re z) with hre | hre
  · simp only [hre, arg_of_re_nonneg hre, Real.arcsin_le_pi_div_two, true_or_iff]
  

Proof state:
case inr
z : ℂ
hre : z.re < 0
⊢ arg z ≤ π / 2 ↔ 0 ≤ z.re ∨ z.im < 0

Next tactic:
simp only [hre.not_le, false_or_iff]
theorem arg_le_pi_div_two_iff {z : ℂ} : arg z ≤ π / 2 ↔ 0 ≤ re z ∨ im z < 0 := by
  rcases le_or_lt 0 (re z) with hre | hre
  · simp only [hre, arg_of_re_nonneg hre, Real.arcsin_le_pi_div_two, true_or_iff]
  simp only [hre.not_le, false_or_iff]
  

Proof state:
case inr
z : ℂ
hre : z.re < 0
⊢ arg z ≤ π / 2 ↔ z.im < 0

Next tactic:
rcases le_or_lt 0 (im z) with him | him
theorem arg_le_pi_div_two_iff {z : ℂ} : arg z ≤ π / 2 ↔ 0 ≤ re z ∨ im z < 0 := by
  rcases le_or_lt 0 (re z) with hre | hre
  · simp only [hre, arg_of_re_nonneg hre, Real.arcsin_le_pi_div_two, true_or_iff]
  simp only [hre.not_le, false_or_iff]
  rcases le_or_lt 0 (im z) with him | him
  · 

Proof state:
case inr.inl
z : ℂ
hre : z.re < 0
him : 0 ≤ z.im
⊢ arg z ≤ π / 2 ↔ z.im < 0

Next tactic:
simp only [him.not_lt]
theorem arg_le_pi_div_two_iff {z : ℂ} : arg z ≤ π / 2 ↔ 0 ≤ re z ∨ im z < 0 := by
  rcases le_or_lt 0 (re z) with hre | hre
  · simp only [hre, arg_of_re_nonneg hre, Real.arcsin_le_pi_div_two, true_or_iff]
  simp only [hre.not_le, false_or_iff]
  rcases le_or_lt 0 (im z) with him | him
  · simp only [him.not_lt]
    

Proof state:
case inr.inl
z : ℂ
hre : z.re < 0
him : 0 ≤ z.im
⊢ arg z ≤ π / 2 ↔ False

Next tactic:
rw [iff_false_iff, not_le, arg_of_re_neg_of_im_nonneg hre him, ← sub_lt_iff_lt_add, half_sub,
      Real.neg_pi_div_two_lt_arcsin, neg_im, neg_div, neg_lt_neg_iff, div_lt_one, ←
      _root_.abs_of_nonneg him, abs_im_lt_abs]
theorem arg_le_pi_div_two_iff {z : ℂ} : arg z ≤ π / 2 ↔ 0 ≤ re z ∨ im z < 0 := by
  rcases le_or_lt 0 (re z) with hre | hre
  · simp only [hre, arg_of_re_nonneg hre, Real.arcsin_le_pi_div_two, true_or_iff]
  simp only [hre.not_le, false_or_iff]
  rcases le_or_lt 0 (im z) with him | him
  · simp only [him.not_lt]
    rw [iff_false_iff, not_le, arg_of_re_neg_of_im_nonneg hre him, ← sub_lt_iff_lt_add, half_sub,
      Real.neg_pi_div_two_lt_arcsin, neg_im, neg_div, neg_lt_neg_iff, div_lt_one, ←
      _root_.abs_of_nonneg him, abs_im_lt_abs]
    

Proof state:
case inr.inl
z : ℂ
hre : z.re < 0
him : 0 ≤ z.im
⊢ z.re ≠ 0
case inr.inl z : ℂ hre : z.re < 0 him : 0 ≤ z.im ⊢ 0 < abs z

Next tactic:
exacts [hre.ne, abs.pos <| ne_of_apply_ne re hre.ne]
theorem arg_le_pi_div_two_iff {z : ℂ} : arg z ≤ π / 2 ↔ 0 ≤ re z ∨ im z < 0 := by
  rcases le_or_lt 0 (re z) with hre | hre
  · simp only [hre, arg_of_re_nonneg hre, Real.arcsin_le_pi_div_two, true_or_iff]
  simp only [hre.not_le, false_or_iff]
  rcases le_or_lt 0 (im z) with him | him
  · simp only [him.not_lt]
    rw [iff_false_iff, not_le, arg_of_re_neg_of_im_nonneg hre him, ← sub_lt_iff_lt_add, half_sub,
      Real.neg_pi_div_two_lt_arcsin, neg_im, neg_div, neg_lt_neg_iff, div_lt_one, ←
      _root_.abs_of_nonneg him, abs_im_lt_abs]
    exacts [hre.ne, abs.pos <| ne_of_apply_ne re hre.ne]
  · 

Proof state:
case inr.inr
z : ℂ
hre : z.re < 0
him : z.im < 0
⊢ arg z ≤ π / 2 ↔ z.im < 0

Next tactic:
simp only [him]
theorem arg_le_pi_div_two_iff {z : ℂ} : arg z ≤ π / 2 ↔ 0 ≤ re z ∨ im z < 0 := by
  rcases le_or_lt 0 (re z) with hre | hre
  · simp only [hre, arg_of_re_nonneg hre, Real.arcsin_le_pi_div_two, true_or_iff]
  simp only [hre.not_le, false_or_iff]
  rcases le_or_lt 0 (im z) with him | him
  · simp only [him.not_lt]
    rw [iff_false_iff, not_le, arg_of_re_neg_of_im_nonneg hre him, ← sub_lt_iff_lt_add, half_sub,
      Real.neg_pi_div_two_lt_arcsin, neg_im, neg_div, neg_lt_neg_iff, div_lt_one, ←
      _root_.abs_of_nonneg him, abs_im_lt_abs]
    exacts [hre.ne, abs.pos <| ne_of_apply_ne re hre.ne]
  · simp only [him]
    

Proof state:
case inr.inr
z : ℂ
hre : z.re < 0
him : z.im < 0
⊢ arg z ≤ π / 2 ↔ True

Next tactic:
rw [iff_true_iff, arg_of_re_neg_of_im_neg hre him]