Theorem: Real.Angle.sign_two_nsmul_eq_sign_iff
File: Mathlib/Analysis/SpecialFunctions/Trigonometric/Angle.lean

tactic: by_cases hpi : θ = π
state_before: θ : Angle
⊢ sign (2 • θ) = sign θ ↔ θ = ↑π ∨ abs (toReal θ) < π / 2

tactic: rw [or_iff_right hpi]
state_before: case neg
θ : Angle
hpi : ¬θ = ↑π
⊢ sign (2 • θ) = sign θ ↔ θ = ↑π ∨ abs (toReal θ) < π / 2

tactic: refine' ⟨fun h => _, fun h => _⟩
state_before: case neg
θ : Angle
hpi : ¬θ = ↑π
⊢ sign (2 • θ) = sign θ ↔ abs (toReal θ) < π / 2

tactic: simp [hpi]
state_before: case pos
θ : Angle
hpi : θ = ↑π
⊢ sign (2 • θ) = sign θ ↔ θ = ↑π ∨ abs (toReal θ) < π / 2

tactic: by_contra hle
state_before: case neg.refine'_1
θ : Angle
hpi : ¬θ = ↑π
h : sign (2 • θ) = sign θ
⊢ abs (toReal θ) < π / 2

tactic: rw [not_lt, le_abs, le_neg] at hle
state_before: case neg.refine'_1
θ : Angle
hpi : ¬θ = ↑π
h : sign (2 • θ) = sign θ
hle : ¬abs (toReal θ) < π / 2
⊢ False

tactic: have hpi' : θ.toReal ≠ π := by simpa using hpi
state_before: case neg.refine'_1
θ : Angle
hpi : ¬θ = ↑π
h : sign (2 • θ) = sign θ
hle : π / 2 ≤ toReal θ ∨ toReal θ ≤ -(π / 2)
⊢ False

tactic: rcases hle with (hle | hle) <;> rcases hle.eq_or_lt with (heq | hlt)
state_before: case neg.refine'_1
θ : Angle
hpi : ¬θ = ↑π
h : sign (2 • θ) = sign θ
hle : π / 2 ≤ toReal θ ∨ toReal θ ≤ -(π / 2)
hpi' : toReal θ ≠ π
⊢ False

tactic: simpa using hpi
state_before: θ : Angle
hpi : ¬θ = ↑π
h : sign (2 • θ) = sign θ
hle : π / 2 ≤ toReal θ ∨ toReal θ ≤ -(π / 2)
⊢ toReal θ ≠ π

tactic: rw [← coe_toReal θ, ← heq] at h
state_before: case neg.refine'_1.inl.inl
θ : Angle
hpi : ¬θ = ↑π
h : sign (2 • θ) = sign θ
hpi' : toReal θ ≠ π
hle : π / 2 ≤ toReal θ
heq : π / 2 = toReal θ
⊢ False

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

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
state_before: case neg.refine'_1.inl.inr
θ : Angle
hpi : ¬θ = ↑π
h : sign (2 • θ) = sign θ
hpi' : toReal θ ≠ π
hle : π / 2 ≤ toReal θ
hlt : π / 2 < toReal θ
⊢ False

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

tactic: rw [← mul_sub]
state_before: 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

tactic: exact mul_neg_of_pos_of_neg two_pos (sub_neg.2 ((toReal_le_pi _).lt_of_ne hpi'))
state_before: 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

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

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

tactic: rw [← coe_toReal θ, heq] at h
state_before: case neg.refine'_1.inr.inl
θ : Angle
hpi : ¬θ = ↑π
h : sign (2 • θ) = sign θ
hpi' : toReal θ ≠ π
hle : toReal θ ≤ -(π / 2)
heq : toReal θ = -(π / 2)
⊢ False

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

tactic: rw [← sign_toReal hpi, _root_.sign_neg (hlt.trans (Left.neg_neg_iff.2 pi_div_two_pos)), ←
  sign_toReal] at h
state_before: case neg.refine'_1.inr.inr
θ : Angle
hpi : ¬θ = ↑π
h : sign (2 • θ) = sign θ
hpi' : toReal θ ≠ π
hle : toReal θ ≤ -(π / 2)
hlt : toReal θ < -(π / 2)
⊢ False

tactic: swap
state_before: case neg.refine'_1.inr.inr
θ : Angle
hpi : ¬θ = ↑π
h : ↑SignType.sign (toReal (2 • θ)) = -1
hpi' : toReal θ ≠ π
hle : toReal θ ≤ -(π / 2)
hlt : toReal θ < -(π / 2)
⊢ False

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

tactic: rw [← neg_div] at hlt
state_before: case neg.refine'_1.inr.inr
θ : Angle
hpi : ¬θ = ↑π
h : ↑SignType.sign (toReal (2 • θ)) = -1
hpi' : toReal θ ≠ π
hle : toReal θ ≤ -(π / 2)
hlt : toReal θ < -(π / 2)
⊢ False

tactic: rw [two_nsmul_toReal_eq_two_mul_add_two_pi.2 hlt.le, sign_pos] at h
state_before: case neg.refine'_1.inr.inr
θ : Angle
hpi : ¬θ = ↑π
h : ↑SignType.sign (toReal (2 • θ)) = -1
hpi' : toReal θ ≠ π
hle : toReal θ ≤ -(π / 2)
hlt : toReal θ < -π / 2
⊢ False

tactic: intro he
state_before: case neg.refine'_1.inr.inr
θ : Angle
hpi : ¬θ = ↑π
h : sign (2 • θ) = -1
hpi' : toReal θ ≠ π
hle : toReal θ ≤ -(π / 2)
hlt : toReal θ < -(π / 2)
⊢ 2 • θ ≠ ↑π

tactic: simp [he] at h
state_before: case neg.refine'_1.inr.inr
θ : Angle
hpi : ¬θ = ↑π
h : sign (2 • θ) = -1
hpi' : toReal θ ≠ π
hle : toReal θ ≤ -(π / 2)
hlt : toReal θ < -(π / 2)
he : 2 • θ = ↑π
⊢ False

tactic: simp at h
state_before: case neg.refine'_1.inr.inr
θ : Angle
hpi : ¬θ = ↑π
h : 1 = -1
hpi' : toReal θ ≠ π
hle : toReal θ ≤ -(π / 2)
hlt : toReal θ < -π / 2
⊢ False

tactic: linarith [neg_pi_lt_toReal θ]
state_before: case neg.refine'_1.inr.inr
θ : Angle
hpi : ¬θ = ↑π
h : ↑SignType.sign (2 * toReal θ + 2 * π) = -1
hpi' : toReal θ ≠ π
hle : toReal θ ≤ -(π / 2)
hlt : toReal θ < -π / 2
⊢ 0 < 2 * toReal θ + 2 * π

tactic: rw [abs_lt, ← neg_div] at h
state_before: case neg.refine'_2
θ : Angle
hpi : ¬θ = ↑π
h : abs (toReal θ) < π / 2
hpi' : 2 • θ ≠ ↑π
⊢ sign (2 • θ) = sign θ

tactic: rw [← sign_toReal hpi, ← sign_toReal hpi', two_nsmul_toReal_eq_two_mul.2 ⟨h.1, h.2.le⟩,
  sign_mul, sign_pos (zero_lt_two' ℝ), one_mul]
state_before: case neg.refine'_2
θ : Angle
hpi : ¬θ = ↑π
h : -π / 2 < toReal θ ∧ toReal θ < π / 2
hpi' : 2 • θ ≠ ↑π
⊢ sign (2 • θ) = sign θ

tactic: rw [Ne.def, two_nsmul_eq_pi_iff, not_or]
state_before: θ : Angle
hpi : ¬θ = ↑π
h : abs (toReal θ) < π / 2
⊢ 2 • θ ≠ ↑π

tactic: constructor
state_before: θ : Angle
hpi : ¬θ = ↑π
h : abs (toReal θ) < π / 2
⊢ ¬θ = ↑(π / 2) ∧ ¬θ = ↑(-π / 2)

tactic: rintro rfl
state_before: case left
θ : Angle
hpi : ¬θ = ↑π
h : abs (toReal θ) < π / 2
⊢ ¬θ = ↑(π / 2)

tactic: simp [pi_pos, div_pos, abs_of_pos] at h
state_before: case left
hpi : ¬↑(π / 2) = ↑π
h : abs (toReal ↑(π / 2)) < π / 2
⊢ False

tactic: rintro rfl
state_before: case right
θ : Angle
hpi : ¬θ = ↑π
h : abs (toReal θ) < π / 2
⊢ ¬θ = ↑(-π / 2)

tactic: rw [toReal_neg_pi_div_two] at h
state_before: case right
hpi : ¬↑(-π / 2) = ↑π
h : abs (toReal ↑(-π / 2)) < π / 2
⊢ False

tactic: simp [pi_pos, div_pos, neg_div, abs_of_pos] at h
state_before: case right
hpi : ¬↑(-π / 2) = ↑π
h : abs (-π / 2) < π / 2
⊢ False