# Weak convergence of (finite) measures #

This file defines the topology of weak convergence of finite measures and probability measures
on topological spaces. The topology of weak convergence is the coarsest topology w.r.t. which
for every bounded continuous `ℝ≥0`

-valued function `f`

, the integration of `f`

against the
measure is continuous.

TODOs:

- Include the portmanteau theorem on characterizations of weak convergence of (Borel) probability measures.

## Main definitions #

The main definitions are the

- types
`measure_theory.finite_measure α`

and`measure_theory.probability_measure α`

with the topologies of weak convergence; `measure_theory.finite_measure.normalize`

, normalizing a finite measure to a probability measure (returns junk for the zero measure);`measure_theory.finite_measure.to_weak_dual_bcnn : finite_measure α → (weak_dual ℝ≥0 (α →ᵇ ℝ≥0))`

allowing to interpret a finite measure as a continuous linear functional on the space of bounded continuous nonnegative functions on`α`

. This is used for the definition of the topology of weak convergence.

## Main results #

- Finite measures
`μ`

on`α`

give rise to continuous linear functionals on the space of bounded continuous nonnegative functions on`α`

via integration:`measure_theory.finite_measure.to_weak_dual_bcnn : finite_measure α → (weak_dual ℝ≥0 (α →ᵇ ℝ≥0))`

`measure_theory.finite_measure.tendsto_iff_forall_integral_tendsto`

and`measure_theory.probability_measure.tendsto_iff_forall_integral_tendsto`

: Convergence of finite measures and probability measures is characterized by the convergence of integrals of all bounded continuous functions. This shows that the chosen definition of topology coincides with the common textbook definition of weak convergence of measures. Similar characterizations by the convergence of integrals (in the`measure_theory.lintegral`

sense) of all bounded continuous nonnegative functions are`measure_theory.finite_measure.tendsto_iff_forall_lintegral_tendsto`

and`measure_theory.probability_measure.tendsto_iff_forall_lintegral_tendsto`

.`measure_theory.finite_measure.tendsto_normalize_iff_tendsto`

: The convergence of finite measures to a nonzero limit is characterized by the convergence of the probability-normalized versions and of the total masses.

TODO:

- Portmanteau theorem:
`measure_theory.finite_measure.limsup_measure_closed_le_of_tendsto`

proves one implication. The current formulation assumes`pseudo_emetric_space`

. The only reason is to have bounded continuous pointwise approximations to the indicator function of a closed set. Clearly for example metrizability or pseudo-emetrizability would be sufficient assumptions. The typeclass assumptions should be later adjusted in a way that takes into account use cases, but the proof will presumably remain essentially the same.`measure_theory.limsup_measure_closed_le_iff_liminf_measure_open_ge`

proves the equivalence of the limsup condition for closed sets and the liminf condition for open sets for probability measures.`measure_theory.tendsto_measure_of_null_frontier`

proves that the liminf condition for open sets (which is equivalent to the limsup condition for closed sets) implies the convergence of probabilities of sets whose boundary carries no mass under the limit measure.`measure_theory.probability_measure.tendsto_measure_of_null_frontier_of_tendsto`

is a combination of earlier implications, which shows that weak convergence of probability measures implies the convergence of probabilities of sets whose boundary carries no mass under the limit measure.- Prove the rest of the implications.
(Where formulations are currently only provided for probability measures, one can obtain the
finite measure formulations using the characterization of convergence of finite measures by
their total masses and their probability-normalized versions, i.e., by
`measure_theory.finite_measure.tendsto_normalize_iff_tendsto`

.)

## Notations #

No new notation is introduced.

## Implementation notes #

The topology of weak convergence of finite Borel measures will be defined using a mapping from
`measure_theory.finite_measure α`

to `weak_dual ℝ≥0 (α →ᵇ ℝ≥0)`

, inheriting the topology from the
latter.

The current implementation of `measure_theory.finite_measure α`

and
`measure_theory.probability_measure α`

is directly as subtypes of `measure_theory.measure α`

, and
the coercion to a function is the composition `ennreal.to_nnreal`

and the coercion to function
of `measure_theory.measure α`

. Another alternative would be to use a bijection
with `measure_theory.vector_measure α ℝ≥0`

as an intermediate step. The choice of implementation
should not have drastic downstream effects, so it can be changed later if appropriate.

Potential advantages of using the `nnreal`

-valued vector measure alternative:

- The coercion to function would avoid need to compose with
`ennreal.to_nnreal`

, the`nnreal`

-valued API could be more directly available.

Potential drawbacks of the vector measure alternative:

- The coercion to function would lose monotonicity, as non-measurable sets would be defined to have measure 0.
- No integration theory directly. E.g., the topology definition requires
`measure_theory.lintegral`

w.r.t. a coercion to`measure_theory.measure α`

in any case.

## References #

## Tags #

weak convergence of measures, finite measure, probability measure

### Finite measures #

In this section we define the `Type`

of `finite_measure α`

, when `α`

is a measurable space. Finite
measures on `α`

are a module over `ℝ≥0`

.

If `α`

is moreover a topological space and the sigma algebra on `α`

is finer than the Borel sigma
algebra (i.e. `[opens_measurable_space α]`

), then `finite_measure α`

is equipped with the topology
of weak convergence of measures. This is implemented by defining a pairing of finite measures `μ`

on `α`

with continuous bounded nonnegative functions `f : α →ᵇ ℝ≥0`

via integration, and using the
associated weak topology (essentially the weak-star topology on the dual of `α →ᵇ ℝ≥0`

).

Finite measures are defined as the subtype of measures that have the property of being finite measures (i.e., their total mass is finite).

## Equations

## Instances for `measure_theory.finite_measure`

- measure_theory.finite_measure.measure_theory.measure.has_coe
- measure_theory.finite_measure.has_coe_to_fun
- measure_theory.finite_measure.has_zero
- measure_theory.finite_measure.inhabited
- measure_theory.finite_measure.has_add
- measure_theory.finite_measure.has_smul
- measure_theory.finite_measure.add_comm_monoid
- measure_theory.finite_measure.module
- measure_theory.finite_measure.topological_space

A finite measure can be interpreted as a measure.

## Equations

- measure_theory.finite_measure.has_coe_to_fun = {coe := λ (μ : measure_theory.finite_measure α) (s : set α), (⇑μ s).to_nnreal}

The (total) mass of a finite measure `μ`

is `μ univ`

, i.e., the cast to `nnreal`

of
`(μ : measure α) univ`

.

## Equations

- measure_theory.finite_measure.has_zero = {zero := ⟨0, _⟩}

## Equations

## Equations

- measure_theory.finite_measure.has_add = {add := λ (μ ν : measure_theory.finite_measure α), ⟨↑μ + ↑ν, _⟩}

## Equations

- measure_theory.finite_measure.has_smul = {smul := λ (c : R) (μ : measure_theory.finite_measure α), ⟨c • ↑μ, _⟩}

## Equations

- measure_theory.finite_measure.add_comm_monoid = function.injective.add_comm_monoid coe measure_theory.finite_measure.coe_injective measure_theory.finite_measure.coe_zero measure_theory.finite_measure.coe_add measure_theory.finite_measure.add_comm_monoid._proof_3

Coercion is an `add_monoid_hom`

.

## Equations

- measure_theory.finite_measure.coe_add_monoid_hom = {to_fun := coe coe_to_lift, map_zero' := _, map_add' := _}

## Equations

- measure_theory.finite_measure.module = function.injective.module nnreal measure_theory.finite_measure.coe_add_monoid_hom measure_theory.finite_measure.coe_injective measure_theory.finite_measure.module._proof_4

The pairing of a finite (Borel) measure `μ`

with a nonnegative bounded continuous
function is obtained by (Lebesgue) integrating the (test) function against the measure.
This is `finite_measure.test_against_nn`

.

Finite measures yield elements of the `weak_dual`

of bounded continuous nonnegative
functions via `measure_theory.finite_measure.test_against_nn`

, i.e., integration.

## Equations

- μ.to_weak_dual_bcnn = {to_linear_map := {to_fun := λ (f : bounded_continuous_function α nnreal), μ.test_against_nn f, map_add' := _, map_smul' := _}, cont := _}

The topology of weak convergence on `measure_theory.finite_measure α`

is inherited (induced)
from the weak-* topology on `weak_dual ℝ≥0 (α →ᵇ ℝ≥0)`

via the function
`measure_theory.finite_measure.to_weak_dual_bcnn`

.

The total mass of a finite measure depends continuously on the measure.

Convergence of finite measures implies the convergence of their total masses.

If the total masses of finite measures tend to zero, then the measures tend to
zero. This formulation concerns the associated functionals on bounded continuous
nonnegative test functions. See `finite_measure.tendsto_zero_of_tendsto_zero_mass`

for
a formulation stating the weak convergence of measures.

If the total masses of finite measures tend to zero, then the measures tend to zero.

A characterization of weak convergence in terms of integrals of bounded continuous nonnegative functions.

### Bounded convergence results for finite measures #

This section is about bounded convergence theorems for finite measures.

A bounded convergence theorem for a finite measure: If bounded continuous non-negative functions are uniformly bounded by a constant and tend to a limit, then their integrals against the finite measure tend to the integral of the limit. This formulation assumes:

- the functions tend to a limit along a countably generated filter;
- the limit is in the almost everywhere sense;
- boundedness holds almost everywhere;
- integration is
`measure_theory.lintegral`

, i.e., the functions and their integrals are`ℝ≥0∞`

-valued.

A bounded convergence theorem for a finite measure:
If a sequence of bounded continuous non-negative functions are uniformly bounded by a constant
and tend pointwise to a limit, then their integrals (`measure_theory.lintegral`

) against the finite
measure tend to the integral of the limit.

A related result with more general assumptions is
`measure_theory.finite_measure.tendsto_lintegral_nn_filter_of_le_const`

.

A bounded convergence theorem for a finite measure: If bounded continuous non-negative functions are uniformly bounded by a constant and tend to a limit, then their integrals against the finite measure tend to the integral of the limit. This formulation assumes:

- the functions tend to a limit along a countably generated filter;
- the limit is in the almost everywhere sense;
- boundedness holds almost everywhere;
- integration is the pairing against non-negative continuous test functions
(
`measure_theory.finite_measure.test_against_nn`

).

A related result using `measure_theory.lintegral`

for integration is
`measure_theory.finite_measure.tendsto_lintegral_nn_filter_of_le_const`

.

A bounded convergence theorem for a finite measure:
If a sequence of bounded continuous non-negative functions are uniformly bounded by a constant and
tend pointwise to a limit, then their integrals (`measure_theory.finite_measure.test_against_nn`

)
against the finite measure tend to the integral of the limit.

Related results:

`measure_theory.finite_measure.tendsto_test_against_nn_filter_of_le_const`

: more general assumptions`measure_theory.finite_measure.tendsto_lintegral_nn_of_le_const`

: using`measure_theory.lintegral`

for integration.

### Weak convergence of finite measures with bounded continuous real-valued functions #

In this section we characterize the weak convergence of finite measures by the usual (defining) condition that the integrals of all bounded continuous real-valued functions converge.

A characterization of weak convergence in terms of integrals of bounded continuous real-valued functions.

### Probability measures #

In this section we define the type of probability measures on a measurable space `α`

, denoted by
`measure_theory.probability_measure α`

. TODO: Probability measures form a convex space.

If `α`

is moreover a topological space and the sigma algebra on `α`

is finer than the Borel sigma
algebra (i.e. `[opens_measurable_space α]`

), then `measure_theory.probability_measure α`

is
equipped with the topology of weak convergence of measures. Since every probability measure is a
finite measure, this is implemented as the induced topology from the coercion
`measure_theory.probability_measure.to_finite_measure`

.

Probability measures are defined as the subtype of measures that have the property of being probability measures (i.e., their total mass is one).

## Equations

A probability measure can be interpreted as a measure.

## Equations

- measure_theory.probability_measure.has_coe_to_fun = {coe := λ (μ : measure_theory.probability_measure α) (s : set α), (⇑μ s).to_nnreal}

A probability measure can be interpreted as a finite measure.

## Equations

- μ.to_finite_measure = ⟨↑μ, _⟩

The topology of weak convergence on `measure_theory.probability_measure α`

. This is inherited
(induced) from the topology of weak convergence of finite measures via the inclusion
`measure_theory.probability_measure.to_finite_measure`

.

Probability measures yield elements of the `weak_dual`

of bounded continuous nonnegative
functions via `measure_theory.finite_measure.test_against_nn`

, i.e., integration.

A characterization of weak convergence of probability measures by the condition that the integrals of every continuous bounded nonnegative function converge to the integral of the function against the limit measure.

The characterization of weak convergence of probability measures by the usual (defining) condition that the integrals of every continuous bounded function converge to the integral of the function against the limit measure.

### Normalization of finite measures to probability measures #

This section is about normalizing finite measures to probability measures.

The weak convergence of finite measures to nonzero limit measures is characterized by the convergence of the total mass and the convergence of the normalized probability measures.

Normalize a finite measure so that it becomes a probability measure, i.e., divide by the total mass.

Averaging with respect to a finite measure is the same as integraing against
`measure_theory.finite_measure.normalize`

.

If the normalized versions of finite measures converge weakly and their total masses also converge, then the finite measures themselves converge weakly.

If finite measures themselves converge weakly to a nonzero limit measure, then their normalized versions also converge weakly.

The weak convergence of finite measures to a nonzero limit can be characterized by the weak convergence of both their normalized versions (probability measures) and their total masses.

### Portmanteau: limsup condition for closed sets iff liminf condition for open sets #

In this section we prove that for a sequence of Borel probability measures on a topological space
and its candidate limit measure, the following two conditions are equivalent:
(C) For any closed set `F`

in `α`

the limsup of the measures of `F`

is at most the limit
measure of `F`

.
(O) For any open set `G`

in `α`

the liminf of the measures of `G`

is at least the limit
measure of `G`

.
Either of these will later be shown to be equivalent to the weak convergence of the sequence
of measures.

One pair of implications of the portmanteau theorem: For a sequence of Borel probability measures, the following two are equivalent:

(C) The limsup of the measures of any closed set is at most the measure of the closed set under a candidate limit measure.

(O) The liminf of the measures of any open set is at least the measure of the open set under a candidate limit measure.

### Portmanteau: limit of measures of Borel sets whose boundary carries no mass in the limit #

In this section we prove that for a sequence of Borel probability measures on a topological space
and its candidate limit measure, either of the following equivalent conditions:
(C) For any closed set `F`

in `α`

the limsup of the measures of `F`

is at most the limit
measure of `F`

(O) For any open set `G`

in `α`

the liminf of the measures of `G`

is at least the limit
measure of `G`

implies that
(B) For any Borel set `E`

in `α`

whose boundary `∂E`

carries no mass under the candidate limit
measure, we have that the limit of measures of `E`

is the measure of `E`

under the
candidate limit measure.

One implication of the portmanteau theorem: For a sequence of Borel probability measures, if the liminf of the measures of any open set is at least the measure of the open set under a candidate limit measure, then for any set whose boundary carries no probability mass under the candidate limit measure, then its measures under the sequence converge to its measure under the candidate limit measure.

### Portmanteau implication: weak convergence implies a limsup condition for closed sets #

In this section we prove, under the assumption that the underlying topological space `α`

is
pseudo-emetrizable, that the weak convergence of measures on `measure_theory.finite_measure α`

implies that for any closed set `F`

in `α`

the limsup of the measures of `F`

is at most the
limit measure of `F`

. This is one implication of the portmanteau theorem characterizing weak
convergence of measures.

Combining with an earlier implication we also get that weak convergence implies that for any Borel
set `E`

in `α`

whose boundary `∂E`

carries no mass under the limit measure, the limit of measures
of `E`

is the measure of `E`

under the limit measure.

If bounded continuous functions tend to the indicator of a measurable set and are uniformly bounded, then their integrals against a finite measure tend to the measure of the set. This formulation assumes:

- the functions tend to a limit along a countably generated filter;
- the limit is in the almost everywhere sense;
- boundedness holds almost everywhere.

If a sequence of bounded continuous functions tends to the indicator of a measurable set and the functions are uniformly bounded, then their integrals against a finite measure tend to the measure of the set.

A similar result with more general assumptions is
`measure_theory.measure_of_cont_bdd_of_tendsto_filter_indicator`

.

The integrals of thickened indicators of a closed set against a finite measure tend to the measure of the closed set if the thickening radii tend to zero.

One implication of the portmanteau theorem: Weak convergence of finite measures implies that the limsup of the measures of any closed set is at most the measure of the closed set under the limit measure.

One implication of the portmanteau theorem: Weak convergence of probability measures implies that the limsup of the measures of any closed set is at most the measure of the closed set under the limit probability measure.

One implication of the portmanteau theorem: Weak convergence of probability measures implies that the liminf of the measures of any open set is at least the measure of the open set under the limit probability measure.

One implication of the portmanteau theorem: Weak convergence of probability measures implies that if the boundary of a Borel set carries no probability mass under the limit measure, then the limit of the measures of the set equals the measure of the set under the limit probability measure.

A version with coercions to ordinary `ℝ≥0∞`

-valued measures is
`measure_theory.probability_measure.tendsto_measure_of_null_frontier_of_tendsto'`

.