Skip to content

Commit

Permalink
rename following mathcomp
Browse files Browse the repository at this point in the history
  • Loading branch information
affeldt-aist committed Oct 13, 2021
1 parent 4430f45 commit c51f1a6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG_UNRELEASED.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
`exp_funD`, `exp_fun_inv`, `exp_fun_mulrn`
+ definition `riemannR`, lemmas `riemannR_gt0`, `dvg_riemannR`
- new file `trigo.v`
+ lemmas `sqrtvR`, `divr_eq`, `sum_group`, `cvg_series_cvg_series_group`,
+ lemmas `sqrtvR`, `eqr_div`, `big_nat_mul`, `cvg_series_cvg_series_group`,
`cvg_series_cvg_series_group2`, `lt_sum_lim_series`
+ definitions `periodic`, `alternating`
+ lemmas `periodicn`, `alternatingn`
Expand Down
2 changes: 1 addition & 1 deletion theories/exp.v
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ From mathcomp Require Import matrix interval rat.
Require Import boolp reals ereal.
Require Import nsatz_realtype.
Require Import classical_sets posnum topology normedtype landau sequences.
Require Import derive continuous_inverse.
Require Import derive inverse_continuous.

(******************************************************************************)
(* Theory of exponential/logarithm functions *)
Expand Down
24 changes: 14 additions & 10 deletions theories/trigo.v
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ Import numFieldNormedType.Exports.
Local Open Scope classical_set_scope.
Local Open Scope ring_scope.

(* NB: packport to mathcomp in progress *)
Lemma sqrtrV (R : rcfType) (x : R) : 0 <= x -> Num.sqrt (x^-1) = (Num.sqrt x)^-1.
Proof.
move=> x_ge0.
Expand All @@ -47,7 +48,7 @@ rewrite -[LHS]mul1r -(mulVf (_ : Num.sqrt x != 0)); last first.
by rewrite -mulrA -sqrtrM // divff // sqrtr1 mulr1.
Qed.

Lemma divr_eq (R : numFieldType) (x y z t : R):
Lemma eqr_div (R : numFieldType) (x y z t : R):
y != 0 -> t != 0 -> (x / y == z / t) = (x * t == z * y).
Proof.
move=> yD0 tD0.
Expand All @@ -56,29 +57,32 @@ apply/eqP/eqP=> [->//|H].
by apply/(mulIf tD0)/(mulIf yD0).
Qed.

Lemma sum_group (R : zmodType) (f : R ^nat) (n k : nat) :
\sum_(0 <= i < n) \sum_(i * k <= j < i.+1 * k) f j =
\sum_(0 <= i < n * k) f i.
Lemma big_nat_mul (R : zmodType) (f : R ^nat) (n k : nat) :
\sum_(0 <= i < n * k) f i =
\sum_(0 <= i < n) \sum_(i * k <= j < i.+1 * k) f j.
Proof.
elim: n => [|n ih]; first by rewrite mul0n 2!big_nil.
rewrite big_nat_recr//= ih mulSn addnC [in RHS]/index_iota subn0 iota_add.
rewrite big_cat /= [in X in X + _ = _]/index_iota subn0; congr (_ + _).
by rewrite /index_iota addnC addnK.
rewrite [in RHS]big_nat_recr//= -ih mulSn addnC [in LHS]/index_iota subn0 iotaD.
rewrite big_cat /= [in X in _ = X _]/index_iota subn0; congr (_ + _).
by rewrite add0n /index_iota (addnC _ k) addnK.
Qed.
(* /NB: packport to mathcomp in progress *)

Lemma cvg_series_cvg_series_group (R : realFieldType) (f : R ^nat) k : cvg (series f) -> (0 < k)%N ->
Lemma cvg_series_cvg_series_group (R : realFieldType) (f : R ^nat) k :
cvg (series f) -> (0 < k)%N ->
series (fun n => \sum_(n * k <= i < n.+1 * k) f i) --> lim (series f).
Proof.
move=> /cvg_ballP cf k0; apply/cvg_ballP => _/posnumP[e].
have := cf _ (posnum_gt0 e); rewrite near_map => -[n _ nl].
rewrite near_map; near=> m.
rewrite /ball /= [in X in `|_ - X|]/series [in X in `|_ - X|]/= sum_group.
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.
Grab Existential Variables. all: end_near. Qed.

Lemma cvg_series_cvg_series_group2 (R : realFieldType) (f : R ^nat) : cvg (series f) ->
Lemma cvg_series_cvg_series_group2 (R : realFieldType) (f : R ^nat) :
cvg (series f) ->
series (fun n => \sum_(n.*2 <= i < n.*2 + 2) f i) --> lim (series f).
Proof.
move=> cf; rewrite [X in series X --> _](_ : _ =
Expand Down

0 comments on commit c51f1a6

Please sign in to comment.