Built with Alectryon, running Coq+SerAPI v8.10.0+0.7.0. Coq sources are in this panel; goals and messages will appear in the other. Bubbles () indicate interactive fragments: hover for details, tap to reveal contents. Use Ctrl+↑ Ctrl+↓ to navigate, Ctrl+🖱️ to focus.
(************************************************************************)
(*         *   The Coq Proof Assistant / The Coq Development Team       *)
(*  v      *   INRIA, CNRS and contributors - Copyright 1999-2018       *)
(* <O___,, *       (see CREDITS file for the list of authors)           *)
(*   \VV/  **************************************************************)
(*    //   *    This file is distributed under the terms of the         *)
(*         *     GNU Lesser General Public License Version 2.1          *)
(*         *     (see LICENSE file for the text of the license)         *)
(************************************************************************)

Require Import Rbase.
Require Import Rfunctions.
Require Import SeqSeries.
Require Import Rtrigo1.
Require Import R_sqrt.
Local Open Scope R_scope.


tan PI = 0

tan PI = 0
unfold tan; rewrite sin_PI; rewrite cos_PI; unfold Rdiv; apply Rmult_0_l. Qed.

sin (3 * (PI / 2)) = -1

sin (3 * (PI / 2)) = -1

sin (PI + PI / 2) = -1

PI + PI / 2 = 3 * (PI / 2)

PI + PI / 2 = 3 * (PI / 2)
pattern PI at 1; rewrite (double_var PI); ring. Qed.

tan (2 * PI) = 0

tan (2 * PI) = 0
unfold tan; rewrite sin_2PI; unfold Rdiv; apply Rmult_0_l. Qed.

sin (PI / 4) = cos (PI / 4)

sin (PI / 4) = cos (PI / 4)

sin (PI / 4) = sin (PI / 2 + PI / 4)

sin (PI / 4) = sin (- (PI / 4) + PI)
rewrite neg_sin, sin_neg; ring. Qed.

sin (PI / 3) = cos (PI / 6)

sin (PI / 3) = cos (PI / 6)

sin (PI / 3) = cos (PI / 2 - PI / 3)
now rewrite cos_shift. Qed.

cos (PI / 3) = sin (PI / 6)

cos (PI / 3) = sin (PI / 6)

cos (PI / 3) = sin (PI / 2 - PI / 3)
now rewrite sin_shift. Qed.

0 < PI / 6

0 < PI / 6
unfold Rdiv; apply Rmult_lt_0_compat; [ apply PI_RGT_0 | apply Rinv_0_lt_compat; prove_sup0 ]. Qed.

PI / 6 < PI / 2

PI / 6 < PI / 2

0 < PI

/ 6 < / 2

/ 6 < / 2
apply Rinv_lt_contravar; prove_sup. Qed.

sin (PI / 6) = 1 / 2

sin (PI / 6) = 1 / 2

2 * cos (PI / 6) * sin (PI / 6) = 2 * cos (PI / 6) * (1 / 2)

2 * cos (PI / 6) <> 0

2 * sin (PI / 6) * cos (PI / 6) = 2 * cos (PI / 6) * (1 / 2)

2 * cos (PI / 6) <> 0

sin (PI / 3) = 2 * cos (PI / 6) * (1 / 2)

2 * cos (PI / 6) <> 0

cos (PI / 6) = 2 * cos (PI / 6) * (1 / 2)

2 * cos (PI / 6) <> 0

2 * cos (PI / 6) <> 0

2 <> 0

cos (PI / 6) <> 0

cos (PI / 6) <> 0
cut (0 < cos (PI / 6)); [ intro H1; auto with real | apply cos_gt_0; [ apply (Rlt_trans (- (PI / 2)) 0 (PI / 6) _PI2_RLT_0 PI6_RGT_0) | apply PI6_RLT_PI2 ] ]. Qed.

sqrt 2 <> 0

sqrt 2 <> 0
assert (Hyp : 0 < 2); [ prove_sup0 | generalize (Rlt_le 0 2 Hyp); intro H1; red; intro H2; generalize (sqrt_eq_0 2 H1 H2); intro H; absurd (2 = 0); [ discrR | assumption ] ]. Qed.

1 / sqrt 2 <> 0

1 / sqrt 2 <> 0
generalize (Rinv_neq_0_compat (sqrt 2) sqrt2_neq_0); intro H; generalize (prod_neq_R0 1 (/ sqrt 2) R1_neq_R0 H); intro H0; assumption. Qed.

2 * sqrt 3 <> 0

2 * sqrt 3 <> 0
apply prod_neq_R0; [ discrR | assert (Hyp : 0 < 3); [ prove_sup0 | generalize (Rlt_le 0 3 Hyp); intro H1; red; intro H2; generalize (sqrt_eq_0 3 H1 H2); intro H; absurd (3 = 0); [ discrR | assumption ] ] ]. Qed.

0 < sqrt 2

0 < sqrt 2
assert (Hyp : 0 < 2); [ prove_sup0 | generalize (sqrt_positivity 2 (Rlt_le 0 2 Hyp)); intro H1; elim H1; intro H2; [ assumption | absurd (0 = sqrt 2); [ apply (not_eq_sym (A:=R)); apply sqrt2_neq_0 | assumption ] ] ]. Qed.

0 < sqrt 3

0 < sqrt 3
cut (0%nat <> 1%nat); [ intro H0; assert (Hyp : 0 < 2); [ prove_sup0 | generalize (Rlt_le 0 2 Hyp); intro H1; assert (Hyp2 : 0 < 3); [ prove_sup0 | generalize (Rlt_le 0 3 Hyp2); intro H2; generalize (lt_INR_0 1 (neq_O_lt 1 H0)); unfold INR; intro H3; generalize (Rplus_lt_compat_l 2 0 1 H3); rewrite Rplus_comm; rewrite Rplus_0_l; replace (2 + 1) with 3; [ intro H4; generalize (sqrt_lt_1 2 3 H1 H2 H4); clear H3; intro H3; apply (Rlt_trans 0 (sqrt 2) (sqrt 3) Rlt_sqrt2_0 H3) | ring ] ] ] | discriminate ]. Qed.

0 < PI / 4

0 < PI / 4
unfold Rdiv; apply Rmult_lt_0_compat; [ apply PI_RGT_0 | apply Rinv_0_lt_compat; prove_sup0 ]. Qed.

cos (PI / 4) = 1 / sqrt 2

cos (PI / 4) = 1 / sqrt 2

0 <= cos (PI / 4)

0 <= 1 / sqrt 2

(cos (PI / 4))² = (1 / sqrt 2

- (PI / 2) <= PI / 4

PI / 4 <= PI / 2

0 <= 1 / sqrt 2

(cos (PI / 4))² = (1 / sqrt 2

PI / 4 <= PI / 2

0 <= 1 / sqrt 2

(cos (PI / 4))² = (1 / sqrt 2

0 <= 1 / sqrt 2

(cos (PI / 4))² = (1 / sqrt 2

0 < 1

0 < / sqrt 2

(cos (PI / 4))² = (1 / sqrt 2

0 < / sqrt 2

(cos (PI / 4))² = (1 / sqrt 2

(cos (PI / 4))² = (1 / sqrt 2

(cos (PI / 4))² = 1² / (sqrt 2

sqrt 2 <> 0

(cos (PI / 4))² = 1 / 2

0 <= 2

sqrt 2 <> 0

1 / 2 * (2 * sin (PI / 4) * cos (PI / 4)) = 1 / 2

0 <= 2

sqrt 2 <> 0

1 / 2 * sin (PI / 2) = 1 / 2

0 <= 2

sqrt 2 <> 0

1 / 2 * 1 = 1 / 2

0 <= 2

sqrt 2 <> 0

0 <= 2

sqrt 2 <> 0

sqrt 2 <> 0
apply sqrt2_neq_0... Qed.

sin (PI / 4) = 1 / sqrt 2

sin (PI / 4) = 1 / sqrt 2
rewrite sin_cos_PI4; apply cos_PI4. Qed.

tan (PI / 4) = 1

tan (PI / 4) = 1

cos (PI / 4) / cos (PI / 4) = 1

cos (PI * / 4) <> 0
change (cos (PI / 4) <> 0); rewrite cos_PI4; apply R1_sqrt2_neq_0. Qed.

cos (3 * (PI / 4)) = -1 / sqrt 2

cos (3 * (PI / 4)) = -1 / sqrt 2

cos (PI / 2 - - (PI / 4)) = -1 / sqrt 2

- (1 / sqrt 2) = -1 / sqrt 2

- (1 * / sqrt 2) = -1 * / sqrt 2
ring. Qed. Notation cos3PI4 := cos_3PI4 (compat "8.10").

sin (3 * (PI / 4)) = 1 / sqrt 2

sin (3 * (PI / 4)) = 1 / sqrt 2

sin (PI / 2 - - (PI / 4)) = 1 / sqrt 2
now rewrite sin_shift, cos_neg, cos_PI4. Qed. Notation sin3PI4 := sin_3PI4 (compat "8.10").

cos (PI / 6) = sqrt 3 / 2

cos (PI / 6) = sqrt 3 / 2

0 <= cos (PI / 6)

0 <= sqrt 3 / 2

(cos (PI / 6))² = (sqrt 3 / 2

- (PI / 2) <= PI / 6

PI / 6 <= PI / 2

0 <= sqrt 3 / 2

(cos (PI / 6))² = (sqrt 3 / 2

PI / 6 <= PI / 2

0 <= sqrt 3 / 2

(cos (PI / 6))² = (sqrt 3 / 2

0 <= sqrt 3 / 2

(cos (PI / 6))² = (sqrt 3 / 2

0 < sqrt 3

0 < / 2

(cos (PI / 6))² = (sqrt 3 / 2

0 < / 2

(cos (PI / 6))² = (sqrt 3 / 2

(cos (PI / 6))² = (sqrt 3 / 2

(cos (PI / 6))² = (sqrt 3)² / 2²

1 - 1 / 2 * (1 / 2) = 3 / (2 * 2)

0 <= 3

0 <= 3
left ; prove_sup0. Qed.

tan (PI / 6) = 1 / sqrt 3

tan (PI / 6) = 1 / sqrt 3

/ 2 * (/ sqrt 3 * / / 2) = / sqrt 3

sqrt 3 <> 0

/ 2 <> 0

/ 2 * (/ sqrt 3 * 2) = / sqrt 3

2 <> 0

sqrt 3 <> 0

/ 2 <> 0

/ sqrt 3 * 1 = / sqrt 3

2 <> 0

2 <> 0

sqrt 3 <> 0

/ 2 <> 0

2 <> 0

2 <> 0

sqrt 3 <> 0

/ 2 <> 0

2 <> 0

sqrt 3 <> 0

/ 2 <> 0

sqrt 3 <> 0

/ 2 <> 0

/ 2 <> 0
apply Rinv_neq_0_compat; discrR. Qed.

sin (PI / 3) = sqrt 3 / 2

sin (PI / 3) = sqrt 3 / 2
rewrite sin_PI3_cos_PI6; apply cos_PI6. Qed.

cos (PI / 3) = 1 / 2

cos (PI / 3) = 1 / 2
rewrite sin_PI6_cos_PI3; apply sin_PI6. Qed.

tan (PI / 3) = sqrt 3

tan (PI / 3) = sqrt 3

sqrt 3 * / 2 * 2 = sqrt 3

2 <> 0

sqrt 3 * 1 = sqrt 3

2 <> 0

2 <> 0

2 <> 0

2 <> 0

2 <> 0
discrR. Qed.

sin (2 * (PI / 3)) = sqrt 3 / 2

sin (2 * (PI / 3)) = sqrt 3 / 2
rewrite double; rewrite sin_plus; rewrite sin_PI3; rewrite cos_PI3; unfold Rdiv; repeat rewrite Rmult_1_l; rewrite (Rmult_comm (/ 2)); repeat rewrite <- Rmult_assoc; rewrite double_var; reflexivity. Qed.

cos (2 * (PI / 3)) = -1 / 2

cos (2 * (PI / 3)) = -1 / 2

1 / 2 * (1 / 2) - sqrt 3 / 2 * (sqrt 3 / 2) = -1 / 2

1 / 2 * (1 / 2) - sqrt 3 * sqrt 3 / 4 = -1 / 2

1 / 2 * (1 / 2) - 3 / 4 = -1 / 2

0 <= 3

0 <= 3
left ; prove_sup0. Qed.

tan (2 * (PI / 3)) = - sqrt 3

tan (2 * (PI / 3)) = - sqrt 3

sqrt 3 / 2 / (-1 / 2) = - sqrt 3
field. Qed.

cos (5 * (PI / 4)) = -1 / sqrt 2

cos (5 * (PI / 4)) = -1 / sqrt 2

cos (PI / 4 + PI) = -1 / sqrt 2

- (1 * / sqrt 2) = -1 * / sqrt 2
ring. Qed.

sin (5 * (PI / 4)) = -1 / sqrt 2

sin (5 * (PI / 4)) = -1 / sqrt 2

sin (PI / 4 + PI) = -1 / sqrt 2

- (1 * / sqrt 2) = -1 * / sqrt 2
ring. Qed.

cos (5 * (PI / 4)) = sin (5 * (PI / 4))

cos (5 * (PI / 4)) = sin (5 * (PI / 4))
rewrite cos_5PI4; rewrite sin_5PI4; reflexivity. Qed.

0 < 3 * (PI / 2)

0 < 3 * (PI / 2)
apply Rmult_lt_0_compat; [ prove_sup0 | unfold Rdiv; apply Rmult_lt_0_compat; [ apply PI_RGT_0 | apply Rinv_0_lt_compat; prove_sup0 ] ]. Qed.

0 < 2 * PI

0 < 2 * PI
apply Rmult_lt_0_compat; [ prove_sup0 | apply PI_RGT_0 ]. Qed.

PI < 3 * (PI / 2)

PI < 3 * (PI / 2)
H1:0 < PI / 2

PI + 0 < 3 * (PI / 2) -> PI < 3 * (PI / 2)
H1:0 < PI / 2
3 * (PI / 2) = PI + PI / 2
H1:0 < PI / 2

3 * (PI / 2) = PI + PI / 2
pattern PI at 2; rewrite double_var; ring. Qed.

3 * (PI / 2) < 2 * PI

3 * (PI / 2) < 2 * PI
H1:0 < PI / 2

3 * (PI / 2) + 0 < 2 * PI -> 3 * (PI / 2) < 2 * PI
H1:0 < PI / 2
2 * PI = 3 * (PI / 2) + PI / 2
H1:0 < PI / 2

2 * PI = 3 * (PI / 2) + PI / 2
rewrite double; pattern PI at 1 2; rewrite double_var; ring. Qed. (***************************************************************)
Radian -> Degree | Degree -> Radian
(***************************************************************)

Definition plat : R := 180.
Definition toRad (x:R) : R := x * PI * / plat.
Definition toDeg (x:R) : R := x * plat * / PI.


forall x : R, toRad (toDeg x) = x

forall x : R, toRad (toDeg x) = x
x:R

x * (plat * / plat) * (PI * / PI) = x
x:R

x * 1 * 1 = x
x:R
PI <> 0
x:R
plat <> 0
x:R

PI <> 0
x:R
plat <> 0
x:R

plat <> 0
unfold plat; discrR. Qed.

forall x y : R, toRad x = toRad y -> x = y

forall x y : R, toRad x = toRad y -> x = y
x, y:R
H:x * PI * / plat = y * PI * / plat

PI * x = PI * y
x, y:R
H:x * PI * / plat = y * PI * / plat
PI <> 0
x, y:R
H:x * PI * / plat = y * PI * / plat

x * PI = y * PI
x, y:R
H:x * PI * / plat = y * PI * / plat
PI <> 0
x, y:R
H:x * PI * / plat = y * PI * / plat

/ plat * (x * PI) = / plat * (y * PI)
x, y:R
H:x * PI * / plat = y * PI * / plat
/ plat <> 0
x, y:R
H:x * PI * / plat = y * PI * / plat
PI <> 0
x, y:R
H:x * PI * / plat = y * PI * / plat

/ plat <> 0
x, y:R
H:x * PI * / plat = y * PI * / plat
PI <> 0
x, y:R
H:x * PI * / plat = y * PI * / plat

PI <> 0
apply PI_neq0. Qed.

forall x : R, toDeg (toRad x) = x

forall x : R, toDeg (toRad x) = x
intro x; apply toRad_inj; rewrite (rad_deg (toRad x)); reflexivity. Qed. Definition sind (x:R) : R := sin (toRad x). Definition cosd (x:R) : R := cos (toRad x). Definition tand (x:R) : R := tan (toRad x).

forall x : R, (sind x)² + (cosd x)² = 1

forall x : R, (sind x)² + (cosd x)² = 1
intro x; unfold sind; unfold cosd; apply sin2_cos2. Qed. (***************************************************)
Other properties
(***************************************************)


forall a : R, 0 <= a -> a <= PI / 2 -> 0 <= sin_lb a

forall a : R, 0 <= a -> a <= PI / 2 -> 0 <= sin_lb a
a:R
H:0 <= a
H0:a <= PI / 2
H1:0 < a

0 <= sin_lb a
a:R
H:0 <= a
H0:a <= PI / 2
H1:0 = a \/ 0 > a
0 <= sin_lb a
a:R
H:0 <= a
H0:a <= PI / 2
H1:0 = a \/ 0 > a

0 <= sin_lb a
a:R
H:0 <= a
H0:a <= PI / 2
H1:0 = a \/ 0 > a
H2:0 = a

0 <= sin_lb a
a:R
H:0 <= a
H0:a <= PI / 2
H1:0 = a \/ 0 > a
H2:0 > a
0 <= sin_lb a
a:R
H:0 <= a
H0:a <= PI / 2
H1:0 = a \/ 0 > a
H2:0 = a

0 <= (-1) ^ 0 * (0 / INR (fact (2 * 0 + 1))) + (-1) ^ 1 * (0 / INR (fact (2 * 1 + 1))) + (-1) ^ 2 * (0 / INR (fact (2 * 2 + 1))) + (-1) ^ 3 * (0 / INR (fact (2 * 3 + 1)))
a:R
H:0 <= a
H0:a <= PI / 2
H1:0 = a \/ 0 > a
H2:0 = a
(2 * 3 + 1)%nat <> 0%nat
a:R
H:0 <= a
H0:a <= PI / 2
H1:0 = a \/ 0 > a
H2:0 = a
(2 * 2 + 1)%nat <> 0%nat
a:R
H:0 <= a
H0:a <= PI / 2
H1:0 = a \/ 0 > a
H2:0 = a
(2 * 1 + 1)%nat <> 0%nat
a:R
H:0 <= a
H0:a <= PI / 2
H1:0 = a \/ 0 > a
H2:0 = a
(2 * 0 + 1)%nat <> 0%nat
a:R
H:0 <= a
H0:a <= PI / 2
H1:0 = a \/ 0 > a
H2:0 > a
0 <= sin_lb a
a:R
H:0 <= a
H0:a <= PI / 2
H1:0 = a \/ 0 > a
H2:0 = a

(2 * 3 + 1)%nat <> 0%nat
a:R
H:0 <= a
H0:a <= PI / 2
H1:0 = a \/ 0 > a
H2:0 = a
(2 * 2 + 1)%nat <> 0%nat
a:R
H:0 <= a
H0:a <= PI / 2
H1:0 = a \/ 0 > a
H2:0 = a
(2 * 1 + 1)%nat <> 0%nat
a:R
H:0 <= a
H0:a <= PI / 2
H1:0 = a \/ 0 > a
H2:0 = a
(2 * 0 + 1)%nat <> 0%nat
a:R
H:0 <= a
H0:a <= PI / 2
H1:0 = a \/ 0 > a
H2:0 > a
0 <= sin_lb a
a:R
H:0 <= a
H0:a <= PI / 2
H1:0 = a \/ 0 > a
H2:0 = a

(2 * 2 + 1)%nat <> 0%nat
a:R
H:0 <= a
H0:a <= PI / 2
H1:0 = a \/ 0 > a
H2:0 = a
(2 * 1 + 1)%nat <> 0%nat
a:R
H:0 <= a
H0:a <= PI / 2
H1:0 = a \/ 0 > a
H2:0 = a
(2 * 0 + 1)%nat <> 0%nat
a:R
H:0 <= a
H0:a <= PI / 2
H1:0 = a \/ 0 > a
H2:0 > a
0 <= sin_lb a
a:R
H:0 <= a
H0:a <= PI / 2
H1:0 = a \/ 0 > a
H2:0 = a

(2 * 1 + 1)%nat <> 0%nat
a:R
H:0 <= a
H0:a <= PI / 2
H1:0 = a \/ 0 > a
H2:0 = a
(2 * 0 + 1)%nat <> 0%nat
a:R
H:0 <= a
H0:a <= PI / 2
H1:0 = a \/ 0 > a
H2:0 > a
0 <= sin_lb a
a:R
H:0 <= a
H0:a <= PI / 2
H1:0 = a \/ 0 > a
H2:0 = a

(2 * 0 + 1)%nat <> 0%nat
a:R
H:0 <= a
H0:a <= PI / 2
H1:0 = a \/ 0 > a
H2:0 > a
0 <= sin_lb a
a:R
H:0 <= a
H0:a <= PI / 2
H1:0 = a \/ 0 > a
H2:0 > a

0 <= sin_lb a
elim (Rlt_irrefl 0 (Rle_lt_trans 0 a 0 H H2)). Qed.