Module mathcomp.analysis.trigo
From HB Require Import structures.From mathcomp Require Import boot order ssralg ssrint ssrnum matrix.
From mathcomp Require Import interval rat.
#[warning="-warn-library-file-internal-analysis"]
From mathcomp Require Import unstable.
From mathcomp Require Import mathcomp_extra boolp classical_sets functions.
From mathcomp Require Import reals ereal interval_inference topology normedtype.
From mathcomp Require Import landau sequences derive realfun exp realfun.
From mathcomp Require Import measure lebesgue_measure lebesgue_integral ftc.
Unset SsrOldRewriteGoalsOrder.
Set Implicit Arguments.
Unset Strict Implicit.
Unset Printing Implicit Defensive.
Import Order.TTheory GRing.Theory Num.Def Num.Theory.
Import numFieldNormedType.Exports.
Local Open Scope classical_set_scope.
Local Open Scope ring_scope.
Lemma
Source code
cvg (series f @ \oo) -> (0 < k)%N ->
[series \sum_(n * k <= < n.+1 * k) f i]_ @ \oo --> lim (series f @ \oo).
Proof.
have := [elaborate cf _ (gt0 e)] => -[n _ nl]; near=> m.
rewrite /ball /= [in X in `|_ - X|]/series [in X in `|_ - X|]/= -big_nat_mul.
have /nl : (n <= m * k)%N.
by near: m; exists n.+1 => //= p /ltnW /leq_trans /(_ (leq_pmulr _ k0)).
by rewrite /ball /= distrC.
Unshelve. all: by end_near. Qed.
Lemma
Source code
cvg (series f @ \oo) ->
(forall , 0 < f (n + d.*2)%N + f (n + d.*2.+1)%N) ->
\sum_(0 <= < n) f i < lim (series f @ \oo).
Proof.
have fn0 : 0 < f n + f n.+1 by have := fn 0%N; rewrite double0 addn0 addn1.
rewrite ltNge; apply: contraPN cf => ffn /(_ _ fn0).
have nf_ub N : \sum_(0 <= < n.+2) f i <= \sum_(0 <= < N.+1.*2 + n) f i.
elim: N => // N /le_trans ->//; rewrite -(addn1 (N.+1)) doubleD addnAC.
rewrite [in leRHS]/index_iota subn0 iotaD big_cat.
rewrite -[in X in _ <= X + _](subn0 (N.+1.*2 + n)%N) lerDl /= add0n.
by rewrite 2!big_cons big_nil addr0 -(addnC n) ltW// -addnS fn.
case=> N _ Nfn; have /Nfn/ltr_distlCDr : (N.+1.*2 + n >= N)%N.
by rewrite doubleS -addn2 -addnn -2!addnA leq_addr.
rewrite addrA => ffnfn.
have : lim (series f @ \oo) + f n + f n.+1 <= \sum_(0 <= < N.+1.*2 + n) f i.
apply: (le_trans _ (nf_ub N)).
by do 2 rewrite big_nat_recr //=; by rewrite -2!addrA lerD2r.
by move/(lt_le_trans ffnfn); rewrite ltxx.
Qed.
Section periodic.
Variables : zmodType.
Implicit Type f : U -> V.
Definition
periodic : forall [U V : GRing.Zmodule.Exports.zmodType], (U -> V) -> U -> Prop periodic is not universe polymorphic Arguments periodic [U V] f%_function_scope T%_ring_scope periodic is transparent Expands to: Constant mathcomp.analysis.trigo.periodic Declared in library mathcomp.analysis.trigo, line 88, characters 11-19
Source code
Lemma
Source code
End periodic.
Section alternating.
Variables ( : zmodType) ( : pzRingType).
Implicit Type f : U -> V.
Definition
alternating : forall [U : GRing.Zmodule.Exports.zmodType] [V : pzRingType], (U -> V) -> U -> Prop alternating is not universe polymorphic Arguments alternating [U V] f%_function_scope T%_ring_scope alternating is transparent Expands to: Constant mathcomp.analysis.trigo.alternating Declared in library mathcomp.analysis.trigo, line 100, characters 11-22
Source code
Lemma
Source code
forall , f (a + T *+ n) = (- 1) ^+ n * f a.
Proof.
End alternating.
Definition
sin_coeff : forall {R : realType}, R -> (join_GRing_PzRing_between_Algebra_BaseZmodule_and_GRing_PzSemiRing R) ^nat sin_coeff is not universe polymorphic Arguments sin_coeff {R} x%_ring_scope _ sin_coeff is transparent Expands to: Constant mathcomp.analysis.trigo.sin_coeff Declared in library mathcomp.analysis.trigo, line 111, characters 11-20
Source code
[sequence (odd n)%:R * (-1) ^+ n.-1./2 * x ^+ n / n`!%:R]_.
sin_unlock_subterm : unlockable (fun (R : realType) (x : R) => filter.lim (filter.fmap (series (sin_coeff x)) (filter.nbhs filter.eventually))) sin_unlock_subterm is not universe polymorphic sin_unlock_subterm is transparent Expands to: Constant mathcomp.analysis.trigo.sin_unlock_subterm Declared in library mathcomp.analysis.trigo, line 114, characters 0-80
Source code
sin_unlock_subterm : unlockable (fun (R : realType) (x : R) => filter.lim (filter.fmap (series (sin_coeff x)) (filter.nbhs filter.eventually))) sin_unlock_subterm is not universe polymorphic sin_unlock_subterm is transparent Expands to: Constant mathcomp.analysis.trigo.sin_unlock_subterm Declared in library mathcomp.analysis.trigo, line 114, characters 0-80
Source code
sin_unlock_subterm : unlockable (fun (R : realType) (x : R) => filter.lim (filter.fmap (series (sin_coeff x)) (filter.nbhs filter.eventually))) sin_unlock_subterm is not universe polymorphic sin_unlock_subterm is transparent Expands to: Constant mathcomp.analysis.trigo.sin_unlock_subterm Declared in library mathcomp.analysis.trigo, line 114, characters 0-80
Source code
sin_unlock_subterm : unlockable (fun (R : realType) (x : R) => filter.lim (filter.fmap (series (sin_coeff x)) (filter.nbhs filter.eventually))) sin_unlock_subterm is not universe polymorphic sin_unlock_subterm is transparent Expands to: Constant mathcomp.analysis.trigo.sin_unlock_subterm Declared in library mathcomp.analysis.trigo, line 114, characters 0-80
Source code
sin_unlock_subterm : unlockable (fun (R : realType) (x : R) => filter.lim (filter.fmap (series (sin_coeff x)) (filter.nbhs filter.eventually))) sin_unlock_subterm is not universe polymorphic sin_unlock_subterm is transparent Expands to: Constant mathcomp.analysis.trigo.sin_unlock_subterm Declared in library mathcomp.analysis.trigo, line 114, characters 0-80
Source code
Canonical
locked_sin : unlockable (fun (R : realType) (x : R) => filter.lim (filter.fmap (series (sin_coeff x)) (filter.nbhs filter.eventually))) locked_sin is not universe polymorphic locked_sin is transparent Expands to: Constant mathcomp.analysis.trigo.locked_sin Declared in library mathcomp.analysis.trigo, line 115, characters 10-20
Source code
Definition
cos_coeff : forall {R : realType}, R -> R ^nat cos_coeff is not universe polymorphic Arguments cos_coeff {R} x%_ring_scope _ cos_coeff is transparent Expands to: Constant mathcomp.analysis.trigo.cos_coeff Declared in library mathcomp.analysis.trigo, line 117, characters 11-20
Source code
[sequence (~~ odd n)%:R * (-1)^n./2 * x ^+ n / n`!%:R]_.
cos_unlock_subterm : unlockable (fun (R : realType) (x : R) => filter.lim (filter.fmap (series (cos_coeff x)) (filter.nbhs filter.eventually))) cos_unlock_subterm is not universe polymorphic cos_unlock_subterm is transparent Expands to: Constant mathcomp.analysis.trigo.cos_unlock_subterm Declared in library mathcomp.analysis.trigo, line 120, characters 0-80
Source code
cos_unlock_subterm : unlockable (fun (R : realType) (x : R) => filter.lim (filter.fmap (series (cos_coeff x)) (filter.nbhs filter.eventually))) cos_unlock_subterm is not universe polymorphic cos_unlock_subterm is transparent Expands to: Constant mathcomp.analysis.trigo.cos_unlock_subterm Declared in library mathcomp.analysis.trigo, line 120, characters 0-80
Source code
cos_unlock_subterm : unlockable (fun (R : realType) (x : R) => filter.lim (filter.fmap (series (cos_coeff x)) (filter.nbhs filter.eventually))) cos_unlock_subterm is not universe polymorphic cos_unlock_subterm is transparent Expands to: Constant mathcomp.analysis.trigo.cos_unlock_subterm Declared in library mathcomp.analysis.trigo, line 120, characters 0-80
Source code
cos_unlock_subterm : unlockable (fun (R : realType) (x : R) => filter.lim (filter.fmap (series (cos_coeff x)) (filter.nbhs filter.eventually))) cos_unlock_subterm is not universe polymorphic cos_unlock_subterm is transparent Expands to: Constant mathcomp.analysis.trigo.cos_unlock_subterm Declared in library mathcomp.analysis.trigo, line 120, characters 0-80
Source code
cos_unlock_subterm : unlockable (fun (R : realType) (x : R) => filter.lim (filter.fmap (series (cos_coeff x)) (filter.nbhs filter.eventually))) cos_unlock_subterm is not universe polymorphic cos_unlock_subterm is transparent Expands to: Constant mathcomp.analysis.trigo.cos_unlock_subterm Declared in library mathcomp.analysis.trigo, line 120, characters 0-80
Source code
Canonical
locked_cos : unlockable (fun (R : realType) (x : R) => filter.lim (filter.fmap (series (cos_coeff x)) (filter.nbhs filter.eventually))) locked_cos is not universe polymorphic locked_cos is transparent Expands to: Constant mathcomp.analysis.trigo.locked_cos Declared in library mathcomp.analysis.trigo, line 121, characters 10-20
Source code
Section CosSin.
Variable : realType.
Implicit Types x y : R.
Lemma
Source code
(fun => (fun => (odd n)%:R * (-1) ^+ n.-1./2 * (n`!%:R)^-1) n * x ^+ n).
Lemma
Source code
Proof.
Lemma
Source code
Proof.
apply: series_le_cvg; last exact: (is_cvg_series_exp_coeff `|x|).
- by move=> n; rewrite normr_ge0.
- by move=> n; rewrite divr_ge0.
- move=> n /=; rewrite /exp_coeff /sin_coeff /=.
rewrite !normrM normfV !normr_nat !normrX normrN normr1 expr1n mulr1.
by case: odd; [rewrite mul1r| rewrite !mul0r].
Qed.
Lemma
Source code
lim (pseries (fun => (odd n)%:R * (-1) ^+ n.-1./2 * (n`!%:R)^-1) x @ \oo).
Proof.
Definition
sin_coeff' : forall [R : realType], R -> nat -> R sin_coeff' is not universe polymorphic Arguments sin_coeff' [R] x%_ring_scope n%_nat_scope sin_coeff' is transparent Expands to: Constant mathcomp.analysis.trigo.sin_coeff' Declared in library mathcomp.analysis.trigo, line 149, characters 11-21
Source code
Lemma
Source code
Proof.
Lemma
Source code
Proof.
have /(@cvg_series_cvg_series_group _ _ 2) := @is_cvg_series_sin_coeff x.
move=> /(_ isT); apply: cvg_trans.
rewrite [X in _ --> series X @ \oo](_ : _ = (fun => sin_coeff x n.*2.+1)).
rewrite funeqE=> n; rewrite /= 2!muln2 big_nat_recl //= sin_coeff_even add0r.
by rewrite big_nat_recl // big_geq // addr0.
rewrite [X in series X @ \oo --> _](_ : _ = (fun => sin_coeff x n.*2.+1)) //.
by rewrite funeqE => n; exact: sin_coeff'E.
Qed.
Lemma
Source code
pseries_diffs (fun => (odd n)%:R * (-1) ^+ n.-1./2 * (n`!%:R)^-1) =
(fun => (~~(odd n))%:R * (-1) ^+ n./2 * (n`!%:R)^-1 : R).
Proof.
Lemma
Source code
Proof.
Lemma
Source code
Proof.
apply: lim_near_cst => //; near=> m; rewrite -[m]prednK; first by near: m.
rewrite -addn1 series_addn series_sin_coeff0 big_add1 big1 ?addr0//.
by move=> i _; rewrite /sin_coeff /= expr0n !(mulr0, mul0r).
Unshelve. all: by end_near. Qed.
Lemma
Source code
Proof.
Lemma
Source code
Lemma
Source code
Lemma
Source code
Proof.
Lemma
Source code
cos_coeff x = (fun => (fun => (~~(odd n))%:R * (-1) ^+ n./2 *
(n`!%:R)^-1) n * x ^+ n).
Lemma
Source code
Proof.
apply: series_le_cvg; last exact: (is_cvg_series_exp_coeff `|x|).
- by move=> n; rewrite normr_ge0.
- by move=> n; rewrite divr_ge0.
- move=> n /=; rewrite /exp_coeff /cos_coeff /=.
rewrite !normrM normfV !normr_nat !normrX normrN normr1 expr1n mulr1.
by case: odd; [rewrite !mul0r | rewrite mul1r].
Qed.
Lemma
Source code
lim (series (fun =>
(fun => (~~(odd n))%:R * (-1)^+ n./2 * (n`!%:R)^-1) n
* x ^+ n) @ \oo).
Proof.
Definition
cos_coeff' : forall [R : realType], R -> nat -> R cos_coeff' is not universe polymorphic Arguments cos_coeff' [R] x%_ring_scope n%_nat_scope cos_coeff' is transparent Expands to: Constant mathcomp.analysis.trigo.cos_coeff' Declared in library mathcomp.analysis.trigo, line 229, characters 11-21
Source code
Lemma
Source code
Proof.
by rewrite (half_bit_double n false).
Qed.
Lemma
Source code
Proof.
have /(@cvg_series_cvg_series_group _ _ 2) := @is_cvg_series_cos_coeff x.
move=> /(_ isT); apply: cvg_trans.
rewrite [X in _ --> series X @ \oo](_ : _ = (fun => cos_coeff x n.*2)).
rewrite funeqE=> n; rewrite /= 2!muln2 big_nat_recr //= cos_coeff_odd addr0.
by rewrite big_nat_recl//= /index_iota subnn big_nil addr0.
rewrite [X in series X @ \oo --> _](_ : _ = (fun => cos_coeff x n.*2)) //.
by rewrite funeqE => n; exact: cos_coeff'E.
Qed.
Lemma
Source code
pseries_diffs (fun => (~~ odd n)%:R * (-1) ^+ n./2 * n`!%:R^-1) =
(fun => - ((odd n)%:R * (-1) ^+ n.-1./2 * n`!%:R^-1) : R).
Proof.
Lemma
Source code
Proof.
Lemma
Source code
Proof.
apply: lim_near_cst => //; near=> m; rewrite -[m]prednK; first by near: m.
rewrite -addn1 series_addn series_cos_coeff0 big_add1 big1 ?addr0//.
by move=> i _; rewrite /cos_coeff /= expr0n !(mulr0, mul0r).
Unshelve. all: by end_near. Qed.
Global Instance
Source code
Proof.
pose s : R^nat := fun => (odd n)%:R * (-1) ^+ (n.-1)./2 / n`!%:R.
pose s1 := pseries_diffs s n * x ^+ n.
rewrite cosE /= /pseries (_ : (fun _ => _) = s1).
by apply/funext => i; rewrite /s1 diffs_sin.
apply: (@pseries_snd_diffs _ _ (`|x| + 1)); rewrite /pseries.
- by rewrite -sin_coeffE; apply: is_cvg_series_sin_coeff.
- rewrite (_ : (fun _ => _) = cos_coeff (`|x| + 1)).
by apply/funext => i; rewrite diffs_sin cos_coeffE.
exact: is_cvg_series_cos_coeff.
- rewrite /pseries (_ : (fun _ => _) = - sin_coeff (`|x| + 1)).
by apply/funext => i; rewrite diffs_sin diffs_cos sin_coeffE !fctE !mulNr.
by rewrite is_cvg_seriesN; exact: is_cvg_series_sin_coeff.
- by rewrite [ltRHS]ger0_norm// addrC -subr_gt0 addrK.
Qed.
Lemma
Source code
Proof.
Lemma
Source code
Proof.
Global Instance
Source code
Proof.
pose s : R^nat := fun => (~~ odd n)%:R * (-1) ^+ n./2 / n`!%:R.
pose s1 := pseries_diffs s n * x ^+ n.
rewrite sinE /= /pseries.
rewrite (_ : (fun _ => _) = - s1).
by apply/funext => i; rewrite /s1 diffs_cos !fctE mulNr opprK.
rewrite lim_seriesN ?opprK.
rewrite (_ : s1 = - sin_coeff x).
by apply/funext => i; rewrite /s1 diffs_cos sin_coeffE !fctE mulNr.
by rewrite is_cvg_seriesN; exact: is_cvg_series_sin_coeff.
apply: (@pseries_snd_diffs _ _ (`|x| + 1)).
- by rewrite /pseries -cos_coeffE; apply: is_cvg_series_cos_coeff.
- rewrite /pseries (_ : (fun _ => _) = - sin_coeff (`|x| + 1)).
by apply/funext => i; rewrite diffs_cos sin_coeffE !fctE mulNr.
by rewrite is_cvg_seriesN; exact: is_cvg_series_sin_coeff.
- rewrite /pseries (_ : (fun _=> _) = - cos_coeff (`|x| + 1)); last first.
by rewrite is_cvg_seriesN; exact: is_cvg_series_cos_coeff.
apply/funext => i; rewrite diffs_cos pseries_diffsN.
by rewrite diffs_sin cos_coeffE mulNr.
- by rewrite [ltRHS]ger0_norm// addrC -subr_gt0 addrK.
Qed.
Lemma
Source code
Proof.
Lemma
Source code
Proof.
Lemma
Source code
Proof.
Lemma
Source code
Proof.
Lemma
Source code
Proof.
Lemma
Source code
Proof.
Lemma
Source code
Proof.
Lemma
Source code
Proof.
Lemma
Source code
Proof.
Fact
Source code
(sin (x + y) - (sin x * cos y + cos x * sin y)) ^+ 2 +
(cos (x + y) - (cos x * cos y - sin x * sin y)) ^+ 2 = 0.
Proof.
apply: (@eq_trans _ _ (f 0)); last first.
by rewrite /f cos0 sin0 !(mul1r, mul0r, add0r, subr0, subrr, expr0n).
apply: is_derive_0_is_cst => {}x.
apply: trigger_derive; rewrite /GRing.scale/= !mulr0 !add0r addr0 !mulr1.
rewrite -!mulr2n -mulrnDl 2!mulrN 2!opprB -2!opprD mulrN.
by rewrite mulrC 2!(mulrC (cos y)) 2!(mulrC (sin y)) subrr mul0rn.
Qed.
Lemma
Source code
Proof.
Lemma
Source code
Proof.
Lemma
Source code
Lemma
Source code
Lemma
Source code
Lemma
Source code
Fact
Source code
(sin (- x) + sin x) ^+ 2 + (cos (- x) - cos x) ^+ 2 = 0.
Proof.
apply: (@eq_trans _ _ (f 0)); last first.
by rewrite /f oppr0 cos0 sin0 !(addr0, subrr, expr0n).
apply: is_derive_0_is_cst => {}x.
apply: trigger_derive; rewrite /GRing.scale /=.
rewrite !mulrN1 !opprK -!mulr2n -mulrnDl mulrC.
by rewrite -opprB mulNr [- _ + _]addrC subrr mul0rn.
Qed.
Lemma
Source code
Proof.
Lemma
Source code
Proof.
Lemma
Source code
Lemma
Source code
Lemma
Source code
Lemma
Source code
Lemma
Source code
Proof.
Lemma
Source code
Proof.
Lemma
Source code
Proof.
Lemma
Source code
Proof.
Lemma
Source code
Proof.
Lemma
Source code
End CosSin.
Arguments sin {R}.
Arguments cos {R}.
Lemma
Source code
Itv.spec (@Itv.num_sem R) (Itv.Real `[-1, 1]%Z) (sin x).
Canonical
sin_inum : forall {R : realType}, R -> {itv R & `[(-1)%Z, 1%Z]%R} sin_inum is not universe polymorphic Arguments sin_inum {R} x%_ring_scope sin_inum is transparent Expands to: Constant mathcomp.analysis.trigo.sin_inum Declared in library mathcomp.analysis.trigo, line 473, characters 10-18
Source code
Lemma
Source code
Itv.spec (@Itv.num_sem R) (Itv.Real `[-1, 1]%Z) (cos x).
Canonical
cos_inum : forall {R : realType}, R -> {itv R & `[(-1)%Z, 1%Z]%R} cos_inum is not universe polymorphic Arguments cos_inum {R} x%_ring_scope cos_inum is transparent Expands to: Constant mathcomp.analysis.trigo.cos_inum Declared in library mathcomp.analysis.trigo, line 479, characters 10-18
Source code
Section Pi.
Variable : realType.
Implicit Types (x y : R) (n k : nat).
Definition
Notation pi := pi.body Expands to: Notation mathcomp.boot.generic_quotient.pi Declared in library mathcomp.boot.generic_quotient, line 158, characters 0-35 pi.body : forall [T : Type] (qT : quotType T), T -> qT pi.body is not universe polymorphic Arguments pi.body [T]%_type_scope qT%_type_scope _ Expands to: Constant mathcomp.boot.generic_quotient.pi.body Declared in library mathcomp.boot.generic_quotient, line 158, characters 0-35
Source code
Lemma
Source code
Lemma
Source code
Proof.
rewrite -(cvg_lim (@Rhausdorff R) h).
apply: (@lt_trans _ _ (\sum_(0 <= < 3) - cos_coeff' 2 i)).
do 3 rewrite big_nat_recl//; rewrite big_nil addr0 3!cos_coeff'E double0.
rewrite cos_coeff_2_0 cos_coeff_2_2 -muln2 cos_coeff_2_4 addrA -(opprD 1).
rewrite opprB -(@natrB _ 2 1)// subn1/= -[in X in X - _](@divff _ 3%:R)//.
by rewrite -mulrBl divr_gt0// -natrB// -[(_ - _)%N]/_.+1.
rewrite -seriesN lt_sum_lim_series //.
by move/cvgP in h; by rewrite seriesN.
move=> d.
rewrite /cos_coeff' 2!exprzD_nat (exprSz _ d.*2) -[in (-1) ^ d.*2](muln2 d).
rewrite -(exprnP _ (d * 2)) (exprM (-1)) sqrr_sign 2!mulr1 -exprSzr.
rewrite -[4%Z]/(_ (2 * 2))%N -(exprnP _ (2 * 2)) (exprM (-1)) sqrr_sign.
rewrite mul1r [(-1) ^ 3](_ : _ = -1) ?mulN1r ?mulNr ?opprK.
by rewrite -exprnP 2!exprS expr1 mulrN1 opprK mulr1.
rewrite subr_gt0.
rewrite addnS doubleS -[X in 2 ^+ X]addn2 exprD -mulrA ltr_pM2l//.
rewrite factS factS 2!natrM mulrA invfM !mulrA.
rewrite ltr_pdivrMr ?ltr0n ?fact_gt0// mulVf ?pnatr_eq0 ?gtn_eqF ?fact_gt0//.
rewrite ltr_pdivrMr ?mul1r //.
by rewrite expr2 -!natrM ltr_nat !mulSn !add2n mul0n !addnS.
Qed.
Lemma
Source code
Proof.
have sinx := @cvg_sin_coeff' _ x.
rewrite -(cvg_lim (@Rhausdorff R) sinx).
rewrite [ltLHS](_ : 0 = \sum_(0 <= < 0) sin_coeff' x i :> R).
by rewrite big_nil.
apply: lt_sum_lim_series; first by move/cvgP in sinx.
move=> d.
rewrite /sin_coeff' 2!exprzD_nat (exprSz _ d.*2) -[in (-1) ^ d.*2](muln2 d).
rewrite -(exprnP _ (d * 2)) (exprM (-1)) sqrr_sign 2!mulr1 -exprSzr.
rewrite !add0n!mul1r mulN1r -[d.*2.+1]addn1 doubleD -addSn exprD.
rewrite -(ffact_fact (leq_addl _ _)) addnK.
rewrite mulNr -!mulrA -mulrBr mulr_gt0 ?exprn_gt0 //.
set u := _.+1.
rewrite natrM invfM.
rewrite -[X in _ < X - _]mul1r !mulrA -mulrBl divr_gt0 // subr_gt0.
set v := _ ^_ _; rewrite -[ltRHS](divff (_ : v%:R != 0)).
by rewrite lt0r_neq0 // (ltr_nat _ 0) ffact_gt0 leq_addl.
rewrite ltr_pM2r; first by rewrite invr_gt0 (ltr_nat _ 0) ffact_gt0 leq_addl.
rewrite {}/v !addnS addn0 !ffactnS ffactn0 muln1 /= natrM.
by rewrite (ltr_pM (ltW _ ) (ltW _)) // (lt_le_trans x_lt2) // ler_nat.
Qed.
Lemma
Source code
Proof.
apply: (@lt_trans _ _ (\sum_(0 <= < 2) cos_coeff' 1 i)).
rewrite big_nat_recr//= big_nat_recr//= big_nil add0r.
rewrite /cos_coeff' expr0z expr1n fact0 !mul1r expr1n expr1z.
by rewrite !mulNr subr_gt0 mul1r div1r ltf_pV2 ?posrE ?ltr0n// ltr_nat.
apply: lt_sum_lim_series; [by move/cvgP in h|move=> d].
rewrite /cos_coeff' !(expr1n,mulr1).
rewrite -muln2 -mulSn muln2 -exprnP -signr_odd odd_double expr0.
rewrite -exprnP -signr_odd oddD/= muln2 odd_double/= expr1 add2n.
rewrite mulNr subr_gt0 2!div1r ltf_pV2 ?posrE ?ltr0n ?fact_gt0//.
by rewrite ltr_nat ltn_pfact//ltn_double doubleS.
Qed.
Lemma
Source code
Source code
Proof.
Lemma
Source code
0 <= x <= 2 -> cos x = 0 -> 0 <= y <= 2 -> cos y = 0 -> x = y.
Proof.
by case: (lerP x y) => [/H //| /ltW /H H1]; [exact|exact/esym/H1].
move=> /andP[x_ge0 x_le2] cx0 /andP[y_ge0 y_le2] cy0.
move: xLy; rewrite le_eqVlt => /predU1P[//|xLLs].
have /(Rolle xLLs)[x1 _|x1|x1 x1I [_ x1D]] : cos x = cos y by rewrite cy0.
- exact: derivable_cos.
- by apply/continuous_subspaceT => ?; exact: continuous_cos.
- have [_ /esym/eqP] := is_derive_cos x1; rewrite x1D oppr_eq0 => /eqP Hs.
suff : 0 < sin x1 by rewrite Hs ltxx.
apply/sin2_gt0/andP; split.
+ by rewrite (le_lt_trans x_ge0)// (itvP x1I).
+ by rewrite (lt_le_trans _ y_le2)// (itvP x1I).
Qed.
Lemma
Source code
Proof.
#[deprecated(note="Use pihalf_ge1 and pihalf_lt2 instead")]
Lemma
Source code
Proof.
Let
Source code
Proof.
rewrite lt_neqAle andbA andbAC pih2 andbT; apply/andP; split; last first.
by apply/eqP => hpi2; have := cos2_lt0; rewrite -hpi2 cpih ltxx.
rewrite leNgt; apply/negP => hpi1; have [x /andP[x1 x2] cs0] := cos_exists.
have := @cos_02_uniq (pi / 2) x.
rewrite pih0 pih2 cpih (le_trans _ x1)// x2 cs0 => /(_ erefl erefl erefl erefl).
by move=> pih; move: hpi1; rewrite pih => /lt_le_trans/(_ x1); rewrite ltxx.
Qed.
Lemma
Source code
Lemma
Source code
Lemma
Source code
Proof.
Lemma
Source code
Proof.
Lemma
Source code
Lemma
Source code
Proof.
by apply: lt_trans xLpi _; exact: pihalf_lt2.
Qed.
Lemma
Source code
Proof.
case: (leP 0 x) => [/Hw//| x_lt_0].
rewrite -{-1}[x]opprK ltrNl andbC [-- _ < _]ltrNl cosN.
by apply: Hw => //; rewrite oppr_cp0 ltW.
move=> /andP[x_gt0 xLpi2]; case: (ler0P (cos x)) => // cx_le0.
have /IVT[]// : minr (cos 0) (cos x) <= 0 <= maxr (cos 0) (cos x).
by rewrite cos0 /minr /maxr !ifN ?cx_le0 //= -leNgt (le_trans cx_le0).
- by apply/continuous_subspaceT => ?; exact: continuous_cos.
move=> x1 /itvP xx1 cx1_eq0.
suff x1E : x1 = pi/2.
have : x1 < pi / 2 by apply: le_lt_trans xLpi2; rewrite xx1.
by rewrite x1E ltxx.
apply: cos_02_uniq=> //; last by case pihalf_02_cos_pihalf => _ ->.
by rewrite xx1 ltW // (lt_trans _ pihalf_lt2) // (le_lt_trans _ xLpi2) // xx1.
by rewrite divr_ge0 ?(ltW pihalf_lt2)// pi_ge0.
Qed.
Lemma
Source code
Proof.
Lemma
Source code
Proof.
rewrite -[in X in _ = X -> _](expr1n _ 2%N) => /eqP; rewrite -subr_eq0 subr_sqr.
rewrite mulf_eq0=> /orP[|]; first by rewrite subr_eq0=> /eqP.
rewrite addr_eq0 => /eqP spi21; have /sin2_gt0: 0 < pi / 2 < 2.
by rewrite pihalf_lt2 andbT (lt_le_trans _ pihalf_ge1).
by rewrite spi21 ltr0N1.
Qed.
Lemma
Source code
Proof.
move=> /predU1P[->|?]; first by rewrite cos_pihalf.
by apply/ltW/cos_gt0_pihalf/andP.
Qed.
Lemma
Source code
Proof.
Lemma
Source code
Lemma
Source code
Lemma
Source code
Lemma
Source code
Lemma
Source code
Lemma
Source code
Lemma
Source code
Lemma
Source code
Proof.
Lemma
Source code
Proof.
Lemma
Source code
Proof.
Lemma
Source code
Proof.
Lemma
Source code
Proof.
Lemma
Source code
Proof.
Lemma
Source code
Proof.
rewrite cos0 le_eqVlt; case: eqP => /= [<- _|_ /andP[y_gt0 gLpi]].
by rewrite cos0 !ltxx.
rewrite y_gt0; apply/idP.
suff : cos y != 1 by case: ltrgtP (cos_le1 y).
rewrite -cos0 eq_sym; apply/eqP => /Rolle [||x1|x1 /itvP x1I [_ x1D]] //.
exact/continuous_subspaceT/continuous_cos.
case: (is_derive_cos x1) => _ /eqP; rewrite x1D eq_sym oppr_eq0 => /eqP s_eq0.
suff : 0 < sin x1 by rewrite s_eq0 ltxx.
by apply: sin_gt0_pi; rewrite x1I /= (lt_le_trans (_ : _ < y)) ?x1I // yI.
rewrite le_eqVlt; case: eqP => [-> _ /andP[y_ge0]|/= _ /andP[x_gt0 x_ltpi]] /=.
rewrite cospi le_eqVlt; case: eqP => /= [-> _|/eqP yDpi y_ltpi].
by rewrite cospi ltxx.
by rewrite ltNge cos_geN1 ltNge ltW.
rewrite le_eqVlt; case: eqP => [<- _|_] /=.
rewrite cos0 [_ < 0]ltNge ltW //=.
by apply/idP/negP; rewrite -leNgt cos_le1.
rewrite le_eqVlt; case: eqP => /= [-> _ | _ /andP[y_gt0 y_ltpi]].
rewrite cospi x_ltpi; apply/idP.
suff : cos x != -1 by case: ltrgtP (cos_geN1 x).
rewrite -cospi; apply/eqP => /Rolle [||x1|x1 /itvP x1I [_ x1D]] //.
exact/continuous_subspaceT/continuous_cos.
case: (is_derive_cos x1) => _ /eqP; rewrite x1D eq_sym oppr_eq0 => /eqP s_eq0.
suff : 0 < sin x1 by rewrite s_eq0 ltxx.
by apply: sin_gt0_pi; rewrite x1I /= (lt_le_trans (_ : _ < x)) ?x1I.
wlog xLy : x y x_gt0 x_ltpi y_gt0 y_ltpi / x <= y => [H | ].
case: (lerP x y) => [/H //->//|yLx].
by rewrite !ltNge ltW ?(ltW yLx) // H // ltW.
move: (xLy); rewrite le_eqVlt => /predU1P[->|xLLs]; first by rewrite ltxx.
rewrite xLLs -subr_gt0 -opprB; rewrite -subr_gt0 in xLLs; apply/idP.
have [x1|z /itvP zI ->] := @MVT_segment _ cos (- sin) _ _ xLy.
exact/continuous_subspaceT/continuous_cos.
rewrite -mulNr opprK mulr_gt0 //; apply: sin_gt0_pi.
by rewrite (lt_le_trans x_gt0) ?zI //= (le_lt_trans _ y_ltpi) ?zI.
Qed.
Lemma
Source code
Proof.
Lemma
Source code
Proof.
Lemma
Source code
Proof.
End Pi.
Arguments pi {R}.
Section Tan.
Variable : realType.
Definition
tan : forall {R : realType}, R -> R tan is not universe polymorphic Arguments tan {R} x%_ring_scope tan is transparent Expands to: Constant mathcomp.analysis.trigo.tan Declared in library mathcomp.analysis.trigo, line 782, characters 11-14
Source code
Lemma
Source code
Lemma
Source code
Lemma
Source code
Lemma
Source code
tan (x + y) = (tan x + tan y) / (1 - tan x * tan y).
Proof.
Lemma
Source code
Lemma
Source code
Lemma
Source code
Proof.
Lemma
Source code
Proof.
Lemma
Source code
Lemma
Source code
Proof.
apply: continuousM; first exact: continuous_sin.
exact/(continuousV cxNZ)/continuous_cos.
Qed.
Lemma
Source code
Proof.
Lemma
Source code
Proof.
Lemma
Source code
Proof.
case: (lerP x y) => [/H //->//|yLx].
by rewrite !ltNge ltW ?(ltW yLx) // H // ltW.
move: (xLy); rewrite le_eqVlt => /predU1P[->|xLLs]; first by rewrite ltxx.
rewrite -subr_gt0 xLLs; rewrite -subr_gt0 in xLLs; apply/idP.
have [x1 /itvP x1I|z |] := @MVT_segment _ tan (fun => (cos x) ^-2) _ _ xLy.
- apply: is_derive_tan.
rewrite gt_eqF // cos_gt0_pihalf // (@lt_le_trans _ _ x) ?x1I ?xB//=.
by rewrite (@le_lt_trans _ _ y) ?x1I ?yB.
- apply/continuous_in_subspaceT => ? -/[!(@mem_setE R)] /itvP inI.
apply: continuous_tan; rewrite gt_eqF// cos_gt0_pihalf//.
by rewrite (@lt_le_trans _ _ x) ?xB ?inI// (@le_lt_trans _ _ y) ?yB ?inI.
- move=> x1 /itvP x1I ->.
rewrite mulr_gt0 // invr_gt0 // exprn_gte0 // cos_gt0_pihalf //.
by rewrite (@lt_le_trans _ _ x) ?x1I ?xB//= (@le_lt_trans _ _ y) ?x1I ?yB.
Qed.
Lemma
Source code
End Tan.
Arguments tan {R}.
#[global] Hint Extern 0 (is_derive _ _ tan _) =>
(eapply is_derive_tan; first by []) : typeclass_instances.
acos_unlock_subterm : unlockable (fun (R : realType) (x : R) => [get x0 : _ | [set y | (0 <= y <= trigo.pi)%R /\ cos y = x]%classic x0]) acos_unlock_subterm is not universe polymorphic acos_unlock_subterm is transparent Expands to: Constant mathcomp.analysis.trigo.acos_unlock_subterm Declared in library mathcomp.analysis.trigo, line 872, characters 0-96
Source code
acos_unlock_subterm : unlockable (fun (R : realType) (x : R) => [get x0 : _ | [set y | (0 <= y <= trigo.pi)%R /\ cos y = x]%classic x0]) acos_unlock_subterm is not universe polymorphic acos_unlock_subterm is transparent Expands to: Constant mathcomp.analysis.trigo.acos_unlock_subterm Declared in library mathcomp.analysis.trigo, line 872, characters 0-96
Source code
acos_unlock_subterm : unlockable (fun (R : realType) (x : R) => [get x0 : _ | [set y | (0 <= y <= trigo.pi)%R /\ cos y = x]%classic x0]) acos_unlock_subterm is not universe polymorphic acos_unlock_subterm is transparent Expands to: Constant mathcomp.analysis.trigo.acos_unlock_subterm Declared in library mathcomp.analysis.trigo, line 872, characters 0-96
Source code
acos_unlock_subterm : unlockable (fun (R : realType) (x : R) => [get x0 : _ | [set y | (0 <= y <= trigo.pi)%R /\ cos y = x]%classic x0]) acos_unlock_subterm is not universe polymorphic acos_unlock_subterm is transparent Expands to: Constant mathcomp.analysis.trigo.acos_unlock_subterm Declared in library mathcomp.analysis.trigo, line 872, characters 0-96
Source code
acos_unlock_subterm : unlockable (fun (R : realType) (x : R) => [get x0 : _ | [set y | (0 <= y <= trigo.pi)%R /\ cos y = x]%classic x0]) acos_unlock_subterm is not universe polymorphic acos_unlock_subterm is transparent Expands to: Constant mathcomp.analysis.trigo.acos_unlock_subterm Declared in library mathcomp.analysis.trigo, line 872, characters 0-96
Source code
get [set | 0 <= y <= pi /\ cos y = x].
Canonical
locked_acos : unlockable (fun (R : realType) (x : R) => [get x0 : _ | [set y | (0 <= y <= trigo.pi)%R /\ cos y = x]%classic x0]) locked_acos is not universe polymorphic locked_acos is transparent Expands to: Constant mathcomp.analysis.trigo.locked_acos Declared in library mathcomp.analysis.trigo, line 874, characters 10-21
Source code
Section Acos.
Variable : realType.
Implicit Type x : R.
Lemma
Source code
-1 <= x <= 1 -> 0 <= acos x <= pi /\ cos (acos x) = x.
Proof.
pose f := cos y - x.
have /(IVT (@pi_ge0 _))[] // : minr (f 0) (f pi) <= 0 <= maxr (f 0) (f pi).
rewrite /f cos0 cospi /minr /maxr ltrD2r -subr_lt0 opprK (_ : 1 + 1 = 2)//.
by rewrite ltrn0 subr_le0 subr_ge0.
- move=> y y0pi.
by apply: continuousB; apply/continuous_in_subspaceT => ? ?;
[exact: continuous_cos|exact: cst_continuous].
- rewrite /f => x1 /itvP x1I /eqP; rewrite subr_eq0 => /eqP cosx1E.
by case: (He x1); rewrite !x1I.
Qed.
Lemma
Source code
Lemma
Source code
Lemma
Source code
Lemma
Source code
Proof.
Lemma
Source code
Proof.
Lemma
Source code
Proof.
Lemma
Source code
Lemma
Source code
Proof.
Lemma
Source code
Proof.
Lemma
Source code
Lemma
Source code
Lemma
Source code
Proof.
Lemma
Source code
Proof.
by have : -1 <= x <= 1 by rewrite !ltW //; case/andP: xB.
apply: nbhs_singleton (near_can_continuous _ _); last first.
by near=> z; apply: continuous_cos.
have /near_in_itvoo aI : acos x \in `]0, pi[.
by rewrite in_itv/= acos_gt0 ?ltW //= acos_ltpi // ltW ?andbT.
near=> z; apply: cosK.
suff /itvP zI : z \in `]0, pi[ by rewrite in_itv/= ltW zI.
by near: z.
Unshelve. all: by end_near. Qed.
Lemma
Source code
-1 < x < 1 -> is_derive x 1 (@acos R) (- (Num.sqrt (1 - x ^+ 2))^-1).
Proof.
rewrite -{1}[x]acosK; first by rewrite in_itv /= ?ltW.
have /near_in_itvoo aI : acos x \in `]0, pi[.
by rewrite in_itv/= acos_gt0 ?ltW //= acos_ltpi // x_gtN1 ltW.
apply: (@is_derive_inverse R cos).
- near=> z; apply: cosK.
suff /itvP zI : z \in `]0, pi[ by rewrite in_itv/= ?zI.
by near: z.
- by near=> z; apply: continuous_cos.
- rewrite oppr_eq0 sin_acos ?ltW // sqrtr_eq0 // -ltNge subr_gt0.
rewrite -real_normK ?qualifE/=; first by case: ltrgt0P.
by rewrite exprn_cp1 // ltr_norml x_gtN1.
Unshelve. all: by end_near. Qed.
End Acos.
#[global] Hint Extern 0 (is_derive _ 1 (@acos _) _) =>
(eapply is_derive1_acos; first by []) : typeclass_instances.
asin_unlock_subterm : unlockable (fun (R : realType) (x : R) => [get x0 : _ | [set y | (- (trigo.pi / 2) <= y <= trigo.pi / 2)%R /\ sin y = x]%classic x0]) asin_unlock_subterm is not universe polymorphic asin_unlock_subterm is transparent Expands to: Constant mathcomp.analysis.trigo.asin_unlock_subterm Declared in library mathcomp.analysis.trigo, line 998, characters 0-108
Source code
asin_unlock_subterm : unlockable (fun (R : realType) (x : R) => [get x0 : _ | [set y | (- (trigo.pi / 2) <= y <= trigo.pi / 2)%R /\ sin y = x]%classic x0]) asin_unlock_subterm is not universe polymorphic asin_unlock_subterm is transparent Expands to: Constant mathcomp.analysis.trigo.asin_unlock_subterm Declared in library mathcomp.analysis.trigo, line 998, characters 0-108
Source code
asin_unlock_subterm : unlockable (fun (R : realType) (x : R) => [get x0 : _ | [set y | (- (trigo.pi / 2) <= y <= trigo.pi / 2)%R /\ sin y = x]%classic x0]) asin_unlock_subterm is not universe polymorphic asin_unlock_subterm is transparent Expands to: Constant mathcomp.analysis.trigo.asin_unlock_subterm Declared in library mathcomp.analysis.trigo, line 998, characters 0-108
Source code
asin_unlock_subterm : unlockable (fun (R : realType) (x : R) => [get x0 : _ | [set y | (- (trigo.pi / 2) <= y <= trigo.pi / 2)%R /\ sin y = x]%classic x0]) asin_unlock_subterm is not universe polymorphic asin_unlock_subterm is transparent Expands to: Constant mathcomp.analysis.trigo.asin_unlock_subterm Declared in library mathcomp.analysis.trigo, line 998, characters 0-108
Source code
asin_unlock_subterm : unlockable (fun (R : realType) (x : R) => [get x0 : _ | [set y | (- (trigo.pi / 2) <= y <= trigo.pi / 2)%R /\ sin y = x]%classic x0]) asin_unlock_subterm is not universe polymorphic asin_unlock_subterm is transparent Expands to: Constant mathcomp.analysis.trigo.asin_unlock_subterm Declared in library mathcomp.analysis.trigo, line 998, characters 0-108
Source code
get [set | -(pi / 2) <= y <= pi / 2 /\ sin y = x].
Canonical
locked_asin : unlockable (fun (R : realType) (x : R) => [get x0 : _ | [set y | (- (trigo.pi / 2) <= y <= trigo.pi / 2)%R /\ sin y = x]%classic x0]) locked_asin is not universe polymorphic locked_asin is transparent Expands to: Constant mathcomp.analysis.trigo.locked_asin Declared in library mathcomp.analysis.trigo, line 1000, characters 10-21
Source code
Section Asin.
Variable : realType.
Implicit Type x : R.
Lemma
Source code
-1 <= x <= 1 -> -(pi / 2) <= asin x <= pi / 2 /\ sin (asin x) = x.
Proof.
pose f := sin y - x.
have /IVT[] // :
minr (f (-(pi/2))) (f (pi/2)) <= 0 <= maxr (f (-(pi/2))) (f (pi/2)).
rewrite /f sinN sin_pihalf /minr /maxr ltrD2r -subr_gt0 opprK.
by rewrite (_ : 1 + 1 = 2)// ltr0n/= subr_le0 subr_ge0.
- by rewrite -subr_ge0 opprK -splitr pi_ge0.
- by move=> *; apply: continuousB; apply/continuous_in_subspaceT => ? ?;
[exact: continuous_sin| exact: cst_continuous].
- rewrite /f => x1 /itvP x1I /eqP; rewrite subr_eq0 => /eqP sinx1E.
by case: (He x1); rewrite !x1I.
Qed.
Lemma
Source code
Lemma
Source code
Lemma
Source code
Lemma
Source code
Proof.
Lemma
Source code
Proof.
Lemma
Source code
Proof.
Lemma
Source code
Proof.
by apply: cos_ge0_pihalf; rewrite asin_lepi2 // asin_geNpi2.
Qed.
Lemma
Source code
Proof.
by have : -1 <= x <= 1 by rewrite !ltW //; case/andP: xB.
apply: nbhs_singleton (near_can_continuous _ _); last first.
by near=> z; apply: continuous_sin.
have /near_in_itvoo aI : asin x \in `](-(pi/2)), (pi/2)[.
by rewrite in_itv/= asin_gtNpi2 ?ltW ?andbT //= asin_ltpi2 // ltW.
near=> z; apply: sinK.
suff /itvP zI : z \in `](-(pi/2)), (pi/2)[.
by have : - (pi / 2) <= z <= pi / 2 by rewrite ltW ?zI.
by near: z.
Unshelve. all: by end_near. Qed.
Lemma
Source code
-1 < x < 1 -> is_derive x 1 (@asin R) (Num.sqrt (1 - x ^+ 2))^-1.
Proof.
rewrite -{1}[x]asinK; first by have : -1 <= x <= 1 by rewrite ltW // ltW.
have /near_in_itvoo aI : asin x \in `](-(pi/2)), (pi/2)[.
by rewrite in_itv/= asin_gtNpi2 ?ltW ?andbT //= asin_ltpi2 // ltW.
apply: (@is_derive_inverse R sin).
- near=> z; apply: sinK.
suff /itvP zI : z \in `](-(pi/2)), (pi/2)[.
by have : - (pi / 2) <= z <= pi / 2 by rewrite ltW ?zI.
by near: z.
- by near=> z; exact: continuous_sin.
- rewrite cos_asin ?ltW // sqrtr_eq0 // -ltNge subr_gt0.
rewrite -real_normK ?qualifE/=; first by case: ltrgt0P.
by rewrite exprn_cp1 // ltr_norml x_gtN1.
Unshelve. all: by end_near. Qed.
End Asin.
#[global] Hint Extern 0 (is_derive _ 1 (@asin _) _) =>
(eapply is_derive1_asin; first by []) : typeclass_instances.
atan_unlock_subterm : unlockable (fun (R : realType) (x : R) => [get x0 : _ | [set y | (- (trigo.pi / 2) < y < trigo.pi / 2)%R /\ tan y = x]%classic x0]) atan_unlock_subterm is not universe polymorphic atan_unlock_subterm is transparent Expands to: Constant mathcomp.analysis.trigo.atan_unlock_subterm Declared in library mathcomp.analysis.trigo, line 1098, characters 0-106
Source code
atan_unlock_subterm : unlockable (fun (R : realType) (x : R) => [get x0 : _ | [set y | (- (trigo.pi / 2) < y < trigo.pi / 2)%R /\ tan y = x]%classic x0]) atan_unlock_subterm is not universe polymorphic atan_unlock_subterm is transparent Expands to: Constant mathcomp.analysis.trigo.atan_unlock_subterm Declared in library mathcomp.analysis.trigo, line 1098, characters 0-106
Source code
atan_unlock_subterm : unlockable (fun (R : realType) (x : R) => [get x0 : _ | [set y | (- (trigo.pi / 2) < y < trigo.pi / 2)%R /\ tan y = x]%classic x0]) atan_unlock_subterm is not universe polymorphic atan_unlock_subterm is transparent Expands to: Constant mathcomp.analysis.trigo.atan_unlock_subterm Declared in library mathcomp.analysis.trigo, line 1098, characters 0-106
Source code
atan_unlock_subterm : unlockable (fun (R : realType) (x : R) => [get x0 : _ | [set y | (- (trigo.pi / 2) < y < trigo.pi / 2)%R /\ tan y = x]%classic x0]) atan_unlock_subterm is not universe polymorphic atan_unlock_subterm is transparent Expands to: Constant mathcomp.analysis.trigo.atan_unlock_subterm Declared in library mathcomp.analysis.trigo, line 1098, characters 0-106
Source code
atan_unlock_subterm : unlockable (fun (R : realType) (x : R) => [get x0 : _ | [set y | (- (trigo.pi / 2) < y < trigo.pi / 2)%R /\ tan y = x]%classic x0]) atan_unlock_subterm is not universe polymorphic atan_unlock_subterm is transparent Expands to: Constant mathcomp.analysis.trigo.atan_unlock_subterm Declared in library mathcomp.analysis.trigo, line 1098, characters 0-106
Source code
get [set | -(pi / 2) < y < pi / 2 /\ tan y = x].
Canonical
locked_atan : unlockable (fun (R : realType) (x : R) => [get x0 : _ | [set y | (- (trigo.pi / 2) < y < trigo.pi / 2)%R /\ tan y = x]%classic x0]) locked_atan is not universe polymorphic locked_atan is transparent Expands to: Constant mathcomp.analysis.trigo.locked_atan Declared in library mathcomp.analysis.trigo, line 1100, characters 10-21
Source code
Section oneDsqr.
Context { : realType}.
Implicit Type x : R.
Definition
oneDsqr : forall {R : realType}, R -> R oneDsqr is not universe polymorphic Arguments oneDsqr {R} x%_ring_scope oneDsqr is transparent Expands to: Constant mathcomp.analysis.trigo.oneDsqr Declared in library mathcomp.analysis.trigo, line 1106, characters 11-18
Source code
Lemma
Source code
#[local]
Hint Extern 0 (is_true (1 <= oneDsqr _)) => solve[apply: oneDsqr_ge1] : core.
Canonical
oneDsqr_inum : forall {R : realType}, R -> {itv R & `[1%Z, +oo[%R} oneDsqr_inum is not universe polymorphic Arguments oneDsqr_inum {R} x%_ring_scope oneDsqr_inum is transparent Expands to: Constant mathcomp.analysis.trigo.oneDsqr_inum Declared in library mathcomp.analysis.trigo, line 1114, characters 10-22
Source code
(BLeft 1%Z) (BInfty _ false) (oneDsqr_ge1 x) erefl.
Lemma
Source code
Proof.
Lemma
Source code
Proof.
Lemma
Source code
Proof.
End oneDsqr.
#[global]
Hint Extern 0 (is_true (1 <= oneDsqr _)) => solve [apply: oneDsqr_ge1] : core.
Section Atan.
Context { : realType}.
Implicit Type x : R.
Lemma
Source code
Proof.
pose x1 := Num.sqrt (1 + x ^+ 2)^-1.
have ox2_gt0 : 0 < 1 + x^2 by exact/ltr_pwDl/sqr_ge0.
have ox2_ge0 : 0 <= 1 + x^2 by rewrite ltW.
have x1B : -1 <= x1 <= 1.
rewrite -ler_norml /x1 ger0_norm ?sqrt_ge0// -[leRHS]sqrtr1.
by rewrite ler_psqrt ?qualifE/= ?invr_gte0// invf_le1// lerDl sqr_ge0.
case: (He (Num.sg x * acos x1)); split; last first.
have [->|xD0] := eqVneq x 0; first by rewrite sgr0 mul0r tan0.
rewrite /tan sin_sg cos_sg // acosK ?sin_acos// /x1 sqr_sqrtr// ?invr_ge0//.
rewrite -[X in 1 - X]div1r -[X in X - _]divr1// -mulNr addf_div ?lt0r_neq0//.
rewrite mul1r mulr1 [X in X - 1]addrC addrK// sqrtrM ?sqr_ge0// sqrtrV//.
rewrite invrK// mulrA divfK//; first by rewrite sqrtr_eq0 -ltNge.
by rewrite sqrtr_sqr -numEsg.
rewrite -ltr_norml normrM.
have pi2 : 0 < pi / 2 :> R by rewrite divr_gt0 // pi_gt0.
have [->|xD0] := eqVneq x 0; first by rewrite sgr0 normr0 mul0r.
rewrite normr_sg xD0 mul1r ltr_norml.
rewrite (@lt_le_trans _ _ 0) ?acos_ge0 ?oppr_cp0 //=.
rewrite -ltr_cos ?in_itv/= ?acos_ge0/= ?acos_lepi//.
by rewrite ltW//= ler_pdivrMr// ler_pMr ?pi_gt0// ler1n.
by rewrite cos_pihalf acosK// sqrtr_gt0 ?invr_gt0.
Qed.
Lemma
Source code
Lemma
Source code
Lemma
Source code
Proof.
Lemma
Source code
Proof.
- by rewrite in_itv/= atan_gtNpi2 atan_ltpi2.
- by rewrite in_itv/= oppr_cp0 divr_gt0 ?pi_gt0.
Qed.
Lemma
Source code
Proof.
by rewrite atanK tan_piquarter.
by rewrite in_itv/= atan_gtNpi2 atan_ltpi2.
rewrite in_itv/= -divrN !ltr_pM2l ?pi_gt0// (lt_trans (_ : _ < 0))//=.
by rewrite ltf_pV2 ?qualifE//= ltr_nat.
Qed.
Lemma
Source code
Proof.
- by rewrite in_itv/= ltrNl opprK ltrNl andbC atan_ltpi2 atan_gtNpi2.
- by rewrite tanN !atanK.
Qed.
Lemma
Source code
Proof.
by rewrite in_itv/= atan_gtNpi2 atan_ltpi2.
Qed.
Lemma
Source code
Proof.
have /near_in_itvoo aI : atan x \in `](-(pi / 2)), (pi / 2)[.
by rewrite in_itv/= atan_gtNpi2 atan_ltpi2.
apply: nbhs_singleton (near_can_continuous _ _); last first.
by near=> z; apply/continuous_tan/lt0r_neq0/cos_gt0_pihalf; near: z.
by near=> z; apply: tanK; near: z.
Unshelve. all: by end_near. Qed.
Lemma
Source code
Proof.
by apply: cos_gt0_pihalf; rewrite atan_gtNpi2 atan_ltpi2.
have cosD0 : cos (atan x) != 0 by apply: lt0r_neq0.
have /eqP : cos (atan x) ^+2 = (Num.sqrt (1 + x ^+ 2))^-2.
by rewrite -[LHS]invrK cos2_tan2 // atanK sqr_sqrtr // addr_ge0 // sqr_ge0.
rewrite -exprVn eqf_sqr => /orP[] /eqP // cosE.
move: cos_gt0; rewrite cosE ltNge; case/negP.
by rewrite oppr_le0 invr_ge0 sqrtr_ge0.
Qed.
Global Instance
Source code
Proof.
have cosD0 : cos (atan x) != 0.
by apply/lt0r_neq0/cos_gt0_pihalf; rewrite atan_gtNpi2 atan_ltpi2.
have /near_in_itvoo aI : atan x \in `](-(pi/2)), (pi/2)[.
by rewrite in_itv/= atan_gtNpi2 atan_ltpi2.
apply: (@is_derive_inverse R tan).
- by near=> z; apply: tanK; near: z.
- by near=> z; apply/continuous_tan/lt0r_neq0/cos_gt0_pihalf; near: z.
- by rewrite -[X in 1 + X ^+ 2]atanK -cos2_tan2 //; exact: is_derive_tan.
exact/lt0r_neq0/ltr_pwDl/sqr_ge0.
Unshelve. all: by end_near. Qed.
Lemma
Source code
Proof.
Lemma
Source code
Proof.
Lemma
Source code
Proof.
have datan z : z \in `]x, y[ -> is_derive z 1 atan (1 + z ^+ 2)^-1.
by move=> _; exact: is_derive1_atan.
have catan : {within `[x, y], continuous atan}.
by apply: derivable_within_continuous => z _; exact: ex_derive.
have [c _ ->] := MVT xy datan catan.
by rewrite mulr_gt0// ?subr_gt0// invr_gt0// ltr_wpDr// sqr_ge0.
Qed.
Lemma
Source code
Lemma
Source code
Proof.
by move=> _ /= [x _ <-]; exact/ltW/atan_ltpi2.
rewrite (_ : pi / 2 = sup (range atan)); last first.
by apply/(nondecreasing_cvgr le_atan); exists (pi / 2).
apply/eqP; rewrite eq_le; apply/andP; split; last first.
by apply: ge_sup => //; exists 0, 0 => //; exact: atan0.
have -> : pi / 2 = sup `[0, pi / 2[ :> R.
by rewrite real_interval.sup_itv// bnd_simp divr_gt0// pi_gt0.
apply: supS.
- by exists 0; rewrite /= in_itv/= lexx/= divr_gt0// pi_gt0.
- split; first by exists 0, 0 => //; rewrite atan0.
by exists (pi / 2) => _ [x _ <-]; exact/ltW/atan_ltpi2.
move=> x/= /itvP x0pi2; exists (tan x) => //=.
rewrite tanK// in_itv/= x0pi2 andbT (@lt_le_trans _ _ 0) ?x0pi2//.
by rewrite ltrNl oppr0 divr_gt0// pi_gt0.
Qed.
Let := @lebesgue_measure R.
Lemma
Source code
\int[mu]_( in `[0, b]) (oneDsqr x)^-1 = atan b.
Proof.
by rewrite set_itv1 Rintegral_set1 atan0.
rewrite /Rintegral (@continuous_FTC2 _ _ atan)//.
- by apply: continuous_in_subspaceT => x ?; exact: continuous_oneDsqrV.
- split.
+ by move=> x _; exact: derivable_atan.
+ by apply: cvg_at_right_filter; exact: continuous_atan.
+ by apply: cvg_at_left_filter; exact: continuous_atan.
- by move=> x x01; rewrite derive1_atan// mul1r.
- by rewrite atan0 sube0.
Qed.
Import MeasurableR.
Lemma
Source code
(\int[mu]_( in `[0%R, +oo[) (oneDsqr x)^-1%:E = (pi / 2)%:E)%E.
Proof.
- by move=> x _; rewrite invr_ge0.
- apply/continuous_within_itvcyP; split.
by move=> x x0; apply: continuous_oneDsqrV.
by apply: cvg_at_right_filter; exact: continuous_oneDsqrV.
- move=> x x0; apply: ex_derive.
- by apply: cvg_at_right_filter; exact: continuous_atan.
- by move=> x _; rewrite derive1E; exact: derive_val.
- by rewrite atan0 oppr0 addr0.
Qed.
End Atan.