Theorem: Real.cos_quadratic_upper_bound
File: Mathlib/Analysis/SpecialFunctions/Trigonometric/Bounds.lean

tactic: wlog hx₀ : 0 ≤ x
state_before: x : ℝ
hx : |x| ≤ π
⊢ cos x ≤ 1 - 2 / π ^ 2 * x ^ 2
state_after: case inr
x : ℝ
hx : |x| ≤ π
this : ∀ {x : ℝ}, |x| ≤ π → 0 ≤ x → cos x ≤ 1 - 2 / π ^ 2 * x ^ 2
hx₀ : ¬0 ≤ x
⊢ cos x ≤ 1 - 2 / π ^ 2 * x ^ 2

x✝ x : ℝ
hx : |x| ≤ π
hx₀ : 0 ≤ x
⊢ cos x ≤ 1 - 2 / π ^ 2 * x ^ 2

tactic: rw [abs_of_nonneg hx₀] at hx
state_before: x✝ x : ℝ
hx : |x| ≤ π
hx₀ : 0 ≤ x
⊢ cos x ≤ 1 - 2 / π ^ 2 * x ^ 2
state_after: x✝ x : ℝ
hx : x ≤ π
hx₀ : 0 ≤ x
⊢ cos x ≤ 1 - 2 / π ^ 2 * x ^ 2

tactic: have hderiv (x) : HasDerivAt (fun x ↦ 1 - 2 / π ^ 2 * x ^ 2 - cos x) _ x :=
  (((hasDerivAt_pow ..).const_mul _).const_sub _).sub $ hasDerivAt_cos _
state_before: x✝ x : ℝ
hx : x ≤ π
hx₀ : 0 ≤ x
⊢ cos x ≤ 1 - 2 / π ^ 2 * x ^ 2
state_after: x✝ x : ℝ
hx : x ≤ π
hx₀ : 0 ≤ x
hderiv : ∀ (x : ℝ), HasDerivAt (fun x => 1 - 2 / π ^ 2 * x ^ 2 - cos x) (-(2 / π ^ 2 * (↑2 * x ^ (2 - 1))) - -sin x) x
⊢ cos x ≤ 1 - 2 / π ^ 2 * x ^ 2

tactic: simp only [Nat.cast_ofNat, Nat.succ_sub_succ_eq_sub, tsub_zero, pow_one, ← neg_sub', neg_sub,
  ← mul_assoc] at hderiv
state_before: x✝ x : ℝ
hx : x ≤ π
hx₀ : 0 ≤ x
hderiv : ∀ (x : ℝ), HasDerivAt (fun x => 1 - 2 / π ^ 2 * x ^ 2 - cos x) (-(2 / π ^ 2 * (↑2 * x ^ (2 - 1))) - -sin x) x
⊢ cos x ≤ 1 - 2 / π ^ 2 * x ^ 2
state_after: x✝ x : ℝ
hx : x ≤ π
hx₀ : 0 ≤ x
hderiv : ∀ (x : ℝ), HasDerivAt (fun x => 1 - 2 / π ^ 2 * x ^ 2 - cos x) (sin x - 2 / π ^ 2 * 2 * x) x
⊢ cos x ≤ 1 - 2 / π ^ 2 * x ^ 2

tactic: have hmono : MonotoneOn (fun x ↦ 1 - 2 / π ^ 2 * x ^ 2 - cos x) (Icc 0 (π / 2)) := by
  set_option tactic.skipAssignedInstances false in
  refine monotoneOn_of_hasDerivWithinAt_nonneg
    (convex_Icc ..)
    (Continuous.continuousOn $ by fun_prop)
    (fun x _ ↦ (hderiv _).hasDerivWithinAt)
    fun x hx ↦ sub_nonneg.2 ?_
  have ⟨hx₀, hx⟩ := interior_subset hx
  calc 2 / π ^ 2 * 2 * x
      = 2 / π * (2 / π * x) := by ring
    _ ≤ 1 * sin x := by
        gcongr; exacts [div_le_one_of_le two_le_pi (by positivity), two_div_pi_mul_le_sin hx₀ hx]
    _ = sin x := one_mul _
state_before: x✝ x : ℝ
hx : x ≤ π
hx₀ : 0 ≤ x
hderiv : ∀ (x : ℝ), HasDerivAt (fun x => 1 - 2 / π ^ 2 * x ^ 2 - cos x) (sin x - 2 / π ^ 2 * 2 * x) x
⊢ cos x ≤ 1 - 2 / π ^ 2 * x ^ 2
state_after: x✝ x : ℝ
hx : x ≤ π
hx₀ : 0 ≤ x
hderiv : ∀ (x : ℝ), HasDerivAt (fun x => 1 - 2 / π ^ 2 * x ^ 2 - cos x) (sin x - 2 / π ^ 2 * 2 * x) x
hmono : MonotoneOn (fun x => 1 - 2 / π ^ 2 * x ^ 2 - cos x) (Icc 0 (π / 2))
⊢ cos x ≤ 1 - 2 / π ^ 2 * x ^ 2

tactic: rw [← sub_nonneg]
state_before: x✝ x : ℝ
hx : x ≤ π
hx₀ : 0 ≤ x
hderiv : ∀ (x : ℝ), HasDerivAt (fun x => 1 - 2 / π ^ 2 * x ^ 2 - cos x) (sin x - 2 / π ^ 2 * 2 * x) x
hmono : MonotoneOn (fun x => 1 - 2 / π ^ 2 * x ^ 2 - cos x) (Icc 0 (π / 2))
hconc : ConcaveOn ℝ (Icc (π / 2) π) fun x => 1 - 2 / π ^ 2 * x ^ 2 - cos x
⊢ cos x ≤ 1 - 2 / π ^ 2 * x ^ 2
state_after: x✝ x : ℝ
hx : x ≤ π
hx₀ : 0 ≤ x
hderiv : ∀ (x : ℝ), HasDerivAt (fun x => 1 - 2 / π ^ 2 * x ^ 2 - cos x) (sin x - 2 / π ^ 2 * 2 * x) x
hmono : MonotoneOn (fun x => 1 - 2 / π ^ 2 * x ^ 2 - cos x) (Icc 0 (π / 2))
hconc : ConcaveOn ℝ (Icc (π / 2) π) fun x => 1 - 2 / π ^ 2 * x ^ 2 - cos x
⊢ 0 ≤ 1 - 2 / π ^ 2 * x ^ 2 - cos x

tactic: obtain hx' | hx' := le_total x (π / 2)
state_before: x✝ x : ℝ
hx : x ≤ π
hx₀ : 0 ≤ x
hderiv : ∀ (x : ℝ), HasDerivAt (fun x => 1 - 2 / π ^ 2 * x ^ 2 - cos x) (sin x - 2 / π ^ 2 * 2 * x) x
hmono : MonotoneOn (fun x => 1 - 2 / π ^ 2 * x ^ 2 - cos x) (Icc 0 (π / 2))
hconc : ConcaveOn ℝ (Icc (π / 2) π) fun x => 1 - 2 / π ^ 2 * x ^ 2 - cos x
⊢ 0 ≤ 1 - 2 / π ^ 2 * x ^ 2 - cos x
state_after: case inl
x✝ x : ℝ
hx : x ≤ π
hx₀ : 0 ≤ x
hderiv : ∀ (x : ℝ), HasDerivAt (fun x => 1 - 2 / π ^ 2 * x ^ 2 - cos x) (sin x - 2 / π ^ 2 * 2 * x) x
hmono : MonotoneOn (fun x => 1 - 2 / π ^ 2 * x ^ 2 - cos x) (Icc 0 (π / 2))
hconc : ConcaveOn ℝ (Icc (π / 2) π) fun x => 1 - 2 / π ^ 2 * x ^ 2 - cos x
hx' : x ≤ π / 2
⊢ 0 ≤ 1 - 2 / π ^ 2 * x ^ 2 - cos x

case inr
x✝ x : ℝ
hx : x ≤ π
hx₀ : 0 ≤ x
hderiv : ∀ (x : ℝ), HasDerivAt (fun x => 1 - 2 / π ^ 2 * x ^ 2 - cos x) (sin x - 2 / π ^ 2 * 2 * x) x
hmono : MonotoneOn (fun x => 1 - 2 / π ^ 2 * x ^ 2 - cos x) (Icc 0 (π / 2))
hconc : ConcaveOn ℝ (Icc (π / 2) π) fun x => 1 - 2 / π ^ 2 * x ^ 2 - cos x
hx' : π / 2 ≤ x
⊢ 0 ≤ 1 - 2 / π ^ 2 * x ^ 2 - cos x

tactic: simpa using this (by rwa [abs_neg]) $ neg_nonneg.2 $ le_of_not_le hx₀
state_before: case inr
x : ℝ
hx : |x| ≤ π
this : ∀ {x : ℝ}, |x| ≤ π → 0 ≤ x → cos x ≤ 1 - 2 / π ^ 2 * x ^ 2
hx₀ : ¬0 ≤ x
⊢ cos x ≤ 1 - 2 / π ^ 2 * x ^ 2
state_after: no goals

tactic: rwa [abs_neg]
state_before: x : ℝ
hx : |x| ≤ π
this : ∀ {x : ℝ}, |x| ≤ π → 0 ≤ x → cos x ≤ 1 - 2 / π ^ 2 * x ^ 2
hx₀ : ¬0 ≤ x
⊢ |(-x)| ≤ π
state_after: no goals

tactic: set_option tactic.skipAssignedInstances false in
refine monotoneOn_of_hasDerivWithinAt_nonneg
  (convex_Icc ..)
  (Continuous.continuousOn $ by fun_prop)
  (fun x _ ↦ (hderiv _).hasDerivWithinAt)
  fun x hx ↦ sub_nonneg.2 ?_
have ⟨hx₀, hx⟩ := interior_subset hx
calc 2 / π ^ 2 * 2 * x
    = 2 / π * (2 / π * x) := by ring
  _ ≤ 1 * sin x := by
      gcongr; exacts [div_le_one_of_le two_le_pi (by positivity), two_div_pi_mul_le_sin hx₀ hx]
  _ = sin x := one_mul _
state_before: x✝ x : ℝ
hx : x ≤ π
hx₀ : 0 ≤ x
hderiv : ∀ (x : ℝ), HasDerivAt (fun x => 1 - 2 / π ^ 2 * x ^ 2 - cos x) (sin x - 2 / π ^ 2 * 2 * x) x
⊢ MonotoneOn (fun x => 1 - 2 / π ^ 2 * x ^ 2 - cos x) (Icc 0 (π / 2))
state_after: no goals

tactic: refine monotoneOn_of_hasDerivWithinAt_nonneg
  (convex_Icc ..)
  (Continuous.continuousOn $ by fun_prop)
  (fun x _ ↦ (hderiv _).hasDerivWithinAt)
  fun x hx ↦ sub_nonneg.2 ?_
state_before: x✝ x : ℝ
hx : x ≤ π
hx₀ : 0 ≤ x
hderiv : ∀ (x : ℝ), HasDerivAt (fun x => 1 - 2 / π ^ 2 * x ^ 2 - cos x) (sin x - 2 / π ^ 2 * 2 * x) x
⊢ MonotoneOn (fun x => 1 - 2 / π ^ 2 * x ^ 2 - cos x) (Icc 0 (π / 2))
state_after: x✝¹ x✝ : ℝ
hx✝ : x✝ ≤ π
hx₀ : 0 ≤ x✝
hderiv : ∀ (x : ℝ), HasDerivAt (fun x => 1 - 2 / π ^ 2 * x ^ 2 - cos x) (sin x - 2 / π ^ 2 * 2 * x) x
x : ℝ
hx : x ∈ interior (Icc 0 (π / 2))
⊢ 2 / π ^ 2 * 2 * x ≤ sin x

tactic: have ⟨hx₀, hx⟩ := interior_subset hx
state_before: x✝¹ x✝ : ℝ
hx✝ : x✝ ≤ π
hx₀ : 0 ≤ x✝
hderiv : ∀ (x : ℝ), HasDerivAt (fun x => 1 - 2 / π ^ 2 * x ^ 2 - cos x) (sin x - 2 / π ^ 2 * 2 * x) x
x : ℝ
hx : x ∈ interior (Icc 0 (π / 2))
⊢ 2 / π ^ 2 * 2 * x ≤ sin x
state_after: x✝¹ x✝ : ℝ
hx✝¹ : x✝ ≤ π
hx₀✝ : 0 ≤ x✝
hderiv : ∀ (x : ℝ), HasDerivAt (fun x => 1 - 2 / π ^ 2 * x ^ 2 - cos x) (sin x - 2 / π ^ 2 * 2 * x) x
x : ℝ
hx✝ : x ∈ interior (Icc 0 (π / 2))
hx₀ : 0 ≤ x
hx : x ≤ π / 2
⊢ 2 / π ^ 2 * 2 * x ≤ sin x

tactic: calc 2 / π ^ 2 * 2 * x
    = 2 / π * (2 / π * x) := by ring
  _ ≤ 1 * sin x := by
      gcongr; exacts [div_le_one_of_le two_le_pi (by positivity), two_div_pi_mul_le_sin hx₀ hx]
  _ = sin x := one_mul _
state_before: x✝¹ x✝ : ℝ
hx✝¹ : x✝ ≤ π
hx₀✝ : 0 ≤ x✝
hderiv : ∀ (x : ℝ), HasDerivAt (fun x => 1 - 2 / π ^ 2 * x ^ 2 - cos x) (sin x - 2 / π ^ 2 * 2 * x) x
x : ℝ
hx✝ : x ∈ interior (Icc 0 (π / 2))
hx₀ : 0 ≤ x
hx : x ≤ π / 2
⊢ 2 / π ^ 2 * 2 * x ≤ sin x
state_after: no goals

tactic: fun_prop
state_before: x✝ x : ℝ
hx : x ≤ π
hx₀ : 0 ≤ x
hderiv : ∀ (x : ℝ), HasDerivAt (fun x => 1 - 2 / π ^ 2 * x ^ 2 - cos x) (sin x - 2 / π ^ 2 * 2 * x) x
⊢ Continuous fun x => 1 - 2 / π ^ 2 * x ^ 2 - cos x
state_after: no goals

tactic: ring
state_before: x✝¹ x✝ : ℝ
hx✝¹ : x✝ ≤ π
hx₀✝ : 0 ≤ x✝
hderiv : ∀ (x : ℝ), HasDerivAt (fun x => 1 - 2 / π ^ 2 * x ^ 2 - cos x) (sin x - 2 / π ^ 2 * 2 * x) x
x : ℝ
hx✝ : x ∈ interior (Icc 0 (π / 2))
hx₀ : 0 ≤ x
hx : x ≤ π / 2
⊢ 2 / π ^ 2 * 2 * x = 2 / π * (2 / π * x)
state_after: no goals

tactic: gcongr
state_before: x✝¹ x✝ : ℝ
hx✝¹ : x✝ ≤ π
hx₀✝ : 0 ≤ x✝
hderiv : ∀ (x : ℝ), HasDerivAt (fun x => 1 - 2 / π ^ 2 * x ^ 2 - cos x) (sin x - 2 / π ^ 2 * 2 * x) x
x : ℝ
hx✝ : x ∈ interior (Icc 0 (π / 2))
hx₀ : 0 ≤ x
hx : x ≤ π / 2
⊢ 2 / π * (2 / π * x) ≤ 1 * sin x
state_after: case h₁
x✝¹ x✝ : ℝ
hx✝¹ : x✝ ≤ π
hx₀✝ : 0 ≤ x✝
hderiv : ∀ (x : ℝ), HasDerivAt (fun x => 1 - 2 / π ^ 2 * x ^ 2 - cos x) (sin x - 2 / π ^ 2 * 2 * x) x
x : ℝ
hx✝ : x ∈ interior (Icc 0 (π / 2))
hx₀ : 0 ≤ x
hx : x ≤ π / 2
⊢ 2 / π ≤ 1

case h₂
x✝¹ x✝ : ℝ
hx✝¹ : x✝ ≤ π
hx₀✝ : 0 ≤ x✝
hderiv : ∀ (x : ℝ), HasDerivAt (fun x => 1 - 2 / π ^ 2 * x ^ 2 - cos x) (sin x - 2 / π ^ 2 * 2 * x) x
x : ℝ
hx✝ : x ∈ interior (Icc 0 (π / 2))
hx₀ : 0 ≤ x
hx : x ≤ π / 2
⊢ 2 / π * x ≤ sin x

tactic: exacts [div_le_one_of_le two_le_pi (by positivity), two_div_pi_mul_le_sin hx₀ hx]
state_before: case h₁
x✝¹ x✝ : ℝ
hx✝¹ : x✝ ≤ π
hx₀✝ : 0 ≤ x✝
hderiv : ∀ (x : ℝ), HasDerivAt (fun x => 1 - 2 / π ^ 2 * x ^ 2 - cos x) (sin x - 2 / π ^ 2 * 2 * x) x
x : ℝ
hx✝ : x ∈ interior (Icc 0 (π / 2))
hx₀ : 0 ≤ x
hx : x ≤ π / 2
⊢ 2 / π ≤ 1

case h₂
x✝¹ x✝ : ℝ
hx✝¹ : x✝ ≤ π
hx₀✝ : 0 ≤ x✝
hderiv : ∀ (x : ℝ), HasDerivAt (fun x => 1 - 2 / π ^ 2 * x ^ 2 - cos x) (sin x - 2 / π ^ 2 * 2 * x) x
x : ℝ
hx✝ : x ∈ interior (Icc 0 (π / 2))
hx₀ : 0 ≤ x
hx : x ≤ π / 2
⊢ 2 / π * x ≤ sin x
state_after: no goals

tactic: positivity
state_before: x✝¹ x✝ : ℝ
hx✝¹ : x✝ ≤ π
hx₀✝ : 0 ≤ x✝
hderiv : ∀ (x : ℝ), HasDerivAt (fun x => 1 - 2 / π ^ 2 * x ^ 2 - cos x) (sin x - 2 / π ^ 2 * 2 * x) x
x : ℝ
hx✝ : x ∈ interior (Icc 0 (π / 2))
hx₀ : 0 ≤ x
hx : x ≤ π / 2
⊢ 0 ≤ π
state_after: no goals

tactic: refine concaveOn_of_hasDerivWithinAt2_nonpos (convex_Icc ..)
  (Continuous.continuousOn $ by fun_prop) (fun x _ ↦ (hderiv _).hasDerivWithinAt)
  (fun x _ ↦ ((hasDerivAt_sin ..).sub $ (hasDerivAt_id ..).const_mul _).hasDerivWithinAt)
  fun x hx ↦ ?_
state_before: x✝ x : ℝ
hx : x ≤ π
hx₀ : 0 ≤ x
hderiv : ∀ (x : ℝ), HasDerivAt (fun x => 1 - 2 / π ^ 2 * x ^ 2 - cos x) (sin x - 2 / π ^ 2 * 2 * x) x
hmono : MonotoneOn (fun x => 1 - 2 / π ^ 2 * x ^ 2 - cos x) (Icc 0 (π / 2))
⊢ ConcaveOn ℝ (Icc (π / 2) π) fun x => 1 - 2 / π ^ 2 * x ^ 2 - cos x
state_after: x✝¹ x✝ : ℝ
hx✝ : x✝ ≤ π
hx₀ : 0 ≤ x✝
hderiv : ∀ (x : ℝ), HasDerivAt (fun x => 1 - 2 / π ^ 2 * x ^ 2 - cos x) (sin x - 2 / π ^ 2 * 2 * x) x
hmono : MonotoneOn (fun x => 1 - 2 / π ^ 2 * x ^ 2 - cos x) (Icc 0 (π / 2))
x : ℝ
hx : x ∈ interior (Icc (π / 2) π)
⊢ cos x - 2 / π ^ 2 * 2 * 1 ≤ 0

tactic: have ⟨hx, hx'⟩ := interior_subset hx
state_before: x✝¹ x✝ : ℝ
hx✝ : x✝ ≤ π
hx₀ : 0 ≤ x✝
hderiv : ∀ (x : ℝ), HasDerivAt (fun x => 1 - 2 / π ^ 2 * x ^ 2 - cos x) (sin x - 2 / π ^ 2 * 2 * x) x
hmono : MonotoneOn (fun x => 1 - 2 / π ^ 2 * x ^ 2 - cos x) (Icc 0 (π / 2))
x : ℝ
hx : x ∈ interior (Icc (π / 2) π)
⊢ cos x - 2 / π ^ 2 * 2 * 1 ≤ 0
state_after: x✝¹ x✝ : ℝ
hx✝¹ : x✝ ≤ π
hx₀ : 0 ≤ x✝
hderiv : ∀ (x : ℝ), HasDerivAt (fun x => 1 - 2 / π ^ 2 * x ^ 2 - cos x) (sin x - 2 / π ^ 2 * 2 * x) x
hmono : MonotoneOn (fun x => 1 - 2 / π ^ 2 * x ^ 2 - cos x) (Icc 0 (π / 2))
x : ℝ
hx✝ : x ∈ interior (Icc (π / 2) π)
hx : π / 2 ≤ x
hx' : x ≤ π
⊢ cos x - 2 / π ^ 2 * 2 * 1 ≤ 0

tactic: fun_prop
state_before: x✝ x : ℝ
hx : x ≤ π
hx₀ : 0 ≤ x
hderiv : ∀ (x : ℝ), HasDerivAt (fun x => 1 - 2 / π ^ 2 * x ^ 2 - cos x) (sin x - 2 / π ^ 2 * 2 * x) x
hmono : MonotoneOn (fun x => 1 - 2 / π ^ 2 * x ^ 2 - cos x) (Icc 0 (π / 2))
⊢ Continuous fun x => 1 - 2 / π ^ 2 * x ^ 2 - cos x
state_after: no goals

tactic: gcongr
state_before: x✝¹ x✝ : ℝ
hx✝¹ : x✝ ≤ π
hx₀ : 0 ≤ x✝
hderiv : ∀ (x : ℝ), HasDerivAt (fun x => 1 - 2 / π ^ 2 * x ^ 2 - cos x) (sin x - 2 / π ^ 2 * 2 * x) x
hmono : MonotoneOn (fun x => 1 - 2 / π ^ 2 * x ^ 2 - cos x) (Icc 0 (π / 2))
x : ℝ
hx✝ : x ∈ interior (Icc (π / 2) π)
hx : π / 2 ≤ x
hx' : x ≤ π
⊢ cos x - 2 / π ^ 2 * 2 * 1 ≤ 0 - 0
state_after: case hab
x✝¹ x✝ : ℝ
hx✝¹ : x✝ ≤ π
hx₀ : 0 ≤ x✝
hderiv : ∀ (x : ℝ), HasDerivAt (fun x => 1 - 2 / π ^ 2 * x ^ 2 - cos x) (sin x - 2 / π ^ 2 * 2 * x) x
hmono : MonotoneOn (fun x => 1 - 2 / π ^ 2 * x ^ 2 - cos x) (Icc 0 (π / 2))
x : ℝ
hx✝ : x ∈ interior (Icc (π / 2) π)
hx : π / 2 ≤ x
hx' : x ≤ π
⊢ cos x ≤ 0

case hcd
x✝¹ x✝ : ℝ
hx✝¹ : x✝ ≤ π
hx₀ : 0 ≤ x✝
hderiv : ∀ (x : ℝ), HasDerivAt (fun x => 1 - 2 / π ^ 2 * x ^ 2 - cos x) (sin x - 2 / π ^ 2 * 2 * x) x
hmono : MonotoneOn (fun x => 1 - 2 / π ^ 2 * x ^ 2 - cos x) (Icc 0 (π / 2))
x : ℝ
hx✝ : x ∈ interior (Icc (π / 2) π)
hx : π / 2 ≤ x
hx' : x ≤ π
⊢ 0 ≤ 2 / π ^ 2 * 2 * 1

tactic: exact cos_nonpos_of_pi_div_two_le_of_le hx $ hx'.trans $ by linarith
state_before: case hab
x✝¹ x✝ : ℝ
hx✝¹ : x✝ ≤ π
hx₀ : 0 ≤ x✝
hderiv : ∀ (x : ℝ), HasDerivAt (fun x => 1 - 2 / π ^ 2 * x ^ 2 - cos x) (sin x - 2 / π ^ 2 * 2 * x) x
hmono : MonotoneOn (fun x => 1 - 2 / π ^ 2 * x ^ 2 - cos x) (Icc 0 (π / 2))
x : ℝ
hx✝ : x ∈ interior (Icc (π / 2) π)
hx : π / 2 ≤ x
hx' : x ≤ π
⊢ cos x ≤ 0
state_after: no goals

tactic: linarith
state_before: x✝¹ x✝ : ℝ
hx✝¹ : x✝ ≤ π
hx₀ : 0 ≤ x✝
hderiv : ∀ (x : ℝ), HasDerivAt (fun x => 1 - 2 / π ^ 2 * x ^ 2 - cos x) (sin x - 2 / π ^ 2 * 2 * x) x
hmono : MonotoneOn (fun x => 1 - 2 / π ^ 2 * x ^ 2 - cos x) (Icc 0 (π / 2))
x : ℝ
hx✝ : x ∈ interior (Icc (π / 2) π)
hx : π / 2 ≤ x
hx' : x ≤ π
⊢ π ≤ π + π / 2
state_after: no goals

tactic: positivity
state_before: case hcd
x✝¹ x✝ : ℝ
hx✝¹ : x✝ ≤ π
hx₀ : 0 ≤ x✝
hderiv : ∀ (x : ℝ), HasDerivAt (fun x => 1 - 2 / π ^ 2 * x ^ 2 - cos x) (sin x - 2 / π ^ 2 * 2 * x) x
hmono : MonotoneOn (fun x => 1 - 2 / π ^ 2 * x ^ 2 - cos x) (Icc 0 (π / 2))
x : ℝ
hx✝ : x ∈ interior (Icc (π / 2) π)
hx : π / 2 ≤ x
hx' : x ≤ π
⊢ 0 ≤ 2 / π ^ 2 * 2 * 1
state_after: no goals

tactic: simpa using hmono (left_mem_Icc.2 $ by positivity) ⟨hx₀, hx'⟩ hx₀
state_before: case inl
x✝ x : ℝ
hx : x ≤ π
hx₀ : 0 ≤ x
hderiv : ∀ (x : ℝ), HasDerivAt (fun x => 1 - 2 / π ^ 2 * x ^ 2 - cos x) (sin x - 2 / π ^ 2 * 2 * x) x
hmono : MonotoneOn (fun x => 1 - 2 / π ^ 2 * x ^ 2 - cos x) (Icc 0 (π / 2))
hconc : ConcaveOn ℝ (Icc (π / 2) π) fun x => 1 - 2 / π ^ 2 * x ^ 2 - cos x
hx' : x ≤ π / 2
⊢ 0 ≤ 1 - 2 / π ^ 2 * x ^ 2 - cos x
state_after: no goals

tactic: positivity
state_before: x✝ x : ℝ
hx : x ≤ π
hx₀ : 0 ≤ x
hderiv : ∀ (x : ℝ), HasDerivAt (fun x => 1 - 2 / π ^ 2 * x ^ 2 - cos x) (sin x - 2 / π ^ 2 * 2 * x) x
hmono : MonotoneOn (fun x => 1 - 2 / π ^ 2 * x ^ 2 - cos x) (Icc 0 (π / 2))
hconc : ConcaveOn ℝ (Icc (π / 2) π) fun x => 1 - 2 / π ^ 2 * x ^ 2 - cos x
hx' : x ≤ π / 2
⊢ 0 ≤ π / 2
state_after: no goals

tactic: refine (le_min ?_ ?_).trans $ hconc.min_le_of_mem_Icc ⟨hx', hx⟩ <;> field_simp <;> norm_num
state_before: case inr
x✝ x : ℝ
hx : x ≤ π
hx₀ : 0 ≤ x
hderiv : ∀ (x : ℝ), HasDerivAt (fun x => 1 - 2 / π ^ 2 * x ^ 2 - cos x) (sin x - 2 / π ^ 2 * 2 * x) x
hmono : MonotoneOn (fun x => 1 - 2 / π ^ 2 * x ^ 2 - cos x) (Icc 0 (π / 2))
hconc : ConcaveOn ℝ (Icc (π / 2) π) fun x => 1 - 2 / π ^ 2 * x ^ 2 - cos x
hx' : π / 2 ≤ x
⊢ 0 ≤ 1 - 2 / π ^ 2 * x ^ 2 - cos x
state_after: no goals