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

tactic: by_cases hpi : θ = π
state_before: θ : Angle
⊢ (2 • θ).sign = θ.sign ↔ θ = ↑π ∨ |θ.toReal| < π / 2
state_after: case pos
θ : Angle
hpi : θ = ↑π
⊢ (2 • θ).sign = θ.sign ↔ θ = ↑π ∨ |θ.toReal| < π / 2

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

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

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

case neg.refine_2
θ : Angle
hpi : ¬θ = ↑π
h : |θ.toReal| < π / 2
⊢ (2 • θ).sign = θ.sign

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

tactic: by_contra hle
state_before: case neg.refine_1
θ : Angle
hpi : ¬θ = ↑π
h : (2 • θ).sign = θ.sign
⊢ |θ.toReal| < π / 2
state_after: case neg.refine_1
θ : Angle
hpi : ¬θ = ↑π
h : (2 • θ).sign = θ.sign
hle : ¬|θ.toReal| < π / 2
⊢ False

tactic: rw [not_lt, le_abs, le_neg] at hle
state_before: case neg.refine_1
θ : Angle
hpi : ¬θ = ↑π
h : (2 • θ).sign = θ.sign
hle : ¬|θ.toReal| < π / 2
⊢ False
state_after: case neg.refine_1
θ : Angle
hpi : ¬θ = ↑π
h : (2 • θ).sign = θ.sign
hle : π / 2 ≤ θ.toReal ∨ θ.toReal ≤ -(π / 2)
⊢ False

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

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

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

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

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

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

tactic: rw [← coe_toReal θ, ← heq] at h
state_before: case neg.refine_1.inl.inl
θ : Angle
hpi : ¬θ = ↑π
h : (2 • θ).sign = θ.sign
hpi' : θ.toReal ≠ π
hle : π / 2 ≤ θ.toReal
heq : π / 2 = θ.toReal
⊢ False
state_after: case neg.refine_1.inl.inl
θ : Angle
hpi : ¬θ = ↑π
h : (2 • ↑(π / 2)).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 : (2 • ↑(π / 2)).sign = (↑(π / 2)).sign
hpi' : θ.toReal ≠ π
hle : π / 2 ≤ θ.toReal
heq : π / 2 = θ.toReal
⊢ False
state_after: no goals

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

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

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

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
state_after: no goals

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
state_after: 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: 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
state_after: no goals

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

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

tactic: rw [← coe_toReal θ, heq] at h
state_before: case neg.refine_1.inr.inl
θ : Angle
hpi : ¬θ = ↑π
h : (2 • θ).sign = θ.sign
hpi' : θ.toReal ≠ π
hle : θ.toReal ≤ -(π / 2)
heq : θ.toReal = -(π / 2)
⊢ False
state_after: case neg.refine_1.inr.inl
θ : Angle
hpi : ¬θ = ↑π
h : (2 • ↑(-(π / 2))).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 : (2 • ↑(-(π / 2))).sign = (↑(-(π / 2))).sign
hpi' : θ.toReal ≠ π
hle : θ.toReal ≤ -(π / 2)
heq : θ.toReal = -(π / 2)
⊢ False
state_after: no goals

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

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

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

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

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

tactic: rw [← neg_div] at hlt
state_before: case neg.refine_1.inr.inr
θ : Angle
hpi : ¬θ = ↑π
h : SignType.sign (2 • θ).toReal = -1
hpi' : θ.toReal ≠ π
hle : θ.toReal ≤ -(π / 2)
hlt : θ.toReal < -(π / 2)
⊢ False
state_after: case neg.refine_1.inr.inr
θ : Angle
hpi : ¬θ = ↑π
h : SignType.sign (2 • θ).toReal = -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 (2 • θ).toReal = -1
hpi' : θ.toReal ≠ π
hle : θ.toReal ≤ -(π / 2)
hlt : θ.toReal < -π / 2
⊢ False
state_after: case neg.refine_1.inr.inr
θ : Angle
hpi : ¬θ = ↑π
h : 1 = -1
hpi' : θ.toReal ≠ π
hle : θ.toReal ≤ -(π / 2)
hlt : θ.toReal < -π / 2
⊢ False

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

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

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
state_after: no goals

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 * π
state_after: no goals

tactic: rw [abs_lt, ← neg_div] at h
state_before: case neg.refine_2
θ : Angle
hpi : ¬θ = ↑π
h : |θ.toReal| < π / 2
hpi' : 2 • θ ≠ ↑π
⊢ (2 • θ).sign = θ.sign
state_after: case neg.refine_2
θ : Angle
hpi : ¬θ = ↑π
h : -π / 2 < θ.toReal ∧ θ.toReal < π / 2
hpi' : 2 • θ ≠ ↑π
⊢ (2 • θ).sign = θ.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 • θ ≠ ↑π
⊢ (2 • θ).sign = θ.sign
state_after: no goals

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

tactic: constructor
state_before: θ : Angle
hpi : ¬θ = ↑π
h : |θ.toReal| < π / 2
⊢ ¬θ = ↑(π / 2) ∧ ¬θ = ↑(-π / 2)
state_after: case left
θ : Angle
hpi : ¬θ = ↑π
h : |θ.toReal| < π / 2
⊢ ¬θ = ↑(π / 2)

case right
θ : Angle
hpi : ¬θ = ↑π
h : |θ.toReal| < π / 2
⊢ ¬θ = ↑(-π / 2)

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

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

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

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

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