Module mathcomp.analysis.lebesgue_integral_theory.simple_functions
From HB Require Import structures.From mathcomp Require Import all_ssreflect_compat ssralg ssrnum ssrint interval.
From mathcomp Require Import interval_inference archimedean finmap.
From mathcomp Require Import mathcomp_extra boolp classical_sets functions.
From mathcomp Require Import cardinality reals fsbigop ereal topology tvs.
From mathcomp Require Import normedtype sequences real_interval esum measure.
From mathcomp Require Import lebesgue_measure numfun realfun measurable_realfun.
Reserved Notation "{ 'nnfun' aT >-> T }"
(at level 0, format "{ 'nnfun' aT >-> T }").
Reserved Notation "[ 'nnfun' 'of' f ]"
(at level 0, format "[ 'nnfun' 'of' f ]").
Reserved Notation "{ 'nnsfun' aT >-> T }"
(at level 0, format "{ 'nnsfun' aT >-> T }").
Reserved Notation "[ 'nnsfun' 'of' f ]"
(at level 0, format "[ 'nnsfun' 'of' f ]").
Reserved Notation "{ 'sfun' aT >-> T }"
(at level 0, format "{ 'sfun' aT >-> T }").
Reserved Notation "[ 'sfun' 'of' f ]"
(at level 0, format "[ 'sfun' 'of' f ]").
Set 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.
Module HBSimple.
HB.structure Definition SimpleFun d (aT : sigmaRingType d) (rT : realType) :=
{f of @isMeasurableFun d _ aT rT f & @FiniteImage aT rT f}.
End HBSimple.
Notation "{ 'sfun' aT >-> T }" := (@HBSimple.SimpleFun.type _ aT T) : form_scope.
Notation "[ 'sfun' 'of' f ]" := [the {sfun _ >-> _} of f] : form_scope.
Module HBNNSimple.
Import HBSimple.
HB.structure Definition NonNegSimpleFun
d (aT : sigmaRingType d) (rT : realType) :=
{f of @SimpleFun d _ _ f & @NonNegFun aT rT f}.
End HBNNSimple.
Notation "{ 'nnsfun' aT >-> T }" := (@HBNNSimple.NonNegSimpleFun.type _ aT%type T) : form_scope.
Notation "[ 'nnsfun' 'of' f ]" := [the {nnsfun _ >-> _} of f] : form_scope.
Section sfun_pred.
Context {d} {aT : sigmaRingType d} {rT : realType}.
Definition
sfun : forall {d : measure_display} {aT : sigmaRingType d} {rT : realType}, {pred aT -> rT} sfun is not universe polymorphic Arguments sfun {d}%_measure_display_scope {aT rT} _ sfun is transparent Expands to: Constant mathcomp.analysis.lebesgue_integral_theory.simple_functions.sfun Declared in library mathcomp.analysis.lebesgue_integral_theory.simple_functions, line 96, characters 11-15
Definition
sfun_key : forall {d : measure_display} {aT : sigmaRingType d} {rT : realType}, pred_key (T:=aT -> rT) sfun sfun_key is not universe polymorphic Arguments sfun_key {d}%_measure_display_scope {aT rT} sfun_key is opaque Expands to: Constant mathcomp.analysis.lebesgue_integral_theory.simple_functions.sfun_key Declared in library mathcomp.analysis.lebesgue_integral_theory.simple_functions, line 97, characters 11-19
Proof.
sfun_keyed : forall {d : measure_display} {aT : sigmaRingType d} {rT : realType}, keyed_pred sfun_key sfun_keyed is not universe polymorphic Arguments sfun_keyed {d}%_measure_display_scope {aT rT} sfun_keyed is transparent Expands to: Constant mathcomp.analysis.lebesgue_integral_theory.simple_functions.sfun_keyed Declared in library mathcomp.analysis.lebesgue_integral_theory.simple_functions, line 98, characters 10-20
Lemma sub_sfun_mfun : {subset sfun <= mfun}
Proof.
Proof.
Section sfun.
Context {d} {aT : measurableType d} {rT : realType}.
Notation T := {sfun aT >-> rT}.
Notation sfun := (@sfun _ aT rT).
Section Sub.
Context (f : aT -> rT) (fP : f \in sfun).
Definition
sfun_Sub1_subproof : forall {d : measure_display} {aT : measurableType d} {rT : realType} [f : aT -> rT], f \in sfun -> isMeasurableFun.axioms_ d default_measure_display aT rT f sfun_Sub1_subproof is not universe polymorphic Arguments sfun_Sub1_subproof {d}%_measure_display_scope {aT rT} [f]%_function_scope fP sfun_Sub1_subproof is transparent Expands to: Constant mathcomp.analysis.lebesgue_integral_theory.simple_functions.sfun_Sub1_subproof Declared in library mathcomp.analysis.lebesgue_integral_theory.simple_functions, line 109, characters 11-29
@isMeasurableFun.Build d _ aT rT f (set_mem (sub_sfun_mfun fP)).
#[local] HB.instance Definition _ := sfun_Sub1_subproof.
Definition
sfun_Sub2_subproof : forall {d : measure_display} {aT : measurableType d} {rT : realType} [f : aT -> rT], f \in sfun -> cardinality.FiniteImage.axioms_ aT rT f sfun_Sub2_subproof is not universe polymorphic Arguments sfun_Sub2_subproof {d}%_measure_display_scope {aT rT} [f]%_function_scope fP sfun_Sub2_subproof is transparent Expands to: Constant mathcomp.analysis.lebesgue_integral_theory.simple_functions.sfun_Sub2_subproof Declared in library mathcomp.analysis.lebesgue_integral_theory.simple_functions, line 112, characters 11-29
@FiniteImage.Build aT rT f (set_mem (sub_sfun_fimfun fP)).
Import HBSimple.
#[local] HB.instance Definition _ := sfun_Sub2_subproof.
Definition
sfun_Sub : forall {d : measure_display} {aT : measurableType d} {rT : realType} [f : aT -> rT], f \in sfun -> {sfun aT >-> rT} sfun_Sub is not universe polymorphic Arguments sfun_Sub {d}%_measure_display_scope {aT rT} [f]%_function_scope fP sfun_Sub is transparent Expands to: Constant mathcomp.analysis.lebesgue_integral_theory.simple_functions.sfun_Sub Declared in library mathcomp.analysis.lebesgue_integral_theory.simple_functions, line 118, characters 11-19
End Sub.
Lemma sfun_rect (K : T -> Type) :
(forall f (Pf : f \in sfun), K (sfun_Sub Pf)) -> forall u : T, K u.
Proof.
have -> : Pf1 = set_mem (sub_sfun_mfun Pf) by [].
have -> : Pf2 = set_mem (sub_sfun_fimfun Pf) by [].
exact: Ksub.
Qed.
Import HBSimple.
Lemma sfun_valP f (Pf : f \in sfun) : sfun_Sub Pf = f :> (_ -> _).
Proof.
HB.instance Definition _ := isSub.Build _ _ T sfun_rect sfun_valP.
Lemma sfuneqP (f g : {sfun aT >-> rT}) : f = g <-> f =1 g.
HB.instance Definition _ := [Choice of {sfun aT >-> rT} by <:].
HB.instance Definition _ x : @FImFun aT rT (cst x) := FImFun.on (cst x).
Definition
cst_sfun : forall {d : measure_display} {aT : measurableType d} {rT : realType}, rT -> {sfun aT >-> rT} cst_sfun is not universe polymorphic Arguments cst_sfun {d}%_measure_display_scope {aT rT} x%_ring_scope cst_sfun is transparent Expands to: Constant mathcomp.analysis.lebesgue_integral_theory.simple_functions.cst_sfun Declared in library mathcomp.analysis.lebesgue_integral_theory.simple_functions, line 145, characters 11-19
Lemma cst_sfunE x : @cst_sfun x =1 cst x
Proof.
End sfun.
Lemma fctD (T : pointedType) (K : pzRingType) (f g : T -> K) : f + g = f \+ g.
Proof.
Proof.
Proof.
k *: f = k \*: f.
Proof.
Definition
fctWE : (forall (T : pointedType) (K : pzRingType) (f g : T -> K), (f + g)%R = (f \+ g)%R) * (forall (T : pointedType) (K : pzRingType) (f : T -> K), (- f)%R = (\- f)%R) * (forall (T : pointedType) (K : pzRingType) (f g : T -> K), (f * g)%R = (f \* g)%R) * (forall (T : pointedType) (K : pzRingType) (L : lmodType K) (k : K) (f : T -> L), (k *: f)%R = (k \*: f)%R) fctWE is not universe polymorphic fctWE is transparent Expands to: Constant mathcomp.analysis.lebesgue_integral_theory.simple_functions.fctWE Declared in library mathcomp.analysis.lebesgue_integral_theory.simple_functions, line 162, characters 11-16
Section ring.
Context d (aT : measurableType d) (rT : realType).
Lemma sfun_subring_closed : subring_closed (@sfun d aT rT).
Proof.
HB.instance Definition _ := GRing.isSubringClosed.Build _ sfun
sfun_subring_closed.
HB.instance Definition _ := [SubChoice_isSubComNzRing of {sfun aT >-> rT} by <:].
Implicit Types (f g : {sfun aT >-> rT}).
Import HBSimple.
Lemma sfun0 : (0 : {sfun aT >-> rT}) =1 cst 0
Proof.
Proof.
Proof.
Proof.
Proof.
Proof.
(\sum_(i <- r | P i) f i) x = \sum_(i <- r | P i) f i x.
Proof.
(\sum_(i <- r | P i) f i) x = \sum_(i <- r | P i) f i x.
Proof.
HB.instance Definition _ f g := MeasurableFun.copy (f \+ g) (f + g).
HB.instance Definition _ f g := MeasurableFun.copy (\- f) (- f).
HB.instance Definition _ f g := MeasurableFun.copy (f \- g) (f - g).
HB.instance Definition _ f g := MeasurableFun.copy (f \* g) (f * g).
Import HBSimple.
HB.instance Definition _ (D : set aT) (mD : measurable D) :
@FImFun aT rT (mindic _ mD) := FImFun.on (mindic _ mD).
Definition
indic_sfun : forall {d : measure_display} {aT : measurableType d} {rT : realType} (D : set aT), d.-measurable%classic D -> {sfun aT >-> rT} indic_sfun is not universe polymorphic Arguments indic_sfun {d}%_measure_display_scope {aT rT} D%_classical_set_scope mD indic_sfun is transparent Expands to: Constant mathcomp.analysis.lebesgue_integral_theory.simple_functions.indic_sfun Declared in library mathcomp.analysis.lebesgue_integral_theory.simple_functions, line 206, characters 11-21
mindic rT mD.
HB.instance Definition _ k f := MeasurableFun.copy (k \o* f) (f * cst_sfun k).
Definition
scale_sfun : forall [d : measure_display] [aT : measurableType d] [rT : realType], rT -> {sfun aT >-> rT} -> {sfun aT >-> rT} scale_sfun is not universe polymorphic Arguments scale_sfun [d]%_measure_display_scope [aT rT] k%_ring_scope f scale_sfun is transparent Expands to: Constant mathcomp.analysis.lebesgue_integral_theory.simple_functions.scale_sfun Declared in library mathcomp.analysis.lebesgue_integral_theory.simple_functions, line 210, characters 11-21
End ring.
Arguments indic_sfun {d aT rT} _.
Lemma preimage_nnfun0 T (R : realDomainType) (f : {nnfun T >-> R}) t :
t < 0 -> f @^-1` [set t] = set0.
Proof.
Lemma preimage_cstM T (R : realFieldType) (x y : R) (f : T -> R) :
x != 0 -> (cst x \* f) @^-1` [set y] = f @^-1` [set y / x].
Proof.
Lemma preimage_add T (R : numDomainType) (f g : T -> R) z :
(f \+ g) @^-1` [set z] = \bigcup_(a in f @` setT)
((f @^-1` [set a]) `&` (g @^-1` [set z - a])).
Proof.
Section simple_bounded.
Context d (T : sigmaRingType d) (R : realType).
Import HBSimple.
Lemma simple_bounded (f : {sfun T >-> R}) : bounded_fun f.
Proof.
exists (fine (\big[maxe/-oo%E]_(i <- r) `|i|%:E)).
split; rewrite ?num_real// => x mx z _; apply/ltW/(le_lt_trans _ mx).
have ? : f z \in r by have := imageT f z; rewrite fr.
rewrite -[leLHS]/(fine `|f z|%:E) fine_le//.
(* TODO: generalize the statement of bigmaxe_fin_num *)
have := @bigmaxe_fin_num _ (map normr r) `|f z|.
by rewrite big_map => ->//; apply/mapP; exists (f z).
by rewrite (unstable.bigmax_sup_seq _ _ (lexx _)).
Qed.
End simple_bounded.
Section nnsfun_functions.
Context d (T : measurableType d) (R : realType).
Import HBNNSimple.
Lemma cst_nnfun_subproof (x : {nonneg R}) : forall t : T, 0 <= cst x%:num t.
Proof.
(cst_nnfun_subproof x).
Definition
cst_nnsfun : forall [d : measure_display] (T : measurableType d) [R : realType], {nonneg R}%R -> {nnsfun T >-> R} cst_nnsfun is not universe polymorphic Arguments cst_nnsfun [d]%_measure_display_scope T [R] r cst_nnsfun is transparent Expands to: Constant mathcomp.analysis.lebesgue_integral_theory.simple_functions.cst_nnsfun Declared in library mathcomp.analysis.lebesgue_integral_theory.simple_functions, line 269, characters 11-21
Definition
nnsfun0 : forall {d : measure_display} {T : measurableType d} {R : realType}, {nnsfun T >-> R} nnsfun0 is not universe polymorphic Arguments nnsfun0 {d}%_measure_display_scope {T R} nnsfun0 is transparent Expands to: Constant mathcomp.analysis.lebesgue_integral_theory.simple_functions.nnsfun0 Declared in library mathcomp.analysis.lebesgue_integral_theory.simple_functions, line 271, characters 11-18
Lemma indic_nnfun_subproof (D : set T) : forall x, 0 <= (\1_D) x :> R.
Proof.
HB.instance Definition _ D := @isNonNegFun.Build T R \1_D
(indic_nnfun_subproof D).
HB.instance Definition _ D (mD : measurable D) :
@NonNegFun T R (mindic R mD) := NonNegFun.on (mindic R mD).
End nnsfun_functions.
Arguments nnsfun0 {d T R}.
Section nnfun_bin.
Variables (T : Type) (R : numDomainType) (f g : {nnfun T >-> R}).
Lemma add_nnfun_subproof : @isNonNegFun T R (f \+ g).
HB.instance Definition _ := add_nnfun_subproof.
Lemma mul_nnfun_subproof : @isNonNegFun T R (f \* g).
HB.instance Definition _ := mul_nnfun_subproof.
Lemma max_nnfun_subproof : @isNonNegFun T R (f \max g).
HB.instance Definition _ := max_nnfun_subproof.
End nnfun_bin.
Section nnsfun_bin.
Context d (T : measurableType d) (R : realType).
Variables f g : {nnsfun T >-> R}.
Import HBNNSimple.
HB.instance Definition _ := MeasurableFun.on (f \+ g).
Definition
add_nnsfun : forall {d : measure_display} {T : measurableType d} {R : realType}, {nnsfun T >-> R} -> {nnsfun T >-> R} -> {nnsfun T >-> R} add_nnsfun is not universe polymorphic Arguments add_nnsfun {d}%_measure_display_scope {T R} f g add_nnsfun is transparent Expands to: Constant mathcomp.analysis.lebesgue_integral_theory.simple_functions.add_nnsfun Declared in library mathcomp.analysis.lebesgue_integral_theory.simple_functions, line 309, characters 11-21
HB.instance Definition _ := MeasurableFun.on (f \* g).
Definition
mul_nnsfun : forall {d : measure_display} {T : measurableType d} {R : realType}, {nnsfun T >-> R} -> {nnsfun T >-> R} -> {nnsfun T >-> R} mul_nnsfun is not universe polymorphic Arguments mul_nnsfun {d}%_measure_display_scope {T R} f g mul_nnsfun is transparent Expands to: Constant mathcomp.analysis.lebesgue_integral_theory.simple_functions.mul_nnsfun Declared in library mathcomp.analysis.lebesgue_integral_theory.simple_functions, line 312, characters 11-21
HB.instance Definition _ := MeasurableFun.on (f \max g).
Definition
max_nnsfun : forall {d : measure_display} {T : measurableType d} {R : realType}, {nnsfun T >-> R} -> {nnsfun T >-> R} -> {nnsfun T >-> R} max_nnsfun is not universe polymorphic Arguments max_nnsfun {d}%_measure_display_scope {T R} f g max_nnsfun is transparent Expands to: Constant mathcomp.analysis.lebesgue_integral_theory.simple_functions.max_nnsfun Declared in library mathcomp.analysis.lebesgue_integral_theory.simple_functions, line 315, characters 11-21
Definition
indic_nnsfun : forall [d : measure_display] [T : measurableType d] (R : realType) [A : set T], d.-measurable%classic A -> {nnsfun T >-> R} indic_nnsfun is not universe polymorphic Arguments indic_nnsfun [d]%_measure_display_scope [T] R [A]%_classical_set_scope mA indic_nnsfun is transparent Expands to: Constant mathcomp.analysis.lebesgue_integral_theory.simple_functions.indic_nnsfun Declared in library mathcomp.analysis.lebesgue_integral_theory.simple_functions, line 317, characters 11-23
End nnsfun_bin.
Arguments add_nnsfun {d T R} _ _.
Arguments mul_nnsfun {d T R} _ _.
Arguments max_nnsfun {d T R} _ _.
Definition
scale_nnsfun : forall [d : measure_display] [T : measurableType d] [R : realType], {nnsfun T >-> R} -> forall [k : R], (0 <= k)%R -> {nnsfun T >-> R} scale_nnsfun is not universe polymorphic Arguments scale_nnsfun [d]%_measure_display_scope [T R] f [k]%_ring_scope k0 scale_nnsfun is transparent Expands to: Constant mathcomp.analysis.lebesgue_integral_theory.simple_functions.scale_nnsfun Declared in library mathcomp.analysis.lebesgue_integral_theory.simple_functions, line 324, characters 11-23
(f : {nnsfun T >-> R}) (k : R) (k0 : 0 <= k) :=
mul_nnsfun (cst_nnsfun T (NngNum k0)) f.
Definition
proj_nnsfun : forall [d : measure_display] [T : measurableType d] [R : realType], {nnsfun T >-> R} -> forall [A : set T], d.-measurable%classic A -> {nnsfun T >-> R} proj_nnsfun is not universe polymorphic Arguments proj_nnsfun [d]%_measure_display_scope [T R] f [A]%_classical_set_scope mA proj_nnsfun is transparent Expands to: Constant mathcomp.analysis.lebesgue_integral_theory.simple_functions.proj_nnsfun Declared in library mathcomp.analysis.lebesgue_integral_theory.simple_functions, line 328, characters 11-22
(f : {nnsfun T >-> R}) (A : set T) (mA : measurable A) :=
mul_nnsfun f (indic_nnsfun R mA).
Section mrestrict.
Import HBNNSimple.
Lemma mrestrict d (T : measurableType d) (R : realType) (f : {nnsfun T >-> R})
A (mA : measurable A) : f \_ A = proj_nnsfun f mA.
End mrestrict.
Section nnsfun_iter.
Context d (T : measurableType d) (R : realType) (D : set T).
Variable f : {nnsfun T >-> R}^nat.
Definition
sum_nnsfun : forall [d : measure_display] [T : measurableType d] [R : realType], {nnsfun T >-> R} ^nat -> nat -> {nnsfun T >-> R} sum_nnsfun is not universe polymorphic Arguments sum_nnsfun [d]%_measure_display_scope [T R] f n%_nat_scope sum_nnsfun is transparent Expands to: Constant mathcomp.analysis.lebesgue_integral_theory.simple_functions.sum_nnsfun Declared in library mathcomp.analysis.lebesgue_integral_theory.simple_functions, line 348, characters 11-21
Import HBNNSimple.
Lemma sum_nnsfunE n t : sum_nnsfun n t = \sum_(i < n) (f i t).
Proof.
Definition
bigmax_nnsfun : forall [d : measure_display] [T : measurableType d] [R : realType], {nnsfun T >-> R} ^nat -> nat -> {nnsfun T >-> R} bigmax_nnsfun is not universe polymorphic Arguments bigmax_nnsfun [d]%_measure_display_scope [T R] f n%_nat_scope bigmax_nnsfun is transparent Expands to: Constant mathcomp.analysis.lebesgue_integral_theory.simple_functions.bigmax_nnsfun Declared in library mathcomp.analysis.lebesgue_integral_theory.simple_functions, line 355, characters 11-24
Lemma bigmax_nnsfunE n t : bigmax_nnsfun n t = \big[maxr/0]_(i < n) (f i t).
Proof.
End nnsfun_iter.
Section nnsfun_cover.
Local Open Scope ereal_scope.
Context d (T : measurableType d) (R : realType).
Variable f : {nnsfun T >-> R}.
Import HBNNSimple.
Lemma nnsfun_cover : \big[setU/set0]_(i \in range f) (f @^-1` [set i]) = setT.
Proof.
Lemma nnsfun_coverT : \big[setU/set0]_(i \in [set: R]) f @^-1` [set i] = setT.
Proof.
End nnsfun_cover.
Section measure_fsbig.
Local Open Scope ereal_scope.
Context d (T : measurableType d) (R : realType).
Variable m : {measure set T -> \bar R}.
Lemma measure_fsbig (I : choiceType) (A : set I) (F : I -> set T) :
finite_set A ->
(forall i, A i -> measurable (F i)) -> trivIset A F ->
m (\big[setU/set0]_(i \in A) F i) = \sum_(i \in A) m (F i).
Proof.
Import HBNNSimple.
Lemma additive_nnsfunr (g f : {nnsfun T >-> R}) x :
\sum_(i \in range g) m (f @^-1` [set x] `&` (g @^-1` [set i])) =
m (f @^-1` [set x] `&` \big[setU/set0]_(i \in range g) (g @^-1` [set i])).
Proof.
- by rewrite !fsbig_finite//= big_distrr.
- by move=> i Ai; apply: measurableI.
- exact/trivIset_setIl/trivIset_preimage1.
Qed.
Lemma additive_nnsfunl (g f : {nnsfun T >-> R}) x :
\sum_(i \in range g) m (g @^-1` [set i] `&` (f @^-1` [set x])) =
m (\big[setU/set0]_(i \in range g) (g @^-1` [set i]) `&` f @^-1` [set x]).
Proof.
End measure_fsbig.
Section mulem_ge0.
Local Open Scope ereal_scope.
Let mulef_ge0 (R : realDomainType) x (f : R -> \bar R) :
0 <= f x -> ((x < 0)%R -> f x = 0) -> 0 <= x%:E * f x.
Proof.
Lemma nnfun_muleindic_ge0 d (T : sigmaRingType d) (R : realDomainType)
(f : {nnfun T >-> R}) r z : 0 <= r%:E * (\1_(f @^-1` [set r]) z)%:E.
Proof.
Lemma mulemu_ge0 d (T : sigmaRingType d) (R : realType)
(mu : {measure set T -> \bar R}) x (A : R -> set T) :
((x < 0)%R -> A x = set0) -> 0 <= x%:E * mu (A x).
Global Arguments mulemu_ge0 {d T R mu x} A.
Import HBNNSimple.
Lemma nnsfun_mulemu_ge0 d (T : sigmaRingType d) (R : realType)
(mu : {measure set T -> \bar R}) (f : {nnsfun T >-> R}) x :
0 <= x%:E * mu (f @^-1` [set x]).
Proof.
End mulem_ge0.