Theorem: Complex.norm_sub_mem_Icc_angle
File: Mathlib/Analysis/Complex/Angle.lean

tactic: clear a
state_before: a x y : ℂ
hx : ‖x‖ = 1
hy : ‖y‖ = 1
⊢ ‖x - y‖ ∈ Icc (2 / π * angle x y) (angle x y)
state_after: x y : ℂ
hx : ‖x‖ = 1
hy : ‖y‖ = 1
⊢ ‖x - y‖ ∈ Icc (2 / π * angle x y) (angle x y)

tactic: wlog h : y = 1
state_before: x y : ℂ
hx : ‖x‖ = 1
hy : ‖y‖ = 1
⊢ ‖x - y‖ ∈ Icc (2 / π * angle x y) (angle x y)
state_after: case inr
x y : ℂ
hx : ‖x‖ = 1
hy : ‖y‖ = 1
this : ∀ {x y : ℂ}, ‖x‖ = 1 → ‖y‖ = 1 → y = 1 → ‖x - y‖ ∈ Icc (2 / π * angle x y) (angle x y)
h : ¬y = 1
⊢ ‖x - y‖ ∈ Icc (2 / π * angle x y) (angle x y)

x✝ y✝ x y : ℂ
hx : ‖x‖ = 1
hy : ‖y‖ = 1
h : y = 1
⊢ ‖x - y‖ ∈ Icc (2 / π * angle x y) (angle x y)

tactic: subst y
state_before: x✝ y✝ x y : ℂ
hx : ‖x‖ = 1
hy : ‖y‖ = 1
h : y = 1
⊢ ‖x - y‖ ∈ Icc (2 / π * angle x y) (angle x y)
state_after: x✝ y x : ℂ
hx : ‖x‖ = 1
hy : ‖1‖ = 1
⊢ ‖x - 1‖ ∈ Icc (2 / π * angle x 1) (angle x 1)

tactic: rw [norm_eq_abs, abs_eq_one_iff'] at hx
state_before: x✝ y x : ℂ
hx : ‖x‖ = 1
hy : ‖1‖ = 1
⊢ ‖x - 1‖ ∈ Icc (2 / π * angle x 1) (angle x 1)
state_after: x✝ y x : ℂ
hx : ∃ θ ∈ Ioc (-π) π, cexp (↑θ * I) = x
hy : ‖1‖ = 1
⊢ ‖x - 1‖ ∈ Icc (2 / π * angle x 1) (angle x 1)

tactic: obtain ⟨θ, hθ, rfl⟩ := hx
state_before: x✝ y x : ℂ
hx : ∃ θ ∈ Ioc (-π) π, cexp (↑θ * I) = x
hy : ‖1‖ = 1
⊢ ‖x - 1‖ ∈ Icc (2 / π * angle x 1) (angle x 1)
state_after: case intro.intro
x y : ℂ
hy : ‖1‖ = 1
θ : ℝ
hθ : θ ∈ Ioc (-π) π
⊢ ‖cexp (↑θ * I) - 1‖ ∈ Icc (2 / π * angle (cexp (↑θ * I)) 1) (angle (cexp (↑θ * I)) 1)

tactic: rw [angle_exp_one, exp_mul_I, add_sub_right_comm, (toIocMod_eq_self _).2]
state_before: case intro.intro
x y : ℂ
hy : ‖1‖ = 1
θ : ℝ
hθ : θ ∈ Ioc (-π) π
⊢ ‖cexp (↑θ * I) - 1‖ ∈ Icc (2 / π * angle (cexp (↑θ * I)) 1) (angle (cexp (↑θ * I)) 1)
state_after: case intro.intro
x y : ℂ
hy : ‖1‖ = 1
θ : ℝ
hθ : θ ∈ Ioc (-π) π
⊢ ‖cos ↑θ - 1 + sin ↑θ * I‖ ∈ Icc (2 / π * |θ|) |θ|

case intro.intro
x y : ℂ
hy : ‖1‖ = 1
θ : ℝ
hθ : θ ∈ Ioc (-π) π
⊢ θ ∈ Ioc (-π) (-π + 2 * π)

tactic: have := @this (x / y) 1 (by simp only [norm_div, hx, hy, div_one]) norm_one rfl
state_before: case inr
x y : ℂ
hx : ‖x‖ = 1
hy : ‖y‖ = 1
this : ∀ {x y : ℂ}, ‖x‖ = 1 → ‖y‖ = 1 → y = 1 → ‖x - y‖ ∈ Icc (2 / π * angle x y) (angle x y)
h : ¬y = 1
⊢ ‖x - y‖ ∈ Icc (2 / π * angle x y) (angle x y)
state_after: case inr
x y : ℂ
hx : ‖x‖ = 1
hy : ‖y‖ = 1
this✝ : ∀ {x y : ℂ}, ‖x‖ = 1 → ‖y‖ = 1 → y = 1 → ‖x - y‖ ∈ Icc (2 / π * angle x y) (angle x y)
h : ¬y = 1
this : ‖x / y - 1‖ ∈ Icc (2 / π * angle (x / y) 1) (angle (x / y) 1)
⊢ ‖x - y‖ ∈ Icc (2 / π * angle x y) (angle x y)

tactic: rwa [angle_div_left_eq_angle_mul_right, div_sub_one, norm_div, hy, div_one, one_mul]
  at this
state_before: case inr
x y : ℂ
hx : ‖x‖ = 1
hy : ‖y‖ = 1
this✝ : ∀ {x y : ℂ}, ‖x‖ = 1 → ‖y‖ = 1 → y = 1 → ‖x - y‖ ∈ Icc (2 / π * angle x y) (angle x y)
h : ¬y = 1
this : ‖x / y - 1‖ ∈ Icc (2 / π * angle (x / y) 1) (angle (x / y) 1)
⊢ ‖x - y‖ ∈ Icc (2 / π * angle x y) (angle x y)
state_after: case inr
x y : ℂ
hx : ‖x‖ = 1
hy : ‖y‖ = 1
this✝ : ∀ {x y : ℂ}, ‖x‖ = 1 → ‖y‖ = 1 → y = 1 → ‖x - y‖ ∈ Icc (2 / π * angle x y) (angle x y)
h : ¬y = 1
this : ‖x / y - 1‖ ∈ Icc (2 / π * angle x (1 * y)) (angle x (1 * y))
⊢ y ≠ 0

tactic: rintro rfl
state_before: case inr
x y : ℂ
hx : ‖x‖ = 1
hy : ‖y‖ = 1
this✝ : ∀ {x y : ℂ}, ‖x‖ = 1 → ‖y‖ = 1 → y = 1 → ‖x - y‖ ∈ Icc (2 / π * angle x y) (angle x y)
h : ¬y = 1
this : ‖x / y - 1‖ ∈ Icc (2 / π * angle x (1 * y)) (angle x (1 * y))
⊢ y ≠ 0
state_after: case inr
x : ℂ
hx : ‖x‖ = 1
this✝ : ∀ {x y : ℂ}, ‖x‖ = 1 → ‖y‖ = 1 → y = 1 → ‖x - y‖ ∈ Icc (2 / π * angle x y) (angle x y)
hy : ‖0‖ = 1
h : ¬0 = 1
this : ‖x / 0 - 1‖ ∈ Icc (2 / π * angle x (1 * 0)) (angle x (1 * 0))
⊢ False

tactic: simp at hy
state_before: case inr
x : ℂ
hx : ‖x‖ = 1
this✝ : ∀ {x y : ℂ}, ‖x‖ = 1 → ‖y‖ = 1 → y = 1 → ‖x - y‖ ∈ Icc (2 / π * angle x y) (angle x y)
hy : ‖0‖ = 1
h : ¬0 = 1
this : ‖x / 0 - 1‖ ∈ Icc (2 / π * angle x (1 * 0)) (angle x (1 * 0))
⊢ False
state_after: no goals

tactic: simp only [norm_div, hx, hy, div_one]
state_before: x y : ℂ
hx : ‖x‖ = 1
hy : ‖y‖ = 1
this : ∀ {x y : ℂ}, ‖x‖ = 1 → ‖y‖ = 1 → y = 1 → ‖x - y‖ ∈ Icc (2 / π * angle x y) (angle x y)
h : ¬y = 1
⊢ ‖x / y‖ = 1
state_after: no goals

tactic: norm_cast
state_before: case intro.intro
x y : ℂ
hy : ‖1‖ = 1
θ : ℝ
hθ : θ ∈ Ioc (-π) π
⊢ ‖cos ↑θ - 1 + sin ↑θ * I‖ ∈ Icc (2 / π * |θ|) |θ|
state_after: case intro.intro
x y : ℂ
hy : ‖1‖ = 1
θ : ℝ
hθ : θ ∈ Ioc (-π) π
⊢ ‖↑(Real.cos θ - 1) + ↑(Real.sin θ) * I‖ ∈ Icc (2 / π * |θ|) |θ|

tactic: rw [norm_eq_abs, abs_add_mul_I]
state_before: case intro.intro
x y : ℂ
hy : ‖1‖ = 1
θ : ℝ
hθ : θ ∈ Ioc (-π) π
⊢ ‖↑(Real.cos θ - 1) + ↑(Real.sin θ) * I‖ ∈ Icc (2 / π * |θ|) |θ|
state_after: case intro.intro
x y : ℂ
hy : ‖1‖ = 1
θ : ℝ
hθ : θ ∈ Ioc (-π) π
⊢ √((Real.cos θ - 1) ^ 2 + Real.sin θ ^ 2) ∈ Icc (2 / π * |θ|) |θ|

tactic: refine ⟨Real.le_sqrt_of_sq_le ?_, ?_⟩
state_before: case intro.intro
x y : ℂ
hy : ‖1‖ = 1
θ : ℝ
hθ : θ ∈ Ioc (-π) π
⊢ √((Real.cos θ - 1) ^ 2 + Real.sin θ ^ 2) ∈ Icc (2 / π * |θ|) |θ|
state_after: case intro.intro.refine_1
x y : ℂ
hy : ‖1‖ = 1
θ : ℝ
hθ : θ ∈ Ioc (-π) π
⊢ (2 / π * |θ|) ^ 2 ≤ (Real.cos θ - 1) ^ 2 + Real.sin θ ^ 2

case intro.intro.refine_2
x y : ℂ
hy : ‖1‖ = 1
θ : ℝ
hθ : θ ∈ Ioc (-π) π
⊢ √((Real.cos θ - 1) ^ 2 + Real.sin θ ^ 2) ≤ |θ|

tactic: rw [mul_pow, ← _root_.abs_pow, abs_sq]
state_before: case intro.intro.refine_1
x y : ℂ
hy : ‖1‖ = 1
θ : ℝ
hθ : θ ∈ Ioc (-π) π
⊢ (2 / π * |θ|) ^ 2 ≤ (Real.cos θ - 1) ^ 2 + Real.sin θ ^ 2
state_after: case intro.intro.refine_1
x y : ℂ
hy : ‖1‖ = 1
θ : ℝ
hθ : θ ∈ Ioc (-π) π
⊢ (2 / π) ^ 2 * θ ^ 2 ≤ (Real.cos θ - 1) ^ 2 + Real.sin θ ^ 2

tactic: calc
  _ = 2 * (1 - (1 - 2 / π ^ 2 * θ ^ 2)) := by ring
  _ ≤ 2 * (1 - θ.cos) := by
      gcongr; exact Real.cos_quadratic_upper_bound <| abs_le.2 <| Ioc_subset_Icc_self hθ
  _  = _ := by linear_combination -θ.cos_sq_add_sin_sq
state_before: case intro.intro.refine_1
x y : ℂ
hy : ‖1‖ = 1
θ : ℝ
hθ : θ ∈ Ioc (-π) π
⊢ (2 / π) ^ 2 * θ ^ 2 ≤ (Real.cos θ - 1) ^ 2 + Real.sin θ ^ 2
state_after: no goals

tactic: ring
state_before: x y : ℂ
hy : ‖1‖ = 1
θ : ℝ
hθ : θ ∈ Ioc (-π) π
⊢ (2 / π) ^ 2 * θ ^ 2 = 2 * (1 - (1 - 2 / π ^ 2 * θ ^ 2))
state_after: no goals

tactic: gcongr
state_before: x y : ℂ
hy : ‖1‖ = 1
θ : ℝ
hθ : θ ∈ Ioc (-π) π
⊢ 2 * (1 - (1 - 2 / π ^ 2 * θ ^ 2)) ≤ 2 * (1 - Real.cos θ)
state_after: case h.h
x y : ℂ
hy : ‖1‖ = 1
θ : ℝ
hθ : θ ∈ Ioc (-π) π
⊢ Real.cos θ ≤ 1 - 2 / π ^ 2 * θ ^ 2

tactic: exact Real.cos_quadratic_upper_bound <| abs_le.2 <| Ioc_subset_Icc_self hθ
state_before: case h.h
x y : ℂ
hy : ‖1‖ = 1
θ : ℝ
hθ : θ ∈ Ioc (-π) π
⊢ Real.cos θ ≤ 1 - 2 / π ^ 2 * θ ^ 2
state_after: no goals

tactic: linear_combination -θ.cos_sq_add_sin_sq
state_before: x y : ℂ
hy : ‖1‖ = 1
θ : ℝ
hθ : θ ∈ Ioc (-π) π
⊢ 2 * (1 - Real.cos θ) = (Real.cos θ - 1) ^ 2 + Real.sin θ ^ 2
state_after: no goals

tactic: rw [Real.sqrt_le_left (by positivity), ← _root_.abs_pow, abs_sq]
state_before: case intro.intro.refine_2
x y : ℂ
hy : ‖1‖ = 1
θ : ℝ
hθ : θ ∈ Ioc (-π) π
⊢ √((Real.cos θ - 1) ^ 2 + Real.sin θ ^ 2) ≤ |θ|
state_after: case intro.intro.refine_2
x y : ℂ
hy : ‖1‖ = 1
θ : ℝ
hθ : θ ∈ Ioc (-π) π
⊢ (Real.cos θ - 1) ^ 2 + Real.sin θ ^ 2 ≤ θ ^ 2

tactic: calc
  _ = 2 * (1 - θ.cos) := by linear_combination θ.cos_sq_add_sin_sq
  _ ≤ 2 * (1 - (1 - θ ^ 2 / 2)) := by gcongr; exact Real.one_sub_sq_div_two_le_cos
  _ = _ := by ring
state_before: case intro.intro.refine_2
x y : ℂ
hy : ‖1‖ = 1
θ : ℝ
hθ : θ ∈ Ioc (-π) π
⊢ (Real.cos θ - 1) ^ 2 + Real.sin θ ^ 2 ≤ θ ^ 2
state_after: no goals

tactic: positivity
state_before: x y : ℂ
hy : ‖1‖ = 1
θ : ℝ
hθ : θ ∈ Ioc (-π) π
⊢ 0 ≤ |θ|
state_after: no goals

tactic: linear_combination θ.cos_sq_add_sin_sq
state_before: x y : ℂ
hy : ‖1‖ = 1
θ : ℝ
hθ : θ ∈ Ioc (-π) π
⊢ (Real.cos θ - 1) ^ 2 + Real.sin θ ^ 2 = 2 * (1 - Real.cos θ)
state_after: no goals

tactic: gcongr
state_before: x y : ℂ
hy : ‖1‖ = 1
θ : ℝ
hθ : θ ∈ Ioc (-π) π
⊢ 2 * (1 - Real.cos θ) ≤ 2 * (1 - (1 - θ ^ 2 / 2))
state_after: case h.h
x y : ℂ
hy : ‖1‖ = 1
θ : ℝ
hθ : θ ∈ Ioc (-π) π
⊢ 1 - θ ^ 2 / 2 ≤ Real.cos θ

tactic: exact Real.one_sub_sq_div_two_le_cos
state_before: case h.h
x y : ℂ
hy : ‖1‖ = 1
θ : ℝ
hθ : θ ∈ Ioc (-π) π
⊢ 1 - θ ^ 2 / 2 ≤ Real.cos θ
state_after: no goals

tactic: ring
state_before: x y : ℂ
hy : ‖1‖ = 1
θ : ℝ
hθ : θ ∈ Ioc (-π) π
⊢ 2 * (1 - (1 - θ ^ 2 / 2)) = θ ^ 2
state_after: no goals

tactic: convert hθ
state_before: case intro.intro
x y : ℂ
hy : ‖1‖ = 1
θ : ℝ
hθ : θ ∈ Ioc (-π) π
⊢ θ ∈ Ioc (-π) (-π + 2 * π)
state_after: case h.e'_5.h.e'_4
x y : ℂ
hy : ‖1‖ = 1
θ : ℝ
hθ : θ ∈ Ioc (-π) π
⊢ -π + 2 * π = π

tactic: ring
state_before: case h.e'_5.h.e'_4
x y : ℂ
hy : ‖1‖ = 1
θ : ℝ
hθ : θ ∈ Ioc (-π) π
⊢ -π + 2 * π = π
state_after: no goals