Theorem: Complex.cos_ne_zero_of_arctan_bounds
File: Mathlib/Analysis/SpecialFunctions/Complex/Arctan.lean

tactic: refine cos_ne_zero_iff.mpr (fun k ↦ ?_)
state_before: z : ℂ
h₀ : z ≠ ↑π / 2
h₁ : -(π / 2) < z.re
h₂ : z.re ≤ π / 2
⊢ cos z ≠ 0
state_after: z : ℂ
h₀ : z ≠ ↑π / 2
h₁ : -(π / 2) < z.re
h₂ : z.re ≤ π / 2
k : ℤ
⊢ z ≠ (2 * ↑k + 1) * ↑π / 2

tactic: rw [ne_eq, ext_iff, not_and_or] at h₀ ⊢
state_before: z : ℂ
h₀ : z ≠ ↑π / 2
h₁ : -(π / 2) < z.re
h₂ : z.re ≤ π / 2
k : ℤ
⊢ z ≠ (2 * ↑k + 1) * ↑π / 2
state_after: z : ℂ
h₀ : ¬z.re = (↑π / 2).re ∨ ¬z.im = (↑π / 2).im
h₁ : -(π / 2) < z.re
h₂ : z.re ≤ π / 2
k : ℤ
⊢ ¬z.re = ((2 * ↑k + 1) * ↑π / 2).re ∨ ¬z.im = ((2 * ↑k + 1) * ↑π / 2).im

tactic: norm_cast at h₀ ⊢
state_before: z : ℂ
h₀ : ¬z.re = (↑π / 2).re ∨ ¬z.im = (↑π / 2).im
h₁ : -(π / 2) < z.re
h₂ : z.re ≤ π / 2
k : ℤ
⊢ ¬z.re = ((2 * ↑k + 1) * ↑π / 2).re ∨ ¬z.im = ((2 * ↑k + 1) * ↑π / 2).im
state_after: z : ℂ
h₁ : -(π / 2) < z.re
h₂ : z.re ≤ π / 2
k : ℤ
h₀ : ¬z.re = π / 2 ∨ ¬z.im = 0
⊢ ¬z.re = ↑(2 * k + 1) * π / 2 ∨ ¬z.im = 0

tactic: cases' h₀ with nr ni
state_before: z : ℂ
h₁ : -(π / 2) < z.re
h₂ : z.re ≤ π / 2
k : ℤ
h₀ : ¬z.re = π / 2 ∨ ¬z.im = 0
⊢ ¬z.re = ↑(2 * k + 1) * π / 2 ∨ ¬z.im = 0
state_after: case inl
z : ℂ
h₁ : -(π / 2) < z.re
h₂ : z.re ≤ π / 2
k : ℤ
nr : ¬z.re = π / 2
⊢ ¬z.re = ↑(2 * k + 1) * π / 2 ∨ ¬z.im = 0

case inr
z : ℂ
h₁ : -(π / 2) < z.re
h₂ : z.re ≤ π / 2
k : ℤ
ni : ¬z.im = 0
⊢ ¬z.re = ↑(2 * k + 1) * π / 2 ∨ ¬z.im = 0

tactic: left
state_before: case inl
z : ℂ
h₁ : -(π / 2) < z.re
h₂ : z.re ≤ π / 2
k : ℤ
nr : ¬z.re = π / 2
⊢ ¬z.re = ↑(2 * k + 1) * π / 2 ∨ ¬z.im = 0
state_after: case inl.h
z : ℂ
h₁ : -(π / 2) < z.re
h₂ : z.re ≤ π / 2
k : ℤ
nr : ¬z.re = π / 2
⊢ ¬z.re = ↑(2 * k + 1) * π / 2

tactic: contrapose! nr
state_before: case inl.h
z : ℂ
h₁ : -(π / 2) < z.re
h₂ : z.re ≤ π / 2
k : ℤ
nr : ¬z.re = π / 2
⊢ ¬z.re = ↑(2 * k + 1) * π / 2
state_after: case inl.h
z : ℂ
h₁ : -(π / 2) < z.re
h₂ : z.re ≤ π / 2
k : ℤ
nr : z.re = ↑(2 * k + 1) * π / 2
⊢ z.re = π / 2

tactic: rw [nr, mul_div_assoc, neg_eq_neg_one_mul, mul_lt_mul_iff_of_pos_right (by positivity)] at h₁
state_before: case inl.h
z : ℂ
h₁ : -(π / 2) < z.re
h₂ : z.re ≤ π / 2
k : ℤ
nr : z.re = ↑(2 * k + 1) * π / 2
⊢ z.re = π / 2
state_after: case inl.h
z : ℂ
h₂ : z.re ≤ π / 2
k : ℤ
h₁ : -1 < ↑(2 * k + 1)
nr : z.re = ↑(2 * k + 1) * π / 2
⊢ z.re = π / 2

tactic: rw [nr, ← one_mul (π / 2), mul_div_assoc, mul_le_mul_iff_of_pos_right (by positivity)] at h₂
state_before: case inl.h
z : ℂ
h₂ : z.re ≤ π / 2
k : ℤ
h₁ : -1 < ↑(2 * k + 1)
nr : z.re = ↑(2 * k + 1) * π / 2
⊢ z.re = π / 2
state_after: case inl.h
z : ℂ
k : ℤ
h₂ : ↑(2 * k + 1) ≤ 1
h₁ : -1 < ↑(2 * k + 1)
nr : z.re = ↑(2 * k + 1) * π / 2
⊢ z.re = π / 2

tactic: norm_cast at h₁ h₂
state_before: case inl.h
z : ℂ
k : ℤ
h₂ : ↑(2 * k + 1) ≤ 1
h₁ : -1 < ↑(2 * k + 1)
nr : z.re = ↑(2 * k + 1) * π / 2
⊢ z.re = π / 2
state_after: case inl.h
z : ℂ
k : ℤ
nr : z.re = ↑(2 * k + 1) * π / 2
h₁ : Int.negSucc 0 < 2 * k + 1
h₂ : 2 * k + 1 ≤ 1
⊢ z.re = π / 2

tactic: change -1 < _ at h₁
state_before: case inl.h
z : ℂ
k : ℤ
nr : z.re = ↑(2 * k + 1) * π / 2
h₁ : Int.negSucc 0 < 2 * k + 1
h₂ : 2 * k + 1 ≤ 1
⊢ z.re = π / 2
state_after: case inl.h
z : ℂ
k : ℤ
nr : z.re = ↑(2 * k + 1) * π / 2
h₂ : 2 * k + 1 ≤ 1
h₁ : -1 < 2 * k + 1
⊢ z.re = π / 2

tactic: rwa [show 2 * k + 1 = 1 by omega, Int.cast_one, one_mul] at nr
state_before: case inl.h
z : ℂ
k : ℤ
nr : z.re = ↑(2 * k + 1) * π / 2
h₂ : 2 * k + 1 ≤ 1
h₁ : -1 < 2 * k + 1
⊢ z.re = π / 2
state_after: no goals

tactic: positivity
state_before: z : ℂ
h₂ : z.re ≤ π / 2
k : ℤ
h₁ : -1 * (π / 2) < ↑(2 * k + 1) * (π / 2)
nr : z.re = ↑(2 * k + 1) * π / 2
⊢ 0 < π / 2
state_after: no goals

tactic: positivity
state_before: z : ℂ
k : ℤ
h₂ : ↑(2 * k + 1) * (π / 2) ≤ 1 * (π / 2)
h₁ : -1 < ↑(2 * k + 1)
nr : z.re = ↑(2 * k + 1) * π / 2
⊢ 0 < π / 2
state_after: no goals

tactic: omega
state_before: z : ℂ
k : ℤ
nr : z.re = ↑(2 * k + 1) * π / 2
h₂ : 2 * k + 1 ≤ 1
h₁ : -1 < 2 * k + 1
⊢ 2 * k + 1 = 1
state_after: no goals

tactic: exact Or.inr ni
state_before: case inr
z : ℂ
h₁ : -(π / 2) < z.re
h₂ : z.re ≤ π / 2
k : ℤ
ni : ¬z.im = 0
⊢ ¬z.re = ↑(2 * k + 1) * π / 2 ∨ ¬z.im = 0
state_after: no goals