l3lab/ntp-mathlib huggingface dataset:
theorem neg_coe_abs_toReal_of_sign_nonpos {θ : Angle} (h : θ.sign ≤ 0) : -↑|θ.toReal| = θ := by
  rw [SignType.nonpos_iff] at h
  rcases h with (h | h)
  · rw [abs_of_neg (toReal_neg_iff_sign_neg.2 h), coe_neg, neg_neg, coe_toReal]
  · 

Proof state:
case inr
θ : Angle
h : sign θ = 0
⊢ -↑|toReal θ| = θ

Next tactic:
rw [sign_eq_zero_iff] at h
theorem neg_coe_abs_toReal_of_sign_nonpos {θ : Angle} (h : θ.sign ≤ 0) : -↑|θ.toReal| = θ := by
  rw [SignType.nonpos_iff] at h
  rcases h with (h | h)
  · rw [abs_of_neg (toReal_neg_iff_sign_neg.2 h), coe_neg, neg_neg, coe_toReal]
  · rw [sign_eq_zero_iff] at h
    

Proof state:
case inr
θ : Angle
h : θ = 0 ∨ θ = ↑π
⊢ -↑|toReal θ| = θ

Next tactic:
rcases h with (rfl | rfl)
theorem neg_coe_abs_toReal_of_sign_nonpos {θ : Angle} (h : θ.sign ≤ 0) : -↑|θ.toReal| = θ := by
  rw [SignType.nonpos_iff] at h
  rcases h with (h | h)
  · rw [abs_of_neg (toReal_neg_iff_sign_neg.2 h), coe_neg, neg_neg, coe_toReal]
  · rw [sign_eq_zero_iff] at h
    rcases h with (rfl | rfl) <;> 

Proof state:
case inr.inl
⊢ -↑|toReal 0| = 0

Next tactic:
simp [abs_of_pos Real.pi_pos]
theorem neg_coe_abs_toReal_of_sign_nonpos {θ : Angle} (h : θ.sign ≤ 0) : -↑|θ.toReal| = θ := by
  rw [SignType.nonpos_iff] at h
  rcases h with (h | h)
  · rw [abs_of_neg (toReal_neg_iff_sign_neg.2 h), coe_neg, neg_neg, coe_toReal]
  · rw [sign_eq_zero_iff] at h
    rcases h with (rfl | rfl) <;> 

Proof state:
case inr.inr
⊢ -↑|toReal ↑π| = ↑π

Next tactic:
simp [abs_of_pos Real.pi_pos]
theorem eq_iff_sign_eq_and_abs_toReal_eq {θ ψ : Angle} :
    θ = ψ ↔ θ.sign = ψ.sign ∧ |θ.toReal| = |ψ.toReal| := by
  

Proof state:
θ ψ : Angle
⊢ θ = ψ ↔ sign θ = sign ψ ∧ |toReal θ| = |toReal ψ|

Next tactic:
refine' ⟨_, fun h => _⟩
theorem eq_iff_sign_eq_and_abs_toReal_eq {θ ψ : Angle} :
    θ = ψ ↔ θ.sign = ψ.sign ∧ |θ.toReal| = |ψ.toReal| := by
  refine' ⟨_, fun h => _⟩;
  · 

Proof state:
case refine'_1
θ ψ : Angle
⊢ θ = ψ → sign θ = sign ψ ∧ |toReal θ| = |toReal ψ|

Next tactic:
rintro rfl
theorem eq_iff_sign_eq_and_abs_toReal_eq {θ ψ : Angle} :
    θ = ψ ↔ θ.sign = ψ.sign ∧ |θ.toReal| = |ψ.toReal| := by
  refine' ⟨_, fun h => _⟩;
  · rintro rfl
    

Proof state:
case refine'_1
θ : Angle
⊢ sign θ = sign θ ∧ |toReal θ| = |toReal θ|

Next tactic:
exact ⟨rfl, rfl⟩
theorem eq_iff_sign_eq_and_abs_toReal_eq {θ ψ : Angle} :
    θ = ψ ↔ θ.sign = ψ.sign ∧ |θ.toReal| = |ψ.toReal| := by
  refine' ⟨_, fun h => _⟩;
  · rintro rfl
    exact ⟨rfl, rfl⟩
  

Proof state:
case refine'_2
θ ψ : Angle
h : sign θ = sign ψ ∧ |toReal θ| = |toReal ψ|
⊢ θ = ψ

Next tactic:
rcases h with ⟨hs, hr⟩
theorem eq_iff_sign_eq_and_abs_toReal_eq {θ ψ : Angle} :
    θ = ψ ↔ θ.sign = ψ.sign ∧ |θ.toReal| = |ψ.toReal| := by
  refine' ⟨_, fun h => _⟩;
  · rintro rfl
    exact ⟨rfl, rfl⟩
  rcases h with ⟨hs, hr⟩
  

Proof state:
case refine'_2.intro
θ ψ : Angle
hs : sign θ = sign ψ
hr : |toReal θ| = |toReal ψ|
⊢ θ = ψ

Next tactic:
rw [abs_eq_abs] at hr
theorem eq_iff_sign_eq_and_abs_toReal_eq {θ ψ : Angle} :
    θ = ψ ↔ θ.sign = ψ.sign ∧ |θ.toReal| = |ψ.toReal| := by
  refine' ⟨_, fun h => _⟩;
  · rintro rfl
    exact ⟨rfl, rfl⟩
  rcases h with ⟨hs, hr⟩
  rw [abs_eq_abs] at hr
  

Proof state:
case refine'_2.intro
θ ψ : Angle
hs : sign θ = sign ψ
hr : toReal θ = toReal ψ ∨ toReal θ = -toReal ψ
⊢ θ = ψ

Next tactic:
rcases hr with (hr | hr)
theorem eq_iff_sign_eq_and_abs_toReal_eq {θ ψ : Angle} :
    θ = ψ ↔ θ.sign = ψ.sign ∧ |θ.toReal| = |ψ.toReal| := by
  refine' ⟨_, fun h => _⟩;
  · rintro rfl
    exact ⟨rfl, rfl⟩
  rcases h with ⟨hs, hr⟩
  rw [abs_eq_abs] at hr
  rcases hr with (hr | hr)
  · 

Proof state:
case refine'_2.intro.inl
θ ψ : Angle
hs : sign θ = sign ψ
hr : toReal θ = toReal ψ
⊢ θ = ψ

Next tactic:
exact toReal_injective hr
theorem eq_iff_sign_eq_and_abs_toReal_eq {θ ψ : Angle} :
    θ = ψ ↔ θ.sign = ψ.sign ∧ |θ.toReal| = |ψ.toReal| := by
  refine' ⟨_, fun h => _⟩;
  · rintro rfl
    exact ⟨rfl, rfl⟩
  rcases h with ⟨hs, hr⟩
  rw [abs_eq_abs] at hr
  rcases hr with (hr | hr)
  · exact toReal_injective hr
  · 

Proof state:
case refine'_2.intro.inr
θ ψ : Angle
hs : sign θ = sign ψ
hr : toReal θ = -toReal ψ
⊢ θ = ψ

Next tactic:
by_cases h : θ = π
theorem eq_iff_sign_eq_and_abs_toReal_eq {θ ψ : Angle} :
    θ = ψ ↔ θ.sign = ψ.sign ∧ |θ.toReal| = |ψ.toReal| := by
  refine' ⟨_, fun h => _⟩;
  · rintro rfl
    exact ⟨rfl, rfl⟩
  rcases h with ⟨hs, hr⟩
  rw [abs_eq_abs] at hr
  rcases hr with (hr | hr)
  · exact toReal_injective hr
  · by_cases h : θ = π
    · 

Proof state:
case pos
θ ψ : Angle
hs : sign θ = sign ψ
hr : toReal θ = -toReal ψ
h : θ = ↑π
⊢ θ = ψ

Next tactic:
rw [h, toReal_pi, ← neg_eq_iff_eq_neg] at hr
theorem eq_iff_sign_eq_and_abs_toReal_eq {θ ψ : Angle} :
    θ = ψ ↔ θ.sign = ψ.sign ∧ |θ.toReal| = |ψ.toReal| := by
  refine' ⟨_, fun h => _⟩;
  · rintro rfl
    exact ⟨rfl, rfl⟩
  rcases h with ⟨hs, hr⟩
  rw [abs_eq_abs] at hr
  rcases hr with (hr | hr)
  · exact toReal_injective hr
  · by_cases h : θ = π
    · rw [h, toReal_pi, ← neg_eq_iff_eq_neg] at hr
      

Proof state:
case pos
θ ψ : Angle
hs : sign θ = sign ψ
hr : -π = toReal ψ
h : θ = ↑π
⊢ θ = ψ

Next tactic:
exact False.elim ((neg_pi_lt_toReal ψ).ne hr)
theorem eq_iff_sign_eq_and_abs_toReal_eq {θ ψ : Angle} :
    θ = ψ ↔ θ.sign = ψ.sign ∧ |θ.toReal| = |ψ.toReal| := by
  refine' ⟨_, fun h => _⟩;
  · rintro rfl
    exact ⟨rfl, rfl⟩
  rcases h with ⟨hs, hr⟩
  rw [abs_eq_abs] at hr
  rcases hr with (hr | hr)
  · exact toReal_injective hr
  · by_cases h : θ = π
    · rw [h, toReal_pi, ← neg_eq_iff_eq_neg] at hr
      exact False.elim ((neg_pi_lt_toReal ψ).ne hr)
    · 

Proof state:
case neg
θ ψ : Angle
hs : sign θ = sign ψ
hr : toReal θ = -toReal ψ
h : ¬θ = ↑π
⊢ θ = ψ

Next tactic:
by_cases h' : ψ = π
theorem eq_iff_sign_eq_and_abs_toReal_eq {θ ψ : Angle} :
    θ = ψ ↔ θ.sign = ψ.sign ∧ |θ.toReal| = |ψ.toReal| := by
  refine' ⟨_, fun h => _⟩;
  · rintro rfl
    exact ⟨rfl, rfl⟩
  rcases h with ⟨hs, hr⟩
  rw [abs_eq_abs] at hr
  rcases hr with (hr | hr)
  · exact toReal_injective hr
  · by_cases h : θ = π
    · rw [h, toReal_pi, ← neg_eq_iff_eq_neg] at hr
      exact False.elim ((neg_pi_lt_toReal ψ).ne hr)
    · by_cases h' : ψ = π
      · 

Proof state:
case pos
θ ψ : Angle
hs : sign θ = sign ψ
hr : toReal θ = -toReal ψ
h : ¬θ = ↑π
h' : ψ = ↑π
⊢ θ = ψ

Next tactic:
rw [h', toReal_pi] at hr
theorem eq_iff_sign_eq_and_abs_toReal_eq {θ ψ : Angle} :
    θ = ψ ↔ θ.sign = ψ.sign ∧ |θ.toReal| = |ψ.toReal| := by
  refine' ⟨_, fun h => _⟩;
  · rintro rfl
    exact ⟨rfl, rfl⟩
  rcases h with ⟨hs, hr⟩
  rw [abs_eq_abs] at hr
  rcases hr with (hr | hr)
  · exact toReal_injective hr
  · by_cases h : θ = π
    · rw [h, toReal_pi, ← neg_eq_iff_eq_neg] at hr
      exact False.elim ((neg_pi_lt_toReal ψ).ne hr)
    · by_cases h' : ψ = π
      · rw [h', toReal_pi] at hr
        

Proof state:
case pos
θ ψ : Angle
hs : sign θ = sign ψ
hr : toReal θ = -π
h : ¬θ = ↑π
h' : ψ = ↑π
⊢ θ = ψ

Next tactic:
exact False.elim ((neg_pi_lt_toReal θ).ne hr.symm)
theorem eq_iff_sign_eq_and_abs_toReal_eq {θ ψ : Angle} :
    θ = ψ ↔ θ.sign = ψ.sign ∧ |θ.toReal| = |ψ.toReal| := by
  refine' ⟨_, fun h => _⟩;
  · rintro rfl
    exact ⟨rfl, rfl⟩
  rcases h with ⟨hs, hr⟩
  rw [abs_eq_abs] at hr
  rcases hr with (hr | hr)
  · exact toReal_injective hr
  · by_cases h : θ = π
    · rw [h, toReal_pi, ← neg_eq_iff_eq_neg] at hr
      exact False.elim ((neg_pi_lt_toReal ψ).ne hr)
    · by_cases h' : ψ = π
      · rw [h', toReal_pi] at hr
        exact False.elim ((neg_pi_lt_toReal θ).ne hr.symm)
      · 

Proof state:
case neg
θ ψ : Angle
hs : sign θ = sign ψ
hr : toReal θ = -toReal ψ
h : ¬θ = ↑π
h' : ¬ψ = ↑π
⊢ θ = ψ

Next tactic:
rw [← sign_toReal h, ← sign_toReal h', hr, Left.sign_neg, SignType.neg_eq_self_iff,
          _root_.sign_eq_zero_iff, toReal_eq_zero_iff] at hs
theorem eq_iff_sign_eq_and_abs_toReal_eq {θ ψ : Angle} :
    θ = ψ ↔ θ.sign = ψ.sign ∧ |θ.toReal| = |ψ.toReal| := by
  refine' ⟨_, fun h => _⟩;
  · rintro rfl
    exact ⟨rfl, rfl⟩
  rcases h with ⟨hs, hr⟩
  rw [abs_eq_abs] at hr
  rcases hr with (hr | hr)
  · exact toReal_injective hr
  · by_cases h : θ = π
    · rw [h, toReal_pi, ← neg_eq_iff_eq_neg] at hr
      exact False.elim ((neg_pi_lt_toReal ψ).ne hr)
    · by_cases h' : ψ = π
      · rw [h', toReal_pi] at hr
        exact False.elim ((neg_pi_lt_toReal θ).ne hr.symm)
      · rw [← sign_toReal h, ← sign_toReal h', hr, Left.sign_neg, SignType.neg_eq_self_iff,
          _root_.sign_eq_zero_iff, toReal_eq_zero_iff] at hs
        

Proof state:
case neg
θ ψ : Angle
hs : ψ = 0
hr : toReal θ = -toReal ψ
h : ¬θ = ↑π
h' : ¬ψ = ↑π
⊢ θ = ψ

Next tactic:
rw [hs, toReal_zero, neg_zero, toReal_eq_zero_iff] at hr
theorem eq_iff_sign_eq_and_abs_toReal_eq {θ ψ : Angle} :
    θ = ψ ↔ θ.sign = ψ.sign ∧ |θ.toReal| = |ψ.toReal| := by
  refine' ⟨_, fun h => _⟩;
  · rintro rfl
    exact ⟨rfl, rfl⟩
  rcases h with ⟨hs, hr⟩
  rw [abs_eq_abs] at hr
  rcases hr with (hr | hr)
  · exact toReal_injective hr
  · by_cases h : θ = π
    · rw [h, toReal_pi, ← neg_eq_iff_eq_neg] at hr
      exact False.elim ((neg_pi_lt_toReal ψ).ne hr)
    · by_cases h' : ψ = π
      · rw [h', toReal_pi] at hr
        exact False.elim ((neg_pi_lt_toReal θ).ne hr.symm)
      · rw [← sign_toReal h, ← sign_toReal h', hr, Left.sign_neg, SignType.neg_eq_self_iff,
          _root_.sign_eq_zero_iff, toReal_eq_zero_iff] at hs
        rw [hs, toReal_zero, neg_zero, toReal_eq_zero_iff] at hr
        

Proof state:
case neg
θ ψ : Angle
hs : ψ = 0
hr : θ = 0
h : ¬θ = ↑π
h' : ¬ψ = ↑π
⊢ θ = ψ

Next tactic:
rw [hr, hs]
theorem eq_iff_abs_toReal_eq_of_sign_eq {θ ψ : Angle} (h : θ.sign = ψ.sign) :
    θ = ψ ↔ |θ.toReal| = |ψ.toReal| := by 

Proof state:
θ ψ : Angle
h : sign θ = sign ψ
⊢ θ = ψ ↔ |toReal θ| = |toReal ψ|

Next tactic:
simpa [h] using @eq_iff_sign_eq_and_abs_toReal_eq θ ψ
@[simp]
theorem sign_coe_pi_div_two : (↑(π / 2) : Angle).sign = 1 := by
  

Proof state:
⊢ sign ↑(π / 2) = 1

Next tactic:
rw [sign, sin_coe, sin_pi_div_two, sign_one]
@[simp]
theorem sign_coe_neg_pi_div_two : (↑(-π / 2) : Angle).sign = -1 := by
  

Proof state:
⊢ sign ↑(-π / 2) = -1

Next tactic:
rw [sign, sin_coe, neg_div, Real.sin_neg, sin_pi_div_two, Left.sign_neg, sign_one]
theorem sign_coe_nonneg_of_nonneg_of_le_pi {θ : ℝ} (h0 : 0 ≤ θ) (hpi : θ ≤ π) :
    0 ≤ (θ : Angle).sign := by
  

Proof state:
θ : ℝ
h0 : 0 ≤ θ
hpi : θ ≤ π
⊢ 0 ≤ sign ↑θ

Next tactic:
rw [sign, sign_nonneg_iff]
theorem sign_coe_nonneg_of_nonneg_of_le_pi {θ : ℝ} (h0 : 0 ≤ θ) (hpi : θ ≤ π) :
    0 ≤ (θ : Angle).sign := by
  rw [sign, sign_nonneg_iff]
  

Proof state:
θ : ℝ
h0 : 0 ≤ θ
hpi : θ ≤ π
⊢ 0 ≤ sin ↑θ

Next tactic:
exact sin_nonneg_of_nonneg_of_le_pi h0 hpi
theorem sign_neg_coe_nonpos_of_nonneg_of_le_pi {θ : ℝ} (h0 : 0 ≤ θ) (hpi : θ ≤ π) :
    (-θ : Angle).sign ≤ 0 := by
  

Proof state:
θ : ℝ
h0 : 0 ≤ θ
hpi : θ ≤ π
⊢ sign (-↑θ) ≤ 0

Next tactic:
rw [sign, sign_nonpos_iff, sin_neg, Left.neg_nonpos_iff]
theorem sign_neg_coe_nonpos_of_nonneg_of_le_pi {θ : ℝ} (h0 : 0 ≤ θ) (hpi : θ ≤ π) :
    (-θ : Angle).sign ≤ 0 := by
  rw [sign, sign_nonpos_iff, sin_neg, Left.neg_nonpos_iff]
  

Proof state:
θ : ℝ
h0 : 0 ≤ θ
hpi : θ ≤ π
⊢ 0 ≤ sin ↑θ

Next tactic:
exact sin_nonneg_of_nonneg_of_le_pi h0 hpi
theorem sign_two_nsmul_eq_sign_iff {θ : Angle} :
    ((2 : ℕ) • θ).sign = θ.sign ↔ θ = π ∨ |θ.toReal| < π / 2 := by
  

Proof state:
θ : Angle
⊢ sign (2 • θ) = sign θ ↔ θ = ↑π ∨ |toReal θ| < π / 2

Next tactic:
by_cases hpi : θ = π
theorem sign_two_nsmul_eq_sign_iff {θ : Angle} :
    ((2 : ℕ) • θ).sign = θ.sign ↔ θ = π ∨ |θ.toReal| < π / 2 := by
  by_cases hpi : θ = π; · 

Proof state:
case pos
θ : Angle
hpi : θ = ↑π
⊢ sign (2 • θ) = sign θ ↔ θ = ↑π ∨ |toReal θ| < π / 2

Next tactic:
simp [hpi]
theorem sign_two_nsmul_eq_sign_iff {θ : Angle} :
    ((2 : ℕ) • θ).sign = θ.sign ↔ θ = π ∨ |θ.toReal| < π / 2 := by
  by_cases hpi : θ = π; · simp [hpi]
  

Proof state:
case neg
θ : Angle
hpi : ¬θ = ↑π
⊢ sign (2 • θ) = sign θ ↔ θ = ↑π ∨ |toReal θ| < π / 2

Next tactic:
rw [or_iff_right hpi]
theorem sign_two_nsmul_eq_sign_iff {θ : Angle} :
    ((2 : ℕ) • θ).sign = θ.sign ↔ θ = π ∨ |θ.toReal| < π / 2 := by
  by_cases hpi : θ = π; · simp [hpi]
  rw [or_iff_right hpi]
  

Proof state:
case neg
θ : Angle
hpi : ¬θ = ↑π
⊢ sign (2 • θ) = sign θ ↔ |toReal θ| < π / 2

Next tactic:
refine' ⟨fun h => _, fun h => _⟩
theorem sign_two_nsmul_eq_sign_iff {θ : Angle} :
    ((2 : ℕ) • θ).sign = θ.sign ↔ θ = π ∨ |θ.toReal| < π / 2 := by
  by_cases hpi : θ = π; · simp [hpi]
  rw [or_iff_right hpi]
  refine' ⟨fun h => _, fun h => _⟩
  · 

Proof state:
case neg.refine'_1
θ : Angle
hpi : ¬θ = ↑π
h : sign (2 • θ) = sign θ
⊢ |toReal θ| < π / 2

Next tactic:
by_contra hle
theorem sign_two_nsmul_eq_sign_iff {θ : Angle} :
    ((2 : ℕ) • θ).sign = θ.sign ↔ θ = π ∨ |θ.toReal| < π / 2 := by
  by_cases hpi : θ = π; · simp [hpi]
  rw [or_iff_right hpi]
  refine' ⟨fun h => _, fun h => _⟩
  · by_contra hle
    

Proof state:
case neg.refine'_1
θ : Angle
hpi : ¬θ = ↑π
h : sign (2 • θ) = sign θ
hle : ¬|toReal θ| < π / 2
⊢ False

Next tactic:
rw [not_lt, le_abs, le_neg] at hle
theorem sign_two_nsmul_eq_sign_iff {θ : Angle} :
    ((2 : ℕ) • θ).sign = θ.sign ↔ θ = π ∨ |θ.toReal| < π / 2 := by
  by_cases hpi : θ = π; · simp [hpi]
  rw [or_iff_right hpi]
  refine' ⟨fun h => _, fun h => _⟩
  · by_contra hle
    rw [not_lt, le_abs, le_neg] at hle
    

Proof state:
case neg.refine'_1
θ : Angle
hpi : ¬θ = ↑π
h : sign (2 • θ) = sign θ
hle : π / 2 ≤ toReal θ ∨ toReal θ ≤ -(π / 2)
⊢ False

Next tactic:
have hpi' : θ.toReal ≠ π := by simpa using hpi
theorem sign_two_nsmul_eq_sign_iff {θ : Angle} :
    ((2 : ℕ) • θ).sign = θ.sign ↔ θ = π ∨ |θ.toReal| < π / 2 := by
  by_cases hpi : θ = π; · simp [hpi]
  rw [or_iff_right hpi]
  refine' ⟨fun h => _, fun h => _⟩
  · by_contra hle
    rw [not_lt, le_abs, le_neg] at hle
    have hpi' : θ.toReal ≠ π := by 

Proof state:
θ : Angle
hpi : ¬θ = ↑π
h : sign (2 • θ) = sign θ
hle : π / 2 ≤ toReal θ ∨ toReal θ ≤ -(π / 2)
⊢ toReal θ ≠ π

Next tactic:
simpa using hpi
theorem sign_two_nsmul_eq_sign_iff {θ : Angle} :
    ((2 : ℕ) • θ).sign = θ.sign ↔ θ = π ∨ |θ.toReal| < π / 2 := by
  by_cases hpi : θ = π; · simp [hpi]
  rw [or_iff_right hpi]
  refine' ⟨fun h => _, fun h => _⟩
  · by_contra hle
    rw [not_lt, le_abs, le_neg] at hle
    have hpi' : θ.toReal ≠ π := by simpa using hpi
    

Proof state:
case neg.refine'_1
θ : Angle
hpi : ¬θ = ↑π
h : sign (2 • θ) = sign θ
hle : π / 2 ≤ toReal θ ∨ toReal θ ≤ -(π / 2)
hpi' : toReal θ ≠ π
⊢ False

Next tactic:
rcases hle with (hle | hle)
theorem sign_two_nsmul_eq_sign_iff {θ : Angle} :
    ((2 : ℕ) • θ).sign = θ.sign ↔ θ = π ∨ |θ.toReal| < π / 2 := by
  by_cases hpi : θ = π; · simp [hpi]
  rw [or_iff_right hpi]
  refine' ⟨fun h => _, fun h => _⟩
  · by_contra hle
    rw [not_lt, le_abs, le_neg] at hle
    have hpi' : θ.toReal ≠ π := by simpa using hpi
    rcases hle with (hle | hle) <;> 

Proof state:
case neg.refine'_1.inl
θ : Angle
hpi : ¬θ = ↑π
h : sign (2 • θ) = sign θ
hpi' : toReal θ ≠ π
hle : π / 2 ≤ toReal θ
⊢ False

Next tactic:
rcases hle.eq_or_lt with (heq | hlt)
theorem sign_two_nsmul_eq_sign_iff {θ : Angle} :
    ((2 : ℕ) • θ).sign = θ.sign ↔ θ = π ∨ |θ.toReal| < π / 2 := by
  by_cases hpi : θ = π; · simp [hpi]
  rw [or_iff_right hpi]
  refine' ⟨fun h => _, fun h => _⟩
  · by_contra hle
    rw [not_lt, le_abs, le_neg] at hle
    have hpi' : θ.toReal ≠ π := by simpa using hpi
    rcases hle with (hle | hle) <;> 

Proof state:
case neg.refine'_1.inr
θ : Angle
hpi : ¬θ = ↑π
h : sign (2 • θ) = sign θ
hpi' : toReal θ ≠ π
hle : toReal θ ≤ -(π / 2)
⊢ False

Next tactic:
rcases hle.eq_or_lt with (heq | hlt)
theorem sign_two_nsmul_eq_sign_iff {θ : Angle} :
    ((2 : ℕ) • θ).sign = θ.sign ↔ θ = π ∨ |θ.toReal| < π / 2 := by
  by_cases hpi : θ = π; · simp [hpi]
  rw [or_iff_right hpi]
  refine' ⟨fun h => _, fun h => _⟩
  · by_contra hle
    rw [not_lt, le_abs, le_neg] at hle
    have hpi' : θ.toReal ≠ π := by simpa using hpi
    rcases hle with (hle | hle) <;> rcases hle.eq_or_lt with (heq | hlt)
    · 

Proof state:
case neg.refine'_1.inl.inl
θ : Angle
hpi : ¬θ = ↑π
h : sign (2 • θ) = sign θ
hpi' : toReal θ ≠ π
hle : π / 2 ≤ toReal θ
heq : π / 2 = toReal θ
⊢ False

Next tactic:
rw [← coe_toReal θ, ← heq] at h
theorem sign_two_nsmul_eq_sign_iff {θ : Angle} :
    ((2 : ℕ) • θ).sign = θ.sign ↔ θ = π ∨ |θ.toReal| < π / 2 := by
  by_cases hpi : θ = π; · simp [hpi]
  rw [or_iff_right hpi]
  refine' ⟨fun h => _, fun h => _⟩
  · by_contra hle
    rw [not_lt, le_abs, le_neg] at hle
    have hpi' : θ.toReal ≠ π := by simpa using hpi
    rcases hle with (hle | hle) <;> rcases hle.eq_or_lt with (heq | hlt)
    · rw [← coe_toReal θ, ← heq] at h
      

Proof state:
case neg.refine'_1.inl.inl
θ : Angle
hpi : ¬θ = ↑π
h : sign (2 • ↑(π / 2)) = sign ↑(π / 2)
hpi' : toReal θ ≠ π
hle : π / 2 ≤ toReal θ
heq : π / 2 = toReal θ
⊢ False

Next tactic:
simp at h
theorem sign_two_nsmul_eq_sign_iff {θ : Angle} :
    ((2 : ℕ) • θ).sign = θ.sign ↔ θ = π ∨ |θ.toReal| < π / 2 := by
  by_cases hpi : θ = π; · simp [hpi]
  rw [or_iff_right hpi]
  refine' ⟨fun h => _, fun h => _⟩
  · by_contra hle
    rw [not_lt, le_abs, le_neg] at hle
    have hpi' : θ.toReal ≠ π := by simpa using hpi
    rcases hle with (hle | hle) <;> rcases hle.eq_or_lt with (heq | hlt)
    · rw [← coe_toReal θ, ← heq] at h
      simp at h
    · 

Proof state:
case neg.refine'_1.inl.inr
θ : Angle
hpi : ¬θ = ↑π
h : sign (2 • θ) = sign θ
hpi' : toReal θ ≠ π
hle : π / 2 ≤ toReal θ
hlt : π / 2 < toReal θ
⊢ False

Next tactic:
rw [← sign_toReal hpi, sign_pos (pi_div_two_pos.trans hlt), ← sign_toReal,
        two_nsmul_toReal_eq_two_mul_sub_two_pi.2 hlt, _root_.sign_neg] at h
theorem sign_two_nsmul_eq_sign_iff {θ : Angle} :
    ((2 : ℕ) • θ).sign = θ.sign ↔ θ = π ∨ |θ.toReal| < π / 2 := by
  by_cases hpi : θ = π; · simp [hpi]
  rw [or_iff_right hpi]
  refine' ⟨fun h => _, fun h => _⟩
  · by_contra hle
    rw [not_lt, le_abs, le_neg] at hle
    have hpi' : θ.toReal ≠ π := by simpa using hpi
    rcases hle with (hle | hle) <;> rcases hle.eq_or_lt with (heq | hlt)
    · rw [← coe_toReal θ, ← heq] at h
      simp at h
    · rw [← sign_toReal hpi, sign_pos (pi_div_two_pos.trans hlt), ← sign_toReal,
        two_nsmul_toReal_eq_two_mul_sub_two_pi.2 hlt, _root_.sign_neg] at h
      · 

Proof state:
case neg.refine'_1.inl.inr
θ : Angle
hpi : ¬θ = ↑π
h : -1 = 1
hpi' : toReal θ ≠ π
hle : π / 2 ≤ toReal θ
hlt : π / 2 < toReal θ
⊢ False

Next tactic:
simp at h
theorem sign_two_nsmul_eq_sign_iff {θ : Angle} :
    ((2 : ℕ) • θ).sign = θ.sign ↔ θ = π ∨ |θ.toReal| < π / 2 := by
  by_cases hpi : θ = π; · simp [hpi]
  rw [or_iff_right hpi]
  refine' ⟨fun h => _, fun h => _⟩
  · by_contra hle
    rw [not_lt, le_abs, le_neg] at hle
    have hpi' : θ.toReal ≠ π := by simpa using hpi
    rcases hle with (hle | hle) <;> rcases hle.eq_or_lt with (heq | hlt)
    · rw [← coe_toReal θ, ← heq] at h
      simp at h
    · rw [← sign_toReal hpi, sign_pos (pi_div_two_pos.trans hlt), ← sign_toReal,
        two_nsmul_toReal_eq_two_mul_sub_two_pi.2 hlt, _root_.sign_neg] at h
      · simp at h
      · 

Proof state:
case neg.refine'_1.inl.inr
θ : Angle
hpi : ¬θ = ↑π
h : SignType.sign (2 * toReal θ - 2 * π) = 1
hpi' : toReal θ ≠ π
hle : π / 2 ≤ toReal θ
hlt : π / 2 < toReal θ
⊢ 2 * toReal θ - 2 * π < 0

Next tactic:
rw [← mul_sub]
theorem sign_two_nsmul_eq_sign_iff {θ : Angle} :
    ((2 : ℕ) • θ).sign = θ.sign ↔ θ = π ∨ |θ.toReal| < π / 2 := by
  by_cases hpi : θ = π; · simp [hpi]
  rw [or_iff_right hpi]
  refine' ⟨fun h => _, fun h => _⟩
  · by_contra hle
    rw [not_lt, le_abs, le_neg] at hle
    have hpi' : θ.toReal ≠ π := by simpa using hpi
    rcases hle with (hle | hle) <;> rcases hle.eq_or_lt with (heq | hlt)
    · rw [← coe_toReal θ, ← heq] at h
      simp at h
    · rw [← sign_toReal hpi, sign_pos (pi_div_two_pos.trans hlt), ← sign_toReal,
        two_nsmul_toReal_eq_two_mul_sub_two_pi.2 hlt, _root_.sign_neg] at h
      · simp at h
      · rw [← mul_sub]
        

Proof state:
case neg.refine'_1.inl.inr
θ : Angle
hpi : ¬θ = ↑π
h : SignType.sign (2 * toReal θ - 2 * π) = 1
hpi' : toReal θ ≠ π
hle : π / 2 ≤ toReal θ
hlt : π / 2 < toReal θ
⊢ 2 * (toReal θ - π) < 0

Next tactic:
exact mul_neg_of_pos_of_neg two_pos (sub_neg.2 ((toReal_le_pi _).lt_of_ne hpi'))
theorem sign_two_nsmul_eq_sign_iff {θ : Angle} :
    ((2 : ℕ) • θ).sign = θ.sign ↔ θ = π ∨ |θ.toReal| < π / 2 := by
  by_cases hpi : θ = π; · simp [hpi]
  rw [or_iff_right hpi]
  refine' ⟨fun h => _, fun h => _⟩
  · by_contra hle
    rw [not_lt, le_abs, le_neg] at hle
    have hpi' : θ.toReal ≠ π := by simpa using hpi
    rcases hle with (hle | hle) <;> rcases hle.eq_or_lt with (heq | hlt)
    · rw [← coe_toReal θ, ← heq] at h
      simp at h
    · rw [← sign_toReal hpi, sign_pos (pi_div_two_pos.trans hlt), ← sign_toReal,
        two_nsmul_toReal_eq_two_mul_sub_two_pi.2 hlt, _root_.sign_neg] at h
      · simp at h
      · rw [← mul_sub]
        exact mul_neg_of_pos_of_neg two_pos (sub_neg.2 ((toReal_le_pi _).lt_of_ne hpi'))
      · 

Proof state:
case neg.refine'_1.inl.inr
θ : Angle
hpi : ¬θ = ↑π
h : sign (2 • θ) = 1
hpi' : toReal θ ≠ π
hle : π / 2 ≤ toReal θ
hlt : π / 2 < toReal θ
⊢ 2 • θ ≠ ↑π

Next tactic:
intro he
theorem sign_two_nsmul_eq_sign_iff {θ : Angle} :
    ((2 : ℕ) • θ).sign = θ.sign ↔ θ = π ∨ |θ.toReal| < π / 2 := by
  by_cases hpi : θ = π; · simp [hpi]
  rw [or_iff_right hpi]
  refine' ⟨fun h => _, fun h => _⟩
  · by_contra hle
    rw [not_lt, le_abs, le_neg] at hle
    have hpi' : θ.toReal ≠ π := by simpa using hpi
    rcases hle with (hle | hle) <;> rcases hle.eq_or_lt with (heq | hlt)
    · rw [← coe_toReal θ, ← heq] at h
      simp at h
    · rw [← sign_toReal hpi, sign_pos (pi_div_two_pos.trans hlt), ← sign_toReal,
        two_nsmul_toReal_eq_two_mul_sub_two_pi.2 hlt, _root_.sign_neg] at h
      · simp at h
      · rw [← mul_sub]
        exact mul_neg_of_pos_of_neg two_pos (sub_neg.2 ((toReal_le_pi _).lt_of_ne hpi'))
      · intro he
        

Proof state:
case neg.refine'_1.inl.inr
θ : Angle
hpi : ¬θ = ↑π
h : sign (2 • θ) = 1
hpi' : toReal θ ≠ π
hle : π / 2 ≤ toReal θ
hlt : π / 2 < toReal θ
he : 2 • θ = ↑π
⊢ False

Next tactic:
simp [he] at h
theorem sign_two_nsmul_eq_sign_iff {θ : Angle} :
    ((2 : ℕ) • θ).sign = θ.sign ↔ θ = π ∨ |θ.toReal| < π / 2 := by
  by_cases hpi : θ = π; · simp [hpi]
  rw [or_iff_right hpi]
  refine' ⟨fun h => _, fun h => _⟩
  · by_contra hle
    rw [not_lt, le_abs, le_neg] at hle
    have hpi' : θ.toReal ≠ π := by simpa using hpi
    rcases hle with (hle | hle) <;> rcases hle.eq_or_lt with (heq | hlt)
    · rw [← coe_toReal θ, ← heq] at h
      simp at h
    · rw [← sign_toReal hpi, sign_pos (pi_div_two_pos.trans hlt), ← sign_toReal,
        two_nsmul_toReal_eq_two_mul_sub_two_pi.2 hlt, _root_.sign_neg] at h
      · simp at h
      · rw [← mul_sub]
        exact mul_neg_of_pos_of_neg two_pos (sub_neg.2 ((toReal_le_pi _).lt_of_ne hpi'))
      · intro he
        simp [he] at h
    · 

Proof state:
case neg.refine'_1.inr.inl
θ : Angle
hpi : ¬θ = ↑π
h : sign (2 • θ) = sign θ
hpi' : toReal θ ≠ π
hle : toReal θ ≤ -(π / 2)
heq : toReal θ = -(π / 2)
⊢ False

Next tactic:
rw [← coe_toReal θ, heq] at h
theorem sign_two_nsmul_eq_sign_iff {θ : Angle} :
    ((2 : ℕ) • θ).sign = θ.sign ↔ θ = π ∨ |θ.toReal| < π / 2 := by
  by_cases hpi : θ = π; · simp [hpi]
  rw [or_iff_right hpi]
  refine' ⟨fun h => _, fun h => _⟩
  · by_contra hle
    rw [not_lt, le_abs, le_neg] at hle
    have hpi' : θ.toReal ≠ π := by simpa using hpi
    rcases hle with (hle | hle) <;> rcases hle.eq_or_lt with (heq | hlt)
    · rw [← coe_toReal θ, ← heq] at h
      simp at h
    · rw [← sign_toReal hpi, sign_pos (pi_div_two_pos.trans hlt), ← sign_toReal,
        two_nsmul_toReal_eq_two_mul_sub_two_pi.2 hlt, _root_.sign_neg] at h
      · simp at h
      · rw [← mul_sub]
        exact mul_neg_of_pos_of_neg two_pos (sub_neg.2 ((toReal_le_pi _).lt_of_ne hpi'))
      · intro he
        simp [he] at h
    · rw [← coe_toReal θ, heq] at h
      

Proof state:
case neg.refine'_1.inr.inl
θ : Angle
hpi : ¬θ = ↑π
h : sign (2 • ↑(-(π / 2))) = sign ↑(-(π / 2))
hpi' : toReal θ ≠ π
hle : toReal θ ≤ -(π / 2)
heq : toReal θ = -(π / 2)
⊢ False

Next tactic:
simp at h