@@ -4,6 +4,8 @@ Released under Apache 2.0 license as described in the file LICENSE.
4
4
Authors: Chris Hughes, Abhimanyu Pallavi Sudhir, Jean Lo, Calle Sönne, Benjamin Davidson
5
5
-/
6
6
import analysis.special_functions.exp_log
7
+ import data.set.intervals.infinite
8
+ import algebra.quadratic_discriminant
7
9
8
10
/-!
9
11
# Trigonometric functions
@@ -835,6 +837,12 @@ begin
835
837
exact ⟨y, hy⟩ }
836
838
end
837
839
840
+ lemma range_cos_infinite : (range real.cos).infinite :=
841
+ by { rw real.range_cos, exact Icc.infinite (by norm_num) }
842
+
843
+ lemma range_sin_infinite : (range real.sin).infinite :=
844
+ by { rw real.range_sin, exact Icc.infinite (by norm_num) }
845
+
838
846
lemma sin_lt {x : ℝ} (h : 0 < x) : sin x < x :=
839
847
begin
840
848
cases le_or_gt x 1 with h' h',
@@ -1632,6 +1640,9 @@ by rw [log, exp_add_mul_I, ← of_real_sin, sin_arg, ← of_real_cos, cos_arg hx
1632
1640
mul_div_cancel' _ (of_real_ne_zero.2 (mt abs_eq_zero.1 hx)), ← mul_assoc,
1633
1641
mul_div_cancel' _ (of_real_ne_zero.2 (mt abs_eq_zero.1 hx)), re_add_im]
1634
1642
1643
+ lemma range_exp : range exp = {x | x ≠ 0 } :=
1644
+ set.ext $ λ x, ⟨by { rintro ⟨x, rfl⟩, exact exp_ne_zero x }, λ hx, ⟨log x, exp_log hx⟩⟩
1645
+
1635
1646
lemma exp_inj_of_neg_pi_lt_of_le_pi {x y : ℂ} (hx₁ : -π < x.im) (hx₂ : x.im ≤ π)
1636
1647
(hy₁ : - π < y.im) (hy₂ : y.im ≤ π) (hxy : exp x = exp y) : x = y :=
1637
1648
by rw [exp_eq_exp_re_mul_sin_add_cos, exp_eq_exp_re_mul_sin_add_cos y] at hxy;
@@ -1664,6 +1675,21 @@ lemma log_I : log I = π / 2 * I := by simp [log]
1664
1675
1665
1676
lemma log_neg_I : log (-I) = -(π / 2 ) * I := by simp [log]
1666
1677
1678
+ lemma exists_pow_nat_eq (x : ℂ) {n : ℕ} (hn : 0 < n) : ∃ z, z ^ n = x :=
1679
+ begin
1680
+ by_cases hx : x = 0 ,
1681
+ { use 0 , simp only [hx, zero_pow_eq_zero, hn] },
1682
+ { use exp (log x / n),
1683
+ rw [← exp_nat_mul, mul_div_cancel', exp_log hx],
1684
+ exact_mod_cast (nat.pos_iff_ne_zero.mp hn) }
1685
+ end
1686
+
1687
+ lemma exists_eq_mul_self (x : ℂ) : ∃ z, x = z * z :=
1688
+ begin
1689
+ obtain ⟨z, rfl⟩ := exists_pow_nat_eq x zero_lt_two,
1690
+ exact ⟨z, pow_two z⟩
1691
+ end
1692
+
1667
1693
lemma two_pi_I_ne_zero : (2 * π * I : ℂ) ≠ 0 :=
1668
1694
by norm_num [real.pi_ne_zero, I_ne_zero]
1669
1695
@@ -1867,8 +1893,38 @@ continuous_on_sin.div continuous_on_cos $ λ x, id
1867
1893
lemma continuous_tan : continuous (λ x : {x | cos x ≠ 0 }, tan x) :=
1868
1894
continuous_on_iff_continuous_restrict.1 continuous_on_tan
1869
1895
1870
- end complex
1896
+ lemma cos_surjective : function.surjective cos :=
1897
+ begin
1898
+ intro x,
1899
+ obtain ⟨w, hw⟩ : ∃ w, 1 * w * w + (-2 * x) * w + 1 = 0 ,
1900
+ { exact exists_quadratic_eq_zero one_ne_zero (exists_eq_mul_self _) },
1901
+ have hw' : exp (log w / I * I) = w,
1902
+ { rw [div_mul_cancel _ I_ne_zero, exp_log],
1903
+ rintro rfl,
1904
+ simpa only [zero_add, one_ne_zero, mul_zero] using hw },
1905
+ obtain ⟨z, hz⟩ : ∃ z : ℂ, (exp (z * I)) ^ 2 - 2 * x * exp (z * I) + 1 = 0 ,
1906
+ { use log w / I, rw [hw', ← hw], ring },
1907
+ use z,
1908
+ delta cos,
1909
+ rw ← mul_left_inj' (exp_ne_zero (z * I)),
1910
+ rw [sub_add_eq_add_sub, sub_eq_zero, pow_two, ← exp_add, mul_comm _ x, mul_right_comm] at hz,
1911
+ field_simp [add_mul, ← exp_add, hz]
1912
+ end
1871
1913
1914
+ @[simp] lemma range_cos : range cos = set.univ :=
1915
+ cos_surjective.range_eq
1916
+
1917
+ lemma sin_surjective : function.surjective sin :=
1918
+ begin
1919
+ intro x,
1920
+ rcases cos_surjective x with ⟨z, rfl⟩,
1921
+ exact ⟨z+π/2 , sin_add_pi_div_two z⟩
1922
+ end
1923
+
1924
+ @[simp] lemma range_sin : range sin = set.univ :=
1925
+ sin_surjective.range_eq
1926
+
1927
+ end complex
1872
1928
1873
1929
namespace real
1874
1930
open_locale real
0 commit comments