Theorem: Real.cos_arcsin
File: Mathlib/Analysis/SpecialFunctions/Trigonometric/Inverse.lean

tactic: by_cases hx₁ : -1 ≤ x
state_before: x✝ y x : ℝ
⊢ cos (arcsin x) = √(1 - x ^ 2)
state_after: case pos
x✝ y x : ℝ
hx₁ : -1 ≤ x
⊢ cos (arcsin x) = √(1 - x ^ 2)

case neg
x✝ y x : ℝ
hx₁ : ¬-1 ≤ x
⊢ cos (arcsin x) = √(1 - x ^ 2)

tactic: swap
state_before: case pos
x✝ y x : ℝ
hx₁ : -1 ≤ x
⊢ cos (arcsin x) = √(1 - x ^ 2)

case neg
x✝ y x : ℝ
hx₁ : ¬-1 ≤ x
⊢ cos (arcsin x) = √(1 - x ^ 2)
state_after: case neg
x✝ y x : ℝ
hx₁ : ¬-1 ≤ x
⊢ cos (arcsin x) = √(1 - x ^ 2)

case pos
x✝ y x : ℝ
hx₁ : -1 ≤ x
⊢ cos (arcsin x) = √(1 - x ^ 2)

tactic: by_cases hx₂ : x ≤ 1
state_before: case pos
x✝ y x : ℝ
hx₁ : -1 ≤ x
⊢ cos (arcsin x) = √(1 - x ^ 2)
state_after: case pos
x✝ y x : ℝ
hx₁ : -1 ≤ x
hx₂ : x ≤ 1
⊢ cos (arcsin x) = √(1 - x ^ 2)

case neg
x✝ y x : ℝ
hx₁ : -1 ≤ x
hx₂ : ¬x ≤ 1
⊢ cos (arcsin x) = √(1 - x ^ 2)

tactic: swap
state_before: case pos
x✝ y x : ℝ
hx₁ : -1 ≤ x
hx₂ : x ≤ 1
⊢ cos (arcsin x) = √(1 - x ^ 2)

case neg
x✝ y x : ℝ
hx₁ : -1 ≤ x
hx₂ : ¬x ≤ 1
⊢ cos (arcsin x) = √(1 - x ^ 2)
state_after: case neg
x✝ y x : ℝ
hx₁ : -1 ≤ x
hx₂ : ¬x ≤ 1
⊢ cos (arcsin x) = √(1 - x ^ 2)

case pos
x✝ y x : ℝ
hx₁ : -1 ≤ x
hx₂ : x ≤ 1
⊢ cos (arcsin x) = √(1 - x ^ 2)

tactic: have : sin (arcsin x) ^ 2 + cos (arcsin x) ^ 2 = 1 := sin_sq_add_cos_sq (arcsin x)
state_before: case pos
x✝ y x : ℝ
hx₁ : -1 ≤ x
hx₂ : x ≤ 1
⊢ cos (arcsin x) = √(1 - x ^ 2)
state_after: case pos
x✝ y x : ℝ
hx₁ : -1 ≤ x
hx₂ : x ≤ 1
this : sin (arcsin x) ^ 2 + cos (arcsin x) ^ 2 = 1
⊢ cos (arcsin x) = √(1 - x ^ 2)

tactic: rw [← eq_sub_iff_add_eq', ← sqrt_inj (sq_nonneg _) (sub_nonneg.2 (sin_sq_le_one (arcsin x))), sq,
  sqrt_mul_self (cos_arcsin_nonneg _)] at this
state_before: case pos
x✝ y x : ℝ
hx₁ : -1 ≤ x
hx₂ : x ≤ 1
this : sin (arcsin x) ^ 2 + cos (arcsin x) ^ 2 = 1
⊢ cos (arcsin x) = √(1 - x ^ 2)
state_after: case pos
x✝ y x : ℝ
hx₁ : -1 ≤ x
hx₂ : x ≤ 1
this : cos (arcsin x) = √(1 - sin (arcsin x) ^ 2)
⊢ cos (arcsin x) = √(1 - x ^ 2)

tactic: rw [this, sin_arcsin hx₁ hx₂]
state_before: case pos
x✝ y x : ℝ
hx₁ : -1 ≤ x
hx₂ : x ≤ 1
this : cos (arcsin x) = √(1 - sin (arcsin x) ^ 2)
⊢ cos (arcsin x) = √(1 - x ^ 2)
state_after: no goals

tactic: rw [not_le] at hx₁
state_before: case neg
x✝ y x : ℝ
hx₁ : ¬-1 ≤ x
⊢ cos (arcsin x) = √(1 - x ^ 2)
state_after: case neg
x✝ y x : ℝ
hx₁ : x < -1
⊢ cos (arcsin x) = √(1 - x ^ 2)

tactic: rw [arcsin_of_le_neg_one hx₁.le, cos_neg, cos_pi_div_two, sqrt_eq_zero_of_nonpos]
state_before: case neg
x✝ y x : ℝ
hx₁ : x < -1
⊢ cos (arcsin x) = √(1 - x ^ 2)
state_after: case neg
x✝ y x : ℝ
hx₁ : x < -1
⊢ 1 - x ^ 2 ≤ 0

tactic: nlinarith
state_before: case neg
x✝ y x : ℝ
hx₁ : x < -1
⊢ 1 - x ^ 2 ≤ 0
state_after: no goals

tactic: rw [not_le] at hx₂
state_before: case neg
x✝ y x : ℝ
hx₁ : -1 ≤ x
hx₂ : ¬x ≤ 1
⊢ cos (arcsin x) = √(1 - x ^ 2)
state_after: case neg
x✝ y x : ℝ
hx₁ : -1 ≤ x
hx₂ : 1 < x
⊢ cos (arcsin x) = √(1 - x ^ 2)

tactic: rw [arcsin_of_one_le hx₂.le, cos_pi_div_two, sqrt_eq_zero_of_nonpos]
state_before: case neg
x✝ y x : ℝ
hx₁ : -1 ≤ x
hx₂ : 1 < x
⊢ cos (arcsin x) = √(1 - x ^ 2)
state_after: case neg
x✝ y x : ℝ
hx₁ : -1 ≤ x
hx₂ : 1 < x
⊢ 1 - x ^ 2 ≤ 0

tactic: nlinarith
state_before: case neg
x✝ y x : ℝ
hx₁ : -1 ≤ x
hx₂ : 1 < x
⊢ 1 - x ^ 2 ≤ 0
state_after: no goals