Top source

Module mathcomp.analysis.measure_theory.probability_measure

From HB Require Import structures.
From mathcomp Require Import boot order algebra.
From mathcomp Require Import boolp classical_sets functions cardinality reals.
From mathcomp Require Import interval_inference ereal topology normedtype.
From mathcomp Require Import measurable_structure measure_function dirac_measure.

# Probability Measures ``` isSubProbability == interface for functions that satisfy the property of subprobability The HB class is SubProbability. subprobability T R == subprobability measure over the measurableType T with values in \bar R with R : realType The HB class is SubProbability. Measure_isSubProbability == interface that extends measures to subprobability measures isProbability == interface for functions that satisfy the property of probability measures The HB class is Probability. probability T R == type of probability measure over the measurableType T with values in \bar R with R : realType Measure_isProbability == interface that extends measures to probability measures mnormalize mu == normalization of a measure to a probability ``` ``` mset U r == the set of probability measures mu such that mu U < r pset == the sets mset U r with U measurable and r \in [0,1] pprobability == the measurable type generated by pset ```

Unset SsrOldRewriteGoalsOrder.
Set Implicit Arguments.
Unset Strict Implicit.
Unset Printing Implicit Defensive.
Import Order.TTheory GRing.Theory Num.Theory.

Local Open Scope classical_set_scope.
Local Open Scope ring_scope.

.
isSubProbability
Source code
(
sigmaRingType
Source code
d) (R : realType)
  (P : set T -> \bar R) := { sprobability_setT : (P setT <= 1)%E }.

(
type=subprobability
Source code
)
.
structure
Source code
Definition
Source code
SubProbability
Source code
(
measurableType
Source code
d) (R : realType)
  := { of @FiniteMeasure d T R mu & isSubProbability d T R mu }.

.
Measure_isSubProbability
Source code
(
measurableType
Source code
d)
    (R : realType) (P : set T -> \bar R) & isMeasure _ _ _ P :=
  { sprobability_setT : (P setT <= 1)%E }.

.
builders
Source code
Context
Source code
(
measurableType
Source code
d) (R : realType)
  P & Measure_isSubProbability d T R P.

Let : @Measure_isFinite d T R P.
Proof.
split; apply: lty_fin_num_fun.
by rewrite (le_lt_trans (@sprobability_setT))// ltey.
Qed.

.
instance
Source code
Definition
Source code
.

.
instance
Source code
Definition
Source code
@isSubProbability
Source code
.Build _ _ _ P sprobability_setT.

..

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

Let
mzero_setT
Source code
: (@mzero d T R setT <= 1)%E.
Proof.
by rewrite /mzero/=. Qed.

.
instance
Source code
Definition
Source code

  Measure_isSubProbability.Build _ _ _ (@mzero d T R) mzero_setT.

End mzero_subprobability.

.
isProbability
Source code
(
measurableType
Source code
d) (R : realType)
  (P : set T -> \bar R) := { probability_setT : P setT = 1%E }.

(
type=probability
Source code
)
.
structure
Source code
Definition
Source code
Probability
Source code
(
measurableType
Source code
d) (R : realType) :=
  { of @SubProbability d T R P & isProbability d T R P }.

Arguments probability_setT {d T R} s.

.
instance
Source code
Definition
Source code
(
measurableType
Source code
d) (R : realType) :=
  gen_eqMixin (probability T R).
.
instance
Source code
Definition
Source code
(
measurableType
Source code
d) (R : realType) :=
  gen_choiceMixin (probability T R).

Section probability_lemmas.
Local Open Scope ereal_scope.
Context ( : measurableType d) ( : realType) ( : probability T R).

Lemma
probability_le1
Source code
( : set T) : measurable A -> P A <= 1.
Proof.
by move=> mA; rewrite -(probability_setT P) ?le_measure ?in_setE. Qed.

Lemma
probability_setC
Source code
( : set T) : measurable A -> P (~` A) = 1 - P A.
Proof.
move=> mA; rewrite -(probability_setT P) -(setvU A) measureU ?addeK ?setICl//.
  exact: measurableC.
by rewrite fin_num_measure.
Qed.

End probability_lemmas.

.
Measure_isProbability
Source code
(
measurableType
Source code
d)
    (R : realType) (P : set T -> \bar R) & isMeasure _ _ _ P :=
  { probability_setT : P setT = 1%E }.

.
builders
Source code
Context
Source code
(
measurableType
Source code
d) (R : realType)
  P & Measure_isProbability d T R P.

Let
subprobability
Source code
: @Measure_isSubProbability d T R P.
Proof.
by split; rewrite probability_setT. Qed.

.
instance
Source code
Definition
Source code
subprobability
Source code
.

.
instance
Source code
Definition
Source code
@isProbability
Source code
.Build _ _ _ P probability_setT.

..

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

.
instance
Source code
Definition
Source code

  Measure_isProbability.Build _ _ _ (@dirac _ T x R) (diracT R x).

End pdirac.

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

Definition
mnormalize

mnormalize : forall [d : measure_display] [T : measurableType d] [R : realType], measure T R -> probability T R -> set T -> \bar R mnormalize is not universe polymorphic Arguments mnormalize [d]%_measure_display_scope [T R] mu P U%_classical_set_scope mnormalize is transparent Expands to: Constant mathcomp.analysis.measure_theory.probability_measure.mnormalize Declared in library mathcomp.analysis.measure_theory.probability_measure, line 146, characters 11-21


Source code
:=
  let
evidence
Source code
:= mu [set: T] in
  if (evidence == 0) || (evidence == +oo) then fun => P U
  else fun => mu U * (fine evidence)^-1%:E.

Let
mnormalize0
Source code
: mnormalize set0 = 0.
Proof.
by rewrite /mnormalize; case: ifPn => // _; rewrite measure0 mul0e.
Qed.

Let
mnormalize_ge0
Source code
: 0 <= mnormalize U.
Proof.
by rewrite /mnormalize; case: ifPn. Qed.

Let
mnormalize_sigma_additive
Source code
: semi_sigma_additive mnormalize.
Proof.
move=> F mF tF mUF; rewrite /mnormalize/=.
case: ifPn => [_|_]; first exact: measure_semi_sigma_additive.
rewrite [X in X @ _ --> _](_ : _ = (fun => \sum_(0 <= < n) mu (F i)) \*
                               cst (fine (mu setT))^-1%:E).
  by apply/funext => n; rewrite -ge0_sume_distrl.
by apply: cvgeZr => //; exact: measure_semi_sigma_additive.
Qed.

.
instance
Source code
Definition
Source code
isMeasure
Source code
.Build _ _ _ mnormalize
  mnormalize0 mnormalize_ge0 mnormalize_sigma_additive.

Let
mnormalize1
Source code
: mnormalize [set: T] = 1.
Proof.
rewrite /mnormalize; case: ifPn; first by rewrite probability_setT.
rewrite negb_or => /andP[ft0 ftoo].
have ? : mu setT \is a fin_num by rewrite ge0_fin_numE// ltey.
by rewrite -{1}(@fineK _ (mu setT))// -EFinM divff// fine_eq0.
Qed.

.
instance
Source code
Definition
Source code

  Measure_isProbability.Build _ _ _ mnormalize mnormalize1.

End mnormalize.

Lemma
mnormalize_id
Source code
( : measurableType d) ( : realType)
  ( : probability T R) : mnormalize P P' = P.
Proof.
apply/funext => x; rewrite /mnormalize/= probability_setT.
by rewrite onee_eq0/= invr1 mule1.
Qed.

.
instance
Source code
Definition
Source code
(
pmeasurableType
Source code
d) (R : realType) :=
  isPointed.Build (probability T R) (dirac point).

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

Definition
mset

mset : forall [d : measure_display] [T : measurableType d] [R : realType], set T -> R -> set (probability T R) mset is not universe polymorphic Arguments mset [d]%_measure_display_scope [T R] U%_classical_set_scope r%_ring_scope _ mset is transparent Expands to: Constant mathcomp.analysis.measure_theory.probability_measure.mset Declared in library mathcomp.analysis.measure_theory.probability_measure, line 198, characters 11-15


Source code
( : set T) ( : R) :=
  [set : probability T R | mu U < r%:E]%E.

Lemma
lt0_mset
Source code
( : set T) ( : R) : (r < 0)%R -> mset U r = set0.
Proof.
move=> r0; apply/seteqP; split => // x/=.
by apply/negP; rewrite -leNgt (@le_trans _ _ 0%E)// lee_fin ltW.
Qed.

Lemma
gt1_mset
Source code
( : set T) ( : R) :
  measurable U -> (1 < r)%R -> mset U r = [set: probability T R].
Proof.
move=> mU r1; apply/seteqP; split => // x/= _.
by rewrite /mset/= (le_lt_trans (probability_le1 _ _)).
Qed.

Definition
pset

pset : forall [d : measure_display] [T : measurableType d] [R : realType], set_system (probability T R) pset is not universe polymorphic Arguments pset [d]%_measure_display_scope [T R] _ pset is transparent Expands to: Constant mathcomp.analysis.measure_theory.probability_measure.pset Declared in library mathcomp.analysis.measure_theory.probability_measure, line 214, characters 11-15


Source code
: set_system (probability T R) :=
  [set mset U r | in `[0%R,1%R] & in measurable].

Definition
pprobability

pprobability : forall [d : measure_display] (T : measurableType d) (R : realType), measurableType (pset (T:=T) (R:=R)).-sigma pprobability is not universe polymorphic Arguments pprobability [d]%_measure_display_scope T R pprobability is transparent Expands to: Constant mathcomp.analysis.measure_theory.probability_measure.pprobability Declared in library mathcomp.analysis.measure_theory.probability_measure, line 217, characters 11-23


Source code
: measurableType pset.-sigma :=
  g_sigma_algebraType pset.

End dist_sigma_algebra_instance.