Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Lean/Mathlib/Mathlib/Dynamics/Ergodic/     Datei vom 15.10.2026 mit Größe 8 kB image not shown  

Quelle  EmpiricalMeasure.lean   Sprache: Lean

 

/-
Copyright (c) 2026 Jeremy Parker. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Jeremy Parker, Lua Viana Reis
-/

module

public import Mathlib.Dynamics.BirkhoffSum.NormedSpace
public import Mathlib.Dynamics.Ergodic.MeasurePreserving
public import Mathlib.MeasureTheory.Measure.HasOuterApproxClosed
public import Mathlib.MeasureTheory.Measure.ProbabilityMeasure
public import Mathlib.MeasureTheory.Measure.Support

import Mathlib.MeasureTheory.Integral.RieszMarkovKakutani.Real
import Mathlib.MeasureTheory.Measure.DiracProba
import Mathlib.MeasureTheory.Measure.Prokhorov
import Mathlib.Topology.ContinuousMap.Bounded.Basic

/-!
# Empirical measures and the Krylov–Bogolyubov theorem

This module introduces orbit empirical measures for an iterated map.
This allows us to prove the Krylov–Bogolyubov (or Krylov–Bogoliubov) theorem, which asserts the
existence of invariant Borel probability measures for continuous dynamics on compact metrizable
spaces.

## Main definitions

- `empiricalMeasure`: an empirical measure for `n` iterations of a map `f` starting at a point `x`.

## Main results

- `exists_measurePreserving_probabilityMeasure` gives an invariant probability measure for
  a continuous map on a compact Hausdorff space. This is the classical Krylov-Bogolyubov theorem.
- `exists_measurePreserving_probabilityMeasure_of_compact_forwardInvariant` gives an invariant
  probability measure defined over a (not necessarily compact) ambient space, supported on a
  compact, forward invariant subset.

## TODO

- When the `Measurable` requirement of `MeasurePreserving` is relaxed,
  `exists_measurePreserving_probabilityMeasure_of_compact_forwardInvariant` can be generalized.
-/


public section

namespace MeasureTheory

open Filter
open scoped BoundedContinuousFunction
open scoped Topology

variable {X : Type*} [MeasurableSpace X]

/-- An empirical measure is the Birkhoff average of the Dirac measures along an orbit starting from
`x` under the dynamics generated by `f`. This uses `n + 1` iterations, to give a well-defined
probability measure for any `n`. -/

noncomputable def empiricalMeasure (f : X → X) (x : X) (n : ℕ) : Measure X :=
  birkhoffAverage NNReal f Measure.dirac (n + 1) x

instance (f : X → X) (x : X) (n : ℕ) : IsProbabilityMeasure (empiricalMeasure f x n) := by
  constructor
  simp [empiricalMeasure, birkhoffAverage, birkhoffSum, ENNReal.smul_def, ENNReal.inv_mul_cancel]

section NormedAddCommGroup

variable (f : X → X) (x : X) (n : ℕ)
  {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] (g : X → E)
  [MeasurableSingletonClass X]

lemma integral_empiricalMeasure_eq_birkhoffaverage (n : ℕ) :
    ∫ y, g y ∂(empiricalMeasure f x n) = birkhoffAverage NNReal f g (n + 1) x := by
  simp [empiricalMeasure,
    integral_birkhoffAverage_measure f g x .dirac (by fun_prop (disch := simp))]

lemma tendsto_integral_comp_sub_integral_empiricalMeasure_of_isBoundedUnder
    (hfg : Bornology.IsBounded (Set.range (g <| f^[·] x))) :
    Tendsto (fun n ↦
        (∫ y, (g ∘ f) y ∂(empiricalMeasure f x n)) - ∫ y, g y ∂(empiricalMeasure f x n))
      atTop (�� 0) := by
  simpa only [integral_empiricalMeasure_eq_birkhoffaverage, birkhoffAverage_comp_apply,
    birkhoffAverage_apply_congr_ring (R := NNReal) (S := ℝ)] using
    (tendsto_add_atTop_iff_nat 1).mpr (tendsto_birkhoffAverage_apply_sub_birkhoffAverage ℝ hfg)

end NormedAddCommGroup

section KrylovBogolyubov

/-- If, for a bounded continuous function `g`, the difference between the integrals of `g ∘ f`
and `g` tends to zero with respect to a filter of probability measures, then for a limit
measure `μ`, we have `∫ y, (g ∘ f) y ∂μ = ∫ y, g y ∂μ`. -/

lemma ProbabilityMeasure.integral_comp_eq_integral_of_mapClusterPt
    [TopologicalSpace X] [BorelSpace X]
    {α : Type*} {F : Filter α} {f : X → X} (hf : Continuous f)
    {u : α → ProbabilityMeasure X} {μ : ProbabilityMeasure X} (hμ : MapClusterPt μ F u)
    {g : X →ᵇ ℝ} (hg : Tendsto (fun t ↦ (∫ y, (g ∘ f) y ∂(u t)) - ∫ y, g y ∂(u t)) F (�� 0)) :
    ∫ y, (g ∘ f) y ∂μ = ∫ y, g y ∂μ := by
  rcases (mapClusterPt_iff_ultrafilter.mp hμ) with ⟨U, hUl, hUμ⟩
  have hgf : Tendsto (fun t ↦ ∫ y, (g ∘ f) y ∂(u t)) U (�� (∫ y, (g ∘ f) y ∂μ)) :=
    (ProbabilityMeasure.tendsto_iff_forall_integral_tendsto.mp hUμ) (g.compContinuous ⟨f, hf⟩)
  have hgf' : Tendsto (fun t ↦ ∫ y, (g ∘ f) y ∂(u t)) U (�� (∫ y, g y ∂μ)) := by
    simpa using (hg.mono_left hUl).add
      (ProbabilityMeasure.tendsto_iff_forall_integral_tendsto.mp hUμ g)
  exact tendsto_nhds_unique hgf hgf'

/-- **Krylov-Bogolyubov theorem**: there exists a regular, invariant, Borel probability measure,
for a continuous function on a nonempty, compact, Hausdorff space. -/

public theorem exists_measurePreserving_probabilityMeasure
    [TopologicalSpace X] [BorelSpace X] [T2Space X]
    [CompactSpace X] [Nonempty X] {f : X → X} (hf : Continuous f) :
    ∃ μ : Measure X, MeasurePreserving f μ μ ∧ Measure.Regular μ ∧ IsProbabilityMeasure μ := by
  obtain ⟨x⟩ := ‹Nonempty X›
  -- starting from any point, the empirical measures must accumulate at some measure μ
  obtain ⟨μ, _, hμ⟩ := isCompact_univ.exists_mapClusterPt
    (u := fun n ↦ (empiricalMeasure f x n).toProbabilityMeasure) (f := atTop) (by simp)
  -- μ gives us a regular measure ν, and the rest is showing ν satisfies the other properties
  obtain ⟨ν, hνreg, hνfin, hμν⟩ := (μ : Measure X).exists_regular_eq_of_compactSpace
  have hprob : ν Set.univ = 1 := by
    rw [← ENNReal.toReal_eq_one_iff]
    change ν.real Set.univ = 1
    simpa using (hμν (BoundedContinuousFunction.const X 1)).symm
  have : (ν.map f).Regular := by
    have := Measure.InnerRegularCompactLTTop.map_of_continuous hf (μ := ν)
    infer_instance
  have hmap : ν.map f = ν := by
    apply Measure.ext_of_integral_eq_on_compactlySupported
    intro g
    rw [integral_map hf.aemeasurable]
    · simp_rw [← g.toBoundedContinuousFunction_apply]
      rw [← ContinuousMap.coe_mk f hf]
      simp_rw [← g.toBoundedContinuousFunction.compContinuous_apply ⟨f,hf⟩, ← hμν]
      refine ProbabilityMeasure.integral_comp_eq_integral_of_mapClusterPt hf hμ (g := g) ?_
      refine tendsto_integral_comp_sub_integral_empiricalMeasure_of_isBoundedUnder f x g ?_
      exact g.toBoundedContinuousFunction.isBounded_range.subset <| Set.range_comp_subset_range ..
    · exact g.continuous.aestronglyMeasurable
  use ν
  exact ⟨⟨hf.measurable, hmap⟩, hνreg, ⟨hprob⟩⟩

/-- **Krylov-Bogolyubov theorem** for forward invariant compact sets. -/
theorem exists_measurePreserving_probabilityMeasure_of_compact_forwardInvariant
    [TopologicalSpace X] [BorelSpace X] [T2Space X]
    {K : Set X} (hcomp : IsCompact K) (hnonempty : K.Nonempty)
    {f : X → X} (hfcont : ContinuousOn f K) (hfinv : Set.MapsTo f K K)
    (hfmeas : Measurable f) : -- TODO: relax this
    ∃ μ : Measure X, MeasurePreserving f μ μ
      ∧ Measure.Regular μ ∧ IsProbabilityMeasure μ ∧ Measure.support μ ⊆ K := by
  have : CompactSpace K := isCompact_iff_compactSpace.mp hcomp
  have : Nonempty K := hnonempty.to_subtype
  let ι : K → X := Subtype.val
  obtain ⟨μm, hμ, hμmreg, hμprob⟩ :=
    exists_measurePreserving_probabilityMeasure (hfcont.mapsToRestrict hfinv)
  let μ : ProbabilityMeasure K := ⟨μm, hμprob⟩
  have : (μ : Measure K).Regular := hμmreg
  have hιmeas : Measurable ι :=  measurable_subtype_coe
  let ν := μ.map ι
  use ν
  have : (ν : Measure X).InnerRegular :=
    Measure.InnerRegular.map_of_continuous continuous_subtype_val
  have hιmp : MeasurePreserving ι μ ν := ⟨hιmeas, by simp [ν]⟩
  have hsemi : Function.Semiconj ι (Set.MapsTo.restrict f K K hfinv) f := by
    intro
    rfl
  refine ⟨hιmp.of_semiconj hμ hsemi hfmeas, inferInstance, inferInstance, ?_⟩
  -- Now we prove that the invariant measure is supported on the forward invariant set
  apply Measure.support_subset_of_isClosed hcomp.isClosed
  rw [MeasureTheory.mem_ae_iff]
  simpa [ν, ι] using
    (ProbabilityMeasure.map_apply' μ hιmeas.aemeasurable hcomp.isClosed.measurableSet.compl)

end KrylovBogolyubov

end MeasureTheory

Messung
CHZG
9510010098

¤ Dauer der Verarbeitung: 0.1 Sekunden  (vorverarbeitet am  2026-11-24) ¤

*© Formatika GbR, Deutschland