Theorem: Real.arctan_add_eq_add_pi
File: Mathlib/Analysis/SpecialFunctions/Trigonometric/Arctan.lean

tactic: have hy : 0 < y := by
  have := mul_pos_iff.mp (zero_lt_one.trans h)
  simpa [hx, hx.asymm]
state_before: x y : ℝ
h : 1 < x * y
hx : 0 < x
⊢ arctan x + arctan y = arctan ((x + y) / (1 - x * y)) + π
state_after: x y : ℝ
h : 1 < x * y
hx : 0 < x
hy : 0 < y
⊢ arctan x + arctan y = arctan ((x + y) / (1 - x * y)) + π

tactic: have k := arctan_add (mul_inv x y ▸ inv_lt_one h)
state_before: x y : ℝ
h : 1 < x * y
hx : 0 < x
hy : 0 < y
⊢ arctan x + arctan y = arctan ((x + y) / (1 - x * y)) + π
state_after: x y : ℝ
h : 1 < x * y
hx : 0 < x
hy : 0 < y
k : arctan x⁻¹ + arctan y⁻¹ = arctan ((x⁻¹ + y⁻¹) / (1 - x⁻¹ * y⁻¹))
⊢ arctan x + arctan y = arctan ((x + y) / (1 - x * y)) + π

tactic: rw [arctan_inv_of_pos hx, arctan_inv_of_pos hy, show _ + _ = π - (arctan x + arctan y) by ring,
  sub_eq_iff_eq_add, ← sub_eq_iff_eq_add', sub_eq_add_neg, ← arctan_neg, add_comm] at k
state_before: x y : ℝ
h : 1 < x * y
hx : 0 < x
hy : 0 < y
k : arctan x⁻¹ + arctan y⁻¹ = arctan ((x⁻¹ + y⁻¹) / (1 - x⁻¹ * y⁻¹))
⊢ arctan x + arctan y = arctan ((x + y) / (1 - x * y)) + π
state_after: x y : ℝ
h : 1 < x * y
hx : 0 < x
hy : 0 < y
k : arctan (-((x⁻¹ + y⁻¹) / (1 - x⁻¹ * y⁻¹))) + π = arctan x + arctan y
⊢ arctan x + arctan y = arctan ((x + y) / (1 - x * y)) + π

tactic: convert k.symm using 3
state_before: x y : ℝ
h : 1 < x * y
hx : 0 < x
hy : 0 < y
k : arctan (-((x⁻¹ + y⁻¹) / (1 - x⁻¹ * y⁻¹))) + π = arctan x + arctan y
⊢ arctan x + arctan y = arctan ((x + y) / (1 - x * y)) + π
state_after: case h.e'_3.h.e'_5.h.e'_1
x y : ℝ
h : 1 < x * y
hx : 0 < x
hy : 0 < y
k : arctan (-((x⁻¹ + y⁻¹) / (1 - x⁻¹ * y⁻¹))) + π = arctan x + arctan y
⊢ (x + y) / (1 - x * y) = -((x⁻¹ + y⁻¹) / (1 - x⁻¹ * y⁻¹))

tactic: field_simp
state_before: case h.e'_3.h.e'_5.h.e'_1
x y : ℝ
h : 1 < x * y
hx : 0 < x
hy : 0 < y
k : arctan (-((x⁻¹ + y⁻¹) / (1 - x⁻¹ * y⁻¹))) + π = arctan x + arctan y
⊢ (x + y) / (1 - x * y) = -((x⁻¹ + y⁻¹) / (1 - x⁻¹ * y⁻¹))
state_after: case h.e'_3.h.e'_5.h.e'_1
x y : ℝ
h : 1 < x * y
hx : 0 < x
hy : 0 < y
k : arctan (-((x⁻¹ + y⁻¹) / (1 - x⁻¹ * y⁻¹))) + π = arctan x + arctan y
⊢ (x + y) / (1 - x * y) = (-x + -y) / (x * y - 1)

tactic: rw [show -x + -y = -(x + y) by ring, show x * y - 1 = -(1 - x * y) by ring, neg_div_neg_eq]
state_before: case h.e'_3.h.e'_5.h.e'_1
x y : ℝ
h : 1 < x * y
hx : 0 < x
hy : 0 < y
k : arctan (-((x⁻¹ + y⁻¹) / (1 - x⁻¹ * y⁻¹))) + π = arctan x + arctan y
⊢ (x + y) / (1 - x * y) = (-x + -y) / (x * y - 1)
state_after: no goals

tactic: have := mul_pos_iff.mp (zero_lt_one.trans h)
state_before: x y : ℝ
h : 1 < x * y
hx : 0 < x
⊢ 0 < y
state_after: x y : ℝ
h : 1 < x * y
hx : 0 < x
this : 0 < x ∧ 0 < y ∨ x < 0 ∧ y < 0
⊢ 0 < y

tactic: simpa [hx, hx.asymm]
state_before: x y : ℝ
h : 1 < x * y
hx : 0 < x
this : 0 < x ∧ 0 < y ∨ x < 0 ∧ y < 0
⊢ 0 < y
state_after: no goals

tactic: ring
state_before: x y : ℝ
h : 1 < x * y
hx : 0 < x
hy : 0 < y
k : π / 2 - arctan x + (π / 2 - arctan y) = arctan ((x⁻¹ + y⁻¹) / (1 - x⁻¹ * y⁻¹))
⊢ π / 2 - arctan x + (π / 2 - arctan y) = π - (arctan x + arctan y)
state_after: no goals

tactic: ring
state_before: x y : ℝ
h : 1 < x * y
hx : 0 < x
hy : 0 < y
k : arctan (-((x⁻¹ + y⁻¹) / (1 - x⁻¹ * y⁻¹))) + π = arctan x + arctan y
⊢ -x + -y = -(x + y)
state_after: no goals

tactic: ring
state_before: x y : ℝ
h : 1 < x * y
hx : 0 < x
hy : 0 < y
k : arctan (-((x⁻¹ + y⁻¹) / (1 - x⁻¹ * y⁻¹))) + π = arctan x + arctan y
⊢ x * y - 1 = -(1 - x * y)
state_after: no goals