@@ -29,15 +29,8 @@ From mathcomp Require Import function_spaces.
2929(* *)
3030(* Detailed contents: *)
3131(* ```` *)
32- (* {mfun aT >-> rT} == type of measurable functions *)
33- (* aT and rT are sigmaRingType's. *)
3432(* {sfun T >-> R} == type of simple functions *)
35- (* f \in mfun == holds for f : {mfun _ >-> _} *)
3633(* {nnsfun T >-> R} == type of non-negative simple functions *)
37- (* mindic mD := \1_D where mD is a proof that D is measurable *)
38- (* indic_mfun mD := mindic mD *)
39- (* scale_mfun k f := k \o* f *)
40- (* max_mfun f g := f \max g *)
4134(* indic_sfun mD := mindic _ mD *)
4235(* cst_sfun r == constant simple function *)
4336(* max_sfun f g := f \max f *)
@@ -55,10 +48,6 @@ From mathcomp Require Import function_spaces.
5548(* *)
5649(***************************************************************************** *)
5750
58- Reserved Notation "{ 'mfun' aT >-> T }"
59- (at level 0, format "{ 'mfun' aT >-> T }").
60- Reserved Notation "[ 'mfun' 'of' f ]"
61- (at level 0, format "[ 'mfun' 'of' f ]").
6251Reserved Notation "{ 'nnfun' aT >-> T }"
6352 (at level 0, format "{ 'nnfun' aT >-> T }").
6453Reserved Notation "[ 'nnfun' 'of' f ]"
@@ -81,31 +70,6 @@ Import numFieldNormedType.Exports.
8170Local Open Scope classical_set_scope.
8271Local Open Scope ring_scope.
8372
84- #[global]
85- Hint Extern 0 (measurable [set _]) => solve [apply: measurable_set1] : core.
86-
87- HB.mixin Record isMeasurableFun d d' (aT : sigmaRingType d) (rT : sigmaRingType d')
88- (f : aT -> rT) := {
89- measurable_funPT : measurable_fun [set: aT] f
90- }.
91- HB.structure Definition MeasurableFun d d' aT rT :=
92- {f of @isMeasurableFun d d' aT rT f}.
93- Arguments measurable_funPT {d d' aT rT} s.
94-
95- Notation "{ 'mfun' aT >-> T }" := (@MeasurableFun.type _ _ aT T) : form_scope.
96- Notation "[ 'mfun' 'of' f ]" := [the {mfun _ >-> _} of f] : form_scope.
97- #[global] Hint Extern 0 (measurable_fun [set: _] _) =>
98- solve [apply: measurable_funPT] : core.
99-
100- Lemma measurable_funP {d d' : measure_display}
101- {aT : measurableType d} {rT : sigmaRingType d'}
102- (D : set aT) (s : {mfun aT >-> rT}) : measurable_fun D s.
103- Proof .
104- move=> mD Y mY; apply: measurableI => //.
105- by rewrite -(setTI (_ @^-1` _)); exact: measurable_funPT.
106- Qed .
107- Arguments measurable_funP {d d' aT rT D} s.
108-
10973Module HBSimple.
11074
11175HB.structure Definition SimpleFun d (aT : sigmaRingType d) (rT : realType) :=
@@ -116,10 +80,6 @@ End HBSimple.
11680Notation "{ 'sfun' aT >-> T }" := (@HBSimple.SimpleFun.type _ aT T) : form_scope.
11781Notation "[ 'sfun' 'of' f ]" := [the {sfun _ >-> _} of f] : form_scope.
11882
119- Lemma measurable_sfunP {d d'} {aT : measurableType d} {rT : measurableType d'}
120- (f : {mfun aT >-> rT}) (Y : set rT) : measurable Y -> measurable (f @^-1` Y).
121- Proof . by move=> mY; rewrite -[f @^-1` _]setTI; exact: measurable_funP. Qed .
122-
12383Module HBNNSimple.
12484Import HBSimple.
12585
@@ -132,137 +92,6 @@ End HBNNSimple.
13292Notation "{ 'nnsfun' aT >-> T }" := (@HBNNSimple.NonNegSimpleFun.type _ aT%type T) : form_scope.
13393Notation "[ 'nnsfun' 'of' f ]" := [the {nnsfun _ >-> _} of f] : form_scope.
13494
135- Section mfun_pred.
136- Context {d d'} {aT : sigmaRingType d} {rT : sigmaRingType d'}.
137- Definition mfun : {pred aT -> rT} := mem [set f | measurable_fun setT f].
138- Definition mfun_key : pred_key mfun. Proof . exact. Qed .
139- Canonical mfun_keyed := KeyedPred mfun_key.
140- End mfun_pred.
141-
142- Section mfun.
143- Context {d d'} {aT : sigmaRingType d} {rT : sigmaRingType d'}.
144- Notation T := {mfun aT >-> rT}.
145- Notation mfun := (@mfun _ _ aT rT).
146-
147- Section Sub.
148- Context (f : aT -> rT) (fP : f \in mfun).
149- Definition mfun_Sub_subproof := @isMeasurableFun.Build d _ aT rT f (set_mem fP).
150- #[local] HB.instance Definition _ := mfun_Sub_subproof.
151- Definition mfun_Sub := [mfun of f].
152- End Sub.
153-
154- Lemma mfun_rect (K : T -> Type ) :
155- (forall f (Pf : f \in mfun), K (mfun_Sub Pf)) -> forall u : T, K u.
156- Proof .
157- move=> Ksub [f [[Pf]]]/=.
158- by suff -> : Pf = (set_mem (@mem_set _ [set f | _] f Pf)) by apply: Ksub.
159- Qed .
160-
161- Lemma mfun_valP f (Pf : f \in mfun) : mfun_Sub Pf = f :> (_ -> _).
162- Proof . by []. Qed .
163-
164- HB.instance Definition _ := isSub.Build _ _ T mfun_rect mfun_valP.
165-
166- Lemma mfuneqP (f g : {mfun aT >-> rT}) : f = g <-> f =1 g.
167- Proof . by split=> [->//|fg]; apply/val_inj/funext. Qed .
168-
169- HB.instance Definition _ := [Choice of {mfun aT >-> rT} by <:].
170-
171- HB.instance Definition _ x := isMeasurableFun.Build d _ aT rT (cst x)
172- (@measurable_cst _ _ aT rT setT x).
173-
174- End mfun.
175-
176- Section mfun_realType.
177- Context {rT : realType}.
178-
179- HB.instance Definition _ := @isMeasurableFun.Build _ _ _ rT
180- (@normr rT rT) (@normr_measurable rT setT).
181-
182- HB.instance Definition _ :=
183- isMeasurableFun.Build _ _ _ _ (@expR rT) (@measurable_expR rT).
184-
185- End mfun_realType.
186-
187- Section mfun_measurableType.
188- Context {d1} {T1 : measurableType d1} {d2} {T2 : measurableType d2}
189- {d3} {T3 : measurableType d3}.
190- Variables (f : {mfun T2 >-> T3}) (g : {mfun T1 >-> T2}).
191-
192- Lemma measurableT_comp_subproof : measurable_fun setT (f \o g).
193- Proof . exact: measurableT_comp. Qed .
194-
195- HB.instance Definition _ := isMeasurableFun.Build _ _ _ _ (f \o g)
196- measurableT_comp_subproof.
197-
198- End mfun_measurableType.
199-
200- Section ring.
201- Context d (aT : measurableType d) (rT : realType).
202-
203- Lemma mfun_subring_closed : subring_closed (@mfun _ _ aT rT).
204- Proof .
205- split=> [|f g|f g]; rewrite !inE/=.
206- - exact: measurable_cst.
207- - exact: measurable_funB.
208- - exact: measurable_funM.
209- Qed .
210- HB.instance Definition _ := GRing.isSubringClosed.Build _
211- (@mfun d default_measure_display aT rT) mfun_subring_closed.
212- HB.instance Definition _ := [SubChoice_isSubComRing of {mfun aT >-> rT} by <:].
213-
214- Implicit Types (f g : {mfun aT >-> rT}).
215-
216- Lemma mfun0 : (0 : {mfun aT >-> rT}) =1 cst 0 :> (_ -> _). Proof . by []. Qed .
217- Lemma mfun1 : (1 : {mfun aT >-> rT}) =1 cst 1 :> (_ -> _). Proof . by []. Qed .
218- Lemma mfunN f : - f = \- f :> (_ -> _). Proof . by []. Qed .
219- Lemma mfunD f g : f + g = f \+ g :> (_ -> _). Proof . by []. Qed .
220- Lemma mfunB f g : f - g = f \- g :> (_ -> _). Proof . by []. Qed .
221- Lemma mfunM f g : f * g = f \* g :> (_ -> _). Proof . by []. Qed .
222- Lemma mfunMn f n : (f *+ n) = (fun x => f x *+ n) :> (_ -> _).
223- Proof . by apply/funext=> x; elim: n => //= n; rewrite !mulrS !mfunD /= => ->. Qed .
224- Lemma mfun_sum I r (P : {pred I}) (f : I -> {mfun aT >-> rT}) (x : aT) :
225- (\sum_(i <- r | P i) f i) x = \sum_(i <- r | P i) f i x.
226- Proof . by elim/big_rec2: _ => //= i y ? Pi <-. Qed .
227- Lemma mfun_prod I r (P : {pred I}) (f : I -> {mfun aT >-> rT}) (x : aT) :
228- (\sum_(i <- r | P i) f i) x = \sum_(i <- r | P i) f i x.
229- Proof . by elim/big_rec2: _ => //= i y ? Pi <-. Qed .
230- Lemma mfunX f n : f ^+ n = (fun x => f x ^+ n) :> (_ -> _).
231- Proof . by apply/funext=> x; elim: n => [|n IHn]//; rewrite !exprS mfunM/= IHn. Qed .
232-
233- HB.instance Definition _ f g := MeasurableFun.copy (f \+ g) (f + g).
234- HB.instance Definition _ f g := MeasurableFun.copy (\- f) (- f).
235- HB.instance Definition _ f g := MeasurableFun.copy (f \- g) (f - g).
236- HB.instance Definition _ f g := MeasurableFun.copy (f \* g) (f * g).
237-
238- Definition mindic (D : set aT) of measurable D : aT -> rT := \1_D.
239-
240- Lemma mindicE (D : set aT) (mD : measurable D) :
241- mindic mD = (fun x => (x \in D)%:R).
242- Proof . by rewrite /mindic funeqE => t; rewrite indicE. Qed .
243-
244- HB.instance Definition _ D mD := @isMeasurableFun.Build _ _ aT rT (mindic mD)
245- (@measurable_indic _ aT rT setT D mD).
246-
247- Definition indic_mfun (D : set aT) (mD : measurable D) : {mfun aT >-> rT} :=
248- mindic mD.
249-
250- HB.instance Definition _ k f := MeasurableFun.copy (k \o* f) (f * cst k).
251- Definition scale_mfun k f : {mfun aT >-> rT} := k \o* f.
252-
253- Lemma max_mfun_subproof f g : @isMeasurableFun d _ aT rT (f \max g).
254- Proof . by split; apply: measurable_maxr. Qed .
255-
256- HB.instance Definition _ f g := max_mfun_subproof f g.
257-
258- Definition max_mfun f g : {mfun aT >-> _} := f \max g.
259-
260- End ring.
261- Arguments indic_mfun {d aT rT} _.
262- (* TODO: move earlier? *)
263- #[global] Hint Extern 0 (measurable_fun _ (\1__ : _ -> _)) =>
264- (exact: measurable_indic ) : core.
265-
26695Section sfun_pred.
26796Context {d} {aT : sigmaRingType d} {rT : realType}.
26897Definition sfun : {pred _ -> _} := [predI @mfun _ _ aT rT & fimfun].
@@ -311,7 +140,7 @@ Proof. by split=> [->//|fg]; apply/val_inj/funext. Qed.
311140
312141HB.instance Definition _ := [Choice of {sfun aT >-> rT} by <:].
313142
314- (* NB: already instantiated in cardinality.v *)
143+ (* NB: already in cardinality.v *)
315144HB.instance Definition _ x : @FImFun aT rT (cst x) := FImFun.on (cst x).
316145
317146Definition cst_sfun x : {sfun aT >-> rT} := cst x.
@@ -371,16 +200,17 @@ HB.instance Definition _ f g := MeasurableFun.copy (f \- g) (f - g).
371200HB.instance Definition _ f g := MeasurableFun.copy (f \* g) (f * g).
372201
373202Import HBSimple.
374- (* NB: already instantiated in lebesgue_integral.v *)
203+
204+ (* TODO: mv to `measurable_realfun.v`? *)
375205HB.instance Definition _ (D : set aT) (mD : measurable D) :
376206 @FImFun aT rT (mindic _ mD) := FImFun.on (mindic _ mD).
377-
378207Definition indic_sfun (D : set aT) (mD : measurable D) : {sfun aT >-> rT} :=
379208 mindic rT mD.
380209
381210HB.instance Definition _ k f := MeasurableFun.copy (k \o* f) (f * cst_sfun k).
382211Definition scale_sfun k f : {sfun aT >-> rT} := k \o* f.
383212
213+ (* NB: already in `measurable_realfun.v` *)
384214HB.instance Definition _ f g := max_mfun_subproof f g.
385215Definition max_sfun f g : {sfun aT >-> _} := f \max g.
386216
@@ -441,9 +271,6 @@ Proof. by move=> /=. Qed.
441271HB.instance Definition _ x := @isNonNegFun.Build T R (cst x%:num)
442272 (cst_nnfun_subproof x).
443273
444- (* NB: already instantiated in cardinality.v *)
445- HB.instance Definition _ x : @FImFun T R (cst x) := FImFun.on (cst x).
446-
447274Definition cst_nnsfun (r : {nonneg R}) : {nnsfun T >-> R} := cst r%:num.
448275
449276Definition nnsfun0 : {nnsfun T >-> R} := cst_nnsfun 0%:nng.
@@ -554,18 +381,6 @@ Qed.
554381
555382End nnsfun_cover.
556383
557- (* FIXME: shouldn't we avoid calling [done] in a hint? *)
558- #[global] Hint Extern 0 (measurable (_ @^-1` [set _])) =>
559- solve [apply: measurable_sfunP; exact: measurable_set1] : core.
560-
561- Lemma measurable_sfun_inP {d} {aT : measurableType d} {rT : realType}
562- (f : {mfun aT >-> rT}) D (y : rT) :
563- measurable D -> measurable (D `&` f @^-1` [set y]).
564- Proof . by move=> Dm; exact: measurableI. Qed .
565-
566- #[global] Hint Extern 0 (measurable (_ `&` _ @^-1` [set _])) =>
567- solve [apply: measurable_sfun_inP; assumption] : core.
568-
569384Section measure_fsbig.
570385Local Open Scope ereal_scope.
571386Context d (T : measurableType d) (R : realType).
0 commit comments