analysis.special_functions.trigonometric.arctan
⟷
Mathlib.Analysis.SpecialFunctions.Trigonometric.Arctan
The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(last sync)
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -49,7 +49,7 @@ theorem tan_add' {x y : ℝ}
#print Real.tan_two_mul /-
theorem tan_two_mul {x : ℝ} : tan (2 * x) = 2 * tan x / (1 - tan x ^ 2) := by
simpa only [← Complex.ofReal_inj, Complex.ofReal_sub, Complex.ofReal_div, Complex.ofReal_pow,
- Complex.ofReal_mul, Complex.ofReal_tan, Complex.ofReal_bit0, Complex.ofReal_one] using
+ Complex.ofReal_mul, Complex.ofReal_tan, Complex.of_real_bit0, Complex.ofReal_one] using
Complex.tan_two_mul
#align real.tan_two_mul Real.tan_two_mul
-/
@@ -220,7 +220,7 @@ theorem arctan_eq_arcsin (x : ℝ) : arctan x = arcsin (x / sqrt (1 + x ^ 2)) :=
#print Real.arcsin_eq_arctan /-
theorem arcsin_eq_arctan {x : ℝ} (h : x ∈ Ioo (-(1 : ℝ)) 1) :
arcsin x = arctan (x / sqrt (1 - x ^ 2)) := by
- rw [arctan_eq_arcsin, div_pow, sq_sqrt, one_add_div, div_div, ← sqrt_mul, mul_div_cancel',
+ rw [arctan_eq_arcsin, div_pow, sq_sqrt, one_add_div, div_div, ← sqrt_mul, mul_div_cancel₀,
sub_add_cancel, sqrt_one, div_one] <;>
nlinarith [h.1, h.2]
#align real.arcsin_eq_arctan Real.arcsin_eq_arctan
@@ -257,7 +257,7 @@ theorem arctan_eq_arccos {x : ℝ} (h : 0 ≤ x) : arctan x = arccos (sqrt (1 +
by
rw [arctan_eq_arcsin, arccos_eq_arcsin]; swap; · exact inv_nonneg.2 (sqrt_nonneg _)
congr 1
- rw [← sqrt_inv, sq_sqrt, ← one_div, one_sub_div, add_sub_cancel', sqrt_div, sqrt_sq h]
+ rw [← sqrt_inv, sq_sqrt, ← one_div, one_sub_div, add_sub_cancel_left, sqrt_div, sqrt_sq h]
all_goals positivity
#align real.arctan_eq_arccos Real.arctan_eq_arccos
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -78,7 +78,7 @@ theorem continuousOn_tan : ContinuousOn tan {x | cos x ≠ 0} :=
suffices ContinuousOn (fun x => sin x / cos x) {x | cos x ≠ 0}
by
have h_eq : (fun x => sin x / cos x) = tan := by ext1 x; rw [tan_eq_sin_div_cos]
- rwa [h_eq] at this
+ rwa [h_eq] at this
exact continuous_on_sin.div continuous_on_cos fun x => id
#align real.continuous_on_tan Real.continuousOn_tan
-/
@@ -98,15 +98,15 @@ theorem continuousOn_tan_Ioo : ContinuousOn tan (Ioo (-(π / 2)) (π / 2)) :=
rw [cos_eq_zero_iff]
rintro hx_gt hx_lt ⟨r, hxr_eq⟩
cases le_or_lt 0 r
- · rw [lt_iff_not_ge] at hx_lt
+ · rw [lt_iff_not_ge] at hx_lt
refine' hx_lt _
rw [hxr_eq, ← one_mul (π / 2), mul_div_assoc, ge_iff_le, mul_le_mul_right (half_pos pi_pos)]
simp [h]
- · rw [lt_iff_not_ge] at hx_gt
+ · rw [lt_iff_not_ge] at hx_gt
refine' hx_gt _
rw [hxr_eq, ← one_mul (π / 2), mul_div_assoc, ge_iff_le, neg_mul_eq_neg_mul,
mul_le_mul_right (half_pos pi_pos)]
- have hr_le : r ≤ -1 := by rwa [Int.lt_iff_add_one_le, ← le_neg_iff_add_nonpos_right] at h
+ have hr_le : r ≤ -1 := by rwa [Int.lt_iff_add_one_le, ← le_neg_iff_add_nonpos_right] at h
rw [← le_sub_iff_add_le, mul_comm, ← le_div_iff]
· norm_num; rw [← Int.cast_one, ← Int.cast_neg]; norm_cast; exact hr_le
· exact zero_lt_two
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -287,9 +287,9 @@ theorem continuousAt_arctan {x : ℝ} : ContinuousAt arctan x :=
#align real.continuous_at_arctan Real.continuousAt_arctan
-/
-#print Real.tanLocalHomeomorph /-
+#print Real.tanPartialHomeomorph /-
/-- `real.tan` as a `local_homeomorph` between `(-(π / 2), π / 2)` and the whole line. -/
-def tanLocalHomeomorph : LocalHomeomorph ℝ ℝ
+def tanPartialHomeomorph : PartialHomeomorph ℝ ℝ
where
toFun := tan
invFun := arctan
@@ -303,21 +303,21 @@ def tanLocalHomeomorph : LocalHomeomorph ℝ ℝ
open_target := isOpen_univ
continuous_toFun := continuousOn_tan_Ioo
continuous_invFun := continuous_arctan.ContinuousOn
-#align real.tan_local_homeomorph Real.tanLocalHomeomorph
+#align real.tan_local_homeomorph Real.tanPartialHomeomorph
-/
-#print Real.coe_tanLocalHomeomorph /-
+#print Real.coe_tanPartialHomeomorph /-
@[simp]
-theorem coe_tanLocalHomeomorph : ⇑tanLocalHomeomorph = tan :=
+theorem coe_tanPartialHomeomorph : ⇑tanPartialHomeomorph = tan :=
rfl
-#align real.coe_tan_local_homeomorph Real.coe_tanLocalHomeomorph
+#align real.coe_tan_local_homeomorph Real.coe_tanPartialHomeomorph
-/
-#print Real.coe_tanLocalHomeomorph_symm /-
+#print Real.coe_tanPartialHomeomorph_symm /-
@[simp]
-theorem coe_tanLocalHomeomorph_symm : ⇑tanLocalHomeomorph.symm = arctan :=
+theorem coe_tanPartialHomeomorph_symm : ⇑tanPartialHomeomorph.symm = arctan :=
rfl
-#align real.coe_tan_local_homeomorph_symm Real.coe_tanLocalHomeomorph_symm
+#align real.coe_tan_local_homeomorph_symm Real.coe_tanPartialHomeomorph_symm
-/
end Real
mathlib commit https://github.com/leanprover-community/mathlib/commit/ce64cd319bb6b3e82f31c2d38e79080d377be451
@@ -3,7 +3,7 @@ Copyright (c) 2018 Chris Hughes. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Chris Hughes, Abhimanyu Pallavi Sudhir, Jean Lo, Calle Sönne, Benjamin Davidson
-/
-import Mathbin.Analysis.SpecialFunctions.Trigonometric.Complex
+import Analysis.SpecialFunctions.Trigonometric.Complex
#align_import analysis.special_functions.trigonometric.arctan from "leanprover-community/mathlib"@"c20927220ef87bb4962ba08bf6da2ce3cf50a6dd"
mathlib commit https://github.com/leanprover-community/mathlib/commit/8ea5598db6caeddde6cb734aa179cc2408dbd345
@@ -2,14 +2,11 @@
Copyright (c) 2018 Chris Hughes. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Chris Hughes, Abhimanyu Pallavi Sudhir, Jean Lo, Calle Sönne, Benjamin Davidson
-
-! This file was ported from Lean 3 source module analysis.special_functions.trigonometric.arctan
-! leanprover-community/mathlib commit c20927220ef87bb4962ba08bf6da2ce3cf50a6dd
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathbin.Analysis.SpecialFunctions.Trigonometric.Complex
+#align_import analysis.special_functions.trigonometric.arctan from "leanprover-community/mathlib"@"c20927220ef87bb4962ba08bf6da2ce3cf50a6dd"
+
/-!
# The `arctan` function.
mathlib commit https://github.com/leanprover-community/mathlib/commit/9fb8964792b4237dac6200193a0d533f1b3f7423
@@ -29,6 +29,7 @@ open Set Filter
open scoped Topology Real
+#print Real.tan_add /-
theorem tan_add {x y : ℝ}
(h :
((∀ k : ℤ, x ≠ (2 * k + 1) * π / 2) ∧ ∀ l : ℤ, y ≠ (2 * l + 1) * π / 2) ∨
@@ -38,12 +39,15 @@ theorem tan_add {x y : ℝ}
Complex.ofReal_mul, Complex.ofReal_tan] using
@Complex.tan_add (x : ℂ) (y : ℂ) (by convert h <;> norm_cast)
#align real.tan_add Real.tan_add
+-/
+#print Real.tan_add' /-
theorem tan_add' {x y : ℝ}
(h : (∀ k : ℤ, x ≠ (2 * k + 1) * π / 2) ∧ ∀ l : ℤ, y ≠ (2 * l + 1) * π / 2) :
tan (x + y) = (tan x + tan y) / (1 - tan x * tan y) :=
tan_add (Or.inl h)
#align real.tan_add' Real.tan_add'
+-/
#print Real.tan_two_mul /-
theorem tan_two_mul {x : ℝ} : tan (2 * x) = 2 * tan x / (1 - tan x ^ 2) := by
@@ -53,13 +57,17 @@ theorem tan_two_mul {x : ℝ} : tan (2 * x) = 2 * tan x / (1 - tan x ^ 2) := by
#align real.tan_two_mul Real.tan_two_mul
-/
+#print Real.tan_ne_zero_iff /-
theorem tan_ne_zero_iff {θ : ℝ} : tan θ ≠ 0 ↔ ∀ k : ℤ, θ ≠ k * π / 2 := by
rw [← Complex.ofReal_ne_zero, Complex.ofReal_tan, Complex.tan_ne_zero_iff] <;> norm_cast
#align real.tan_ne_zero_iff Real.tan_ne_zero_iff
+-/
+#print Real.tan_eq_zero_iff /-
theorem tan_eq_zero_iff {θ : ℝ} : tan θ = 0 ↔ ∃ k : ℤ, θ = k * π / 2 := by
rw [← not_iff_not, not_exists, ← Ne, tan_ne_zero_iff]
#align real.tan_eq_zero_iff Real.tan_eq_zero_iff
+-/
#print Real.tan_int_mul_pi_div_two /-
theorem tan_int_mul_pi_div_two (n : ℤ) : tan (n * π / 2) = 0 :=
@@ -67,6 +75,7 @@ theorem tan_int_mul_pi_div_two (n : ℤ) : tan (n * π / 2) = 0 :=
#align real.tan_int_mul_pi_div_two Real.tan_int_mul_pi_div_two
-/
+#print Real.continuousOn_tan /-
theorem continuousOn_tan : ContinuousOn tan {x | cos x ≠ 0} :=
by
suffices ContinuousOn (fun x => sin x / cos x) {x | cos x ≠ 0}
@@ -75,12 +84,16 @@ theorem continuousOn_tan : ContinuousOn tan {x | cos x ≠ 0} :=
rwa [h_eq] at this
exact continuous_on_sin.div continuous_on_cos fun x => id
#align real.continuous_on_tan Real.continuousOn_tan
+-/
+#print Real.continuous_tan /-
@[continuity]
theorem continuous_tan : Continuous fun x : {x | cos x ≠ 0} => tan x :=
continuousOn_iff_continuous_restrict.1 continuousOn_tan
#align real.continuous_tan Real.continuous_tan
+-/
+#print Real.continuousOn_tan_Ioo /-
theorem continuousOn_tan_Ioo : ContinuousOn tan (Ioo (-(π / 2)) (π / 2)) :=
by
refine' ContinuousOn.mono continuous_on_tan fun x => _
@@ -101,27 +114,34 @@ theorem continuousOn_tan_Ioo : ContinuousOn tan (Ioo (-(π / 2)) (π / 2)) :=
· norm_num; rw [← Int.cast_one, ← Int.cast_neg]; norm_cast; exact hr_le
· exact zero_lt_two
#align real.continuous_on_tan_Ioo Real.continuousOn_tan_Ioo
+-/
+#print Real.surjOn_tan /-
theorem surjOn_tan : SurjOn tan (Ioo (-(π / 2)) (π / 2)) univ :=
have := neg_lt_self pi_div_two_pos
continuousOn_tan_Ioo.surjOn_of_tendsto (nonempty_Ioo.2 this)
(by simp [tendsto_tan_neg_pi_div_two, this]) (by simp [tendsto_tan_pi_div_two, this])
#align real.surj_on_tan Real.surjOn_tan
+-/
#print Real.tan_surjective /-
theorem tan_surjective : Function.Surjective tan := fun x => surjOn_tan.subset_range trivial
#align real.tan_surjective Real.tan_surjective
-/
+#print Real.image_tan_Ioo /-
theorem image_tan_Ioo : tan '' Ioo (-(π / 2)) (π / 2) = univ :=
univ_subset_iff.1 surjOn_tan
#align real.image_tan_Ioo Real.image_tan_Ioo
+-/
+#print Real.tanOrderIso /-
/-- `real.tan` as an `order_iso` between `(-(π / 2), π / 2)` and `ℝ`. -/
def tanOrderIso : Ioo (-(π / 2)) (π / 2) ≃o ℝ :=
(strictMonoOn_tan.OrderIso _ _).trans <|
(OrderIso.setCongr _ _ image_tan_Ioo).trans OrderIso.Set.univ
#align real.tan_order_iso Real.tanOrderIso
+-/
#print Real.arctan /-
/-- Inverse of the `tan` function, returns values in the range `-π / 2 < arctan x` and
@@ -139,72 +159,103 @@ theorem tan_arctan (x : ℝ) : tan (arctan x) = x :=
#align real.tan_arctan Real.tan_arctan
-/
+#print Real.arctan_mem_Ioo /-
theorem arctan_mem_Ioo (x : ℝ) : arctan x ∈ Ioo (-(π / 2)) (π / 2) :=
Subtype.coe_prop _
#align real.arctan_mem_Ioo Real.arctan_mem_Ioo
+-/
+#print Real.range_arctan /-
@[simp]
theorem range_arctan : range arctan = Ioo (-(π / 2)) (π / 2) :=
((EquivLike.surjective _).range_comp _).trans Subtype.range_coe
#align real.range_arctan Real.range_arctan
+-/
+#print Real.arctan_tan /-
theorem arctan_tan {x : ℝ} (hx₁ : -(π / 2) < x) (hx₂ : x < π / 2) : arctan (tan x) = x :=
Subtype.ext_iff.1 <| tanOrderIso.symm_apply_apply ⟨x, hx₁, hx₂⟩
#align real.arctan_tan Real.arctan_tan
+-/
+#print Real.cos_arctan_pos /-
theorem cos_arctan_pos (x : ℝ) : 0 < cos (arctan x) :=
cos_pos_of_mem_Ioo <| arctan_mem_Ioo x
#align real.cos_arctan_pos Real.cos_arctan_pos
+-/
+#print Real.cos_sq_arctan /-
theorem cos_sq_arctan (x : ℝ) : cos (arctan x) ^ 2 = 1 / (1 + x ^ 2) := by
rw [one_div, ← inv_one_add_tan_sq (cos_arctan_pos x).ne', tan_arctan]
#align real.cos_sq_arctan Real.cos_sq_arctan
+-/
+#print Real.sin_arctan /-
theorem sin_arctan (x : ℝ) : sin (arctan x) = x / sqrt (1 + x ^ 2) := by
rw [← tan_div_sqrt_one_add_tan_sq (cos_arctan_pos x), tan_arctan]
#align real.sin_arctan Real.sin_arctan
+-/
+#print Real.cos_arctan /-
theorem cos_arctan (x : ℝ) : cos (arctan x) = 1 / sqrt (1 + x ^ 2) := by
rw [one_div, ← inv_sqrt_one_add_tan_sq (cos_arctan_pos x), tan_arctan]
#align real.cos_arctan Real.cos_arctan
+-/
+#print Real.arctan_lt_pi_div_two /-
theorem arctan_lt_pi_div_two (x : ℝ) : arctan x < π / 2 :=
(arctan_mem_Ioo x).2
#align real.arctan_lt_pi_div_two Real.arctan_lt_pi_div_two
+-/
+#print Real.neg_pi_div_two_lt_arctan /-
theorem neg_pi_div_two_lt_arctan (x : ℝ) : -(π / 2) < arctan x :=
(arctan_mem_Ioo x).1
#align real.neg_pi_div_two_lt_arctan Real.neg_pi_div_two_lt_arctan
+-/
+#print Real.arctan_eq_arcsin /-
theorem arctan_eq_arcsin (x : ℝ) : arctan x = arcsin (x / sqrt (1 + x ^ 2)) :=
Eq.symm <| arcsin_eq_of_sin_eq (sin_arctan x) (mem_Icc_of_Ioo <| arctan_mem_Ioo x)
#align real.arctan_eq_arcsin Real.arctan_eq_arcsin
+-/
+#print Real.arcsin_eq_arctan /-
theorem arcsin_eq_arctan {x : ℝ} (h : x ∈ Ioo (-(1 : ℝ)) 1) :
arcsin x = arctan (x / sqrt (1 - x ^ 2)) := by
rw [arctan_eq_arcsin, div_pow, sq_sqrt, one_add_div, div_div, ← sqrt_mul, mul_div_cancel',
sub_add_cancel, sqrt_one, div_one] <;>
nlinarith [h.1, h.2]
#align real.arcsin_eq_arctan Real.arcsin_eq_arctan
+-/
+#print Real.arctan_zero /-
@[simp]
theorem arctan_zero : arctan 0 = 0 := by simp [arctan_eq_arcsin]
#align real.arctan_zero Real.arctan_zero
+-/
+#print Real.arctan_eq_of_tan_eq /-
theorem arctan_eq_of_tan_eq {x y : ℝ} (h : tan x = y) (hx : x ∈ Ioo (-(π / 2)) (π / 2)) :
arctan y = x :=
injOn_tan (arctan_mem_Ioo _) hx (by rw [tan_arctan, h])
#align real.arctan_eq_of_tan_eq Real.arctan_eq_of_tan_eq
+-/
+#print Real.arctan_one /-
@[simp]
theorem arctan_one : arctan 1 = π / 4 :=
arctan_eq_of_tan_eq tan_pi_div_four <| by constructor <;> linarith [pi_pos]
#align real.arctan_one Real.arctan_one
+-/
+#print Real.arctan_neg /-
@[simp]
theorem arctan_neg (x : ℝ) : arctan (-x) = -arctan x := by simp [arctan_eq_arcsin, neg_div]
#align real.arctan_neg Real.arctan_neg
+-/
+#print Real.arctan_eq_arccos /-
theorem arctan_eq_arccos {x : ℝ} (h : 0 ≤ x) : arctan x = arccos (sqrt (1 + x ^ 2))⁻¹ :=
by
rw [arctan_eq_arcsin, arccos_eq_arcsin]; swap; · exact inv_nonneg.2 (sqrt_nonneg _)
@@ -212,7 +263,9 @@ theorem arctan_eq_arccos {x : ℝ} (h : 0 ≤ x) : arctan x = arccos (sqrt (1 +
rw [← sqrt_inv, sq_sqrt, ← one_div, one_sub_div, add_sub_cancel', sqrt_div, sqrt_sq h]
all_goals positivity
#align real.arctan_eq_arccos Real.arctan_eq_arccos
+-/
+#print Real.arccos_eq_arctan /-
-- The junk values for `arccos` and `sqrt` make this true even for `1 < x`.
theorem arccos_eq_arctan {x : ℝ} (h : 0 < x) : arccos x = arctan (sqrt (1 - x ^ 2) / x) :=
by
@@ -222,6 +275,7 @@ theorem arccos_eq_arctan {x : ℝ} (h : 0 < x) : arccos x = arctan (sqrt (1 - x
· linarith only [arcsin_le_pi_div_two x, pi_pos]
· linarith only [arcsin_pos.2 h]
#align real.arccos_eq_arctan Real.arccos_eq_arctan
+-/
#print Real.continuous_arctan /-
@[continuity]
mathlib commit https://github.com/leanprover-community/mathlib/commit/31c24aa72e7b3e5ed97a8412470e904f82b81004
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Chris Hughes, Abhimanyu Pallavi Sudhir, Jean Lo, Calle Sönne, Benjamin Davidson
! This file was ported from Lean 3 source module analysis.special_functions.trigonometric.arctan
-! leanprover-community/mathlib commit f2ce6086713c78a7f880485f7917ea547a215982
+! leanprover-community/mathlib commit c20927220ef87bb4962ba08bf6da2ce3cf50a6dd
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
@@ -13,6 +13,9 @@ import Mathbin.Analysis.SpecialFunctions.Trigonometric.Complex
/-!
# The `arctan` function.
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
Inequalities, derivatives,
and `real.tan` as a `local_homeomorph` between `(-(π / 2), π / 2)` and the whole line.
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/a3209ddf94136d36e5e5c624b10b2a347cc9d090
@@ -42,11 +42,13 @@ theorem tan_add' {x y : ℝ}
tan_add (Or.inl h)
#align real.tan_add' Real.tan_add'
+#print Real.tan_two_mul /-
theorem tan_two_mul {x : ℝ} : tan (2 * x) = 2 * tan x / (1 - tan x ^ 2) := by
simpa only [← Complex.ofReal_inj, Complex.ofReal_sub, Complex.ofReal_div, Complex.ofReal_pow,
Complex.ofReal_mul, Complex.ofReal_tan, Complex.ofReal_bit0, Complex.ofReal_one] using
Complex.tan_two_mul
#align real.tan_two_mul Real.tan_two_mul
+-/
theorem tan_ne_zero_iff {θ : ℝ} : tan θ ≠ 0 ↔ ∀ k : ℤ, θ ≠ k * π / 2 := by
rw [← Complex.ofReal_ne_zero, Complex.ofReal_tan, Complex.tan_ne_zero_iff] <;> norm_cast
@@ -56,9 +58,11 @@ theorem tan_eq_zero_iff {θ : ℝ} : tan θ = 0 ↔ ∃ k : ℤ, θ = k * π / 2
rw [← not_iff_not, not_exists, ← Ne, tan_ne_zero_iff]
#align real.tan_eq_zero_iff Real.tan_eq_zero_iff
+#print Real.tan_int_mul_pi_div_two /-
theorem tan_int_mul_pi_div_two (n : ℤ) : tan (n * π / 2) = 0 :=
tan_eq_zero_iff.mpr (by use n)
#align real.tan_int_mul_pi_div_two Real.tan_int_mul_pi_div_two
+-/
theorem continuousOn_tan : ContinuousOn tan {x | cos x ≠ 0} :=
by
@@ -101,8 +105,10 @@ theorem surjOn_tan : SurjOn tan (Ioo (-(π / 2)) (π / 2)) univ :=
(by simp [tendsto_tan_neg_pi_div_two, this]) (by simp [tendsto_tan_pi_div_two, this])
#align real.surj_on_tan Real.surjOn_tan
+#print Real.tan_surjective /-
theorem tan_surjective : Function.Surjective tan := fun x => surjOn_tan.subset_range trivial
#align real.tan_surjective Real.tan_surjective
+-/
theorem image_tan_Ioo : tan '' Ioo (-(π / 2)) (π / 2) = univ :=
univ_subset_iff.1 surjOn_tan
@@ -114,17 +120,21 @@ def tanOrderIso : Ioo (-(π / 2)) (π / 2) ≃o ℝ :=
(OrderIso.setCongr _ _ image_tan_Ioo).trans OrderIso.Set.univ
#align real.tan_order_iso Real.tanOrderIso
+#print Real.arctan /-
/-- Inverse of the `tan` function, returns values in the range `-π / 2 < arctan x` and
`arctan x < π / 2` -/
@[pp_nodot]
noncomputable def arctan (x : ℝ) : ℝ :=
tanOrderIso.symm x
#align real.arctan Real.arctan
+-/
+#print Real.tan_arctan /-
@[simp]
theorem tan_arctan (x : ℝ) : tan (arctan x) = x :=
tanOrderIso.apply_symm_apply x
#align real.tan_arctan Real.tan_arctan
+-/
theorem arctan_mem_Ioo (x : ℝ) : arctan x ∈ Ioo (-(π / 2)) (π / 2) :=
Subtype.coe_prop _
@@ -210,15 +220,20 @@ theorem arccos_eq_arctan {x : ℝ} (h : 0 < x) : arccos x = arctan (sqrt (1 - x
· linarith only [arcsin_pos.2 h]
#align real.arccos_eq_arctan Real.arccos_eq_arctan
+#print Real.continuous_arctan /-
@[continuity]
theorem continuous_arctan : Continuous arctan :=
continuous_subtype_val.comp tanOrderIso.toHomeomorph.continuous_invFun
#align real.continuous_arctan Real.continuous_arctan
+-/
+#print Real.continuousAt_arctan /-
theorem continuousAt_arctan {x : ℝ} : ContinuousAt arctan x :=
continuous_arctan.ContinuousAt
#align real.continuous_at_arctan Real.continuousAt_arctan
+-/
+#print Real.tanLocalHomeomorph /-
/-- `real.tan` as a `local_homeomorph` between `(-(π / 2), π / 2)` and the whole line. -/
def tanLocalHomeomorph : LocalHomeomorph ℝ ℝ
where
@@ -235,16 +250,21 @@ def tanLocalHomeomorph : LocalHomeomorph ℝ ℝ
continuous_toFun := continuousOn_tan_Ioo
continuous_invFun := continuous_arctan.ContinuousOn
#align real.tan_local_homeomorph Real.tanLocalHomeomorph
+-/
+#print Real.coe_tanLocalHomeomorph /-
@[simp]
theorem coe_tanLocalHomeomorph : ⇑tanLocalHomeomorph = tan :=
rfl
#align real.coe_tan_local_homeomorph Real.coe_tanLocalHomeomorph
+-/
+#print Real.coe_tanLocalHomeomorph_symm /-
@[simp]
theorem coe_tanLocalHomeomorph_symm : ⇑tanLocalHomeomorph.symm = arctan :=
rfl
#align real.coe_tan_local_homeomorph_symm Real.coe_tanLocalHomeomorph_symm
+-/
end Real
mathlib commit https://github.com/leanprover-community/mathlib/commit/5f25c089cb34db4db112556f23c50d12da81b297
@@ -60,9 +60,9 @@ theorem tan_int_mul_pi_div_two (n : ℤ) : tan (n * π / 2) = 0 :=
tan_eq_zero_iff.mpr (by use n)
#align real.tan_int_mul_pi_div_two Real.tan_int_mul_pi_div_two
-theorem continuousOn_tan : ContinuousOn tan { x | cos x ≠ 0 } :=
+theorem continuousOn_tan : ContinuousOn tan {x | cos x ≠ 0} :=
by
- suffices ContinuousOn (fun x => sin x / cos x) { x | cos x ≠ 0 }
+ suffices ContinuousOn (fun x => sin x / cos x) {x | cos x ≠ 0}
by
have h_eq : (fun x => sin x / cos x) = tan := by ext1 x; rw [tan_eq_sin_div_cos]
rwa [h_eq] at this
@@ -70,7 +70,7 @@ theorem continuousOn_tan : ContinuousOn tan { x | cos x ≠ 0 } :=
#align real.continuous_on_tan Real.continuousOn_tan
@[continuity]
-theorem continuous_tan : Continuous fun x : { x | cos x ≠ 0 } => tan x :=
+theorem continuous_tan : Continuous fun x : {x | cos x ≠ 0} => tan x :=
continuousOn_iff_continuous_restrict.1 continuousOn_tan
#align real.continuous_tan Real.continuous_tan
mathlib commit https://github.com/leanprover-community/mathlib/commit/cca40788df1b8755d5baf17ab2f27dacc2e17acb
@@ -65,7 +65,7 @@ theorem continuousOn_tan : ContinuousOn tan { x | cos x ≠ 0 } :=
suffices ContinuousOn (fun x => sin x / cos x) { x | cos x ≠ 0 }
by
have h_eq : (fun x => sin x / cos x) = tan := by ext1 x; rw [tan_eq_sin_div_cos]
- rwa [h_eq] at this
+ rwa [h_eq] at this
exact continuous_on_sin.div continuous_on_cos fun x => id
#align real.continuous_on_tan Real.continuousOn_tan
@@ -81,15 +81,15 @@ theorem continuousOn_tan_Ioo : ContinuousOn tan (Ioo (-(π / 2)) (π / 2)) :=
rw [cos_eq_zero_iff]
rintro hx_gt hx_lt ⟨r, hxr_eq⟩
cases le_or_lt 0 r
- · rw [lt_iff_not_ge] at hx_lt
+ · rw [lt_iff_not_ge] at hx_lt
refine' hx_lt _
rw [hxr_eq, ← one_mul (π / 2), mul_div_assoc, ge_iff_le, mul_le_mul_right (half_pos pi_pos)]
simp [h]
- · rw [lt_iff_not_ge] at hx_gt
+ · rw [lt_iff_not_ge] at hx_gt
refine' hx_gt _
rw [hxr_eq, ← one_mul (π / 2), mul_div_assoc, ge_iff_le, neg_mul_eq_neg_mul,
mul_le_mul_right (half_pos pi_pos)]
- have hr_le : r ≤ -1 := by rwa [Int.lt_iff_add_one_le, ← le_neg_iff_add_nonpos_right] at h
+ have hr_le : r ≤ -1 := by rwa [Int.lt_iff_add_one_le, ← le_neg_iff_add_nonpos_right] at h
rw [← le_sub_iff_add_le, mul_comm, ← le_div_iff]
· norm_num; rw [← Int.cast_one, ← Int.cast_neg]; norm_cast; exact hr_le
· exact zero_lt_two
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -24,7 +24,7 @@ namespace Real
open Set Filter
-open Topology Real
+open scoped Topology Real
theorem tan_add {x y : ℝ}
(h :
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -64,10 +64,7 @@ theorem continuousOn_tan : ContinuousOn tan { x | cos x ≠ 0 } :=
by
suffices ContinuousOn (fun x => sin x / cos x) { x | cos x ≠ 0 }
by
- have h_eq : (fun x => sin x / cos x) = tan :=
- by
- ext1 x
- rw [tan_eq_sin_div_cos]
+ have h_eq : (fun x => sin x / cos x) = tan := by ext1 x; rw [tan_eq_sin_div_cos]
rwa [h_eq] at this
exact continuous_on_sin.div continuous_on_cos fun x => id
#align real.continuous_on_tan Real.continuousOn_tan
@@ -94,10 +91,7 @@ theorem continuousOn_tan_Ioo : ContinuousOn tan (Ioo (-(π / 2)) (π / 2)) :=
mul_le_mul_right (half_pos pi_pos)]
have hr_le : r ≤ -1 := by rwa [Int.lt_iff_add_one_le, ← le_neg_iff_add_nonpos_right] at h
rw [← le_sub_iff_add_le, mul_comm, ← le_div_iff]
- · norm_num
- rw [← Int.cast_one, ← Int.cast_neg]
- norm_cast
- exact hr_le
+ · norm_num; rw [← Int.cast_one, ← Int.cast_neg]; norm_cast; exact hr_le
· exact zero_lt_two
#align real.continuous_on_tan_Ioo Real.continuousOn_tan_Ioo
mathlib commit https://github.com/leanprover-community/mathlib/commit/1a313d8bba1bad05faba71a4a4e9742ab5bd9efd
@@ -32,7 +32,7 @@ theorem tan_add {x y : ℝ}
(∃ k : ℤ, x = (2 * k + 1) * π / 2) ∧ ∃ l : ℤ, y = (2 * l + 1) * π / 2) :
tan (x + y) = (tan x + tan y) / (1 - tan x * tan y) := by
simpa only [← Complex.ofReal_inj, Complex.ofReal_sub, Complex.ofReal_add, Complex.ofReal_div,
- Complex.ofReal_mul, Complex.of_real_tan] using
+ Complex.ofReal_mul, Complex.ofReal_tan] using
@Complex.tan_add (x : ℂ) (y : ℂ) (by convert h <;> norm_cast)
#align real.tan_add Real.tan_add
@@ -44,12 +44,12 @@ theorem tan_add' {x y : ℝ}
theorem tan_two_mul {x : ℝ} : tan (2 * x) = 2 * tan x / (1 - tan x ^ 2) := by
simpa only [← Complex.ofReal_inj, Complex.ofReal_sub, Complex.ofReal_div, Complex.ofReal_pow,
- Complex.ofReal_mul, Complex.of_real_tan, Complex.ofReal_bit0, Complex.ofReal_one] using
+ Complex.ofReal_mul, Complex.ofReal_tan, Complex.ofReal_bit0, Complex.ofReal_one] using
Complex.tan_two_mul
#align real.tan_two_mul Real.tan_two_mul
theorem tan_ne_zero_iff {θ : ℝ} : tan θ ≠ 0 ↔ ∀ k : ℤ, θ ≠ k * π / 2 := by
- rw [← Complex.ofReal_ne_zero, Complex.of_real_tan, Complex.tan_ne_zero_iff] <;> norm_cast
+ rw [← Complex.ofReal_ne_zero, Complex.ofReal_tan, Complex.tan_ne_zero_iff] <;> norm_cast
#align real.tan_ne_zero_iff Real.tan_ne_zero_iff
theorem tan_eq_zero_iff {θ : ℝ} : tan θ = 0 ↔ ∃ k : ℤ, θ = k * π / 2 := by
mathlib commit https://github.com/leanprover-community/mathlib/commit/ddec54a71a0dd025c05445d467f1a2b7d586a3ba
@@ -31,8 +31,8 @@ theorem tan_add {x y : ℝ}
((∀ k : ℤ, x ≠ (2 * k + 1) * π / 2) ∧ ∀ l : ℤ, y ≠ (2 * l + 1) * π / 2) ∨
(∃ k : ℤ, x = (2 * k + 1) * π / 2) ∧ ∃ l : ℤ, y = (2 * l + 1) * π / 2) :
tan (x + y) = (tan x + tan y) / (1 - tan x * tan y) := by
- simpa only [← Complex.of_real_inj, Complex.of_real_sub, Complex.of_real_add, Complex.of_real_div,
- Complex.of_real_mul, Complex.of_real_tan] using
+ simpa only [← Complex.ofReal_inj, Complex.ofReal_sub, Complex.ofReal_add, Complex.ofReal_div,
+ Complex.ofReal_mul, Complex.of_real_tan] using
@Complex.tan_add (x : ℂ) (y : ℂ) (by convert h <;> norm_cast)
#align real.tan_add Real.tan_add
@@ -43,13 +43,13 @@ theorem tan_add' {x y : ℝ}
#align real.tan_add' Real.tan_add'
theorem tan_two_mul {x : ℝ} : tan (2 * x) = 2 * tan x / (1 - tan x ^ 2) := by
- simpa only [← Complex.of_real_inj, Complex.of_real_sub, Complex.of_real_div, Complex.of_real_pow,
- Complex.of_real_mul, Complex.of_real_tan, Complex.of_real_bit0, Complex.of_real_one] using
+ simpa only [← Complex.ofReal_inj, Complex.ofReal_sub, Complex.ofReal_div, Complex.ofReal_pow,
+ Complex.ofReal_mul, Complex.of_real_tan, Complex.ofReal_bit0, Complex.ofReal_one] using
Complex.tan_two_mul
#align real.tan_two_mul Real.tan_two_mul
theorem tan_ne_zero_iff {θ : ℝ} : tan θ ≠ 0 ↔ ∀ k : ℤ, θ ≠ k * π / 2 := by
- rw [← Complex.of_real_ne_zero, Complex.of_real_tan, Complex.tan_ne_zero_iff] <;> norm_cast
+ rw [← Complex.ofReal_ne_zero, Complex.of_real_tan, Complex.tan_ne_zero_iff] <;> norm_cast
#align real.tan_ne_zero_iff Real.tan_ne_zero_iff
theorem tan_eq_zero_iff {θ : ℝ} : tan θ = 0 ↔ ∃ k : ℤ, θ = k * π / 2 := by
mathlib commit https://github.com/leanprover-community/mathlib/commit/bd9851ca476957ea4549eb19b40e7b5ade9428cc
This adds the notation √r
for Real.sqrt r
. The precedence is such that √x⁻¹
is parsed as √(x⁻¹)
; not because this is particularly desirable, but because it's the default and the choice doesn't really matter.
This is extracted from #7907, which adds a more general nth root typeclass.
The idea is to perform all the boring substitutions downstream quickly, so that we can play around with custom elaborators with a much slower rate of code-rot.
This PR also won't rot as quickly, as it does not forbid writing x.sqrt
as that PR does.
While perhaps claiming √
for Real.sqrt
is greedy; it:
NNReal.sqrt
and Nat.sqrt
sqrt
on Float
Co-authored-by: Yury G. Kudryashov <urkud@urkud.name>
@@ -139,11 +139,11 @@ theorem cos_sq_arctan (x : ℝ) : cos (arctan x) ^ 2 = 1 / (1 + x ^ 2) := by
rw_mod_cast [one_div, ← inv_one_add_tan_sq (cos_arctan_pos x).ne', tan_arctan]
#align real.cos_sq_arctan Real.cos_sq_arctan
-theorem sin_arctan (x : ℝ) : sin (arctan x) = x / sqrt (1 + x ^ 2) := by
+theorem sin_arctan (x : ℝ) : sin (arctan x) = x / √(1 + x ^ 2) := by
rw_mod_cast [← tan_div_sqrt_one_add_tan_sq (cos_arctan_pos x), tan_arctan]
#align real.sin_arctan Real.sin_arctan
-theorem cos_arctan (x : ℝ) : cos (arctan x) = 1 / sqrt (1 + x ^ 2) := by
+theorem cos_arctan (x : ℝ) : cos (arctan x) = 1 / √(1 + x ^ 2) := by
rw_mod_cast [one_div, ← inv_sqrt_one_add_tan_sq (cos_arctan_pos x), tan_arctan]
#align real.cos_arctan Real.cos_arctan
@@ -155,12 +155,12 @@ theorem neg_pi_div_two_lt_arctan (x : ℝ) : -(π / 2) < arctan x :=
(arctan_mem_Ioo x).1
#align real.neg_pi_div_two_lt_arctan Real.neg_pi_div_two_lt_arctan
-theorem arctan_eq_arcsin (x : ℝ) : arctan x = arcsin (x / sqrt (1 + x ^ 2)) :=
+theorem arctan_eq_arcsin (x : ℝ) : arctan x = arcsin (x / √(1 + x ^ 2)) :=
Eq.symm <| arcsin_eq_of_sin_eq (sin_arctan x) (mem_Icc_of_Ioo <| arctan_mem_Ioo x)
#align real.arctan_eq_arcsin Real.arctan_eq_arcsin
theorem arcsin_eq_arctan {x : ℝ} (h : x ∈ Ioo (-(1 : ℝ)) 1) :
- arcsin x = arctan (x / sqrt (1 - x ^ 2)) := by
+ arcsin x = arctan (x / √(1 - x ^ 2)) := by
rw_mod_cast [arctan_eq_arcsin, div_pow, sq_sqrt, one_add_div, div_div, ← sqrt_mul,
mul_div_cancel₀, sub_add_cancel, sqrt_one, div_one] <;> simp at h <;> nlinarith [h.1, h.2]
#align real.arcsin_eq_arctan Real.arcsin_eq_arctan
@@ -198,7 +198,7 @@ theorem arctan_one : arctan 1 = π / 4 :=
theorem arctan_neg (x : ℝ) : arctan (-x) = -arctan x := by simp [arctan_eq_arcsin, neg_div]
#align real.arctan_neg Real.arctan_neg
-theorem arctan_eq_arccos {x : ℝ} (h : 0 ≤ x) : arctan x = arccos (sqrt (1 + x ^ 2))⁻¹ := by
+theorem arctan_eq_arccos {x : ℝ} (h : 0 ≤ x) : arctan x = arccos (√(1 + x ^ 2))⁻¹ := by
rw [arctan_eq_arcsin, arccos_eq_arcsin]; swap; · exact inv_nonneg.2 (sqrt_nonneg _)
congr 1
rw_mod_cast [← sqrt_inv, sq_sqrt, ← one_div, one_sub_div, add_sub_cancel_left, sqrt_div,
@@ -207,7 +207,7 @@ theorem arctan_eq_arccos {x : ℝ} (h : 0 ≤ x) : arctan x = arccos (sqrt (1 +
#align real.arctan_eq_arccos Real.arctan_eq_arccos
-- The junk values for `arccos` and `sqrt` make this true even for `1 < x`.
-theorem arccos_eq_arctan {x : ℝ} (h : 0 < x) : arccos x = arctan (sqrt (1 - x ^ 2) / x) := by
+theorem arccos_eq_arctan {x : ℝ} (h : 0 < x) : arccos x = arctan (√(1 - x ^ 2) / x) := by
rw [arccos, eq_comm]
refine' arctan_eq_of_tan_eq _ ⟨_, _⟩
· rw_mod_cast [tan_pi_div_two_sub, tan_arcsin, inv_div]
@@ -67,7 +67,7 @@ theorem continuous_tan : Continuous fun x : {x | cos x ≠ 0} => tan x :=
theorem continuousOn_tan_Ioo : ContinuousOn tan (Ioo (-(π / 2)) (π / 2)) := by
refine' ContinuousOn.mono continuousOn_tan fun x => _
- simp only [and_imp, mem_Ioo, mem_setOf_eq, Ne.def]
+ simp only [and_imp, mem_Ioo, mem_setOf_eq, Ne]
rw [cos_eq_zero_iff]
rintro hx_gt hx_lt ⟨r, hxr_eq⟩
rcases le_or_lt 0 r with h | h
mul
-div
cancellation lemmas (#11530)
Lemma names around cancellation of multiplication and division are a mess.
This PR renames a handful of them according to the following table (each big row contains the multiplicative statement, then the three rows contain the GroupWithZero
lemma name, the Group
lemma, the AddGroup
lemma name).
| Statement | New name | Old name | |
@@ -162,7 +162,7 @@ theorem arctan_eq_arcsin (x : ℝ) : arctan x = arcsin (x / sqrt (1 + x ^ 2)) :=
theorem arcsin_eq_arctan {x : ℝ} (h : x ∈ Ioo (-(1 : ℝ)) 1) :
arcsin x = arctan (x / sqrt (1 - x ^ 2)) := by
rw_mod_cast [arctan_eq_arcsin, div_pow, sq_sqrt, one_add_div, div_div, ← sqrt_mul,
- mul_div_cancel', sub_add_cancel, sqrt_one, div_one] <;> simp at h <;> nlinarith [h.1, h.2]
+ mul_div_cancel₀, sub_add_cancel, sqrt_one, div_one] <;> simp at h <;> nlinarith [h.1, h.2]
#align real.arcsin_eq_arctan Real.arcsin_eq_arctan
@[simp]
@@ -201,7 +201,8 @@ theorem arctan_neg (x : ℝ) : arctan (-x) = -arctan x := by simp [arctan_eq_arc
theorem arctan_eq_arccos {x : ℝ} (h : 0 ≤ x) : arctan x = arccos (sqrt (1 + x ^ 2))⁻¹ := by
rw [arctan_eq_arcsin, arccos_eq_arcsin]; swap; · exact inv_nonneg.2 (sqrt_nonneg _)
congr 1
- rw_mod_cast [← sqrt_inv, sq_sqrt, ← one_div, one_sub_div, add_sub_cancel', sqrt_div, sqrt_sq h]
+ rw_mod_cast [← sqrt_inv, sq_sqrt, ← one_div, one_sub_div, add_sub_cancel_left, sqrt_div,
+ sqrt_sq h]
all_goals positivity
#align real.arctan_eq_arccos Real.arctan_eq_arccos
This is a very large PR, but it has been reviewed piecemeal already in PRs to the bump/v4.7.0
branch as we update to intermediate nightlies.
Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Kyle Miller <kmill31415@gmail.com> Co-authored-by: damiano <adomani@gmail.com>
@@ -81,7 +81,8 @@ theorem continuousOn_tan_Ioo : ContinuousOn tan (Ioo (-(π / 2)) (π / 2)) := by
mul_le_mul_right (half_pos pi_pos)]
have hr_le : r ≤ -1 := by rwa [Int.lt_iff_add_one_le, ← le_neg_iff_add_nonpos_right] at h
rw [← le_sub_iff_add_le, mul_comm, ← le_div_iff]
- · norm_num; rw [← Int.cast_one, ← Int.cast_neg]; norm_cast
+ · set_option tactic.skipAssignedInstances false in norm_num
+ rw [← Int.cast_one, ← Int.cast_neg]; norm_cast
· exact zero_lt_two
#align real.continuous_on_tan_Ioo Real.continuousOn_tan_Ioo
@@ -168,6 +168,21 @@ theorem arcsin_eq_arctan {x : ℝ} (h : x ∈ Ioo (-(1 : ℝ)) 1) :
theorem arctan_zero : arctan 0 = 0 := by simp [arctan_eq_arcsin]
#align real.arctan_zero Real.arctan_zero
+@[mono]
+theorem arctan_strictMono : StrictMono arctan := tanOrderIso.symm.strictMono
+
+theorem arctan_injective : arctan.Injective := arctan_strictMono.injective
+
+@[simp]
+theorem arctan_eq_zero_iff {x : ℝ} : arctan x = 0 ↔ x = 0 :=
+ .trans (by rw [arctan_zero]) arctan_injective.eq_iff
+
+theorem tendsto_arctan_atTop : Tendsto arctan atTop (𝓝[<] (π / 2)) :=
+ tendsto_Ioo_atTop.mp tanOrderIso.symm.tendsto_atTop
+
+theorem tendsto_arctan_atBot : Tendsto arctan atBot (𝓝[>] (-(π / 2))) :=
+ tendsto_Ioo_atBot.mp tanOrderIso.symm.tendsto_atBot
+
theorem arctan_eq_of_tan_eq {x y : ℝ} (h : tan x = y) (hx : x ∈ Ioo (-(π / 2)) (π / 2)) :
arctan y = x :=
injOn_tan (arctan_mem_Ioo _) hx (by rw [tan_arctan, h])
@@ -10,8 +10,14 @@ import Mathlib.Analysis.SpecialFunctions.Trigonometric.Complex
/-!
# The `arctan` function.
-Inequalities, derivatives,
-and `Real.tan` as a `PartialHomeomorph` between `(-(π / 2), π / 2)` and the whole line.
+Inequalities, identities and `Real.tan` as a `PartialHomeomorph` 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`.
-/
@@ -192,6 +198,94 @@ theorem arccos_eq_arctan {x : ℝ} (h : 0 < x) : arccos x = arctan (sqrt (1 - x
· linarith only [arcsin_pos.2 h]
#align real.arccos_eq_arctan Real.arccos_eq_arctan
+theorem arctan_inv_of_pos {x : ℝ} (h : 0 < x) : arctan x⁻¹ = π / 2 - arctan x := by
+ rw [← arctan_tan (x := _ - _), tan_pi_div_two_sub, tan_arctan]
+ · norm_num
+ exact (arctan_lt_pi_div_two x).trans (half_lt_self_iff.mpr pi_pos)
+ · rw [sub_lt_self_iff, ← arctan_zero]
+ exact tanOrderIso.symm.strictMono h
+
+theorem arctan_inv_of_neg {x : ℝ} (h : x < 0) : arctan x⁻¹ = -(π / 2) - arctan x := by
+ have := arctan_inv_of_pos (neg_pos.mpr h)
+ rwa [inv_neg, arctan_neg, neg_eq_iff_eq_neg, neg_sub', arctan_neg, neg_neg] at this
+
+section ArctanAdd
+
+lemma arctan_ne_mul_pi_div_two {x : ℝ} : ∀ (k : ℤ), arctan x ≠ (2 * k + 1) * π / 2 := by
+ by_contra!
+ obtain ⟨k, h⟩ := this
+ obtain ⟨lb, ub⟩ := arctan_mem_Ioo x
+ rw [h, neg_eq_neg_one_mul, mul_div_assoc, mul_lt_mul_right (by positivity)] at lb
+ rw [h, ← one_mul (π / 2), mul_div_assoc, mul_lt_mul_right (by positivity)] at ub
+ norm_cast at lb ub; change -1 < _ at lb; omega
+
+lemma arctan_add_arctan_lt_pi_div_two {x y : ℝ} (h : x * y < 1) : arctan x + arctan y < π / 2 := by
+ cases' le_or_lt y 0 with hy hy
+ · rw [← add_zero (π / 2), ← arctan_zero]
+ exact add_lt_add_of_lt_of_le (arctan_lt_pi_div_two _) (tanOrderIso.symm.monotone hy)
+ · rw [← lt_div_iff hy, ← inv_eq_one_div] at h
+ replace h : arctan x < arctan y⁻¹ := tanOrderIso.symm.strictMono h
+ rwa [arctan_inv_of_pos hy, lt_tsub_iff_right] at h
+
+theorem arctan_add {x y : ℝ} (h : x * y < 1) :
+ arctan x + arctan y = arctan ((x + y) / (1 - x * y)) := by
+ rw [← arctan_tan (x := _ + _)]
+ · congr
+ conv_rhs => rw [← tan_arctan x, ← tan_arctan y]
+ exact tan_add' ⟨arctan_ne_mul_pi_div_two, arctan_ne_mul_pi_div_two⟩
+ · rw [neg_lt, neg_add, ← arctan_neg, ← arctan_neg]
+ rw [← neg_mul_neg] at h
+ exact arctan_add_arctan_lt_pi_div_two h
+ · exact arctan_add_arctan_lt_pi_div_two h
+
+theorem arctan_add_eq_add_pi {x y : ℝ} (h : 1 < x * y) (hx : 0 < x) :
+ arctan x + arctan y = arctan ((x + y) / (1 - x * y)) + π := by
+ have hy : 0 < y := by
+ have := mul_pos_iff.mp (zero_lt_one.trans h)
+ simpa [hx, hx.asymm]
+ have k := arctan_add (mul_inv x y ▸ inv_lt_one h)
+ 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
+ convert k.symm using 3
+ field_simp
+ rw [show -x + -y = -(x + y) by ring, show x * y - 1 = -(1 - x * y) by ring, neg_div_neg_eq]
+
+theorem arctan_add_eq_sub_pi {x y : ℝ} (h : 1 < x * y) (hx : x < 0) :
+ arctan x + arctan y = arctan ((x + y) / (1 - x * y)) - π := by
+ rw [← neg_mul_neg] at h
+ have k := arctan_add_eq_add_pi h (neg_pos.mpr hx)
+ rw [show _ / _ = -((x + y) / (1 - x * y)) by ring, ← neg_inj] at k
+ simp only [arctan_neg, neg_add, neg_neg, ← sub_eq_add_neg _ π] at k
+ exact k
+
+theorem two_mul_arctan {x : ℝ} (h₁ : -1 < x) (h₂ : x < 1) :
+ 2 * arctan x = arctan (2 * x / (1 - x ^ 2)) := by
+ rw [two_mul, arctan_add (by nlinarith)]; congr 1; ring
+
+theorem two_mul_arctan_add_pi {x : ℝ} (h : 1 < x) :
+ 2 * arctan x = arctan (2 * x / (1 - x ^ 2)) + π := by
+ rw [two_mul, arctan_add_eq_add_pi (by nlinarith) (by linarith)]; congr 2; ring
+
+theorem two_mul_arctan_sub_pi {x : ℝ} (h : x < -1) :
+ 2 * arctan x = arctan (2 * x / (1 - x ^ 2)) - π := by
+ rw [two_mul, arctan_add_eq_sub_pi (by nlinarith) (by linarith)]; congr 2; ring
+
+theorem arctan_inv_2_add_arctan_inv_3 : arctan 2⁻¹ + arctan 3⁻¹ = π / 4 := by
+ rw [arctan_add] <;> norm_num
+
+theorem two_mul_arctan_inv_2_sub_arctan_inv_7 : 2 * arctan 2⁻¹ - arctan 7⁻¹ = π / 4 := by
+ rw [two_mul_arctan, ← arctan_one, sub_eq_iff_eq_add, arctan_add] <;> norm_num
+
+theorem two_mul_arctan_inv_3_add_arctan_inv_7 : 2 * arctan 3⁻¹ + arctan 7⁻¹ = π / 4 := by
+ rw [two_mul_arctan, arctan_add] <;> norm_num
+
+/-- **John Machin's 1706 formula**, which he used to compute π to 100 decimal places. -/
+theorem four_mul_arctan_inv_5_sub_arctan_inv_239 : 4 * arctan 5⁻¹ - arctan 239⁻¹ = π / 4 := by
+ rw [show 4 * arctan _ = 2 * (2 * _) by ring, two_mul_arctan, two_mul_arctan, ← arctan_one,
+ sub_eq_iff_eq_add, arctan_add] <;> norm_num
+
+end ArctanAdd
+
@[continuity]
theorem continuous_arctan : Continuous arctan :=
continuous_subtype_val.comp tanOrderIso.toHomeomorph.continuous_invFun
Complex.tan_eq_zero_iff'
(#9877)
This version assumes that the cosine is not zero.
@@ -43,14 +43,6 @@ theorem tan_two_mul {x : ℝ} : tan (2 * x) = 2 * tan x / (1 - tan x ^ 2) := by
norm_cast at *
#align real.tan_two_mul Real.tan_two_mul
-theorem tan_ne_zero_iff {θ : ℝ} : tan θ ≠ 0 ↔ ∀ k : ℤ, θ ≠ k * π / 2 := by
- rw [← Complex.ofReal_ne_zero, Complex.ofReal_tan, Complex.tan_ne_zero_iff]; norm_cast
-#align real.tan_ne_zero_iff Real.tan_ne_zero_iff
-
-theorem tan_eq_zero_iff {θ : ℝ} : tan θ = 0 ↔ ∃ k : ℤ, θ = k * π / 2 := by
- rw [← not_iff_not, not_exists, ← Ne, tan_ne_zero_iff]
-#align real.tan_eq_zero_iff Real.tan_eq_zero_iff
-
theorem tan_int_mul_pi_div_two (n : ℤ) : tan (n * π / 2) = 0 :=
tan_eq_zero_iff.mpr (by use n)
#align real.tan_int_mul_pi_div_two Real.tan_int_mul_pi_div_two
cases'
(#9171)
I literally went through and regex'd some uses of cases'
, replacing them with rcases
; this is meant to be a low effort PR as I hope that tools can do this in the future.
rcases
is an easier replacement than cases
, though with better tools we could in future do a second pass converting simple rcases
added here (and existing ones) to cases
.
@@ -72,7 +72,7 @@ theorem continuousOn_tan_Ioo : ContinuousOn tan (Ioo (-(π / 2)) (π / 2)) := by
simp only [and_imp, mem_Ioo, mem_setOf_eq, Ne.def]
rw [cos_eq_zero_iff]
rintro hx_gt hx_lt ⟨r, hxr_eq⟩
- cases' le_or_lt 0 r with h h
+ rcases le_or_lt 0 r with h | h
· rw [lt_iff_not_ge] at hx_lt
refine' hx_lt _
rw [hxr_eq, ← one_mul (π / 2), mul_div_assoc, ge_iff_le, mul_le_mul_right (half_pos pi_pos)]
LocalHomeomorph
evokes a "local homeomorphism": this is not what this means.
Instead, this is a homeomorphism on an open set of the domain (extended to the whole space, by the junk value pattern). Hence, partial homeomorphism is more appropriate, and avoids confusion with IsLocallyHomeomorph
.
A future PR will rename LocalEquiv
to PartialEquiv
.
@@ -11,7 +11,7 @@ import Mathlib.Analysis.SpecialFunctions.Trigonometric.Complex
# The `arctan` function.
Inequalities, derivatives,
-and `Real.tan` as a `LocalHomeomorph` between `(-(π / 2), π / 2)` and the whole line.
+and `Real.tan` as a `PartialHomeomorph` between `(-(π / 2), π / 2)` and the whole line.
-/
@@ -209,8 +209,8 @@ theorem continuousAt_arctan {x : ℝ} : ContinuousAt arctan x :=
continuous_arctan.continuousAt
#align real.continuous_at_arctan Real.continuousAt_arctan
-/-- `Real.tan` as a `LocalHomeomorph` between `(-(π / 2), π / 2)` and the whole line. -/
-def tanLocalHomeomorph : LocalHomeomorph ℝ ℝ where
+/-- `Real.tan` as a `PartialHomeomorph` between `(-(π / 2), π / 2)` and the whole line. -/
+def tanPartialHomeomorph : PartialHomeomorph ℝ ℝ where
toFun := tan
invFun := arctan
source := Ioo (-(π / 2)) (π / 2)
@@ -223,16 +223,16 @@ def tanLocalHomeomorph : LocalHomeomorph ℝ ℝ where
open_target := isOpen_univ
continuousOn_toFun := continuousOn_tan_Ioo
continuousOn_invFun := continuous_arctan.continuousOn
-#align real.tan_local_homeomorph Real.tanLocalHomeomorph
+#align real.tan_local_homeomorph Real.tanPartialHomeomorph
@[simp]
-theorem coe_tanLocalHomeomorph : ⇑tanLocalHomeomorph = tan :=
+theorem coe_tanPartialHomeomorph : ⇑tanPartialHomeomorph = tan :=
rfl
-#align real.coe_tan_local_homeomorph Real.coe_tanLocalHomeomorph
+#align real.coe_tan_local_homeomorph Real.coe_tanPartialHomeomorph
@[simp]
-theorem coe_tanLocalHomeomorph_symm : ⇑tanLocalHomeomorph.symm = arctan :=
+theorem coe_tanPartialHomeomorph_symm : ⇑tanPartialHomeomorph.symm = arctan :=
rfl
-#align real.coe_tan_local_homeomorph_symm Real.coe_tanLocalHomeomorph_symm
+#align real.coe_tan_local_homeomorph_symm Real.coe_tanPartialHomeomorph_symm
end Real
They have type ContinuousOn ..., hence should be named accordingly. Suggested by @fpvandoorn in #8736.
@@ -221,8 +221,8 @@ def tanLocalHomeomorph : LocalHomeomorph ℝ ℝ where
right_inv' y _ := tan_arctan y
open_source := isOpen_Ioo
open_target := isOpen_univ
- continuous_toFun := continuousOn_tan_Ioo
- continuous_invFun := continuous_arctan.continuousOn
+ continuousOn_toFun := continuousOn_tan_Ioo
+ continuousOn_invFun := continuous_arctan.continuousOn
#align real.tan_local_homeomorph Real.tanLocalHomeomorph
@[simp]
This is the supremum of
along with some minor fixes from failures on nightly-testing as Mathlib master
is merged into it.
Note that some PRs for changes that are already compatible with the current toolchain and will be necessary have already been split out: #8380.
I am hopeful that in future we will be able to progressively merge adaptation PRs into a bump/v4.X.0
branch, so we never end up with a "big merge" like this. However one of these adaptation PRs (#8056) predates my new scheme for combined CI, and it wasn't possible to keep that PR viable in the meantime.
In particular this includes adjustments for the Lean PRs
We can get rid of all the
local macro_rules | `($x ^ $y) => `(HPow.hPow $x $y) -- Porting note: See issue [lean4#2220](https://github.com/leanprover/lean4/pull/2220)
macros across Mathlib (and in any projects that want to write natural number powers of reals).
Changes the default behaviour of simp
to (config := {decide := false})
. This makes simp
(and consequentially norm_num
) less powerful, but also more consistent, and less likely to blow up in long failures. This requires a variety of changes: changing some previously by simp
or norm_num
to decide
or rfl
, or adding (config := {decide := true})
.
This changed the behaviour of simp
so that simp [f]
will only unfold "fully applied" occurrences of f
. The old behaviour can be recovered with simp (config := { unfoldPartialApp := true })
. We may in future add a syntax for this, e.g. simp [!f]
; please provide feedback! In the meantime, we have made the following changes:
(config := { unfoldPartialApp := true })
in some places, to recover the old behaviour@[eqns]
to manually adjust the equation lemmas for a particular definition, recovering the old behaviour just for that definition. See #8371, where we do this for Function.comp
and Function.flip
.This change in Lean may require further changes down the line (e.g. adding the !f
syntax, and/or upstreaming the special treatment for Function.comp
and Function.flip
, and/or removing this special treatment). Please keep an open and skeptical mind about these changes!
Co-authored-by: leanprover-community-mathlib4-bot <leanprover-community-mathlib4-bot@users.noreply.github.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Mauricio Collares <mauricio@collares.org>
@@ -17,8 +17,6 @@ and `Real.tan` as a `LocalHomeomorph` between `(-(π / 2), π / 2)` and the whol
noncomputable section
-local macro_rules | `($x ^ $y) => `(HPow.hPow $x $y) -- Porting note: See issue lean4#2220
-
namespace Real
open Set Filter
@@ -17,7 +17,7 @@ and `Real.tan` as a `LocalHomeomorph` between `(-(π / 2), π / 2)` and the whol
noncomputable section
-local macro_rules | `($x ^ $y) => `(HPow.hPow $x $y) -- Porting note: See issue #2220
+local macro_rules | `($x ^ $y) => `(HPow.hPow $x $y) -- Porting note: See issue lean4#2220
namespace Real
@@ -2,14 +2,11 @@
Copyright (c) 2018 Chris Hughes. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Chris Hughes, Abhimanyu Pallavi Sudhir, Jean Lo, Calle Sönne, Benjamin Davidson
-
-! This file was ported from Lean 3 source module analysis.special_functions.trigonometric.arctan
-! leanprover-community/mathlib commit f2ce6086713c78a7f880485f7917ea547a215982
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathlib.Analysis.SpecialFunctions.Trigonometric.Complex
+#align_import analysis.special_functions.trigonometric.arctan from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982"
+
/-!
# The `arctan` function.
@@ -14,7 +14,7 @@ import Mathlib.Analysis.SpecialFunctions.Trigonometric.Complex
# The `arctan` function.
Inequalities, derivatives,
-and `real.tan` as a `local_homeomorph` between `(-(π / 2), π / 2)` and the whole line.
+and `Real.tan` as a `LocalHomeomorph` between `(-(π / 2), π / 2)` and the whole line.
-/
@@ -214,7 +214,7 @@ theorem continuousAt_arctan {x : ℝ} : ContinuousAt arctan x :=
continuous_arctan.continuousAt
#align real.continuous_at_arctan Real.continuousAt_arctan
-/-- `real.tan` as a `local_homeomorph` between `(-(π / 2), π / 2)` and the whole line. -/
+/-- `Real.tan` as a `LocalHomeomorph` between `(-(π / 2), π / 2)` and the whole line. -/
def tanLocalHomeomorph : LocalHomeomorph ℝ ℝ where
toFun := tan
invFun := arctan
The unported dependencies are
algebra.order.module
init.core
linear_algebra.free_module.finite.rank
algebra.order.monoid.cancel.defs
algebra.abs
algebra.group_power.lemmas
init.data.list.basic
linear_algebra.free_module.rank
init.data.list.default
algebra.order.monoid.cancel.basic
topology.subset_properties
init.logic
The following 1 dependencies have changed in mathlib3 since they were ported, which may complicate porting this file