Module mathcomp.analysis.numfun
From HB Require Import structures.From mathcomp Require Import boot order ssralg ssrnum ssrint interval.
From mathcomp Require Import interval_inference finmap.
#[warning="-warn-library-file-internal-analysis"]
From mathcomp Require Import unstable.
From mathcomp Require Import boolp classical_sets fsbigop functions cardinality
set_interval reals.
From mathcomp Require Import topology ereal normedtype sequences.
Reserved Notation "{ 'nnfun' aT >-> T }"
(at level 0, format "{ 'nnfun' aT >-> T }").
Reserved Notation "[ 'nnfun' 'of' f ]"
(at level 0, format "[ 'nnfun' 'of' f ]").
Unset SsrOldRewriteGoalsOrder.
Set Implicit Arguments.
Unset Strict Implicit.
Unset Printing Implicit Defensive.
Import Order.TTheory GRing.Theory Num.Theory.
Import numFieldTopology.Exports.
Local Open Scope classical_set_scope.
Local Open Scope ring_scope.
Lemma nondecreasing_funNSource code {RSource code : numDomainType} aSource code bSource code (fSource code : R -> R) :
{in `[a, b] &, nondecreasing_fun f} <->
{in `[a, b] &, nonincreasing_fun (\- f)}.
Proof.
Lemma nonincreasing_funNSource code {RSource code : numDomainType} aSource code bSource code (fSource code : R -> R) :
{in `[a, b] &, nonincreasing_fun f} <->
{in `[a, b] &, nondecreasing_fun (\- f)}.
Proof.
Section interval_partition_porderType.
Context {dSource code} {TSource code : porderType d}.
Implicit Type (a b : T) (s : seq T).
a, b itv_partition : forall {d : Order.disp_t} {T : porderType d}, T -> T -> seq T -> Prop itv_partition is not universe polymorphic Arguments itv_partition {d T} a b s%_seq_scope itv_partition is transparent Expands to: Constant mathcomp.analysis.numfun.itv_partition Declared in library mathcomp.analysis.numfun, line 78, characters 11-24
Used by
- mathcomp.analysis.realfun
Source code aSource code bSource code sSource code := [/\ path <%O a s & last a s == b].
Lemma itv_partition_nilUsed by
- mathcomp.analysis.realfun
Source code aSource code bSource code : itv_partition a b [::] -> a = b.
Proof.
Lemma itv_partition_consSource code aSource code bSource code xSource code sSource code :
itv_partition a b (x :: s) -> itv_partition x b s.
Proof.
Lemma itv_partition1Used by
- mathcomp.analysis.realfun
Source code aSource code bSource code : (a < b)%O -> itv_partition a b [:: b].
Proof.
Lemma itv_partition_size_neq0Source code aSource code bSource code sSource code :
(size s > 0)%N -> itv_partition a b s -> (a < b)%O.
Proof.
by rewrite andbT => -[ax /eqP <-].
move=> [] /andP[ax /andP[xy] ht /eqP tb].
by rewrite (lt_trans ax)// ih// /itv_partition /= xy/= tb.
Qed.
Lemma itv_partitionxxSource code aSource code sSource code : itv_partition a a s -> s = [::].
Proof.
Lemma itv_partition_leUsed by
- mathcomp.analysis.realfun
Source code aSource code bSource code sSource code : itv_partition a b s -> (a <= b)%O.
Proof.
Lemma itv_partition_catUsed by
- mathcomp.analysis.realfun
Source code aSource code bSource code cSource code sSource code tSource code :
itv_partition a b s -> itv_partition b c t -> itv_partition a c (s ++ t).
Proof.
Lemma itv_partition_nth_sizeSource code defSource code aSource code bSource code sSource code : itv_partition a b s ->
nth def (a :: s) (size s) = b.
Proof.
Lemma itv_partition_nth_geUsed by
- mathcomp.analysis.realfun
Source code defSource code aSource code bSource code sSource code mSource code : (m < (size s).+1)%N ->
itv_partition a b s -> (a <= nth def (a :: s) m)%O.
Proof.
Lemma itv_partition_nth_leUsed by
- mathcomp.analysis.realfun
Source code aSource code bSource code sSource code mSource code : (m < (size s).+1)%N ->
itv_partition a b s -> (nth b (a :: s) m <= b)%O.
Proof.
by move=> [//|a h t /= nt] H; rewrite ih//; exact: itv_partition_cons H.
Qed.
Lemma nondecreasing_fun_itv_partitionSource code aSource code bSource code fSource code sSource code :
{in `[a, b] &, nondecreasing_fun f} -> itv_partition a b s ->
let FSource code : nat -> T := f \o nth b (a :: s) in
forall kSource code, (k < size s)%N -> (F k <= F k.+1)%O.
Proof.
have [_] := nondecreasing_seqP F; apply => m n mn; rewrite /F/=.
have [ms|ms] := ltnP m (size s).+1; last first.
rewrite nth_default//.
have [|ns] := ltnP n (size s).+1; last by rewrite nth_default.
by move=> /(leq_ltn_trans mn); rewrite ltnS leqNgt ms.
have [ns|ns] := ltnP n (size s).+1; last first.
rewrite [in leRHS]nth_default//=; apply/ndf/itv_partition_nth_le => //.
rewrite in_itv/= itv_partition_nth_le// andbT.
exact: (itv_partition_nth_ge b b).
by rewrite in_itv/= lexx andbT; exact: (itv_partition_le abs).
move: abs; rewrite /itv_partition => -[] sa sab.
move: mn; rewrite leq_eqVlt => /predU1P[->//|mn].
apply/ndf/ltW/sorted_ltn_nth => //=; last exact: lt_trans.
rewrite in_itv/= itv_partition_nth_le// andbT.
exact: (itv_partition_nth_ge b b).
rewrite in_itv/= itv_partition_nth_le// andbT.
exact: (itv_partition_nth_ge b b).
Qed.
a, b and c, returns a partition of a, c itv_partitionL : forall {d : Order.disp_t} {T : porderType d}, seq T -> T -> seq T itv_partitionL is not universe polymorphic Arguments itv_partitionL {d T} s%_seq_scope c itv_partitionL is transparent Expands to: Constant mathcomp.analysis.numfun.itv_partitionL Declared in library mathcomp.analysis.numfun, line 168, characters 11-25
Used by
- mathcomp.analysis.realfun
Source code sSource code cSource code := rcons [seq xSource code <- s | (x < c)%O] c.
a, b and c, returns a partition of c, b itv_partitionR : forall {d : Order.disp_t} {T : porderType d}, seq T -> T -> seq T itv_partitionR is not universe polymorphic Arguments itv_partitionR {d T} s%_seq_scope c itv_partitionR is transparent Expands to: Constant mathcomp.analysis.numfun.itv_partitionR Declared in library mathcomp.analysis.numfun, line 171, characters 11-25
Used by
- mathcomp.analysis.realfun
Source code sSource code cSource code := [seq xSource code <- s | (c < x)%O].
End interval_partition_porderType.
Section interval_partition_orderType.
Context {dSource code} {TSource code : orderType d}.
Implicit Type (a b : T) (s : seq T).
Lemma itv_partitionLPUsed by
- mathcomp.analysis.realfun
Source code aSource code bSource code cSource code sSource code : (a < c)%O -> (c < b)%O -> itv_partition a b s ->
itv_partition a c (itv_partitionL s c).
Proof.
rewrite /itv_partitionL rcons_path/=; apply/andP; split.
by apply: path_filter => //; exact: lt_trans.
exact: (last_filterP [pred xSource code | (x < c)%O]).
by rewrite /itv_partitionL last_rcons.
Qed.
Lemma itv_partitionRPUsed by
- mathcomp.analysis.realfun
Source code aSource code bSource code cSource code sSource code : (a < c)%O -> (c < b)%O -> itv_partition a b s ->
itv_partition c b (itv_partitionR s c).
Proof.
move: sa; rewrite lt_path_sortedE => /andP[allas ss].
rewrite lt_path_sortedE filter_all/=.
by apply: sorted_filter => //; exact: lt_trans.
exact/eqP/(path_lt_last_filter ac).
Qed.
Lemma in_itv_partitionSource code cSource code sSource code : sorted <%O s -> c \in s ->
s = itv_partitionL s c ++ itv_partitionR s c.
Proof.
rewrite inE => /predU1P[->{c}/=|ct].
rewrite ltxx /itv_partitionL /= ltxx /itv_partitionR/= path_lt_filter0//=.
by rewrite path_lt_filterT.
rewrite /itv_partitionL/=; case: ifPn => [hc|].
by rewrite ltNge (ltW hc)/= /= [in LHS](ih _ _ ct)//; exact: path_sorted ht.
rewrite -leNgt le_eqVlt => /predU1P[ch|ch].
by rewrite ch ltxx path_lt_filter0//= /itv_partitionR path_lt_filterT.
move: ht; rewrite lt_path_sortedE => /andP[/allP/(_ _ ct)].
by move=> /lt_trans-/(_ _ ch); rewrite ltxx.
Qed.
Lemma notin_itv_partitionSource code cSource code sSource code : sorted <%O s -> c \notin s ->
s = [seq xSource code <- s | (x < c)%O] ++ itv_partitionR s c.
Proof.
rewrite inE negb_or => /andP[]; rewrite neq_lt => /orP[ch|ch] ct.
rewrite ch ltNge (ltW ch)/= path_lt_filter0/= /itv_partitionR.
exact: path_lt_head ht.
by rewrite path_lt_filterT//; exact: path_lt_head ht.
by rewrite ch/= ltNge (ltW ch)/= -ih//; exact: path_sorted ht.
Qed.
End interval_partition_orderType.
Section interval_partition_numDomainType.
Context {RSource code : numDomainType}.
Implicit Type (a b : R) (s : seq R).
Lemma nonincreasing_fun_itv_partitionSource code aSource code bSource code fSource code sSource code :
{in `[a, b] &, nonincreasing_fun f} -> itv_partition a b s ->
let FSource code : nat -> R := f \o nth b (a :: s) in
forall kSource code, (k < size s)%N -> (F k.+1 <= F k)%O.
Proof.
exact: (nondecreasing_fun_itv_partition ndNf abs).
Qed.
Lemma itv_partition_revSource code aSource code bSource code sSource code : itv_partition a b s ->
itv_partition (- b) (- a) (rev (belast (- a) (map -%R s))).
Proof.
End interval_partition_numDomainType.
Section variation_numDomainType.
Context {RSource code : numDomainType}.
Implicit Types (a b : R) (f g : R -> R).
Definition variation
variation : forall {R : numDomainType}, R -> R -> (R -> R) -> seq R -> {| Num.POrderZmodule.sort := R; Num.POrderZmodule.class := {| Num.POrderZmodule.choice_hasChoice_mixin := Num.NumDomain.class R; Num.POrderZmodule.eqtype_hasDecEq_mixin := Num.NumDomain.class R; Num.POrderZmodule.Order_isDuallyPreorder_mixin := Num.NumDomain.class R; Num.POrderZmodule.Order_Preorder_isDuallyPOrder_mixin := Num.NumDomain.class R; Num.POrderZmodule.Algebra_hasOpp_mixin := Num.NumDomain.class R; Num.POrderZmodule.Algebra_hasZero_mixin := Num.NumDomain.class R; Num.POrderZmodule.Algebra_hasAdd_mixin := Num.NumDomain.class R; Num.POrderZmodule.Algebra_BaseZmoduleNmodule_isZmodule_mixin := Num.NumDomain.class R; Num.POrderZmodule.Algebra_BaseAddUMagma_isAddUMagma_mixin := Num.NumDomain.class R; Num.POrderZmodule.Algebra_BaseAddMagma_isAddMagma_mixin := Num.NumDomain.class R; Num.POrderZmodule.Algebra_AddMagma_isAddSemigroup_mixin := Num.NumDomain.class R |} |} variation is not universe polymorphic Arguments variation {R} (a b)%_ring_scope f%_function_scope s%_seq_scope variation is transparent Expands to: Constant mathcomp.analysis.numfun.variation Declared in library mathcomp.analysis.numfun, line 257, characters 11-20
Used by
- mathcomp.analysis.realfun
Source code aSource code bSource code fSource code sSource code := let FSource code := f \o nth b (a :: s) in
\sum_(0 <= nSource code < size s) `|F n.+1 - F n|%R.
Lemma variation_zipSource code aSource code bSource code fSource code sSource code : itv_partition a b s ->
variation a b f s = \sum_(xSource code <- zip s (a :: s)) `|f x.1 - f x.2|.
Proof.
by rewrite /itv_partition /= => -[_ /eqP <-]; rewrite /variation/= !big_nil.
rewrite /itv_partition /variation => -[]/= /andP[ah ht] /eqP htb.
rewrite big_nat_recl//= big_cons/=; congr +%R.
have /ih : itv_partition h b t by split => //; exact/eqP.
by rewrite /variation => ->; rewrite !big_seq; apply/eq_bigr => r rt.
Qed.
Lemma variation_prevUsed by
- mathcomp.analysis.realfun
Source code aSource code bSource code fSource code sSource code : itv_partition a b s ->
variation a b f s = \sum_(xSource code <- s) `|f x - f (prev (locked (a :: s)) x)|.
Proof.
apply: eq_bigr => i /andP[_ si]; congr (`| _ - f _ |).
rewrite -lock.
rewrite prev_nth inE gt_eqF.
rewrite -[a]/(nth b (a :: s) 0) -[ltRHS]/(nth b (a :: s) i.+1).
exact: lt_sorted_ltn_nth.
rewrite orFb mem_nth// index_uniq//.
by apply: (sorted_uniq lt_trans) => //; apply: path_sorted sa.
by apply: set_nth_default => /=; rewrite ltnS ltnW.
Qed.
Lemma variation_nextSource code aSource code bSource code fSource code sSource code : itv_partition a b s ->
variation a b f s =
\sum_(xSource code <- belast a s) `|f (next (locked (a :: s)) x) - f x|.
Proof.
rewrite size_belast; apply: eq_bigr => i /andP[_ si].
congr (`| f _ - f _ |); last first.
by rewrite lastI -cats1 nth_cat size_belast// si.
rewrite -lock next_nth.
rewrite {1}lastI mem_rcons inE mem_nth ?size_belast// orbT.
rewrite lastI -cats1 index_cat mem_nth ?size_belast//.
rewrite index_uniq ?size_belast//; last exact: set_nth_default.
have /lt_sorted_uniq : sorted <%R (a :: s) by [].
by rewrite lastI rcons_uniq => /andP[].
Qed.
Lemma variation_nilSource code aSource code bSource code fSource code : variation a b f [::] = 0.
Lemma variation_ge0Source code aSource code bSource code fSource code sSource code : 0 <= variation a b f s.
Proof.
Lemma variationNSource code aSource code bSource code fSource code sSource code : variation a b (\- f) s = variation a b f s.
Lemma variation_leUsed by
- mathcomp.analysis.realfun
Source code aSource code bSource code fSource code gSource code sSource code :
variation a b (f \+ g)%R s <= variation a b f s + variation a b g s.
Proof.
Lemma nondecreasing_variationUsed by
- mathcomp.analysis.realfun
Source code aSource code bSource code fSource code sSource code : {in `[a, b] &, nondecreasing_fun f} ->
itv_partition a b s -> variation a b f s = f b - f a.
Proof.
transitivity (\sum_(0 <= nSource code < size s) (F n.+1 - F n)).
rewrite !big_nat; apply: eq_bigr => k; rewrite leq0n/= => ks.
by rewrite ger0_norm// subr_ge0; exact: nondecreasing_fun_itv_partition.
by rewrite telescope_sumr// /F/= (itv_partition_nth_size _ abs).
Qed.
Lemma nonincreasing_variationSource code aSource code bSource code fSource code sSource code : {in `[a, b] &, nonincreasing_fun f} ->
itv_partition a b s -> variation a b f s = f a - f b.
Proof.
by rewrite opprK addrC => <-; rewrite variationN.
Qed.
Lemma variation_catUsed by
- mathcomp.analysis.realfun
Source code cSource code aSource code bSource code fSource code sSource code tSource code : a <= c -> c <= b ->
itv_partition a c s -> itv_partition c b t ->
variation a b f (s ++ t) = variation a c f s + variation c b f t.
Proof.
by move=> /itv_partitionxx ->; rewrite variation_nil add0r.
rewrite le_eqVlt => /predU1P[<-{b}|cb].
by move=> ? /itv_partitionxx ->; rewrite variation_nil addr0 cats0.
move=> acs cbt; rewrite /variation /= [in LHS]/index_iota subn0 size_cat.
rewrite iotaD add0n big_cat/= -[in X in X + _ = _](subn0 (size s)); congr +%R.
rewrite -/(index_iota 0 (size s)) 2!big_nat.
apply: eq_bigr => k /[!leq0n] /= ks.
rewrite nth_cat ks -cat_cons nth_cat /= ltnS (ltnW ks).
by rewrite !(set_nth_default b c)//= ltnS ltnW.
rewrite -[in LHS](addnK (size s) (size t)).
rewrite -/(index_iota (size s) (size t + size s)).
rewrite -{1}[in LHS](add0n (size s)) big_addn addnK 2!big_nat; apply: eq_bigr.
move=> k /[!leq0n]/= kt.
rewrite nth_cat {1}(addnC k) -ltn_subRL subnn ltn0 addnK.
case: k kt => [t0 /=|k kt].
rewrite add0n -cat_cons nth_cat/= ltnS leqnn -last_nth.
by case: acs => _ /eqP ->.
rewrite addSnnS (addnC k) -cat_cons nth_cat/= -ltn_subRL subnn ltn0.
by rewrite -(addnC k) addnK.
Qed.
Lemma le_variationUsed by
- mathcomp.analysis.realfun
Source code aSource code bSource code fSource code sSource code xSource code : variation a b f s <= variation a b f (x :: s).
Proof.
by rewrite variation_nil /variation/= big_nat_recl//= big_nil addr0.
rewrite /variation/= !big_nat_recl//= addrA lerD2r.
by rewrite -(subrKA (f x)) addrC ler_normD.
Qed.
Lemma variation_opp_revSource code aSource code bSource code fSource code sSource code : itv_partition a b s ->
variation a b f s =
variation (- b) (- a) (f \o -%R) (rev (belast (- a) (map -%R s))).
Proof.
rewrite size_rev size_map size_belast 2!big_nat.
apply: eq_bigr => k; rewrite leq0n /= => ks.
rewrite nth_rev ?size_map ?size_belast// [in RHS]distrC.
rewrite (nth_map a).
by rewrite size_belast ltn_subLR// addSn ltnS leq_addl.
rewrite opprK -rev_rcons nth_rev ?size_rcons ?size_map ?size_belast 1?ltnW//.
rewrite subSn// -map_rcons (nth_map b) ?size_rcons ?size_belast.
by rewrite ltnS ltn_subLR// addSn ltnS leq_addl.
rewrite opprK nth_rcons size_belast -subSn// subSS.
rewrite (ltn_subLR _ (ltnW ks)) if_same.
case: k => [|k] in ks *.
rewrite add0n ltnn subn1 (_ : nth b s _ = b).
case: abl ks => _.
elim/last_ind : s => // h t _; rewrite last_rcons => /eqP -> _.
by rewrite nth_rcons size_rcons ltnn eqxx.
rewrite (_ : nth b (a :: s) _ = nth a (belast a s) (size s).-1)//.
case: abl ks => _.
elim/last_ind : s => // h t _; rewrite last_rcons => /eqP -> _.
rewrite belast_rcons size_rcons/= -rcons_cons nth_rcons/= ltnS leqnn.
exact: set_nth_default.
rewrite addSn ltnS leq_addl//; congr (`| f _ - f _ |).
elim/last_ind : s ks {abl} => // h t _; rewrite size_rcons ltnS => kh.
rewrite belast_rcons nth_rcons subSS ltn_subLR//.
by rewrite addSn ltnS leq_addl// subSn.
elim/last_ind : s ks {abl} => // h t _; rewrite size_rcons ltnS => kh.
rewrite belast_rcons subSS -rcons_cons nth_rcons /= ltn_subLR//.
rewrite addnS ltnS leq_addl; apply: set_nth_default => //.
by rewrite /= ltnS leq_subLR leq_addl.
Qed.
Lemma variation_rev_oppSource code aSource code bSource code fSource code sSource code : itv_partition (- b) (- a) s ->
variation a b f (rev (belast b (map -%R s))) =
variation (- b) (- a) (f \o -%R) s.
Proof.
End variation_numDomainType.
#[deprecated(since="mathcomp-analysis 1.12.0", note="use `variation_cat` instead")]
Notation variationDSource code := variation_cat (only parsing).
Section variation_realDomainType.
Context {RSource code : realDomainType}.
Implicit Types (a b : R) (f g : R -> R).
Lemma variation_itv_partitionLRUsed by
- mathcomp.analysis.realfun
Source code aSource code bSource code cSource code fSource code sSource code : a < c -> c < b ->
itv_partition a b s ->
variation a b f s <= variation a b f (itv_partitionL s c ++ itv_partitionR s c).
Proof.
by rewrite -in_itv_partition//; case: abs => /path_sorted.
rewrite /itv_partitionL [in leLHS](notin_itv_partition _ cl)//.
by apply: path_sorted; case: abs => + _; exact.
rewrite -notin_itv_partition//.
by apply: path_sorted; case: abs => /= + _; exact.
rewrite !variation_zip//.
by apply: itv_partition_cat;
[exact: (itv_partitionLP _ bc)|exact: (itv_partitionRP ac)].
rewrite [in leLHS](notin_itv_partition _ cl).
by apply: path_sorted; case: abs => + _; exact.
set L := [seq xSource code <- s | x < c].
rewrite -cats1 -catA.
move: L => L.
set B := itv_partitionR s c.
move: B => B.
elim/last_ind : L => [|L0 L1 _].
rewrite !cat0s /=; case: B => [|B0 B1].
by rewrite big_nil big_cons/= big_nil addr0.
by rewrite !big_cons/= addrA lerD// -(subrKA (f c)) [leRHS]addrC ler_normD.
rewrite -cats1.
rewrite (_ : a :: _ ++ B = (a :: L0) ++ [:: L1] ++ B)//.
by rewrite -!catA -cat_cons.
rewrite zip_cat; first by rewrite cats1 size_rcons.
rewrite (_ : a :: _ ++ _ ++ B = (a :: L0) ++ [:: L1] ++ [:: c] ++ B).
by rewrite -!catA -cat_cons.
rewrite zip_cat; first by rewrite cats1 size_rcons.
rewrite !big_cat lerD//.
case: B => [|B0 B1].
by rewrite /= big_nil big_cons big_nil addr0.
rewrite -cat1s zip_cat// catA.
rewrite (_ : [:: L1] ++ _ ++ B1 = ([:: L1] ++ [:: c]) ++ [:: B0] ++ B1).
by rewrite catA.
rewrite zip_cat// !big_cat lerD//= !big_cons !big_nil !addr0/= [leRHS]addrC.
by rewrite (le_trans _ (ler_normD _ _))// subrKA.
Qed.
Lemma variation_subseqSource code aSource code bSource code fSource code (sSource code tSource code : list R) :
itv_partition a b s -> itv_partition a b t ->
subseq s t ->
variation a b f s <= variation a b f t.
Proof.
by rewrite variation_nil // variation_ge0.
move=> /[dup] /itv_partition_cons itvxb /[dup] /itv_partition_le wb itvxt.
move=> /[dup] /itv_partition_cons itvas itvws /=.
have ab : a <= b by exact: (itv_partition_le itvas).
have wa : w < a by case: itvws => /= /andP[].
have waW : w <= a := ltW wa.
case: ifPn => [|] nXA.
move/eqP : nXA itvxt itvxb => -> itvat itvt /= ta.
rewrite -[_ :: t]cat1s -[_ :: s]cat1s.
rewrite ?(@variation_cat _ a)//; [exact: itv_partition1..|].
by rewrite lerD// IH.
move=> xts; rewrite -[_ :: s]cat1s (@variation_cat _ a) => //.
exact: itv_partition1.
have [y [s' s'E]] : exists ySource code s'Source code, s = y :: s'.
by case: {itvas itvws IH} s xts => // y s' ?; exists y, s'.
apply: (@le_trans _ _ (variation w b f s)).
rewrite IH//.
case: itvws => /= /andP[_]; rewrite s'E /= => /andP[ay ys' lyb].
by split => //; rewrite (path_lt_head wa)//= ys' andbT.
by rewrite -variation_cat//; [exact: itv_partition1 | exact: le_variation].
Qed.
End variation_realDomainType.
Section bounded_variation.
Context {RSource code : numDomainType}.
Implicit Type (a b : R) (f : R -> R).
Definition variations
variations : forall {R : numDomainType}, R -> R -> (R -> R) -> set {| Num.POrderZmodule.sort := R; Num.POrderZmodule.class := {| Num.POrderZmodule.choice_hasChoice_mixin := Num.NumDomain.class R; Num.POrderZmodule.eqtype_hasDecEq_mixin := Num.NumDomain.class R; Num.POrderZmodule.Order_isDuallyPreorder_mixin := Num.NumDomain.class R; Num.POrderZmodule.Order_Preorder_isDuallyPOrder_mixin := Num.NumDomain.class R; Num.POrderZmodule.Algebra_hasOpp_mixin := Num.NumDomain.class R; Num.POrderZmodule.Algebra_hasZero_mixin := Num.NumDomain.class R; Num.POrderZmodule.Algebra_hasAdd_mixin := Num.NumDomain.class R; Num.POrderZmodule.Algebra_BaseZmoduleNmodule_isZmodule_mixin := Num.NumDomain.class R; Num.POrderZmodule.Algebra_BaseAddUMagma_isAddUMagma_mixin := Num.NumDomain.class R; Num.POrderZmodule.Algebra_BaseAddMagma_isAddMagma_mixin := Num.NumDomain.class R; Num.POrderZmodule.Algebra_AddMagma_isAddSemigroup_mixin := Num.NumDomain.class R |} |} variations is not universe polymorphic Arguments variations {R} (a b)%_ring_scope f%_function_scope _ variations is transparent Expands to: Constant mathcomp.analysis.numfun.variations Declared in library mathcomp.analysis.numfun, line 500, characters 11-21
Used by
- mathcomp.analysis.realfun
Source code aSource code bSource code fSource code := [set variation a b f l | lSource code in itv_partition a b].
Lemma variations_variationUsed by
- mathcomp.analysis.realfun
Source code aSource code bSource code fSource code sSource code : itv_partition a b s ->
variations a b f (variation a b f s).
Proof.
Lemma variations_neq0Used by
- mathcomp.analysis.realfun
Source code aSource code bSource code fSource code : a < b -> variations a b f !=set0.
Lemma variationsNUsed by
- mathcomp.analysis.realfun
Source code aSource code bSource code fSource code : variations a b (\- f) = variations a b f.
Proof.
by rewrite variationN; exact: variations_variation.
by rewrite -variationN => <-; exact: variations_variation.
Qed.
Lemma variationsxxUsed by
- mathcomp.analysis.realfun
Source code aSource code fSource code : variations a a f = [set 0].
Proof.
Definition bounded_variation
bounded_variation : forall {R : numDomainType}, R -> R -> (R -> R) -> Prop bounded_variation is not universe polymorphic Arguments bounded_variation {R} (a b)%_ring_scope f%_function_scope bounded_variation is transparent Expands to: Constant mathcomp.analysis.numfun.bounded_variation Declared in library mathcomp.analysis.numfun, line 526, characters 11-28
Used by
- mathcomp.analysis.realfun
Source code aSource code bSource code fSource code := has_ubound (variations a b f).
Notation BVSource code := bounded_variation.
Lemma bounded_variationxxUsed by
- mathcomp.analysis.realfun
Source code aSource code fSource code : BV a a f.
Proof.
Lemma bounded_variationDUsed by
- mathcomp.analysis.realfun
Source code aSource code bSource code fSource code gSource code : a < b ->
BV a b f -> BV a b g -> BV a b (f \+ g).
Proof.
apply: le_trans; first exact: variation_le.
rewrite lerD//.
- by apply: abfr; exact: variations_variation.
- by apply: abgs; exact: variations_variation.
Qed.
Lemma bounded_variationNUsed by
- mathcomp.analysis.realfun
Source code aSource code bSource code fSource code : BV a b f -> BV a b (\- f).
Proof.
Lemma bounded_variationlUsed by
- mathcomp.analysis.realfun
Source code aSource code cSource code bSource code fSource code : a <= c -> c <= b -> BV a b f -> BV a c f.
Proof.
rewrite le_eqVlt => /predU1P[<-{b}//|cb].
move=> [x Hx]; exists x => _ [s acs] <-.
rewrite (@le_trans _ _ (variation a b f (rcons s b)))//; last first.
apply/Hx/variations_variation; case: acs => sa /eqP asc.
by rewrite /itv_partition rcons_path last_rcons sa/= asc.
rewrite {2}/variation size_rcons -[leLHS]addr0 big_nat_recr//= lerD//.
rewrite /variation !big_nat ler_sum// => k; rewrite leq0n /= => ks.
rewrite nth_rcons// ks -cats1 -cat_cons nth_cat /= ltnS (ltnW ks).
by rewrite //= ltnS ltnW.
Qed.
Lemma bounded_variationrUsed by
- mathcomp.analysis.realfun
Source code aSource code cSource code bSource code fSource code : a <= c -> c <= b -> BV a b f -> BV c b f.
Proof.
rewrite le_eqVlt => /predU1P[<-{b} ?|cb]; first exact: bounded_variationxx.
move=> [x Hx]; exists x => _ [s cbs] <-.
rewrite (@le_trans _ _ (variation a b f (c :: s)))//; last first.
apply/Hx/variations_variation; case: cbs => cs csb.
by rewrite /itv_partition/= ac/= cs.
by rewrite {2}/variation/= -[leLHS]add0r big_nat_recl//= lerD.
Qed.
Lemma variations_oppUsed by
- mathcomp.analysis.realfun
Source code aSource code bSource code fSource code :
variations (- b) (- a) (f \o -%R) = variations a b f.
Proof.
eexists; last exact: variation_rev_opp.
by move/itv_partition_rev : bas; rewrite !opprK.
eexists; last by exact/esym/variation_opp_rev.
exact: itv_partition_rev abs.
Qed.
Lemma nondecreasing_bounded_variationUsed by
- mathcomp.analysis.realfun
Source code aSource code bSource code fSource code :
{in `[a, b] &, {homo f : xSource code ySource code / x <= y}} -> BV a b f.
Proof.
by rewrite nondecreasing_variation// eqxx.
Qed.
End bounded_variation.
HBUsed by
- mathcomp.analysis.lebesgue_integral_theory.simple_functions
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_definition
Source code.mixinUsed by
- mathcomp.analysis.lebesgue_integral_theory.simple_functions
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_definition
Source code RecordUsed by
- mathcomp.analysis.lebesgue_integral_theory.simple_functions
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_definition
Source code isNonNegFunUsed by
- mathcomp.analysis.lebesgue_integral_theory.simple_functions
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_definition
Source code (aTUsed by
- mathcomp.analysis.lebesgue_integral_theory.simple_functions
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_definition
Source code :Used by
- mathcomp.analysis.lebesgue_integral_theory.simple_functions
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_definition
Source code TypeUsed by
- mathcomp.analysis.lebesgue_integral_theory.simple_functions
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_definition
Source code) (rTUsed by
- mathcomp.analysis.lebesgue_integral_theory.simple_functions
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_definition
Source code :Used by
- mathcomp.analysis.lebesgue_integral_theory.simple_functions
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_definition
Source code numDomainTypeUsed by
- mathcomp.analysis.lebesgue_integral_theory.simple_functions
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_definition
Source code) (f : aT -> rT) := {
fun_ge0 : forall xSource code, (0 <= f x)%R
}.
HBUsed by
- mathcomp.analysis.lebesgue_integral_theory.simple_functions
Source code.structureUsed by
- mathcomp.analysis.lebesgue_integral_theory.simple_functions
Source code DefinitionUsed by
- mathcomp.analysis.lebesgue_integral_theory.simple_functions
Source code NonNegFunUsed by
- mathcomp.analysis.lebesgue_integral_theory.simple_functions
Source code aTUsed by
- mathcomp.analysis.lebesgue_integral_theory.simple_functions
Source code rTUsed by
- mathcomp.analysis.lebesgue_integral_theory.simple_functions
Source code :=Used by
- mathcomp.analysis.lebesgue_integral_theory.simple_functions
Source code {fUsed by
- mathcomp.analysis.lebesgue_integral_theory.simple_functions
Source code of @isNonNegFun aT rT f}.
Notation "{ 'nnfun' aT >-> T }"Source code := (@NonNegFun.type aT T) : form_scope.
Notation "[ 'nnfun' 'of' f ]"Source code := [the {nnfun _ >-> _} of f] : form_scope.
#[global] Hint Extern 0 (is_true (0 <= _)) => solve [apply: fun_ge0] : core.
Section fimfun_bin.
Context (TSource code : Type) (RSource code : numDomainType).
Variables fSource code gSource code : {fimfun T >-> R}.
Lemma max_fimfun_subproofSource code : @FiniteImage T R (f \max g).
Proof.
End fimfun_bin.
Reserved Notation "f ^\+" (at level 1, format "f ^\+").
Reserved Notation "f ^\-" (at level 1, format "f ^\-").
Section restrict_lemmas.
Context {aTSource code : Type} {rTSource code : numFieldType}.
Implicit Types (f g : aT -> rT) (D : set aT).
Lemma restrict_set0Source code fSource code : f \_ set0 = cst 0.
Proof.
Lemma restrict_ge0Used by
- mathcomp.analysis.probability_theory.exponential_distribution
Source code DSource code fSource code :
(forall xSource code, D x -> 0 <= f x) -> forall xSource code, 0 <= (f \_ D) x.
Lemma ler_restrictSource code DSource code fSource code gSource code :
(forall xSource code, D x -> f x <= g x) -> forall xSource code, (f \_ D) x <= (g \_ D) x.
Lemma restrict_normrUsed by
- mathcomp.analysis.ftc
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_differentiation
Source code DSource code fSource code : (Num.norm \o f) \_ D = Num.norm \o (f \_ D).
End restrict_lemmas.
Lemma erestrict_ge0Used by
- mathcomp.analysis.probability_theory.random_variable
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_nonneg
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_monotone_convergence
Source code {aTSource code} {rTSource code : numFieldType} (DSource code : set aT) (fSource code : aT -> \bar rT) :
(forall xSource code, D x -> (0 <= f x)%E) -> forall xSource code, (0 <= (f \_ D) x)%E.
Lemma lee_restrictUsed by
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_monotone_convergence
Source code {aTSource code} {rTSource code : numFieldType} (DSource code : set aT) (fSource code gSource code : aT -> \bar rT) :
(forall xSource code, D x -> f x <= g x)%E -> forall xSource code, ((f \_ D) x <= (g \_ D) x)%E.
Lemma restrict_leeUsed by
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_nonneg
Source code {aTSource code} {rTSource code : numFieldType} (DSource code ESource code : set aT) (fSource code : aT -> \bar rT) :
(forall xSource code, E x -> 0 <= f x)%E ->
D `<=` E -> forall xSource code, ((f \_ D) x <= (f \_ E) x)%E.
Proof.
Section erestrict_lemmas.
Local Open Scope ereal_scope.
Variables (TSource code : Type) (RSource code : realDomainType) (DSource code : set T).
Implicit Types (f g : T -> \bar R) (r : R).
Lemma erestrict_set0Source code fSource code : f \_ set0 = cst 0.
Proof.
Lemma erestrict0Used by
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_definition
Source code : (cst 0 : T -> \bar R) \_ D = cst 0.
Lemma erestrictDUsed by
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_nonneg
Source code fSource code gSource code : (f \+ g) \_ D = f \_ D \+ g \_ D.
Lemma erestrictNSource code fSource code : (\- f) \_ D = \- f \_ D.
Lemma erestrictBSource code fSource code gSource code : (f \- g) \_ D = f \_ D \- g \_ D.
Lemma erestrictMSource code fSource code gSource code : (f \* g) \_ D = f \_ D \* g \_ D.
Lemma erestrict_scaleUsed by
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_nonneg
Source code kSource code fSource code :
(fun xSource code => k%:E * f x) \_ D = (fun xSource code => k%:E * (f \_ D) x).
End erestrict_lemmas.
Section funrposneg.
Local Open Scope ring_scope.
Definition funrpos
funrpos : forall [T : Type] [R : realDomainType], (T -> R) -> T -> R funrpos is not universe polymorphic Arguments funrpos [T]%_type_scope [R] f%_function_scope x funrpos is transparent Expands to: Constant mathcomp.analysis.numfun.funrpos Declared in library mathcomp.analysis.numfun, line 682, characters 11-18
Used by
- mathcomp.experimental_reals.realsum
Source code TSource code (RSource code : realDomainType) (fSource code : T -> R) :=
fun xSource code => Num.max (f x) 0.
Definition funrneg
funrneg : forall [T : Type] [R : realDomainType], (T -> R) -> T -> join_Num_POrderZmodule_between_Algebra_BaseZmodule_and_Order_Preorder R funrneg is not universe polymorphic Arguments funrneg [T]%_type_scope [R] f%_function_scope x funrneg is transparent Expands to: Constant mathcomp.analysis.numfun.funrneg Declared in library mathcomp.analysis.numfun, line 684, characters 11-18
Used by
- mathcomp.experimental_reals.realsum
Source code TSource code (RSource code : realDomainType) (fSource code : T -> R) :=
fun xSource code => Num.max (- f x) 0.
End funrposneg.
Notation "f ^\+"Source code := (funrpos f) : ring_scope.
Notation "f ^\-"Source code := (funrneg f) : ring_scope.
Section funrposneg_lemmas.
Local Open Scope ring_scope.
Variables (TSource code : Type) (RSource code : realDomainType) (DSource code : set T).
Implicit Types (f g : T -> R) (r : R).
Lemma funrpos_ge0Used by
- mathcomp.analysis.probability_theory.random_variable
- mathcomp.experimental_reals.realsum
Source code fSource code xSource code : 0 <= f^\+ x.
Lemma funrneg_ge0Used by
- mathcomp.analysis.probability_theory.random_variable
Source code fSource code xSource code : 0 <= f^\- x.
Lemma funrposNUsed by
- mathcomp.experimental_reals.realsum
Source code fSource code : (\- f)^\+ = f^\-
Proof.
Lemma funrnegNUsed by
- mathcomp.experimental_reals.realsum
Source code fSource code : (\- f)^\- = f^\+.
Lemma ge0_funrposEUsed by
- mathcomp.experimental_reals.realsum
Source code fSource code : (forall xSource code, D x -> 0 <= f x) -> {in D, f^\+ =1 f}.
Lemma ge0_funrnegEUsed by
- mathcomp.experimental_reals.realsum
Source code fSource code : (forall xSource code, D x -> 0 <= f x) -> {in D, f^\- =1 cst 0}.
Lemma le0_funrposESource code fSource code : (forall xSource code, D x -> f x <= 0) -> {in D, f^\+ =1 cst 0}.
Lemma le0_funrnegESource code fSource code : (forall xSource code, D x -> f x <= 0) -> {in D, f^\- =1 \- f}.
Lemma ge0_funrposMSource code rSource code fSource code : (0 <= r)%R ->
(fun xSource code => r * f x)^\+ = (fun xSource code => r * (f^\+ x)).
Lemma ge0_funrnegMSource code rSource code fSource code : (0 <= r)%R ->
(fun xSource code => r * f x)^\- = (fun xSource code => r * (f^\- x)).
Lemma le0_funrposMSource code rSource code fSource code : (r <= 0)%R ->
(fun xSource code => r * f x)^\+ = (fun xSource code => - r * (f^\- x)).
Proof.
Lemma le0_funrnegMSource code rSource code fSource code : (r <= 0)%R ->
(fun xSource code => r * f x)^\- = (fun xSource code => - r * (f^\+ x)).
Proof.
Lemma funrposDnegSource code fSource code : f^\+ + f^\- = Num.norm \o f.
Proof.
- rewrite ler0_norm// /funrpos /funrneg.
move/max_idPr : (fx0) => ->; rewrite add0r.
by move: fx0; rewrite -{1}oppr0 lerNr => /max_idPl ->.
- rewrite ger0_norm// /funrpos /funrneg; move/max_idPl : (fx0) => ->.
by move: fx0; rewrite -{1}oppr0 lerNl => /max_idPr ->; rewrite addr0.
Qed.
Lemma funrposBnegUsed by
- mathcomp.analysis.probability_theory.independence
- mathcomp.analysis.probability_theory.random_variable
- mathcomp.experimental_reals.realsum
Source code fSource code : f^\+ - f^\- = f.
Proof.
Lemma funrDBSource code fSource code gSource code : (f^\+ + g^\+) - (f^\- + g^\-) = f + g.
Proof.
Lemma funrpos_leUsed by
- mathcomp.experimental_reals.realsum
Source code fSource code gSource code :
{in D, forall xSource code, f x <= g x} -> {in D, forall xSource code, f^\+ x <= g^\+ x}.
Proof.
Lemma funrneg_leSource code fSource code gSource code :
{in D, forall xSource code, f x <= g x} -> {in D, forall xSource code, g^\- x <= f^\- x}.
Proof.
Lemma eq_funrposUsed by
- mathcomp.experimental_reals.realsum
Source code fSource code gSource code : f =1 g -> f^\+ =1 g^\+.
Proof.
Lemma eq_funrnegUsed by
- mathcomp.experimental_reals.realsum
Source code fSource code gSource code : f =1 g -> f^\- =1 g^\-.
Proof.
Lemma funrpos_cst0Used by
- mathcomp.experimental_reals.realsum
Source code xSource code : (fun _ : T => 0)^\+ x = 0 :> R.
Lemma funrneg_cst0Used by
- mathcomp.experimental_reals.realsum
Source code xSource code : (fun _ : T => 0)^\- x = 0 :> R.
Lemma funrposZUsed by
- mathcomp.experimental_reals.realsum
Source code fSource code cSource code : 0 <= c -> (c \*o f)^\+ =1 c \*o f^\+.
Proof.
Lemma funrnegZUsed by
- mathcomp.experimental_reals.realsum
Source code fSource code cSource code : 0 <= c -> (c \*o f)^\- =1 c \*o f^\-.
Proof.
by apply/eq_funrpos=> y /=; rewrite mulrN.
Qed.
Lemma funrpos_natrMUsed by
- mathcomp.experimental_reals.realsum
Source code fSource code (nSource code : T -> nat) xSource code :
(fun xSource code => (n x)%:R * f x)^\+ x = (n x)%:R * f^\+ x.
Lemma funrneg_natrMUsed by
- mathcomp.experimental_reals.realsum
Source code fSource code (nSource code : T -> nat) xSource code :
(fun xSource code => (n x)%:R * f x)^\- x = (n x)%:R * f^\- x.
Proof.
Lemma le_funrpos_normSource code fSource code xSource code : f^\+ x <= `|f x|.
Proof.
End funrposneg_lemmas.
#[global]
Hint Extern 0 (is_true (0%R <= _ ^\+ _)%R) => solve [apply: funrpos_ge0] : core.
#[global]
Hint Extern 0 (is_true (0%R <= _ ^\- _)%R) => solve [apply: funrneg_ge0] : core.
HB
funepos_unlock_subterm : unlockable (fun (T : Type) (R : realDomainType) (f : T -> \bar R) (x : T) => maxe (f x) 0%R) funepos_unlock_subterm is not universe polymorphic funepos_unlock_subterm is transparent Expands to: Constant mathcomp.analysis.numfun.funepos_unlock_subterm Declared in library mathcomp.analysis.numfun, line 845, characters 0-95
Source code.lock
funepos_unlock_subterm : unlockable (fun (T : Type) (R : realDomainType) (f : T -> \bar R) (x : T) => maxe (f x) 0%R) funepos_unlock_subterm is not universe polymorphic funepos_unlock_subterm is transparent Expands to: Constant mathcomp.analysis.numfun.funepos_unlock_subterm Declared in library mathcomp.analysis.numfun, line 845, characters 0-95
Source code
Definition
funepos_unlock_subterm : unlockable (fun (T : Type) (R : realDomainType) (f : T -> \bar R) (x : T) => maxe (f x) 0%R) funepos_unlock_subterm is not universe polymorphic funepos_unlock_subterm is transparent Expands to: Constant mathcomp.analysis.numfun.funepos_unlock_subterm Declared in library mathcomp.analysis.numfun, line 845, characters 0-95
Source code funepos
funepos_unlock_subterm : unlockable (fun (T : Type) (R : realDomainType) (f : T -> \bar R) (x : T) => maxe (f x) 0%R) funepos_unlock_subterm is not universe polymorphic funepos_unlock_subterm is transparent Expands to: Constant mathcomp.analysis.numfun.funepos_unlock_subterm Declared in library mathcomp.analysis.numfun, line 845, characters 0-95
Source code T
funepos_unlock_subterm : unlockable (fun (T : Type) (R : realDomainType) (f : T -> \bar R) (x : T) => maxe (f x) 0%R) funepos_unlock_subterm is not universe polymorphic funepos_unlock_subterm is transparent Expands to: Constant mathcomp.analysis.numfun.funepos_unlock_subterm Declared in library mathcomp.analysis.numfun, line 845, characters 0-95
Source code (RSource code : realDomainType) (fSource code : T -> \bar R) :=
fun xSource code => maxe (f x) 0.
HB
funeneg_unlock_subterm : unlockable (fun (T : Type) (R : realDomainType) (f : T -> \bar R) (x : T) => maxe (- f x)%E 0%R) funeneg_unlock_subterm is not universe polymorphic funeneg_unlock_subterm is transparent Expands to: Constant mathcomp.analysis.numfun.funeneg_unlock_subterm Declared in library mathcomp.analysis.numfun, line 848, characters 0-102
Source code.lock
funeneg_unlock_subterm : unlockable (fun (T : Type) (R : realDomainType) (f : T -> \bar R) (x : T) => maxe (- f x)%E 0%R) funeneg_unlock_subterm is not universe polymorphic funeneg_unlock_subterm is transparent Expands to: Constant mathcomp.analysis.numfun.funeneg_unlock_subterm Declared in library mathcomp.analysis.numfun, line 848, characters 0-102
Source code
Definition
funeneg_unlock_subterm : unlockable (fun (T : Type) (R : realDomainType) (f : T -> \bar R) (x : T) => maxe (- f x)%E 0%R) funeneg_unlock_subterm is not universe polymorphic funeneg_unlock_subterm is transparent Expands to: Constant mathcomp.analysis.numfun.funeneg_unlock_subterm Declared in library mathcomp.analysis.numfun, line 848, characters 0-102
Source code funeneg
funeneg_unlock_subterm : unlockable (fun (T : Type) (R : realDomainType) (f : T -> \bar R) (x : T) => maxe (- f x)%E 0%R) funeneg_unlock_subterm is not universe polymorphic funeneg_unlock_subterm is transparent Expands to: Constant mathcomp.analysis.numfun.funeneg_unlock_subterm Declared in library mathcomp.analysis.numfun, line 848, characters 0-102
Source code T
funeneg_unlock_subterm : unlockable (fun (T : Type) (R : realDomainType) (f : T -> \bar R) (x : T) => maxe (- f x)%E 0%R) funeneg_unlock_subterm is not universe polymorphic funeneg_unlock_subterm is transparent Expands to: Constant mathcomp.analysis.numfun.funeneg_unlock_subterm Declared in library mathcomp.analysis.numfun, line 848, characters 0-102
Source code (RSource code : realDomainType) (fSource code : T -> \bar R) :=
fun xSource code => maxe (oppe (f x)) 0.
Notation "f ^\+"Source code := (funepos f) : ereal_scope.
Notation "f ^\-"Source code := (funeneg f) : ereal_scope.
Section funposneg_lemmas.
Local Open Scope ereal_scope.
Variables (TSource code USource code : Type) (RSource code : realDomainType) (DSource code : set T).
Implicit Types (f g : T -> \bar R) (h : U -> T) (r : R).
Lemma funeposEUsed by
- mathcomp.analysis.esum
- mathcomp.analysis.measure_theory.measure_negligible
- mathcomp.analysis.ftc
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_nonneg
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integrable
Source code fSource code xSource code : f^\+ x = maxe (f x) 0.
Proof.
Lemma funenegEUsed by
- mathcomp.analysis.esum
- mathcomp.analysis.measure_theory.measure_negligible
- mathcomp.analysis.ftc
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_nonneg
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integrable
Source code fSource code xSource code : f^\- x = maxe (- f x) 0.
Proof.
Lemma funepos_ge0Used by
- mathcomp.analysis.esum
Source code fSource code xSource code : 0 <= f^\+ x.
Lemma funeneg_ge0Used by
- mathcomp.analysis.esum
Source code fSource code xSource code : 0 <= f^\- x.
Lemma funeposNUsed by
- mathcomp.analysis.esum
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_nonneg
Source code fSource code : (\- f)^\+ = f^\-.
Lemma funenegNUsed by
- mathcomp.analysis.esum
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_nonneg
Source code fSource code : (\- f)^\- = f^\+.
Lemma funepos_compUsed by
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_fubini
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integrable
Source code fSource code hSource code : (f \o h)^\+ = f^\+ \o h.
Proof.
Lemma funeneg_compUsed by
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_fubini
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integrable
Source code fSource code hSource code : (f \o h)^\- = f^\- \o h.
Proof.
Lemma funepos_restrictUsed by
- mathcomp.analysis.esum
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_nonneg
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_definition
Source code fSource code : (f \_ D)^\+ = (f^\+) \_ D.
Lemma funeneg_restrictUsed by
- mathcomp.analysis.esum
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_nonneg
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_definition
Source code fSource code : (f \_ D)^\- = (f^\-) \_ D.
Lemma ge0_funeposEUsed by
- mathcomp.analysis.esum
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_nonneg
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_definition
Source code fSource code : (forall xSource code, D x -> 0 <= f x) -> {in D, f^\+ =1 f}.
Lemma ge0_funenegEUsed by
- mathcomp.analysis.esum
- mathcomp.analysis.ftc
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_nonneg
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_definition
Source code fSource code : (forall xSource code, D x -> 0 <= f x) -> {in D, f^\- =1 cst 0}.
Lemma le0_funeposEUsed by
- mathcomp.analysis.ftc
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_nonneg
Source code fSource code : (forall xSource code, D x -> f x <= 0) -> {in D, f^\+ =1 cst 0}.
Lemma le0_funenegESource code fSource code : (forall xSource code, D x -> f x <= 0) -> {in D, f^\- =1 \- f}.
Lemma ge0_funeposMUsed by
- mathcomp.analysis.esum
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integrable
Source code rSource code fSource code : (0 <= r)%R ->
(fun xSource code => r%:E * f x)^\+ = (fun xSource code => r%:E * (f^\+ x)).
Lemma ge0_funenegMUsed by
- mathcomp.analysis.esum
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integrable
Source code rSource code fSource code : (0 <= r)%R ->
(fun xSource code => r%:E * f x)^\- = (fun xSource code => r%:E * (f^\- x)).
Lemma le0_funeposMUsed by
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_nonneg
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integrable
Source code rSource code fSource code : (r <= 0)%R ->
(fun xSource code => r%:E * f x)^\+ = (fun xSource code => - r%:E * (f^\- x)).
Proof.
Lemma le0_funenegMUsed by
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_nonneg
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integrable
Source code rSource code fSource code : (r <= 0)%R ->
(fun xSource code => r%:E * f x)^\- = (fun xSource code => - r%:E * (f^\+ x)).
Proof.
Lemma funeposDnegUsed by
- mathcomp.analysis.esum
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_nonneg
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_fubini
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integrable
Source code fSource code : f^\+ \+ f^\- = abse \o f.
Proof.
- rewrite lee0_abs// funeposE funenegE.
move/max_idPr : (fx0) => ->; rewrite add0e.
by move: fx0; rewrite -{1}oppe0 leeNr => /max_idPl ->.
- rewrite gee0_abs// funeposE funenegE; move/max_idPl : (fx0) => ->.
by move: fx0; rewrite -{1}oppe0 leeNl => /max_idPr ->; rewrite adde0.
Qed.
Lemma funeposBnegUsed by
- mathcomp.analysis.esum
- mathcomp.analysis.measure_theory.measure_negligible
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_nonneg
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_dominated_convergence
- mathcomp.analysis.lebesgue_integral_theory.radon_nikodym
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integrable
- mathcomp.analysis.lebesgue_integral_theory.measurable_fun_approximation
Source code fSource code : f^\+ \- f^\- = f.
Proof.
Lemma add_def_funeposnegUsed by
- 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 fSource code xSource code : (f^\+ x +? - f^\- x).
Proof.
#[deprecated(since="mathcomp-analysis 1.15.0", note="use `funeposBneg` instead")]
Lemma funeD_DposSource code fSource code gSource code : (f \+ g)^\+ \- (f \+ g)^\- = f \+ g.
Proof.
Lemma funeDBUsed by
- mathcomp.analysis.esum
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integrable
Source code fSource code gSource code : (f^\+ \+ g^\+) \- (f^\- \+ g^\-) = f \+ g.
Proof.
by rewrite -[in RHS](funeposBneg f) -[in RHS](funeposBneg g).
Qed.
Lemma funepos_leUsed by
- mathcomp.analysis.esum
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integrable
Source code fSource code gSource code :
{in D, forall xSource code, f x <= g x} -> {in D, forall xSource code, f^\+ x <= g^\+ x}.
Proof.
Lemma funeneg_leUsed by
- mathcomp.analysis.esum
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integrable
Source code fSource code gSource code :
{in D, forall xSource code, f x <= g x} -> {in D, forall xSource code, g^\- x <= f^\- x}.
Proof.
Lemma funepos_cst0Source code tSource code : (@cst T _ 0)^\+ t = 0 :> \bar R.
Lemma funeneg_cst0Source code tSource code : (@cst T _ 0)^\- t = 0 :> \bar R.
End funposneg_lemmas.
#[deprecated(since="mathcomp-analysis 1.15.0", note="use `-funeDB` instead")]
Notation funeD_posDSource code := funeDB (only parsing).
#[global]
Hint Extern 0 (is_true (0%R <= _ ^\+ _)%E) => solve [apply: funepos_ge0] : core.
#[global]
Hint Extern 0 (is_true (0%R <= _ ^\- _)%E) => solve [apply: funeneg_ge0] : core.
Section funrpos_funepos_lemmas.
Context {TSource code : Type} {RSource code : realDomainType}.
Lemma funerposUsed by
- mathcomp.analysis.probability_theory.independence
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integrable
- mathcomp.experimental_reals.realsum
Source code (fSource code : T -> R) : (EFin \o f)^\+%E = (EFin \o f^\+).
Lemma funernegUsed by
- mathcomp.analysis.probability_theory.independence
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integrable
- mathcomp.experimental_reals.realsum
Source code (fSource code : T -> R) : (EFin \o f)^\-%E = (EFin \o f^\-).
End funrpos_funepos_lemmas.
Definition indic
indic : forall {T : Type} {R : pzRingType}, set T -> T -> R indic is not universe polymorphic Arguments indic {T}%_type_scope {R} A%_classical_set_scope x indic is transparent Expands to: Constant mathcomp.analysis.numfun.indic Declared in library mathcomp.analysis.numfun, line 1017, characters 11-16
Used by
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_nonneg
Source code {TSource code} {RSource code : pzRingType} (ASource code : set T) (xSource code : T) : R := (x \in A)%:R.
Reserved Notation "'\1_' A" (at level 8, A at level 2, format "'\1_' A") .
Notation "'\1_' A"Source code := (indic A) : ring_scope.
Lemma num_spec_indicSource code {TSource code} {RSource code : numDomainType} (ASource code : set T) (xSource code : T) :
Itv.spec (@Itv.num_sem R) (Itv.Real `[0, 1]%Z) (indic A x).
Proof.
Canonical indic_inum
indic_inum : forall {T : Type} {R : numDomainType}, set T -> T -> {i01 R} indic_inum is not universe polymorphic Arguments indic_inum {T}%_type_scope {R} A%_classical_set_scope x indic_inum is transparent Expands to: Constant mathcomp.analysis.numfun.indic_inum Declared in library mathcomp.analysis.numfun, line 1029, characters 10-20
Source code {TSource code} {RSource code : numDomainType} (ASource code : set T) (xSource code : T) :=
Itv.mk (@num_spec_indic T R A x).
Section indic_ringType.
Context (TSource code : Type) (RSource code : pzRingType).
Implicit Types A D : set T.
Lemma indicEUsed by
- mathcomp.analysis.probability_theory.beta_distribution
- mathcomp.analysis.probability_theory.independence
- mathcomp.analysis.probability_theory.uniform_distribution
- mathcomp.analysis.probability_theory.random_variable
- mathcomp.analysis.real_measure.measurable_realfun
- mathcomp.analysis.measure_theory.dirac_measure
- mathcomp.analysis.kernel
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_nonneg
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_Rintegral
- mathcomp.analysis.lebesgue_integral_theory.simple_functions
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_fubini
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_differentiation
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integrable
- mathcomp.analysis.lebesgue_integral_theory.measurable_fun_approximation
Source code ASource code (xSource code : T) : \1_A x = (x \in A)%:R :> R
Proof.
Lemma indicTUsed by
- mathcomp.analysis.probability_theory.beta_distribution
- mathcomp.analysis.kernel
Source code : \1_[set: T] = cst (1 : R).
Lemma indic0Used by
- mathcomp.analysis.measure_theory.dirac_measure
- mathcomp.analysis.kernel
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_nonneg
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_Rintegral
- mathcomp.analysis.lebesgue_integral_theory.simple_functions
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integrable
Source code : \1_(@set0 T) = cst (0 : R).
Lemma indicIUsed by
- mathcomp.analysis.probability_theory.independence
- mathcomp.analysis.kernel
Source code ASource code BSource code : \1_(A `&` B) = \1_A \* \1_B :> (_ -> R).
Lemma indicCUsed by
- mathcomp.analysis.kernel
Source code ASource code : \1_(~` A) = (fun xSource code => (~~ (x \in A))%:R) :> (_ -> R).
Lemma image_indicSource code DSource code ASource code :
\1_D @` A = (if A `\` D != set0 then [set 0] else set0) `|`
(if A `&` D != set0 then [set 1 : R] else set0).
Proof.
by rewrite /indic; case: (boolP (t \in D)); rewrite ?(inE, notin_setE) => Dt;
[right|left]; rewrite ifT//=; apply/set0P; exists t.
by move=> []; case: ifPn; rewrite ?negbK// => /set0P[t [At Dt]] ->;
exists t => //; case: (boolP (t \in D)); rewrite ?(inE, notin_setE).
Qed.
Lemma preimage_indicUsed by
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_definition
Source code (DSource code : set T) (BSource code : set R) :
\1_D @^-1` B = if 1 \in B then (if 0 \in B then setT else D)
else (if 0 \in B then ~` D else set0).
Proof.
case: ifPn => B1; case: ifPn => B0 //=.
- have [|] := boolP (x \in D); first by rewrite inE.
by rewrite notin_setE in B0.
- have [|] := boolP (x \in D); last by rewrite notin_setE.
by rewrite notin_setE in B1.
- by have [xD|xD] := boolP (x \in D);
[rewrite notin_setE in B1|rewrite notin_setE in B0].
- by have [xD|xD] := boolP (x \in D); [rewrite inE in B1|rewrite inE in B0].
- have [xD|] := boolP (x \in D); last by rewrite notin_setE.
by rewrite inE in B1.
- have [|xD] := boolP (x \in D); first by rewrite inE.
by rewrite inE in B0.
Qed.
Lemma image_indic_subUsed by
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_definition
Source code DSource code ASource code : \1_D @` A `<=` ([set 0; 1] : set R).
Proof.
Lemma fimfunEUsed by
- mathcomp.analysis.probability_theory.independence
- mathcomp.analysis.probability_theory.uniform_distribution
- mathcomp.analysis.kernel
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_nonneg
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_Rintegral
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_fubini
- mathcomp.analysis.lebesgue_integral_theory.radon_nikodym
Source code (fSource code : {fimfun T >-> R}) xSource code :
f x = \sum_(ySource code \in range f) (y * \1_(f @^-1` [set y]) x).
Proof.
Lemma fimfunEordSource code (fSource code : {fimfun T >-> R})
(sSource code := fset_set (f @` setT)) :
forall xSource code, f x = \sum_(iSource code < #|`s|) (s`_i * \1_(f @^-1` [set s`_i]) x).
Proof.
End indic_ringType.
Lemma indic_bigcupUsed by
- mathcomp.analysis.kernel
Source code TSource code {RSource code : realType} (ASource code : (set T)^nat) (tSource code : T) :
trivIset [set: nat] A ->
(\1_(\bigcup_nSource code A n) t)%:E = (\sum_(0 <= nSource code <oo) (\1_(A n) t)%:E)%E :> \bar R.
Proof.
have [At|At] := eqVneq (\1_(\bigcup_nSource code A n) t) (1%R : R).
- move: (At) => /eqP; rewrite pnatr_eq1 eqb1 => /asboolP[i _] Ait.
rewrite At (@nneseriesD1 _ _ i)//.
rewrite indicE mem_set// eseries0 ?adde0// => j _/= ji.
rewrite indicE memNset// => Ajt.
move/trivIsetP : tA => /(_ j i Logic.I Logic.I ji).
by apply/eqP/set0P; exists t.
- have {}At : \1_(\bigcup_nSource code A n) t = 0%R :> R.
by apply/eqP; move: At; rewrite pnatr_eq1 eqb1 pnatr_eq0 eqb0.
move: (At) => /eqP; rewrite pnatr_eq0 eqb0 notin_setE => AtC.
rewrite At eseries0// => j _ _.
by rewrite indicE memNset// => Ajt; apply: AtC; exists j.
Qed.
Lemma patch_indicUsed by
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_differentiation
Source code TSource code {RSource code : numFieldType} (fSource code : T -> R) (DSource code : set T) :
f \_ D = (f \* \1_D)%R.
Proof.
Lemma epatch_indicUsed by
- mathcomp.analysis.probability_theory.normal_distribution
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_nonneg
- mathcomp.analysis.lebesgue_integral_theory.radon_nikodym
Source code TSource code (RSource code : numDomainType) (fSource code : T -> \bar R) (DSource code : set T) :
(f \_ D = f \* (EFin \o \1_D))%E.
Proof.
Lemma xsection_indicSource code (RSource code : nzRingType) T1Source code T2Source code (ASource code : set (T1 * T2)) xSource code :
xsection A x = (fun ySource code => (\1_A (x, y) : R)) @^-1` [set 1].
Proof.
Lemma ysection_indicSource code (RSource code : nzRingType) T1Source code T2Source code (ASource code : set (T1 * T2)) ySource code :
ysection A y = (fun xSource code => (\1_A (x, y) : R)) @^-1` [set 1].
Proof.
Lemma bounded_indicSource code TSource code {RSource code : numFieldType} (ASource code : set T) :
[bounded \1_A x : R^o | xSource code in A].
Lemma indic_restrictUsed by
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integrable
Source code {TSource code : Type} {RSource code : numFieldType} (ASource code : set T) :
\1_A = (1 : T -> R) \_ A.
Lemma restrict_indicUsed by
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_definition
Source code TSource code (RSource code : numFieldType) (ESource code ASource code : set T) :
((\1_E : T -> R) \_ A) = \1_(E `&` A).
Proof.
Lemma cvg_indicUsed by
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_differentiation
Source code {RSource code : realFieldType} (xSource code : R^o) kSource code :
x \in (ball 0 k : set R^o) ->
\1_(ball 0 k : set R^o) y @[ySource code --> x] --> (\1_(ball 0 k) x : R).
Proof.
rewrite !indicE xB/= mem_set//=; last by rewrite subrr normr0// ltW.
near: t.
rewrite inE /ball /= sub0r normrN in xB.
exists ((k - `|x|)/2) => /=; first by rewrite divr_gt0// subr_gt0.
rewrite /ball_/= => z /= h; rewrite /ball/= sub0r normrN.
rewrite -(subrK x z) (le_lt_trans (ler_normD _ _))//.
rewrite -ltrBrDr distrC (lt_le_trans h)//.
by rewrite ler_pdivrMr//= ler_pMr// ?subr_gt0// ler1n.
Unshelve. all: by end_near. Qed.
Section ring.
Context (aTSource code : Type) (rTSource code : pzRingType).
Lemma fimfun_mulr_closedSource code : mulr_closed (@fimfun aT rT).
Proof.
by move=> fA gA; exact: (finite_image11 (fun xSource code ySource code => x * y)).
Qed.
HBSource code.instanceSource code DefinitionSource code _Source code :=Source code
@GRingSource code.isMulClosed.Build _ (@fimfun aT rT) fimfun_mulr_closed.
HBSource code.instanceSource code DefinitionSource code _Source code :=Source code [SubNmodule_isSubPzSemiRingSource code of {fimfun aT >-> rT} by <:].
Implicit Types f g : {fimfun aT >-> rT}.
Lemma fimfunMSource code fSource code gSource code : f * g = f \* g :> (_ -> _)
Proof.
Lemma fimfun1Source code : (1 : {fimfun aT >-> rT}) = cst 1 :> (_ -> _)
Proof.
Lemma fimfun_prodSource code ISource code rSource code (PSource code : {pred I}) (fSource code : I -> {fimfun aT >-> rT}) (xSource code : aT) :
(\sum_(iSource code <- r | P i) f i) x = \sum_(iSource code <- r | P i) f i x.
Proof.
Lemma fimfunXSource code fSource code nSource code : f ^+ n = (fun xSource code => f x ^+ n) :> (_ -> _).
Lemma indic_fimfun_subproofSource code XSource code : @FiniteImage aT rT \1_X.
Proof.
HBSource code.instanceSource code DefinitionSource code _Source code XSource code :=Source code indic_fimfun_subproofSource code X.
Definition indic_fimfun
indic_fimfun : forall {aT : Type} {rT : pzRingType}, set aT -> {fimfun aT >-> rT} indic_fimfun is not universe polymorphic Arguments indic_fimfun {aT}%_type_scope {rT} X%_classical_set_scope indic_fimfun is transparent Expands to: Constant mathcomp.analysis.numfun.indic_fimfun Declared in library mathcomp.analysis.numfun, line 1226, characters 11-23
Source code (XSource code : set aT) : {fimfun aT >-> rT} := \1_X.
HBSource code.instanceSource code DefinitionSource code _Source code kSource code fSource code :=Source code FImFunSource code.copy (k \o* f) (f * cst_fimfun k).
Definition scale_fimfun
scale_fimfun : forall [aT : Type] [rT : pzRingType], rT -> {fimfun aT >-> rT} -> {fimfun aT >-> rT} scale_fimfun is not universe polymorphic Arguments scale_fimfun [aT]%_type_scope [rT] k%_ring_scope f scale_fimfun is transparent Expands to: Constant mathcomp.analysis.numfun.scale_fimfun Declared in library mathcomp.analysis.numfun, line 1230, characters 11-23
Source code kSource code fSource code : {fimfun aT >-> rT} := k \o* f.
End ring.
Arguments indic_fimfun {aT rT} _.
Notation "[ 'SubPzRing_isSubComPzRing' 'of' U 'by' <: ]"Source code :=
(GRing.SubPzRing_isSubComPzRing.Build _ _ U)
(format "[ 'SubPzRing_isSubComPzRing' 'of' U 'by' <: ]")
: form_scope.
Section comring.
Context (aTSource code : Type) (rTSource code : comPzRingType).
HBSource code.instanceSource code DefinitionSource code _Source code :=Source code
[SubPzRing_isSubComPzRing of {fimfun aT >-> rT} by <:].
Implicit Types (f g : {fimfun aT >-> rT}).
HBSource code.instanceSource code DefinitionSource code _Source code fSource code gSource code :=Source code FImFunSource code.copy (f \* g) (f * g).
End comring.
HBSource code.factorySource code RecordSource code FiniteDecompSource code (TSource code :Source code TypeSource code) (RSource code :Source code pzRingTypeSource code) (f : T -> R) :=
{ fimfunE : exists (rSource code : seq R) (A_Source code : R -> set T),
forall xSource code, f x = \sum_(ySource code <- r) (y * \1_(A_ y) x) }.
HBSource code.buildersSource code ContextSource code TSource code RSource code fSource code &Source code @FiniteDecompSource code T R f.
Lemma finite_subproofSource code: @FiniteImage T R f.
Proof.
suff -> : f = \sum_(ySource code <- r) cst_fimfun y * indic_fimfun (A_ y) by [].
by apply/funext=> x; rewrite fE fimfun_sum.
Qed.
HBSource code.endSource code.
Section Tietze.
Context {XSource code : topologicalType} {RSource code : realType}.
Hypothesis normalXSource code : normal_space X.
Lemma urysohn_ext_itvSource code ASource code BSource code xSource code ySource code :
closed A -> closed B -> A `&` B = set0 -> x < y ->
exists fSource code : X -> R, [/\ continuous f,
f @` A `<=` [set x], f @` B `<=` [set y] & range f `<=` `[x, y]].
Proof.
have /(@uniform_separatorP _ R)[f [cf f01 f0 f1]] := urysohn_ext R _ _ cA cB A0.
pose g : X -> R := line_path x y \o f; exists g; split; rewrite /g /=.
move=> t; apply: continuous_comp; first exact: cf.
apply: (@continuousD R R^o).
apply: continuousM; last exact: cst_continuous.
by apply: (@continuousB _ R^o) => //; exact: cst_continuous.
by apply: continuousM => //; exact: cst_continuous.
- by rewrite -image_comp => z /= [? /f0 -> <-]; rewrite line_path0.
- by rewrite -image_comp => z /= [? /f1 -> <-]; rewrite line_path1.
- rewrite -image_comp; apply: (subset_trans (image_subset _ f01)).
by rewrite range_line_path.
Qed.
Context (ASource code : set X).
Hypothesis clASource code : closed A.
Local Lemma tietze_step'Source code (fSource code : X -> R) (MSource code : R) :
0 < M -> {within A, continuous f} ->
(forall xSource code, A x -> `|f x| <= M) ->
exists gSource code : X -> R, [/\ continuous g,
(forall xSource code, A x -> `|f x - g x| <= 2/3 * M) &
(forall xSource code, `|g x| <= 1/3 * M)].
Proof.
have [] := @urysohn_ext_itv (A `&` f @^-1` `]-oo, -(1/3) * M%:num])
(A `&` f @^-1` `[1/3 * M%:num,+oo[) (-(1/3) * M%:num) (1/3 * M%:num).
- by rewrite closed_setSI//; exact: preimage_closed.
- by rewrite closed_setSI//; apply: preimage_closed => //; exact: interval_closed.
- rewrite setIACA -preimage_setI eqEsubset; split => z // [_ []].
rewrite !set_itvE/= => /[swap] /le_trans /[apply].
by rewrite leNgt mulNr gtrN// mulr_gt0// divr_gt0.
- by rewrite mulNr gtrN// mulr_gt0//.
move=> g [ctsg gL3 gR3 grng]; exists g; split => //; first last.
by move=> x; rewrite ler_norml -mulNr; apply: grng; exists x.
move=> x Ax; have := fA1 _ Ax; rewrite 2!ler_norml => /andP[Mfx fxM].
have [xL|xL] := leP (f x) (-(1/3) * M%:num).
have: [set g x | xSource code in A `&` f@^-1` `]-oo, -(1/3) * M%:num]] (g x) by exists x.
move/gL3=> ->; rewrite !mulNr opprK; apply/andP; split.
by rewrite -lerBlDr -opprD -2!mulrDl natr1 divff// mul1r.
rewrite -lerBrDr -2!mulrBl -(@natrB _ 2 1)// (le_trans xL)//.
by rewrite ler_pM2r// ltW// gtrN// divr_gt0.
have [xR|xR] := lerP (1/3 * M%:num) (f x).
have : [set g x | xSource code in A `&` f@^-1` `[1/3 * M%:num, +oo[] (g x).
by exists x => //; split => //; rewrite /= in_itv //= xR.
move/gR3 => ->; apply/andP; split.
rewrite lerBrDl -2!mulrBl (le_trans _ xR)// ler_pM2r//.
by rewrite ler_wpM2r ?invr_ge0 ?ler0n// lerBlDl natr1 ler1n.
by rewrite lerBlDl -2!mulrDl nat1r divff ?mul1r.
have /andP[ng3 pg3] : -(1/3) * M%:num <= g x <= 1/3 * M%:num.
by apply: grng; exists x.
rewrite ?(intrD _ 1 1) !mulrDl; apply/andP; split.
by rewrite opprD lerB// -mulNr ltW.
by rewrite (lerD (ltW _))// lerNl -mulNr.
Qed.
Let tietze_stepSource code (fSource code : X -> R) MSource code :
{gSource code : X -> R^o | {within A, continuous f} -> 0 < M ->
(forall xSource code, A x -> `|f x| <= M) -> [/\ continuous g,
forall xSource code, A x -> `|f x - g x| <= 2/3 * M :>R
& forall xSource code, `|g x| <= 1/3 * M ]}.
Proof.
Let onem_twothirdsSource code : 1 - 2/3 = 1/3 :> R.
- mathcomp.analysis.lebesgue_integral_theory.lebesgue_integral_differentiation
Source code (fSource code : X -> R^o) MSource code :
0 < M -> {within A, continuous f} -> (forall xSource code, A x -> `|f x| <= M) ->
exists gSource code, [/\ {in A, f =1 g}, continuous g & forall xSource code, `|g x| <= M].
Proof.
have MN0 n : 0 < M2d3 n by rewrite /M2d3 /geometric /mk_sequence.
pose f_ := fix F nSource code :=
if n is n.+1 then F n - projT1 (tietze_step (F n) (M2d3 n)) else f.
pose g_ nSource code := projT1 (tietze_step (f_ n) (M2d3 n)).
have fgE n : f_ n - f_ n.+1 = g_ n by rewrite /= opprB addrC subrK.
have twothirds1 : `|2/3| < 1 :> R.
by rewrite gtr0_norm//= ltr_pdivrMr// mul1r ltr_nat.
have f_geo n : {within A, continuous f_ n} /\
(forall xSource code, A x -> `|f_ n x| <= geometric M%:num (2/3) n).
elim: n => [|n [ctsN bdN]]; first by split=> //= x ?; rewrite expr0 mulr1 fbd.
have [cg bdNS bd2] := projT2 (tietze_step (f_ n) _) ctsN (MN0 n) bdN.
split=> [x|]; first by apply: cvgB; [exact:ctsN|exact/continuous_subspaceT/cg].
by move=> x Ax; rewrite (le_trans (bdNS _ Ax))// /M2d3/= mulrCA -exprS.
have g_cts n : continuous (g_ n).
by have [? ?] := f_geo n; case: (projT2 (tietze_step (f_ n) _) _ (MN0 n)).
have g_bd n : forall xSource code, `|g_ n x| <= geometric ((1/3) * M%:num) (2/3) n.
have [ctsN bdfN] := f_geo n; rewrite /geometric /= -[_ * M%:num * _]mulrA.
by have [_ _] := projT2 (tietze_step (f_ n) _) ctsN (MN0 n) bdfN.
pose h_ : nat -> arrow_uniform_type X R^o := @series {uniform X -> _} g_.
have cvgh' : cvg (h_ @ \oo).
apply/cauchy_cvgP/cauchy_ballP => eps epos; near_simpl.
suff : \forall xSource code & x'Source code \near \oo, (x' <= x)%N -> ball (h_ x) eps (h_ x').
move=>/[dup]; rewrite {1}near_swap; apply: filter_app2; near=> n m.
by have /orP[mn /(_ mn)/ball_sym + _| ? _] := leq_total n m; apply.
near=> n m; move=> /= MN; rewrite /ball /= /h_ => t; rewrite /ball /=.
rewrite -[X in `|X|]/((series g_ n - series g_ m) t) sub_series MN fct_sumE.
rewrite (le_lt_trans (ler_norm_sum _ _ _))//.
rewrite (le_lt_trans (ler_sum _ (fun iSource code _ => g_bd i t)))// -mulr_sumr.
rewrite -(subnKC MN) geometric_partial_tail.
pose L := (1/3) * M%:num * ((2/3) ^+ m / (1 - (2/3))).
apply: (@le_lt_trans _ _ L); first by rewrite ler_pM2l // geometric_le_lim.
rewrite /L onem_twothirds.
rewrite [_ ^+ _ * _ ^-1]mulrC mulrA -[x in x < _]ger0_norm; first by [].
near: m; near_simpl; move: eps epos.
by apply: (cvgr0_norm_lt (fun _ => _ : R^o)); exact: cvg_geometric.
have cvgh : {uniform, h_ @ \oo --> lim (h_ @ \oo)}.
by move=> ?; rewrite /= uniform_nbhsT; exact: cvgh'.
exists (lim (h_ @ \oo)); split.
- move=> t /set_mem At; have /pointwise_cvgP/(_ t)/(cvg_lim (@Rhausdorff _)) :=
[elaborate pointwise_uniform_cvg _ cvgh].
rewrite -fmap_comp /comp /h_ => <-; apply/esym/(@cvg_lim _ (@Rhausdorff R)).
apply: (@cvg_zero _ R^o); apply: norm_cvg0; under eq_fun => n.
rewrite distrC /series /cst /= -mulN1r fct_sumE mulr_sumr.
under [fun _ : nat => _]eq_fun => ? do rewrite mulN1r -fgE opprB.
rewrite telescope_sumr //= subrKC.
over.
apply/norm_cvg0P/cvgr0Pnorm_lt => eps epos.
have /(_ _ epos) := @cvgr0_norm_lt R _ _ _ eventually_filter (_ : nat -> R^o)
(cvg_geometric M%:num twothirds1).
apply: filter_app; near_simpl; apply: nearW => n /le_lt_trans; apply.
by rewrite (le_trans ((f_geo n).2 _ _)) // ler_norm.
- apply: (@uniform_limit_continuous X _ (h_ @ \oo) (lim (h_ @ \oo))) =>//.
near_simpl; apply: nearW; elim.
by rewrite /h_ /series /= big_geq// => ?; exact: cst_continuous.
move=> n; rewrite /h_ /series /= big_nat_recr /= // => IH t.
by apply: continuousD; [exact: IH|exact: g_cts].
- move=> t.
have /pointwise_cvgP/(_ t)/(cvg_lim (@Rhausdorff _)) :=
[elaborate pointwise_uniform_cvg _ cvgh].
rewrite -fmap_comp /comp /h_ => <-.
under [fun _ : nat => _]eq_fun => ? do rewrite /series /= fct_sumE.
have cvg_gt : cvgn [normed series (g_^~ t)].
apply: (series_squeeze_is_cvgn _ _ (g_bd ^~ t)
(is_cvg_geometric_series _)) => //.
by move=> n; rewrite mulr_ge0.
rewrite (le_trans (lim_series_norm _))//; apply: le_trans.
exact/(lim_series_le cvg_gt _ (g_bd ^~ t))/is_cvg_geometric_series.
rewrite (cvg_lim _ (cvg_geometric_series _))//; first exact: Rhausdorff.
by rewrite onem_twothirds mulrAC divff mul1r.
Unshelve. all: by end_near. Qed.
End Tietze.