Module mathcomp.analysis.sequences
From HB Require Import structures.From mathcomp Require Import boot order ssralg ssrnum ssrint.
From mathcomp Require Import interval interval_inference archimedean.
#[warning="-warn-library-file-internal-analysis"]
From mathcomp Require Import unstable.
From mathcomp Require Import boolp contra classical_sets functions cardinality
set_interval reals.
From mathcomp Require Import topology ereal tvs normedtype landau.
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.
Reserved Notation "a `^ x" (at level 11).
Reserved Notation "[ 'sequence' E ]_ n"
(at level 0, n name, format "[ 'sequence' E ]_ n").
Reserved Notation "[ 'series' E ]_ n"
(at level 0, n name, format "[ 'series' E ]_ n").
Reserved Notation "[ 'normed' E ]" (format "[ 'normed' E ]").
Reserved Notation "\big [ op / idx ]_ ( m <= i <oo | P ) F"
(F at level 36,
format "'[' \big [ op / idx ]_ ( m <= i <oo | P ) F ']'").
Reserved Notation "\big [ op / idx ]_ ( m <= i <oo ) F"
(F at level 36,
format "'[' \big [ op / idx ]_ ( m <= i <oo ) '/ ' F ']'").
Reserved Notation "\big [ op / idx ]_ ( i <oo | P ) F"
(F at level 36,
format "'[' \big [ op / idx ]_ ( i <oo | P ) '/ ' F ']'").
Reserved Notation "\big [ op / idx ]_ ( i <oo ) F"
(F at level 36,
format "'[' \big [ op / idx ]_ ( i <oo ) F ']'").
Reserved Notation "\sum_ ( m <= i '<oo' | P ) F"
(F at level 41,
format "'[' \sum_ ( m <= i <oo | P ) '/ ' F ']'").
Reserved Notation "\sum_ ( m <= i '<oo' ) F"
(F at level 41,
format "'[' \sum_ ( m <= i <oo ) '/ ' F ']'").
Reserved Notation "\sum_ ( i '<oo' | P ) F"
(F at level 41,
format "'[' \sum_ ( i <oo | P ) '/ ' F ']'").
Reserved Notation "\sum_ ( i '<oo' ) F"
(F at level 41,
format "'[' \sum_ ( i <oo ) '/ ' F ']'").
Definition mk_sequence
mk_sequence : forall [R : Type], R ^nat -> R ^nat mk_sequence is not universe polymorphic Arguments mk_sequence [R]%_type_scope f / _ The reduction tactics unfold mk_sequence when applied to 2 arguments mk_sequence is transparent Expands to: Constant mathcomp.analysis.sequences.mk_sequence Declared in library mathcomp.analysis.sequences, line 156, characters 11-22
Used by
- mathcomp.analysis.numfun
Source code RSource code fSource code : sequence R := f.
Arguments mk_sequence R f /.
Notation "[ 'sequence' E ]_ n"Source code := (mk_sequence (fun nSource code => E%E)) : ereal_scope.
Notation "[ 'sequence' E ]_ n"Source code := (mk_sequence (fun nSource code => E)) : ring_scope.
Notation "R ^nat"Source code := (sequence R) : type_scope.
Notation "'nondecreasing_seq' f"Used by
- mathcomp.analysis.esum
- mathcomp.analysis.measure_theory.measure_function
- mathcomp.analysis.kernel
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_nonneg
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_monotone_convergence
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_definition
- mathcomp.analysis.lebesgue_integral_theory.counting_lebesgue
- mathcomp.analysis.lebesgue_integral_theory.radon_nikodym
- mathcomp.analysis.lebesgue_integral_theory.measurable_fun_approximation
Source code := ({homo f : nSource code mSource code / (n <= m)%nat >-> (n <= m)%O})
(at level 10).
Notation "'nonincreasing_seq' f"Used by
- mathcomp.analysis.real_measure.measurable_realfun
- mathcomp.analysis.measure_theory.measure_function
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_nonneg
Source code := ({homo f : nSource code mSource code / (n <= m)%nat >-> (n >= m)%O})
(at level 10).
Notation "'increasing_seq' f"Source code := ({mono f : nSource code mSource code / (n <= m)%nat >-> (n <= m)%O})
(at level 10).
Notation "'decreasing_seq' f"Source code := ({mono f : nSource code mSource code / (n <= m)%nat >-> (n >= m)%O})
(at level 10).
Lemma nondecreasing_oppSource code (TSource code : numDomainType) (u_Source code : T ^nat) :
nondecreasing_seq (- u_) = nonincreasing_seq u_.
Lemma nonincreasing_oppSource code (TSource code : numDomainType) (u_Source code : T ^nat) :
nonincreasing_seq (- u_) = nondecreasing_seq u_.
Lemma decreasing_oppSource code (TSource code : numDomainType) (u_Source code : T ^nat) :
decreasing_seq (- u_) = increasing_seq u_.
Lemma increasing_oppSource code (TSource code : numDomainType) (u_Source code : T ^nat) :
increasing_seq (- u_) = decreasing_seq u_.
Lemma nondecreasing_seqPUsed by
- mathcomp.analysis.ftc
- mathcomp.analysis.numfun
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_nonneg
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_monotone_convergence
- mathcomp.analysis.lebesgue_integral_theory.measurable_fun_approximation
Source code dSource code (TSource code : porderType d) (u_Source code : T ^nat) :
(forall nSource code, u_ n <= u_ n.+1)%O <-> nondecreasing_seq u_.
Lemma nonincreasing_seqPUsed by
- mathcomp.analysis.measure_theory.measure_function
Source code dSource code (TSource code : porderType d) (u_Source code : T ^nat) :
(forall nSource code, u_ n >= u_ n.+1)%O <-> nonincreasing_seq u_.
Proof.
by move=> u_nincr n; exact: u_nincr.
Qed.
Lemma increasing_seqPSource code dSource code (TSource code : porderType d) (u_Source code : T ^nat) :
(forall nSource code, u_ n < u_ n.+1)%O <-> increasing_seq u_.
Proof.
Lemma increasing_seq_injectiveSource code dSource code {TSource code : orderType d} (fSource code : T^nat) :
increasing_seq f -> injective f.
Proof.
- have : (f a < f b)%O.
rewrite (@lt_le_trans _ _ (f a.+1))//.
by move/increasing_seqP : incrf; exact.
by move: ab; rewrite incrf.
by rewrite fafb ltxx.
- have := incrf a b.
rewrite fafb lexx => /esym.
by rewrite -leEnat leNgt ba.
Qed.
Lemma decreasing_seqPSource code dSource code (TSource code : porderType d) (u_Source code : T ^nat) :
(forall nSource code, u_ n > u_ n.+1)%O <-> decreasing_seq u_.
Proof.
move=> u_noninc.
(* FIXME: add shortcut to order.v *)
apply: (@total_homo_mono _ T u_ leq ltn _ _ leqnn _ ltn_neqAle
_ (fun _ _ _ => esym (le_anti _)) leq_total
(homo_ltn (fun _ _ _ uSource code vSource code => lt_trans v u) u_noninc)) => //.
by move=> x y; rewrite eq_sym -lt_neqAle.
by move=> u_decr n; rewrite lt_neqAle eq_le !u_decr !leqnSn ltnn.
Qed.
Lemma lef_atUsed by
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_monotone_convergence
Source code (aTSource code : Type) dSource code (TSource code : porderType d) (fSource code : (aT -> T)^nat) xSource code :
nondecreasing_seq f -> {homo (f^~ x) : nSource code mSource code / (n <= m)%N >-> (n <= m)%O}.
Proof.
Lemma nondecreasing_seqDUsed by
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_nonneg
Source code TSource code (RSource code : numDomainType) (fSource code gSource code : (T -> R)^nat) :
(forall xSource code, nondecreasing_seq (f ^~ x)) ->
(forall xSource code, nondecreasing_seq (g ^~ x)) ->
(forall xSource code, nondecreasing_seq ((f \+ g) ^~ x)).
Proof.
Local Notation eqolimnSource code := (@eqolim _ _ _ eventually_filter).
Local Notation eqolimPnSource code := (@eqolimP _ _ _ eventually_filter).
Section seqDU.
Context {TSource code : Type}.
Implicit Types F : (set T)^nat.
Lemma bigsetU_seqDUUsed by
- mathcomp.analysis.measure_theory.measure_function
- mathcomp.analysis.ftc
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_nonneg
Source code FSource code nSource code :
\big[setU/set0]_(kSource code < n) F k = \big[setU/set0]_(kSource code < n) seqDU F k.
Proof.
rewrite !big_ord_recr /= predeqE => t; split=> [[Ft|Fnt]|[Ft|[Fnt Ft]]].
- by left; rewrite -ih.
- have [?|?] := pselect ((\big[setU/set0]_(iSource code < n) seqDU F i) t); first by left.
by right; split => //; rewrite ih.
- by left; rewrite ih.
- by right.
Qed.
Lemma seqDUIEUsed by
- mathcomp.analysis.measure_theory.signed_measure
Source code (SSource code : set T) (FSource code : (set T)^nat) :
seqDU (fun nSource code => S `&` F n) = (fun nSource code => S `&` F n `\` \bigcup_(iSource code < n) F i).
Proof.
move=> x [Sx [Fnx UFx]]; split=> //; apply: contra_not UFx => /=.
by rewrite bigcup_mkord -big_distrr/= => -[].
by rewrite /seqDU -setIDA bigcup_mkord -big_distrr/= setDIr setIUr setDIK set0U.
Qed.
Lemma subset_seqDUUsed by
- mathcomp.analysis.measure_theory.measure_negligible
Source code (ASource code : (set T)^nat) (iSource code : nat) : seqDU A i `<=` A i.
Proof.
End seqDU.
Arguments trivIset_seqDU {T} F.
#[global] Hint Resolve trivIset_seqDU : core.
Section seqD.
Variable TSource code : Type.
Implicit Types F : (set T) ^nat.
Lemma bigsetU_seqDSource code FSource code nSource code :
\big[setU/set0]_(iSource code < n) F i = \big[setU/set0]_(iSource code < n) seqD F i.
Proof.
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_seqDUsed by
- mathcomp.analysis.measure_theory.measure_function
Source code FSource code : nondecreasing_seq F ->
forall nSource code, F n.+1 = F n `|` seqD F n.+1.
Proof.
by move=> ?; have [?|?] := pselect (F n x); [left | right].
by move=> -[|[]//]; move: x; exact/subsetPset/ndF.
Qed.
Lemma nondecreasing_bigsetU_seqDUsed by
- mathcomp.analysis.measure_theory.measure_function
Source code FSource code nSource code : nondecreasing_seq F ->
\big[setU/set0]_(iSource code < n.+1) seqD F i = F n.
Proof.
- by rewrite big_ord_recl big_ord0 setU0.
- by move=> ?; rewrite big_ord_recl big_ord0; left.
- by rewrite big_ord_recr /= ih => -[|[]//]; move: x; exact/subsetPset/ndF.
- rewrite (setU_seqD ndF) => -[|/= [Fn1x Fnx]].
by rewrite big_ord_recr /= -ih => Fnx; left.
by rewrite big_ord_recr /=; right.
Qed.
Lemma eq_bigcup_seqD_bigsetUUsed by
- mathcomp.analysis.measure_theory.measure_extension
Source code FSource code :
\bigcup_nSource code (seqD (fun nSource code => \big[setU/set0]_(iSource code < n.+1) F i) n) = \bigcup_nSource code F n.
Proof.
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.
Lemma seqDUEUsed by
- mathcomp.analysis.ftc
Source code {RSource code : realDomainType} nSource code (rSource code : R) :
(seqDU (fun nSource code => `]r, r + n%:R]) n = `]r + n.-1%:R, r + n%:R])%classic.
Proof.
apply/nondecreasing_seqP => k; apply/subsetPset/subset_itvl.
by rewrite bnd_simp lerD2l ler_nat.
move: n => [/=|n]; first by rewrite addr0.
rewrite eqEsubset; split => x /= /[!in_itv] /=.
- by move=> [] /andP[-> ->] /[!andbT] /= /negP; rewrite -ltNge.
- move=> /andP[rnx ->].
rewrite andbT; split; first by rewrite (le_lt_trans _ rnx)// lerDl.
by apply/negP; rewrite negb_and -ltNge rnx orbT.
Qed.
Section sequences_patched.
Section NatShift.
Variables (NSource code : nat) (VSource code : ptopologicalType).
Implicit Types (f : nat -> V) (u : V ^nat) (l : set_system V).
Lemma cvg_restrictSource code fSource code u_Source code lSource code :
([sequence if (n <= N)%N then f n else u_ n]_nSource code @ \oo --> l) =
(u_ @ \oo --> l).
Proof.
by near do [move=> /=; case: ifP => //; rewrite ltn_geF//].
Unshelve. all: by end_near. Qed.
Lemma is_cvg_restrictSource code fSource code u_Source code :
cvgn [sequence if (n <= N)%nat then f n else u_ n]_nSource code = cvgn u_.
Proof.
Lemma cvg_centernSource code u_Source code lSource code :
([sequence u_ (n - N)%N]_nSource code @ \oo --> l) = (u_ @ \oo --> l).
Proof.
Lemma cvg_shiftnUsed by
- mathcomp.analysis.measure_theory.measure_extension
- mathcomp.analysis.measure_theory.counting_measure
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_under
Source code u_Source code lSource code :
([sequence u_ (n + N)%N]_nSource code @ \oo --> l) = (u_ @ \oo --> l).
Proof.
rewrite -[X in X -> _]cvg_centern; apply: cvg_trans => /=.
by apply: near_eq_cvg; near do rewrite subnK; exists N.
Unshelve. all: by end_near. Qed.
End NatShift.
Variables (VSource code : ptopologicalType).
Lemma cvg_shiftSUsed by
- mathcomp.analysis.probability_theory.random_variable
- mathcomp.analysis.measure_theory.measure_extension
- mathcomp.analysis.measure_theory.measure_function
- mathcomp.analysis.ftc
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_nonneg
- mathcomp.analysis.exp
- mathcomp.analysis_stdlib.Rstruct_topology
Source code u_Source code (lSource code : set_system V) :
([sequence u_ n.+1]_nSource code @ \oo --> l) = (u_ @ \oo --> l).
Proof.
by rewrite funeqE => n/=; rewrite addn1.
Qed.
End sequences_patched.
Section sequences_R_lemmas_realFieldType.
Variable RSource code : realFieldType.
Implicit Types u v : R ^nat.
Lemma lt_limUsed by
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_definition
Source code uSource code (MSource code : R) : nondecreasing_seq u ->
cvgn u -> M < limn u -> \forall nSource code \near \oo, M <= u n.
Proof.
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 xSource code, 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_geSource code u_Source code : nonincreasing_seq u_ -> cvgn u_ ->
forall nSource code, limn u_ <= u_ n.
Proof.
move/cvgrPdist_lt : ul => /(_ `|u_ p - limn u_|%R).
rewrite {1}ltr0_norm ?subr_lt0 // opprB subr_gt0 => /(_ up0) ul.
near \oo => N.
have /du uNp : (p <= N)%nat by near: N; rewrite nearE; exists p.
have : `|limn u_ - u_ N| >= `|u_ p - limn u_|%R.
rewrite ltr0_norm // ?subr_lt0 // opprB distrC.
rewrite (@le_trans _ _ (limn u_ - u_ N)) // ?lerB //.
rewrite (_ : `| _ | = `|u_ N - limn u_|%R) // ler0_norm // ?opprB //.
by rewrite subr_le0 (le_trans _ (ltW up0)).
rewrite leNgt => /negP; apply; by near: N.
Unshelve. all: by end_near. Qed.
Lemma nondecreasing_cvgn_leUsed by
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_monotone_convergence
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_definition
- mathcomp.analysis.lebesgue_integral_theory.measurable_fun_approximation
Source code u_Source code : nondecreasing_seq u_ -> cvgn u_ ->
forall nSource code, u_ n <= limn u_.
Proof.
rewrite -nondecreasing_opp opprK => /(_ iu); rewrite is_cvgNE => /(_ cu n).
by rewrite limN // lerNl opprK.
Qed.
Lemma cvg_has_ubSource code u_Source code : cvgn u_ -> has_ubound [set `|u_ n| | nSource code in setT].
Proof.
by exists M; apply/ubP => x -[n _ <-{x}]; exact: uM.
Qed.
Lemma cvg_has_supSource code u_Source code : cvgn u_ -> has_sup (u_ @` setT).
Proof.
by move=> /has_ub_image_norm uM; split => //; exists (u_ 0%N), 0%N.
Qed.
Lemma cvg_has_infSource code u_Source code : cvgn u_ -> has_inf (u_ @` setT).
Proof.
End sequences_R_lemmas_realFieldType.
Section partial_sum.
Variables (VSource code : zmodType) (u_Source code : V ^nat).
Definition series
series : forall {V : GRing.Zmodule.Exports.zmodType}, V ^nat -> V ^nat series is not universe polymorphic Arguments series {V} u_ n : simpl never (where some original arguments have been renamed) The reduction tactics never unfold series series is transparent Expands to: Constant mathcomp.analysis.sequences.series Declared in library mathcomp.analysis.sequences, line 456, characters 11-17
Used by
- mathcomp.analysis.probability_theory.poisson_distribution
- mathcomp.analysis.measure_theory.signed_measure
- mathcomp.analysis.elementary_functions.trigonometry_functions
- mathcomp.analysis.numfun
- mathcomp.analysis.exp
- mathcomp.analysis_stdlib.Rstruct_topology
Source code : V ^nat := [sequence \sum_(0 <= kSource code < n) u_ k]_nSource code.
Definition telescope
telescope : forall {V : GRing.Zmodule.Exports.zmodType}, V ^nat -> V ^nat telescope is not universe polymorphic Arguments telescope {V} u_ n : simpl never (where some original arguments have been renamed) The reduction tactics never unfold telescope telescope is transparent Expands to: Constant mathcomp.analysis.sequences.telescope Declared in library mathcomp.analysis.sequences, line 457, characters 11-20
Source code : V ^nat := [sequence u_ n.+1 - u_ n]_nSource code.
Lemma seriesEnatSource code : series = [sequence \sum_(0 <= kSource code < n) u_ k]_nSource code.
Proof.
Lemma seriesEordSource code : series = [sequence \sum_(kSource code < n) u_ k]_nSource code.
Lemma seriesSrSource code nSource code : series n.+1 = series n + u_ n.
Proof.
Lemma seriesSSource code nSource code : series n.+1 = u_ n + series n.
Lemma seriesSBSource code (nSource code : nat) : series n.+1 - series n = u_ n.
Lemma series_addnUsed by
- mathcomp.analysis.elementary_functions.trigonometry_functions
- mathcomp.analysis.exp
Source code mSource code nSource code : series (n + m)%N = series m + \sum_(m <= kSource code < n + m) u_ k.
Proof.
Lemma sub_series_geqSource code mSource code nSource code : (m <= n)%N ->
series n - series m = \sum_(m <= kSource code < n) u_ k.
Proof.
Lemma sub_seriesUsed by
- mathcomp.analysis.numfun
Source code mSource code nSource code :
series n - series m = if (m <= n)%N then \sum_(m <= kSource code < n) u_ k
else - \sum_(n <= kSource code < m) u_ k.
Proof.
Lemma sub_double_seriesSource code nSource code : series n.*2 - series n = \sum_(n <= kSource code < 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"Source code := (series [sequence E]_nSource code) : ring_scope.
Lemma seriesNUsed by
- mathcomp.analysis.elementary_functions.trigonometry_functions
Source code (VSource code : zmodType) (fSource code : V ^nat) : series (- f) = - series f.
Lemma seriesDSource code (VSource code : zmodType) (fSource code gSource code : V ^nat) : series (f + g) = series f + series g.
Lemma seriesZSource code (RSource code : pzRingType) (VSource code : lmodType R) (fSource code : V ^nat) kSource code :
series (k *: f) = k *: series f.
Proof.
Section partial_sum_numFieldType.
Variables VSource code : numFieldType.
Implicit Types f g : V ^nat.
Lemma is_cvg_seriesNUsed by
- mathcomp.analysis.elementary_functions.trigonometry_functions
Source code fSource code : cvgn (series (- f)) = cvgn (series f).
Lemma lim_seriesNUsed by
- mathcomp.analysis.elementary_functions.trigonometry_functions
Source code fSource code : cvg (series f @ \oo) ->
limn (series (- f)) = - limn (series f).
Lemma is_cvg_seriesZUsed by
- mathcomp.analysis.exp
Source code fSource code kSource code : cvgn (series f) -> cvgn (series (k *: f)).
Proof.
Lemma lim_seriesZSource code fSource code kSource code : cvgn (series f) ->
limn (series (k *: f)) = k *: limn (series f).
Lemma is_cvg_seriesDSource code fSource code gSource code :
cvgn (series f) -> cvgn (series g) -> cvgn (series (f + g)).
Lemma lim_seriesDSource code fSource code gSource code : cvgn (series f) -> cvgn (series g) ->
limn (series (f + g)) = limn (series f) + limn (series g).
Lemma is_cvg_seriesBUsed by
- mathcomp.analysis.exp
Source code fSource code gSource code :
cvgn (series f) -> cvgn (series g) -> cvgn (series (f - g)).
Proof.
Lemma lim_seriesBUsed by
- mathcomp.analysis.exp
Source code fSource code gSource code : 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_leUsed by
- mathcomp.analysis.numfun
Source code (VSource code : realFieldType) (fSource code gSource code : V ^nat) :
cvgn (series f) -> cvgn (series g) -> (forall nSource code, f n <= g n) ->
limn (series f) <= limn (series g).
Proof.
Lemma telescopeKSource code (VSource code : zmodType) (u_Source code : V ^nat) :
series (telescope u_) = [sequence u_ n - u_ 0%N]_nSource code.
Proof.
Lemma seriesKSource code (VSource code : zmodType) : cancel (@series V) telescope.
Lemma eq_sum_telescopeSource code (VSource code : zmodType) (u_Source code : V ^nat) nSource code :
u_ n = u_ 0%N + series (telescope u_) n.
Proof.
Section series_patched.
Context (NSource code : nat) {KSource code : numFieldType} {VSource code : normedModType K}.
Implicit Types (f : nat -> V) (u : V ^nat) (l : set_system V).
Lemma is_cvg_series_restrictSource code u_Source code :
cvgn [sequence \sum_(N <= kSource code < n) u_ k]_nSource code = cvgn (series u_).
Proof.
fun nSource code => if (n <= N)%N then \sum_(N <= kSource code < n) u_ k
else series u_ n - \sum_(0 <= kSource code < N) u_ k.
by rewrite is_cvg_restrict/= is_cvgDlE.
rewrite funeqE => n; case: leqP => // ltNn; apply: (canRL (addrK _)).
by rewrite seriesEnat addrC -big_cat_nat// ltnW.
Qed.
Lemma is_cvg_series_shiftnSource code u_Source code : cvgn (series u_) <-> cvgn [series u_ (n + N)]_nSource code.
Proof.
- rewrite -is_cvg_series_restrict => /cvg_ex[/= l +].
rewrite -(cvg_shiftn N)/= => Nnul; apply: cvgP; apply: cvg_trans Nnul.
apply: near_eq_cvg; near=> n.
rewrite /series/=.
by rewrite -{1}(add0n N) big_addn addnK.
- move=> cvgu; rewrite -is_cvg_series_restrict.
apply: cvgP; rewrite -(cvg_shiftn N)/=; apply: cvg_trans cvgu.
apply: near_eq_cvg; near=> n => /=.
by rewrite -{2}(add0n N) big_addn addnK.
Unshelve. all: by end_near. Qed.
End series_patched.
Section sequences_R_lemmas.
Context {RSource code : realType}.
Lemma nondecreasing_cvgnSource code (u_Source code : R ^nat) :
nondecreasing_seq u_ -> has_ubound (range u_) ->
u_ @ \oo --> sup (range u_).
Proof.
have su_ : has_sup (range u_) by split => //; exists (u_ 0%N), 0%N.
apply/cvgrPdist_le => _/posnumP[e].
have [p Mu_p] : exists pSource code, 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_cvgnUsed by
- mathcomp.analysis.esum
Source code (u_Source code : R ^nat) :
nondecreasing_seq u_ -> has_ubound (range u_) -> cvgn u_.
Proof.
Lemma nondecreasing_dvgn_ltUsed by
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_monotone_convergence
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_definition
- mathcomp.analysis.lebesgue_integral_theory.measurable_fun_approximation
Source code (u_Source code : R ^nat) :
nondecreasing_seq u_ -> ~ cvgn u_ -> u_ @ \oo --> +oo.
Proof.
Lemma near_nondecreasing_is_cvgnSource code (u_Source code : R ^nat) (MSource code : R) :
{near \oo, nondecreasing_seq u_} -> (\forall nSource code \near \oo, u_ n <= M) ->
cvgn u_.
Proof.
suff : cvgn [sequence u_ (n + maxn k k')%N]_nSource code.
by case/cvg_ex => /= l; rewrite cvg_shiftn => ul; apply/cvg_ex; exists l.
apply: nondecreasing_is_cvgn; [move=> /= m n mn|exists M => _ [n _ <-]].
by rewrite u_nd ?leq_add2r//= (leq_trans (leq_maxl _ _) (leq_addl _ _)).
by rewrite u_M //= (leq_trans (leq_maxr _ _) (leq_addl _ _)).
Qed.
Lemma nonincreasing_cvgnSource code (u_Source code : R ^nat) :
nonincreasing_seq u_ -> has_lbound (range u_) ->
u_ @ \oo --> inf (u_ @` setT).
Proof.
apply: cvgN; rewrite image_comp; apply: nondecreasing_cvgn => //.
by move/has_lb_ubN : u_lb; rewrite image_comp.
Qed.
Lemma nonincreasing_is_cvgnSource code (u_Source code : R ^nat) :
nonincreasing_seq u_ -> has_lbound (range u_) -> cvgn u_.
Proof.
Lemma near_nonincreasing_is_cvgnSource code (u_Source code : R ^nat) (mSource code : R) :
{near \oo, nonincreasing_seq u_} -> (\forall nSource code \near \oo, m <= u_ n) ->
cvgn u_.
Proof.
Lemma adjacent_seqSource code (u_Source code v_Source code : R ^nat) : nondecreasing_seq u_ -> nonincreasing_seq v_ ->
v_ - u_ @ \oo --> 0 ->
[/\ limn v_ = limn u_, cvgn u_ & cvgn v_].
Proof.
suff : limn w_ <= w_ n by rewrite (cvg_lim _ w0)// subr_ge0.
apply: (nonincreasing_cvgn_ge _ (cvgP _ w0)) => m p mp.
by rewrite lerB; rewrite ?iu ?dv.
have cu : cvgn u_.
apply: nondecreasing_is_cvgn => //; exists (v_ 0%N) => _ [n _ <-].
by rewrite (le_trans (vu _)) // dv.
have cv : cvgn v_.
apply: nonincreasing_is_cvgn => //; exists (u_ 0%N) => _ [n _ <-].
by rewrite (le_trans _ (vu _)) // iu.
by split=> //; apply/eqP; rewrite -subr_eq0 -limB //; exact/eqP/cvg_lim.
Qed.
End sequences_R_lemmas.
#[deprecated(since="mathcomp-analysis 1.14.0", note="renamed to `adjacent_seq`")]
Notation adjacentSource code := adjacent_seq (only parsing).
Definition harmonic
harmonic : forall {R : fieldType}, R ^nat harmonic is not universe polymorphic Arguments harmonic {R} n / (where some original arguments have been renamed) The reduction tactics unfold harmonic when applied to 2 arguments harmonic is transparent Expands to: Constant mathcomp.analysis.sequences.harmonic Declared in library mathcomp.analysis.sequences, line 677, characters 11-19
Used by
- mathcomp.analysis.exp
Source code {RSource code : fieldType} : R ^nat := [sequence n.+1%:R^-1]_nSource code.
Arguments harmonic {R} n /.
Lemma harmonic_gt0Source code {RSource code : numFieldType} iSource code : 0 < harmonic i :> R.
Proof.
Lemma harmonic_ge0Used by
- mathcomp.analysis.exp
Source code {RSource code : numFieldType} iSource code : 0 <= harmonic i :> R.
Proof.
Lemma cvg_harmonicSource code {RSource code : archiRealFieldType} : @harmonic R @ \oo --> 0.
Proof.
rewrite distrC subr0 ger0_norm//= -lef_pV2 ?qualifE//= invrK.
rewrite (le_trans (ltW (archi_boundP _)))// ler_nat -add1n -leq_subLR.
by near: i; apply: nbhs_infty_ge.
Unshelve. all: by end_near. Qed.
Lemma cvge_harmonicUsed by
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_differentiation
Source code {RSource code : archiRealFieldType} :
(EFin \o @harmonic R) @ \oo --> 0%E.
Proof.
Lemma dvg_harmonicUsed by
- mathcomp.analysis.exp
Source code (RSource code : numFieldType) : ~ cvgn (series (@harmonic R)).
Proof.
case: n => // n _.
rewrite (@le_trans _ _ (\sum_(n.+1 <= iSource code < n.+1.*2) n.+1.*2%:R^-1)) //=.
rewrite sumr_const_nat -addnn addnK addnn -mul2n natrM invfM.
by rewrite -[_ *+ n.+1]mulr_natr divfK.
by apply: ler_sum_nat => i /andP[? ?]; rewrite lef_pV2 ?qualifE/= ?ler_nat.
move/cvg_cauchy/cauchy_ballP => /(_ _ [gt0 of 2^-1 : R]); rewrite !near_map2.
rewrite -ball_normE => /nearP_dep hcvg; near \oo => n; near \oo => m.
have: `|series harmonic n - series harmonic m| < 2^-1 :> R by near: m; near: n.
rewrite le_gtF// distrC -[X in X - _](addrNK (series harmonic n.*2)).
rewrite sub_series_geq; first by near: m; apply: nbhs_infty_ge.
rewrite -addrA sub_series_geq -addnn ?leq_addr// addnn.
have sh_ge0 i j : 0 <= \sum_(i <= kSource code < j) harmonic k :> R.
by rewrite ?sumr_ge0//; move=> k _; apply: harmonic_ge0.
by rewrite ger0_norm// ler_wpDl// ge_half//; near: n.
Unshelve. all: by end_near. Qed.
Definition arithmetic_mean
arithmetic_mean : forall [R : numDomainType], R ^nat -> R ^nat arithmetic_mean is not universe polymorphic Arguments arithmetic_mean [R] u_ _ arithmetic_mean is transparent Expands to: Constant mathcomp.analysis.sequences.arithmetic_mean Declared in library mathcomp.analysis.sequences, line 717, characters 11-26
Source code (RSource code : numDomainType) (u_Source code : R ^nat) : R ^nat :=
[sequence n.+1%:R^-1 * (series u_ n.+1)]_nSource code.
Definition harmonic_mean
harmonic_mean : forall [R : numDomainType], R ^nat -> R ^nat harmonic_mean is not universe polymorphic Arguments harmonic_mean [R] u_ _ harmonic_mean is transparent Expands to: Constant mathcomp.analysis.sequences.harmonic_mean Declared in library mathcomp.analysis.sequences, line 720, characters 11-24
Source code (RSource code : numDomainType) (u_Source code : R ^nat) : R ^nat :=
let vSource code := [sequence (u_ n)^-1]_nSource code in
[sequence (n.+1%:R / series v n.+1)]_nSource code.
Definition root_mean_square
root_mean_square : forall [R : realType], R ^nat -> R ^nat root_mean_square is not universe polymorphic Arguments root_mean_square [R] u_ _ root_mean_square is transparent Expands to: Constant mathcomp.analysis.sequences.root_mean_square Declared in library mathcomp.analysis.sequences, line 724, characters 11-27
Source code (RSource code : realType) (u_Source code : R ^nat) : R ^nat :=
let v_Source code := [sequence (u_ k)^+2]_kSource code in
[sequence Num.sqrt (n.+1%:R^-1 * series v_ n.+1)]_nSource code.
Section cesaro.
Variable RSource code : archiRealFieldType.
Theorem cesaroSource code (u_Source code : R ^nat) (lSource code : R) : u_ @ \oo --> l ->
arithmetic_mean u_ @ \oo --> l.
Proof.
n%:R^-1 * `|series v_ m| + n%:R^-1 * `|\sum_(m <= iSource code < n) v_ i|.
move=> /subnK<-; rewrite series_addn mulrDr (le_trans (ler_normD _ _))//.
by rewrite !normrM ger0_norm.
apply/cvgrPdist_lt=> _/posnumP[e]; near \oo => m; near=> n.
have {}/ssplit -/(_ _ [sequence l - u_ n]_nSource code) : (m.+1 <= n.+1)%nat.
by near: n; exists m.
rewrite !seriesEnat /= big_split/=.
rewrite sumrN mulrBr sumr_const_nat -(mulr_natl l) mulKf//.
move=> /le_lt_trans->//; rewrite [e%:num]splitr ltrD//.
have [->|neq0] := eqVneq (\sum_(0 <= kSource code < m.+1) (l - u_ k)) 0.
by rewrite normr0 mulr0.
rewrite -ltr_pdivlMr ?normr_gt0//.
rewrite -ltf_pV2 ?qualifE//= ?mulr_gt0 ?invr_gt0 ?normr_gt0// invrK.
rewrite (lt_le_trans (archi_boundP _))// ler_nat leqW//.
by near: n; apply: nbhs_infty_ge.
rewrite ltr_pdivrMl ?ltr0n // (le_lt_trans (ler_norm_sum _ _ _)) //.
rewrite (le_lt_trans (@ler_sum_nat _ _ _ _ (fun iSource code => e%:num / 2) _))//; last first.
by rewrite sumr_const_nat mulr_natl ltr_pMn2l// ltn_subrL.
move=> i /andP[mi _]; move: i mi; near: m.
have : \forall xSource code \near \oo, `|l - u_ x| < e%:num / 2.
by move/cvgrPdist_lt : u0_cvg; apply.
move=> -[N _ Nu]; exists N => // k Nk i ki.
by rewrite ltW// Nu//= (leq_trans Nk)// ltnW.
Unshelve. all: by end_near. Qed.
End cesaro.
Section cesaro_converse.
Context {RSource code : archiRealFieldType}.
Let cesaro_converse_off_by_oneSource code (u_Source code : R ^nat) :
[sequence n.+1%:R^-1 * series u_ n.+1]_nSource code @ \oo --> 0 ->
[sequence n.+1%:R^-1 * series u_ n]_nSource code @ \oo --> 0.
Proof.
move/cvgrPdist_lt : H => /(_ _ (gt0 e)) -[m _ mu].
near=> n; rewrite sub0r normrN /=.
have /andP[n0] : ((0 < n) && (m <= n.-1))%N.
near: n; exists m.+1 => // k mk; rewrite (leq_trans _ mk) //=.
by rewrite -(leq_add2r 1%N) !addn1 prednK // (leq_trans _ mk).
move/mu => {mu}; rewrite sub0r normrN /= prednK //; apply: le_lt_trans.
rewrite !normrM ler_wpM2r // ger0_norm // ger0_norm //.
by rewrite lef_pV2 // ?ler_nat // posrE // ltr0n.
Unshelve. all: by end_near. Qed.
Lemma cesaro_converseSource code (u_Source code : R ^nat) (lSource code : R) :
telescope u_ =o_\oo @harmonic R ->
arithmetic_mean u_ @ \oo --> l -> u_ @ \oo --> l.
Proof.
suff abel : forall nSource code,
u_ n - arithmetic_mean u_ n = \sum_(1 <= kSource code < n.+1) k%:R / n.+1%:R * a_ k.-1.
suff K : u_ - arithmetic_mean u_ @ \oo --> 0.
rewrite (_ : u_ = u_ - arithmetic_mean u_ + arithmetic_mean u_).
by rewrite funeqE => n; rewrite subrK.
exact: cvg0D.
rewrite (_ : _ - arithmetic_mean u_ =
(fun nSource code => \sum_(1 <= kSource code < n.+1) k%:R / n.+1%:R * a_ k.-1)).
by rewrite funeqE.
rewrite {abel} /= (_ : (fun _ => _) =
fun nSource code => n.+1%:R^-1 * \sum_(0 <= kSource code < n) k.+1%:R * a_ k).
rewrite funeqE => n; rewrite big_add1 /= /= big_distrr /=.
by apply eq_bigr => i _; rewrite mulrCA mulrA.
have {}a_o : [sequence n.+1%:R * telescope u_ n]_nSource code @ \oo --> 0.
apply: (@eqolim0 _ _ _ eventually_filterType).
rewrite a_o.
set h := 'o_\oo (@harmonic R).
apply/eqoP => _/posnumP[e] /=.
near=> n; rewrite normr1 mulr1 normrM -ler_pdivlMl ?normr_gt0//.
rewrite mulrC -normfV.
near: n.
by case: (eqoP eventually_filterType (@harmonic R) h) => Hh _; apply Hh.
move: (cesaro a_o); rewrite /arithmetic_mean /series /= -/a_.
exact: (@cesaro_converse_off_by_one (fun kSource code => k.+1%:R * a_ k)).
case => [|n].
rewrite /arithmetic_mean/= invr1 mul1r !seriesEnat/=.
by rewrite big_nat1 subrr big_geq.
rewrite /arithmetic_mean /= seriesEnat /= big_nat_recl //=.
under eq_bigr do rewrite [u_ _]eq_sum_telescope.
rewrite big_split /= big_const_nat iter_addr addr0 addrA -mulrS mulrDr.
rewrite -(mulr_natl (u_ O)) mulKf ?pnatr_eq0//.
rewrite eq_sum_telescope (addrC (u_ O)) addrKA.
rewrite [X in _ - _ * X](_ : _ =
\sum_(0 <= iSource code < n.+1) \sum_(0 <= kSource code < n.+1 | (k < i.+1)%N) a_ k).
rewrite !big_mkord; apply: eq_bigr => i _.
by rewrite seriesEord/= big_mkord -big_ord_widen.
rewrite (exchange_big_dep_nat xpredT) //=.
rewrite [X in _ - _ * X](_ : _ =
\sum_(0 <= iSource code < n.+1) \sum_(i <= jSource code < n.+1) a_ i ).
apply: congr_big_nat => //= i ni.
rewrite big_const_nat iter_addr addr0 -big_filter.
rewrite big_const_seq iter_addr addr0; congr (_ *+ _).
rewrite /index_iota subn0 -[in LHS](subnKC (ltnW ni)) iotaD filter_cat.
rewrite count_cat (_ : [seq _ <- _ | _] = [::]).
rewrite -(filter_pred0 (iota 0 i)); apply: eq_in_filter => j.
by rewrite mem_iota leq0n andTb add0n => ji; rewrite ltnNge ji.
rewrite 2!add0n (_ : [seq _ <- _ | _] = iota i (n.+1 - i)).
rewrite -[RHS]filter_predT; apply: eq_in_filter => j.
rewrite mem_iota => /andP[ij]; rewrite subnKC; first exact/ltnW.
by move=> jn; rewrite ltnS ij.
by rewrite count_predT size_iota.
rewrite [X in _ - _ * X](_ : _ =
\sum_(0 <= iSource code < n.+1) a_ i * (n.+1 - i)%:R).
by apply: eq_bigr => i _; rewrite big_const_nat iter_addr addr0 mulr_natr.
rewrite big_distrr /= big_mkord (big_morph _ (@opprD _) (@oppr0 _)).
rewrite seriesEord -big_split /= big_add1 /= big_mkord; apply: eq_bigr => i _.
rewrite mulrCA -[X in X - _]mulr1 -mulrBr [RHS]mulrC; congr (_ * _).
rewrite -[X in X - _](@divff _ (n.+2)%:R) ?pnatr_eq0//.
rewrite [in X in _ - X]mulrC -mulrBl; congr (_ / _).
rewrite -natrB; first by rewrite (@leq_trans n.+1) // leq_subr.
rewrite subnBA; by [rewrite addSnnS addnC addnK | rewrite ltnW].
Unshelve. all: by end_near. Qed.
End cesaro_converse.
Section series_convergence.
Lemma cvg_series_cvg_0Used by
- mathcomp.analysis.measure_theory.signed_measure
- mathcomp.analysis.pi_irrational
- mathcomp.analysis.exp
Source code (KSource code : numFieldType) (VSource code : normedModType K) (u_Source code : V ^nat) :
cvgn (series u_) -> u_ @ \oo --> 0.
Proof.
Lemma nondecreasing_seriesUsed by
- mathcomp.analysis.esum
Source code (RSource code : numFieldType) (u_Source code : R ^nat) (PSource code : pred nat) mSource code :
(forall nSource code, (m <= n)%N -> P n -> 0 <= u_ n)%R ->
nondecreasing_seq (fun nSource code=> \sum_(m <= kSource code < n | P k) u_ k)%R.
Proof.
have [mn|nm] := leqP m n.
rewrite [leRHS]big_mkcond/= [leRHS]big_nat_recr//=.
by rewrite -[in leRHS]big_mkcond/= lerDl; case: ifPn => //; exact: u_ge0.
by rewrite (big_geq (ltnW _)) // big_geq.
Qed.
Lemma increasing_seriesSource code (RSource code : numFieldType) (u_Source code : R ^nat) :
(forall nSource code, 0 < u_ n) -> increasing_seq (series u_).
Proof.
End series_convergence.
Definition arithmetic
arithmetic : forall {R : GRing.Zmodule.Exports.zmodType}, R -> R -> R ^nat arithmetic is not universe polymorphic Arguments arithmetic {R} (a z)%_ring_scope n / (where some original arguments have been renamed) The reduction tactics unfold arithmetic when applied to 4 arguments arithmetic is transparent Expands to: Constant mathcomp.analysis.sequences.arithmetic Declared in library mathcomp.analysis.sequences, line 882, characters 11-21
Source code (RSource code : zmodType) aSource code zSource code : R ^nat := [sequence a + z *+ n]_nSource code.
Arguments arithmetic {R} a z n /.
Lemma mulrn_arithmeticSource code (RSource code : zmodType) : @GRing.natmul R = arithmetic 0.
Definition geometric
geometric : forall {R : fieldType}, R -> R -> R ^nat geometric is not universe polymorphic Arguments geometric {R} (a z)%_ring_scope n / (where some original arguments have been renamed) The reduction tactics unfold geometric when applied to 4 arguments geometric is transparent Expands to: Constant mathcomp.analysis.sequences.geometric Declared in library mathcomp.analysis.sequences, line 888, characters 11-20
Used by
- mathcomp.analysis.numfun
- mathcomp.analysis.exp
Source code (RSource code : fieldType) aSource code zSource code : R ^nat := [sequence a * z ^+ n]_nSource code.
Arguments geometric {R} a z n /.
Lemma exprn_geometricSource code (RSource code : fieldType) : (@GRing.exp R) = geometric 1.
Lemma cvg_arithmeticSource code (RSource code : archiRealFieldType) aSource code (zSource code : R) :
z > 0 -> arithmetic a z @ \oo --> +oo.
Proof.
rewrite -lerBlDl -mulr_natl -ler_pdivrMr//.
rewrite ler_normlW// ltW// (lt_le_trans (archi_boundP _))// ler_nat.
by near: n; apply: nbhs_infty_ge.
Unshelve. all: by end_near. Qed.
Lemma cvg_exprUsed by
- mathcomp.analysis.exp
Source code (RSource code : archiRealFieldType) (zSource code : R) :
`|z| < 1 -> (GRing.exp z : R ^nat) @ \oo --> 0.
Proof.
apply: (squeeze_cvgr (cst 0) _ (t^-1 *: @harmonic R)) => //; last first.
by rewrite -(scaler0 _ t^-1); exact: (cvgZl_tmp cvg_harmonic).
near=> n; rewrite normr_ge0 normrX/= ler_pdivlMl ?subr_gt0//.
rewrite -(@ler_pM2l _ n.+1%:R)// mulfV// [t * _]mulrC mulr_natl.
have -> : 1 = (`|z| + t) ^+ n.+1 by rewrite addrC addrNK expr1n.
rewrite exprDn (bigD1 (inord 1)) ?inordK// subn1 expr1 bin1 lerDl sumr_ge0//.
by move=> i; rewrite ?(mulrn_wge0, mulr_ge0, exprn_ge0, subr_ge0)// ltW.
Unshelve. all: by end_near. Qed.
Lemma geometric_ge0Source code (RSource code : numFieldType) (aSource code zSource code : R) nSource code :
0 <= a -> 0 <= z -> geometric a z n >= 0.
Lemma geometric_seriesESource code (RSource code : numFieldType) (aSource code zSource code : R) : z != 1 ->
series (geometric a z) = [sequence a * (1 - z ^+ n) / (1 - z)]_nSource code.
Proof.
Lemma cvg_geometric_seriesUsed by
- mathcomp.analysis.numfun
Source code {RSource code : archiRealFieldType} (aSource code zSource code : R) : `|z| < 1 ->
series (geometric a z) @ \oo --> a * (1 - z)^-1.
Proof.
by apply: cvgMr_tmp; apply: cvgM1 => //; apply: cvgB0 => //; exact: cvg_expr.
Qed.
Lemma cvg_geometric_series_halfUsed by
- mathcomp.analysis.measure_theory.signed_measure
Source code {RSource code : archiRealFieldType} (rSource code : R) nSource code :
series (fun kSource code => r / (2 ^ (k + n.+1))%:R : R^o) @ \oo --> (r / 2 ^+ n : R^o).
Proof.
rewrite funeqE => m; rewrite /series /=; apply: eq_bigr => k _.
by rewrite expnD natrM (mulrC (2 ^ k)%:R) invfM exprVn (natrX _ 2 k) mulrA.
apply: cvg_trans.
by apply: cvg_geometric_series; rewrite ger0_norm // invf_lt1 // ?ltr1n.
rewrite [X in (X - _)%R](splitr 1) div1r addrK.
by rewrite -mulrA -invfM expnSr natrM -mulrA divff// mulr1 natrX.
Qed.
Lemma geometric_partial_tailUsed by
- mathcomp.analysis.numfun
Source code {RSource code : fieldType} (nSource code mSource code : nat) (xSource code : R) :
\sum_(m <= iSource code < m + n) x ^+ i = series (geometric (x ^+ m) x) n.
Lemma cvg_geometricUsed by
- mathcomp.analysis.numfun
Source code (RSource code : archiRealFieldType) (aSource code zSource code : R) : `|z| < 1 ->
geometric a z @ \oo --> 0.
Proof.
Lemma is_cvg_geometric_seriesUsed by
- mathcomp.analysis.numfun
- mathcomp.analysis.exp
Source code (RSource code : archiRealFieldType) (aSource code zSource code : R) : `|z| < 1 ->
cvgn (series (geometric a z)).
Proof.
Definition normed_series_of
normed_series_of : forall {K : numDomainType} {V : normedModType K} (u_ : V ^nat), phantom V ^nat (series u_) -> K ^nat normed_series_of is not universe polymorphic Arguments normed_series_of {K V} u_ _ n / (where some original arguments have been renamed) The reduction tactics unfold normed_series_of when applied to 5 arguments normed_series_of is transparent Expands to: Constant mathcomp.analysis.sequences.normed_series_of Declared in library mathcomp.analysis.sequences, line 963, characters 11-27
Used by
- mathcomp.analysis.exp
Source code (KSource code : numDomainType) (VSource code : normedModType K)
(u_Source code : V ^nat) & phantom V^nat (series u_) : K ^nat :=
[series `|u_ n|]_nSource code.
Notation "[ 'normed' s_ ]"Source code := (@normed_series_of _ _ _ (Phantom _ s_)) : ring_scope.
Arguments normed_series_of {K V} u_ _ n /.
Lemma ger0_normedSource code {KSource code : numFieldType} (u_Source code : K ^nat) :
(forall nSource code, 0 <= u_ n) -> [normed series u_] = series u_.
Lemma cauchy_seriesPSource code {RSource code : numFieldType} (VSource code : normedModType R) (u_Source code : V ^nat) :
cauchy (series u_ @ \oo) <->
forall eSource code : R, e > 0 ->
\forall nSource code \near (\oo, \oo), `|\sum_(n.1 <= kSource code < n.2) u_ k| < e.
Proof.
have {}su_cv := [elaborate 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_squeeze_is_cvgnUsed by
- mathcomp.analysis.elementary_functions.trigonometry_functions
- mathcomp.analysis.numfun
- mathcomp.analysis.exp
Source code {RSource code : realType} (u_Source code v_Source code : R ^nat) :
(forall nSource code, 0 <= u_ n) -> (forall nSource code, 0 <= v_ n) ->
(forall nSource code, u_ n <= v_ n) ->
cvgn (series v_) -> cvgn (series u_).
Proof.
apply: nondecreasing_is_cvgn; first exact: nondecreasing_series.
exists M => _ [n _ <-].
by apply: le_trans (v_M (series v_ n) _); [exact: ler_sum | exists n].
Qed.
Notation series_le_cvgSource code := series_squeeze_is_cvgn (only parsing).
Lemma near_series_squeeze_is_cvgnSource code {RSource code : realType} (u_Source code v_Source code : R^nat) :
(\forall nSource code \near \oo, 0 <= u_ n) -> (\forall nSource code \near \oo, 0 <= v_ n) ->
(\forall nSource code \near \oo, u_ n <= v_ n) ->
cvgn (series v_) -> cvgn (series u_).
Proof.
near \oo => N; apply/(is_cvg_series_shiftn N).
move: cvg_v => /(is_cvg_series_shiftn N); apply: series_squeeze_is_cvgn => /= n.
- have : forall nSource code, (n >= N)%N -> 0 <= u_ n.
by near: N; exact: (iffLR (near_infty_leq _)).
by apply; exact: leq_addl.
- have : forall nSource code, (n >= N)%N -> 0 <= v_ n.
by near: N; exact: (iffLR (near_infty_leq _)).
by apply; exact: leq_addl.
- have : forall nSource code, (n >= N)%N -> u_ n <= v_ n.
by near: N; exact: (iffLR (near_infty_leq _)).
by apply; exact: leq_addl.
Unshelve. all: by end_near. Qed.
Lemma normed_cvgUsed by
- mathcomp.analysis.elementary_functions.trigonometry_functions
- mathcomp.analysis.exp
Source code {RSource code : realType} (VSource code : completeNormedModType R) (u_Source code : V ^nat) :
cvgn [normed series u_] -> cvgn (series u_).
Proof.
apply/cauchy_cvgP/cauchy_seriesP => e /u_ncvg.
apply: filterS => n /=; rewrite ger0_norm ?sumr_ge0//.
by apply: le_lt_trans; apply: ler_norm_sum.
Qed.
Lemma lim_series_normUsed by
- mathcomp.analysis.numfun
Source code {RSource code : realType} (VSource code : completeNormedModType R) (fSource code : V ^nat) :
cvgn [normed series f] ->
`|limn (series f)| <= limn [normed series f].
Proof.
rewrite -lim_norm // (ler_lim (is_cvg_norm cf) cnf) //.
by near=> x; rewrite ler_norm_sum.
Unshelve. all: by end_near. Qed.
Section series_linear.
Lemma cvg_series_boundedUsed by
- mathcomp.analysis.exp
Source code (RSource code : realFieldType) (fSource code : R ^nat) :
cvgn (series f) -> bounded_fun f.
Proof.
Lemma cvg_to_0_linearSource code (RSource code : realFieldType) (fSource code : R -> R) KSource code (kSource code : R) :
0 < k -> (forall rSource code, 0 < `| r | < k -> `|f r| <= K * `| r |) ->
f x @[xSource code --> 0^'] --> 0.
Proof.
- apply/cvgrPdist_lt => _/posnumP[e]; near=> x.
rewrite distrC subr0 (le_lt_trans (kfK _ _)) //; last first.
by rewrite (@le_lt_trans _ _ 0)// mulr_le0_ge0.
near: x; exists (k / 2); first by rewrite /mkset divr_gt0.
move=> t /=; rewrite distrC subr0 => tk2 t0.
by rewrite normr_gt0 t0 (lt_trans tk2) // -[in ltLHS](add0r k) midf_lt.
- apply/(@eqolim0 _ _ R 0^')/eqoP => _/posnumP[e]; near=> x.
rewrite (le_trans (kfK _ _)) //=.
+ near: x; exists (k / 2); first by rewrite /mkset divr_gt0.
move=> t /=; rewrite distrC subr0 => tk2 t0.
by rewrite normr_gt0 t0 (lt_trans tk2) // -[in ltLHS](add0r k) midf_lt.
+ rewrite normr1 mulr1 mulrC -ler_pdivlMr //.
near: x; exists (e%:num / K); first by rewrite /mkset divr_gt0.
by move=> t /=; rewrite distrC subr0 => /ltW.
Unshelve. all: by end_near. Qed.
Lemma lim_cvg_to_0_linearUsed by
- mathcomp.analysis.exp
Source code (RSource code : realType) (fSource code : nat -> R) (gSource code : R -> nat -> R) kSource code :
0 < k -> cvgn (series f) ->
(forall rSource code, 0 < `|r| < k -> forall nSource code, `|g r n| <= f n * `| r |) ->
limn (series (g x)) @[xSource code --> 0^'] --> 0.
Proof.
apply: (@cvg_to_0_linear _ _ (limn (series f)) k) => // h hLk; rewrite mulrC.
have Ckf : cvgn (series (`|h| *: f)) := @is_cvg_seriesZ _ _ `|h| Cf.
have Cng : cvgn [normed series (g h)].
apply: series_squeeze_is_cvgn (Hg _ hLk) _ => [//|?|].
exact: le_trans (Hg _ hLk _).
by under eq_fun do rewrite mulrC.
apply: (le_trans (@lim_series_norm _ R^o _ Cng)).
rewrite -[_ * _](lim_seriesZ _ Cf) (lim_series_le Cng Ckf) // => n.
by rewrite [leRHS]mulrC; exact: Hg.
Qed.
End series_linear.
Section exponential_series.
Context {RSource code : realType}.
Implicit Types x : R.
Definition exp_coeff
exp_coeff : forall {R : realType}, R -> R ^nat exp_coeff is not universe polymorphic Arguments exp_coeff {R} x%_ring_scope _ exp_coeff is transparent Expands to: Constant mathcomp.analysis.sequences.exp_coeff Declared in library mathcomp.analysis.sequences, line 1091, characters 11-20
Used by
- mathcomp.analysis.elementary_functions.trigonometry_functions
- mathcomp.analysis.exp
- mathcomp.analysis_stdlib.Rstruct_topology
Source code xSource code := [sequence x ^+ n / n`!%:R]_nSource code.
Local Notation expSource code := exp_coeff.
Lemma exp_coeff_ge0Source code xSource code nSource code : 0 <= x -> 0 <= exp x n.
Lemma series_exp_coeff0Used by
- mathcomp.analysis.exp
Source code nSource code : series (exp 0) n.+1 = 1.
Proof.
Section exponential_series_cvg.
Variable xSource code : R.
Hypothesis x0Source code : 0 < x.
Let S0Source code NSource code nSource code := (N ^ N)%:R * \sum_(N.+1 <= iSource code < n) (x / N%:R) ^+ i.
Let is_cvg_S0Source code NSource code : x < N%:R -> cvgn (S0 N).
Proof.
apply/is_cvg_geometric_series; rewrite normrM normfV.
by rewrite ltr_pdivrMr ?mul1r !ger0_norm // 1?ltW // (lt_trans x0).
Qed.
Let S0_ge0Source code NSource code nSource code : 0 <= S0 N n.
Proof.
Let S0_sup NSource code nSource code : x < N%:R -> S0 N n <= sup (range (S0 N)).
Proof.
Let S1Source code NSource code nSource code := \sum_(N.+1 <= iSource code < n) exp x i.
Lemma incr_S1Source code NSource code : nondecreasing_seq (S1 N).
Proof.
have [nN|Nn] := leqP n N; first by rewrite !big_geq // (leq_trans nN).
by rewrite big_nat_recr//= lerDl exp_coeff_ge0 // ltW.
Qed.
Let S1_supSource code NSource code : x < N%:R -> ubound (range (S1 N)) (sup (range (S0 N))).
Proof.
have N_gt0 := lt_trans x0 xN; apply: ler_sum => i _.
have [Ni|iN] := ltnP N i; last first.
rewrite expr_div_n mulrCA ler_pM2l ?exprn_gt0// (@le_trans _ _ 1) //.
by rewrite invf_le1// ?ler1n ?ltr0n // fact_gt0.
rewrite natrX -expfB_cond ?(negPf (lt0r_neq0 N_gt0))//.
by rewrite exprn_ege1 // ler1n; case: (N) xN x0; case: ltrgt0P.
rewrite /exp expr_div_n /= (fact_split Ni) mulrCA ler_pM2l ?exprn_gt0// natrX.
rewrite -invf_div -expfB // lef_pV2 ?qualifE/= ?exprn_gt0//.
rewrite ltr0n muln_gt0 fact_gt0/= big_seq big_mkcond/= prodn_gt0// => j.
by case: ifPn=>//; rewrite mem_index_iota => /andP[+ _]; exact: leq_ltn_trans.
rewrite big_nat_rev/= -natrX ler_nat -prod_nat_const_nat big_add1 /= big_ltn //.
rewrite leq_mul//; first by rewrite (leq_trans (fact_geq _))// leq_pmull.
under [in X in (_ <= X)%N]eq_bigr do rewrite 2!addSn 2!subSS.
rewrite !big_seq/=; elim/big_ind2 : _ => //; first by move=> *; exact: leq_mul.
move=> j; rewrite mem_index_iota => /andP[_ ji].
by rewrite -addnBA// ?leq_addr// ltnW// ltnW.
Qed.
Lemma is_cvg_series_exp_coeff_posSource code : cvgn (series (exp x)).
Proof.
by near: N; exists (truncn x).+1 => // m/= xm; rewrite -truncn_lt_nat// ltW.
rewrite -(@is_cvg_series_restrict N.+1).
by apply: (nondecreasing_is_cvgn (incr_S1 N)); eexists; exact: S1_sup.
Unshelve. all: by end_near. Qed.
End exponential_series_cvg.
Lemma normed_series_exp_coeffSource code xSource code : [normed series (exp x)] = series (exp `|x|).
Proof.
Lemma is_cvg_series_exp_coeffUsed by
- mathcomp.analysis.probability_theory.poisson_distribution
- mathcomp.analysis.pi_irrational
- mathcomp.analysis.elementary_functions.trigonometry_functions
- mathcomp.analysis.exp
Source code xSource code : cvgn (series (exp x)).
Proof.
apply/cvg_ex; exists 1; apply/cvgrPdist_lt => // => _/posnumP[e].
near=> n; have [m ->] : exists mSource code, n = m.+1.
by exists n.-1; rewrite prednK //; near: n; exists 1%N.
by rewrite series_exp_coeff0 subrr normr0.
apply: normed_cvg; rewrite normed_series_exp_coeff.
by apply: is_cvg_series_exp_coeff_pos; rewrite normr_gt0.
Unshelve. all: by end_near. Qed.
Lemma cvg_exp_coeffSource code xSource code : exp x @ \oo --> 0.
Proof.
End exponential_series.
Arguments is_cvg_series_exp_coeff {R} x.
Definition expR
expR : forall {R : realType}, R -> R expR is not universe polymorphic Arguments expR {R} x%_ring_scope expR is transparent Expands to: Constant mathcomp.analysis.sequences.expR Declared in library mathcomp.analysis.sequences, line 1196, characters 11-15
Used by
- mathcomp.analysis.probability_theory.exponential_distribution
- mathcomp.analysis.probability_theory.poisson_distribution
- mathcomp.analysis.probability_theory.random_variable
- mathcomp.analysis.probability_theory.normal_distribution
- mathcomp.analysis.real_measure.measurable_realfun
- mathcomp.analysis.gauss_integral
- mathcomp.analysis.exp
- mathcomp.analysis_stdlib.Rstruct_topology
Source code {RSource code : realType} (xSource code : R) : R := limn (series (exp_coeff x)).
Lemma nat_nondecreasing_is_cvgSource code (u_Source code : nat^nat) :
nondecreasing_seq u_ -> has_ubound (range u_) -> cvgn u_.
Proof.
suff [N Nu] : exists NSource code, forall nSource code, (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))//.
by apply/funext => n /=; rewrite Nu// leq_addl.
apply/not_existsP => hu.
have {hu}/choice[f Hf] : forall xSource code, (exists nSource code, 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 xSource code, (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
nseries : nat ^nat -> nat -> nat nseries is not universe polymorphic Arguments nseries u n%_nat_scope nseries is transparent Expands to: Constant mathcomp.analysis.sequences.nseries Declared in library mathcomp.analysis.sequences, line 1220, characters 11-18
Used by
- mathcomp.analysis.measure_theory.counting_measure
Source code (uSource code : nat^nat) := (fun nSource code => \sum_(0 <= kSource code < n) u k)%N.
Lemma le_nseriesSource code (uSource code : nat^nat) : {homo nseries u : aSource code bSource code / a <= b}%N.
Proof.
Lemma cvg_nseries_nearUsed by
- mathcomp.analysis.measure_theory.counting_measure
Source code (uSource code : nat^nat) : cvgn (nseries u) ->
\forall nSource code \near \oo, u n = 0%N.
Proof.
by rewrite nbhs_principalE.
have /ul[b _ bul] : nbhs l [set l.-1; l].
by rewrite nbhs_principalE ; apply/principal_filterP => /=; right.
exists (maxn a b) => // n /= abn.
rewrite (_ : u = fun nSource code => nseries u n.+1 - nseries u n)%N.
by rewrite funeqE => i; rewrite /nseries big_nat_recr//= addnC addnK.
have /aul -> : (a <= n)%N by rewrite (leq_trans _ abn) // leq_max leqnn.
have /bul[->|->] : (b <= n.+1)%N by rewrite leqW// (leq_trans _ abn)// leq_maxr.
- by apply/eqP; rewrite subn_eq0// leq_pred.
- by rewrite subnn.
Qed.
Lemma dvg_nseriesUsed by
- mathcomp.analysis.measure_theory.counting_measure
Source code (uSource code : nat^nat) : ~ cvgn (nseries u) ->
nseries u @ \oo --> \oo.
Proof.
apply: nat_nondecreasing_is_cvg => //; first exact: le_nseries.
exists l => _ [n _ <-]; rewrite leNgt; apply/negP => lun; apply: lu.
by near do rewrite (leq_trans lun) ?le_nseries//; apply: nbhs_infty_ge.
Unshelve. all: by end_near. Qed.
Section ereal_inf_sup_seq.
Context {RSource code : realType}.
Implicit Types (S : set (\bar R)).
Local Open Scope ereal_scope.
Lemma ereal_inf_seqUsed by
- mathcomp.analysis.ess_sup_inf
Source code SSource code : S != set0 ->
{uSource code : (\bar R)^nat | forall iSource code, S (u i) & u @ \oo --> ereal_inf S}.
Proof.
move=> /[dup]/ereal_inf_pinfty/subset_set1/orW[/eqP/negPn/[!SN0]//|->] ->.
by exists (fun=> +oo).
suff: exists2 vSource code : (\bar R)^nat, v @ \oo --> ereal_inf S &
forall nSource code, exists2 xSource code : \bar R, x \in S & x < v n.
move=> [v vcvg] /(_ _)/sig2W-/all_sig/= [u /all_and2[/(_ _)/set_mem Su u_lt]].
exists u => //; move: vcvg.
have: cst (ereal_inf S) @ \oo --> ereal_inf S by [].
apply: squeeze_cvge; apply: nearW => n; rewrite /cst/=.
by rewrite ge_ereal_inf /= 1?ltW; first by exists (u n).
have [infNy|NinfNy] := eqVneq (ereal_inf S) -oo.
exists [sequence - (n%:R%:E)]_nSource code => /=; last first.
by move=> n; setoid_rewrite set_mem_set; apply: lb_ereal_infNy_adherent.
rewrite infNy; apply/cvgNey; under eq_cvg do rewrite EFinN oppeK.
exact/cvgeryP/cvgr_idn.
have inf_fin : ereal_inf S \is a fin_num by case: ereal_inf Ninfy NinfNy.
exists [sequence ereal_inf S + n.+1%:R^-1%:E]_nSource code => /=; last first.
by move=> n; setoid_rewrite set_mem_set; exact: lb_ereal_inf_adherent.
apply/sube_cvg0 => //=; apply/cvg_abse0P.
rewrite (@eq_cvg _ _ _ _ (fun nSource code => n.+1%:R^-1%:E)); last exact: cvge_harmonic.
by move=> n /=; rewrite /= addrAC subee// add0e gee0_abs.
Unshelve. all: by end_near. Qed.
Lemma ereal_sup_seqSource code SSource code : S != set0 ->
{uSource code : nat -> \bar R | forall iSource code, S (u i) & u @ \oo --> ereal_sup S}.
Proof.
End ereal_inf_sup_seq.
Notation "\big [ op / idx ]_ ( m <= i <oo | P ) F"Source code :=
(limn (fun nSource code => (\big[ op / idx ]_(m <= iSource code < n | P) F))) : big_scope.
Notation "\big [ op / idx ]_ ( m <= i <oo ) F"Source code :=
(limn (fun nSource code => (\big[ op / idx ]_(m <= iSource code < n) F))) : big_scope.
Notation "\big [ op / idx ]_ ( i <oo | P ) F"Source code :=
(limn (fun nSource code => (\big[ op / idx ]_(iSource code < n | P) F))) : big_scope.
Notation "\big [ op / idx ]_ ( i <oo ) F"Source code :=
(limn (fun nSource code => (\big[ op / idx ]_(iSource code < n) F))) : big_scope.
Notation "\sum_ ( m <= i <oo | P ) F"Source code :=
(\big[+%E/0%E]_(m <= iSource code <oo | P%B) F%E) : ereal_scope.
Notation "\sum_ ( m <= i <oo ) F"Source code :=
(\big[+%E/0%E]_(m <= iSource code <oo) F%E) : ereal_scope.
Notation "\sum_ ( i <oo | P ) F"Source code :=
(\big[+%E/0%E]_(0 <= iSource code <oo | P%B) F%E) : ereal_scope.
Notation "\sum_ ( i <oo ) F"Source code :=
(\big[+%E/0%E]_(0 <= iSource code <oo) F%E) : ereal_scope.
Section partial_esum.
Local Open Scope ereal_scope.
Variables (RSource code : numDomainType) (u_Source code : (\bar R)^nat).
Definition eseries
eseries : forall {R : numDomainType}, (\bar R) ^nat -> (\bar R) ^nat eseries is not universe polymorphic Arguments eseries {R} u_ n : simpl never (where some original arguments have been renamed) The reduction tactics never unfold eseries eseries is transparent Expands to: Constant mathcomp.analysis.sequences.eseries Declared in library mathcomp.analysis.sequences, line 1322, characters 11-18
Used by
- mathcomp.analysis.real_measure.measurable_realfun
- mathcomp.analysis.measure_theory.measure_extension
Source code : (\bar R)^nat := [sequence \sum_(0 <= kSource code < n) u_ k]_nSource code.
Definition etelescope
etelescope : forall {R : numDomainType}, (\bar R) ^nat -> (\bar R) ^nat etelescope is not universe polymorphic Arguments etelescope {R} u_ n : simpl never (where some original arguments have been renamed) The reduction tactics never unfold etelescope etelescope is transparent Expands to: Constant mathcomp.analysis.sequences.etelescope Declared in library mathcomp.analysis.sequences, line 1323, characters 11-21
Source code : (\bar R)^nat := [sequence u_ n.+1 - u_ n]_nSource code.
Lemma eseriesEnatSource code : eseries = [sequence \sum_(0 <= kSource code < n) u_ k]_nSource code.
Proof.
Lemma eseriesEordSource code : eseries = [sequence \sum_(kSource code < n) u_ k]_nSource code.
Lemma eseriesSrSource code nSource code : eseries n.+1 = eseries n + u_ n.
Proof.
Lemma eseriesSSource code nSource code : eseries n.+1 = u_ n + eseries n.
Lemma eseriesSBSource code (nSource code : nat) :
eseries n \is a fin_num -> eseries n.+1 - eseries n = u_ n.
Lemma eseries_addnSource code mSource code nSource code : eseries (n + m)%N = eseries m + \sum_(m <= kSource code < n + m) u_ k.
Proof.
Lemma sub_eseries_geqSource code mSource code nSource code : (m <= n)%N -> eseries m \is a fin_num ->
eseries n - eseries m = \sum_(m <= kSource code < n) u_ k.
Proof.
Lemma sub_eseriesSource code mSource code nSource code : eseries m \is a fin_num -> eseries n \is a fin_num ->
eseries n - eseries m = if (m <= n)%N then \sum_(m <= kSource code < n) u_ k
else - \sum_(n <= kSource code < m) u_ k.
Proof.
by rewrite fin_num_oppeD ?fin_numN// oppeK addeC.
Qed.
Lemma sub_double_eseriesSource code nSource code : eseries n \is a fin_num ->
eseries n.*2 - eseries n = \sum_(n <= kSource code < 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"Source code := (eseries [sequence E%E]_nSource code) : ereal_scope.
Lemma cvg_geometric_eseries_halfUsed by
- mathcomp.analysis.real_measure.measurable_realfun
Source code {RSource code : archiRealFieldType} (rSource code : R) (nSource code : nat) :
eseries (fun kSource code => (r / (2 ^ (k + n.+1))%:R)%:E) @ \oo --> (r / 2 ^+ n)%:E.
Proof.
Section eseries_ops.
Variable (RSource code : numDomainType).
Local Open Scope ereal_scope.
Lemma eseriesDSource code (fSource code gSource code : (\bar R)^nat) : eseries (f \+ g) = eseries f \+ eseries g.
End eseries_ops.
Section sequences_ereal_realDomainType.
Local Open Scope ereal_scope.
Variable TSource code : realDomainType.
Implicit Types u : (\bar T)^nat.
Lemma ereal_nondecreasing_oppnSource code u_Source code :
nondecreasing_seq (-%E \o u_) = nonincreasing_seq u_.
Proof.
End sequences_ereal_realDomainType.
Section sequences_ereal.
Local Open Scope ereal_scope.
Lemma ereal_nondecreasing_cvgnUsed by
- mathcomp.analysis.measure_theory.measure_extension
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_nonneg
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_monotone_convergence
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_definition
- mathcomp.analysis.lebesgue_integral_theory.counting_lebesgue
Source code (RSource code : realType) (u_Source code : (\bar R)^nat) :
nondecreasing_seq u_ -> u_ @ \oo --> ereal_sup (range u_).
Proof.
have [Spoo|Spoo] := pselect (S +oo).
have [N Nu] : exists NSource code, forall nSource code, (n >= N)%nat -> u_ n = +oo.
case: Spoo => N _ uNoo; exists N => n Nn.
by move: (nd_u_ _ _ Nn); rewrite uNoo leye_eq => /eqP.
have -> : l = +oo by rewrite /l /ereal_sup; exact: supremum_pinfty.
rewrite -(cvg_shiftn N); set f := (X in X @ \oo --> _).
rewrite (_ : f = cst +oo)//.
by rewrite funeqE => n; rewrite /f /= Nu // leq_addl.
have [/funext Snoo|Snoo] := pselect (forall nSource code, u_ n = -oo).
rewrite /l (_ : S = [set -oo]); last by rewrite ereal_sup1 Snoo.
apply/seteqP; split => [_ [n _] <- /[!Snoo]//|_ ->].
by rewrite /S Snoo; exists 0%N.
have [/ereal_sup_ninfty loo|lnoo] := eqVneq l -oo.
by exfalso; apply: Snoo => n; rewrite (loo (u_ n))//; exists n.
have {Snoo}[N Snoo] : exists NSource code, forall nSource code, (n >= N)%N -> u_ n != -oo.
move/existsNP : Snoo => [m /eqP].
rewrite neq_lt => /orP[|umoo]; first by rewrite ltNge leNye.
by exists m => k mk; rewrite gt_eqF// (lt_le_trans umoo)// nd_u_.
have u_fin_num n : (n >= N)%N -> u_ n \is a fin_num.
move=> Nn; rewrite fin_numE Snoo//=; apply: contra_notN Spoo => /eqP unpoo.
by exists n.
have [{lnoo}loo|lpoo] := eqVneq l +oo.
rewrite loo; apply/cvgeyPge => M.
have /ereal_sup_gt[_ [n _] <- Mun] : M%:E < l by rewrite loo// ltry.
by exists n => // m /= nm; rewrite (le_trans (ltW Mun))// nd_u_.
have l_fin_num : l \is a fin_num by rewrite fin_numE lpoo lnoo.
rewrite -(@fineK _ l)//; apply/fine_cvgP; split.
near=> n; rewrite fin_numE Snoo/=; first by near: n; exists N.
by apply: contra_notN Spoo => /eqP unpoo; exists n.
rewrite -(cvg_shiftn N); set v_ := [sequence _]_ _.
have <- : sup (range v_) = fine l.
apply: EFin_inj; rewrite -ereal_sup_EFin//.
- exists (fine l) => /= _ [m _ <-]; rewrite /v_ /= fine_le//.
by rewrite u_fin_num// leq_addl.
by apply: ereal_sup_ubound; exists (m + N)%N.
- by exists (v_ 0%N), 0%N.
rewrite fineK//; apply/eqP; rewrite eq_le; apply/andP; split.
apply: ereal_sup_le => _ /= [_ [m _] <-] <-.
by exists (m + N)%N => //; rewrite /v_/= fineK// u_fin_num// leq_addl.
apply: ge_ereal_sup => /= _ [m _] <-.
rewrite (@le_trans _ _ (u_ (m + N)%N))//; first by rewrite nd_u_// leq_addr.
apply: ereal_sup_ubound => /=; exists (fine (u_ (m + N)%N)); first by exists m.
by rewrite fineK// u_fin_num// leq_addl.
apply: nondecreasing_cvgn.
- move=> m n mn /=; rewrite /v_ /= fine_le ?u_fin_num ?leq_addl//.
by rewrite nd_u_// leq_add2r.
- exists (fine l) => /= _ [m _ <-]; rewrite /v_ /= fine_le//.
by rewrite u_fin_num// leq_addl.
by apply: ereal_sup_ubound; exists (m + N)%N.
Unshelve. all: by end_near. Qed.
Section ereal_supD.
Context {RSource code : realType}.
Local Open Scope ereal_scope.
Lemma ereal_supDSource code (uSource code vSource code : nat -> \bar R) :
(forall nSource code, 0 <= u n) -> (forall nSource code, 0 <= v n) ->
nondecreasing u -> nondecreasing v ->
ereal_sup (range u) + ereal_sup (range v) =
ereal_sup (range (fun nSource code => u n + v n)).
Proof.
have u_ge0 : 0 <= ereal_sup (range u).
by rewrite (le_trans (u0 0%N))// ereal_sup_ubound//; exists 0%N.
have v_ge0 : 0 <= ereal_sup (range v).
by rewrite (le_trans (v0 0%N))// ereal_sup_ubound//; exists 0%N.
have ndsum : nondecreasing (fun nSource code => u n + v n).
by move=> n m nm; apply: leeD; [exact: ndu | exact: ndv].
have cuv_add : (fun nSource code => u n + v n) @ \oo -->
ereal_sup (range u) + ereal_sup (range v).
apply: cvgeD.
- by apply: ge0_adde_def; rewrite inE.
- exact: ereal_nondecreasing_cvgn.
- exact: ereal_nondecreasing_cvgn.
have : (fun nSource code => u n + v n) @ \oo --> ereal_sup (range (fun nSource code => u n + v n)).
exact: ereal_nondecreasing_cvgn.
exact: cvg_unique cuv_add.
Qed.
Section ereal_sup_sum.
Context {TSource code : choiceType} (fSource code : T -> nat -> \bar R).
Hypothesis f_ge0Source code : forall tSource code nSource code, 0 <= f t n.
Hypothesis f_ndSource code : forall xSource code, nondecreasing_seq (f x).
Lemma ereal_sup_sumUsed by
- mathcomp.analysis.esum
Source code (lSource code : seq T) :
\sum_(xSource code <- l) ereal_sup (range (f x)) =
ereal_sup (range (fun nSource code => \sum_(xSource code <- l) f x n)).
Proof.
- rewrite big_nil.
under eq_fun do rewrite big_nil.
by rewrite ereal_sup_cst//; apply/set0P; exists 0%N.
- rewrite big_cons ih.
under [in RHS]eq_fun do rewrite big_cons.
apply: ereal_supD.
+ by move=> n; exact: f_ge0.
+ by move=> n; apply: sume_ge0 => y _; exact: f_ge0.
+ by move=> n m nm; exact: f_nd.
+ by move=> n m nm; apply: lee_sum => y _; exact: f_nd.
Qed.
End ereal_sup_sum.
End ereal_supD.
Lemma ereal_nondecreasing_is_cvgnUsed by
- mathcomp.analysis.probability_theory.exponential_distribution
- mathcomp.analysis.probability_theory.beta_distribution
- mathcomp.analysis.probability_theory.poisson_distribution
- mathcomp.analysis.probability_theory.uniform_distribution
- mathcomp.analysis.probability_theory.binomial_distribution
- mathcomp.analysis.probability_theory.bernoulli_distribution
- mathcomp.analysis.kernel
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_nonneg
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_monotone_convergence
- mathcomp.analysis.lebesgue_integral_theory.radon_nikodym
Source code (RSource code : realType) (u_Source code : (\bar R) ^nat) :
nondecreasing_seq u_ -> cvgn u_.
Proof.
Lemma ereal_nonincreasing_cvgnSource code (RSource code : realType) (u_Source code : (\bar R)^nat) :
nonincreasing_seq u_ -> u_ @ \oo --> ereal_inf (u_ @` setT).
Proof.
by rewrite funeqE => n; rewrite /= oppeK.
apply: cvgeN.
rewrite [X in _ --> X](_ : _ = ereal_sup (range (-%E \o u_))).
congr ereal_sup; rewrite predeqE => x; split=> [[_ [n _ <-]] <-|[n _] <-];
by [exists n | exists (u_ n) => //; exists n].
by apply: ereal_nondecreasing_cvgn; rewrite ereal_nondecreasing_oppn.
Qed.
Lemma ereal_nonincreasing_is_cvgnUsed by
- mathcomp.analysis.measure_theory.signed_measure
Source code (RSource code : realType) (u_Source code : (\bar R) ^nat) :
nonincreasing_seq u_ -> cvgn u_.
Proof.
Lemma ereal_nondecreasing_seriesUsed by
- mathcomp.analysis.lebesgue_integral_theory.giry
Source code (RSource code : realDomainType) (u_Source code : (\bar R)^nat)
(PSource code : pred nat) NSource code : (forall nSource code, (N <= n)%N -> P n -> 0 <= u_ n) ->
nondecreasing_seq (fun nSource code => \sum_(N <= iSource code < n | P i) u_ i).
Proof.
Lemma congr_limUsed by
- mathcomp.analysis.esum
- mathcomp.analysis.probability_theory.poisson_distribution
- mathcomp.analysis.probability_theory.uniform_distribution
- mathcomp.analysis.measure_theory.measure_function
- mathcomp.analysis.ftc
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_nonneg
- mathcomp.analysis.lebesgue_integral_theory.giry
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_Rintegral
Source code (RSource code : numFieldType) (fSource code gSource code : nat -> \bar R) :
f = g -> limn f = limn g.
Proof.
Lemma nondecreasing_telescope_sumeyUsed by
- mathcomp.analysis.ftc
Source code (RSource code : realType) nSource code (fSource code : nat -> R) :
limn (EFin \o f) \is a fin_num ->
{homo f : xSource code ySource code / (x <= y)%N >-> (x <= y)%R} ->
\sum_(n <= kSource code <oo) ((f k.+1)%:E - (f k)%:E) = limn (EFin \o f) - (f n)%:E.
Proof.
have nd_sumf : {homo (fun iSource code => \sum_(n <= kSource code < i) ((f k.+1)%:E - (f k)%:E)) :
kSource code mSource code / (k <= m)%N >-> k <= m}.
apply/nondecreasing_seqP => m; apply: lee_sum_nneg_natr => // k _ _.
by rewrite -EFinB lee_fin subr_ge0 ndf.
transitivity
(ereal_sup (range (fun mSource code => \sum_(n <= kSource code < m) ((f k.+1)%:E - (f k)%:E)%E))).
by apply/cvg_lim => //; exact: ereal_nondecreasing_cvgn.
transitivity (limn ((EFin \o f) \- cst (f n)%:E)); last first.
apply/cvg_lim => //; apply: cvgeB => //.
- exact: fin_num_adde_defl.
- by apply: ereal_nondecreasing_is_cvgn => x y xy; rewrite lee_fin ndf.
have := @ereal_nondecreasing_cvgn _ _ nd_sumf.
rewrite -(cvg_restrict n (EFin \o f \- cst (f n)%:E)) => /cvg_lim <-//.
apply: congr_lim; apply/funext => k/=.
case: ifPn => //; rewrite -ltnNge => nk.
under eq_bigr do rewrite EFinN.
by rewrite telescope_sume// ltnW.
Qed.
Lemma eseries_condUsed by
- mathcomp.analysis.real_measure.lebesgue_measure
- mathcomp.analysis.measure_theory.measure_extension
- mathcomp.analysis.measure_theory.measure_function
Source code {RSource code : numFieldType} (fSource code : (\bar R)^nat) PSource code NSource code :
\sum_(N <= iSource code <oo | P i) f i = \sum_(iSource code <oo | P i && (N <= i)%N) f i.
Proof.
Lemma eseries_mkcondlSource code {RSource code : numFieldType} (fSource code : (\bar R)^nat) PSource code QSource code NSource code :
\sum_(N <= iSource code <oo | P i && Q i) f i =
\sum_(N <= iSource code <oo | Q i) if P i then f i else 0.
Proof.
Lemma eseries_mkcondrUsed by
- mathcomp.analysis.measure_theory.measure_extension
- mathcomp.analysis.measure_theory.measure_function
Source code {RSource code : numFieldType} (fSource code : (\bar R)^nat) PSource code QSource code NSource code :
\sum_(N <= iSource code <oo | P i && Q i) f i =
\sum_(N <= iSource code <oo | P i) if Q i then f i else 0.
Proof.
Lemma eq_eseriesrUsed by
- mathcomp.analysis.probability_theory.poisson_distribution
- mathcomp.analysis.probability_theory.random_variable
- mathcomp.analysis.probability_theory.bernoulli_distribution
- mathcomp.analysis.real_measure.measurable_realfun
- mathcomp.analysis.real_measure.lebesgue_measure
- mathcomp.analysis.real_measure.lebesgue_stieltjes_measure
- mathcomp.analysis.measure_theory.measure_extension
- mathcomp.analysis.measure_theory.measure_function
- mathcomp.analysis.ftc
- mathcomp.analysis.kernel
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_nonneg
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_fubini
- mathcomp.analysis.lebesgue_integral_theory.radon_nikodym
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integrable
Source code (RSource code : numFieldType) (fSource code gSource code : (\bar R)^nat) (PSource code : pred nat) {NSource code} :
(forall iSource code, P i -> f i = g i) ->
\sum_(N <= iSource code <oo | P i) f i = \sum_(N <= iSource code <oo | P i) g i.
Lemma eq_eserieslUsed by
- mathcomp.analysis.probability_theory.random_variable
- mathcomp.analysis.lebesgue_integral_theory.radon_nikodym
Source code (RSource code : realFieldType) (PSource code QSource code : pred nat) (fSource code : (\bar R)^nat) NSource code :
P =1 Q -> \sum_(N <= iSource code <oo | P i) f i = \sum_(N <= iSource code <oo | Q i) f i.
Arguments eq_eseriesl {R P} Q.
Lemma lim_mkordUsed by
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_nonneg
Source code (RSource code : realFieldType) (PSource code : {pred nat}) (fSource code : (\bar R)^nat) :
limn (fun nSource code => \sum_(kSource code < n | P k) f k)%E = \sum_(kSource code <oo | P k) f k.
Section ereal_series.
Variables (RSource code : realFieldType) (fSource code : (\bar R)^nat).
Implicit Types P : pred nat.
Lemma ereal_series_condUsed by
- mathcomp.analysis.hoelder
Source code kSource code PSource code :
\sum_(k <= iSource code <oo | P i) f i = \sum_(iSource code <oo | (k <= i)%N && P i) f i.
Proof.
rewrite big_nat_cond (big_nat_widenl k 0%N)//= 2!big_mkord.
by apply: eq_big => //= i; rewrite andbAC ltn_ord andbT andbb.
Qed.
Lemma ereal_seriesUsed by
- mathcomp.analysis.measure_theory.measure_function
- mathcomp.analysis.kernel
Source code kSource code : \sum_(k <= iSource code <oo) f i = \sum_(iSource code <oo | (k <= i)%N) f i.
Proof.
by apply: eq_big => // i; rewrite andbT.
Qed.
Lemma eseries0Used by
- mathcomp.analysis.probability_theory.random_variable
- mathcomp.analysis.real_measure.lebesgue_measure
- mathcomp.analysis.measure_theory.measure_extension
- mathcomp.analysis.measure_theory.measure_function
- mathcomp.analysis.measure_theory.measure_negligible
- mathcomp.analysis.hoelder
- mathcomp.analysis.kernel
- mathcomp.analysis.numfun
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_under
- mathcomp.analysis.lebesgue_integral_theory.measurable_fun_approximation
Source code NSource code PSource code : (forall iSource code, (N <= i)%N -> P i -> f i = 0) ->
\sum_(N <= iSource code <oo | P i) f i = 0.
Proof.
Lemma eseries_pred0Source code PSource code : P =1 xpred0 -> \sum_(iSource code <oo | P i) f i = 0.
Proof.
End ereal_series.
Lemma nneseries_lim_geUsed by
- mathcomp.analysis.esum
- mathcomp.analysis.probability_theory.random_variable
- mathcomp.analysis.showcase.pnt
Source code (RSource code : realType) (u_Source code : (\bar R)^nat) (PSource code : pred nat) {mSource code} kSource code :
(forall nSource code, (m <= n)%N -> P n -> 0 <= u_ n) ->
\sum_(m <= iSource code < k | P i) u_ i <= \sum_(m <= iSource code <oo | P i) u_ i.
Proof.
by apply: ereal_sup_ubound; exists k.
Qed.
Lemma eseries_pinftyUsed by
- mathcomp.analysis.measure_theory.measure_extension
Source code (RSource code : realFieldType) (u_Source code : (\bar R)^nat)
(PSource code : pred nat) kSource code : (forall nSource code, P n -> u_ n != -oo) -> P k ->
u_ k = +oo -> \sum_(iSource code <oo | P i) u_ i = +oo.
Proof.
Section cvg_eseries.
Variable (RSource code : realType) (u_Source code : (\bar R)^nat).
Implicit Type P : pred nat.
Lemma is_cvg_ereal_nneg_natsum_condUsed by
- mathcomp.analysis.measure_theory.signed_measure
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_Rintegral
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integrable
Source code mSource code PSource code :
(forall nSource code, (m <= n)%N -> P n -> 0 <= u_ n) ->
cvgn (fun nSource code => \sum_(m <= iSource code < n | P i) u_ i).
Proof.
Lemma is_cvg_ereal_npos_natsum_condUsed by
- mathcomp.analysis.measure_theory.signed_measure
Source code mSource code PSource code :
(forall nSource code, (m <= n)%N -> P n -> u_ n <= 0) ->
cvgn (fun nSource code => \sum_(m <= iSource code < n | P i) u_ i).
Proof.
Lemma is_cvg_ereal_nneg_natsumUsed by
- mathcomp.analysis.measure_theory.measure_function
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_nonneg
- mathcomp.analysis.lebesgue_integral_theory.radon_nikodym
Source code mSource code : (forall nSource code, (m <= n)%N -> 0 <= u_ n) ->
cvgn (fun nSource code => \sum_(m <= iSource code < n) u_ i).
Proof.
Lemma is_cvg_ereal_npos_natsumSource code mSource code : (forall nSource code, (m <= n)%N -> u_ n <= 0) ->
cvgn (fun nSource code => \sum_(m <= iSource code < n) u_ i).
Proof.
Lemma is_cvg_nneseries_condUsed by
- mathcomp.analysis.esum
- mathcomp.analysis.ftc
- mathcomp.analysis.lebesgue_integral_theory.measurable_fun_approximation
Source code PSource code NSource code : (forall nSource code, (N <= n)%N -> P n -> 0 <= u_ n) ->
cvgn (fun nSource code => \sum_(N <= iSource code < n | P i) u_ i).
Proof.
Lemma is_cvg_npeseries_condSource code PSource code NSource code : (forall nSource code, (N <= n)%N -> P n -> u_ n <= 0) ->
cvgn (fun nSource code => \sum_(N <= iSource code < n | P i) u_ i).
Proof.
Lemma is_cvg_nneseriesUsed by
- mathcomp.analysis.measure_theory.measure_extension
- mathcomp.analysis.measure_theory.measure_function
- mathcomp.analysis.ftc
- mathcomp.analysis.kernel
- mathcomp.analysis.showcase.pnt
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_nonneg
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_fubini
Source code PSource code NSource code : (forall nSource code, (N <= n)%N -> P n -> 0 <= u_ n) ->
cvgn (fun nSource code => \sum_(N <= iSource code < n | P i) u_ i).
Proof.
Lemma is_cvg_npeseriesSource code PSource code NSource code : (forall nSource code, (N <= n)%N -> P n -> u_ n <= 0) ->
cvgn (fun nSource code => \sum_(N <= iSource code < n | P i) u_ i).
Proof.
Lemma nneseries_ge0Used by
- mathcomp.analysis.esum
- mathcomp.analysis.real_measure.lebesgue_measure
- mathcomp.analysis.measure_theory.measure_extension
- mathcomp.analysis.measure_theory.signed_measure
- mathcomp.analysis.measure_theory.measure_function
- mathcomp.analysis.kernel
- mathcomp.analysis.showcase.pnt
- mathcomp.analysis.lebesgue_integral_theory.radon_nikodym
Source code PSource code NSource code : (forall nSource code, (N <= n)%N -> P n -> 0 <= u_ n) ->
0 <= \sum_(N <= iSource code <oo | P i) u_ i.
Proof.
by rewrite big_nat_cond sume_ge0// => n /andP[/andP[+ _]]; exact: u0.
Qed.
Lemma npeseries_le0Used by
- mathcomp.analysis.measure_theory.signed_measure
Source code PSource code NSource code : (forall nSource code : nat, (N <= n)%N -> P n -> u_ n <= 0) ->
\sum_(N <= iSource code <oo | P i) u_ i <= 0.
Proof.
by rewrite big_nat_cond sume_le0// => n /andP[/andP[+ _]]; exact: u0.
Qed.
End cvg_eseries.
Arguments is_cvg_nneseries {R}.
Arguments nneseries_ge0 {R u_ P} N.
Lemma nnseries_is_cvgSource code {RSource code : realType} (uSource code : nat -> R) :
(forall iSource code, 0 <= u i)%R -> \sum_(kSource code <oo) (u k)%:E < +oo ->
cvgn (series u).
Proof.
move=> m n mn; rewrite /series/=.
rewrite -(subnKC mn) {2}/index_iota subn0 iotaD big_cat/=.
by rewrite add0n -{2}(subn0 m) -/(index_iota _ _) lerDl sumr_ge0.
exists (fine (\sum_(kSource code <oo) (u k)%:E)).
rewrite /ubound/= => _ [n _ <-]; rewrite -lee_fin fineK//.
rewrite fin_num_abs gee0_abs//; apply: nneseries_ge0 => // i _.
by rewrite lee_fin.
by rewrite -sumEFin; apply: nneseries_lim_ge => i _; rewrite lee_fin.
Qed.
Lemma nneseriesZlUsed by
- mathcomp.analysis.probability_theory.poisson_distribution
- mathcomp.analysis.real_measure.lebesgue_measure
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_nonneg
Source code (RSource code : realType) (fSource code : nat -> \bar R) (PSource code : pred nat) xSource code NSource code :
(forall iSource code, P i -> 0 <= f i) ->
(\sum_(N <= iSource code <oo | P i) (x%:E * f i) = x%:E * \sum_(N <= iSource code <oo | P i) f i).
Proof.
by apply/congr_lim/funext => /= n; rewrite ge0_sume_distrr.
Qed.
Lemma adde_def_nneseriesSource code (RSource code : realType) (fSource code gSource code : (\bar R)^nat)
(PSource code QSource code : pred nat) mSource code :
(forall nSource code, (m <= n)%N -> P n -> 0 <= f n) ->
(forall nSource code, (m <= n)%N -> Q n -> 0 <= g n) ->
(\sum_(m <= iSource code <oo | P i) f i) +? (\sum_(m <= iSource code <oo | Q i) g i).
Proof.
- by right; apply/eqP => Qg; have := nneseries_ge0 m g0; rewrite Qg.
- by left; apply/eqP => Pf; have := nneseries_ge0 m f0; rewrite Pf.
Qed.
Lemma nneseries_pinftySource code (RSource code : realType) (u_Source code : (\bar R)^nat)
(PSource code : pred nat) kSource code : (forall nSource code, P n -> 0 <= u_ n) -> P k ->
u_ k = +oo -> \sum_(iSource code <oo | P i) u_ i = +oo.
Proof.
by rewrite gt_eqF// (lt_le_trans _ (u_ge0 _ Pn)).
Qed.
Lemma lee_nneseriesUsed by
- mathcomp.analysis.real_measure.measurable_realfun
- mathcomp.analysis.real_measure.lebesgue_measure
- mathcomp.analysis.measure_theory.measure_extension
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_nonneg
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integrable
- mathcomp.analysis.lebesgue_integral_theory.measurable_fun_approximation
Source code (RSource code : realType) (uSource code vSource code : (\bar R)^nat) (PSource code : pred nat) NSource code :
(forall iSource code, (N <= i)%N -> P i -> 0 <= u i) ->
(forall nSource code, P n -> u n <= v n) ->
\sum_(N <= iSource code <oo | P i) u i <= \sum_(N <= iSource code <oo | P i) v i.
Proof.
- by apply: is_cvg_ereal_nneg_natsum_cond => n Nn /u0; exact.
- apply: is_cvg_ereal_nneg_natsum_cond => n Nn Pn.
by rewrite (le_trans _ (Puv _ Pn))// u0.
- by near=> n; apply: lee_sum => k; exact: Puv.
Unshelve. all: by end_near. Qed.
Lemma subset_lee_nneseriesUsed by
- mathcomp.analysis.real_measure.lebesgue_measure
Source code (RSource code : realType) (uSource code : (\bar R)^nat) (PSource code QSource code : pred nat)
(NSource code : nat) :
(forall iSource code, Q i -> 0 <= u i) ->
(forall iSource code, P i -> Q i) ->
\sum_(N <= iSource code <oo | P i) u i <= \sum_(N <= iSource code <oo | Q i) u i.
Proof.
- apply: ereal_nondecreasing_is_cvgn => a b ab.
by apply: lee_sum_nneg_natr => // n Mn Pn; apply: Pu => //; exact: PQ.
- apply: ereal_nondecreasing_is_cvgn => a b ab.
by apply: lee_sum_nneg_natr => // n Mn Pn; apply: Pu => //; exact: PQ.
- near=> n; apply: lee_sum_nneg_subset => //.
by move=> i; rewrite inE => /andP[iP iQ]; exact: Pu.
Unshelve. all: by end_near. Qed.
Lemma lee_npeseriesUsed by
- mathcomp.analysis.measure_theory.signed_measure
Source code (RSource code : realType) (uSource code vSource code : (\bar R)^nat) (PSource code : pred nat) :
(forall iSource code, P i -> u i <= 0) -> (forall nSource code, P n -> v n <= u n) ->
\sum_(iSource code <oo | P i) v i <= \sum_(iSource code <oo | P i) u i.
Proof.
- apply: is_cvg_ereal_npos_natsum_cond => n _ /[dup] Pn /Puv/le_trans; apply.
exact/u0.
- by apply: is_cvg_ereal_npos_natsum_cond => n _ Pn; exact/u0.
- by near=> n; exact: lee_sum.
Unshelve. all: by end_near. Qed.
Let lim_shift_cstSource code (RSource code : realFieldType) (uSource code : (\bar R) ^nat) (lSource code : \bar R) :
cvgn u -> (forall nSource code, 0 <= u n) -> -oo < l ->
limn (fun xSource code => l + u x) = l + limn u.
Proof.
rewrite ltninfty_adde_def// inE (@lt_le_trans _ _ 0)//.
by apply: lime_ge => //; exact: nearW.
Qed.
Lemma eseries_mkcondUsed by
- mathcomp.analysis.probability_theory.random_variable
- mathcomp.analysis.real_measure.lebesgue_measure
- mathcomp.analysis.measure_theory.measure_function
Source code [RSource code : realFieldType] [PSource code : pred nat] (fSource code : nat -> \bar R) NSource code :
\sum_(N <= iSource code <oo | P i) f i = \sum_(N <= iSource code <oo) if P i then f i else 0.
Proof.
Section nneseries_split.
Let near_eq_limSource code (RSource code : realFieldType) (fSource code gSource code : nat -> \bar R) :
cvgn g -> {near \oo, f =1 g} -> limn f = limn g.
Proof.
Lemma nneseries_splitUsed by
- mathcomp.analysis.real_measure.lebesgue_measure
- mathcomp.analysis.measure_theory.measure_extension
- mathcomp.analysis.hoelder
- mathcomp.analysis.kernel
- mathcomp.analysis.showcase.pnt
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_nonneg
Source code (RSource code : realType) (fSource code : nat -> \bar R) NSource code nSource code :
(forall kSource code, (N <= k)%N -> 0 <= f k) ->
\sum_(N <= kSource code <oo) f k = \sum_(N <= kSource code < N + n) f k + \sum_(N + n <= kSource code <oo) f k.
Proof.
rewrite addn0 [in X in _ = X + _]/index_iota subnn.
by rewrite (@size0nil _ (iota _ 0)) ?size_iota// big_nil add0r.
rewrite addnS big_nat_recr/= ?leq_addr// -addeA.
rewrite [f (N + n)%N + _](_ : _ = \sum_(N + n <= kSource code <oo) f k); last exact: ih.
have cf m : (m >= N)%N -> cvgn (fun nSource code => \sum_(m <= kSource code < n) f k).
move=> Nm; apply: is_cvg_ereal_nneg_natsum => p Nmp.
by rewrite f0// (leq_trans _ Nmp).
rewrite -lim_shift_cst; [| | by rewrite (@lt_le_trans _ _ 0)// f0// leq_addr|].
- by apply: cf; rewrite -addnS leq_addr.
- move=> m; rewrite big_seq; apply: sume_ge0 => /= p.
rewrite mem_index_iota => /andP[Nnp _].
by rewrite f0// (leq_trans _ Nnp)// -addnS leq_addr.
- apply: (@near_eq_lim _ (fun xSource code => f (N + n)%N + _)) => //.
by apply: cf; rewrite leq_addr.
by near do rewrite -big_ltn//; exact: nbhs_infty_gt.
Unshelve. all: by end_near. Qed.
Lemma nneseries_split_condUsed by
- mathcomp.analysis.real_measure.lebesgue_measure
Source code (RSource code : realType) (fSource code : nat -> \bar R) NSource code nSource code (PSource code : pred nat) :
(forall kSource code, P k -> 0 <= f k) ->
\sum_(N <= kSource code <oo | P k) f k =
\sum_(N <= kSource code < N + n | P k) f k + \sum_(N + n <= kSource code <oo | P k) f k.
Proof.
rewrite big_mkcond/= (nneseries_split n)// => k Nk.
by case: ifPn => //; exact: NPf.
Qed.
Lemma nneseriesD1Used by
- mathcomp.analysis.probability_theory.random_variable
- mathcomp.analysis.numfun
Source code {RSource code : realType} (fSource code : nat -> \bar R) nSource code (PSource code : pred nat) :
(forall kSource code, P k -> 0 <= f k) -> P n ->
\sum_(0 <= kSource code <oo | P k) f k =
f n + \sum_(0 <= kSource code <oo | P k && (k != n)) f k.
Proof.
rewrite (@nneseries_split_cond _ f 0%N n.+1 P)// add0n big_mkcond/=.
rewrite big_nat_recr//= Pn -big_mkcond/= -addrA addrCA; congr +%E.
rewrite [RHS]eseries_mkcondr.
rewrite [in RHS](@nneseries_split_cond _ _ _ n.+1 P)//.
by move=> k Pk; case: ifPn => // _; exact: f0.
rewrite add0n [X in _ = X + _]big_mkcond/= big_nat_recr//= Pn eqxx/= adde0.
rewrite -big_mkcond//=; congr +%E.
rewrite big_seq_cond [RHS]big_seq_cond; apply: eq_bigr => /= i.
by rewrite mem_index_iota leq0n/= => /andP[ij Pi]; rewrite lt_eqF.
rewrite eseries_cond [RHS]eseries_cond; apply: eq_eseriesr => i /andP[Pi ji].
by rewrite gt_eqF.
Qed.
End nneseries_split.
Arguments nneseries_split {R f} _ _.
Arguments nneseries_split_cond {R f} _ _ _.
Arguments nneseriesD1 {R f} n {P}.
Lemma nneseries_reclUsed by
- mathcomp.analysis.measure_theory.measure_extension
- mathcomp.analysis.kernel
Source code {RSource code : realType} (PSource code : pred nat) (fSource code : nat -> \bar R) :
(forall kSource code, P k -> 0 <= f k) -> P 0%N ->
\sum_(0 <= kSource code <oo | P k) f k = f 0%N + \sum_(1 <= kSource code <oo | P k) f k.
Proof.
by rewrite [RHS]eseries_cond; apply: eq_eseriesl => n; rewrite lt0n.
Qed.
Lemma nneseries_tail_cvgUsed by
- mathcomp.analysis.real_measure.lebesgue_measure
- mathcomp.analysis.measure_theory.measure_function
Source code (RSource code : realType) (fSource code : (\bar R)^nat) PSource code :
(\sum_(0 <= kSource code <oo | P k) f k < +oo -> (forall kSource code, P k -> 0 <= f k) ->
\sum_(N <= kSource code <oo | P k) f k @[NSource code --> \oo] --> 0)%E.
Proof.
have : cvg (\sum_(0 <= kSource code < n | P k) f k @[nSource code --> \oo]).
apply: ereal_nondecreasing_is_cvgn.
by apply: lee_sum_nneg_natr => n _; exact: f0.
move/cvg_ex => [[l fl||/cvg_lim fnoo]] /=; last 2 first.
- by move/cvg_lim => fpoo; rewrite fpoo// in foo.
- have : 0 <= \sum_(kSource code <oo | P k) f k.
by apply: nneseries_ge0 => n _; exact: f0.
by rewrite fnoo.
rewrite [X in X @ _ --> _](_ : _ = fun NSource code => l%:E - \sum_(0 <= kSource code < N | P k) f k).
apply/funext => N; apply/esym/eqP; rewrite sube_eq//; last first.
by rewrite addeC -nneseries_split_cond//; exact/eqP/esym/cvg_lim.
rewrite ge0_adde_def//= ?inE; last exact: sume_ge0.
by apply: nneseries_ge0 => n Nn; exact: f0.
apply/cvgeNP; rewrite oppe0.
under eq_fun => ? do rewrite oppeD// oppeK addeC.
exact/sube_cvg0.
Qed.
Lemma nneseriesDUsed by
- mathcomp.analysis.real_measure.measurable_realfun
- mathcomp.analysis.kernel
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integrable
Source code (RSource code : realType) (fSource code gSource code : nat -> \bar R) (PSource code : pred nat) NSource code :
(forall iSource code, (N <= i)%N -> P i -> 0 <= f i) ->
(forall iSource code, (N <= i)%N -> P i -> 0 <= g i) ->
\sum_(N <= iSource code <oo | P i) (f i + g i) =
\sum_(N <= iSource code <oo | P i) f i + \sum_(N <= iSource code <oo | P i) g i.
Proof.
transitivity (limn (fun nSource code => \sum_(N <= iSource code < n | P i) f i +
\sum_(N <= iSource code < n | P i) g i)).
by apply/congr_lim/funext => n; rewrite big_split.
rewrite limeD /adde_def //=; do ? exact: is_cvg_nneseries.
by rewrite ![_ == -oo]gt_eqF ?andbF// (@lt_le_trans _ _ 0)
?[_ < _]real0// nneseries_ge0.
Qed.
Lemma nneseries_sum_natSource code (RSource code : realType) mSource code nSource code (fSource code : nat -> nat -> \bar R) NSource code :
(forall iSource code jSource code, 0 <= f i j) ->
\sum_(N <= jSource code <oo) (\sum_(m <= iSource code < n) f i j) =
\sum_(m <= iSource code < n) (\sum_(N <= jSource code <oo) f i j).
Proof.
by rewrite big_geq// eseries0// => i; rewrite big_geq.
have [mn|nm] := leqP m n.
rewrite big_nat_recr// -ih/= -nneseriesD//; first by move=> i; rewrite sume_ge0.
by apply/congr_lim/funext => ?; apply: eq_bigr => i _; rewrite big_nat_recr.
by rewrite big_geq// eseries0// => i; rewrite big_geq.
Qed.
Lemma nneseries_sumUsed by
- mathcomp.analysis.measure_theory.measure_function
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_nonneg
Source code ISource code (rSource code : seq I) (PSource code : {pred I}) [RSource code : realType]
[fSource code : I -> nat -> \bar R] NSource code : (forall iSource code jSource code, P i -> 0 <= f i j) ->
\sum_(N <= jSource code <oo) \sum_(iSource code <- r | P i) f i j =
\sum_(iSource code <- r | P i) \sum_(N <= jSource code <oo) f i j.
Proof.
by rewrite big_nil eseries0// => i; rewrite big_nil.
rewrite {r'}(big_nth i) big_mkcond.
rewrite (eq_eseriesr (fun _ _ => big_nth i _ _)).
rewrite (eq_eseriesr (fun _ _ => big_mkcond _ _))/=.
rewrite nneseries_sum_nat; first by move=> ? ?; case: ifP => // /f_ge0.
by apply: eq_bigr => j _; case: ifP => //; rewrite eseries0.
Qed.
Lemma nneseries_addnSource code {RSource code : realType} (fSource code : (\bar R)^nat) kSource code :
(forall iSource code, 0 <= f i) ->
\sum_(iSource code <oo) f (i + k)%N = \sum_(k <= iSource code <oo) f i.
Proof.
by apply: ereal_nondecreasing_is_cvgn => m n mn; exact: lee_sum_nneg_natr.
rewrite (cvg_lim _ fl)//; apply/cvg_lim => //=.
move: fl; rewrite -(cvg_shiftn k) /=.
by under eq_fun do rewrite -{1}(add0n k)// big_addn addnK.
Qed.
Lemma lte_limSource code (RSource code : realFieldType) (uSource code : (\bar R)^nat) (MSource code : R) :
nondecreasing_seq u -> cvgn u -> M%:E < limn u ->
\forall nSource code \near \oo, M%:E <= u n.
Proof.
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 xSource code, 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.
End sequences_ereal.
Arguments nneseries_split {R f} _ _.
Local Open Scope ereal_scope.
Lemma epsilon_trickUsed by
- mathcomp.analysis.real_measure.lebesgue_measure
- mathcomp.analysis.real_measure.lebesgue_stieltjes_measure
- mathcomp.analysis.measure_theory.measure_extension
Source code (RSource code : realType) (ASource code : (\bar R)^nat) eSource code
(PSource code : pred nat) : (forall nSource code, 0 <= A n) -> (0 <= e)%R ->
\sum_(iSource code <oo | P i) (A i + (e / (2 ^ i.+1)%:R)%:E) <=
\sum_(iSource code <oo | P i) A i + e%:E.
Proof.
rewrite (@le_trans _ _ (lim ((fun nSource code => (\sum_(0 <= iSource code < n | P i) A i) +
\sum_(0 <= iSource code < n) (e%:num / (2 ^ i.+1)%:R)%:E) @ \oo))) //.
rewrite nneseriesD // limeD //.
- exact: is_cvg_nneseries.
- exact: is_cvg_nneseries.
- exact: adde_def_nneseries.
rewrite leeD2l //; apply: lee_lim => //.
- exact: is_cvg_nneseries.
- exact: is_cvg_nneseries.
- by near=> n; exact: lee_sum_nneg_subset.
suff cvggeo : (fun nSource code => \sum_(0 <= iSource code < n) (e%:num / (2 ^ i.+1)%:R)%:E) @ \oo -->
e%:num%:E.
rewrite limeD //.
- exact: is_cvg_nneseries.
- by apply: is_cvg_nneseries => ?; rewrite lee_fin divr_ge0.
- by rewrite (cvg_lim _ cvggeo) //= fin_num_adde_defl.
- by rewrite leeD2l // (cvg_lim _ cvggeo).
rewrite (_ : (fun nSource code => _) = EFin \o
(fun nSource code => \sum_(0 <= iSource code < n) (e%:num / (2 ^ (i + 1))%:R))%R).
rewrite funeqE => n /=; rewrite (@big_morph _ _ EFin 0 adde)//.
by under [in RHS]eq_bigr do rewrite addn1.
apply: cvg_comp; last by apply cvg_refl.
have := cvg_geometric_series_half e%:num O.
by rewrite expr0 divr1; apply: cvg_trans.
Unshelve. all: by end_near. Qed.
Lemma epsilon_trick0Used by
- mathcomp.analysis.real_measure.measurable_realfun
- mathcomp.analysis.lebesgue_integral_theory.measurable_fun_approximation
Source code (RSource code : realType) (epsSource code : R) (PSource code : pred nat) :
(0 <= eps)%R -> \sum_(iSource code <oo | P i) (eps / (2 ^ i.+1)%:R)%:E <= eps%:E.
Proof.
(* TODO: breaks coq 8.15 and below *)
(* (under eq_eseriesr do rewrite add0e) => /le_trans; apply. *)
rewrite (@eq_eseriesr _ (fun nSource code => 0 + _) (fun nSource code => (eps/(2^n.+1)%:R)%:E)).
by move=> ? ?; rewrite add0e.
by move/le_trans; apply; rewrite eseries0 ?add0e; [move=> ? ? | exact: lexx].
Qed.
Section minr_cvg_0.
Local Open Scope ring_scope.
Context {RSource code : realFieldType}.
Implicit Types (u : R^nat) (r : R).
Lemma minr_cvg_0_cvg_0Source code uSource code rSource code : 0 < r -> (forall kSource code, 0 <= u k) ->
minr (u n) r @[nSource code --> \oo] --> 0 -> u n @[nSource code --> \oo] --> 0.
Proof.
have : 0 < minr e%:num r by rewrite lt_min// 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_min u0 ltW.
Unshelve. all: by end_near. Qed.
Lemma maxr_cvg_0_cvg_0Source code uSource code rSource code : r < 0 -> (forall kSource code, u k <= 0) ->
maxr (u n) r @[nSource code --> \oo] --> 0 -> u n @[nSource code --> \oo] --> 0.
Proof.
End minr_cvg_0.
Section mine_cvg_0.
Context {RSource code : realFieldType}.
Local Open Scope ereal_scope.
Implicit Types (u : (\bar R)^nat) (r : R) (x : \bar R).
Lemma mine_cvg_0_cvg_fin_numSource code uSource code xSource code : 0 < x -> (forall kSource code, 0 <= u k) ->
mine (u n) x @[nSource code --> \oo] --> 0 ->
\forall nSource code \near \oo, u n \is a fin_num.
Proof.
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//.
by rewrite le_min u0 ltW.
by have := u0 n; case: (u n) => //=; rewrite ltxx.
Unshelve. all: by end_near. Qed.
Lemma mine_cvg_minr_cvgSource code uSource code rSource code : (0 < r)%R -> (forall kSource code, 0 <= u k) ->
mine (u n) r%:E @[nSource code --> \oo] --> 0 ->
minr (fine (u n)) r @[nSource code --> \oo] --> 0%R.
Proof.
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_0Used by
- mathcomp.analysis.measure_theory.signed_measure
Source code uSource code xSource code : 0 < x -> (forall kSource code, 0 <= u k) ->
mine (u n) x @[nSource code --> \oo] --> 0 -> u n @[nSource code --> \oo] --> 0.
Proof.
exact: (mine_cvg_0_cvg_fin_num x0).
case: x x0 h => [r r0 h|_|//]; last first.
under eq_cvg do rewrite miney.
exact: fine_cvg.
apply: (@minr_cvg_0_cvg_0 _ (fine \o u) r) => //.
by move=> k /=; rewrite fine_ge0.
exact: mine_cvg_minr_cvg.
Qed.
Lemma maxe_cvg_0_cvg_fin_numSource code uSource code xSource code : x < 0 -> (forall kSource code, u k <= 0) ->
maxe (u n) x @[nSource code --> \oo] --> 0 ->
\forall nSource code \near \oo, u n \is a fin_num.
Proof.
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 leeNr oppe0.
by move=> /(_ Nu0)[n _ nu]; exists n => // m/= nm; rewrite -fin_numN nu.
Qed.
Lemma maxe_cvg_maxr_cvgSource code uSource code rSource code : (r < 0)%R -> (forall kSource code, u k <= 0) ->
maxe (u n) r%:E @[nSource code --> \oo] --> 0 ->
maxr (fine (u n)) r @[nSource code --> \oo] --> 0%R.
Proof.
under eq_fun do rewrite -(oppeK (u _)) -[in maxe _ _](oppeK r%:E) -oppe_min.
rewrite -[in _ --> _]oppe0 => /cvgeNP/mine_cvg_minr_cvg-/(_ r0).
have Nu0 k : 0 <= - u k by rewrite leeNr oppe0.
move=> /(_ Nu0)/(cvgNP _ _).2; rewrite oppr0.
by under eq_cvg do rewrite /GRing.opp /= oppr_min fineN !opprK.
Qed.
Lemma maxe_cvg_0_cvg_0Source code uSource code xSource code : x < 0 -> (forall kSource code, u k <= 0) ->
maxe (u n) x @[nSource code --> \oo] --> 0 -> u n @[nSource code --> \oo] --> 0.
Proof.
End mine_cvg_0.
Definition sdrop
sdrop : forall [T : Type], T ^nat -> nat -> set T sdrop is not universe polymorphic Arguments sdrop [T]%_type_scope u n%_nat_scope _ sdrop is transparent Expands to: Constant mathcomp.analysis.sequences.sdrop Declared in library mathcomp.analysis.sequences, line 2124, characters 11-16
Source code TSource code (uSource code : T^nat) nSource code := [set u k | kSource code in [set kSource code | k >= n]]%N.
Section sdrop.
Context {dSource code} {RSource code : porderType d}.
Implicit Types (u : R^o^nat).
Lemma sdrop_shiftSource code uSource code NSource code nSource code : sdrop (fun iSource code => u (i + N)%N) n = sdrop u (n + N).
Proof.
Lemma has_lbound_sdropSource code uSource code : has_lbound (range u) ->
forall mSource code, has_lbound (sdrop u m).
Proof.
Qed.
Lemma has_ubound_sdropUsed by
- mathcomp.analysis.real_measure.measurable_realfun
Source code uSource code : has_ubound (range u) ->
forall mSource code, has_ubound (sdrop u m).
Proof.
Qed.
End sdrop.
Section sups_infs.
Variable RSource code : realType.
Implicit Types (r : R) (u : R^o^nat).
Definition sups
sups : forall [R : realType], (R^o) ^nat -> R ^nat sups is not universe polymorphic Arguments sups [R] u _ sups is transparent Expands to: Constant mathcomp.analysis.sequences.sups Declared in library mathcomp.analysis.sequences, line 2157, characters 11-15
Used by
- mathcomp.analysis.real_measure.measurable_realfun
Source code uSource code := [sequence sup (sdrop u n)]_nSource code.
Definition infs
infs : forall [R : realType], (R^o) ^nat -> R ^nat infs is not universe polymorphic Arguments infs [R] u _ infs is transparent Expands to: Constant mathcomp.analysis.sequences.infs Declared in library mathcomp.analysis.sequences, line 2159, characters 11-15
Used by
- mathcomp.analysis.real_measure.measurable_realfun
Source code uSource code := [sequence inf (sdrop u n)]_nSource code.
Lemma supsNSource code uSource code : sups (-%R \o u) = - infs u.
Proof.
Lemma infsNSource code uSource code : infs (-%R \o u) = - sups u.
Proof.
Lemma nonincreasing_supsSource code uSource code : has_ubound (range u) ->
nonincreasing_seq (sups u).
Proof.
- by exists (u n) => /=; exists n => /=.
- by split; [exists (u m); exists m => /=|exact/has_ubound_sdrop].
- by exists p => //=; exact: leq_trans np.
Qed.
Lemma nondecreasing_infsSource code uSource code : has_lbound (range u) ->
nondecreasing_seq (infs u).
Proof.
by move: u_lb => /has_lb_ubN; rewrite /comp /= image_comp.
Qed.
Lemma is_cvg_supsSource code uSource code : cvgn u -> cvgn (sups u).
Proof.
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: ub_le_sup; last by exists n => /=.
exact/has_ubound_sdrop/bounded_fun_has_ubound/cvg_seq_bounded.
Qed.
Lemma is_cvg_infsSource code uSource code : cvgn u -> cvgn (infs u).
Proof.
Lemma infs_le_supsSource code uSource code nSource code : cvgn u -> infs u n <= sups u n.
Proof.
have [a Aa] : A !=set0 by exists (u n); rewrite /A /=; exists n => //=.
(rewrite (@le_trans _ _ a) //; [apply/ge_inf|apply/ub_le_sup]) => //.
- 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_infUsed by
- mathcomp.analysis.real_measure.measurable_realfun
Source code uSource code : has_ubound (range u) -> has_lbound (range u) ->
sups u @ \oo --> inf (range (sups u)).
Proof.
case: u_lb => M uM; exists M => _ [n _ <-].
rewrite (@le_trans _ _ (u n)) //; first by apply: uM; exists n.
by apply: ub_le_sup; [exact/has_ubound_sdrop|exists n => /=].
Qed.
Lemma cvg_infs_supSource code uSource code : has_ubound (range u) -> has_lbound (range u) ->
infs u @ \oo --> sup (range (infs u)).
Proof.
apply: cvg_sups_inf.
- by move: u_lb => /has_lb_ubN; rewrite image_comp.
- by move: u_ub => /has_ub_lbN; rewrite image_comp.
rewrite /inf => /(cvg_comp _ (fun xSource code => - x)).
rewrite supsN /comp /= -[in X in _ -> X --> _](opprK (infs u)); apply.
rewrite image_comp /comp /= -(opprK (sup (range (infs u)))); apply: cvgN.
by rewrite (_ : [set _ | _ in setT] = (range (infs u))) // opprK.
Qed.
Lemma sups_preimageUsed by
- mathcomp.analysis.real_measure.measurable_realfun
Source code TSource code (DSource code : set T) rSource code (fSource code : (T -> R)^nat) nSource code :
(forall tSource code, D t -> has_ubound (range (f ^~ t))) ->
D `&` (fun xSource code => sups (f ^~x) n) @^-1` `]r, +oo[%classic =
D `&` \bigcup_(kSource code in [set kSource code | n <= k]%N) f k @^-1` `]r, +oo[.
Proof.
- 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: ub_le_sup; [exact/has_ubound_sdrop/f_ub|by exists k].
Qed.
Lemma infs_preimageUsed by
- mathcomp.analysis.real_measure.measurable_realfun
Source code TSource code (DSource code : set T) rSource code (fSource code : (T -> R)^nat) nSource code :
(forall tSource code, D t -> has_lbound (range (f ^~ t))) ->
D `&` (fun xSource code => infs (f ^~ x) n) @^-1` `]-oo, r[ =
D `&` \bigcup_(kSource code in [set kSource code | n <= k]%N) f k @^-1` `]-oo, r[.
Proof.
- 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/ge_inf => //; [exact/has_lbound_sdrop/lb_f|by exists k].
Qed.
Lemma bounded_fun_has_lbound_supsSource code uSource code :
bounded_fun u -> has_lbound (range (sups u)).
Proof.
have [M hM] := h O; exists M => y [n _ <-].
rewrite (@le_trans _ _ (u n)) //; first by apply: hM; exists n.
apply: ub_le_sup; last by exists n => /=.
by move: ba => /bounded_fun_has_ubound/has_ubound_sdrop; exact.
Qed.
Lemma bounded_fun_has_ubound_infsSource code uSource code :
bounded_fun u -> has_ubound (range (infs u)).
Proof.
have [M hM] := h O; exists M => y [n _ <-].
rewrite (@le_trans _ _ (u n)) //; last by apply: hM; exists n.
apply: ge_inf; 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 RSource code : realType.
Implicit Types (r : R) (u v : R^o^nat).
Definition limn_sup
limn_sup : forall [R : realType], (R^o) ^nat -> join_order_topology_POrderedPointedTopological_between_Order_POrder_and_filter_PointedNbhs (numFieldTopology.Real_sort__canonical__order_topology_POrderedPointedTopological R) limn_sup is not universe polymorphic Arguments limn_sup [R] u limn_sup is transparent Expands to: Constant mathcomp.analysis.sequences.limn_sup Declared in library mathcomp.analysis.sequences, line 2294, characters 11-19
Used by
- mathcomp.analysis.real_measure.measurable_realfun
Source code uSource code := limn (sups u).
Definition limn_inf
limn_inf : forall [R : realType], (R^o) ^nat -> join_pseudometric_normed_Zmodule_PseudoMetricNormedZmodule_between_Algebra_BaseZmodule_and_filter_PointedNbhs (numFieldNormedType.Real_sort__canonical__pseudometric_normed_Zmodule_PseudoMetricNormedZmodule R) limn_inf is not universe polymorphic Arguments limn_inf [R] u limn_inf is transparent Expands to: Constant mathcomp.analysis.sequences.limn_inf Declared in library mathcomp.analysis.sequences, line 2296, characters 11-19
Source code uSource code := limn (infs u).
Lemma limn_infNSource code uSource code : cvgn u -> limn_inf (-%R \o u) = - limn_sup u.
Proof.
Lemma limn_supESource code uSource code : bounded_fun u -> limn_sup u = inf (range (sups u)).
Proof.
by apply/cvg_sups_inf; [exact/bounded_fun_has_ubound|
exact/bounded_fun_has_lbound].
Qed.
Lemma limn_infESource code uSource code : bounded_fun u -> limn_inf u = sup (range (infs u)).
Proof.
by apply/cvg_infs_sup; [exact/bounded_fun_has_ubound|
exact/bounded_fun_has_lbound].
Qed.
Lemma limn_inf_supSource code uSource code : cvgn u -> limn_inf u <= limn_sup u.
Proof.
by apply: nearW => n; apply: infs_le_sups.
Qed.
Lemma cvg_limn_inf_supSource code uSource code lSource code : u @ \oo --> l -> (limn_inf u = l) * (limn_sup u = l).
Proof.
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: ge_sup; 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_infESource code uSource code : cvgn u -> limn_inf u = limn u.
Proof.
Lemma cvg_limn_supESource code uSource code : cvgn u -> limn_sup u = limn u.
Proof.
Lemma cvg_supsUsed by
- mathcomp.analysis.real_measure.measurable_realfun
Source code uSource code lSource code : u @ \oo --> l -> sups u @ \oo --> (l : R^o).
Proof.
apply/cvg_closeP; split => //; apply: is_cvg_sups.
by apply/cvg_ex; eexists; apply: ul.
Qed.
Lemma cvg_infsSource code uSource code lSource code : u @ \oo --> l -> infs u @ \oo --> (l : R^o).
Proof.
apply/cvg_closeP; split => //; apply: is_cvg_infs.
by apply/cvg_ex; eexists; apply: ul.
Qed.
Lemma le_limn_supDSource code uSource code vSource code : bounded_fun u -> bounded_fun v ->
limn_sup (u \+ v) <= limn_sup u + limn_sup v.
Proof.
apply: ge_sup; first by exists ((u \+ v) k); exists k => /=.
by move=> M [n /= kn <-]; apply: lerD; apply: ub_le_sup; [
exact/has_ubound_sdrop/bounded_fun_has_ubound; exact | exists n |
exact/has_ubound_sdrop/bounded_fun_has_ubound; exact | exists n ].
have cu : cvgn (sups u).
apply: nonincreasing_is_cvgn; last exact: bounded_fun_has_lbound_sups.
exact/nonincreasing_sups/bounded_fun_has_ubound.
have cv : cvgn (sups v).
apply: nonincreasing_is_cvgn; last exact: bounded_fun_has_lbound_sups.
exact/nonincreasing_sups/bounded_fun_has_ubound.
rewrite -(limD cu cv); apply: ler_lim.
- apply: nonincreasing_is_cvgn; last first.
exact/bounded_fun_has_lbound_sups/bounded_funD.
exact/nonincreasing_sups/bounded_fun_has_ubound/bounded_funD.
- exact: is_cvgD cu cv.
- exact: nearW.
Qed.
Lemma le_limn_infDSource code uSource code vSource code : bounded_fun u -> bounded_fun v ->
limn_inf u + limn_inf v <= limn_inf (u \+ v).
Proof.
apply: lb_le_inf; first by exists ((u \+ v) k); exists k => /=.
by move=> M [n /= kn <-]; apply: lerD; apply: ge_inf; [
exact/has_lbound_sdrop/bounded_fun_has_lbound; exact | exists n |
exact/has_lbound_sdrop/bounded_fun_has_lbound; exact | exists n ].
have cu : cvgn (infs u).
apply: nondecreasing_is_cvgn; last exact: bounded_fun_has_ubound_infs.
exact/nondecreasing_infs/bounded_fun_has_lbound.
have cv : cvgn (infs v).
apply: nondecreasing_is_cvgn; last exact: bounded_fun_has_ubound_infs.
exact/nondecreasing_infs/bounded_fun_has_lbound.
rewrite -(limD cu cv); apply: ler_lim.
- exact: is_cvgD cu cv.
- apply: nondecreasing_is_cvgn; last first.
exact/bounded_fun_has_ubound_infs/bounded_funD.
exact/nondecreasing_infs/bounded_fun_has_lbound/bounded_funD.
- exact: nearW.
Qed.
Lemma limn_supDSource code uSource code vSource code : cvgn u -> cvgn v ->
limn_sup (u \+ v) = limn_sup u + limn_sup v.
Proof.
apply/eqP; rewrite eq_le le_limn_supD //=.
have := @le_limn_supD _ _ (bounded_funD ba bb) (bounded_funN bb).
rewrite -lerBlDr; apply: le_trans.
rewrite -[_ \+ _]/(u + v - v) addrK -limn_infN; first exact: is_cvgN.
rewrite /comp /=; under eq_fun do rewrite opprK.
by rewrite lerD// cvg_limn_infE// cvg_limn_supE.
Qed.
Lemma limn_infDSource code uSource code vSource code : cvgn u -> cvgn v ->
limn_inf (u \+ v) = limn_inf u + limn_inf v.
Proof.
rewrite (cvg_limn_infE cv) -(cvg_limn_supE cv) -limn_supD//.
rewrite cvg_limn_supE; first exact: is_cvgD cu cv.
by rewrite cvg_limn_infE //; exact: is_cvgD cu cv.
Qed.
End limn_sup_limn_inf.
Section esups_einfs.
Context {RSource code : realType}.
Implicit Types (u : (\bar R)^nat).
Local Open Scope ereal_scope.
Definition esups
esups : forall {R : realType}, (\bar R) ^nat -> constructive_ereal_extended__canonical__Order_POrder ^nat esups is not universe polymorphic Arguments esups {R} u _ esups is transparent Expands to: Constant mathcomp.analysis.sequences.esups Declared in library mathcomp.analysis.sequences, line 2448, characters 11-16
Used by
- mathcomp.analysis.real_measure.measurable_realfun
Source code uSource code := [sequence ereal_sup (sdrop u n)]_nSource code.
Definition einfs
einfs : forall {R : realType}, (\bar R) ^nat -> (\bar R) ^nat einfs is not universe polymorphic Arguments einfs {R} u _ einfs is transparent Expands to: Constant mathcomp.analysis.sequences.einfs Declared in library mathcomp.analysis.sequences, line 2450, characters 11-16
Used by
- mathcomp.analysis.real_measure.measurable_realfun
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_monotone_convergence
Source code uSource code := [sequence ereal_inf (sdrop u n)]_nSource code.
Lemma esupsNSource code uSource code : esups (-%E \o u) = -%E \o einfs u.
Proof.
Lemma einfsNSource code uSource code : einfs (-%E \o u) = -%E \o esups u.
Proof.
Lemma ge_einfsSource code uSource code nSource code mSource code : (m <= n)%N -> einfs u m <= u n.
Proof.
Lemma einfs_shiftSource code uSource code NSource code nSource code : einfs (fun kSource code => u (k + N)%N) n = einfs u (n + N)%N.
Proof.
Lemma nonincreasing_esupsSource code uSource code : nonincreasing_seq (esups u).
Proof.
by rewrite (leq_trans mn).
Qed.
Lemma nondecreasing_einfsSource code uSource code : nondecreasing_seq (einfs u).
Proof.
by rewrite (leq_trans mn).
Qed.
Lemma einfs_le_esupsSource code uSource code nSource code : einfs u n <= esups u n.
Proof.
by exists (u n); rewrite /A /=; exists n => //=.
by rewrite (@le_trans _ _ a)//; [exact/ereal_inf_lbound|exact/ereal_sup_ubound].
Unshelve. all: by end_near. Qed.
Lemma cvg_esups_infUsed by
- mathcomp.analysis.real_measure.measurable_realfun
Source code uSource code : esups u @ \oo --> ereal_inf (range (esups u)).
Proof.
Lemma is_cvg_esupsSource code uSource code : cvgn (esups u).
Proof.
Lemma cvg_einfs_supSource code uSource code : einfs u @ \oo --> ereal_sup (range (einfs u)).
Proof.
Lemma is_cvg_einfsSource code uSource code : cvgn (einfs u).
Proof.
Lemma esups_preimageUsed by
- mathcomp.analysis.real_measure.measurable_realfun
Source code TSource code (aSource code : \bar R) (fSource code : (T -> \bar R)^nat) nSource code :
(fun xSource code => esups (f^~x) n) @^-1` `]a, +oo[ =
\bigcup_(kSource code in [set kSource code | n <= k]%N) f k @^-1` `]a, +oo[.
Proof.
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_ubound; exists k.
Qed.
Lemma einfs_preimageUsed by
- mathcomp.analysis.real_measure.measurable_realfun
Source code TSource code (aSource code : \bar R) (fSource code : (T -> \bar R)^nat) nSource code :
(fun xSource code => einfs (f^~x) n) @^-1` `[a, +oo[%classic =
\bigcap_(kSource code in [set kSource code | n <= k]%N) f k @^-1` `[a, +oo[%classic.
Proof.
rewrite in_itv andbT /= => h k nk /=.
by rewrite /= in_itv/= (le_trans h)//; apply: ereal_inf_lbound; exists k.
rewrite /= in_itv /= andbT leNgt; apply/negP.
move=> /ereal_inf_lt[_ /= [k nk <-]]; apply/negP.
by have := h _ nk; rewrite /= in_itv /= andbT -leNgt.
Qed.
End esups_einfs.
Section limn_esup_einf.
Context {RSource code : realType}.
Implicit Type (u : (\bar R)^nat).
Local Open Scope ereal_scope.
Definition limn_esup
limn_esup : forall {R : realType}, (\bar R) ^nat -> \bar R limn_esup is not universe polymorphic Arguments limn_esup {R} u limn_esup is transparent Expands to: Constant mathcomp.analysis.sequences.limn_esup Declared in library mathcomp.analysis.sequences, line 2532, characters 11-20
Used by
- mathcomp.analysis.real_measure.measurable_realfun
- mathcomp.analysis.kernel
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_dominated_convergence
- mathcomp.analysis.lebesgue_integral_theory.radon_nikodym
- mathcomp.analysis.lebesgue_integral_theory.measurable_fun_approximation
Source code uSource code := limf_esup u \oo.
Definition limn_einf
limn_einf : forall {R : realType}, (\bar R) ^nat -> \bar R limn_einf is not universe polymorphic Arguments limn_einf {R} u limn_einf is transparent Expands to: Constant mathcomp.analysis.sequences.limn_einf Declared in library mathcomp.analysis.sequences, line 2534, characters 11-20
Used by
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_monotone_convergence
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_dominated_convergence
Source code uSource code := - limn_esup (\- u).
Lemma limn_esup_limUsed by
- mathcomp.analysis.real_measure.measurable_realfun
Source code uSource code : limn_esup u = limn (esups u).
Proof.
apply: lime_ge; first exact: is_cvg_esups.
near=> m; apply: ereal_inf_lbound => /=.
by exists [set kSource code | (m <= k)%N] => //=; exists m.
apply: le_ereal_inf_tmp => /= _ [A [r /= r0 rA] <-].
apply: lime_le; first exact: is_cvg_esups.
near=> m; apply: ereal_sup_le => _ [n /= mn] <-.
exists n => //; apply: rA => //=; apply: leq_trans mn.
by near: m; exists r.
Unshelve. all: by end_near. Qed.
Lemma limn_einf_limUsed by
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_monotone_convergence
Source code uSource code : limn_einf u = limn (einfs u).
Proof.
by apply: is_cvgeN; exact: is_cvg_einfs.
by under eq_fun do rewrite oppeK.
Qed.
End limn_esup_einf.
Section lim_esup_inf.
Local Open Scope ereal_scope.
Context {RSource code : realType}.
Implicit Types (u v : (\bar R)^nat) (l : \bar R).
Lemma limn_einf_addlUsed by
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_dominated_convergence
Source code uSource code lSource code : l \is a fin_num ->
limn_einf (fun xSource code => l + u x) = l + limn_einf u.
Proof.
apply: cvg_trans; last first.
apply: (@cvgeD _ \oo _ _ (cst l) (einfs u) _ (limn (einfs u))) => //.
- by rewrite fin_num_adde_defr.
- exact: is_cvg_einfs.
suff : einfs (fun nSource code => l + u n) = (fun nSource code => l + einfs u n) by move=> ->.
rewrite funeqE => n.
apply/eqP; rewrite eq_le; apply/andP; split.
- rewrite addeC -leeBlDr//; apply: le_ereal_inf_tmp => /= _ [m /= mn] <-.
rewrite leeBlDr//; apply: ereal_inf_lbound.
by exists m => //; rewrite addeC.
- apply: le_ereal_inf_tmp => /= _ [m /= mn] <-.
by rewrite leeD2l//; apply: ereal_inf_lbound; exists m.
Qed.
Lemma limn_esup_le_cvgUsed by
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_dominated_convergence
Source code uSource code lSource code : limn_esup u <= l -> (forall nSource code, l <= u n) ->
u @ \oo --> l.
Proof.
by rewrite ul /=; apply/ereal_sup_ubound; exists n => /=.
suff : esups u @ \oo --> l.
by apply: (squeeze_cvge (cst l)) => //; exact: nearW.
apply/cvg_closeP; split; first exact: is_cvg_esups.
rewrite closeE//; apply/eqP.
rewrite eq_le -[X in X <= _ <= _]limn_esup_lim supul/=.
apply: (lime_ge (@is_cvg_esups _ _)); apply: nearW => m.
have /le_trans : l <= einfs u m by apply: le_ereal_inf_tmp => _ [p /= pm] <-.
by apply; exact: einfs_le_esups.
Qed.
Lemma limn_einfNUsed by
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_dominated_convergence
Source code uSource code : limn_einf (-%E \o u) = - limn_esup u.
Proof.
Lemma limn_esupNSource code uSource code : limn_esup (-%E \o u) = - limn_einf u.
Lemma limn_einf_supSource code uSource code : limn_einf u <= limn_esup u.
Proof.
apply: lee_lim; [exact/is_cvg_einfs|exact/is_cvg_esups|].
by apply: nearW; exact: einfs_le_esups.
Qed.
Lemma cvgNy_limn_einf_supSource code uSource code : u @ \oo --> -oo ->
(limn_einf u = -oo) * (limn_esup u = -oo).
Proof.
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: ge_ereal_sup => _ [k /= nk <-].
by apply: uM => /=; rewrite (leq_trans _ nk)//; near: n; exists m.
Unshelve. all: by end_near. Qed.
Lemma cvgNy_einfsSource code uSource code : u @ \oo --> -oo -> einfs u @ \oo --> -oo.
Proof.
apply/cvg_closeP; split; [exact: is_cvg_einfs|rewrite closeE//].
by rewrite -limn_einf_lim.
Qed.
Lemma cvgNy_esupsSource code uSource code : u @ \oo --> -oo -> esups u @ \oo --> -oo.
Proof.
by split; [exact: is_cvg_esups|rewrite closeE// -limn_esup_lim].
Qed.
Lemma cvgy_einfsSource code uSource code : u @ \oo --> +oo -> einfs u @ \oo --> +oo.
Lemma cvgy_esupsSource code uSource code : u @ \oo --> +oo -> esups u @ \oo --> +oo.
Lemma cvg_esupsUsed by
- mathcomp.analysis.real_measure.measurable_realfun
Source code uSource code lSource code : u @ \oo --> l -> esups u @ \oo --> l.
Proof.
- 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.
- 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_einfsSource code uSource code lSource code : u @ \oo --> l -> einfs u @ \oo --> l.
Proof.
Lemma cvg_limn_einf_supSource code uSource code lSource code : u @ \oo --> l ->
(limn_einf u = l) * (limn_esup u = l).
Proof.
- by apply/cvg_lim => //; exact/cvg_einfs.
- by apply/cvg_lim => //; exact/cvg_esups.
Qed.
Lemma is_cvg_limn_einfEUsed by
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_dominated_convergence
Source code uSource code : cvgn u -> limn_einf u = limn u.
Proof.
Lemma is_cvg_limn_esupEUsed by
- mathcomp.analysis.kernel
- mathcomp.analysis.lebesgue_integral_theory.radon_nikodym
- mathcomp.analysis.lebesgue_integral_theory.measurable_fun_approximation
Source code uSource code : cvgn u -> limn_esup u = limn u.
Proof.
#[deprecated(since="mathcomp-analysis 1.19.0", note="to be renamed `limn_einf_shift`")]
Lemma limn_einf_shift_newSource code uSource code NSource code :
limn_einf (fun nSource code => u (n + N)%N) = limn_einf u.
Proof.
rewrite [X in limn X = _](_ : _ = (fun nSource code => einfs u (n + N)%N)).
by apply/funext => n; exact: einfs_shift.
by apply/cvg_lim => //; rewrite (cvg_shiftn N (einfs u)); exact: is_cvg_einfs.
Qed.
Lemma limn_einf_shiftSSource code uSource code : limn_einf (fun nSource code => u n.+1) = limn_einf u.
Proof.
Lemma limn_einf_cstSource code (cSource code : \bar R) : limn_einf (cst c) = c.
Proof.
End lim_esup_inf.
#[deprecated(since="mathcomp-analysis 1.19.0", note="renamed to `limn_einf_addl`")]
Notation limn_einf_shiftSource code := limn_einf_addl (only parsing).
Lemma geometric_le_limUsed by
- mathcomp.analysis.numfun
Source code {RSource code : realType} (nSource code : nat) (aSource code xSource code : R) :
0 <= a -> 0 < x -> `|x| < 1 -> series (geometric a x) n <= a * (1 - x)^-1.
Proof.
have /(@cvg_unique _ (@Rhausdorff R)) := @cvg_geometric_series _ a _ x1.
move/(_ _ (@is_cvg_geometric_series _ a _ x1)) => ->.
apply: nondecreasing_cvgn_le; last exact: is_cvg_geometric_series.
by apply: nondecreasing_series => ? _ /=; rewrite pmulr_lge0 // exprn_gt0.
Qed.
Lemma cluster_eventuallyPSource code {RSource code : realFieldType} (u_Source code : R^nat) (aSource code : R) :
cluster (u_ @ \oo) a <->
forall (eSource code : R) nSource code, e > 0 -> exists2 pSource code, (p >= n)%N & `|a - u_ p| <= e.
Proof.
- apply/not_exists2P => nuae.
have yuAe : nbhs \oo (u_ @^-1` [set xSource code | `|a - x| > e]).
exists n => // m/= nm; have := nuae m.
by rewrite nm/= => -[//|/negP]; rewrite -ltNge.
have [/= r []] := uya _ _ yuAe (nbhsx_ballx a _ e0).
by rewrite /ball/= => /ltW; rewrite leNgt => /negbTE ->.
- have e20 : 0 < e / 2 by rewrite divr_gt0.
have [p np upae] := u_a _ n e20.
exists (u_ p); split; first exact: nuA.
apply: aeB => /=.
by rewrite (le_lt_trans upae)// gtr_pMr// invf_lt1// ltr1n.
Qed.
Section cluster_eventually_cvg.
Context {RSource code : realType}.
Variables (u_Source code : R^nat) (aSource code : R).
Let ASource code NSource code kSource code := [set jSource code | (j > N)%N /\ `|a - u_ j| <= k.+1%:R^-1].
Let elt_propSource code NkSource code :=
[/\ `|a - u_ Nk.1| <= Nk.2%:R^-1, A Nk.1 Nk.2 !=set0 & (0 < Nk.2)%N].
Let elt_typeSource code := {xSource code : nat * nat | elt_prop x}.
Let N_Source code (xSource code : elt_type) := (proj1_sig x).1.
Let idx_Source code (xSource code : elt_type) := (proj1_sig x).2.
Let N_idxSource code xSource code : `|a - u_ (N_ x)| <= (idx_ x)%:R^-1.
Proof.
Let A_nonemptySource code xSource code : A (N_ x) (idx_ x) !=set0.
Proof.
Let elt_relSource code iSource code jSource code := [/\ idx_ j = (idx_ i).+1,
(N_ j > N_ i)%N & N_ j = proj1_sig (cid (nat_has_minimum (A_nonempty i)))].
Let N_incrSource code vSource code kSource code pSource code : (forall nSource code, elt_rel (v n) (v n.+1)) ->
(k < p)%N -> (N_ (v k) < N_ (v p))%N.
Proof.
Let idx_incrSource code vSource code nSource code : (forall nSource code, elt_rel (v n) (v n.+1)) -> (n <= idx_ (v n))%N.
Proof.
Let cluster_eventually_cvg_directSource code : cluster (u_ @ \oo) a ->
exists2 fSource code : nat -> nat, increasing_seq f & u_ \o f @ \oo --> a.
Proof.
have [N0 N01] : {N0Source code | `| a - u_ N0 | <= 1^-1}.
by move: u_a => /(_ 1 1 ltr01)/cid2[N1 _] N1a1; exists N1; rewrite invr1.
have A0 : A N0 1 !=set0.
move: u_a => /(_ 2^-1 N0.+1).
by rewrite invr_gt0// ltr0n => /(_ isT)[j N0j j1]; exists j.
have [v [v0 vrel]] : {vSource code : nat -> elt_type |
v 0 = exist elt_prop (N0, 1) (And3 N01 A0 isT) /\
forall nSource code, elt_rel (v n) (v n.+1) }.
apply: dependent_choice => // -[[N i] /=] [uNi ANi0 i0].
pose M := proj1_sig (cid (nat_has_minimum ANi0)).
have Mi1 : `|a - u_ M| <= i.+1%:R^-1 by rewrite /M; case: cid => /= x [[]].
have AMi1 : A M i.+1 !=set0.
move: u_a => /(_ i.+2%:R^-1 M.+1).
by rewrite invr_gt0// ltr0n => /(_ isT)/cid2[m nm um]; exists m.
exists (exist elt_prop (M, i.+1) (And3 Mi1 AMi1 isT)).
rewrite /elt_rel/= /N_/=; split; first exact.
- by rewrite /M; case: cid => // x [[]].
- rewrite /M; case: cid => // x [/= ANix ANi].
case: cid => //= y [/ANi xy] /(_ _ ANix) yx.
by apply/eqP; rewrite eq_le leEnat xy yx.
exists (N_ \o v \o S).
by apply/increasing_seqP => n; exact: N_incr.
apply/subr_cvg0/cvgrPdist_le => /= e e0; near=> n.
rewrite sub0r normrN distrC (le_trans (N_idx (v n.+1)))//.
rewrite invf_ple ?posrE//; first by rewrite ltr0n; case: (v n.+1) => -[? ?] [].
rewrite (@le_trans _ _ n.+1%:R)//; last by rewrite ler_nat idx_incr.
by rewrite -nat1r -lerBlDl; near: n; exact: nbhs_infty_ger.
Unshelve. all: end_near. Qed.
Lemma cluster_eventually_cvgSource code : cluster (u_ @ \oo) a <->
exists2 fSource code : nat -> nat, increasing_seq f & (u_ \o f @ \oo --> a).
Proof.
apply/cluster_eventuallyP => e n e0; move: auf.
move=> /(_ _ e0)[N _ {}Nauf].
exists (f (n + N)); last by rewrite Nauf//= leq_addl.
rewrite (@leq_trans (f n))//.
elim: n => // n; rewrite -ltnS => /leq_trans; apply.
by move/increasing_seqP : incrf; exact.
by rewrite -leEnat incrf leq_addr.
Qed.
Lemma limit_point_cluster_eventuallySource code :
limit_point (range u_) a -> cluster (u_ @ \oo) a.
Proof.
pose V iSource code := [set u_ k | kSource code in `I_i].
have finV i : finite_set (V i) by exact/finite_image/finite_II.
(* we pick up elements u_N_k from the following set: *)
pose aU kSource code := `]a - k.+1%:R^-1, a + k.+1%:R^-1[ `&` ((U `\` V k) `\ a).
move=> u_a.
have aU0 k : aU k !=set0.
have /(limit_pointP _ _).1 [a_ [au a_a]] := limit_point_setD (finV k) u_a.
move/cvgrPdist_lt => /(_ k.+1%:R^-1).
rewrite invr_gt0 ltr0n => /(_ isT)[N _ a_cvg].
exists (a_ N); split; first by rewrite /= in_itv/= -ltr_distlC a_cvg/=.
split; last exact/eqP.
split; first by have /au[] := imageT a_ N.
by case => x xk uxaN; have /au[_] := imageT a_ N; apply => /=; exists x.
have idx_aU k : exists N1Source code, u_ N1 \in aU k.
have [/= y [/= a1y [[[m _ umy] Uny] ya]]] := aU0 k.
exists m; rewrite inE /aU umy; split => //=; split => //; split => //.
by exists m.
have [N0 N01] : {N0Source code | `| a - u_ N0 | <= 1^-1}.
apply/cid; have [a_ [au a_a]] := (limit_pointP _ _).1 u_a.
move/cvgrPdist_le => /(_ _ ltr01)[N _] /(_ _ (leqnn N)) aaN1.
have /au[x _ uxaN] := imageT a_ N.
by exists x; rewrite uxaN invr1.
have A0 : A N0 1 !=set0.
have [N1] := idx_aU N0.+1.
rewrite inE => -[/= uN1 [[[x _ uxuN1] /= VN0N1] uN1_a]].
exists x; split.
by rewrite ltnNge; apply/negP => xN0; apply: VN0N1; exists x.
move: uN1; rewrite in_itv/= -ltr_distlC uxuN1 distrC => /ltW/le_trans; apply.
by rewrite lef_pV2 ?posrE// ler_nat.
have [v [v0 vrel]] : {vSource code : nat -> elt_type |
v 0%N = exist elt_prop (N0, 1) (And3 N01 A0 isT) /\
forall nSource code, elt_rel (v n) (v n.+1) }.
apply: dependent_choice => // -[[N i] /=] [uNi ANi0 i0].
pose M := proj1_sig (cid (nat_has_minimum ANi0)).
have M0 : (0 < M)%N.
by rewrite /M; case: cid => //= x [[+ _] _]; exact: leq_trans.
have Mi1 : `|a - u_ M| <= i.+1%:R^-1 by rewrite /M; case: cid => /= x [[]].
have AMi1 : A M i.+1 !=set0.
have [N1] := idx_aU (maxn i.+1 M.+1).
rewrite inE => -[/= uN1 [[[x _ uxuN2] /= Vi1M1] uN1_a]].
have Mx : (M < x)%N.
rewrite ltnNge; apply/negP => xM.
by apply: Vi1M1; exists x => //; rewrite /(`I_ _) leq_max !ltnS xM orbT.
exists x; split => //.
move: uN1; rewrite in_itv -ltr_distlC uxuN2 distrC => /ltW/le_trans; apply.
by rewrite lef_pV2 ?posrE// ler_nat ltnS leq_max ltnSn.
exists (exist elt_prop (M, i.+1) (And3 Mi1 AMi1 isT)).
rewrite /elt_rel/= /N_/=; split; first exact.
- by rewrite /M; case: cid => // x [[]].
- rewrite /M; case: cid => // x [ANix ANi]/=.
case: cid => //= y; rewrite /idx_/= => -[/ANi xy /(_ _ ANix) yx].
by apply/eqP; rewrite eq_le leEnat xy yx.
apply/cluster_eventually_cvg; exists (N_ \o v).
by apply/increasing_seqP => n; exact: N_incr.
apply/cvgrPdist_le => /= e e0; near=> n.
have := N_idx (v n); rewrite distrC => /le_trans; apply.
rewrite invf_ple//.
by rewrite posrE ltr0n; case: (v n) => [[? ?] []].
rewrite (@le_trans _ _ n%:R)//; last by rewrite ler_nat idx_incr.
by near: n; exact: nbhs_infty_ger.
Unshelve. all: end_near. Qed.
End cluster_eventually_cvg.
Section adjacent_cut.
Context {RSource code : realType}.
Implicit Types L D E : set R.
Definition adjacent_set
adjacent_set : forall {R : realType}, set (join_Num_POrderNmodule_between_Algebra_BaseAddMagma_and_Order_Preorder (join_Num_POrderZmodule_between_Algebra_BaseZmodule_and_Num_POrderNmodule R)) -> set (join_Num_POrderNmodule_between_Algebra_BaseAddMagma_and_Order_Preorder (join_Num_POrderZmodule_between_Algebra_BaseZmodule_and_Num_POrderNmodule R)) -> Prop adjacent_set is not universe polymorphic Arguments adjacent_set {R} (A B)%_classical_set_scope adjacent_set is transparent Expands to: Constant mathcomp.analysis.sequences.adjacent_set Declared in library mathcomp.analysis.sequences, line 2902, characters 11-23
Source code ASource code BSource code :=
[/\ A !=set0, B !=set0, (forall xSource code ySource code, A x -> B y -> x <= y) &
forall eSource code : {posnum R}, exists2 xySource code, xy \in A `*` B & xy.2 - xy.1 < e%:num].
Lemma adjacent_sup_infSource code ASource code BSource code : adjacent_set A B -> sup A = inf B.
Proof.
by apply: ge_sup => // x Ax; apply: lb_le_inf => // y By; exact: AB_le.
apply/ler_addgt0Pl => _ /posnumP[e]; rewrite -lerBlDr.
have [[x y]/=] := AB_eps e.
rewrite !inE => -[/= Ax By] /ltW yxe.
rewrite (le_trans _ yxe)// lerB//.
- by rewrite ge_inf//; exists x => // z; exact: AB_le.
- by rewrite ub_le_sup//; exists y => // z Az; exact: AB_le.
Qed.
Lemma adjacent_sup_inf_uniqueSource code ASource code BSource code MSource code : adjacent_set A B ->
ubound A M -> lbound B M -> M = sup A.
Proof.
Definition cut
cut : forall {R : realType}, set R -> set R -> Prop cut is not universe polymorphic Arguments cut {R} (L B)%_classical_set_scope cut is transparent Expands to: Constant mathcomp.analysis.sequences.cut Declared in library mathcomp.analysis.sequences, line 2926, characters 11-14
Source code LSource code BSource code := [/\ L !=set0, B !=set0,
(forall xSource code ySource code, L x -> B y -> x < y) & L `|` B = [set: R] ].
Lemma cut_adjacentSource code ASource code BSource code : cut A B -> adjacent_set A B.
Proof.
move: A0 B0 => [a aA] [b bB] e.
have ba0 : b - a > 0 by rewrite subr_gt0 ABlt.
have [N N0 baNe] : exists2 NSource code, N != 0 & (b - a) / N%:R < e%:num.
exists (truncn ((b - a) / e%:num)).+1 => //.
by rewrite ltr_pdivrMr// mulrC -ltr_pdivrMr// truncnS_gt.
pose a_ iSource code := a + i%:R * (b - a) / N%:R.
pose k : nat := [arg min_(iSource code < @ord_max N | a_ i \in B) i].
have ? : a_ (@ord_max N) \in B.
by rewrite /a_ /= mulrAC divff ?pnatr_eq0// mul1r subrKC; exact/mem_set.
have k_gt0 : (0 < k)%N.
rewrite /k; case: arg_minnP => // /= i + aBi.
contra; rewrite leqn0 => /eqP ->.
rewrite /a_ !mul0r addr0; apply/negP => /set_mem/(ABlt _ _ aA).
by rewrite ltxx.
have akN1A : a_ k.-1 \in A.
rewrite /k; case: arg_minnP => // /= i aiB aBi.
have i0 : i != ord0.
contra: aiB => ->.
rewrite /a_ !mul0r addr0; apply/negP => /set_mem/(ABlt _ _ aA).
by rewrite ltxx.
apply/mem_set/not_notP => abs.
have {}abs : a_ i.-1 \in B.
by move/seteqP : ABT => [_ /(_ (a_ i.-1) Logic.I)] [//|/mem_set].
have iN : (i.-1 < N.+1)%N by rewrite prednK ?lt0n// ltnW.
have := aBi (Ordinal iN) abs.
apply/negP; rewrite -ltnNge/=.
by case: i => -[//|? ?] in i0 iN abs aiB aBi *.
have akB : a_ k \in B by rewrite /k; case: arg_minnP => // /= i aiB aBi.
exists (a_ k.-1, a_ k); first by rewrite !inE; split => //=; exact/set_mem.
rewrite /a_ opprD addrACA subrr add0r -!mulrA -!mulrBl.
by rewrite -natrB ?leq_pred// -subn1 subKn// mul1r.
Qed.
Lemma infinite_bounded_limit_point_nonemptySource code ESource code :
infinite_set E -> bounded_set E -> limit_point E !=set0.
Proof.
have E0 : E !=set0.
apply/set0P/negP => /eqP E0.
by move: infiniteE; rewrite E0; apply; exact: finite_set0.
have ? : ProperFilter (globally E).
by case: E0 => x Ex; exact: globally_properfilter Ex.
pose A := [set xSource code | infinite_set (`[x, +oo[ `&` E)].
have A0 : A !=set0.
move/ex_bound : boundedE => [M EM]; exists (- M).
rewrite /A /= setIidr// => x Ex /=.
by rewrite in_itv/= andbT lerNnormlW// EM.
pose B := ~` A.
have B0 : B !=set0.
move/ex_bound : boundedE => [M EM]; exists (M + 1).
rewrite /B /A /= (_ : _ `&` _ = set0)// -subset0 => x []/=.
rewrite in_itv/= andbT => /[swap] /EM/= /ler_normlW xM.
by move/le_trans => /(_ _ xM); rewrite leNgt ltrDl ltr01.
have Ale_closed x y : A x -> y <= x -> A y.
rewrite /A /= => xE yx.
rewrite (@itv_bndbnd_setU _ _ _ (BLeft x))//.
by apply: contra_not xE; rewrite setIUl finite_setU => -[].
have ABlt x y : A x -> B y -> x < y.
by move=> Ax By; rewrite ltNge; apply/negP => /(Ale_closed _ _ Ax).
have AB : cut A B by split => //; rewrite /B setUv.
pose l := sup A. (* the real number defined by the cut (A, B) *)
have infleE (eSource code : R) (e0Source code : e > 0) :infinite_set (`]l - e, +oo[ `&` E).
suff : A (l - e).
have /infinite_setD/[apply] := finite_set1 (l - e).
by rewrite setIC -setIDA setDitv1l setIC.
have : has_sup A.
by split => //; case: B0 => d dB; exists d => z Az; exact/ltW/ABlt.
move/(sup_adherent e0) => [r Ar].
by rewrite -/l => /ltW ler; exact: (Ale_closed _ _ Ar).
have finleE (eSource code : R) (e0Source code : e > 0) : finite_set (`[l + e, +oo[ `&` E).
suff : B (l + e) by rewrite /B/= /A/= => /contrapT.
have : has_inf B.
by split => //; case: A0 => g gA; exists g => z Bz; exact/ltW/ABlt.
move/(inf_adherent e0) => [r Br].
rewrite -(adjacent_sup_inf (cut_adjacent AB)) -/l => /ltW rle Ale.
have /ABlt := Ale_closed _ _ Ale rle.
by move/(_ _ Br); rewrite ltxx.
exists l; apply/limit_point_infinite_setP => /= U.
rewrite /nbhs/= /nbhs_ball_/= => -[e /= e0].
rewrite -[ball_ _ _ _]/(ball _ _) => leU.
have : infinite_set (`]l - e, l + e[ `&` E).
rewrite (_ : _ `&` _ =
`]l - e, +oo[ `&` E `\` `[l + e, +oo[ `&` E).
rewrite setDE setCI setIUr -(setIA _ _ (~` E)) setICr setI0 setU0.
by rewrite setIAC -setDE [in LHS]set_itv_splitD.
by apply: infinite_setD; [exact: infleE|exact: finleE].
apply/contra_not/sub_finite_set; apply: setSI.
by move: leU; rewrite ball_itv.
Qed.
End adjacent_cut.
Section finite_range_sequence_constant.
Lemma finite_range_cst_subsequenceSource code {TSource code} (u_Source code : T^nat) : finite_set (range u_) ->
exists xSource code, exists2 ASource code, infinite_set A & (forall kSource code, A k <-> u_ k = x).
Proof.
suff [x Aoo] : exists xSource code, infinite_set (A x) by exists x, (A x) => // k.
apply/existsNP => Afin.
have: finite_set (\bigcup_(xSource code in range u_) A x) by exact: bigcup_finite.
rewrite -preimage_bigcup bigcup_imset1 image_id preimage_range.
exact: infinite_nat.
Qed.
Lemma infinite_increasing_seqSource code {dSource code} {TSource code : porderType d} (ASource code : set T) :
(forall xSource code, infinite_set [set ySource code | A y /\ (x < y)%O]) ->
forall x0Source code : T, exists fSource code : nat -> T,
[/\ increasing_seq f, forall nSource code : nat, (x0 < f n)%O & forall nSource code, A (f n)].
Proof.
have [x|f [f0 /all_and2[fA fS]]] := @dependent_choice T R _ x0.
by have /infinite_setN0/cid := Roo x.
exists (f \o S); split => //=; first by apply/increasing_seqP => n; apply: fS.
by elim=> /= [|n IHn]; rewrite (le_lt_trans _ (fS _)) ?f0//= ltW.
Qed.
Lemma infinite_increasing_seq_wfSource code {dSource code} {TSource code : orderType d} (ASource code : set T) :
(forall xSource code : T, finite_set [set ySource code | (y <= x)%O]) -> infinite_set A ->
forall x0Source code : T, exists fSource code : nat -> T,
[/\ increasing_seq f, forall nSource code, (x0 < f n)%O & forall nSource code, A (f n)].
Proof.
apply: infinite_setIl => //.
by apply: sub_finite_set (Dfin x) => y /=; case: leP.
Qed.
Lemma finite_range_cvg_subsequenceSource code {TSource code : ptopologicalType} (x_Source code : T ^nat) :
finite_set (range x_) ->
exists2 fSource code : nat -> nat, increasing_seq f & cvgn (x_ \o f).
Proof.
have /= [|f [fincr _ Af]] := infinite_increasing_seq_wf _ Aoo 0.
by move=> n; apply: sub_finite_set (finite_II n.+1) => m /=.
exists f => //=; suff -> : x_ \o f = fun=> x by [].
by apply/funext => k /=; rewrite (Ax_ _).1.
Qed.
End finite_range_sequence_constant.
Theorem bolzano_weierstrassSource code {RSource code : realType} (u_Source code : R^nat):
bounded_fun u_ -> exists2 fSource code : nat -> nat, increasing_seq f & cvgn (u_ \o f).
Proof.
have bndU : bounded_set U.
case: bnd_u => N [Nreal Nu_].
by exists N; split => // x /Nu_ {}Nu_ /= y [x0 _ <-]; exact: Nu_.
have [/finite_range_cvg_subsequence//|infU] := pselect (finite_set U).
have [/= l Ul] := infinite_bounded_limit_point_nonempty infU bndU.
have x_l := limit_point_cluster_eventually Ul.
have [+ _] := cluster_eventually_cvg u_ l.
by move=> /(_ x_l)[f fi fl]; exists f => //; apply/cvg_ex; exists l.
Qed.
Section banach_contraction.
Context {RSource code : realType} {XSource code : completeNormedModType R} (USource code : set X).
Variables (fSource code : {fun U >-> U}).
Section contractions.
Variables (qSource code : {nonneg R}) (ctrfSource code : contraction q f) (baseSource code : X) (UbaseSource code : U base).
Let CSource code := `|f base - base| / (1 - q%:num).
Let ySource code := fun nSource code => iter n f base.
Let q1Source code := ctrf.1.
Let ctrfqSource code := ctrf.2.
Let C_ge0Source code : 0 <= C.
Lemma contraction_distSource code nSource code mSource code : `|y n - y (n + m)| <= C * q%:num ^+ n.
Proof.
elim: k => [|k /(ler_wpM2l (ge0 q))]; first by rewrite expr0 mul1r.
rewrite mulrA -exprS; apply: le_trans.
by rewrite (@ctrfq (y k.+1, y k)); split; exact: funS.
have /le_trans -> // : `| y n - y (n + m)| <=
series (geometric (`|f base - base| * q%:num ^+ n) q%:num) m.
elim: m => [|m ih].
by rewrite geometric_seriesE ?lt_eqF//= addn0 subrr normr0 subrr mulr0 mul0r.
rewrite (le_trans (ler_distD (y (n + m)%N) _ _))//.
apply: (le_trans (lerD ih _)); first by rewrite distrC addnS; exact: f1.
rewrite [_ * `|_|]mulrC exprD mulrA geometric_seriesE ?lt_eqF//=.
pose q' := Itv01 [elaborate ge0 q] (ltW q1).
rewrite -[q%:num]/(q'%:num) -!mulrA -mulrDr ler_pM// {}/q'/=.
rewrite -!/(_.~) -mulrDr exprSr onemM -addrA.
rewrite -[in leRHS](mulrC _ (_ ^+ m).~) -onemMr onemK.
by rewrite [in leRHS]mulrDl mulrAC mulfV ?mul1r// gt_eqF// onem_gt0.
rewrite geometric_seriesE ?lt_eqF//= -[leRHS]mulr1 (ACl (1*4*2*3))/= -/C.
by rewrite ler_wpM2l// 1?mulr_ge0// lerBlDr lerDl.
Qed.
Lemma contraction_cvgSource code : cvgn y.
Proof.
have lt_min n m : `|y n - y m| <= C * q%:num ^+ minn n m.
wlog : n m / (n <= m)%N => W.
by case/orP: (leq_total n m) => /W //; rewrite distrC minnC.
by rewrite (minn_idPl _)// (le_trans _ (contraction_dist _ (m - n)))// subnKC.
case: ltrgt0P C_ge0 => // [Cpos|C0] _; last first.
near=> n m => /=; rewrite -ball_normE.
by apply: (le_lt_trans (lt_min _ _)); rewrite C0 mul0r.
near=> n; rewrite -ball_normE /= (le_lt_trans (lt_min n.1 n.2)) //.
rewrite // -ltr_pdivlMl //.
suff : ball 0 (C^-1 * e%:num) (q%:num ^+ minn n.1 n.2).
by rewrite /ball /= sub0r normrN ger0_norm.
near: n; rewrite nbhs_simpl.
pose g := fun wSource code : nat * nat => q%:num ^+ minn w.1 w.2.
have := @fcvg_ball _ _ (g @ filter_prod \oo \oo) _ 0 _ (C^-1 * e%:num).
move: (@cvg_geometric _ 1 q%:num); rewrite ger0_norm // => /(_ q1) geo.
near_simpl; apply; last by rewrite mulr_gt0 // invr_gt0.
apply/cvg_ballP => _/posnumP[delta]; near_simpl.
have [N _ Q] : \forall NSource code \near \oo, ball 0 delta%:num (geometric 1 q%:num N).
exact: (@fcvg_ball R R _ _ 0 geo).
exists ([set nSource code | N <= n], [set nSource code | N <= n])%N; first by split; exists N.
move=> [n m] [Nn Nm]; rewrite /ball /= sub0r normrN ger0_norm /g //.
apply: le_lt_trans; last by apply: (Q N) => /=.
rewrite sub0r normrN ger0_norm /geometric //= mul1r.
by rewrite ler_wiXn2l // ?ltW // leq_min Nn.
Unshelve. all: end_near. Qed.
Lemma contraction_cvg_fixedSource code : closed U -> limn y = f (limn y).
Proof.
apply/cvgrPdist_lt => _/posnumP[e]; near_simpl; apply: near_inftyS.
have [q_gt0 | | q0] := ltrgt0P q%:num.
- near=> n => /=; apply: (le_lt_trans (@ctrfq (_, _) _)) => //=.
+ split; last exact: funS.
by apply: closed_cvg contraction_cvg => //; apply: nearW => ?; exact: funS.
+ rewrite -ltr_pdivlMl //; near: n; move/cvgrPdist_lt: contraction_cvg.
by apply; rewrite mulr_gt0 // invr_gt0.
- by rewrite ltNge//; exact: contraNP.
- apply: nearW => /= n; apply: (le_lt_trans (@ctrfq (_, _) _)).
+ split; last exact: funS.
by apply: closed_cvg contraction_cvg => //; apply: nearW => ?; exact: funS.
+ by rewrite q0 mul0r.
Unshelve. all: end_near. Qed.
End contractions.
Variable ctrfSource code : is_contraction f.
Theorem banach_fixed_pointSource code : closed U -> U !=set0 -> exists2 pSource code, U p & p = f p.
Proof.
apply: closed_cvg (contraction_cvg ctrq Ubase) => //.
by apply: nearW => ?; exact: funS.
exact: (contraction_cvg_fixed ctrq).
Unshelve. all: end_near. Qed.
End banach_contraction.
Section Baire.
Variable KSource code : realType.
Theorem BaireUsed by
- mathcomp.analysis.borel_hierarchy
Source code (USource code : completeNormedModType K) (FSource code : (set U)^nat) :
(forall iSource code, open (F i) /\ dense (F i)) -> dense (\bigcap_iSource code (F i)).
Proof.
have /(_ D Dy OpenD)[a0 DF0a0] : dense (F 0%N) := proj2 (odF 0%N).
have {OpenD Dy} openIDF0 : open (D `&` F 0%N).
by apply: openI => //; exact: (proj1 (odF 0%N)).
have /open_nbhs_nbhs/nbhs_closedballP[r0 Ball_a0] : open_nbhs a0 (D `&` F 0%N).
by [].
pose P (mSource code : nat) (arnSource code : U * {posnum K}) (armSource code : U * {posnum K}) :=
closed_ball arm.1 (arm.2%:num) `<=` (closed_ball arn.1 arn.2%:num)° `&` F m
/\ arm.2%:num < m.+1%:R^-1.
have Ar : forall naSource code : nat * (U * {posnum K}), exists bSource code : U * {posnum K},
P na.1.+1 na.2 b.
move=> [n [an rn]].
have [ openFn denseFn] := odF n.+1.
have [an1 B0Fn2an1] : exists xSource code, ((closed_ball an rn%:num)° `&` F n.+1) x.
have [//|? ?] := @open_nbhs_closed_ball _ _ an rn%:num.
by apply: denseFn => //; exists an.
have openIB0Fn1 : open ((closed_ball an rn%:num)° `&` F n.+1).
by apply/openI => //; exact/open_interior.
have /open_nbhs_nbhs/nbhs_closedballP[rn01 Ball_an1] :
open_nbhs an1 ((closed_ball an rn%:num)° `&` F n.+1) by [].
have n31_gt0 : n.+3%:R^-1 > 0 :> K by [].
have majr : minr (PosNum n31_gt0)%:num rn01%:num > 0 by [].
exists (an1, PosNum majr); split.
apply/(subset_trans _ Ball_an1)/le_closed_ball => /=.
by rewrite ge_min lexx orbT.
rewrite (@le_lt_trans _ _ n.+3%:R^-1) //= ?ge_min ?lexx//.
by rewrite ltf_pV2 // ?ltr_nat// posrE.
have [f Pf] := choice Ar.
pose fix ar nSource code := if n is p.+1 then (f (p, ar p)) else (a0, r0).
pose a := fun nSource code => (ar n).1.
pose r := fun nSource code => (ar n).2.
have Suite_ball n m : (n <= m)%N ->
closed_ball (a m) (r m)%:num `<=` closed_ball (a n) (r n)%:num.
elim m=> [|k iHk]; first by rewrite leqn0 => /eqP ->.
rewrite leq_eqVlt => /orP[/eqP -> //|/iHk]; apply: subset_trans.
have [+ _] : P k.+1 (a k, r k) (a k.+1, r k.+1) by apply: (Pf (k, ar k)).
rewrite subsetI => -[+ _].
by move/subset_trans; apply => //; exact: interior_subset.
have : cvg (a @ \oo).
suff : cauchy (a @ \oo) by exact: cauchy_cvg.
suff : cauchy_ex (a @ \oo) by exact: cauchy_exP.
move=> e e0; rewrite /fmapE -ball_normE /ball_.
have [n rne] : exists nSource code, 2 * (r n)%:num < e.
pose eps := e / 2.
have [n n1e] : exists nSource code, n.+1%:R^-1 < eps.
exists (truncn eps^-1).
by rewrite -ltf_pV2 ?(posrE,divr_gt0)// invrK truncnS_gt.
exists n.+1; rewrite -ltr_pdivlMl //.
have /lt_trans : (r n.+1)%:num < n.+1%:R^-1.
have [_ ] : P n.+1 (a n, r n) (a n.+1, r n.+1) by apply: (Pf (n, ar n)).
by move/lt_le_trans => -> //; rewrite lef_pV2// // ?posrE// ler_nat.
by apply; rewrite mulrC.
exists (a n), n => // m nsupm.
apply: (@lt_trans _ _ (2 * (r n)%:num) (`|a n - a m|) e) => //.
have : (closed_ball (a n) (r n)%:num) (a m).
have /(_ (a m)) := Suite_ball n m nsupm.
by apply; exact: closed_ballxx.
rewrite closed_ballE /closed_ball_ //= => /le_lt_trans; apply.
by rewrite -?ltr_pdivrMr ?mulfV ?ltr1n.
rewrite cvg_ex //= => -[l Hl]; exists l; split.
- have Hinter : (closed_ball a0 r0%:num) l.
apply: (@closed_cvg _ _ \oo eventually_filter a) => //.
+ exact: closed_ball_closed.
+ apply: nearW; move=> m; have /(_ (a m)) := @Suite_ball 0%N _ (leq0n m).
by apply; exact: closed_ballxx.
suff : closed_ball a0 r0%:num `<=` D by move/(_ _ Hinter).
by move: Ball_a0; rewrite closed_ballE //= subsetI; apply: proj1.
- move=> i _.
have : closed_ball (a i) (r i)%:num l.
rewrite -(@cvg_shiftn i _ a _) /= in Hl.
apply: (@closed_cvg _ _ \oo eventually_filter (fun nSource code => a (n + i)%N)) => //=.
+ exact: closed_ball_closed.
+ by apply: nearW; move=> n; exact/(Suite_ball _ _ (leq_addl n i))/closed_ballxx.
move: i => [|n].
by move: Ball_a0; rewrite subsetI => -[_ p] la0; move: (p _ la0).
have [+ _] : P n.+1 (a n, r n) (a n.+1, r n.+1) by apply : (Pf (n , ar n)).
by rewrite subsetI => -[_ p] lan1; move: (p l lan1).
Unshelve. all: by end_near. Qed.
End Baire.
Definition bounded_fun_norm
bounded_fun_norm : forall [K : realType] [V W : normedModType K], (V -> W) -> Prop bounded_fun_norm is not universe polymorphic Arguments bounded_fun_norm [K V W] f%_function_scope bounded_fun_norm is transparent Expands to: Constant mathcomp.analysis.sequences.bounded_fun_norm Declared in library mathcomp.analysis.sequences, line 3271, characters 11-27
Source code (KSource code : realType) (VSource code : normedModType K)
(WSource code : normedModType K) (fSource code : V -> W) :=
forall rSource code, exists MSource code, forall xSource code, `|x| <= r -> `|f x| <= M.
Lemma bounded_landauSource code (KSource code : realType) (VSource code : normedModType K)
(WSource code : normedModType K) (fSource code : {linear V -> W}) :
bounded_fun_norm f <-> ((f : V -> W) =O_ (0 : V) cst (1:K)).
Proof.
- move=> /(_ 1)[M bm].
rewrite !nearE /=; exists M; rewrite num_real; split => // x Mx.
apply/nbhs_normP; exists 1 => //= y /=.
rewrite sub0r normrN/= normr1 mulr1 => y1.
by apply/ltW; rewrite (le_lt_trans _ Mx)// bm// ltW.
- apply/bounded_funP; rewrite /bounded_near.
near=> M.
rewrite (_ : mkset _ = (fun xSource code => `|f x| <= M * `|cst 1 x|)).
by rewrite funeqE => x; rewrite normr1 mulr1.
by near: M.
Unshelve. all: by end_near. Qed.
Definition pointwise_bounded
pointwise_bounded : forall [K : realType] [V W : normedModType K], set (V -> W) -> Prop pointwise_bounded is not universe polymorphic Arguments pointwise_bounded [K V W] F%_classical_set_scope pointwise_bounded is transparent Expands to: Constant mathcomp.analysis.sequences.pointwise_bounded Declared in library mathcomp.analysis.sequences, line 3304, characters 11-28
Source code (KSource code : realType) (VSource code : normedModType K) (WSource code : normedModType K)
(FSource code : set (V -> W)) := forall xSource code, exists MSource code, forall fSource code, F f -> `|f x| <= M.
Definition uniform_bounded
uniform_bounded : forall [K : realType] [V W : normedModType K], set (V -> W) -> Prop uniform_bounded is not universe polymorphic Arguments uniform_bounded [K V W] F%_classical_set_scope uniform_bounded is transparent Expands to: Constant mathcomp.analysis.sequences.uniform_bounded Declared in library mathcomp.analysis.sequences, line 3307, characters 11-26
Source code (KSource code : realType) (VSource code : normedModType K) (WSource code : normedModType K)
(FSource code : set (V -> W)) := forall rSource code, exists MSource code, forall fSource code, F f -> forall xSource code, `|x| <= r -> `|f x| <= M.
Section banach_steinhaus.
Variables (KSource code : realType) (VSource code : completeNormedModType K) (WSource code : normedModType K).
Let pack_linearSource code (fSource code : V -> W) (lfSource code : linear f) : {linear V -> W}
:= HB.pack f (GRing.isLinear.Build _ _ _ _ _ lf).
Theorem Banach_SteinhaussSource code (FSource code : set (V -> W)):
(forall fSource code, F f -> bounded_fun_norm f /\ linear f) ->
pointwise_bounded F -> uniform_bounded F.
Proof.
set O := fun nSource code => \bigcup_(fSource code in F) (normr \o f)@^-1` [set ySource code | y > n%:R].
have O_open : forall nSource code, open ( O n ).
move=> n; apply: bigcup_open => i Fi.
apply: (@open_comp _ _ (normr \o i) [set ySource code | y > n%:R]); last first.
exact: open_gt.
move=> x Hx; apply: continuous_comp; last exact: norm_continuous.
have Li : linear i := proj2 (Propf _ Fi).
apply: (@linear_continuous K V W (pack_linear Li)) => /=.
exact/(proj1 (bounded_landau (pack_linear Li)))/(proj1 (Propf _ Fi)).
set O_inf := \bigcap_iSource code (O i).
have O_infempty : O_inf = set0.
rewrite -subset0 => x.
have [M FxM] := BoundedF x; rewrite /O_inf /O /=.
move=> /(_ (truncn M).+1 Logic.I)[f Ff]; apply/negP; rewrite -leNgt.
by apply/ltW; rewrite -truncn_le_nat le_truncn ?FxM.
have ContraBaire : exists iSource code, not (dense (O i)).
have dOinf : ~ dense O_inf.
rewrite /dense O_infempty ; apply /existsNP; exists setT; elim.
- by move=> x; rewrite setI0.
- by exists point.
- exact: openT.
have /contra_not/(_ dOinf) :
(forall iSource code, open (O i) /\ dense (O i)) -> dense (O_inf).
exact: Baire.
move=> /asboolPn /existsp_asboolPn[n /and_asboolP /nandP Hn].
by exists n; case: Hn => /asboolPn.
have [n [x0 [r H]] k] :
exists nSource code xSource code (rSource code : {posnum K}), (ball x r%:num) `<=` (~` (O n)).
move: ContraBaire =>
[i /(denseNE) [ O0 [ [ x /open_nbhs_nbhs /nbhs_ballP [r r0 bxr]
/((@subsetI_eq0 _ (ball x r) O0 (O i) (O i)))]]]] /(_ bxr) bxrOi.
by exists i, x, (PosNum r0); apply/disjoints_subset/bxrOi.
exists ((n + n)%:R * k * 2 / r%:num)=> f Ff y Hx; move: (Propf f Ff) => [ _ linf].
have [->|Zeroy] := eqVneq y 0.
move: (linear0 (pack_linear linf)) => /= ->.
by rewrite normr0 !mulr_ge0 // (le_trans _ Hx).
have majballi g x : F g -> (ball x0 r%:num) x -> `|g x| <= n%:R.
move=> Fg /(H x); rewrite leNgt.
by rewrite /O setC_bigcup /= => /(_ _ Fg)/negP.
have majball g x : F g -> (ball x0 r%:num) x -> `|g (x - x0)| <= n%:R + n%:R.
move=> Fg; have [Bg Lg] := Propf g Fg.
move: (linearB (pack_linear Lg)) => /= -> Ballx.
apply/(le_trans (ler_normB _ _))/lerD; first exact: majballi.
by apply: majballi => //; exact/ball_center.
have ballprop : ball x0 r%:num (2^-1 * (r%:num / `|y|) *: y + x0).
rewrite -ball_normE /ball_ /= opprD addrC subrK normrN normrZ.
rewrite 2!normrM 2!normfV normr_id !mulrA divfK ?normr_eq0//.
by rewrite !gtr0_norm// gtr_pMl// invf_lt1// ltr1n.
have := majball f (2^-1 * (r%:num / `|y|) *: y + x0) Ff ballprop.
rewrite -addrA addrN linf.
move: (linear0 (pack_linear linf)) => /= ->.
rewrite addr0 normrZ 2!normrM gtr0_norm // gtr0_norm //.
rewrite normfV normr_id -ler_pdivlMl //=.
by rewrite mulr_gt0 // mulr_gt0 // invr_gt0 normr_gt0.
move/le_trans; apply.
rewrite -natrD -!mulrA (mulrC (_%:R)) ler_pM //.
by rewrite invfM invrK mulrCA ler_pM2l // invf_div // ler_pM2r.
Qed.
End banach_steinhaus.