Top source

Module mathcomp.analysis.lebesgue_integral_theory.simple_functions

From HB Require Import structures.
From mathcomp Require Import boot order 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.

# Simple functions This file contains a formalization of simple functions and with basic properties (addition, etc.). About the use of simple functions: Because of a limitation of HB <= 1.8.0, we need some care to be able to use simple functions. The structure SimpleFun (resp. NonNegSimpleFun) is located inside the module HBSimple (resp. HBNNSimple). As a consequence, we need to import HBSimple (resp. HBNNSimple) to use the coercion from simple functions (resp. non-negative simple functions) to Rocq functions. Also, assume that f (e.g., cst, indic) is equipped with the structure of MeasurableFun. For f to be equipped with the structure of SimpleFun (resp. NonNegSimpleFun), one need locally to import HBSimple (resp. HBNNSimple) and to instantiate FiniteImage (resp. NonNegFun) locally. Detailed contents: ```` {sfun T >-> R} == type of simple functions They form a (potentially zero) ring. {nnsfun T >-> R} == type of non-negative simple functions indic_sfun mD := mindic _ mD cst_sfun r == constant simple function cst_nnsfun r == constant simple function nnsfun0 := cst_nnsfun 0 add_nnsfun f g := f \+ g mul_nnsfun f g := f \* g max_nnsfun f g := f \max g proj_nssfun f mA == projection of the function f to the set A mA is a proof that A is measurable scale_nnsfun k f == scales f by the non-negative real number k sum_nnsfun f n := \big[add_nnsfun/nnsfun0]_(i < n) f i bigmax_nnsfun f n := \big[max_nnsfun/nnsfun0]_(i < n) f i ````

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 ]").

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.

Module
HBSimple
Source code
.
Import MeasurableR.

.
structure
Source code
Definition
Source code
SimpleFun
Source code
(
sigmaRingType
Source code
d) (rT : realType) :=
  { of @isMeasurableFun d _ aT rT f & @FiniteImage aT rT f}.

End HBSimple.

Notation
"{ 'sfun' aT >-> T }"
Source code
:= (@HBSimple.SimpleFun.type _ aT T) : form_scope.
Notation
"[ 'sfun' 'of' f ]"
Source code
:= [the {sfun _ >-> _} of f] : form_scope.

Module
HBNNSimple
Source code
.
Import HBSimple.

.
structure
Source code
Definition
Source code
NonNegSimpleFun
Source code

     (
sigmaRingType
Source code
d) (rT : realType) :=
  { of @SimpleFun d _ _ f & @NonNegFun aT rT f}.

End HBNNSimple.

Notation
"{ 'nnsfun' aT >-> T }"
Source code
:= (@HBNNSimple.NonNegSimpleFun.type _ aT%type T) : form_scope.
Notation
"[ 'nnsfun' 'of' f ]"
Source code
:= [the {nnsfun _ >-> _} of f] : form_scope.

Section sfun_pred.
Context {} { : sigmaRingType d} { : realType}.
Import MeasurableR.
Definition
sfun

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 99, characters 11-15


Source code
: {pred _ -> _} := [predI @mfun _ _ aT rT & fimfun].
Definition
sfun_key

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 100, characters 11-19


Source code
: pred_key sfun
Proof.
exact. Qed.
Canonical
sfun_keyed

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 101, characters 10-20


Source code
:= KeyedPred sfun_key.
Lemma
sub_sfun_mfun
Source code
: {subset sfun <= mfun}
Proof.
by move=> x /andP[]. Qed.
Lemma
sub_sfun_fimfun
Source code
: {subset sfun <= fimfun}
Proof.
by move=> x /andP[]. Qed.
End sfun_pred.

Section sfun.
Context {} { : measurableType d} { : realType}.
Notation := {sfun aT >-> rT}.
Notation := (@sfun _ aT rT).
Section Sub.
Context ( : aT -> rT) ( : f \in sfun).
Import MeasurableR.
Definition
sfun_Sub1_subproof

sfun_Sub1_subproof : forall {d : measure_display} {aT : measurableType d} {rT : realType} [f : aT -> rT], f \in sfun -> isMeasurableFun.axioms_ d lebesgue_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 113, characters 11-29


Source code
:=
  @isMeasurableFun.Build d _ aT rT f (set_mem (sub_sfun_mfun fP)).
#[local]
Source code
.
instance
Source code
Definition
Source code
sfun_Sub1_subproof
Source code
.
Definition
sfun_Sub2_subproof

sfun_Sub2_subproof : forall {d : measure_display} {aT : measurableType d} {rT : realType} [f : aT -> rT], f \in sfun -> 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 116, characters 11-29


Source code
:=
  @FiniteImage.Build aT rT f (set_mem (sub_sfun_fimfun fP)).

Import HBSimple.

#[local]
Source code
.
instance
Source code
Definition
Source code
sfun_Sub2_subproof
Source code
.
Definition
sfun_Sub

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 122, characters 11-19


Source code
:= [sfun of f].
End Sub.

Lemma
sfun_rect
Source code
( : T -> Type) :
  (forall ( : f \in sfun), K (sfun_Sub Pf)) -> forall : T, K u.
Proof.
move=> Ksub [f [[Pf1] [Pf2]]]; have Pf : f \in sfun by apply/andP; rewrite ?inE.
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
Source code
( : f \in sfun) : sfun_Sub Pf = f :> (_ -> _).
Proof.
by []. Qed.

.
instance
Source code
Definition
Source code
.Build _ _ T sfun_rect sfun_valP.

Lemma ( : {sfun aT >-> rT}) : f = g <-> f =1 g.
Proof.
by split=> [->//|fg]; apply/val_inj/funext. Qed.

.
instance
Source code
Definition
Source code
[Choice
Source code
of {sfun aT >-> rT} by <:].

Import MeasurableR.

.
instance
Source code
Definition
Source code
@FImFun
Source code
aT rT (cst x) := FImFun.on (cst x).

Definition
cst_sfun

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 151, characters 11-19


Source code
: {sfun aT >-> rT} := cst x.

Lemma
cst_sfunE
Source code
: @cst_sfun x =1 cst x
Proof.
by []. Qed.

End sfun.

Lemma ( : Type) ( : pzRingType) ( : T -> K) : f + g = f \+ g.
Proof.
by []. Qed.
Lemma ( : Type) ( : pzRingType) ( : T -> K) : - f = \- f.
Proof.
by []. Qed.
Lemma ( : Type) ( : pzRingType) ( : T -> K) : f * g = f \* g.
Proof.
by []. Qed.
Lemma ( : Type) ( : pzRingType) ( : lmodType K) ( : T -> L) :
   k *: f = k \*: f.
Proof.
by []. Qed.
Arguments cst _ _ _ _ /.
Definition
fctWE

fctWE : (forall (T : Type) (K : pzRingType) (f g : T -> K), (f + g)%R = (f \+ g)%R) * (forall (T : Type) (K : pzRingType) (f : T -> K), (- f)%R = (\- f)%R) * (forall (T : Type) (K : pzRingType) (f g : T -> K), (f * g)%R = (f \* g)%R) * (forall (T : Type) (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 168, characters 11-16


Source code
:= (fctD, fctN, fctM, fctZ).

Section ring.
Context ( : measurableType d) ( : realType).

Lemma
sfun_subring_closed
Source code
: subring_closed (@sfun d aT rT).
Proof.
by split=> [|f g|f g]; rewrite ?inE/= ?rpred1//;
   move=> /andP[/= mf ff] /andP[/= mg fg]; rewrite !(rpredB, rpredM).
Qed.

.
instance
Source code
Definition
Source code
.isSubringClosed.Build _ sfun
  sfun_subring_closed.
.
instance
Source code
Definition
Source code
[SubChoice_isSubComPzRing
Source code
of {sfun aT >-> rT} by <:].

Implicit Types (f g : {sfun aT >-> rT}).

Import HBSimple.

Lemma : (0 : {sfun aT >-> rT}) =1 cst 0
Proof.
by []. Qed.
Lemma : (1 : {sfun aT >-> rT}) =1 cst 1
Proof.
by []. Qed.
Lemma : - f =1 \- f
Proof.
by []. Qed.
Lemma : f + g =1 f \+ g
Proof.
by []. Qed.
Lemma : f - g =1 f \- g
Proof.
by []. Qed.
Lemma : f * g =1 f \* g
Proof.
by []. Qed.
Lemma
sfun_sum
Source code
( : {pred I}) ( : I -> {sfun aT >-> rT}) ( : aT) :
  (\sum_( <- r | P i) f i) x = \sum_( <- r | P i) f i x.
Proof.
by elim/big_rec2: _ => //= i y ? Pi <-. Qed.
Lemma
sfun_prod
Source code
( : {pred I}) ( : I -> {sfun aT >-> rT}) ( : aT) :
  (\sum_( <- r | P i) f i) x = \sum_( <- r | P i) f i x.
Proof.
by elim/big_rec2: _ => //= i y ? Pi <-. Qed.
Lemma : f ^+ n =1 (fun => f x ^+ n).
Proof.
by move=> x; elim: n => [|n IHn]//; rewrite !exprS sfunM/= IHn. Qed.

Import MeasurableR.

.
instance
Source code
Definition
Source code
MeasurableFun
Source code
.copy (f \+ g) (f + g).
.
instance
Source code
Definition
Source code
MeasurableFun
Source code
.copy (\- f) (- f).
.
instance
Source code
Definition
Source code
MeasurableFun
Source code
.copy (f \- g) (f - g).
.
instance
Source code
Definition
Source code
MeasurableFun
Source code
.copy (f \* g) (f * g).

Import HBSimple.

.
instance
Source code
Definition
Source code
( aT) (mD : measurable D) :
   @FImFun aT rT (mindic _ mD) := FImFun.on (mindic _ mD).
Definition
indic_sfun

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 214, characters 11-21


Source code
( : set aT) ( : measurable D) : {sfun aT >-> rT} :=
  mindic rT mD.

.
instance
Source code
Definition
Source code
MeasurableFun
Source code
.copy (k \o* f) (f * cst_sfun k).
Definition
scale_sfun

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 218, characters 11-21


Source code
: {sfun aT >-> rT} := k \o* f.

End ring.
Arguments indic_sfun {d aT rT} _.

Lemma
preimage_nnfun0
Source code
( : realDomainType) ( : {nnfun T >-> R}) :
  t < 0 -> f @^-1` [set t] = set0.
Proof.
move=> t0.
by apply/preimage10 => -[x _]; apply: contraPnot t0 => <-; rewrite le_gtF.
Qed.

Lemma
preimage_cstM
Source code
( : realFieldType) ( : R) ( : T -> R) :
  x != 0 -> (cst x \* f) @^-1` [set y] = f @^-1` [set y / x].
Proof.
move=> x0; apply/seteqP.
by split=> [z/= <-|z/= ->]; rewrite [x * _]mulrC (mulfK, divfK).
Qed.

Section simple_bounded.
Context ( : sigmaRingType d) ( : realType).

Import HBSimple.

Lemma
simple_bounded
Source code
( : {sfun T >-> R}) : bounded_fun f.
Proof.
have /finite_seqP[r fr] := fimfunP f.
exists (fine (\big[maxe/-oo%E]_( <- 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 ( : measurableType d) ( : realType).

Import HBNNSimple.
Import MeasurableR.

Lemma
cst_nnfun_subproof
Source code
( : {nonneg R}) : forall : T, 0 <= cst x%:num t.
Proof.
by move=> /=. Qed.
.
instance
Source code
Definition
Source code
@isNonNegFun
Source code
.Build T R (cst x%:num)
  (cst_nnfun_subproof x).

Definition
cst_nnsfun

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 268, characters 11-21


Source code
( : {nonneg R}) : {nnsfun T >-> R} := cst r%:num.

Definition
nnsfun0

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 270, characters 11-18


Source code
: {nnsfun T >-> R} := cst_nnsfun 0%:nng.

Lemma
indic_nnfun_subproof
Source code
( : set T) : forall , 0 <= (\1_D) x :> R.
Proof.
by []. Qed.

.
instance
Source code
Definition
Source code
@isNonNegFun
Source code
.Build T R \1_D
  (indic_nnfun_subproof D).

.
instance
Source code
Definition
Source code
(
measurable
Source code
D) :
   @NonNegFun T R (mindic R mD) := NonNegFun.on (mindic R mD).

End nnsfun_functions.
Arguments nnsfun0 {d T R}.

Section nnfun_bin.
Variables ( : Type) ( : numDomainType) ( : {nnfun T >-> R}).

Lemma
add_nnfun_subproof
Source code
: @isNonNegFun T R (f \+ g).
Proof.
by split => x; rewrite addr_ge0//; apply/fun_ge0. Qed.
.
instance
Source code
Definition
Source code
add_nnfun_subproof
Source code
.

Lemma
mul_nnfun_subproof
Source code
: @isNonNegFun T R (f \* g).
Proof.
by split => x; rewrite mulr_ge0//; apply/fun_ge0. Qed.
.
instance
Source code
Definition
Source code
mul_nnfun_subproof
Source code
.

Lemma
max_nnfun_subproof
Source code
: @isNonNegFun T R (f \max g).
Proof.
by split => x /=; rewrite /maxr; case: ifPn => _; apply: fun_ge0. Qed.
.
instance
Source code
Definition
Source code
max_nnfun_subproof
Source code
.

End nnfun_bin.

Section nnsfun_bin.
Context ( : measurableType d) ( : realType).
Variables : {nnsfun T >-> R}.

Import HBNNSimple.
Import MeasurableR.

.
instance
Source code
Definition
Source code
MeasurableFun
Source code
.on (f \+ g).
Definition
add_nnsfun

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


Source code
: {nnsfun T >-> R} := f \+ g.

.
instance
Source code
Definition
Source code
MeasurableFun
Source code
.on (f \* g).
Definition
mul_nnsfun

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


Source code
: {nnsfun T >-> R} := f \* g.

.
instance
Source code
Definition
Source code
MeasurableFun
Source code
.on (f \max g).
Definition
max_nnsfun

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


Source code
: {nnsfun T >-> R} := f \max g.

Definition
indic_nnsfun

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


Source code
( : measurable A) : {nnsfun T >-> R} := mindic R mA.

End nnsfun_bin.
Arguments add_nnsfun {d T R} _ _.
Arguments mul_nnsfun {d T R} _ _.
Arguments max_nnsfun {d T R} _ _.

Definition
scale_nnsfun

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


Source code
( : measurableType d) ( : realType)
    ( : {nnsfun T >-> R}) ( : R) ( : 0 <= k) :=
  mul_nnsfun (cst_nnsfun T (NngNum k0)) f.

Definition
proj_nnsfun

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


Source code
( : measurableType d) ( : realType)
    ( : {nnsfun T >-> R}) ( : set T) ( : measurable A) :=
  mul_nnsfun f (indic_nnsfun R mA).

Section mrestrict.
Import HBNNSimple.

Lemma
mrestrict
Source code
( : measurableType d) ( : realType) ( : {nnsfun T >-> R})
   ( : measurable A) : f \_ A = proj_nnsfun f mA.
Proof.
apply/funext => x /=; rewrite /patch mindicE.
by case: ifP; rewrite (mulr0, mulr1).
Qed.

End mrestrict.

Section nnsfun_iter.
Context ( : measurableType d) ( : realType) ( : set T).
Variable : {nnsfun T >-> R}^nat.

Definition
sum_nnsfun

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


Source code
:= \big[add_nnsfun/nnsfun0]_( < n) f i.

Import HBNNSimple.

Lemma
sum_nnsfunE
Source code
: sum_nnsfun n t = \sum_( < n) (f i t).
Proof.
by rewrite /sum_nnsfun; elim/big_ind2 : _ => [|x g y h <- <-|]. Qed.

Definition
bigmax_nnsfun

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


Source code
:= \big[max_nnsfun/nnsfun0]_( < n) f i.

Lemma
bigmax_nnsfunE
Source code
: bigmax_nnsfun n t = \big[maxr/0]_( < n) (f i t).
Proof.
by rewrite /bigmax_nnsfun; elim/big_ind2 : _ => [|x g y h <- <-|]. Qed.

End nnsfun_iter.

Section nnsfun_cover.
Local Open Scope ereal_scope.
Context ( : measurableType d) ( : realType).
Variable : {nnsfun T >-> R}.

Import HBNNSimple.

Lemma
nnsfun_cover
Source code
: \big[setU/set0]_( \in range f) (f @^-1` [set i]) = setT.
Proof.
by rewrite fsbig_setU//= -subTset => x _; exists (f x). Qed.

Lemma
nnsfun_coverT
Source code
: \big[setU/set0]_( \in [set: R]) f @^-1` [set i] = setT.
Proof.
by rewrite -(fsbig_widen (range f)) ?nnsfun_cover//= => x [_ /preimage10].
Qed.

End nnsfun_cover.

Section measure_fsbig.
Local Open Scope ereal_scope.
Context ( : measurableType d) ( : realType).
Variable : {measure set T -> \bar R}.

Lemma
measure_fsbig
Source code
( : choiceType) ( : set I) ( : I -> set T) :
  finite_set A ->
  (forall , A i -> measurable (F i)) -> trivIset A F ->
  m (\big[setU/set0]_( \in A) F i) = \sum_( \in A) m (F i).
Proof.
move=> Afin Fm Ft.
by rewrite fsbig_finite// -measure_fin_bigcup// -bigsetU_fset_set.
Qed.

Import HBNNSimple.
Import MeasurableR.

Lemma
additive_nnsfunr
Source code
( : {nnsfun T >-> R}) :
  \sum_( \in range g) m (f @^-1` [set x] `&` (g @^-1` [set i])) =
  m (f @^-1` [set x] `&` \big[setU/set0]_( \in range g) (g @^-1` [set i])).
Proof.
rewrite -?measure_fsbig//.
- by move=> i Ai; apply: measurableI.
- exact/trivIset_setIl/trivIset_preimage1.
- by rewrite !fsbig_finite//= big_distrr.
Qed.

Lemma
additive_nnsfunl
Source code
( : {nnsfun T >-> R}) :
  \sum_( \in range g) m (g @^-1` [set i] `&` (f @^-1` [set x])) =
  m (\big[setU/set0]_( \in range g) (g @^-1` [set i]) `&` f @^-1` [set x]).
Proof.
by under eq_fsbigr do rewrite setIC; rewrite setIC additive_nnsfunr. Qed.

End measure_fsbig.

Section mulem_ge0.
Local Open Scope ereal_scope.

Let
mulef_ge0
Source code
( : realDomainType) ( : R -> \bar R) :
  0 <= f x -> ((x < 0)%R -> f x = 0) -> 0 <= x%:E * f x.
Proof.
case: (ltP x 0%R) => [x_lt0 ? ->|x_ge0 fx_ge0 _] //; last exact: mule_ge0.
by rewrite mule0.
Qed.

Lemma
nnfun_muleindic_ge0
Source code
( : sigmaRingType d) ( : realDomainType)
  ( : {nnfun T >-> R}) : 0 <= r%:E * (\1_(f @^-1` [set r]) z)%:E.
Proof.
apply: (@mulef_ge0 _ _ (fun => (\1_(f @^-1` [set r]) z)%:E)).
  by rewrite lee_fin// indicE.
by move=> r0; rewrite preimage_nnfun0// indic0.
Qed.

Lemma
mulemu_ge0
Source code
( : sigmaRingType d) ( : realType)
    ( : {measure set T -> \bar R}) ( : R -> set T) :
  ((x < 0)%R -> A x = set0) -> 0 <= x%:E * mu (A x).
Proof.
by move=> xA; rewrite (@mulef_ge0 _ _ (mu \o _))//= => /xA ->; rewrite measure0.
Qed.
Global Arguments mulemu_ge0 {d T R mu x} A.

Import HBNNSimple.

Lemma
nnsfun_mulemu_ge0
Source code
( : sigmaRingType d) ( : realType)
    ( : {measure set T -> \bar R}) ( : {nnsfun T >-> R}) :
  0 <= x%:E * mu (f @^-1` [set x]).
Proof.
by apply: (mulemu_ge0 (fun => f @^-1` [set x])); exact: preimage_nnfun0.
Qed.

End mulem_ge0.