l3lab/ntp-mathlib huggingface dataset:
theorem cos_nonneg_iff_abs_toReal_le_pi_div_two {θ : Angle} : 0 ≤ cos θ ↔ |θ.toReal| ≤ π / 2 := by
  nth_rw 1 [← coe_toReal θ]
  rw [abs_le, cos_coe]
  

Proof state:
θ : Angle
⊢ 0 ≤ Real.cos (toReal θ) ↔ -(π / 2) ≤ toReal θ ∧ toReal θ ≤ π / 2

Next tactic:
refine' ⟨fun h => _, cos_nonneg_of_mem_Icc⟩
theorem cos_nonneg_iff_abs_toReal_le_pi_div_two {θ : Angle} : 0 ≤ cos θ ↔ |θ.toReal| ≤ π / 2 := by
  nth_rw 1 [← coe_toReal θ]
  rw [abs_le, cos_coe]
  refine' ⟨fun h => _, cos_nonneg_of_mem_Icc⟩
  

Proof state:
θ : Angle
h : 0 ≤ Real.cos (toReal θ)
⊢ -(π / 2) ≤ toReal θ ∧ toReal θ ≤ π / 2

Next tactic:
by_contra hn
theorem cos_nonneg_iff_abs_toReal_le_pi_div_two {θ : Angle} : 0 ≤ cos θ ↔ |θ.toReal| ≤ π / 2 := by
  nth_rw 1 [← coe_toReal θ]
  rw [abs_le, cos_coe]
  refine' ⟨fun h => _, cos_nonneg_of_mem_Icc⟩
  by_contra hn
  

Proof state:
θ : Angle
h : 0 ≤ Real.cos (toReal θ)
hn : ¬(-(π / 2) ≤ toReal θ ∧ toReal θ ≤ π / 2)
⊢ False

Next tactic:
rw [not_and_or, not_le, not_le] at hn
theorem cos_nonneg_iff_abs_toReal_le_pi_div_two {θ : Angle} : 0 ≤ cos θ ↔ |θ.toReal| ≤ π / 2 := by
  nth_rw 1 [← coe_toReal θ]
  rw [abs_le, cos_coe]
  refine' ⟨fun h => _, cos_nonneg_of_mem_Icc⟩
  by_contra hn
  rw [not_and_or, not_le, not_le] at hn
  

Proof state:
θ : Angle
h : 0 ≤ Real.cos (toReal θ)
hn : toReal θ < -(π / 2) ∨ π / 2 < toReal θ
⊢ False

Next tactic:
refine' (not_lt.2 h) _
theorem cos_nonneg_iff_abs_toReal_le_pi_div_two {θ : Angle} : 0 ≤ cos θ ↔ |θ.toReal| ≤ π / 2 := by
  nth_rw 1 [← coe_toReal θ]
  rw [abs_le, cos_coe]
  refine' ⟨fun h => _, cos_nonneg_of_mem_Icc⟩
  by_contra hn
  rw [not_and_or, not_le, not_le] at hn
  refine' (not_lt.2 h) _
  

Proof state:
θ : Angle
h : 0 ≤ Real.cos (toReal θ)
hn : toReal θ < -(π / 2) ∨ π / 2 < toReal θ
⊢ Real.cos (toReal θ) < 0

Next tactic:
rcases hn with (hn | hn)
theorem cos_nonneg_iff_abs_toReal_le_pi_div_two {θ : Angle} : 0 ≤ cos θ ↔ |θ.toReal| ≤ π / 2 := by
  nth_rw 1 [← coe_toReal θ]
  rw [abs_le, cos_coe]
  refine' ⟨fun h => _, cos_nonneg_of_mem_Icc⟩
  by_contra hn
  rw [not_and_or, not_le, not_le] at hn
  refine' (not_lt.2 h) _
  rcases hn with (hn | hn)
  · 

Proof state:
case inl
θ : Angle
h : 0 ≤ Real.cos (toReal θ)
hn : toReal θ < -(π / 2)
⊢ Real.cos (toReal θ) < 0

Next tactic:
rw [← Real.cos_neg]
theorem cos_nonneg_iff_abs_toReal_le_pi_div_two {θ : Angle} : 0 ≤ cos θ ↔ |θ.toReal| ≤ π / 2 := by
  nth_rw 1 [← coe_toReal θ]
  rw [abs_le, cos_coe]
  refine' ⟨fun h => _, cos_nonneg_of_mem_Icc⟩
  by_contra hn
  rw [not_and_or, not_le, not_le] at hn
  refine' (not_lt.2 h) _
  rcases hn with (hn | hn)
  · rw [← Real.cos_neg]
    

Proof state:
case inl
θ : Angle
h : 0 ≤ Real.cos (toReal θ)
hn : toReal θ < -(π / 2)
⊢ Real.cos (-toReal θ) < 0

Next tactic:
refine' cos_neg_of_pi_div_two_lt_of_lt (by linarith) _
theorem cos_nonneg_iff_abs_toReal_le_pi_div_two {θ : Angle} : 0 ≤ cos θ ↔ |θ.toReal| ≤ π / 2 := by
  nth_rw 1 [← coe_toReal θ]
  rw [abs_le, cos_coe]
  refine' ⟨fun h => _, cos_nonneg_of_mem_Icc⟩
  by_contra hn
  rw [not_and_or, not_le, not_le] at hn
  refine' (not_lt.2 h) _
  rcases hn with (hn | hn)
  · rw [← Real.cos_neg]
    refine' cos_neg_of_pi_div_two_lt_of_lt (by 

Proof state:
θ : Angle
h : 0 ≤ Real.cos (toReal θ)
hn : toReal θ < -(π / 2)
⊢ π / 2 < -toReal θ

Next tactic:
linarith
theorem cos_nonneg_iff_abs_toReal_le_pi_div_two {θ : Angle} : 0 ≤ cos θ ↔ |θ.toReal| ≤ π / 2 := by
  nth_rw 1 [← coe_toReal θ]
  rw [abs_le, cos_coe]
  refine' ⟨fun h => _, cos_nonneg_of_mem_Icc⟩
  by_contra hn
  rw [not_and_or, not_le, not_le] at hn
  refine' (not_lt.2 h) _
  rcases hn with (hn | hn)
  · rw [← Real.cos_neg]
    refine' cos_neg_of_pi_div_two_lt_of_lt (by linarith) _
    

Proof state:
case inl
θ : Angle
h : 0 ≤ Real.cos (toReal θ)
hn : toReal θ < -(π / 2)
⊢ -toReal θ < π + π / 2

Next tactic:
linarith [neg_pi_lt_toReal θ]
theorem cos_nonneg_iff_abs_toReal_le_pi_div_two {θ : Angle} : 0 ≤ cos θ ↔ |θ.toReal| ≤ π / 2 := by
  nth_rw 1 [← coe_toReal θ]
  rw [abs_le, cos_coe]
  refine' ⟨fun h => _, cos_nonneg_of_mem_Icc⟩
  by_contra hn
  rw [not_and_or, not_le, not_le] at hn
  refine' (not_lt.2 h) _
  rcases hn with (hn | hn)
  · rw [← Real.cos_neg]
    refine' cos_neg_of_pi_div_two_lt_of_lt (by linarith) _
    linarith [neg_pi_lt_toReal θ]
  · 

Proof state:
case inr
θ : Angle
h : 0 ≤ Real.cos (toReal θ)
hn : π / 2 < toReal θ
⊢ Real.cos (toReal θ) < 0

Next tactic:
refine' cos_neg_of_pi_div_two_lt_of_lt hn _
theorem cos_nonneg_iff_abs_toReal_le_pi_div_two {θ : Angle} : 0 ≤ cos θ ↔ |θ.toReal| ≤ π / 2 := by
  nth_rw 1 [← coe_toReal θ]
  rw [abs_le, cos_coe]
  refine' ⟨fun h => _, cos_nonneg_of_mem_Icc⟩
  by_contra hn
  rw [not_and_or, not_le, not_le] at hn
  refine' (not_lt.2 h) _
  rcases hn with (hn | hn)
  · rw [← Real.cos_neg]
    refine' cos_neg_of_pi_div_two_lt_of_lt (by linarith) _
    linarith [neg_pi_lt_toReal θ]
  · refine' cos_neg_of_pi_div_two_lt_of_lt hn _
    

Proof state:
case inr
θ : Angle
h : 0 ≤ Real.cos (toReal θ)
hn : π / 2 < toReal θ
⊢ toReal θ < π + π / 2

Next tactic:
linarith [toReal_le_pi θ]
theorem cos_pos_iff_abs_toReal_lt_pi_div_two {θ : Angle} : 0 < cos θ ↔ |θ.toReal| < π / 2 := by
  

Proof state:
θ : Angle
⊢ 0 < cos θ ↔ |toReal θ| < π / 2

Next tactic:
rw [lt_iff_le_and_ne, lt_iff_le_and_ne, cos_nonneg_iff_abs_toReal_le_pi_div_two, ←
    and_congr_right]
theorem cos_pos_iff_abs_toReal_lt_pi_div_two {θ : Angle} : 0 < cos θ ↔ |θ.toReal| < π / 2 := by
  rw [lt_iff_le_and_ne, lt_iff_le_and_ne, cos_nonneg_iff_abs_toReal_le_pi_div_two, ←
    and_congr_right]
  

Proof state:
θ : Angle
⊢ |toReal θ| ≤ π / 2 → (|toReal θ| ≠ π / 2 ↔ 0 ≠ cos θ)

Next tactic:
rintro -
theorem cos_pos_iff_abs_toReal_lt_pi_div_two {θ : Angle} : 0 < cos θ ↔ |θ.toReal| < π / 2 := by
  rw [lt_iff_le_and_ne, lt_iff_le_and_ne, cos_nonneg_iff_abs_toReal_le_pi_div_two, ←
    and_congr_right]
  rintro -
  

Proof state:
θ : Angle
⊢ |toReal θ| ≠ π / 2 ↔ 0 ≠ cos θ

Next tactic:
rw [Ne.def, Ne.def, not_iff_not, @eq_comm ℝ 0, abs_toReal_eq_pi_div_two_iff, cos_eq_zero_iff]
theorem cos_neg_iff_pi_div_two_lt_abs_toReal {θ : Angle} : cos θ < 0 ↔ π / 2 < |θ.toReal| := by
  

Proof state:
θ : Angle
⊢ cos θ < 0 ↔ π / 2 < |toReal θ|

Next tactic:
rw [← not_le, ← not_le, not_iff_not, cos_nonneg_iff_abs_toReal_le_pi_div_two]
theorem abs_cos_eq_abs_sin_of_two_nsmul_add_two_nsmul_eq_pi {θ ψ : Angle}
    (h : (2 : ℕ) • θ + (2 : ℕ) • ψ = π) : |cos θ| = |sin ψ| := by
  

Proof state:
θ ψ : Angle
h : 2 • θ + 2 • ψ = ↑π
⊢ |cos θ| = |sin ψ|

Next tactic:
rw [← eq_sub_iff_add_eq, ← two_nsmul_coe_div_two, ← nsmul_sub, two_nsmul_eq_iff] at h
theorem abs_cos_eq_abs_sin_of_two_nsmul_add_two_nsmul_eq_pi {θ ψ : Angle}
    (h : (2 : ℕ) • θ + (2 : ℕ) • ψ = π) : |cos θ| = |sin ψ| := by
  rw [← eq_sub_iff_add_eq, ← two_nsmul_coe_div_two, ← nsmul_sub, two_nsmul_eq_iff] at h
  

Proof state:
θ ψ : Angle
h : θ = ↑(π / 2) - ψ ∨ θ = ↑(π / 2) - ψ + ↑π
⊢ |cos θ| = |sin ψ|

Next tactic:
rcases h with (rfl | rfl)
theorem abs_cos_eq_abs_sin_of_two_nsmul_add_two_nsmul_eq_pi {θ ψ : Angle}
    (h : (2 : ℕ) • θ + (2 : ℕ) • ψ = π) : |cos θ| = |sin ψ| := by
  rw [← eq_sub_iff_add_eq, ← two_nsmul_coe_div_two, ← nsmul_sub, two_nsmul_eq_iff] at h
  rcases h with (rfl | rfl) <;> 

Proof state:
case inl
ψ : Angle
⊢ |cos (↑(π / 2) - ψ)| = |sin ψ|

Next tactic:
simp [cos_pi_div_two_sub]
theorem abs_cos_eq_abs_sin_of_two_nsmul_add_two_nsmul_eq_pi {θ ψ : Angle}
    (h : (2 : ℕ) • θ + (2 : ℕ) • ψ = π) : |cos θ| = |sin ψ| := by
  rw [← eq_sub_iff_add_eq, ← two_nsmul_coe_div_two, ← nsmul_sub, two_nsmul_eq_iff] at h
  rcases h with (rfl | rfl) <;> 

Proof state:
case inr
ψ : Angle
⊢ |cos (↑(π / 2) - ψ + ↑π)| = |sin ψ|

Next tactic:
simp [cos_pi_div_two_sub]
theorem abs_cos_eq_abs_sin_of_two_zsmul_add_two_zsmul_eq_pi {θ ψ : Angle}
    (h : (2 : ℤ) • θ + (2 : ℤ) • ψ = π) : |cos θ| = |sin ψ| := by
  

Proof state:
θ ψ : Angle
h : 2 • θ + 2 • ψ = ↑π
⊢ |cos θ| = |sin ψ|

Next tactic:
simp_rw [two_zsmul, ← two_nsmul] at h
theorem abs_cos_eq_abs_sin_of_two_zsmul_add_two_zsmul_eq_pi {θ ψ : Angle}
    (h : (2 : ℤ) • θ + (2 : ℤ) • ψ = π) : |cos θ| = |sin ψ| := by
  simp_rw [two_zsmul, ← two_nsmul] at h
  

Proof state:
θ ψ : Angle
h : 2 • θ + 2 • ψ = ↑π
⊢ |cos θ| = |sin ψ|

Next tactic:
exact abs_cos_eq_abs_sin_of_two_nsmul_add_two_nsmul_eq_pi h
@[simp]
theorem tan_coe (x : ℝ) : tan (x : Angle) = Real.tan x := by
  

Proof state:
x : ℝ
⊢ tan ↑x = Real.tan x

Next tactic:
rw [tan, sin_coe, cos_coe, Real.tan_eq_sin_div_cos]
@[simp]
theorem tan_zero : tan (0 : Angle) = 0 := by 

Proof state:
⊢ tan 0 = 0

Next tactic:
rw [← coe_zero, tan_coe, Real.tan_zero]
theorem tan_coe_pi : tan (π : Angle) = 0 := by 

Proof state:
⊢ tan ↑π = 0

Next tactic:
rw [tan_coe, Real.tan_pi]
theorem tan_periodic : Function.Periodic tan (π : Angle) := by
  

Proof state:
⊢ Function.Periodic tan ↑π

Next tactic:
intro θ
theorem tan_periodic : Function.Periodic tan (π : Angle) := by
  intro θ
  

Proof state:
θ : Angle
⊢ tan (θ + ↑π) = tan θ

Next tactic:
induction θ using Real.Angle.induction_on
theorem tan_periodic : Function.Periodic tan (π : Angle) := by
  intro θ
  induction θ using Real.Angle.induction_on
  

Proof state:
case h
x✝ : ℝ
⊢ tan (↑x✝ + ↑π) = tan ↑x✝

Next tactic:
rw [← coe_add, tan_coe, tan_coe]
theorem tan_periodic : Function.Periodic tan (π : Angle) := by
  intro θ
  induction θ using Real.Angle.induction_on
  rw [← coe_add, tan_coe, tan_coe]
  

Proof state:
case h
x✝ : ℝ
⊢ Real.tan (x✝ + π) = Real.tan x✝

Next tactic:
exact Real.tan_periodic _
@[simp]
theorem tan_toReal (θ : Angle) : Real.tan θ.toReal = tan θ := by
  

Proof state:
θ : Angle
⊢ Real.tan (toReal θ) = tan θ

Next tactic:
conv_rhs => rw [← coe_toReal θ, tan_coe]
@[simp]
theorem tan_toReal (θ : Angle) : Real.tan θ.toReal = tan θ := by
  conv_rhs => 

Proof state:
θ : Angle
| tan θ

Next tactic:
rw [← coe_toReal θ, tan_coe]
theorem tan_eq_of_two_nsmul_eq {θ ψ : Angle} (h : (2 : ℕ) • θ = (2 : ℕ) • ψ) : tan θ = tan ψ := by
  

Proof state:
θ ψ : Angle
h : 2 • θ = 2 • ψ
⊢ tan θ = tan ψ

Next tactic:
rw [two_nsmul_eq_iff] at h
theorem tan_eq_of_two_nsmul_eq {θ ψ : Angle} (h : (2 : ℕ) • θ = (2 : ℕ) • ψ) : tan θ = tan ψ := by
  rw [two_nsmul_eq_iff] at h
  

Proof state:
θ ψ : Angle
h : θ = ψ ∨ θ = ψ + ↑π
⊢ tan θ = tan ψ

Next tactic:
rcases h with (rfl | rfl)
theorem tan_eq_of_two_nsmul_eq {θ ψ : Angle} (h : (2 : ℕ) • θ = (2 : ℕ) • ψ) : tan θ = tan ψ := by
  rw [two_nsmul_eq_iff] at h
  rcases h with (rfl | rfl)
  · 

Proof state:
case inl
θ : Angle
⊢ tan θ = tan θ

Next tactic:
rfl
theorem tan_eq_of_two_nsmul_eq {θ ψ : Angle} (h : (2 : ℕ) • θ = (2 : ℕ) • ψ) : tan θ = tan ψ := by
  rw [two_nsmul_eq_iff] at h
  rcases h with (rfl | rfl)
  · rfl
  · 

Proof state:
case inr
ψ : Angle
⊢ tan (ψ + ↑π) = tan ψ

Next tactic:
exact tan_add_pi _
theorem tan_eq_of_two_zsmul_eq {θ ψ : Angle} (h : (2 : ℤ) • θ = (2 : ℤ) • ψ) : tan θ = tan ψ := by
  

Proof state:
θ ψ : Angle
h : 2 • θ = 2 • ψ
⊢ tan θ = tan ψ

Next tactic:
simp_rw [two_zsmul, ← two_nsmul] at h
theorem tan_eq_of_two_zsmul_eq {θ ψ : Angle} (h : (2 : ℤ) • θ = (2 : ℤ) • ψ) : tan θ = tan ψ := by
  simp_rw [two_zsmul, ← two_nsmul] at h
  

Proof state:
θ ψ : Angle
h : 2 • θ = 2 • ψ
⊢ tan θ = tan ψ

Next tactic:
exact tan_eq_of_two_nsmul_eq h
theorem tan_eq_inv_of_two_nsmul_add_two_nsmul_eq_pi {θ ψ : Angle}
    (h : (2 : ℕ) • θ + (2 : ℕ) • ψ = π) : tan ψ = (tan θ)⁻¹ := by
  

Proof state:
θ ψ : Angle
h : 2 • θ + 2 • ψ = ↑π
⊢ tan ψ = (tan θ)⁻¹

Next tactic:
induction θ using Real.Angle.induction_on
theorem tan_eq_inv_of_two_nsmul_add_two_nsmul_eq_pi {θ ψ : Angle}
    (h : (2 : ℕ) • θ + (2 : ℕ) • ψ = π) : tan ψ = (tan θ)⁻¹ := by
  induction θ using Real.Angle.induction_on
  

Proof state:
case h
ψ : Angle
x✝ : ℝ
h : 2 • ↑x✝ + 2 • ψ = ↑π
⊢ tan ψ = (tan ↑x✝)⁻¹

Next tactic:
induction ψ using Real.Angle.induction_on
theorem tan_eq_inv_of_two_nsmul_add_two_nsmul_eq_pi {θ ψ : Angle}
    (h : (2 : ℕ) • θ + (2 : ℕ) • ψ = π) : tan ψ = (tan θ)⁻¹ := by
  induction θ using Real.Angle.induction_on
  induction ψ using Real.Angle.induction_on
  

Proof state:
case h.h
x✝¹ x✝ : ℝ
h : 2 • ↑x✝¹ + 2 • ↑x✝ = ↑π
⊢ tan ↑x✝ = (tan ↑x✝¹)⁻¹

Next tactic:
rw [← smul_add, ← coe_add, ← coe_nsmul, two_nsmul, ← two_mul, angle_eq_iff_two_pi_dvd_sub] at h
theorem tan_eq_inv_of_two_nsmul_add_two_nsmul_eq_pi {θ ψ : Angle}
    (h : (2 : ℕ) • θ + (2 : ℕ) • ψ = π) : tan ψ = (tan θ)⁻¹ := by
  induction θ using Real.Angle.induction_on
  induction ψ using Real.Angle.induction_on
  rw [← smul_add, ← coe_add, ← coe_nsmul, two_nsmul, ← two_mul, angle_eq_iff_two_pi_dvd_sub] at h
  

Proof state:
case h.h
x✝¹ x✝ : ℝ
h : ∃ k, 2 * (x✝¹ + x✝) - π = 2 * π * ↑k
⊢ tan ↑x✝ = (tan ↑x✝¹)⁻¹

Next tactic:
rcases h with ⟨k, h⟩
theorem tan_eq_inv_of_two_nsmul_add_two_nsmul_eq_pi {θ ψ : Angle}
    (h : (2 : ℕ) • θ + (2 : ℕ) • ψ = π) : tan ψ = (tan θ)⁻¹ := by
  induction θ using Real.Angle.induction_on
  induction ψ using Real.Angle.induction_on
  rw [← smul_add, ← coe_add, ← coe_nsmul, two_nsmul, ← two_mul, angle_eq_iff_two_pi_dvd_sub] at h
  rcases h with ⟨k, h⟩
  

Proof state:
case h.h.intro
x✝¹ x✝ : ℝ
k : ℤ
h : 2 * (x✝¹ + x✝) - π = 2 * π * ↑k
⊢ tan ↑x✝ = (tan ↑x✝¹)⁻¹

Next tactic:
rw [sub_eq_iff_eq_add, ← mul_inv_cancel_left₀ two_ne_zero π, mul_assoc, ← mul_add,
    mul_right_inj' (two_ne_zero' ℝ), ← eq_sub_iff_add_eq', mul_inv_cancel_left₀ two_ne_zero π,
    inv_mul_eq_div, mul_comm] at h
theorem tan_eq_inv_of_two_nsmul_add_two_nsmul_eq_pi {θ ψ : Angle}
    (h : (2 : ℕ) • θ + (2 : ℕ) • ψ = π) : tan ψ = (tan θ)⁻¹ := by
  induction θ using Real.Angle.induction_on
  induction ψ using Real.Angle.induction_on
  rw [← smul_add, ← coe_add, ← coe_nsmul, two_nsmul, ← two_mul, angle_eq_iff_two_pi_dvd_sub] at h
  rcases h with ⟨k, h⟩
  rw [sub_eq_iff_eq_add, ← mul_inv_cancel_left₀ two_ne_zero π, mul_assoc, ← mul_add,
    mul_right_inj' (two_ne_zero' ℝ), ← eq_sub_iff_add_eq', mul_inv_cancel_left₀ two_ne_zero π,
    inv_mul_eq_div, mul_comm] at h
  

Proof state:
case h.h.intro
x✝¹ x✝ : ℝ
k : ℤ
h : x✝ = ↑k * π + π / 2 - x✝¹
⊢ tan ↑x✝ = (tan ↑x✝¹)⁻¹

Next tactic:
rw [tan_coe, tan_coe, ← tan_pi_div_two_sub, h, add_sub_assoc, add_comm]
theorem tan_eq_inv_of_two_nsmul_add_two_nsmul_eq_pi {θ ψ : Angle}
    (h : (2 : ℕ) • θ + (2 : ℕ) • ψ = π) : tan ψ = (tan θ)⁻¹ := by
  induction θ using Real.Angle.induction_on
  induction ψ using Real.Angle.induction_on
  rw [← smul_add, ← coe_add, ← coe_nsmul, two_nsmul, ← two_mul, angle_eq_iff_two_pi_dvd_sub] at h
  rcases h with ⟨k, h⟩
  rw [sub_eq_iff_eq_add, ← mul_inv_cancel_left₀ two_ne_zero π, mul_assoc, ← mul_add,
    mul_right_inj' (two_ne_zero' ℝ), ← eq_sub_iff_add_eq', mul_inv_cancel_left₀ two_ne_zero π,
    inv_mul_eq_div, mul_comm] at h
  rw [tan_coe, tan_coe, ← tan_pi_div_two_sub, h, add_sub_assoc, add_comm]
  

Proof state:
case h.h.intro
x✝¹ x✝ : ℝ
k : ℤ
h : x✝ = ↑k * π + π / 2 - x✝¹
⊢ Real.tan (π / 2 - x✝¹ + ↑k * π) = Real.tan (π / 2 - x✝¹)

Next tactic:
exact Real.tan_periodic.int_mul _ _
theorem tan_eq_inv_of_two_zsmul_add_two_zsmul_eq_pi {θ ψ : Angle}
    (h : (2 : ℤ) • θ + (2 : ℤ) • ψ = π) : tan ψ = (tan θ)⁻¹ := by
  

Proof state:
θ ψ : Angle
h : 2 • θ + 2 • ψ = ↑π
⊢ tan ψ = (tan θ)⁻¹

Next tactic:
simp_rw [two_zsmul, ← two_nsmul] at h
theorem tan_eq_inv_of_two_zsmul_add_two_zsmul_eq_pi {θ ψ : Angle}
    (h : (2 : ℤ) • θ + (2 : ℤ) • ψ = π) : tan ψ = (tan θ)⁻¹ := by
  simp_rw [two_zsmul, ← two_nsmul] at h
  

Proof state:
θ ψ : Angle
h : 2 • θ + 2 • ψ = ↑π
⊢ tan ψ = (tan θ)⁻¹

Next tactic:
exact tan_eq_inv_of_two_nsmul_add_two_nsmul_eq_pi h
@[simp]
theorem sign_zero : (0 : Angle).sign = 0 := by
  

Proof state:
⊢ sign 0 = 0

Next tactic:
rw [sign, sin_zero, _root_.sign_zero]
@[simp]
theorem sign_coe_pi : (π : Angle).sign = 0 := by 

Proof state:
⊢ sign ↑π = 0

Next tactic:
rw [sign, sin_coe_pi, _root_.sign_zero]
@[simp]
theorem sign_neg (θ : Angle) : (-θ).sign = -θ.sign := by
  

Proof state:
θ : Angle
⊢ sign (-θ) = -sign θ

Next tactic:
simp_rw [sign, sin_neg, Left.sign_neg]
theorem sign_antiperiodic : Function.Antiperiodic sign (π : Angle) := fun θ => by
  

Proof state:
θ : Angle
⊢ sign (θ + ↑π) = -sign θ

Next tactic:
rw [sign, sign, sin_add_pi, Left.sign_neg]
@[simp]
theorem sign_pi_add (θ : Angle) : ((π : Angle) + θ).sign = -θ.sign := by 

Proof state:
θ : Angle
⊢ sign (↑π + θ) = -sign θ

Next tactic:
rw [add_comm, sign_add_pi]
@[simp]
theorem sign_pi_sub (θ : Angle) : ((π : Angle) - θ).sign = θ.sign := by
  

Proof state:
θ : Angle
⊢ sign (↑π - θ) = sign θ

Next tactic:
simp [sign_antiperiodic.sub_eq']
theorem sign_eq_zero_iff {θ : Angle} : θ.sign = 0 ↔ θ = 0 ∨ θ = π := by
  

Proof state:
θ : Angle
⊢ sign θ = 0 ↔ θ = 0 ∨ θ = ↑π

Next tactic:
rw [sign, _root_.sign_eq_zero_iff, sin_eq_zero_iff]
theorem sign_ne_zero_iff {θ : Angle} : θ.sign ≠ 0 ↔ θ ≠ 0 ∧ θ ≠ π := by
  

Proof state:
θ : Angle
⊢ sign θ ≠ 0 ↔ θ ≠ 0 ∧ θ ≠ ↑π

Next tactic:
rw [← not_or, ← sign_eq_zero_iff]
theorem toReal_neg_iff_sign_neg {θ : Angle} : θ.toReal < 0 ↔ θ.sign = -1 := by
  

Proof state:
θ : Angle
⊢ toReal θ < 0 ↔ sign θ = -1

Next tactic:
rw [sign, ← sin_toReal, sign_eq_neg_one_iff]
theorem toReal_neg_iff_sign_neg {θ : Angle} : θ.toReal < 0 ↔ θ.sign = -1 := by
  rw [sign, ← sin_toReal, sign_eq_neg_one_iff]
  

Proof state:
θ : Angle
⊢ toReal θ < 0 ↔ Real.sin (toReal θ) < 0

Next tactic:
rcases lt_trichotomy θ.toReal 0 with (h | h | h)
theorem toReal_neg_iff_sign_neg {θ : Angle} : θ.toReal < 0 ↔ θ.sign = -1 := by
  rw [sign, ← sin_toReal, sign_eq_neg_one_iff]
  rcases lt_trichotomy θ.toReal 0 with (h | h | h)
  · 

Proof state:
case inl
θ : Angle
h : toReal θ < 0
⊢ toReal θ < 0 ↔ Real.sin (toReal θ) < 0

Next tactic:
exact ⟨fun _ => Real.sin_neg_of_neg_of_neg_pi_lt h (neg_pi_lt_toReal θ), fun _ => h⟩
theorem toReal_neg_iff_sign_neg {θ : Angle} : θ.toReal < 0 ↔ θ.sign = -1 := by
  rw [sign, ← sin_toReal, sign_eq_neg_one_iff]
  rcases lt_trichotomy θ.toReal 0 with (h | h | h)
  · exact ⟨fun _ => Real.sin_neg_of_neg_of_neg_pi_lt h (neg_pi_lt_toReal θ), fun _ => h⟩
  · 

Proof state:
case inr.inl
θ : Angle
h : toReal θ = 0
⊢ toReal θ < 0 ↔ Real.sin (toReal θ) < 0

Next tactic:
simp [h]
theorem toReal_neg_iff_sign_neg {θ : Angle} : θ.toReal < 0 ↔ θ.sign = -1 := by
  rw [sign, ← sin_toReal, sign_eq_neg_one_iff]
  rcases lt_trichotomy θ.toReal 0 with (h | h | h)
  · exact ⟨fun _ => Real.sin_neg_of_neg_of_neg_pi_lt h (neg_pi_lt_toReal θ), fun _ => h⟩
  · simp [h]
  · 

Proof state:
case inr.inr
θ : Angle
h : 0 < toReal θ
⊢ toReal θ < 0 ↔ Real.sin (toReal θ) < 0

Next tactic:
exact
      ⟨fun hn => False.elim (h.asymm hn), fun hn =>
        False.elim (hn.not_le (sin_nonneg_of_nonneg_of_le_pi h.le (toReal_le_pi θ)))⟩
theorem toReal_nonneg_iff_sign_nonneg {θ : Angle} : 0 ≤ θ.toReal ↔ 0 ≤ θ.sign := by
  

Proof state:
θ : Angle
⊢ 0 ≤ toReal θ ↔ 0 ≤ sign θ

Next tactic:
rcases lt_trichotomy θ.toReal 0 with (h | h | h)
theorem toReal_nonneg_iff_sign_nonneg {θ : Angle} : 0 ≤ θ.toReal ↔ 0 ≤ θ.sign := by
  rcases lt_trichotomy θ.toReal 0 with (h | h | h)
  · 

Proof state:
case inl
θ : Angle
h : toReal θ < 0
⊢ 0 ≤ toReal θ ↔ 0 ≤ sign θ

Next tactic:
refine' ⟨fun hn => False.elim (h.not_le hn), fun hn => _⟩
theorem toReal_nonneg_iff_sign_nonneg {θ : Angle} : 0 ≤ θ.toReal ↔ 0 ≤ θ.sign := by
  rcases lt_trichotomy θ.toReal 0 with (h | h | h)
  · refine' ⟨fun hn => False.elim (h.not_le hn), fun hn => _⟩
    

Proof state:
case inl
θ : Angle
h : toReal θ < 0
hn : 0 ≤ sign θ
⊢ 0 ≤ toReal θ

Next tactic:
rw [toReal_neg_iff_sign_neg.1 h] at hn
theorem toReal_nonneg_iff_sign_nonneg {θ : Angle} : 0 ≤ θ.toReal ↔ 0 ≤ θ.sign := by
  rcases lt_trichotomy θ.toReal 0 with (h | h | h)
  · refine' ⟨fun hn => False.elim (h.not_le hn), fun hn => _⟩
    rw [toReal_neg_iff_sign_neg.1 h] at hn
    

Proof state:
case inl
θ : Angle
h : toReal θ < 0
hn : 0 ≤ -1
⊢ 0 ≤ toReal θ

Next tactic:
exact False.elim (hn.not_lt (by decide))
theorem toReal_nonneg_iff_sign_nonneg {θ : Angle} : 0 ≤ θ.toReal ↔ 0 ≤ θ.sign := by
  rcases lt_trichotomy θ.toReal 0 with (h | h | h)
  · refine' ⟨fun hn => False.elim (h.not_le hn), fun hn => _⟩
    rw [toReal_neg_iff_sign_neg.1 h] at hn
    exact False.elim (hn.not_lt (by 

Proof state:
θ : Angle
h : toReal θ < 0
hn : 0 ≤ -1
⊢ -1 < 0

Next tactic:
decide
theorem toReal_nonneg_iff_sign_nonneg {θ : Angle} : 0 ≤ θ.toReal ↔ 0 ≤ θ.sign := by
  rcases lt_trichotomy θ.toReal 0 with (h | h | h)
  · refine' ⟨fun hn => False.elim (h.not_le hn), fun hn => _⟩
    rw [toReal_neg_iff_sign_neg.1 h] at hn
    exact False.elim (hn.not_lt (by decide))
  · 

Proof state:
case inr.inl
θ : Angle
h : toReal θ = 0
⊢ 0 ≤ toReal θ ↔ 0 ≤ sign θ

Next tactic:
simp [h, sign, ← sin_toReal]
theorem toReal_nonneg_iff_sign_nonneg {θ : Angle} : 0 ≤ θ.toReal ↔ 0 ≤ θ.sign := by
  rcases lt_trichotomy θ.toReal 0 with (h | h | h)
  · refine' ⟨fun hn => False.elim (h.not_le hn), fun hn => _⟩
    rw [toReal_neg_iff_sign_neg.1 h] at hn
    exact False.elim (hn.not_lt (by decide))
  · simp [h, sign, ← sin_toReal]
  · 

Proof state:
case inr.inr
θ : Angle
h : 0 < toReal θ
⊢ 0 ≤ toReal θ ↔ 0 ≤ sign θ

Next tactic:
refine' ⟨fun _ => _, fun _ => h.le⟩
theorem toReal_nonneg_iff_sign_nonneg {θ : Angle} : 0 ≤ θ.toReal ↔ 0 ≤ θ.sign := by
  rcases lt_trichotomy θ.toReal 0 with (h | h | h)
  · refine' ⟨fun hn => False.elim (h.not_le hn), fun hn => _⟩
    rw [toReal_neg_iff_sign_neg.1 h] at hn
    exact False.elim (hn.not_lt (by decide))
  · simp [h, sign, ← sin_toReal]
  · refine' ⟨fun _ => _, fun _ => h.le⟩
    

Proof state:
case inr.inr
θ : Angle
h : 0 < toReal θ
x✝ : 0 ≤ toReal θ
⊢ 0 ≤ sign θ

Next tactic:
rw [sign, ← sin_toReal, sign_nonneg_iff]
theorem toReal_nonneg_iff_sign_nonneg {θ : Angle} : 0 ≤ θ.toReal ↔ 0 ≤ θ.sign := by
  rcases lt_trichotomy θ.toReal 0 with (h | h | h)
  · refine' ⟨fun hn => False.elim (h.not_le hn), fun hn => _⟩
    rw [toReal_neg_iff_sign_neg.1 h] at hn
    exact False.elim (hn.not_lt (by decide))
  · simp [h, sign, ← sin_toReal]
  · refine' ⟨fun _ => _, fun _ => h.le⟩
    rw [sign, ← sin_toReal, sign_nonneg_iff]
    

Proof state:
case inr.inr
θ : Angle
h : 0 < toReal θ
x✝ : 0 ≤ toReal θ
⊢ 0 ≤ Real.sin (toReal θ)

Next tactic:
exact sin_nonneg_of_nonneg_of_le_pi h.le (toReal_le_pi θ)
@[simp]
theorem sign_toReal {θ : Angle} (h : θ ≠ π) : SignType.sign θ.toReal = θ.sign := by
  

Proof state:
θ : Angle
h : θ ≠ ↑π
⊢ SignType.sign (toReal θ) = sign θ

Next tactic:
rcases lt_trichotomy θ.toReal 0 with (ht | ht | ht)
@[simp]
theorem sign_toReal {θ : Angle} (h : θ ≠ π) : SignType.sign θ.toReal = θ.sign := by
  rcases lt_trichotomy θ.toReal 0 with (ht | ht | ht)
  · 

Proof state:
case inl
θ : Angle
h : θ ≠ ↑π
ht : toReal θ < 0
⊢ SignType.sign (toReal θ) = sign θ

Next tactic:
simp [ht, toReal_neg_iff_sign_neg.1 ht]
@[simp]
theorem sign_toReal {θ : Angle} (h : θ ≠ π) : SignType.sign θ.toReal = θ.sign := by
  rcases lt_trichotomy θ.toReal 0 with (ht | ht | ht)
  · simp [ht, toReal_neg_iff_sign_neg.1 ht]
  · 

Proof state:
case inr.inl
θ : Angle
h : θ ≠ ↑π
ht : toReal θ = 0
⊢ SignType.sign (toReal θ) = sign θ

Next tactic:
simp [sign, ht, ← sin_toReal]
@[simp]
theorem sign_toReal {θ : Angle} (h : θ ≠ π) : SignType.sign θ.toReal = θ.sign := by
  rcases lt_trichotomy θ.toReal 0 with (ht | ht | ht)
  · simp [ht, toReal_neg_iff_sign_neg.1 ht]
  · simp [sign, ht, ← sin_toReal]
  · 

Proof state:
case inr.inr
θ : Angle
h : θ ≠ ↑π
ht : 0 < toReal θ
⊢ SignType.sign (toReal θ) = sign θ

Next tactic:
rw [sign, ← sin_toReal, sign_pos ht,
      sign_pos
        (sin_pos_of_pos_of_lt_pi ht ((toReal_le_pi θ).lt_of_ne (toReal_eq_pi_iff.not.2 h)))]
theorem coe_abs_toReal_of_sign_nonneg {θ : Angle} (h : 0 ≤ θ.sign) : ↑|θ.toReal| = θ := by
  

Proof state:
θ : Angle
h : 0 ≤ sign θ
⊢ ↑|toReal θ| = θ

Next tactic:
rw [abs_eq_self.2 (toReal_nonneg_iff_sign_nonneg.2 h), coe_toReal]
theorem neg_coe_abs_toReal_of_sign_nonpos {θ : Angle} (h : θ.sign ≤ 0) : -↑|θ.toReal| = θ := by
  

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

Next tactic:
rw [SignType.nonpos_iff] at h
theorem neg_coe_abs_toReal_of_sign_nonpos {θ : Angle} (h : θ.sign ≤ 0) : -↑|θ.toReal| = θ := by
  rw [SignType.nonpos_iff] at h
  

Proof state:
θ : Angle
h : sign θ = -1 ∨ sign θ = 0
⊢ -↑|toReal θ| = θ

Next tactic:
rcases h with (h | 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)
  · 

Proof state:
case inl
θ : Angle
h : sign θ = -1
⊢ -↑|toReal θ| = θ

Next tactic:
rw [abs_of_neg (toReal_neg_iff_sign_neg.2 h), coe_neg, neg_neg, coe_toReal]