Documentation

Mathlib.Analysis.SpecialFunctions.Trigonometric.Arctan

The arctan function. #

Inequalities, identities and Real.tan as an OpenPartialHomeomorph between (-(ฯ€ / 2), ฯ€ / 2) and the whole line.

The result of arctan x + arctan y is given by arctan_add, arctan_add_eq_add_pi or arctan_add_eq_sub_pi depending on whether x * y < 1 and 0 < x. As an application of arctan_add we give four Machin-like formulas (linear combinations of arctangents equal to ฯ€ / 4 = arctan 1), including John Machin's original one at four_mul_arctan_inv_5_sub_arctan_inv_239.

theorem Real.tan_add {x y : โ„} (h : ((โˆ€ (k : โ„ค), x โ‰  (2 * โ†‘k + 1) * Real.pi / 2) โˆง โˆ€ (l : โ„ค), y โ‰  (2 * โ†‘l + 1) * Real.pi / 2) โˆจ (โˆƒ (k : โ„ค), x = (2 * โ†‘k + 1) * Real.pi / 2) โˆง โˆƒ (l : โ„ค), y = (2 * โ†‘l + 1) * Real.pi / 2) :
tan (x + y) = (tan x + tan y) / (1 - tan x * tan y)
theorem Real.tan_add' {x y : โ„} (h : (โˆ€ (k : โ„ค), x โ‰  (2 * โ†‘k + 1) * Real.pi / 2) โˆง โˆ€ (l : โ„ค), y โ‰  (2 * โ†‘l + 1) * Real.pi / 2) :
tan (x + y) = (tan x + tan y) / (1 - tan x * tan y)
theorem Real.tan_sub {x y : โ„} (h : ((โˆ€ (k : โ„ค), x โ‰  (2 * โ†‘k + 1) * Real.pi / 2) โˆง โˆ€ (l : โ„ค), y โ‰  (2 * โ†‘l + 1) * Real.pi / 2) โˆจ (โˆƒ (k : โ„ค), x = (2 * โ†‘k + 1) * Real.pi / 2) โˆง โˆƒ (l : โ„ค), y = (2 * โ†‘l + 1) * Real.pi / 2) :
tan (x - y) = (tan x - tan y) / (1 + tan x * tan y)
theorem Real.tan_sub' {x y : โ„} (h : (โˆ€ (k : โ„ค), x โ‰  (2 * โ†‘k + 1) * Real.pi / 2) โˆง โˆ€ (l : โ„ค), y โ‰  (2 * โ†‘l + 1) * Real.pi / 2) :
tan (x - y) = (tan x - tan y) / (1 + tan x * tan y)
theorem Real.tan_two_mul {x : โ„} :
tan (2 * x) = 2 * tan x / (1 - tan x ^ 2)
theorem Real.tan_int_mul_pi_div_two (n : โ„ค) :
tan (โ†‘n * Real.pi / 2) = 0
theorem Real.continuous_tan :
Continuous fun (x : โ†‘{x : โ„ | cos x โ‰  0}) => tan โ†‘x
theorem Real.tan_surjective :
Function.Surjective tan
noncomputable def Real.tanOrderIso :
โ†‘(Set.Ioo (-(Real.pi / 2)) (Real.pi / 2)) โ‰ƒo โ„

Real.tan as an OrderIso between (-(ฯ€ / 2), ฯ€ / 2) and โ„.

Instances For
    noncomputable def Real.arctan (x : โ„) :

    Inverse of the tan function, returns values in the range -ฯ€ / 2 < arctan x and arctan x < ฯ€ / 2

    Instances For
      theorem Real.arctan_tan {x : โ„} (hxโ‚ : -(Real.pi / 2) < x) (hxโ‚‚ : x < Real.pi / 2) :
      arctan (tan x) = x
      theorem Real.sin_sq_arctan (x : โ„) :
      sin (arctan x) ^ 2 = x ^ 2 / (1 + x ^ 2)
      theorem Real.cos_sq_arctan (x : โ„) :
      cos (arctan x) ^ 2 = 1 / (1 + x ^ 2)
      theorem Real.sin_arctan (x : โ„) :
      sin (arctan x) = x / โˆš(1 + x ^ 2)
      theorem Real.cos_arctan (x : โ„) :
      cos (arctan x) = 1 / โˆš(1 + x ^ 2)
      theorem Real.arcsin_eq_arctan {x : โ„} (h : x โˆˆ Set.Ioo (-1) 1) :
      arcsin x = arctan (x / โˆš(1 - x ^ 2))
      @[deprecated Real.arctan_strictMono (since := "2025-10-20")]
      theorem Real.arctan_lt_arctan {x y : โ„} (hxy : x < y) :
      @[simp]
      theorem Real.arctan_lt_arctan_iff {x y : โ„} :
      arctan x < arctan y โ†” x < y
      @[deprecated Real.arctan_mono (since := "2025-10-20")]
      theorem Real.arctan_le_arctan {x y : โ„} (hxy : x โ‰ค y) :
      @[simp]
      theorem Real.arctan_inj {x y : โ„} :
      arctan x = arctan y โ†” x = y
      @[simp]
      theorem Real.arctan_eq_zero_iff {x : โ„} :
      arctan x = 0 โ†” x = 0
      theorem Real.arctan_eq_of_tan_eq {x y : โ„} (h : tan x = y) (hx : x โˆˆ Set.Ioo (-(Real.pi / 2)) (Real.pi / 2)) :
      arctan y = x
      @[simp]
      theorem Real.arctan_eq_pi_div_four {x : โ„} :
      arctan x = Real.pi / 4 โ†” x = 1
      @[simp]
      theorem Real.arctan_eq_neg_pi_div_four {x : โ„} :
      arctan x = -(Real.pi / 4) โ†” x = -1
      @[simp]
      theorem Real.arctan_pos {x : โ„} :
      0 < arctan x โ†” 0 < x
      @[simp]
      theorem Real.arctan_lt_zero {x : โ„} :
      arctan x < 0 โ†” x < 0
      theorem Real.arccos_eq_arctan {x : โ„} (h : 0 < x) :
      arccos x = arctan (โˆš(1 - x ^ 2) / x)
      theorem Real.arctan_ne_mul_pi_div_two {x : โ„} (k : โ„ค) :
      arctan x โ‰  (2 * โ†‘k + 1) * Real.pi / 2
      theorem Real.arctan_add {x y : โ„} (h : x * y < 1) :
      arctan x + arctan y = arctan ((x + y) / (1 - x * y))
      theorem Real.arctan_add_eq_add_pi {x y : โ„} (h : 1 < x * y) (hx : 0 < x) :
      arctan x + arctan y = arctan ((x + y) / (1 - x * y)) + Real.pi
      theorem Real.arctan_add_eq_sub_pi {x y : โ„} (h : 1 < x * y) (hx : x < 0) :
      arctan x + arctan y = arctan ((x + y) / (1 - x * y)) - Real.pi
      theorem Real.two_mul_arctan {x : โ„} (hโ‚ : -1 < x) (hโ‚‚ : x < 1) :
      2 * arctan x = arctan (2 * x / (1 - x ^ 2))
      theorem Real.two_mul_arctan_add_pi {x : โ„} (h : 1 < x) :
      2 * arctan x = arctan (2 * x / (1 - x ^ 2)) + Real.pi
      theorem Real.two_mul_arctan_sub_pi {x : โ„} (h : x < -1) :
      2 * arctan x = arctan (2 * x / (1 - x ^ 2)) - Real.pi

      John Machin's 1706 formula, which he used to compute ฯ€ to 100 decimal places.

      @[simp]
      theorem Real.sin_arctan_pos {x : โ„} :
      0 < sin (arctan x) โ†” 0 < x
      @[simp]
      theorem Real.sin_arctan_lt_zero {x : โ„} :
      sin (arctan x) < 0 โ†” x < 0
      @[simp]
      theorem Real.sin_arctan_eq_zero {x : โ„} :
      sin (arctan x) = 0 โ†” x = 0

      Real.tan as an OpenPartialHomeomorph between (-(ฯ€ / 2), ฯ€ / 2) and the whole line.

      Instances For