l3lab/ntp-mathlib huggingface dataset:
theorem abs_cos_eq_of_two_nsmul_eq {θ ψ : Angle} (h : (2 : ℕ) • θ = (2 : ℕ) • ψ) :
    |cos θ| = |cos ψ| := by
  rw [two_nsmul_eq_iff] at h
  

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

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

Proof state:
case inl
θ : Angle
⊢ |cos θ| = |cos θ|

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

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

Next tactic:
rw [cos_add_pi, abs_neg]
theorem abs_cos_eq_of_two_zsmul_eq {θ ψ : Angle} (h : (2 : ℤ) • θ = (2 : ℤ) • ψ) :
    |cos θ| = |cos ψ| := by
  

Proof state:
θ ψ : Angle
h : 2 • θ = 2 • ψ
⊢ |cos θ| = |cos ψ|

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

Proof state:
θ ψ : Angle
h : 2 • θ = 2 • ψ
⊢ |cos θ| = |cos ψ|

Next tactic:
exact abs_cos_eq_of_two_nsmul_eq h
@[simp]
theorem coe_toIcoMod (θ ψ : ℝ) : ↑(toIcoMod two_pi_pos ψ θ) = (θ : Angle) := by
  

Proof state:
θ ψ : ℝ
⊢ ↑(toIcoMod two_pi_pos ψ θ) = ↑θ

Next tactic:
rw [angle_eq_iff_two_pi_dvd_sub]
@[simp]
theorem coe_toIcoMod (θ ψ : ℝ) : ↑(toIcoMod two_pi_pos ψ θ) = (θ : Angle) := by
  rw [angle_eq_iff_two_pi_dvd_sub]
  

Proof state:
θ ψ : ℝ
⊢ ∃ k, toIcoMod two_pi_pos ψ θ - θ = 2 * π * ↑k

Next tactic:
refine' ⟨-toIcoDiv two_pi_pos ψ θ, _⟩
@[simp]
theorem coe_toIcoMod (θ ψ : ℝ) : ↑(toIcoMod two_pi_pos ψ θ) = (θ : Angle) := by
  rw [angle_eq_iff_two_pi_dvd_sub]
  refine' ⟨-toIcoDiv two_pi_pos ψ θ, _⟩
  

Proof state:
θ ψ : ℝ
⊢ toIcoMod two_pi_pos ψ θ - θ = 2 * π * ↑(-toIcoDiv two_pi_pos ψ θ)

Next tactic:
rw [toIcoMod_sub_self, zsmul_eq_mul, mul_comm]
@[simp]
theorem coe_toIocMod (θ ψ : ℝ) : ↑(toIocMod two_pi_pos ψ θ) = (θ : Angle) := by
  

Proof state:
θ ψ : ℝ
⊢ ↑(toIocMod two_pi_pos ψ θ) = ↑θ

Next tactic:
rw [angle_eq_iff_two_pi_dvd_sub]
@[simp]
theorem coe_toIocMod (θ ψ : ℝ) : ↑(toIocMod two_pi_pos ψ θ) = (θ : Angle) := by
  rw [angle_eq_iff_two_pi_dvd_sub]
  

Proof state:
θ ψ : ℝ
⊢ ∃ k, toIocMod two_pi_pos ψ θ - θ = 2 * π * ↑k

Next tactic:
refine' ⟨-toIocDiv two_pi_pos ψ θ, _⟩
@[simp]
theorem coe_toIocMod (θ ψ : ℝ) : ↑(toIocMod two_pi_pos ψ θ) = (θ : Angle) := by
  rw [angle_eq_iff_two_pi_dvd_sub]
  refine' ⟨-toIocDiv two_pi_pos ψ θ, _⟩
  

Proof state:
θ ψ : ℝ
⊢ toIocMod two_pi_pos ψ θ - θ = 2 * π * ↑(-toIocDiv two_pi_pos ψ θ)

Next tactic:
rw [toIocMod_sub_self, zsmul_eq_mul, mul_comm]
theorem toReal_coe_eq_self_iff {θ : ℝ} : (θ : Angle).toReal = θ ↔ -π < θ ∧ θ ≤ π := by
  

Proof state:
θ : ℝ
⊢ toReal ↑θ = θ ↔ -π < θ ∧ θ ≤ π

Next tactic:
rw [toReal_coe, toIocMod_eq_self two_pi_pos]
theorem toReal_coe_eq_self_iff {θ : ℝ} : (θ : Angle).toReal = θ ↔ -π < θ ∧ θ ≤ π := by
  rw [toReal_coe, toIocMod_eq_self two_pi_pos]
  

Proof state:
θ : ℝ
⊢ θ ∈ Set.Ioc (-π) (-π + 2 * π) ↔ -π < θ ∧ θ ≤ π

Next tactic:
ring_nf
theorem toReal_coe_eq_self_iff {θ : ℝ} : (θ : Angle).toReal = θ ↔ -π < θ ∧ θ ≤ π := by
  rw [toReal_coe, toIocMod_eq_self two_pi_pos]
  ring_nf
  

Proof state:
θ : ℝ
⊢ θ ∈ Set.Ioc (-π) π ↔ -π < θ ∧ θ ≤ π

Next tactic:
rfl
theorem toReal_coe_eq_self_iff_mem_Ioc {θ : ℝ} : (θ : Angle).toReal = θ ↔ θ ∈ Set.Ioc (-π) π := by
  

Proof state:
θ : ℝ
⊢ toReal ↑θ = θ ↔ θ ∈ Set.Ioc (-π) π

Next tactic:
rw [toReal_coe_eq_self_iff, ← Set.mem_Ioc]
theorem toReal_injective : Function.Injective toReal := by
  

Proof state:
⊢ Function.Injective toReal

Next tactic:
intro θ ψ h
theorem toReal_injective : Function.Injective toReal := by
  intro θ ψ h
  

Proof state:
θ ψ : Angle
h : toReal θ = toReal ψ
⊢ θ = ψ

Next tactic:
induction θ using Real.Angle.induction_on
theorem toReal_injective : Function.Injective toReal := by
  intro θ ψ h
  induction θ using Real.Angle.induction_on
  

Proof state:
case h
ψ : Angle
x✝ : ℝ
h : toReal ↑x✝ = toReal ψ
⊢ ↑x✝ = ψ

Next tactic:
induction ψ using Real.Angle.induction_on
theorem toReal_injective : Function.Injective toReal := by
  intro θ ψ h
  induction θ using Real.Angle.induction_on
  induction ψ using Real.Angle.induction_on
  

Proof state:
case h.h
x✝¹ x✝ : ℝ
h : toReal ↑x✝¹ = toReal ↑x✝
⊢ ↑x✝¹ = ↑x✝

Next tactic:
simpa [toReal_coe, toIocMod_eq_toIocMod, zsmul_eq_mul, mul_comm _ (2 * π), ←
    angle_eq_iff_two_pi_dvd_sub, eq_comm] using h
@[simp]
theorem coe_toReal (θ : Angle) : (θ.toReal : Angle) = θ := by
  

Proof state:
θ : Angle
⊢ ↑(toReal θ) = θ

Next tactic:
induction θ using Real.Angle.induction_on
@[simp]
theorem coe_toReal (θ : Angle) : (θ.toReal : Angle) = θ := by
  induction θ using Real.Angle.induction_on
  

Proof state:
case h
x✝ : ℝ
⊢ ↑(toReal ↑x✝) = ↑x✝

Next tactic:
exact coe_toIocMod _ _
theorem neg_pi_lt_toReal (θ : Angle) : -π < θ.toReal := by
  

Proof state:
θ : Angle
⊢ -π < toReal θ

Next tactic:
induction θ using Real.Angle.induction_on
theorem neg_pi_lt_toReal (θ : Angle) : -π < θ.toReal := by
  induction θ using Real.Angle.induction_on
  

Proof state:
case h
x✝ : ℝ
⊢ -π < toReal ↑x✝

Next tactic:
exact left_lt_toIocMod _ _ _
theorem toReal_le_pi (θ : Angle) : θ.toReal ≤ π := by
  

Proof state:
θ : Angle
⊢ toReal θ ≤ π

Next tactic:
induction θ using Real.Angle.induction_on
theorem toReal_le_pi (θ : Angle) : θ.toReal ≤ π := by
  induction θ using Real.Angle.induction_on
  

Proof state:
case h
x✝ : ℝ
⊢ toReal ↑x✝ ≤ π

Next tactic:
convert toIocMod_le_right two_pi_pos _ _
theorem toReal_le_pi (θ : Angle) : θ.toReal ≤ π := by
  induction θ using Real.Angle.induction_on
  convert toIocMod_le_right two_pi_pos _ _
  

Proof state:
case h.e'_4
x✝ : ℝ
⊢ π = -π + 2 * π

Next tactic:
ring
@[simp]
theorem toIocMod_toReal (θ : Angle) : toIocMod two_pi_pos (-π) θ.toReal = θ.toReal := by
  

Proof state:
θ : Angle
⊢ toIocMod two_pi_pos (-π) (toReal θ) = toReal θ

Next tactic:
induction θ using Real.Angle.induction_on
@[simp]
theorem toIocMod_toReal (θ : Angle) : toIocMod two_pi_pos (-π) θ.toReal = θ.toReal := by
  induction θ using Real.Angle.induction_on
  

Proof state:
case h
x✝ : ℝ
⊢ toIocMod two_pi_pos (-π) (toReal ↑x✝) = toReal ↑x✝

Next tactic:
rw [toReal_coe]
@[simp]
theorem toIocMod_toReal (θ : Angle) : toIocMod two_pi_pos (-π) θ.toReal = θ.toReal := by
  induction θ using Real.Angle.induction_on
  rw [toReal_coe]
  

Proof state:
case h
x✝ : ℝ
⊢ toIocMod two_pi_pos (-π) (toIocMod two_pi_pos (-π) x✝) = toIocMod two_pi_pos (-π) x✝

Next tactic:
exact toIocMod_toIocMod _ _ _ _
@[simp]
theorem toReal_zero : (0 : Angle).toReal = 0 := by
  

Proof state:
⊢ toReal 0 = 0

Next tactic:
rw [← coe_zero, toReal_coe_eq_self_iff]
@[simp]
theorem toReal_zero : (0 : Angle).toReal = 0 := by
  rw [← coe_zero, toReal_coe_eq_self_iff]
  

Proof state:
⊢ -π < 0 ∧ 0 ≤ π

Next tactic:
exact ⟨Left.neg_neg_iff.2 Real.pi_pos, Real.pi_pos.le⟩
@[simp]
theorem toReal_eq_zero_iff {θ : Angle} : θ.toReal = 0 ↔ θ = 0 := by
  

Proof state:
θ : Angle
⊢ toReal θ = 0 ↔ θ = 0

Next tactic:
nth_rw 1 [← toReal_zero]
@[simp]
theorem toReal_eq_zero_iff {θ : Angle} : θ.toReal = 0 ↔ θ = 0 := by
  nth_rw 1 [← toReal_zero]
  

Proof state:
θ : Angle
⊢ toReal θ = toReal 0 ↔ θ = 0

Next tactic:
exact toReal_inj
@[simp]
theorem toReal_pi : (π : Angle).toReal = π := by
  

Proof state:
⊢ toReal ↑π = π

Next tactic:
rw [toReal_coe_eq_self_iff]
@[simp]
theorem toReal_pi : (π : Angle).toReal = π := by
  rw [toReal_coe_eq_self_iff]
  

Proof state:
⊢ -π < π ∧ π ≤ π

Next tactic:
exact ⟨Left.neg_lt_self Real.pi_pos, le_refl _⟩
@[simp]
theorem toReal_eq_pi_iff {θ : Angle} : θ.toReal = π ↔ θ = π := by 

Proof state:
θ : Angle
⊢ toReal θ = π ↔ θ = ↑π

Next tactic:
rw [← toReal_inj, toReal_pi]
theorem pi_ne_zero : (π : Angle) ≠ 0 := by
  

Proof state:
⊢ ↑π ≠ 0

Next tactic:
rw [← toReal_injective.ne_iff, toReal_pi, toReal_zero]
theorem pi_ne_zero : (π : Angle) ≠ 0 := by
  rw [← toReal_injective.ne_iff, toReal_pi, toReal_zero]
  

Proof state:
⊢ π ≠ 0

Next tactic:
exact Real.pi_ne_zero
@[simp]
theorem toReal_pi_div_two : ((π / 2 : ℝ) : Angle).toReal = π / 2 :=
  toReal_coe_eq_self_iff.2 <| by 

Proof state:
⊢ -π < π / 2 ∧ π / 2 ≤ π

Next tactic:
constructor
@[simp]
theorem toReal_pi_div_two : ((π / 2 : ℝ) : Angle).toReal = π / 2 :=
  toReal_coe_eq_self_iff.2 <| by constructor <;> 

Proof state:
case left
⊢ -π < π / 2

Next tactic:
linarith [pi_pos]
@[simp]
theorem toReal_pi_div_two : ((π / 2 : ℝ) : Angle).toReal = π / 2 :=
  toReal_coe_eq_self_iff.2 <| by constructor <;> 

Proof state:
case right
⊢ π / 2 ≤ π

Next tactic:
linarith [pi_pos]
@[simp]
theorem toReal_eq_pi_div_two_iff {θ : Angle} : θ.toReal = π / 2 ↔ θ = (π / 2 : ℝ) := by
  

Proof state:
θ : Angle
⊢ toReal θ = π / 2 ↔ θ = ↑(π / 2)

Next tactic:
rw [← toReal_inj, toReal_pi_div_two]
@[simp]
theorem toReal_neg_pi_div_two : ((-π / 2 : ℝ) : Angle).toReal = -π / 2 :=
  toReal_coe_eq_self_iff.2 <| by 

Proof state:
⊢ -π < -π / 2 ∧ -π / 2 ≤ π

Next tactic:
constructor
@[simp]
theorem toReal_neg_pi_div_two : ((-π / 2 : ℝ) : Angle).toReal = -π / 2 :=
  toReal_coe_eq_self_iff.2 <| by constructor <;> 

Proof state:
case left
⊢ -π < -π / 2

Next tactic:
linarith [pi_pos]
@[simp]
theorem toReal_neg_pi_div_two : ((-π / 2 : ℝ) : Angle).toReal = -π / 2 :=
  toReal_coe_eq_self_iff.2 <| by constructor <;> 

Proof state:
case right
⊢ -π / 2 ≤ π

Next tactic:
linarith [pi_pos]
@[simp]
theorem toReal_eq_neg_pi_div_two_iff {θ : Angle} : θ.toReal = -π / 2 ↔ θ = (-π / 2 : ℝ) := by
  

Proof state:
θ : Angle
⊢ toReal θ = -π / 2 ↔ θ = ↑(-π / 2)

Next tactic:
rw [← toReal_inj, toReal_neg_pi_div_two]
theorem pi_div_two_ne_zero : ((π / 2 : ℝ) : Angle) ≠ 0 := by
  

Proof state:
⊢ ↑(π / 2) ≠ 0

Next tactic:
rw [← toReal_injective.ne_iff, toReal_pi_div_two, toReal_zero]
theorem pi_div_two_ne_zero : ((π / 2 : ℝ) : Angle) ≠ 0 := by
  rw [← toReal_injective.ne_iff, toReal_pi_div_two, toReal_zero]
  

Proof state:
⊢ π / 2 ≠ 0

Next tactic:
exact div_ne_zero Real.pi_ne_zero two_ne_zero
theorem neg_pi_div_two_ne_zero : ((-π / 2 : ℝ) : Angle) ≠ 0 := by
  

Proof state:
⊢ ↑(-π / 2) ≠ 0

Next tactic:
rw [← toReal_injective.ne_iff, toReal_neg_pi_div_two, toReal_zero]
theorem neg_pi_div_two_ne_zero : ((-π / 2 : ℝ) : Angle) ≠ 0 := by
  rw [← toReal_injective.ne_iff, toReal_neg_pi_div_two, toReal_zero]
  

Proof state:
⊢ -π / 2 ≠ 0

Next tactic:
exact div_ne_zero (neg_ne_zero.2 Real.pi_ne_zero) two_ne_zero
theorem abs_toReal_neg_coe_eq_self_iff {θ : ℝ} : |(-θ : Angle).toReal| = θ ↔ 0 ≤ θ ∧ θ ≤ π := by
  

Proof state:
θ : ℝ
⊢ |toReal (-↑θ)| = θ ↔ 0 ≤ θ ∧ θ ≤ π

Next tactic:
refine' ⟨fun h => h ▸ ⟨abs_nonneg _, abs_toReal_le_pi _⟩, fun h => _⟩
theorem abs_toReal_neg_coe_eq_self_iff {θ : ℝ} : |(-θ : Angle).toReal| = θ ↔ 0 ≤ θ ∧ θ ≤ π := by
  refine' ⟨fun h => h ▸ ⟨abs_nonneg _, abs_toReal_le_pi _⟩, fun h => _⟩
  

Proof state:
θ : ℝ
h : 0 ≤ θ ∧ θ ≤ π
⊢ |toReal (-↑θ)| = θ

Next tactic:
by_cases hnegpi : θ = π
theorem abs_toReal_neg_coe_eq_self_iff {θ : ℝ} : |(-θ : Angle).toReal| = θ ↔ 0 ≤ θ ∧ θ ≤ π := by
  refine' ⟨fun h => h ▸ ⟨abs_nonneg _, abs_toReal_le_pi _⟩, fun h => _⟩
  by_cases hnegpi : θ = π; · 

Proof state:
case pos
θ : ℝ
h : 0 ≤ θ ∧ θ ≤ π
hnegpi : θ = π
⊢ |toReal (-↑θ)| = θ

Next tactic:
simp [hnegpi, Real.pi_pos.le]
theorem abs_toReal_neg_coe_eq_self_iff {θ : ℝ} : |(-θ : Angle).toReal| = θ ↔ 0 ≤ θ ∧ θ ≤ π := by
  refine' ⟨fun h => h ▸ ⟨abs_nonneg _, abs_toReal_le_pi _⟩, fun h => _⟩
  by_cases hnegpi : θ = π; · simp [hnegpi, Real.pi_pos.le]
  

Proof state:
case neg
θ : ℝ
h : 0 ≤ θ ∧ θ ≤ π
hnegpi : ¬θ = π
⊢ |toReal (-↑θ)| = θ

Next tactic:
rw [← coe_neg,
    toReal_coe_eq_self_iff.2
      ⟨neg_lt_neg (lt_of_le_of_ne h.2 hnegpi), (neg_nonpos.2 h.1).trans Real.pi_pos.le⟩,
    abs_neg, abs_eq_self.2 h.1]
theorem abs_toReal_eq_pi_div_two_iff {θ : Angle} :
    |θ.toReal| = π / 2 ↔ θ = (π / 2 : ℝ) ∨ θ = (-π / 2 : ℝ) := by
  

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

Next tactic:
rw [abs_eq (div_nonneg Real.pi_pos.le two_pos.le), ← neg_div, toReal_eq_pi_div_two_iff,
    toReal_eq_neg_pi_div_two_iff]
theorem nsmul_toReal_eq_mul {n : ℕ} (h : n ≠ 0) {θ : Angle} :
    (n • θ).toReal = n * θ.toReal ↔ θ.toReal ∈ Set.Ioc (-π / n) (π / n) := by
  

Proof state:
n : ℕ
h : n ≠ 0
θ : Angle
⊢ toReal (n • θ) = ↑n * toReal θ ↔ toReal θ ∈ Set.Ioc (-π / ↑n) (π / ↑n)

Next tactic:
nth_rw 1 [← coe_toReal θ]
theorem nsmul_toReal_eq_mul {n : ℕ} (h : n ≠ 0) {θ : Angle} :
    (n • θ).toReal = n * θ.toReal ↔ θ.toReal ∈ Set.Ioc (-π / n) (π / n) := by
  nth_rw 1 [← coe_toReal θ]
  

Proof state:
n : ℕ
h : n ≠ 0
θ : Angle
⊢ toReal (n • ↑(toReal θ)) = ↑n * toReal θ ↔ toReal θ ∈ Set.Ioc (-π / ↑n) (π / ↑n)

Next tactic:
have h' : 0 < (n : ℝ) := mod_cast Nat.pos_of_ne_zero h
theorem nsmul_toReal_eq_mul {n : ℕ} (h : n ≠ 0) {θ : Angle} :
    (n • θ).toReal = n * θ.toReal ↔ θ.toReal ∈ Set.Ioc (-π / n) (π / n) := by
  nth_rw 1 [← coe_toReal θ]
  have h' : 0 < (n : ℝ) := mod_cast Nat.pos_of_ne_zero h
  

Proof state:
n : ℕ
h : n ≠ 0
θ : Angle
h' : 0 < ↑n
⊢ toReal (n • ↑(toReal θ)) = ↑n * toReal θ ↔ toReal θ ∈ Set.Ioc (-π / ↑n) (π / ↑n)

Next tactic:
rw [← coe_nsmul, nsmul_eq_mul, toReal_coe_eq_self_iff, Set.mem_Ioc, div_lt_iff' h',
    le_div_iff' h']
theorem two_zsmul_toReal_eq_two_mul {θ : Angle} :
    ((2 : ℤ) • θ).toReal = 2 * θ.toReal ↔ θ.toReal ∈ Set.Ioc (-π / 2) (π / 2) := by
  

Proof state:
θ : Angle
⊢ toReal (2 • θ) = 2 * toReal θ ↔ toReal θ ∈ Set.Ioc (-π / 2) (π / 2)

Next tactic:
rw [two_zsmul, ← two_nsmul, two_nsmul_toReal_eq_two_mul]
theorem toReal_coe_eq_self_sub_two_mul_int_mul_pi_iff {θ : ℝ} {k : ℤ} :
    (θ : Angle).toReal = θ - 2 * k * π ↔ θ ∈ Set.Ioc ((2 * k - 1 : ℝ) * π) ((2 * k + 1) * π) := by
  

Proof state:
θ : ℝ
k : ℤ
⊢ toReal ↑θ = θ - 2 * ↑k * π ↔ θ ∈ Set.Ioc ((2 * ↑k - 1) * π) ((2 * ↑k + 1) * π)

Next tactic:
rw [← sub_zero (θ : Angle), ← zsmul_zero k, ← coe_two_pi, ← coe_zsmul, ← coe_sub, zsmul_eq_mul, ←
    mul_assoc, mul_comm (k : ℝ), toReal_coe_eq_self_iff, Set.mem_Ioc]
theorem toReal_coe_eq_self_sub_two_mul_int_mul_pi_iff {θ : ℝ} {k : ℤ} :
    (θ : Angle).toReal = θ - 2 * k * π ↔ θ ∈ Set.Ioc ((2 * k - 1 : ℝ) * π) ((2 * k + 1) * π) := by
  rw [← sub_zero (θ : Angle), ← zsmul_zero k, ← coe_two_pi, ← coe_zsmul, ← coe_sub, zsmul_eq_mul, ←
    mul_assoc, mul_comm (k : ℝ), toReal_coe_eq_self_iff, Set.mem_Ioc]
  

Proof state:
θ : ℝ
k : ℤ
⊢ -π < θ - 2 * ↑k * π ∧ θ - 2 * ↑k * π ≤ π ↔ (2 * ↑k - 1) * π < θ ∧ θ ≤ (2 * ↑k + 1) * π

Next tactic:
exact ⟨fun h => ⟨by linarith, by linarith⟩, fun h => ⟨by linarith, by linarith⟩⟩
theorem toReal_coe_eq_self_sub_two_mul_int_mul_pi_iff {θ : ℝ} {k : ℤ} :
    (θ : Angle).toReal = θ - 2 * k * π ↔ θ ∈ Set.Ioc ((2 * k - 1 : ℝ) * π) ((2 * k + 1) * π) := by
  rw [← sub_zero (θ : Angle), ← zsmul_zero k, ← coe_two_pi, ← coe_zsmul, ← coe_sub, zsmul_eq_mul, ←
    mul_assoc, mul_comm (k : ℝ), toReal_coe_eq_self_iff, Set.mem_Ioc]
  exact ⟨fun h => ⟨by 

Proof state:
θ : ℝ
k : ℤ
h : -π < θ - 2 * ↑k * π ∧ θ - 2 * ↑k * π ≤ π
⊢ (2 * ↑k - 1) * π < θ

Next tactic:
linarith
theorem toReal_coe_eq_self_sub_two_mul_int_mul_pi_iff {θ : ℝ} {k : ℤ} :
    (θ : Angle).toReal = θ - 2 * k * π ↔ θ ∈ Set.Ioc ((2 * k - 1 : ℝ) * π) ((2 * k + 1) * π) := by
  rw [← sub_zero (θ : Angle), ← zsmul_zero k, ← coe_two_pi, ← coe_zsmul, ← coe_sub, zsmul_eq_mul, ←
    mul_assoc, mul_comm (k : ℝ), toReal_coe_eq_self_iff, Set.mem_Ioc]
  exact ⟨fun h => ⟨by linarith, by 

Proof state:
θ : ℝ
k : ℤ
h : -π < θ - 2 * ↑k * π ∧ θ - 2 * ↑k * π ≤ π
⊢ θ ≤ (2 * ↑k + 1) * π

Next tactic:
linarith
theorem toReal_coe_eq_self_sub_two_mul_int_mul_pi_iff {θ : ℝ} {k : ℤ} :
    (θ : Angle).toReal = θ - 2 * k * π ↔ θ ∈ Set.Ioc ((2 * k - 1 : ℝ) * π) ((2 * k + 1) * π) := by
  rw [← sub_zero (θ : Angle), ← zsmul_zero k, ← coe_two_pi, ← coe_zsmul, ← coe_sub, zsmul_eq_mul, ←
    mul_assoc, mul_comm (k : ℝ), toReal_coe_eq_self_iff, Set.mem_Ioc]
  exact ⟨fun h => ⟨by linarith, by linarith⟩, fun h => ⟨by 

Proof state:
θ : ℝ
k : ℤ
h : (2 * ↑k - 1) * π < θ ∧ θ ≤ (2 * ↑k + 1) * π
⊢ -π < θ - 2 * ↑k * π

Next tactic:
linarith
theorem toReal_coe_eq_self_sub_two_mul_int_mul_pi_iff {θ : ℝ} {k : ℤ} :
    (θ : Angle).toReal = θ - 2 * k * π ↔ θ ∈ Set.Ioc ((2 * k - 1 : ℝ) * π) ((2 * k + 1) * π) := by
  rw [← sub_zero (θ : Angle), ← zsmul_zero k, ← coe_two_pi, ← coe_zsmul, ← coe_sub, zsmul_eq_mul, ←
    mul_assoc, mul_comm (k : ℝ), toReal_coe_eq_self_iff, Set.mem_Ioc]
  exact ⟨fun h => ⟨by linarith, by linarith⟩, fun h => ⟨by linarith, by 

Proof state:
θ : ℝ
k : ℤ
h : (2 * ↑k - 1) * π < θ ∧ θ ≤ (2 * ↑k + 1) * π
⊢ θ - 2 * ↑k * π ≤ π

Next tactic:
linarith
theorem toReal_coe_eq_self_sub_two_pi_iff {θ : ℝ} :
    (θ : Angle).toReal = θ - 2 * π ↔ θ ∈ Set.Ioc π (3 * π) := by
  

Proof state:
θ : ℝ
⊢ toReal ↑θ = θ - 2 * π ↔ θ ∈ Set.Ioc π (3 * π)

Next tactic:
convert @toReal_coe_eq_self_sub_two_mul_int_mul_pi_iff θ 1
theorem toReal_coe_eq_self_sub_two_pi_iff {θ : ℝ} :
    (θ : Angle).toReal = θ - 2 * π ↔ θ ∈ Set.Ioc π (3 * π) := by
  convert @toReal_coe_eq_self_sub_two_mul_int_mul_pi_iff θ 1 <;> 

Proof state:
case h.e'_1.h.e'_3.h.e'_6.h.e'_5
θ : ℝ
⊢ 2 = 2 * ↑1

Next tactic:
norm_num
theorem toReal_coe_eq_self_sub_two_pi_iff {θ : ℝ} :
    (θ : Angle).toReal = θ - 2 * π ↔ θ ∈ Set.Ioc π (3 * π) := by
  convert @toReal_coe_eq_self_sub_two_mul_int_mul_pi_iff θ 1 <;> 

Proof state:
case h.e'_2.h.e'_5.h.e'_3
θ : ℝ
⊢ π = (2 * ↑1 - 1) * π

Next tactic:
norm_num
theorem toReal_coe_eq_self_sub_two_pi_iff {θ : ℝ} :
    (θ : Angle).toReal = θ - 2 * π ↔ θ ∈ Set.Ioc π (3 * π) := by
  convert @toReal_coe_eq_self_sub_two_mul_int_mul_pi_iff θ 1 <;> 

Proof state:
case h.e'_2.h.e'_5.h.e'_4.h.e'_5
θ : ℝ
⊢ 3 = 2 * ↑1 + 1

Next tactic:
norm_num
theorem toReal_coe_eq_self_add_two_pi_iff {θ : ℝ} :
    (θ : Angle).toReal = θ + 2 * π ↔ θ ∈ Set.Ioc (-3 * π) (-π) := by
  

Proof state:
θ : ℝ
⊢ toReal ↑θ = θ + 2 * π ↔ θ ∈ Set.Ioc (-3 * π) (-π)

Next tactic:
convert @toReal_coe_eq_self_sub_two_mul_int_mul_pi_iff θ (-1) using 2
theorem toReal_coe_eq_self_add_two_pi_iff {θ : ℝ} :
    (θ : Angle).toReal = θ + 2 * π ↔ θ ∈ Set.Ioc (-3 * π) (-π) := by
  convert @toReal_coe_eq_self_sub_two_mul_int_mul_pi_iff θ (-1) using 2 <;> 

Proof state:
case h.e'_1.h.e'_3
θ : ℝ
⊢ θ + 2 * π = θ - 2 * ↑(-1) * π

Next tactic:
norm_num
theorem toReal_coe_eq_self_add_two_pi_iff {θ : ℝ} :
    (θ : Angle).toReal = θ + 2 * π ↔ θ ∈ Set.Ioc (-3 * π) (-π) := by
  convert @toReal_coe_eq_self_sub_two_mul_int_mul_pi_iff θ (-1) using 2 <;> 

Proof state:
case h.e'_2.h.e'_5
θ : ℝ
⊢ Set.Ioc (-3 * π) (-π) = Set.Ioc ((2 * ↑(-1) - 1) * π) ((2 * ↑(-1) + 1) * π)

Next tactic:
norm_num
theorem two_nsmul_toReal_eq_two_mul_sub_two_pi {θ : Angle} :
    ((2 : ℕ) • θ).toReal = 2 * θ.toReal - 2 * π ↔ π / 2 < θ.toReal := by
  

Proof state:
θ : Angle
⊢ toReal (2 • θ) = 2 * toReal θ - 2 * π ↔ π / 2 < toReal θ

Next tactic:
nth_rw 1 [← coe_toReal θ]
theorem two_nsmul_toReal_eq_two_mul_sub_two_pi {θ : Angle} :
    ((2 : ℕ) • θ).toReal = 2 * θ.toReal - 2 * π ↔ π / 2 < θ.toReal := by
  nth_rw 1 [← coe_toReal θ]
  

Proof state:
θ : Angle
⊢ toReal (2 • ↑(toReal θ)) = 2 * toReal θ - 2 * π ↔ π / 2 < toReal θ

Next tactic:
rw [← coe_nsmul, two_nsmul, ← two_mul, toReal_coe_eq_self_sub_two_pi_iff, Set.mem_Ioc]
theorem two_nsmul_toReal_eq_two_mul_sub_two_pi {θ : Angle} :
    ((2 : ℕ) • θ).toReal = 2 * θ.toReal - 2 * π ↔ π / 2 < θ.toReal := by
  nth_rw 1 [← coe_toReal θ]
  rw [← coe_nsmul, two_nsmul, ← two_mul, toReal_coe_eq_self_sub_two_pi_iff, Set.mem_Ioc]
  

Proof state:
θ : Angle
⊢ π < 2 * toReal θ ∧ 2 * toReal θ ≤ 3 * π ↔ π / 2 < toReal θ

Next tactic:
exact
    ⟨fun h => by linarith, fun h =>
      ⟨(div_lt_iff' (zero_lt_two' ℝ)).1 h, by linarith [pi_pos, toReal_le_pi θ]⟩⟩
theorem two_nsmul_toReal_eq_two_mul_sub_two_pi {θ : Angle} :
    ((2 : ℕ) • θ).toReal = 2 * θ.toReal - 2 * π ↔ π / 2 < θ.toReal := by
  nth_rw 1 [← coe_toReal θ]
  rw [← coe_nsmul, two_nsmul, ← two_mul, toReal_coe_eq_self_sub_two_pi_iff, Set.mem_Ioc]
  exact
    ⟨fun h => by 

Proof state:
θ : Angle
h : π < 2 * toReal θ ∧ 2 * toReal θ ≤ 3 * π
⊢ π / 2 < toReal θ

Next tactic:
linarith
theorem two_nsmul_toReal_eq_two_mul_sub_two_pi {θ : Angle} :
    ((2 : ℕ) • θ).toReal = 2 * θ.toReal - 2 * π ↔ π / 2 < θ.toReal := by
  nth_rw 1 [← coe_toReal θ]
  rw [← coe_nsmul, two_nsmul, ← two_mul, toReal_coe_eq_self_sub_two_pi_iff, Set.mem_Ioc]
  exact
    ⟨fun h => by linarith, fun h =>
      ⟨(div_lt_iff' (zero_lt_two' ℝ)).1 h, by 

Proof state:
θ : Angle
h : π / 2 < toReal θ
⊢ 2 * toReal θ ≤ 3 * π

Next tactic:
linarith [pi_pos, toReal_le_pi θ]
theorem two_zsmul_toReal_eq_two_mul_sub_two_pi {θ : Angle} :
    ((2 : ℤ) • θ).toReal = 2 * θ.toReal - 2 * π ↔ π / 2 < θ.toReal := by
  

Proof state:
θ : Angle
⊢ toReal (2 • θ) = 2 * toReal θ - 2 * π ↔ π / 2 < toReal θ

Next tactic:
rw [two_zsmul, ← two_nsmul, two_nsmul_toReal_eq_two_mul_sub_two_pi]
theorem two_nsmul_toReal_eq_two_mul_add_two_pi {θ : Angle} :
    ((2 : ℕ) • θ).toReal = 2 * θ.toReal + 2 * π ↔ θ.toReal ≤ -π / 2 := by
  

Proof state:
θ : Angle
⊢ toReal (2 • θ) = 2 * toReal θ + 2 * π ↔ toReal θ ≤ -π / 2

Next tactic:
nth_rw 1 [← coe_toReal θ]
theorem two_nsmul_toReal_eq_two_mul_add_two_pi {θ : Angle} :
    ((2 : ℕ) • θ).toReal = 2 * θ.toReal + 2 * π ↔ θ.toReal ≤ -π / 2 := by
  nth_rw 1 [← coe_toReal θ]
  

Proof state:
θ : Angle
⊢ toReal (2 • ↑(toReal θ)) = 2 * toReal θ + 2 * π ↔ toReal θ ≤ -π / 2

Next tactic:
rw [← coe_nsmul, two_nsmul, ← two_mul, toReal_coe_eq_self_add_two_pi_iff, Set.mem_Ioc]
theorem two_nsmul_toReal_eq_two_mul_add_two_pi {θ : Angle} :
    ((2 : ℕ) • θ).toReal = 2 * θ.toReal + 2 * π ↔ θ.toReal ≤ -π / 2 := by
  nth_rw 1 [← coe_toReal θ]
  rw [← coe_nsmul, two_nsmul, ← two_mul, toReal_coe_eq_self_add_two_pi_iff, Set.mem_Ioc]
  

Proof state:
θ : Angle
⊢ -3 * π < 2 * toReal θ ∧ 2 * toReal θ ≤ -π ↔ toReal θ ≤ -π / 2

Next tactic:
refine'
    ⟨fun h => by linarith, fun h =>
      ⟨by linarith [pi_pos, neg_pi_lt_toReal θ], (le_div_iff' (zero_lt_two' ℝ)).1 h⟩⟩
theorem two_nsmul_toReal_eq_two_mul_add_two_pi {θ : Angle} :
    ((2 : ℕ) • θ).toReal = 2 * θ.toReal + 2 * π ↔ θ.toReal ≤ -π / 2 := by
  nth_rw 1 [← coe_toReal θ]
  rw [← coe_nsmul, two_nsmul, ← two_mul, toReal_coe_eq_self_add_two_pi_iff, Set.mem_Ioc]
  refine'
    ⟨fun h => by 

Proof state:
θ : Angle
h : -3 * π < 2 * toReal θ ∧ 2 * toReal θ ≤ -π
⊢ toReal θ ≤ -π / 2

Next tactic:
linarith
theorem two_nsmul_toReal_eq_two_mul_add_two_pi {θ : Angle} :
    ((2 : ℕ) • θ).toReal = 2 * θ.toReal + 2 * π ↔ θ.toReal ≤ -π / 2 := by
  nth_rw 1 [← coe_toReal θ]
  rw [← coe_nsmul, two_nsmul, ← two_mul, toReal_coe_eq_self_add_two_pi_iff, Set.mem_Ioc]
  refine'
    ⟨fun h => by linarith, fun h =>
      ⟨by 

Proof state:
θ : Angle
h : toReal θ ≤ -π / 2
⊢ -3 * π < 2 * toReal θ

Next tactic:
linarith [pi_pos, neg_pi_lt_toReal θ]
theorem two_zsmul_toReal_eq_two_mul_add_two_pi {θ : Angle} :
    ((2 : ℤ) • θ).toReal = 2 * θ.toReal + 2 * π ↔ θ.toReal ≤ -π / 2 := by
  

Proof state:
θ : Angle
⊢ toReal (2 • θ) = 2 * toReal θ + 2 * π ↔ toReal θ ≤ -π / 2

Next tactic:
rw [two_zsmul, ← two_nsmul, two_nsmul_toReal_eq_two_mul_add_two_pi]
@[simp]
theorem sin_toReal (θ : Angle) : Real.sin θ.toReal = sin θ := by
  

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

Next tactic:
conv_rhs => rw [← coe_toReal θ, sin_coe]
@[simp]
theorem sin_toReal (θ : Angle) : Real.sin θ.toReal = sin θ := by
  conv_rhs => 

Proof state:
θ : Angle
| sin θ

Next tactic:
rw [← coe_toReal θ, sin_coe]
@[simp]
theorem cos_toReal (θ : Angle) : Real.cos θ.toReal = cos θ := by
  

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

Next tactic:
conv_rhs => rw [← coe_toReal θ, cos_coe]
@[simp]
theorem cos_toReal (θ : Angle) : Real.cos θ.toReal = cos θ := by
  conv_rhs => 

Proof state:
θ : Angle
| cos θ

Next tactic:
rw [← coe_toReal θ, cos_coe]
theorem cos_nonneg_iff_abs_toReal_le_pi_div_two {θ : Angle} : 0 ≤ cos θ ↔ |θ.toReal| ≤ π / 2 := by
  

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

Next tactic:
nth_rw 1 [← coe_toReal θ]
theorem cos_nonneg_iff_abs_toReal_le_pi_div_two {θ : Angle} : 0 ≤ cos θ ↔ |θ.toReal| ≤ π / 2 := by
  nth_rw 1 [← coe_toReal θ]
  

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

Next tactic:
rw [abs_le, cos_coe]