From mathcomp Require Import all_ssreflect ssralg ssrint ssrnum matrix.
From mathcomp Require Import interval rat.
From mathcomp Require Import mathcomp_extra boolp classical_sets functions.
From mathcomp Require Import set_interval.
Require Import reals ereal signed topology normedtype landau.
# Definitions and lemmas about sequences
The purpose of this file is to gather generic definitions and lemmas about
sequences.
```
nondecreasing_seq u == the sequence u is non-decreasing
nonincreasing_seq u == the sequence u is non-increasing
increasing_seq u == the sequence u is (strictly) increasing
decreasing_seq u == the sequence u is (strictly) decreasing
```
## About sequences of real numbers
```
[sequence u_n]_n == the sequence of general element u_n
R ^nat == notation for the type of sequences, i.e.,
functions of type nat -> R
seqDU F == sequence F_0, F_1 \ F_0, F_2 \ (F_0 U F_1),...
seqD F == the sequence F_0, F_1 \ F_0, F_2 \ F_1,...
series u_ == the sequence of partial sums of u_
telescope u_ := [sequence u_ n.+1 - u_ n]_n
harmonic == harmonic sequence
arithmetic == arithmetic sequence
geometric == geometric sequence
also arithmetic_mean, harmonic_mean,
root_mean_square
[series u_n]_n == the series of general element u_n
[normed S] == transforms a series S = [series u_n]_n in its
normed series [series `|u_n|]_n] (useful to
represent absolute and normed convergence:
cvg [norm S_n])
exp_coeff n == the sequence of coefficients of the real
exponential
expR x == the exponential function defined on a realType
is_cvg_series_exp_coeff == convergence of \sum_n^+oo x^n / n!
\sum_<range> F i == lim (fun n => (\sum_<range>) F i)) where
<range> can be (i <oo), (i <oo | P i),
(m <= i <oo), or (m <= i <oo | P i)
```
Sections sequences_R_* contain properties of sequences of real numbers.
For example:
```
nonincreasing_cvgn_ge u_ == if u_ is nonincreasing and convergent then
forall n, lim u_ <= u_ n
nondecreasing_cvgn_le u_ == if u_ is nondecreasing and convergent then
forall n, lim u_ >= u_ n
nondecreasing_cvgn u_ == if u_ is nondecreasing and bounded then u_
is convergent and its limit is sup u_n
nonincreasing_cvgn u_ == if u_ is nonincreasing u_ and bound by below
then u_ is convergent
adjacent == adjacent sequences lemma
cesaro == Cesaro's lemma
```
## About sequences of natural numbers
nseries
## About sequences of extended real numbers
eseries, etelescope, etc.
Section sequences_ereal contain properties of sequences of extended real
numbers.
Naming convention: lemmas about series of non-negative (resp. non-
positive) extended numbers use the string "nneseries" (resp. "npeseries")
as part of their identifier
## Limit superior and inferior for sequences:
```
sdrop u n := {u_k | k >= n}
sups u := [sequence sup (sdrop u n)]_n
infs u := [sequence inf (sdrop u n)]_n
limn_sup, limn_inf == limit sup/inferior for a sequence of reals
esups u := [sequence ereal_sup (sdrop u n)]_n
einfs u := [sequence ereal_inf (sdrop u n)]_n
limn_esup u, limn_einf == limit sup/inferior for a sequence of
of extended reals
```
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.
Reserved Notation "R ^nat" (
at level 0).
Reserved Notation "a `^ x" (
at level 11).
Reserved Notation "[ 'sequence' E ]_ n"
(
at level 0, E at level 200, n name, format "[ 'sequence' E ]_ n").
Reserved Notation "[ 'series' E ]_ n"
(
at level 0, E at level 0, n name, format "[ 'series' E ]_ n").
Reserved Notation "[ 'normed' E ]" (at level 0, format "[ 'normed' E ]").
Reserved Notation "\big [ op / idx ]_ ( m <= i <oo | P ) F"
(
at level 36, F at level 36, op, idx at level 10, m, i at level 50,
format "'[' \big [ op / idx ]_ ( m <= i <oo | P ) F ']'").
Reserved Notation "\big [ op / idx ]_ ( m <= i <oo ) F"
(
at level 36, F at level 36, op, idx at level 10, i, m at level 50,
format "'[' \big [ op / idx ]_ ( m <= i <oo ) '/ ' F ']'").
Reserved Notation "\big [ op / idx ]_ ( i <oo | P ) F"
(
at level 36, F at level 36, op, idx at level 10, i at level 50,
format "'[' \big [ op / idx ]_ ( i <oo | P ) '/ ' F ']'").
Reserved Notation "\big [ op / idx ]_ ( i <oo ) F"
(
at level 36, F at level 36, op, idx at level 10, i at level 50,
format "'[' \big [ op / idx ]_ ( i <oo ) F ']'").
Reserved Notation "\sum_ ( m <= i '<oo' | P ) F"
(
at level 41, F at level 41, i, m at level 50,
format "'[' \sum_ ( m <= i <oo | P ) '/ ' F ']'").
Reserved Notation "\sum_ ( m <= i '<oo' ) F"
(
at level 41, F at level 41, i, m at level 50,
format "'[' \sum_ ( m <= i <oo ) '/ ' F ']'").
Reserved Notation "\sum_ ( i '<oo' | P ) F"
(
at level 41, F at level 41, i at level 50,
format "'[' \sum_ ( i <oo | P ) '/ ' F ']'").
Reserved Notation "\sum_ ( i '<oo' ) F"
(
at level 41, F at level 41, i at level 50,
format "'[' \sum_ ( i <oo ) '/ ' F ']'").
Definition sequence R := nat -> R.
Definition mk_sequence R f : sequence R := f.
Arguments mk_sequence R f /.
Notation "[ 'sequence' E ]_ n" := (
mk_sequence (
fun n => E%E))
: ereal_scope.
Notation "[ 'sequence' E ]_ n" := (
mk_sequence (
fun n => E))
: ring_scope.
Notation "R ^nat" := (
sequence R)
: type_scope.
Notation "'nondecreasing_seq' f" := (
{homo f : n m / (
n <= m)
%nat >-> (
n <= m)
%O})
(
at level 10).
Notation "'nonincreasing_seq' f" := (
{homo f : n m / (
n <= m)
%nat >-> (
n >= m)
%O})
(
at level 10).
Notation "'increasing_seq' f" := (
{mono f : n m / (
n <= m)
%nat >-> (
n <= m)
%O})
(
at level 10).
Notation "'decreasing_seq' f" := (
{mono f : n m / (
n <= m)
%nat >-> (
n >= m)
%O})
(
at level 10).
Lemma nondecreasing_opp (
T : numDomainType) (
u_ : T ^nat)
:
nondecreasing_seq (
- u_)
= nonincreasing_seq u_.
Proof.
Lemma nonincreasing_opp (
T : numDomainType) (
u_ : T ^nat)
:
nonincreasing_seq (
- u_)
= nondecreasing_seq u_.
Proof.
Lemma decreasing_opp (
T : numDomainType) (
u_ : T ^nat)
:
decreasing_seq (
- u_)
= increasing_seq u_.
Proof.
Lemma increasing_opp (
T : numDomainType) (
u_ : T ^nat)
:
increasing_seq (
- u_)
= decreasing_seq u_.
Proof.
Lemma nondecreasing_seqP (
d : unit) (
T : porderType d) (
u_ : T ^nat)
:
(
forall n, u_ n <= u_ n.
+1)
%O <-> nondecreasing_seq u_.
Proof.
Lemma nonincreasing_seqP (
d : unit) (
T : porderType d) (
u_ : T ^nat)
:
(
forall n, u_ n >= u_ n.
+1)
%O <-> nonincreasing_seq u_.
Proof.
split; first by apply: homo_leq (
fun _ _ _ u v => le_trans v u).
by move=> u_nincr n; exact: u_nincr.
Qed.
Lemma increasing_seqP (
d : unit) (
T : porderType d) (
u_ : T ^nat)
:
(
forall n, u_ n < u_ n.
+1)
%O <-> increasing_seq u_.
Proof.
Lemma decreasing_seqP (
d : unit) (
T : porderType d) (
u_ : T ^nat)
:
(
forall n, u_ n > u_ n.
+1)
%O <-> decreasing_seq u_.
Proof.
Lemma lef_at (
aT : Type)
d (
T : porderType d) (
f : (
aT -> T)
^nat)
x :
nondecreasing_seq f -> {homo (
f^~ x)
: n m / (
n <= m)
%N >-> (
n <= m)
%O}.
Proof.
by move=> nf m n mn; have /asboolP := nf _ _ mn; exact. Qed.
Lemma nondecreasing_seqD T (
d : unit) (
R : numDomainType) (
f g : (
T -> R)
^nat)
:
(
forall x, nondecreasing_seq (
f ^~ x))
->
(
forall x, nondecreasing_seq (
g ^~ x))
->
(
forall x, nondecreasing_seq ((
f \+ g)
^~ x)).
Proof.
by move=> ndf ndg t m n mn; apply: lerD; [exact/ndf|exact/ndg]. Qed.
Local Notation eqolimn := (
@eqolim _ _ _ eventually_filter).
Local Notation eqolimPn := (
@eqolimP _ _ _ eventually_filter).
Sequences of sets
Section seqDU.
Variables (
T : Type).
Implicit Types F : (
set T)
^nat.
Definition seqDU F n := F n `\` \big[setU/set0]_(
k < n)
F k.
Lemma trivIset_seqDU F : trivIset setT (
seqDU F).
Proof.
move=> i j _ _; wlog ij : i j / (
i < j)
%N => [/(
_ _ _ _)
tB|].
by have [ij /tB->|ij|] := ltngtP i j; rewrite //setIC => /tB ->.
move=> /set0P; apply: contraNeq => _; apply/eqP.
rewrite /seqDU 2!setDE !setIA setIC (
bigD1 (
Ordinal ij))
//=.
by rewrite setCU setIAC !setIA setICl !set0I.
Qed.
Lemma bigsetU_seqDU F n :
\big[setU/set0]_(
k < n)
F k = \big[setU/set0]_(
k < n)
seqDU F k.
Proof.
elim: n => [|n ih]; first by rewrite 2!big_ord0.
rewrite !big_ord_recr /= predeqE => t; split=> [[Ft|Fnt]|[Ft|[Fnt Ft]]].
- by left; rewrite -ih.
- have [?|?] := pselect ((
\big[setU/set0]_(
i < n)
seqDU F i)
t)
; first by left.
by right; split => //; rewrite ih.
- by left; rewrite ih.
- by right.
Qed.
Lemma seqDU_bigcup_eq F : \bigcup_k F k = \bigcup_k seqDU F k.
Proof.
rewrite /seqDU predeqE => t; split=> [[n _ Fnt]|[n _]]; last first.
by rewrite setDE => -[? _]; exists n.
have [UFnt|UFnt] := pselect ((
\big[setU/set0]_(
k < n)
F k)
t)
; last by exists n.
suff [m [Fmt FNmt]] : exists m, F m t /\ forall k, (
k < m)
%N -> ~ F k t.
by exists m => //; split => //; rewrite -bigcup_mkord => -[k kj]; exact: FNmt.
move: UFnt; rewrite -bigcup_mkord => -[/= k _ Fkt] {Fnt n}.
have [n kn] := ubnP k; elim: n => // n ih in t k Fkt kn *.
case: k => [|k] in Fkt kn *; first by exists O.
have [?|] := pselect (
forall m, (
m <= k)
%N -> ~ F m t)
; first by exists k.
+1.
move=> /existsNP[i] /not_implyP[ik] /contrapT Fit; apply: (
ih t i)
=> //.
by rewrite (
leq_ltn_trans ik).
Qed.
Lemma seqDUIE (
S : set T) (
F : (
set T)
^nat)
:
seqDU (
fun n => S `&` F n)
= (
fun n => S `&` F n `\` \bigcup_(
i < n)
F i).
Proof.
End seqDU.
Arguments trivIset_seqDU {T} F.
#[global] Hint Resolve trivIset_seqDU : core.
Section seqD.
Variable T : Type.
Implicit Types F : (
set T)
^nat.
Definition seqD F := fun n => if n isn't n'.
+1 then F O else F n `\` F n'.
Lemma seqDU_seqD F : nondecreasing_seq F -> seqDU F = seqD F.
Proof.
move=> ndF; rewrite funeqE => -[|n] /=; first by rewrite /seqDU big_ord0 setD0.
rewrite /seqDU big_ord_recr /= setUC; congr (
_ `\` _)
; apply/setUidPl.
by rewrite -bigcup_mkord => + [k /= kn]; exact/subsetPset/ndF/ltnW.
Qed.
Lemma trivIset_seqD F : nondecreasing_seq F -> trivIset setT (
seqD F).
Proof.
Lemma bigsetU_seqD F n :
\big[setU/set0]_(
i < n)
F i = \big[setU/set0]_(
i < n)
seqD F i.
Proof.
case: n => [|n]; first by rewrite 2!big_ord0.
elim: n => [|n ih]; first by rewrite !big_ord_recl !big_ord0.
rewrite big_ord_recr [in RHS]big_ord_recr /= -{}ih predeqE => x; split.
move=> [?|?]; first by left.
have [?|?] := pselect (
F n x)
; last by right.
by left; rewrite big_ord_recr /=; right.
by move=> [?|[? ?]]; [left | right].
Qed.
Lemma setU_seqD F : nondecreasing_seq F ->
forall n, F n.
+1 = F n `|` seqD F n.
+1.
Proof.
move=> ndF n; rewrite /seqD funeqE => x; rewrite propeqE; split.
by move=> ?; have [?|?] := pselect (
F n x)
; [left | right].
by move=> -[|[]//]; move: x; exact/subsetPset/ndF.
Qed.
Lemma eq_bigsetU_seqD F n : nondecreasing_seq F ->
F n = \big[setU/set0]_(
i < n.
+1)
seqD F i.
Proof.
Lemma eq_bigcup_seqD F : \bigcup_n F n = \bigcup_n seqD F n.
Proof.
rewrite funeqE => x; rewrite propeqE; split.
case; elim=> [_ F0x|n ih _ Fn1x]; first by exists O.
have [|Fnx] := pselect (
F n x)
; last by exists n.
+1.
by move=> /(
ih I)
[m _ Fmx]; exists m.
case; elim=> [_ /= F0x|n ih _ /= [Fn1x Fnx]]; by [exists O | exists n.
+1].
Qed.
Lemma eq_bigcup_seqD_bigsetU F :
\bigcup_n (
seqD (
fun n => \big[setU/set0]_(
i < n.
+1)
F i)
n)
= \bigcup_n F n.
Proof.
rewrite -(
@eq_bigcup_seqD (
fun n => \big[setU/set0]_(
i < n.
+1)
F i)).
rewrite eqEsubset; split => [t [i _]|t [i _ Fit]].
by rewrite -bigcup_seq_cond => -[/= j _ Fjt]; exists j.
by exists i => //; rewrite big_ord_recr /=; right.
Qed.
End seqD.
Convergence of patched sequences
Section sequences_patched.
Section NatShift.
Variables (
N : nat) (
V : topologicalType).
Implicit Types (
f : nat -> V) (
u : V ^nat) (
l : V).
Lemma cvg_restrict f u_ l :
(
[sequence if (
n <= N)
%N then f n else u_ n]_n @ \oo --> l)
=
(
u_ @ \oo --> l).
Proof.
Lemma is_cvg_restrict f u_ :
cvgn [sequence if (
n <= N)
%nat then f n else u_ n]_n = cvgn u_.
Proof.
Lemma cvg_centern u_ l :
(
[sequence u_ (
n - N)
%N]_n @ \oo --> l)
= (
u_ @ \oo --> l).
Proof.
Lemma cvg_shiftn u_ l :
(
[sequence u_ (
n + N)
%N]_n @ \oo --> l)
= (
u_ @ \oo --> l).
Proof.
End NatShift.
Variables (
V : topologicalType).
Lemma cvg_shiftS u_ (
l : V)
:
(
[sequence u_ n.
+1]_n @ \oo --> l)
= (
u_ @ \oo --> l).
Proof.
End sequences_patched.
Section sequences_R_lemmas_realFieldType.
Variable R : realFieldType.
Implicit Types u v : R ^nat.
Lemma __deprecated__squeeze T (
f g h : T -> R) (
a : filter_on T)
:
(
\forall x \near a, f x <= g x <= h x)
-> forall (
l : R)
,
f @ a --> l -> h @ a --> l -> g @ a --> l.
Proof.
#[deprecated(
since="mathcomp-analysis 0.6.0",
note="renamed to `squeeze_cvgr`")
]
Notation squeeze := __deprecated__squeeze (
only parsing).
Lemma __deprecated__cvgPpinfty (
u_ : R ^nat)
:
u_ @ \oo --> +oo <-> forall A, \forall n \near \oo, A <= u_ n.
Proof.
#[deprecated(
since="mathcomp-analysis 0.6.0",
note="renamed to `cvgryPge`, and generalized to any filter")
]
Notation cvgPpinfty := __deprecated__cvgPpinfty (
only parsing).
Lemma __deprecated__cvgNpinfty u_ : (
- u_ @ \oo --> +oo)
= (
u_ @ \oo --> -oo).
Proof.
exact/propeqP/cvgNry. Qed.
#[deprecated(
since="mathcomp-analysis 0.6.0",
note="use `cvgNry` instead")
]
Notation cvgNpinfty := __deprecated__cvgNpinfty (
only parsing).
Lemma __deprecated__cvgNninfty u_ : (
- u_ @ \oo --> -oo)
= (
u_ @ \oo --> +oo).
Proof.
exact/propeqP/cvgNrNy. Qed.
#[deprecated(
since="mathcomp-analysis 0.6.0",
note="use `cvgNrNy` instead")
]
Notation cvgNninfty := __deprecated__cvgNninfty (
only parsing).
Lemma __deprecated__cvgPninfty (
u_ : R ^nat)
:
u_ @ \oo --> -oo <-> forall A, \forall n \near \oo, A >= u_ n.
Proof.
#[deprecated(
since="mathcomp-analysis 0.6.0",
note="renamed to `cvgrNyPle`, and generalized to any filter")
]
Notation cvgPninfty := __deprecated__cvgPninfty (
only parsing).
Lemma __deprecated__ger_cvg_pinfty u_ v_ : (
\forall n \near \oo, u_ n <= v_ n)
->
u_ @ \oo --> +oo -> v_ @ \oo --> +oo.
Proof.
#[deprecated(
since="mathcomp-analysis 0.6.0",
note="renamed to `ger_cvgy`, and generalized to any filter")
]
Notation ger_cvg_pinfty := __deprecated__ger_cvg_pinfty (
only parsing).
Lemma __deprecated__ler_cvg_ninfty v_ u_ : (
\forall n \near \oo, u_ n <= v_ n)
->
v_ @ \oo --> -oo -> u_ @ \oo --> -oo.
Proof.
#[deprecated(
since="mathcomp-analysis 0.6.0",
note="renamed to `ler_cvgNy`, and generalized to any filter")
]
Notation ler_cvg_ninfty := __deprecated__ler_cvg_ninfty (
only parsing).
Lemma __deprecated__lim_ge x u : cvg (
u @ \oo)
->
(
\forall n \near \oo, x <= u n)
-> x <= lim (
u @ \oo).
Proof.
#[deprecated(
since="mathcomp-analysis 0.6.0",
note="renamed to `limr_ge`, and generalized to any proper filter")
]
Notation lim_ge := __deprecated__lim_ge (
only parsing).
Lemma __deprecated__lim_le x u : cvg (
u @ \oo)
->
(
\forall n \near \oo, x >= u n)
-> x >= lim (
u @ \oo).
Proof.
#[deprecated(
since="mathcomp-analysis 0.6.0",
note="renamed to `limr_le`, and generalized to any proper filter")
]
Notation lim_le := __deprecated__lim_le (
only parsing).
Lemma lt_lim u (
M : R)
: nondecreasing_seq u ->
cvgn u -> M < limn u -> \forall n \near \oo, M <= u n.
Proof.
move=> ndu cu Ml; have [[n Mun]|/forallNP Mu] := pselect (
exists n, M <= u n).
near=> m; suff : u n <= u m by exact: le_trans.
by near: m; exists n.
+1 => // p q; apply/ndu/ltnW.
have {}Mu : forall x, M > u x by move=> x; rewrite ltNge; apply/negP.
have : limn u <= M by apply: limr_le => //; near=> m; apply/ltW/Mu.
by move/(
lt_le_trans Ml)
; rewrite ltxx.
Unshelve.
all: by end_near. Qed.
Lemma nonincreasing_cvgn_ge u_ : nonincreasing_seq u_ -> cvgn u_ ->
forall n, limn u_ <= u_ n.
Proof.
Lemma nondecreasing_cvgn_le u_ : nondecreasing_seq u_ -> cvgn u_ ->
forall n, u_ n <= limn u_.
Proof.
move=> iu cu n; move: (
@nonincreasing_cvgn_ge (
- u_)).
rewrite -nondecreasing_opp opprK => /(
_ iu)
; rewrite is_cvgNE => /(
_ cu n).
by rewrite limN // lerNl opprK.
Qed.
Lemma cvg_has_ub u_ : cvgn u_ -> has_ubound [set `|u_ n| | n in setT].
Proof.
move=> /cvg_seq_bounded/pinfty_ex_gt0[M M_gt0 /= uM].
by exists M; apply/ubP => x -[n _ <-{x}]; exact: uM.
Qed.
Lemma cvg_has_sup u_ : cvgn u_ -> has_sup (
u_ @` setT).
Proof.
move/cvg_has_ub; rewrite -/(
_ @` _)
-(
image_comp u_ normr setT).
by move=> /has_ub_image_norm uM; split => //; exists (
u_ 0%N)
, 0%N.
Qed.
Lemma cvg_has_inf u_ : cvgn u_ -> has_inf (
u_ @` setT).
Proof.
by move/is_cvgN/cvg_has_sup; rewrite -has_inf_supN image_comp. Qed.
Lemma __deprecated__cvgPpinfty_lt (
u_ : R ^nat)
:
u_ @ \oo --> +oo%R <-> forall A, \forall n \near \oo, (
A < u_ n)
%R.
Proof.
#[deprecated(
since="mathcomp-analysis 0.6.0",
note="renamed to `cvgryPgt`, and generalized to any proper filter")
]
Notation cvgPpinfty_lt := __deprecated__cvgPpinfty_lt (
only parsing).
Lemma __deprecated__cvgPninfty_lt (
u_ : R ^nat)
:
u_ @ \oo --> -oo%R <-> forall A, \forall n \near \oo, (
A > u_ n)
%R.
Proof.
#[deprecated(
since="mathcomp-analysis 0.6.0",
note="renamed to `cvgrNyPlt`, and generalized to any proper filter")
]
Notation cvgPninfty_lt := __deprecated__cvgPninfty_lt (
only parsing).
Lemma __deprecated__cvgPpinfty_near (
u_ : R ^nat)
:
u_ @ \oo --> +oo%R <-> \forall A \near +oo, \forall n \near \oo, (
A <= u_ n)
%R.
Proof.
#[deprecated(
since="mathcomp-analysis 0.6.0",
note="renamed to `cvgryPgey`, and generalized to any proper filter")
]
Notation cvgPpinfty_near := __deprecated__cvgPpinfty_near (
only parsing).
Lemma __deprecated__cvgPninfty_near (
u_ : R ^nat)
:
u_ @ \oo --> -oo%R <-> \forall A \near -oo, \forall n \near \oo, (
A >= u_ n)
%R.
Proof.
#[deprecated(
since="mathcomp-analysis 0.6.0",
note="renamed to `cvgrNyPleNy`, and generalized to any proper filter")
]
Notation cvgPninfty_near := __deprecated__cvgPninfty_near (
only parsing).
Lemma __deprecated__cvgPpinfty_lt_near (
u_ : R ^nat)
:
u_ @ \oo --> +oo%R <-> \forall A \near +oo, \forall n \near \oo, (
A < u_ n)
%R.
Proof.
#[deprecated(
since="mathcomp-analysis 0.6.0",
note="renamed to `cvgryPgty`, and generalized to any proper filter")
]
Notation cvgPpinfty_lt_near := __deprecated__cvgPpinfty_lt_near (
only parsing).
Lemma __deprecated__cvgPninfty_lt_near (
u_ : R ^nat)
:
u_ @ \oo --> -oo%R <-> \forall A \near -oo, \forall n \near \oo, (
A > u_ n)
%R.
Proof.
#[deprecated(
since="mathcomp-analysis 0.6.0",
note="renamed to `cvgrNyPltNy`, and generalized to any proper filter")
]
Notation cvgPninfty_lt_near := __deprecated__cvgPninfty_lt_near (
only parsing).
End sequences_R_lemmas_realFieldType.
#[deprecated(
since="mathcomp-analysis 0.6.6",
note="renamed to `nonincreasing_cvgn_ge`")
]
Notation nonincreasing_cvg_ge := nonincreasing_cvgn_ge (
only parsing).
#[deprecated(
since="mathcomp-analysis 0.6.6",
note="renamed to `nondecreasing_cvgn_le`")
]
Notation nondecreasing_cvg_le := nondecreasing_cvgn_le (
only parsing).
Lemma __deprecated__invr_cvg0 (
R : realFieldType) (
u : R^nat)
:
(
forall i, 0 < u i)
-> ((
u i)
^-1 @[i --> \oo] --> 0)
<-> (
u @ \oo --> +oo).
Proof.
#[deprecated(
since="mathcomp-analysis 0.6.0",
note="renamed to `gtr0_cvgV0` and generalized")
]
Notation invr_cvg0 := __deprecated__invr_cvg0 (
only parsing).
Lemma __deprecated__invr_cvg_pinfty (
R : realFieldType) (
u : R^nat)
:
(
forall i, 0 < u i)
-> ((
u i)
^-1 @[i --> \oo] --> +oo)
<-> (
u @ \oo--> 0).
Proof.
#[deprecated(
since="mathcomp-analysis 0.6.0",
note="renamed to `cvgrVy` and generalized")
]
Notation invr_cvg_pinfty := __deprecated__invr_cvg_pinfty (
only parsing).
Section partial_sum.
Variables (
V : zmodType) (
u_ : V ^nat).
Definition series : V ^nat := [sequence \sum_(
0 <= k < n)
u_ k]_n.
Definition telescope : V ^nat := [sequence u_ n.
+1 - u_ n]_n.
Lemma seriesEnat : series = [sequence \sum_(
0 <= k < n)
u_ k]_n.
Proof.
by []. Qed.
Lemma seriesEord : series = [sequence \sum_(
k < n)
u_ k]_n.
Proof.
Lemma seriesSr n : series n.
+1 = series n + u_ n.
Proof.
Lemma seriesS n : series n.
+1 = u_ n + series n.
Proof.
Lemma seriesSB (
n : nat)
: series n.
+1 - series n = u_ n.
Proof.
Lemma series_addn m n : series (
n + m)
%N = series m + \sum_(
m <= k < n + m)
u_ k.
Proof.
Lemma sub_series_geq m n : (
m <= n)
%N ->
series n - series m = \sum_(
m <= k < n)
u_ k.
Proof.
Lemma sub_series m n :
series n - series m = if (
m <= n)
%N then \sum_(
m <= k < n)
u_ k
else - \sum_(
n <= k < m)
u_ k.
Proof.
by have [mn|/ltnW mn] := leqP m n; rewrite -sub_series_geq// opprB. Qed.
Lemma sub_double_series n : series n.
*2 - series n = \sum_(
n <= k < n.
*2)
u_ k.
Proof.
End partial_sum.
Arguments series {V} u_ n : simpl never.
Arguments telescope {V} u_ n : simpl never.
Notation "[ 'series' E ]_ n" := (
series [sequence E]_n)
: ring_scope.
Lemma seriesN (
V : zmodType) (
f : V ^nat)
: series (
- f)
= - series f.
Proof.
Lemma seriesD (
V : zmodType) (
f g : V ^nat)
: series (
f + g)
= series f + series g.
Proof.
Lemma seriesZ (
R : ringType) (
V : lmodType R) (
f : V ^nat)
k :
series (
k *: f)
= k *: series f.
Proof.
by rewrite funeqE => n; rewrite /series /= -scaler_sumr. Qed.
Section partial_sum_numFieldType.
Variables V : numFieldType.
Implicit Types f g : V ^nat.
Lemma is_cvg_seriesN f : cvgn (
series (
- f))
= cvgn (
series f).
Proof.
Lemma lim_seriesN f : cvg (
series f @ \oo)
->
limn (
series (
- f))
= - limn (
series f).
Proof.
Lemma is_cvg_seriesZ f k : cvgn (
series f)
-> cvgn (
series (
k *: f)).
Proof.
Lemma lim_seriesZ f k : cvgn (
series f)
->
limn (
series (
k *: f))
= k *: limn (
series f).
Proof.
Lemma is_cvg_seriesD f g :
cvgn (
series f)
-> cvgn (
series g)
-> cvgn (
series (
f + g)).
Proof.
Lemma lim_seriesD f g : cvgn (
series f)
-> cvgn (
series g)
->
limn (
series (
f + g))
= limn (
series f)
+ limn (
series g).
Proof.
Lemma is_cvg_seriesB f g :
cvgn (
series f)
-> cvgn (
series g)
-> cvgn (
series (
f - g)).
Proof.
Lemma lim_seriesB f g : cvg (
series f @ \oo)
-> cvg (
series g @ \oo)
->
limn (
series (
f - g))
= limn (
series f)
- limn (
series g).
Proof.
End partial_sum_numFieldType.
Lemma lim_series_le (
V : realFieldType) (
f g : V ^nat)
:
cvgn (
series f)
-> cvgn (
series g)
-> (
forall n, f n <= g n)
->
limn (
series f)
<= limn (
series g).
Proof.
by move=> cf cg fg; apply: (
ler_lim cf cg)
; near=> x; rewrite ler_sum.
Unshelve.
all: by end_near. Qed.
Lemma telescopeK (
V : zmodType) (
u_ : V ^nat)
:
series (
telescope u_)
= [sequence u_ n - u_ 0%N]_n.
Proof.
Lemma seriesK (
V : zmodType)
: cancel (
@series V)
telescope.
Proof.
move=> ?; exact/funext/seriesSB. Qed.
Lemma eq_sum_telescope (
V : zmodType) (
u_ : V ^nat)
n :
u_ n = u_ 0%N + series (
telescope u_)
n.
Proof.
Section series_patched.
Variables (
N : nat) (
K : numFieldType) (
V : normedModType K).
Implicit Types (
f : nat -> V) (
u : V ^nat) (
l : V).
Lemma is_cvg_series_restrict u_ :
cvgn [sequence \sum_(
N <= k < n)
u_ k]_n = cvgn (
series u_).
Proof.
End series_patched.
Section sequences_R_lemmas.
Variable R : realType.
Lemma nondecreasing_cvgn (
u_ : R ^nat)
:
nondecreasing_seq u_ -> has_ubound (
range u_)
->
u_ @ \oo --> sup (
range u_).
Proof.
move=> leu u_ub; set M := sup (
range u_).
have su_ : has_sup (
range u_)
by split => //; exists (
u_ 0%N)
, 0%N.
apply/cvgrPdist_le => _/posnumP[e].
have [p Mu_p] : exists p, M - e%:num <= u_ p.
have [_ -[p _] <- /ltW Mu_p] := sup_adherent (
gt0 e)
su_.
by exists p; rewrite Mu_p.
near=> n; have pn : (
p <= n)
%N by near: n; exact: nbhs_infty_ge.
rewrite ler_distlC (
le_trans Mu_p (
leu _ _ _))
//= (
@le_trans _ _ M)
?lerDl//.
by have /ubP := sup_upper_bound su_; apply; exists n.
Unshelve.
all: by end_near. Qed.
Lemma nondecreasing_is_cvgn (
u_ : R ^nat)
:
nondecreasing_seq u_ -> has_ubound (
range u_)
-> cvgn u_.
Proof.
Lemma nondecreasing_dvgn_lt (
u_ : R ^nat)
:
nondecreasing_seq u_ -> ~ cvgn u_ -> u_ @ \oo --> +oo.
Proof.
move=> nu du; apply: contrapT => /cvgryPge/existsNP[l lu]; apply: du.
apply: nondecreasing_is_cvgn => //; exists l => _ [n _ <-].
rewrite leNgt; apply/negP => lun; apply: lu; near=> m.
by rewrite (
le_trans (
ltW lun))
//; apply: nu; near: m; exists n.
Unshelve.
all: by end_near. Qed.
Lemma near_nondecreasing_is_cvgn (
u_ : R ^nat) (
M : R)
:
{near \oo, nondecreasing_seq u_} -> (
\forall n \near \oo, u_ n <= M)
->
cvgn u_.
Proof.
Lemma nonincreasing_cvgn (
u_ : R ^nat)
:
nonincreasing_seq u_ -> has_lbound (
range u_)
->
u_ @ \oo --> inf (
u_ @` setT).
Proof.
Lemma nonincreasing_is_cvgn (
u_ : R ^nat)
:
nonincreasing_seq u_ -> has_lbound (
range u_)
-> cvgn u_.
Proof.
Lemma near_nonincreasing_is_cvgn (
u_ : R ^nat) (
m : R)
:
{near \oo, nonincreasing_seq u_} -> (
\forall n \near \oo, m <= u_ n)
->
cvgn u_.
Proof.
Lemma adjacent (
u_ v_ : R ^nat)
: nondecreasing_seq u_ -> nonincreasing_seq v_ ->
v_ - u_ @ \oo --> (
0 : R)
->
[/\ limn v_ = limn u_, cvgn u_ & cvgn v_].
Proof.
End sequences_R_lemmas.
#[deprecated(
since="mathcomp-analysis 0.6.6",
note="renamed to `nonincreasing_cvgn`")
]
Notation nonincreasing_cvg := nonincreasing_cvgn (
only parsing).
#[deprecated(
since="mathcomp-analysis 0.6.6",
note="renamed to `nondecreasing_cvgn`")
]
Notation nondecreasing_cvg := nondecreasing_cvgn (
only parsing).
#[deprecated(
since="mathcomp-analysis 0.6.6",
note="renamed to `nonincreasing_is_cvgn`")
]
Notation nonincreasing_is_cvg := nonincreasing_is_cvgn (
only parsing).
#[deprecated(
since="mathcomp-analysis 0.6.6",
note="renamed to `nondecreasing_is_cvgn`")
]
Notation nondecreasing_is_cvg := nondecreasing_is_cvgn (
only parsing).
#[deprecated(
since="mathcomp-analysis 0.6.6",
note="renamed to `nondecreasing_dvgn_lt`")
]
Notation nondecreasing_dvg_lt := nondecreasing_dvgn_lt (
only parsing).
#[deprecated(
since="mathcomp-analysis 0.6.6",
note="renamed to `near_nondecreasing_is_cvgn`")
]
Notation near_nondecreasing_is_cvg := near_nondecreasing_is_cvgn (
only parsing).
#[deprecated(
since="mathcomp-analysis 0.6.6",
note="renamed to `near_nonincreasing_is_cvgn`")
]
Notation near_nonincreasing_is_cvg := near_nonincreasing_is_cvgn (
only parsing).
Definition harmonic {R : fieldType} : R ^nat := [sequence n.
+1%:R^-1]_n.
Arguments harmonic {R} n /.
Lemma harmonic_gt0 {R : numFieldType} i : 0 < harmonic i :> R.
Proof.
by rewrite /=. Qed.
Lemma harmonic_ge0 {R : numFieldType} i : 0 <= harmonic i :> R.
Proof.
exact/ltW/harmonic_gt0. Qed.
Lemma cvg_harmonic {R : archiFieldType} : @harmonic R @ \oo --> 0.
Proof.
Lemma cvge_harmonic {R : archiFieldType} : (
EFin \o @harmonic R)
@ \oo --> 0%E.
Proof.
Lemma dvg_harmonic (
R : numFieldType)
: ~ cvgn (
series (
@harmonic R)).
Proof.
Definition arithmetic_mean (
R : numDomainType) (
u_ : R ^nat)
: R ^nat :=
[sequence n.
+1%:R^-1 * (
series u_ n.
+1)
]_n.
Definition harmonic_mean (
R : numDomainType) (
u_ : R ^nat)
: R ^nat :=
let v := [sequence (
u_ n)
^-1]_n in
[sequence (
n.
+1%:R / series v n.
+1)
]_n.
Definition root_mean_square (
R : realType) (
u_ : R ^nat)
: R ^nat :=
let v_ := [sequence (
u_ k)
^+2]_k in
[sequence Num.sqrt (
n.
+1%:R^-1 * series v_ n.
+1)
]_n.
Section cesaro.
Variable R : archiFieldType.
Theorem cesaro (
u_ : R ^nat) (
l : R)
: u_ @ \oo --> l ->
arithmetic_mean u_ @ \oo --> l.
Proof.
End cesaro.
Section cesaro_converse.
Variable R : archiFieldType.
Let cesaro_converse_off_by_one (
u_ : R ^nat)
:
[sequence n.
+1%:R^-1 * series u_ n.
+1]_n @ \oo --> (
0 : R)
->
[sequence n.
+1%:R^-1 * series u_ n]_n @ \oo --> (
0 : R).
Proof.
Lemma cesaro_converse (
u_ : R ^nat) (
l : R)
:
telescope u_ =o_\oo @harmonic R ->
arithmetic_mean u_ @ \oo --> l -> u_ @ \oo --> l.
Proof.
End cesaro_converse.
Section series_convergence.
Lemma cvg_series_cvg_0 (
K : numFieldType) (
V : normedModType K) (
u_ : V ^nat)
:
cvgn (
series u_)
-> u_ @ \oo --> (
0 : V).
Proof.
Lemma nondecreasing_series (
R : numFieldType) (
u_ : R ^nat) (
P : pred nat)
:
(
forall n, P n -> 0 <= u_ n)
%R ->
nondecreasing_seq (
fun n=> \sum_(
0 <= k < n | P k)
u_ k)
%R.
Proof.
Lemma increasing_series (
R : numFieldType) (
u_ : R ^nat)
:
(
forall n, 0 < u_ n)
-> increasing_seq (
series u_).
Proof.
move=> u_ge0; apply/increasing_seqP => n.
by rewrite !seriesEord/= big_ord_recr ltrDl.
Qed.
End series_convergence.
Definition arithmetic (
R : zmodType)
a z : R ^nat := [sequence a + z *+ n]_n.
Arguments arithmetic {R} a z n /.
Lemma mulrn_arithmetic (
R : zmodType)
: @GRing.
natmul R = arithmetic 0.
Proof.
Definition geometric (
R : fieldType)
a z : R ^nat := [sequence a * z ^+ n]_n.
Arguments geometric {R} a z n /.
Lemma exprn_geometric (
R : fieldType)
: (
@GRing.
exp R)
= geometric 1.
Proof.
Lemma cvg_arithmetic (
R : archiFieldType)
a (
z : R)
:
z > 0 -> arithmetic a z @ \oo --> +oo.
Proof.
Lemma cvg_expr (
R : archiFieldType) (
z : R)
:
`|z| < 1 -> (
GRing.exp z : R ^nat)
@ \oo --> (
0 : R).
Proof.
Lemma geometric_seriesE (
R : numFieldType) (
a z : R)
: z != 1 ->
series (
geometric a z)
= [sequence a * (
1 - z ^+ n)
/ (
1 - z)
]_n.
Proof.
Lemma cvg_geometric_series (
R : archiFieldType) (
a z : R)
: `|z| < 1 ->
series (
geometric a z)
@ \oo --> (
a * (
1 - z)
^-1).
Proof.
Lemma cvg_geometric_series_half (
R : archiFieldType) (
r : R)
n :
series (
fun k => r / (
2 ^ (
k + n.
+1))
%:R : R^o)
@ \oo --> (
r / 2 ^+ n : R^o).
Proof.
Arguments cvg_geometric_series_half {R} _ _.
Lemma geometric_partial_tail {R : fieldType} (
n m : nat) (
x : R)
:
\sum_(
m <= i < m + n)
x ^+ i = series (
geometric (
x ^+ m)
x)
n.
Proof.
Lemma cvg_geometric (
R : archiFieldType) (
a z : R)
: `|z| < 1 ->
geometric a z @ \oo --> (
0 : R).
Proof.
by move=> /cvg_geometric_series/cvgP/cvg_series_cvg_0. Qed.
Lemma is_cvg_geometric_series (
R : archiFieldType) (
a z : R)
: `|z| < 1 ->
cvgn (
series (
geometric a z)).
Proof.
by move=> /cvg_geometric_series/cvgP; apply. Qed.
Definition normed_series_of (
K : numDomainType) (
V : normedModType K)
(
u_ : V ^nat)
of phantom V^nat (
series u_)
: K ^nat :=
[series `|u_ n|]_n.
Notation "[ 'normed' s_ ]" := (
@normed_series_of _ _ _ (
Phantom _ s_))
: ring_scope.
Arguments normed_series_of {K V} u_ _ n /.
Lemma ger0_normed {K : numFieldType} (
u_ : K ^nat)
:
(
forall n, 0 <= u_ n)
-> [normed series u_] = series u_.
Proof.
Lemma cauchy_seriesP {R : numFieldType} (
V : normedModType R) (
u_ : V ^nat)
:
cauchy (
series u_ @ \oo)
<->
forall e : R, e > 0 ->
\forall n \near (
\oo, \oo)
, `|\sum_(
n.
1 <= k < n.
2)
u_ k| < e.
Proof.
rewrite -cauchy_ballP; split=> su_cv _/posnumP[e];
have {}su_cv := !! su_cv _ (
gt0 e)
;
rewrite -near2_pair -ball_normE !near_simpl/= in su_cv *.
apply: filterS su_cv => -[/= m n]; rewrite distrC sub_series.
by have [|/ltnW]:= leqP m n => mn//; rewrite (
big_geq mn)
?normr0.
have := su_cv; rewrite near_swap => su_cvC; near=> m => /=; rewrite sub_series.
by have [|/ltnW]:= leqP m.
2 m.
1 => m12; rewrite ?normrN; near: m.
Unshelve.
all: by end_near. Qed.
Lemma series_le_cvg (
R : realType) (
u_ v_ : R ^nat)
:
(
forall n, 0 <= u_ n)
-> (
forall n, 0 <= v_ n)
->
(
forall n, u_ n <= v_ n)
->
cvgn (
series v_)
-> cvgn (
series u_).
Proof.
Lemma normed_cvg {R : realType} (
V : completeNormedModType R) (
u_ : V ^nat)
:
cvgn [normed series u_] -> cvgn (
series u_).
Proof.
Lemma lim_series_norm {R : realType} (
V : completeNormedModType R) (
f : V ^nat)
:
cvgn [normed series f] ->
`|limn (
series f)
| <= limn [normed series f].
Proof.
Section series_linear.
Lemma cvg_series_bounded (
R : realFieldType) (
f : R ^nat)
:
cvgn (
series f)
-> bounded_fun f.
Proof.
by move/cvg_series_cvg_0 => f0; apply/cvg_seq_bounded/cvg_ex; exists 0.
Qed.
Lemma cvg_to_0_linear (
R : realFieldType) (
f : R -> R)
K (
k : R)
:
0 < k -> (
forall r, 0 < `| r | < k -> `|f r| <= K * `| r |)
->
f x @[x --> 0^'] --> 0.
Proof.
Lemma lim_cvg_to_0_linear (
R : realType) (
f : nat -> R) (
g : R -> nat -> R)
k :
0 < k -> cvgn (
series f)
->
(
forall r, 0 < `|r| < k -> forall n, `|g r n| <= f n * `| r |)
->
limn (
series (
g x))
@[x --> 0^'] --> 0.
Proof.
End series_linear.
Section exponential_series.
Variable R : realType.
Implicit Types x : R.
Definition exp_coeff x := [sequence x ^+ n / n`!%:R]_n.
Local Notation exp := exp_coeff.
Lemma exp_coeff_ge0 x n : 0 <= x -> 0 <= exp x n.
Proof.
Lemma series_exp_coeff0 n : series (
exp 0)
n.
+1 = 1.
Proof.
Section exponential_series_cvg.
Variable x : R.
Hypothesis x0 : 0 < x.
Let S0 N n := (
N ^ N)
%:R * \sum_(
N.
+1 <= i < n) (
x / N%:R)
^+ i.
Let is_cvg_S0 N : x < N%:R -> cvgn (
S0 N).
Proof.
Let S0_ge0 N n : 0 <= S0 N n.
Proof.
Let S0_sup N n : x < N%:R -> S0 N n <= sup (
range (
S0 N)).
Proof.
Let S1 N n := \sum_(
N.
+1 <= i < n)
exp x i.
Lemma incr_S1 N : nondecreasing_seq (
S1 N).
Proof.
Let S1_sup N : x < N%:R -> ubound (
range (
S1 N)) (
sup (
range (
S0 N))).
Proof.
Lemma is_cvg_series_exp_coeff_pos : cvgn (
series (
exp x)).
Proof.
End exponential_series_cvg.
Lemma normed_series_exp_coeff x : [normed series (
exp x)
] = series (
exp `|x|).
Proof.
Lemma is_cvg_series_exp_coeff x : cvgn (
series (
exp x)).
Proof.
Lemma cvg_exp_coeff x : exp x @ \oo --> (
0 : R).
Proof.
End exponential_series.
Definition expR {R : realType} (
x : R)
: R := limn (
series (
exp_coeff x)).
Sequences of natural numbers
Lemma __deprecated__nat_dvg_real (
R : realType) (
u_ : nat ^nat)
:
u_ @ \oo --> \oo -> (
[sequence (
u_ n)
%:R : R^o]_n @ \oo --> +oo)
%R.
Proof.
by move=> ?; apply/cvgrnyP. Qed.
#[deprecated(
since="mathcomp-analysis 0.6.0",
note="renamed to `cvgrnyP` and generalized")
]
Notation nat_dvg_real := __deprecated__nat_dvg_real (
only parsing).
Lemma __deprecated__nat_cvgPpinfty (
u : nat^nat)
:
u @ \oo --> \oo <-> forall A, \forall n \near \oo, (
A <= u n)
%N.
Proof.
#[deprecated(
since="mathcomp-analysis 0.6.0",
note="renamed to `cvgnyPge` and generalized")
]
Notation nat_cvgPpinfty:= __deprecated__nat_cvgPpinfty (
only parsing).
Lemma nat_nondecreasing_is_cvg (
u_ : nat^nat)
:
nondecreasing_seq u_ -> has_ubound (
range u_)
-> cvgn u_.
Proof.
move=> u_nd [l ul].
suff [N Nu] : exists N, forall n, (
n >= N)
%N -> u_ n = u_ N.
apply/cvg_ex; exists (
u_ N)
; rewrite -(
cvg_shiftn N).
rewrite [X in X @ \oo --> _](
_ : _ = cst (
u_ N))
//; first exact: cvg_cst.
by apply/funext => n /=; rewrite Nu// leq_addl.
apply/not_existsP => hu.
have {hu}/choice[f Hf] : forall x, (
exists n, x <= n /\ u_ n > u_ x)
%N.
move=> x; have /existsNP[N /not_implyP[xN Nx]] := hu x.
exists N; split => //; move/eqP : Nx; rewrite neq_lt => /orP[|//].
by move/u_nd : xN; rewrite le_eqVlt => /predU1P[->|//].
have uf : forall x, (
x < u_ (
iter x.
+1 f O))
%N.
elim=> /= [|i ih]; first by have := Hf O => -[_]; exact: leq_trans.
by have := Hf (
f (
iter i f O))
=> -[_]; exact: leq_trans.
have /ul : range u_ (
u_ (
iter l.
+1 f O))
by exists (
iter l.
+1 f O).
by rewrite leNgt => /negP; apply; rewrite ltEnat //=; exact: uf.
Qed.
Definition nseries (
u : nat^nat)
:= (
fun n => \sum_(
0 <= k < n)
u k)
%N.
Lemma le_nseries (
u : nat^nat)
: {homo nseries u : a b / a <= b}%N.
Proof.
Lemma cvg_nseries_near (
u : nat^nat)
: cvgn (
nseries u)
->
\forall n \near \oo, u n = 0%N.
Proof.
Lemma dvg_nseries (
u : nat^nat)
: ~ cvgn (
nseries u)
->
nseries u @ \oo --> \oo.
Proof.
Sequences of extended real numbers
Notation "\big [ op / idx ]_ ( m <= i <oo | P ) F" :=
(
limn (
fun n => (
\big[ op / idx ]_(
m <= i < n | P)
F)))
: big_scope.
Notation "\big [ op / idx ]_ ( m <= i <oo ) F" :=
(
limn (
fun n => (
\big[ op / idx ]_(
m <= i < n)
F)))
: big_scope.
Notation "\big [ op / idx ]_ ( i <oo | P ) F" :=
(
limn (
fun n => (
\big[ op / idx ]_(
i < n | P)
F)))
: big_scope.
Notation "\big [ op / idx ]_ ( i <oo ) F" :=
(
limn (
fun n => (
\big[ op / idx ]_(
i < n)
F)))
: big_scope.
Notation "\sum_ ( m <= i <oo | P ) F" :=
(
\big[+%E/0%E]_(
m <= i <oo | P%B)
F%E)
: ereal_scope.
Notation "\sum_ ( m <= i <oo ) F" :=
(
\big[+%E/0%E]_(
m <= i <oo)
F%E)
: ereal_scope.
Notation "\sum_ ( i <oo | P ) F" :=
(
\big[+%E/0%E]_(
0 <= i <oo | P%B)
F%E)
: ereal_scope.
Notation "\sum_ ( i <oo ) F" :=
(
\big[+%E/0%E]_(
0 <= i <oo)
F%E)
: ereal_scope.
Section partial_esum.
Local Open Scope ereal_scope.
Variables (
R : numDomainType) (
u_ : (
\bar R)
^nat).
Definition eseries : (
\bar R)
^nat := [sequence \sum_(
0 <= k < n)
u_ k]_n.
Definition etelescope : (
\bar R)
^nat := [sequence u_ n.
+1 - u_ n]_n.
Lemma eseriesEnat : eseries = [sequence \sum_(
0 <= k < n)
u_ k]_n.
Proof.
by []. Qed.
Lemma eseriesEord : eseries = [sequence \sum_(
k < n)
u_ k]_n.
Proof.
Lemma eseriesSr n : eseries n.
+1 = eseries n + u_ n.
Proof.
Lemma eseriesS n : eseries n.
+1 = u_ n + eseries n.
Proof.
Lemma eseriesSB (
n : nat)
:
eseries n \is a fin_num -> eseries n.
+1 - eseries n = u_ n.
Proof.
Lemma eseries_addn m n : eseries (
n + m)
%N = eseries m + \sum_(
m <= k < n + m)
u_ k.
Proof.
Lemma sub_eseries_geq m n : (
m <= n)
%N -> eseries m \is a fin_num ->
eseries n - eseries m = \sum_(
m <= k < n)
u_ k.
Proof.
Lemma sub_eseries m n : eseries m \is a fin_num -> eseries n \is a fin_num ->
eseries n - eseries m = if (
m <= n)
%N then \sum_(
m <= k < n)
u_ k
else - \sum_(
n <= k < m)
u_ k.
Proof.
Lemma sub_double_eseries n : eseries n \is a fin_num ->
eseries n.
*2 - eseries n = \sum_(
n <= k < n.
*2)
u_ k.
Proof.
End partial_esum.
Arguments eseries {R} u_ n : simpl never.
Arguments etelescope {R} u_ n : simpl never.
Notation "[ 'series' E ]_ n" := (
eseries [sequence E%E]_n)
: ereal_scope.
Section eseries_ops.
Variable (
R : numDomainType).
Local Open Scope ereal_scope.
Lemma eseriesD (
f g : (
\bar R)
^nat)
: eseries (
f \+ g)
= eseries f \+ eseries g.
Proof.
End eseries_ops.
Section sequences_ereal_realDomainType.
Local Open Scope ereal_scope.
Variable T : realDomainType.
Implicit Types u : (
\bar T)
^nat.
Lemma ereal_nondecreasing_oppn u_ :
nondecreasing_seq (
-%E \o u_)
= nonincreasing_seq u_.
Proof.
End sequences_ereal_realDomainType.
#[deprecated(
since="mathcomp-analysis 0.6.6",
note="renamed to `ereal_nondecreasing_oppn`")
]
Notation ereal_nondecreasing_opp := ereal_nondecreasing_oppn (
only parsing).
Section sequences_ereal.
Local Open Scope ereal_scope.
Lemma __deprecated__ereal_cvg_abs0 (
R : realFieldType) (
f : (
\bar R)
^nat)
:
abse \o f @ \oo --> 0 -> f @ \oo --> 0.
Proof.
by move/cvg_abse0P. Qed.
Lemma __deprecated__ereal_cvg_ge0 (
R : realFieldType) (
f : (
\bar R)
^nat) (
a : \bar R)
:
(
forall n, 0 <= f n)
-> f @ \oo --> a -> 0 <= a.
Proof.
Lemma __deprecated__ereal_lim_ge (
R : realFieldType)
x (
u_ : (
\bar R)
^nat)
:
cvgn u_ -> (
\forall n \near \oo, x <= u_ n)
-> x <= limn u_.
Proof.
Lemma __deprecated__ereal_lim_le (
R : realFieldType)
x (
u_ : (
\bar R)
^nat)
:
cvgn u_ -> (
\forall n \near \oo, u_ n <= x)
-> limn u_ <= x.
Proof.
Lemma __deprecated__dvg_ereal_cvg (
R : realFieldType) (
u_ : R ^nat)
:
u_ @ \oo --> +oo%R -> [sequence (
u_ n)
%:E]_n @ \oo --> +oo.
Proof.
Lemma __deprecated__ereal_cvg_real (
R : realFieldType) (
f : (
\bar R)
^nat)
a :
{near \oo, forall x, f x \is a fin_num} /\
(
fine \o f @ \oo --> a)
<-> f @ \oo --> a%:E.
Proof.
Lemma ereal_nondecreasing_cvgn (
R : realType) (
u_ : (
\bar R)
^nat)
:
nondecreasing_seq u_ -> u_ @ \oo --> ereal_sup (
range u_).
Proof.
Lemma ereal_nondecreasing_is_cvgn (
R : realType) (
u_ : (
\bar R)
^nat)
:
nondecreasing_seq u_ -> cvgn u_.
Proof.
Lemma ereal_nonincreasing_cvgn (
R : realType) (
u_ : (
\bar R)
^nat)
:
nonincreasing_seq u_ -> u_ @ \oo --> ereal_inf (
u_ @` setT).
Proof.
Lemma ereal_nonincreasing_is_cvgn (
R : realType) (
u_ : (
\bar R)
^nat)
:
nonincreasing_seq u_ -> cvgn u_.
Proof.
Lemma ereal_nondecreasing_series (
R : realDomainType) (
u_ : (
\bar R)
^nat)
(
P : pred nat)
: (
forall n, P n -> 0 <= u_ n)
->
nondecreasing_seq (
fun n => \sum_(
0 <= i < n | P i)
u_ i).
Proof.
Lemma congr_lim (
R : numFieldType) (
f g : nat -> \bar R)
:
f = g -> limn f = limn g.
Proof.
by move=> ->. Qed.
Lemma eseries_cond {R : numFieldType} (
f : (
\bar R)
^nat)
P N :
\sum_(
N <= i <oo | P i)
f i = \sum_(
i <oo | P i && (
N <= i)
%N)
f i.
Proof.
Lemma eseries_mkcondl {R : numFieldType} (
f : (
\bar R)
^nat)
P Q :
\sum_(
i <oo | P i && Q i)
f i = \sum_(
i <oo | Q i)
if P i then f i else 0.
Proof.
by apply/congr_lim/funext => n; rewrite big_mkcondl. Qed.
Lemma eseries_mkcondr {R : numFieldType} (
f : (
\bar R)
^nat)
P Q :
\sum_(
i <oo | P i && Q i)
f i = \sum_(
i <oo | P i)
if Q i then f i else 0.
Proof.
by apply/congr_lim/funext => n; rewrite big_mkcondr. Qed.
Lemma eq_eseriesr (
R : numFieldType) (
f g : (
\bar R)
^nat) (
P : pred nat)
{N} :
(
forall i, P i -> f i = g i)
->
\sum_(
N <= i <oo | P i)
f i = \sum_(
N <= i <oo | P i)
g i.
Proof.
by move=> efg; apply/congr_lim/funext => n; exact: eq_bigr. Qed.
Lemma eq_eseriesl (
R : realFieldType) (
P Q : pred nat) (
f : (
\bar R)
^nat)
:
P =1 Q -> \sum_(
i <oo | P i)
f i = \sum_(
i <oo | Q i)
f i.
Proof.
by move=> efg; apply/congr_lim/funext => n; apply: eq_bigl. Qed.
Arguments eq_eseriesl {R P} Q.
Section ereal_series.
Variables (
R : realFieldType) (
f : (
\bar R)
^nat).
Implicit Types P : pred nat.
Lemma ereal_series_cond k P :
\sum_(
k <= i <oo | P i)
f i = \sum_(
i <oo | (
k <= i)
%N && P i)
f i.
Proof.
Lemma ereal_series k : \sum_(
k <= i <oo)
f i = \sum_(
i <oo | (
k <= i)
%N)
f i.
Proof.
Lemma eseries0 P : (
forall i, P i -> f i = 0)
-> \sum_(
i <oo | P i)
f i = 0.
Proof.
Lemma eseries_pred0 P : P =1 xpred0 -> \sum_(
i <oo | P i)
f i = 0.
Proof.
move=> P0; rewrite (
_ : (
fun _ => _)
= fun=> 0)
?lim_cst// funeqE => n.
by rewrite big1 // => i; rewrite P0.
Qed.
End ereal_series.
Lemma nneseries_lim_ge (
R : realType) (
u_ : (
\bar R)
^nat) (
P : pred nat)
k :
(
forall n, P n -> 0 <= u_ n)
->
\sum_(
0 <= i < k | P i)
u_ i <= \sum_(
i <oo | P i)
u_ i.
Proof.
move/ereal_nondecreasing_series/ereal_nondecreasing_cvgn/cvg_lim => -> //.
by apply: ereal_sup_ub; exists k.
Qed.
Lemma eseries_pinfty (
R : realFieldType) (
u_ : (
\bar R)
^nat)
(
P : pred nat)
k : (
forall n, P n -> u_ n != -oo)
-> P k ->
u_ k = +oo -> \sum_(
i <oo | P i)
u_ i = +oo.
Proof.
move=> uNy Pk uky; apply: lim_near_cst => //; near=> n.
apply/eqP; rewrite big_mkord esum_eqy; last first.
by move=> /= i Pi; rewrite uNy.
apply/existsP.
have kn : (
k < n)
%N by near: n; exists k.
+1.
by exists (
Ordinal kn)
=> /=; rewrite uky eqxx andbT.
Unshelve.
all: by end_near. Qed.
Section cvg_eseries.
Variable (
R : realType) (
u_ : (
\bar R)
^nat).
Implicit Type P : pred nat.
Lemma is_cvg_ereal_nneg_natsum_cond m P :
(
forall n, (
m <= n)
%N -> P n -> 0 <= u_ n)
->
cvgn (
fun n => \sum_(
m <= i < n | P i)
u_ i).
Proof.
by move/lee_sum_nneg_natr/ereal_nondecreasing_cvgn => cu; apply: cvgP; exact: cu.
Qed.
Lemma is_cvg_ereal_npos_natsum_cond m P :
(
forall n, (
m <= n)
%N -> P n -> u_ n <= 0)
->
cvgn (
fun n => \sum_(
m <= i < n | P i)
u_ i).
Proof.
by move/lee_sum_npos_natr/ereal_nonincreasing_cvgn => cu; apply: cvgP; exact: cu.
Qed.
Lemma is_cvg_ereal_nneg_natsum m : (
forall n, (
m <= n)
%N -> 0 <= u_ n)
->
cvgn (
fun n => \sum_(
m <= i < n)
u_ i).
Proof.
Lemma is_cvg_ereal_npos_natsum m : (
forall n, (
m <= n)
%N -> u_ n <= 0)
->
cvgn (
fun n => \sum_(
m <= i < n)
u_ i).
Proof.
Lemma is_cvg_nneseries_cond P N : (
forall n, P n -> 0 <= u_ n)
->
cvgn (
fun n => \sum_(
N <= i < n | P i)
u_ i).
Proof.
Lemma is_cvg_npeseries_cond P N : (
forall n, P n -> u_ n <= 0)
->
cvgn (
fun n => \sum_(
N <= i < n | P i)
u_ i).
Proof.
Lemma is_cvg_nneseries P N : (
forall n, P n -> 0 <= u_ n)
->
cvgn (
fun n => \sum_(
N <= i < n | P i)
u_ i).
Proof.
Lemma is_cvg_npeseries P N : (
forall n, P n -> u_ n <= 0)
->
cvgn (
fun n => \sum_(
N <= i < n | P i)
u_ i).
Proof.
Lemma nneseries_ge0 P N : (
forall n, P n -> 0 <= u_ n)
->
0 <= \sum_(
N <= i <oo | P i)
u_ i.
Proof.
Lemma npeseries_le0 P N : (
forall n : nat, P n -> u_ n <= 0)
->
\sum_(
N <= i <oo | P i)
u_ i <= 0.
Proof.
End cvg_eseries.
Arguments is_cvg_nneseries {R}.
Arguments nneseries_ge0 {R u_ P} N.
Lemma nnseries_is_cvg {R : realType} (
u : nat -> R)
:
(
forall i, 0 <= u i)
%R -> \sum_(
k <oo) (
u k)
%:E < +oo ->
cvgn (
series u).
Proof.
Lemma nneseriesZl (
R : realType) (
f : nat -> \bar R) (
P : pred nat)
x N :
(
forall i, P i -> 0 <= f i)
->
(
\sum_(
N <= i <oo | P i) (
x%:E * f i)
= x%:E * \sum_(
N <= i <oo | P i)
f i).
Proof.
Lemma adde_def_nneseries (
R : realType) (
f g : (
\bar R)
^nat)
(
P Q : pred nat)
:
(
forall n, P n -> 0 <= f n)
-> (
forall n, Q n -> 0 <= g n)
->
(
\sum_(
i <oo | P i)
f i)
+? (
\sum_(
i <oo | Q i)
g i).
Proof.
move=> f0 g0; rewrite /adde_def !negb_and; apply/andP; split; apply/orP.
- by right; apply/eqP => Qg; have := nneseries_ge0 0 g0; rewrite Qg.
- by left; apply/eqP => Pf; have := nneseries_ge0 0 f0; rewrite Pf.
Qed.
Lemma __deprecated__ereal_cvgPpinfty (
R : realFieldType) (
u_ : (
\bar R)
^nat)
:
u_ @ \oo --> +oo <-> (
forall A, (
0 < A)
%R -> \forall n \near \oo, A%:E <= u_ n).
Proof.
by split=> [/cvgeyPge//|u_ge]; apply/cvgeyPgey; near=> x; apply: u_ge.
Unshelve. all: by end_near. Qed.
Lemma __deprecated__ereal_cvgPninfty (
R : realFieldType) (
u_ : (
\bar R)
^nat)
:
u_ @ \oo --> -oo <-> (
forall A, (
A < 0)
%R -> \forall n \near \oo, u_ n <= A%:E).
Proof.
by split=> [/cvgeNyPle//|u_ge]; apply/cvgeNyPleNy; near=> x; apply: u_ge.
Unshelve. all: by end_near. Qed.
Lemma __deprecated__ereal_squeeze (
R : realType) (
f g h : (
\bar R)
^nat)
:
(
\forall x \near \oo, f x <= g x <= h x)
-> forall (
l : \bar R)
,
f @ \oo --> l -> h @ \oo --> l -> g @ \oo --> l.
Proof.
Lemma nneseries_pinfty (
R : realType) (
u_ : (
\bar R)
^nat)
(
P : pred nat)
k : (
forall n, P n -> 0 <= u_ n)
-> P k ->
u_ k = +oo -> \sum_(
i <oo | P i)
u_ i = +oo.
Proof.
Lemma lee_nneseries (
R : realType) (
u v : (
\bar R)
^nat) (
P : pred nat)
N :
(
forall i, P i -> 0 <= u i)
->
(
forall n, P n -> u n <= v n)
->
\sum_(
N <= i <oo | P i)
u i <= \sum_(
N <= i <oo | P i)
v i.
Proof.
Lemma lee_npeseries (
R : realType) (
u v : (
\bar R)
^nat) (
P : pred nat)
:
(
forall i, P i -> u i <= 0)
-> (
forall n, P n -> v n <= u n)
->
\sum_(
i <oo | P i)
v i <= \sum_(
i <oo | P i)
u i.
Proof.
Lemma __deprecated__ereal_cvgD_pinfty_fin (
R : realFieldType) (
f g : (
\bar R)
^nat)
b :
f @ \oo --> +oo -> g @ \oo --> b%:E -> f \+ g @ \oo --> +oo.
Proof.
Lemma __deprecated__ereal_cvgD_ninfty_fin (
R : realFieldType) (
f g : (
\bar R)
^nat)
b :
f @ \oo --> -oo -> g @ \oo --> b%:E -> f \+ g @ \oo --> -oo.
Proof.
Lemma __deprecated__ereal_cvgD_pinfty_pinfty (
R : realFieldType) (
f g : (
\bar R)
^nat)
:
f @ \oo --> +oo -> g @ \oo --> +oo -> f \+ g @ \oo --> +oo.
Proof.
Lemma __deprecated__ereal_cvgD_ninfty_ninfty (
R : realFieldType) (
f g : (
\bar R)
^nat)
:
f @ \oo --> -oo -> g @ \oo --> -oo -> f \+ g @ \oo --> -oo.
Proof.
#[deprecated(
since="mathcomp-analysis 0.6.0", note="use `cvgeD` instead")
]
Notation ereal_cvgD_ninfty_ninfty := __deprecated__ereal_cvgD_ninfty_ninfty (
only parsing).
Lemma __deprecated__ereal_cvgD (
R : realFieldType) (
f g : (
\bar R)
^nat)
a b :
a +? b -> f @ \oo --> a -> g @ \oo --> b -> f \+ g @ \oo --> a + b.
Proof.
Lemma __deprecated__ereal_cvgB (
R : realFieldType) (
f g : (
\bar R)
^nat)
a b :
a +? - b -> f @ \oo --> a -> g @ \oo --> b -> f \- g @ \oo --> a - b.
Proof.
Lemma __deprecated__ereal_is_cvgD (
R : realFieldType) (
u v : (
\bar R)
^nat)
:
limn u +? limn v -> cvgn u -> cvgn v -> cvgn (
u \+ v).
Proof.
Lemma __deprecated__ereal_cvg_sub0 (
R : realFieldType) (
f : (
\bar R)
^nat) (
k : \bar R)
:
k \is a fin_num -> (
fun x => f x - k)
@ \oo --> 0 <-> f @ \oo --> k.
Proof.
Lemma __deprecated__ereal_limD (
R : realFieldType) (
f g : (
\bar R)
^nat)
:
cvgn f -> cvgn g -> limn f +? limn g ->
limn (
f \+ g)
= limn f + limn g.
Proof.
Lemma __deprecated__ereal_cvgM_gt0_pinfty (
R : realFieldType) (
f g : (
\bar R)
^nat)
b :
(
0 < b)
%R -> f @ \oo --> +oo -> g @ \oo --> b%:E -> f \* g @ \oo --> +oo.
Proof.
Lemma __deprecated__ereal_cvgM_lt0_pinfty (
R : realFieldType) (
f g : (
\bar R)
^nat)
b :
(
b < 0)
%R -> f @ \oo --> +oo -> g @ \oo --> b%:E -> f \* g @ \oo --> -oo.
Proof.
Lemma __deprecated__ereal_cvgM_gt0_ninfty (
R : realFieldType) (
f g : (
\bar R)
^nat)
b :
(
0 < b)
%R -> f @ \oo --> -oo -> g @ \oo --> b%:E -> f \* g @ \oo --> -oo.
Proof.
Lemma __deprecated__ereal_cvgM_lt0_ninfty (
R : realFieldType) (
f g : (
\bar R)
^nat)
b :
(
b < 0)
%R -> f @ \oo --> -oo -> g @ \oo --> b%:E -> f \* g @ \oo --> +oo.
Proof.
Lemma __deprecated__ereal_cvgM (
R : realType) (
f g : (
\bar R)
^nat) (
a b : \bar R)
:
a *? b -> f @ \oo --> a -> g @ \oo --> b -> f \* g @ \oo --> a * b.
Proof.
Lemma __deprecated__ereal_lim_sum (
R : realFieldType) (
I : Type) (
r : seq I)
(
f : I -> (
\bar R)
^nat) (
l : I -> \bar R) (
P : pred I)
:
(
forall k n, P k -> 0 <= f k n)
->
(
forall k, P k -> f k @ \oo --> l k)
->
(
fun n => \sum_(
k <- r | P k)
f k n)
@ \oo --> \sum_(
k <- r | P k)
l k.
Proof.
by move=> f0 ?; apply: cvg_nnesum => // ? ?; apply: nearW => ?; apply: f0.
Qed.
Let lim_shift_cst (
R : realFieldType) (
u : (
\bar R)
^nat) (
l : \bar R)
:
cvgn u -> (
forall n, 0 <= u n)
-> -oo < l ->
limn (
fun x => l + u x)
= l + limn u.
Proof.
Section nneseries_split.
Let near_eq_lim (
R : realFieldType) (
f g : nat -> \bar R)
:
cvgn g -> {near \oo, f =1 g} -> limn f = limn g.
Proof.
Lemma nneseries_split (
R : realType) (
f : nat -> \bar R)
n :
(
forall k, 0 <= f k)
->
\sum_(
k <oo)
f k = \sum_(
k < n)
f k + \sum_(
n <= k <oo)
f k.
Proof.
End nneseries_split.
Lemma nneseries_tail_cvg (
R : realType) (
f : (
\bar R)
^nat)
:
\sum_(
k <oo)
f k < +oo -> (
forall k, 0 <= f k)
->
\sum_(
N <= k <oo)
f k @[N --> \oo] --> 0.
Proof.
Lemma nneseriesD (
R : realType) (
f g : nat -> \bar R) (
P : pred nat)
:
(
forall i, P i -> 0 <= f i)
-> (
forall i, P i -> 0 <= g i)
->
\sum_(
i <oo | P i) (
f i + g i)
=
\sum_(
i <oo | P i)
f i + \sum_(
i <oo | P i)
g i.
Proof.
Lemma nneseries_sum_nat (
R : realType)
n (
f : nat -> nat -> \bar R)
:
(
forall i j, 0 <= f i j)
->
\sum_(
j <oo) (
\sum_(
0 <= i < n)
f i j)
=
\sum_(
0 <= i < n) (
\sum_(
j <oo) (
f i j)).
Proof.
Lemma nneseries_sum I (
r : seq I) (
P : {pred I})
[R : realType]
[f : I -> nat -> \bar R] : (
forall i j, P i -> 0 <= f i j)
->
\sum_(
j <oo)
\sum_(
i <- r | P i)
f i j =
\sum_(
i <- r | P i)
\sum_(
j <oo)
f i j.
Proof.
Lemma lte_lim (
R : realFieldType) (
u : (
\bar R)
^nat) (
M : R)
:
nondecreasing_seq u -> cvgn u -> M%:E < limn u ->
\forall n \near \oo, M%:E <= u n.
Proof.
move=> ndu cu Ml; have [[n Mun]|] := pselect (
exists n, M%:E <= u n).
near=> m; suff : u n <= u m by exact: le_trans.
by near: m; exists n.
+1 => // p q; apply/ndu/ltnW.
move/forallNP => Mu.
have {}Mu : forall x, M%:E > u x by move=> x; rewrite ltNge; apply/negP.
have : limn u <= M%:E by apply lime_le => //; near=> m; apply/ltW/Mu.
by move/(
lt_le_trans Ml)
; rewrite ltxx.
Unshelve.
all: by end_near. Qed.
Lemma lim_mkord (
R : realFieldType) (
P : {pred nat}) (
f : (
\bar R)
^nat)
:
limn (
fun n => \sum_(
k < n | P k)
f k)
%E = \sum_(
k <oo | P k)
f k.
Proof.
Lemma eseries_mkcond [R : realFieldType] [P : pred nat] (
f : nat -> \bar R)
:
\sum_(
i <oo | P i)
f i = \sum_(
i <oo)
if P i then f i else 0.
Proof.
by apply/congr_lim/eq_fun => n /=; apply: big_mkcond. Qed.
End sequences_ereal.
#[deprecated(
since="mathcomp-analysis 0.6.0",
note="use `cvgeyPge` or a variant instead")
]
Notation ereal_cvgPpinfty := __deprecated__ereal_cvgPpinfty (
only parsing).
#[deprecated(
since="mathcomp-analysis 0.6.0",
note="use `cvgeNyPle` or a variant instead")
]
Notation ereal_cvgPninfty := __deprecated__ereal_cvgPninfty (
only parsing).
#[deprecated(
since="mathcomp-analysis 0.6.0",
note="renamed to `squeeze_cvge` and generalized")
]
Notation ereal_squeeze := __deprecated__ereal_squeeze (
only parsing).
#[deprecated(
since="mathcomp-analysis 0.6.0", note="use `cvgeD` instead")
]
Notation ereal_cvgD_pinfty_fin := __deprecated__ereal_cvgD_pinfty_fin (
only parsing).
#[deprecated(
since="mathcomp-analysis 0.6.0", note="use `cvgeD` instead")
]
Notation ereal_cvgD_ninfty_fin := __deprecated__ereal_cvgD_ninfty_fin (
only parsing).
#[deprecated(
since="mathcomp-analysis 0.6.0", note="use `cvgeD` instead")
]
Notation ereal_cvgD_pinfty_pinfty := __deprecated__ereal_cvgD_pinfty_pinfty (
only parsing).
#[deprecated(
since="mathcomp-analysis 0.6.0",
note="renamed to `cvgeD` and generalized")
]
Notation ereal_cvgD := __deprecated__ereal_cvgD (
only parsing).
#[deprecated(
since="mathcomp-analysis 0.6.0",
note="renamed to `cvgeB` and generalized")
]
Notation ereal_cvgB := __deprecated__ereal_cvgB (
only parsing).
#[deprecated(
since="mathcomp-analysis 0.6.0",
note="renamed to `is_cvgeD` and generalized")
]
Notation ereal_is_cvgD := __deprecated__ereal_is_cvgD (
only parsing).
#[deprecated(
since="mathcomp-analysis 0.6.0",
note="renamed to `cvge_sub0` and generalized")
]
Notation ereal_cvg_sub0 := __deprecated__ereal_cvg_sub0 (
only parsing).
#[deprecated(
since="mathcomp-analysis 0.6.0",
note="renamed to `limeD` and generalized")
]
Notation ereal_limD := __deprecated__ereal_limD (
only parsing).
#[deprecated(
since="mathcomp-analysis 0.6.0", note="use `cvgeM` instead")
]
Notation ereal_cvgM_gt0_pinfty := __deprecated__ereal_cvgM_gt0_pinfty (
only parsing).
#[deprecated(
since="mathcomp-analysis 0.6.0", note="use `cvgeM` instead")
]
Notation ereal_cvgM_lt0_pinfty := __deprecated__ereal_cvgM_lt0_pinfty (
only parsing).
#[deprecated(
since="mathcomp-analysis 0.6.0", note="use `cvgeM` instead")
]
Notation ereal_cvgM_gt0_ninfty := __deprecated__ereal_cvgM_gt0_ninfty (
only parsing).
#[deprecated(
since="mathcomp-analysis 0.6.0", note="use `cvgeM` instead")
]
Notation ereal_cvgM_lt0_ninfty := __deprecated__ereal_cvgM_lt0_ninfty (
only parsing).
#[deprecated(
since="mathcomp-analysis 0.6.0",
note="renamed to `cvgeM` and generalized")
]
Notation ereal_cvgM := __deprecated__ereal_cvgM (
only parsing).
#[deprecated(
since="mathcomp-analysis 0.6.0",
note="renamed to `cvg_nnesum` and generalized")
]
Notation ereal_lim_sum := __deprecated__ereal_lim_sum (
only parsing).
#[deprecated(
since="mathcomp-analysis 0.6.0",
note="renamed to `cvg_abse0P` and generalized")
]
Notation ereal_cvg_abs0 := __deprecated__ereal_cvg_abs0 (
only parsing).
#[deprecated(
since="mathcomp-analysis 0.6.0", note="use `cvge_ge` instead")
]
Notation ereal_cvg_ge0 := __deprecated__ereal_cvg_ge0 (
only parsing).
#[deprecated(
since="mathcomp-analysis 0.6.0",
note="renamed to `lime_ge` and generalized")
]
Notation ereal_lim_ge := __deprecated__ereal_lim_ge (
only parsing).
#[deprecated(
since="mathcomp-analysis 0.6.0",
note="renamed to `lime_le` and generalized")
]
Notation ereal_lim_le := __deprecated__ereal_lim_le (
only parsing).
#[deprecated(
since="mathcomp-analysis 0.6.0",
note="renamed to `cvgeryP` and generalized")
]
Notation dvg_ereal_cvg := __deprecated__dvg_ereal_cvg (
only parsing).
#[deprecated(
since="mathcomp-analysis 0.6.0",
note="renamed to `fine_cvgP` and generalized")
]
Notation ereal_cvg_real := __deprecated__ereal_cvg_real (
only parsing).
#[deprecated(
since="mathcomp-analysis 0.6.6",
note="renamed to `ereal_nondecreasing_cvgn`")
]
Notation ereal_nondecreasing_cvg := ereal_nondecreasing_cvgn (
only parsing).
#[deprecated(
since="mathcomp-analysis 0.6.6",
note="renamed to `ereal_nondecreasing_is_cvgn`")
]
Notation ereal_nondecreasing_is_cvg := ereal_nondecreasing_is_cvgn (
only parsing).
#[deprecated(
since="mathcomp-analysis 0.6.6",
note="renamed to `ereal_nonincreasing_cvgn`")
]
Notation ereal_nonincreasing_cvg := ereal_nonincreasing_cvgn (
only parsing).
#[deprecated(
since="mathcomp-analysis 0.6.6",
note="renamed to `ereal_nonincreasing_is_cvgn`")
]
Notation ereal_nonincreasing_is_cvg := ereal_nonincreasing_is_cvgn (
only parsing).
#[deprecated(
since="analysis 0.6.0", note="Use eseries0 instead.")
]
Notation nneseries0 := eseries0 (
only parsing).
#[deprecated(
since="analysis 0.6.0", note="Use eq_eseriesr instead.")
]
Notation eq_nneseries := eq_eseriesr (
only parsing).
#[deprecated(
since="analysis 0.6.0", note="Use eseries_pred0 instead.")
]
Notation nneseries_pred0 := eseries_pred0 (
only parsing).
#[deprecated(
since="analysis 0.6.0", note="Use eseries_mkcond instead.")
]
Notation nneseries_mkcond := eseries_mkcond (
only parsing).
Section minr_cvg_0.
Local Open Scope ring_scope.
Context {R : realFieldType}.
Implicit Types (
u : R^nat) (
r : R).
Lemma minr_cvg_0_cvg_0 u r : 0 < r -> (
forall k, 0 <= u k)
->
minr (
u n)
r @[n --> \oo] --> 0 -> u n @[n --> \oo] --> 0.
Proof.
move=> r0 u0 minr_cvg; apply/cvgrPdist_lt => _ /posnumP[e].
have : 0 < minr e%:num r by rewrite lt_minr// r0 andbT.
move/cvgrPdist_lt : minr_cvg => /[apply] -[M _ hM].
near=> n; rewrite sub0r normrN.
have /hM : (
M <= n)
%N by near: n; exists M.
rewrite sub0r normrN (
ger0_norm (
u0 n))
ger0_norm// => [/lt_min_lt//|].
by rewrite le_minr u0 ltW.
Unshelve.
all: by end_near. Qed.
Lemma maxr_cvg_0_cvg_0 u r : r < 0 -> (
forall k, u k <= 0)
->
maxr (
u n)
r @[n --> \oo] --> 0 -> u n @[n --> \oo] --> 0.
Proof.
End minr_cvg_0.
Section mine_cvg_0.
Context {R : realFieldType}.
Local Open Scope ereal_scope.
Implicit Types (
u : (
\bar R)
^nat) (
r : R) (
x : \bar R).
Lemma mine_cvg_0_cvg_fin_num u x : 0 < x -> (
forall k, 0 <= u k)
->
mine (
u n)
x @[n --> \oo] --> 0 ->
\forall n \near \oo, u n \is a fin_num.
Proof.
case: x => [r r0 u0 /fine_cvgP[_]|_ u0|//]; last first.
under eq_cvg do rewrite miney.
by case/fine_cvgP.
move=> /cvgrPdist_lt/(
_ _ r0)
[N _ hN].
near=> n; have /hN : (
N <= n)
%N by near: n; exists N.
rewrite sub0r normrN /= ger0_norm ?fine_ge0//; last first.
by rewrite le_minr u0 ltW.
by have := u0 n; case: (
u n)
=> //=; rewrite ltxx.
Unshelve.
all: by end_near. Qed.
Lemma mine_cvg_minr_cvg u r : (
0 < r)
%R -> (
forall k, 0 <= u k)
->
mine (
u n)
r%:E @[n --> \oo] --> 0 ->
minr (
fine (
u n))
r @[n --> \oo] --> 0%R.
Proof.
move=> r0 u0 mine_cvg; apply: (
cvg_trans _ (
fine_cvg mine_cvg)).
move/fine_cvgP : mine_cvg => [_ /=] /cvgrPdist_lt.
move=> /(
_ _ r0)
[N _ hN]; apply: near_eq_cvg; near=> n.
have xnoo : u n < +oo.
rewrite ltNge leye_eq; apply/eqP => xnoo.
have /hN : (
N <= n)
%N by near: n; exists N.
by rewrite /= sub0r normrN xnoo //= gtr0_norm // ltxx.
by rewrite /= -(
@fineK _ (
u n))
?ge0_fin_numE//= -fine_min.
Unshelve.
all: by end_near. Qed.
Lemma mine_cvg_0_cvg_0 u x : 0 < x -> (
forall k, 0 <= u k)
->
mine (
u n)
x @[n --> \oo] --> 0 -> u n @[n --> \oo] --> 0.
Proof.
Lemma maxe_cvg_0_cvg_fin_num u x : x < 0 -> (
forall k, u k <= 0)
->
maxe (
u n)
x @[n --> \oo] --> 0 ->
\forall n \near \oo, u n \is a fin_num.
Proof.
rewrite -[in x < _]oppe0 lte_oppr => x0 u0.
under eq_fun do rewrite -(
oppeK (
u _))
-[in maxe _ _](
oppeK x)
-oppe_min.
rewrite -[in _ --> _]oppe0 => /cvgeNP/mine_cvg_0_cvg_fin_num-/(
_ x0).
have Nu0 k : 0 <= - u k by rewrite lee_oppr oppe0.
by move=> /(
_ Nu0)
[n _ nu]; exists n => // m/= nm; rewrite -fin_numN nu.
Qed.
Lemma maxe_cvg_maxr_cvg u r : (
r < 0)
%R -> (
forall k, u k <= 0)
->
maxe (
u n)
r%:E @[n --> \oo] --> 0 ->
maxr (
fine (
u n))
r @[n --> \oo] --> 0%R.
Proof.
Lemma maxe_cvg_0_cvg_0 u x : x < 0 -> (
forall k, u k <= 0)
->
maxe (
u n)
x @[n --> \oo] --> 0 -> u n @[n --> \oo] --> 0.
Proof.
rewrite -[in x < _]oppe0 lte_oppr => x0 u0.
under eq_fun do rewrite -(
oppeK (
u _))
-[in maxe _ _](
oppeK x)
-oppe_min.
rewrite -[in _ --> _]oppe0 => /cvgeNP/mine_cvg_0_cvg_0-/(
_ x0).
have Nu0 k : 0 <= - u k by rewrite lee_oppr oppe0.
by move=> /(
_ Nu0)
; rewrite -[in _ --> _]oppe0 => /cvgeNP.
Qed.
End mine_cvg_0.
Definition sdrop T (
u : T^nat)
n := [set u k | k in [set k | k >= n]]%N.
Section sdrop.
Variables (
d : unit) (
R : porderType d).
Implicit Types (
u : R^o^nat).
Lemma has_lbound_sdrop u : has_lbound (
range u)
->
forall m, has_lbound (
sdrop u m).
Proof.
by move=> [M uM] n; exists M => _ [m /= nm] <-; rewrite uM //; exists m.
Qed.
Lemma has_ubound_sdrop u : has_ubound (
range u)
->
forall m, has_ubound (
sdrop u m).
Proof.
by move=> [M uM] n; exists M => _ [m /= nm] <-; rewrite uM //; exists m.
Qed.
End sdrop.
Section sups_infs.
Variable R : realType.
Implicit Types (
r : R) (
u : R^o^nat).
Definition sups u := [sequence sup (
sdrop u n)
]_n.
Definition infs u := [sequence inf (
sdrop u n)
]_n.
Lemma supsN u : sups (
-%R \o u)
= - infs u.
Proof.
rewrite funeqE => n; rewrite /sups /infs /inf /= opprK; congr (
sup _).
by rewrite predeqE => x; split => [[m /= nm <-]|[_ [m /= nm] <-] <-];
[exists (
u m)
=> //; exists m | exists m].
Qed.
Lemma infsN u : infs (
-%R \o u)
= - sups u.
Proof.
apply/eqP; rewrite -eqr_oppLR -supsN; apply/eqP; congr (
sups _).
by rewrite funeqE => ? /=; rewrite opprK.
Qed.
Lemma nonincreasing_sups u : has_ubound (
range u)
->
nonincreasing_seq (
sups u).
Proof.
move=> u_ub m n mn; apply: le_sup => [_ /= [p np] <-| |].
- by apply/downP; exists (
u p)
=> //=; exists p => //; exact: leq_trans np.
- by exists (
u n)
=> /=; exists n => /=.
- by split; [exists (
u m)
; exists m => //=|exact/has_ubound_sdrop].
Qed.
Lemma nondecreasing_infs u : has_lbound (
range u)
->
nondecreasing_seq (
infs u).
Proof.
move=> u_lb; rewrite -nonincreasing_opp -supsN; apply/nonincreasing_sups.
by move: u_lb => /has_lb_ubN; rewrite /comp /= image_comp.
Qed.
Lemma is_cvg_sups u : cvgn u -> cvgn (
sups u).
Proof.
move=> cf; have [M [Mreal Mu]] := cvg_seq_bounded cf.
apply: nonincreasing_is_cvgn.
exact/nonincreasing_sups/bounded_fun_has_ubound/cvg_seq_bounded.
exists (
- (
M + 1))
=> _ [n _ <-]; rewrite (
@le_trans _ _ (
u n))
//.
by apply/lerNnormlW/Mu => //; rewrite ltrDl.
apply: sup_ub; last by exists n => /=.
exact/has_ubound_sdrop/bounded_fun_has_ubound/cvg_seq_bounded.
Qed.
Lemma is_cvg_infs u : cvgn u -> cvgn (
infs u).
Proof.
by move/is_cvgN/is_cvg_sups; rewrite supsN; move/is_cvgN; rewrite opprK.
Qed.
Lemma infs_le_sups u n : cvgn u -> infs u n <= sups u n.
Proof.
move=> cu; rewrite /infs /sups /=; set A := sdrop _ _.
have [a Aa] : A !=set0 by exists (
u n)
; rewrite /A /=; exists n => //=.
rewrite (
@le_trans _ _ a)
//; [apply/inf_lb|apply/sup_ub] => //.
- exact/has_lbound_sdrop/bounded_fun_has_lbound/cvg_seq_bounded.
- exact/has_ubound_sdrop/bounded_fun_has_ubound/cvg_seq_bounded.
Qed.
Lemma cvg_sups_inf u : has_ubound (
range u)
-> has_lbound (
range u)
->
sups u @ \oo --> inf (
range (
sups u)).
Proof.
move=> u_ub u_lb; apply: nonincreasing_cvgn; first exact: nonincreasing_sups.
case: u_lb => M uM; exists M => _ [n _ <-].
rewrite (
@le_trans _ _ (
u n))
//; first by apply: uM; exists n.
by apply: sup_ub; [exact/has_ubound_sdrop|exists n => /=].
Qed.
Lemma cvg_infs_sup u : has_ubound (
range u)
-> has_lbound (
range u)
->
infs u @ \oo --> sup (
range (
infs u)).
Proof.
Lemma sups_preimage T (
D : set T)
r (
f : (
T -> R)
^nat)
n :
(
forall t, D t -> has_ubound (
range (
f ^~ t)))
->
D `&` (
fun x => sups (
f ^~x)
n)
@^-1` `]r, +oo[%classic =
D `&` \bigcup_(
k in [set k | n <= k]%N)
f k @^-1` `]r, +oo[.
Proof.
move=> f_ub; rewrite predeqE => t; split.
- have [|/set0P h] := eqVneq (
sdrop (
f ^~ t)
n)
set0.
by rewrite predeqE => /(
_ (
f n t))
[+ _] => /forall2NP/(
_ n)
/= [].
rewrite /= in_itv /= andbT => -[Dt].
move=> /(
sup_gt h)
[_ [m /= nm <-]] rfmt.
split => //; exists m => //.
by rewrite /= in_itv /= rfmt.
- move=> [Dt [k /= nk]]; rewrite in_itv /= andbT => rfkt.
split=> //; rewrite /= in_itv /= andbT; apply: (
lt_le_trans rfkt).
by apply: sup_ub; [exact/has_ubound_sdrop/f_ub|by exists k].
Qed.
Lemma infs_preimage T (
D : set T)
r (
f : (
T -> R)
^nat)
n :
(
forall t, D t -> has_lbound (
range (
f ^~ t)))
->
D `&` (
fun x => infs (
f ^~ x)
n)
@^-1` `]-oo, r[ =
D `&` \bigcup_(
k in [set k | n <= k]%N)
f k @^-1` `]-oo, r[.
Proof.
move=> lb_f; rewrite predeqE => t; split.
- have [|/set0P h] := eqVneq (
sdrop (
f ^~ t)
n)
set0.
by rewrite predeqE => /(
_ (
f n t))
[+ _] => /forall2NP/(
_ n)
/= [].
rewrite /= in_itv /= => -[Dt].
by move=> /(
inf_lt h)
[_ [m /= nm <-]] fmtr; split => //; exists m.
- move=> [Dt [k /= nk]]; rewrite /= in_itv /= => fktr.
rewrite in_itv /=; split => //; apply: le_lt_trans fktr.
by apply/inf_lb => //; [exact/has_lbound_sdrop/lb_f|by exists k].
Qed.
Lemma bounded_fun_has_lbound_sups u :
bounded_fun u -> has_lbound (
range (
sups u)).
Proof.
move=> /[dup] ba /bounded_fun_has_lbound/has_lbound_sdrop h.
have [M hM] := h O; exists M => y [n _ <-].
rewrite (
@le_trans _ _ (
u n))
//; first by apply: hM; exists n.
apply: sup_ub; last by exists n => /=.
by move: ba => /bounded_fun_has_ubound/has_ubound_sdrop; exact.
Qed.
Lemma bounded_fun_has_ubound_infs u :
bounded_fun u -> has_ubound (
range (
infs u)).
Proof.
move=> /[dup] ba /bounded_fun_has_ubound/has_ubound_sdrop h.
have [M hM] := h O; exists M => y [n _ <-].
rewrite (
@le_trans _ _ (
u n))
//; last by apply: hM; exists n.
apply: inf_lb; last by exists n => /=.
by move: ba => /bounded_fun_has_lbound/has_lbound_sdrop; exact.
Qed.
End sups_infs.
Section limn_sup_limn_inf.
Variable R : realType.
Implicit Types (
r : R) (
u v : R^o^nat).
Definition limn_sup u := limn (
sups u).
Definition limn_inf u := limn (
infs u).
Lemma limn_infN u : cvgn u -> limn_inf (
-%R \o u)
= - limn_sup u.
Proof.
Lemma limn_supE u : bounded_fun u -> limn_sup u = inf (
range (
sups u)).
Proof.
move=> ba; apply/cvg_lim => //.
by apply/cvg_sups_inf; [exact/bounded_fun_has_ubound|
exact/bounded_fun_has_lbound].
Qed.
Lemma limn_infE u : bounded_fun u -> limn_inf u = sup (
range (
infs u)).
Proof.
move=> ba; apply/cvg_lim => //.
by apply/cvg_infs_sup; [exact/bounded_fun_has_ubound|
exact/bounded_fun_has_lbound].
Qed.
Lemma limn_inf_sup u : cvgn u -> limn_inf u <= limn_sup u.
Proof.
Lemma cvg_limn_inf_sup u l : u @ \oo --> l -> (
limn_inf u = l)
* (
limn_sup u = l).
Proof.
move=> ul.
have /cvg_seq_bounded [M [Mr Mu]] : cvg (
u @ \oo)
by apply/cvg_ex; eexists; exact: ul.
suff: limn_sup u <= l <= limn_inf u.
move=> /andP[sul liu].
have /limn_inf_sup iusu : cvg (
u @ \oo)
by apply/cvg_ex; eexists; exact: ul.
split; first by apply/eqP; rewrite eq_le liu andbT (
le_trans iusu).
by apply/eqP; rewrite eq_le sul /= (
le_trans _ iusu).
apply/andP; split.
- apply/ler_addgt0Pr => e e0.
apply: limr_le; first by apply: is_cvg_sups; apply/cvg_ex; exists l.
move/cvgrPdist_lt : (
ul)
=> /(
_ _ e0)
-[k _ klu].
near=> n; have kn : (
k <= n)
%N by near: n; exists k.
apply: sup_le_ub; first by exists (
u n)
=> /=; exists n => //=.
move=> _ /= [m nm] <-; apply/ltW/ltr_distlDr; rewrite distrC.
by apply: (
klu m)
=> /=; rewrite (
leq_trans kn).
- apply/ler_addgt0Pr => e e0; rewrite -lerBlDr.
apply: limr_ge; first by apply: is_cvg_infs; apply/cvg_ex; exists l.
move/cvgrPdist_lt : (
ul)
=> /(
_ _ e0)
-[k _ klu].
near=> n; have kn : (
k <= n)
%N by near: n; exists k.
apply: lb_le_inf; first by exists (
u n)
=> /=; exists n => //=.
move=> _ /= [m nm] <-; apply/ltW/ltr_distlBl.
by apply: (
klu m)
=> /=; rewrite (
leq_trans kn).
Unshelve.
all: by end_near. Qed.
Lemma cvg_limn_infE u : cvgn u -> limn_inf u = limn u.
Proof.
move=> /cvg_ex[l ul]; have [-> _] := cvg_limn_inf_sup ul.
by move/cvg_lim : ul => ->.
Qed.
Lemma cvg_limn_supE u : cvgn u -> limn_sup u = limn u.
Proof.
move=> /cvg_ex[l ul]; have [_ ->] := cvg_limn_inf_sup ul.
by move/cvg_lim : ul => ->.
Qed.
Lemma cvg_sups u l : u @ \oo --> l -> sups u @ \oo --> (
l : R^o).
Proof.
move=> ul; have [iul <-] := cvg_limn_inf_sup ul.
apply/cvg_closeP; split => //; apply: is_cvg_sups.
by apply/cvg_ex; eexists; apply: ul.
Qed.
Lemma cvg_infs u l : u @ \oo --> l -> infs u @ \oo --> (
l : R^o).
Proof.
move=> ul; have [<- iul] := cvg_limn_inf_sup ul.
apply/cvg_closeP; split => //; apply: is_cvg_infs.
by apply/cvg_ex; eexists; apply: ul.
Qed.
Lemma le_limn_supD u v : bounded_fun u -> bounded_fun v ->
limn_sup (
u \+ v)
<= limn_sup u + limn_sup v.
Proof.
Lemma le_limn_infD u v : bounded_fun u -> bounded_fun v ->
limn_inf u + limn_inf v <= limn_inf (
u \+ v).
Proof.
Lemma limn_supD u v : cvgn u -> cvgn v ->
limn_sup (
u \+ v)
= limn_sup u + limn_sup v.
Proof.
Lemma limn_infD u v : cvgn u -> cvgn v ->
limn_inf (
u \+ v)
= limn_inf u + limn_inf v.
Proof.
End limn_sup_limn_inf.
#[deprecated(
since="mathcomp-analysis 0.6.6", note="renamed to `limn_sup`")
]
Notation lim_sup := limn_sup (
only parsing).
#[deprecated(
since="mathcomp-analysis 0.6.6", note="renamed to `limn_inf`")
]
Notation lim_inf := limn_sup (
only parsing).
#[deprecated(
since="mathcomp-analysis 0.6.6", note="renamed to `limn_infN`")
]
Notation lim_infN := limn_infN (
only parsing).
#[deprecated(
since="mathcomp-analysis 0.6.6", note="renamed to `limn_supE`")
]
Notation lim_supE := limn_supE (
only parsing).
#[deprecated(
since="mathcomp-analysis 0.6.6", note="renamed to `limn_infE`")
]
Notation lim_infE := limn_infE (
only parsing).
#[deprecated(
since="mathcomp-analysis 0.6.6", note="renamed to `limn_inf_sup`")
]
Notation lim_inf_le_lim_sup := limn_inf_sup (
only parsing).
#[deprecated(
since="mathcomp-analysis 0.6.6", note="renamed to `cvg_limn_infE`")
]
Notation cvg_lim_infE := cvg_limn_infE (
only parsing).
#[deprecated(
since="mathcomp-analysis 0.6.6", note="renamed to `cvg_limn_supE`")
]
Notation cvg_lim_supE := cvg_limn_supE (
only parsing).
#[deprecated(
since="mathcomp-analysis 0.6.6", note="renamed to `le_limn_supD`")
]
Notation le_lim_supD := le_limn_supD (
only parsing).
#[deprecated(
since="mathcomp-analysis 0.6.6", note="renamed to `le_limn_infD`")
]
Notation le_lim_infD := le_limn_infD (
only parsing).
#[deprecated(
since="mathcomp-analysis 0.6.6", note="renamed to `limn_supD`")
]
Notation lim_supD := limn_supD (
only parsing).
#[deprecated(
since="mathcomp-analysis 0.6.6", note="renamed to `limn_infD`")
]
Notation lim_infD := limn_infD (
only parsing).
Section esups_einfs.
Variable R : realType.
Implicit Types (
u : (
\bar R)
^nat).
Local Open Scope ereal_scope.
Definition esups u := [sequence ereal_sup (
sdrop u n)
]_n.
Definition einfs u := [sequence ereal_inf (
sdrop u n)
]_n.
Lemma esupsN u : esups (
-%E \o u)
= -%E \o einfs u.
Proof.
rewrite funeqE => n; rewrite /esups /= oppeK; congr (
ereal_sup _).
by rewrite predeqE => x; split => [[m /= nm <-]|[_ [m /= nm] <-] <-];
[exists (
u m)
=> //; exists m | exists m].
Qed.
Lemma einfsN u : einfs (
-%E \o u)
= -%E \o esups u.
Proof.
Lemma nonincreasing_esups u : nonincreasing_seq (
esups u).
Proof.
Lemma nondecreasing_einfs u : nondecreasing_seq (
einfs u).
Proof.
Lemma einfs_le_esups u n : einfs u n <= esups u n.
Proof.
rewrite /einfs /=; set A := sdrop _ _; have [a Aa] : A !=set0.
by exists (
u n)
; rewrite /A /=; exists n => //=.
by rewrite (
@le_trans _ _ a)
//; [exact/ereal_inf_lb|exact/ereal_sup_ub].
Unshelve.
all: by end_near. Qed.
Lemma cvg_esups_inf u : esups u @ \oo --> ereal_inf (
range (
esups u)).
Proof.
Lemma is_cvg_esups u : cvgn (
esups u).
Proof.
by apply/cvg_ex; eexists; exact/cvg_esups_inf. Qed.
Lemma cvg_einfs_sup u : einfs u @ \oo --> ereal_sup (
range (
einfs u)).
Proof.
Lemma is_cvg_einfs u : cvgn (
einfs u).
Proof.
by apply/cvg_ex; eexists; exact/cvg_einfs_sup. Qed.
Lemma esups_preimage T (
a : \bar R) (
f : (
T -> \bar R)
^nat)
n :
(
fun x => esups (
f^~x)
n)
@^-1` `]a, +oo[ =
\bigcup_(
k in [set k | n <= k]%N)
f k @^-1` `]a, +oo[.
Proof.
rewrite predeqE => t; split => /=.
rewrite /= in_itv /= andbT=> /ereal_sup_gt[_ [/= k nk <-]] afnt.
by exists k => //=; rewrite in_itv /= afnt.
move=> -[k /= nk] /=; rewrite in_itv /= andbT => /lt_le_trans afkt.
by rewrite in_itv andbT/=; apply/afkt/ereal_sup_ub; exists k.
Qed.
Lemma einfs_preimage T (
a : \bar R) (
f : (
T -> \bar R)
^nat)
n :
(
fun x => einfs (
f^~x)
n)
@^-1` `[a, +oo[%classic =
\bigcap_(
k in [set k | n <= k]%N)
f k @^-1` `[a, +oo[%classic.
Proof.
End esups_einfs.
Section limn_esup_einf.
Context {R : realType}.
Implicit Type (
u : (
\bar R)
^nat).
Local Open Scope ereal_scope.
Definition limn_esup u := limf_esup u \oo.
Definition limn_einf u := - limn_esup (
\- u).
Lemma limn_esup_lim u : limn_esup u = limn (
esups u).
Proof.
Lemma limn_einf_lim u : limn_einf u = limn (
einfs u).
Proof.
End limn_esup_einf.
Section lim_esup_inf.
Local Open Scope ereal_scope.
Variable R : realType.
Implicit Types (
u v : (
\bar R)
^nat) (
l : \bar R).
Lemma limn_einf_shift u l : l \is a fin_num ->
limn_einf (
fun x => l + u x)
= l + limn_einf u.
Proof.
Lemma limn_esup_le_cvg u l : limn_esup u <= l -> (
forall n, l <= u n)
->
u @ \oo --> l.
Proof.
Lemma limn_einfN u : limn_einf (
-%E \o u)
= - limn_esup u.
Proof.
by rewrite /limn_esup -limf_einfN. Qed.
Lemma limn_esupN u : limn_esup (
-%E \o u)
= - limn_einf u.
Proof.
by rewrite /limn_einf oppeK. Qed.
Lemma limn_einf_sup u : limn_einf u <= limn_esup u.
Proof.
Lemma cvgNy_limn_einf_sup u : u @ \oo --> -oo ->
(
limn_einf u = -oo)
* (
limn_esup u = -oo).
Proof.
move=> uoo; suff: limn_esup u = -oo.
by move=> {}uoo; split => //; apply/eqP; rewrite -leeNy_eq -uoo limn_einf_sup.
rewrite limn_esup_lim; apply: cvg_lim => //=; apply/cvgeNyPle => M.
have /cvgeNyPle/(
_ M)
[m _ uM] := uoo.
near=> n; apply: ub_ereal_sup => _ [k /= nk <-].
by apply: uM => /=; rewrite (
leq_trans _ nk)
//; near: n; exists m.
Unshelve.
all: by end_near. Qed.
Lemma cvgNy_einfs u : u @ \oo --> -oo -> einfs u @ \oo --> -oo.
Proof.
Lemma cvgNy_esups u : u @ \oo --> -oo -> esups u @ \oo --> -oo.
Proof.
Lemma cvgy_einfs u : u @ \oo --> +oo -> einfs u @ \oo --> +oo.
Proof.
move=> /cvgeN/cvgNy_esups/cvgeN; rewrite esupsN.
by under eq_cvg do rewrite /= oppeK.
Qed.
Lemma cvgy_esups u : u @ \oo --> +oo -> esups u @ \oo --> +oo.
Proof.
move=> /cvgeN/cvgNy_einfs/cvgeN; rewrite einfsN.
by under eq_cvg do rewrite /= oppeK.
Qed.
Lemma cvg_esups u l : u @ \oo --> l -> esups u @ \oo --> l.
Proof.
case: l => [l /fine_cvgP[u_fin_num] ul| |]; last 2 first.
- exact: cvgy_esups.
- exact: cvgNy_esups.
have [p _ pu] := u_fin_num; apply/cvg_ballP => _/posnumP[e].
have : EFin \o sups (
fine \o u)
@ \oo --> l%:E.
by apply: continuous_cvg => //; apply: cvg_sups.
move=> /cvg_ballP /(
_ e%:num (
gt0 _))
[q _ qsupsu]; near=> n.
have -> : esups u n = (
EFin \o sups (
fine \o u))
n.
rewrite /= -ereal_sup_EFin; last 2 first.
- apply/has_ubound_sdrop/bounded_fun_has_ubound.
by apply/cvg_seq_bounded/cvg_ex; eexists; exact ul.
- by eexists; rewrite /sdrop /=; exists n; [|reflexivity].
congr (
ereal_sup _).
rewrite predeqE => y; split=> [[m /= nm <-{y}]|[r [m /= nm <-{r} <-{y}]]].
have /pu : (
p <= m)
%N by rewrite (
leq_trans _ nm)
//; near: n; exists p.
by move=> /fineK umE; eexists; [exists m|exact/umE].
have /pu : (
p <= m)
%N by rewrite (
leq_trans _ nm)
//; near: n; exists p.
by move=> /fineK umE; exists m => //; exact/umE.
by apply: qsupsu => /=; near: n; exists q.
Unshelve.
all: by end_near. Qed.
Lemma cvg_einfs u l : u @ \oo --> l -> einfs u @ \oo --> l.
Proof.
Lemma cvg_limn_einf_sup u l : u @ \oo --> l ->
(
limn_einf u = l)
* (
limn_esup u = l).
Proof.
move=> ul; rewrite limn_esup_lim limn_einf_lim; split.
- by apply/cvg_lim => //; exact/cvg_einfs.
- by apply/cvg_lim => //; exact/cvg_esups.
Qed.
Lemma is_cvg_limn_einfE u : cvgn u -> limn_einf u = limn u.
Proof.
move=> /cvg_ex[l ul]; have [-> _] := cvg_limn_einf_sup ul.
by move/cvg_lim : ul => ->.
Qed.
Lemma is_cvg_limn_esupE u : cvgn u -> limn_esup u = limn u.
Proof.
move=> /cvg_ex[l ul]; have [_ ->] := cvg_limn_einf_sup ul.
by move/cvg_lim : ul => ->.
Qed.
End lim_esup_inf.
#[deprecated(
since="mathcomp-analysis 0.6.6", note="renamed to `limn_einf_shift`")
]
Notation lim_einf_shift := limn_einf_shift (
only parsing).
#[deprecated(
since="mathcomp-analysis 0.6.6", note="renamed to `limn_esup_le_cvg`")
]
Notation lim_esup_le_cvg := limn_esup_le_cvg (
only parsing).
#[deprecated(
since="mathcomp-analysis 0.6.6", note="renamed to `limn_einfN`")
]
Notation lim_einfN := limn_einfN (
only parsing).
#[deprecated(
since="mathcomp-analysis 0.6.6", note="renamed to `limn_esupN`")
]
Notation lim_esupN := limn_esupN (
only parsing).
#[deprecated(
since="mathcomp-analysis 0.6.6", note="renamed to `limn_einf_sup`")
]
Notation lim_einf_sup := limn_einf_sup (
only parsing).
#[deprecated(
since="mathcomp-analysis 0.6.6", note="renamed to `cvgNy_limn_einf_sup`")
]
Notation cvgNy_lim_einf_sup := cvgNy_limn_einf_sup (
only parsing).
#[deprecated(
since="mathcomp-analysis 0.6.6", note="renamed to `cvg_limn_einf_sup`")
]
Notation cvg_lim_einf_sup := cvg_limn_einf_sup (
only parsing).
#[deprecated(
since="mathcomp-analysis 0.6.6", note="renamed to `is_cvg_limn_einfE`")
]
Notation is_cvg_lim_einfE := is_cvg_limn_einfE (
only parsing).
#[deprecated(
since="mathcomp-analysis 0.6.6", note="renamed to `is_cvg_limn_esupE`")
]
Notation is_cvg_lim_esupE := is_cvg_limn_esupE (
only parsing).
Lemma geometric_le_lim {R : realType} (
n : nat) (
a x : R)
:
0 <= a -> 0 < x -> `|x| < 1 -> series (
geometric a x)
n <= a * (
1 - x)
^-1.
Proof.
Section banach_contraction.
Context {R : realType} {X : completeNormedModType R} (
U : set X).
Variables (
f : {fun U >-> U}).
Section contractions.
Variables (
q : {nonneg R}) (
ctrf : contraction q f) (
base : X) (
Ubase : U base).
Let C := `|f base - base| / (
1 - q%:num).
Let y := fun n => iter n f base.
Let q1 := ctrf.
1.
Let ctrfq := ctrf.
2.
Let C_ge0 : 0 <= C.
Proof.
Lemma contraction_dist n m : `|y n - y (
n + m)
| <= C * q%:num ^+ n.
Proof.
Lemma contraction_cvg : cvgn y.
Proof.
Lemma contraction_cvg_fixed : closed U -> limn y = f (
limn y).
Proof.
End contractions.
Variable ctrf : is_contraction f.
Theorem banach_fixed_point : closed U -> U !=set0 -> exists2 p, U p & p = f p.
Proof.
End banach_contraction.