InformationTheory

InformationTheory.Shannon.BirkhoffErgodic

source

Birkhoff individual ergodic theorem via Garsia's maximal ergodic inequality #

This file proves the Birkhoff individual ergodic theorem (Petersen Ergodic Theory, Walters An Introduction to Ergodic Theory, 1931):

Let T : Ω → Ω be a measure-preserving ergodic transformation of a probability space (Ω, μ), and let f : Ω → ℝ be integrable. Then the time averages

A_n ω := (∑_{i=0}^{n} f (T^[i] ω)) / (n + 1)

converge almost everywhere to the spatial mean ∫ f dμ.

Strategy: Garsia (1965) — maximal ergodic inequality + sandwich #

The proof uses Garsia's elementary proof of the maximal ergodic inequality, followed by a sandwich argument bounding both limsup A_n and liminf A_n by ∫f dμ.

Historical note. A previous iteration of this file attempted the backward-martingale Hopf identity route (Williams). That route is only valid for i.i.d. processes and is mathematically false for general measure-preserving ergodic systems: the cyclic system on {0, 1, 2} with T(x) = (x + 1) mod 3 and f(x) = x is a concrete counter-example to the would-be exchangeability lemma μ[f ∘ T | σ(S_3, S_4, …)] =ᵐ μ[f | σ(S_3, S_4, …)]. The Petersen reference for the "Hopf identity" was conflated with the (different) Hopf maximal ergodic inequality used here.

Proof structure #

  • §1 sets up the definitions birkhoffAverageReal, birkhoffPartialSum, maxPartialSum (running max M_n := max(S_0, S_1, …, S_n)).
  • §2 establishes integral preservation ∫ A_n dμ = ∫ f dμ.
  • §3 gives the Birkhoff sum recursion S_{k+1}(ω) = f(ω) + S_k(T ω), A_n(T ω) = ((n+2)·A_{n+1}(ω) - f(ω))/(n+1).
  • §4 proves the Garsia maximal ergodic inequality ∫_{M_n > 0} f dμ ≥ 0.
  • §5 is the sandwich limsup A_n ≤ ∫f and liminf A_n ≥ ∫f a.e.
  • §6 is the main theorem birkhoff_ergodic_ae.

Main statements #

§1 Definitions #

noncomputable def

InformationTheory.Shannon.birkhoffAverageReal

source
{Ω : Type u_1} (T : ΩΩ) (f : Ω) (n : ) :
Ω

Birkhoff time average with n + 1 terms.

birkhoffAverageReal T f n ω := (∑_{i=0}^{n} f (T^[i] ω)) / (n + 1).

The n + 1 denominator side-steps the n = 0 division issue; this is the sequence we want to converge to ∫ f dμ under Birkhoff's theorem.

Equations
Instances For
    Used by
      noncomputable def

      InformationTheory.Shannon.birkhoffPartialSum

      source
      {Ω : Type u_1} (T : ΩΩ) (f : Ω) (k : ) :
      Ω

      Partial Birkhoff sum with k terms. birkhoffPartialSum T f k ω := ∑_{i=0}^{k-1} f (T^[i] ω).

      Equations
      Instances For
        Used by
          theorem

          InformationTheory.Shannon.birkhoffAverageReal_eq_partialSum_div

          source
          {Ω : Type u_1} (T : ΩΩ) (f : Ω) (n : ) (ω : Ω) :
          birkhoffAverageReal T f n ω = birkhoffPartialSum T f (n + 1) ω / (n + 1)

          Average and partial sum are related: A_n = S_{n+1} / (n + 1).

          Used by
            theorem

            InformationTheory.Shannon.birkhoffPartialSum_zero

            source
            @[simp]
            {Ω : Type u_1} (T : ΩΩ) (f : Ω) (ω : Ω) :
            Used by
              theorem

              InformationTheory.Shannon.birkhoffPartialSum_measurable

              source
              {Ω : Type u_1} {m₀ : MeasurableSpace Ω} {T : ΩΩ} (hT : Measurable T) {f : Ω} (hf : Measurable f) (k : ) :

              Partial sums are measurable when T and f are.

              Used by
                noncomputable def

                InformationTheory.Shannon.maxPartialSum

                source
                {Ω : Type u_1} (T : ΩΩ) (f : Ω) :
                Ω

                Running maximum of Birkhoff partial sums: maxPartialSum T f n ω = max{S_0(ω), S_1(ω), …, S_n(ω)}.

                Since S_0 = 0, this satisfies maxPartialSum T f n ω ≥ 0.

                Equations
                Instances For
                  Used by
                    theorem

                    InformationTheory.Shannon.maxPartialSum_zero

                    source
                    @[simp]
                    {Ω : Type u_1} (T : ΩΩ) (f : Ω) (ω : Ω) :
                    maxPartialSum T f 0 ω = 0
                    Used by
                      theorem

                      InformationTheory.Shannon.maxPartialSum_succ

                      source
                      {Ω : Type u_1} (T : ΩΩ) (f : Ω) (n : ) (ω : Ω) :
                      maxPartialSum T f (n + 1) ω = max (maxPartialSum T f n ω) (birkhoffPartialSum T f (n + 1) ω)
                      Used by
                        theorem

                        InformationTheory.Shannon.maxPartialSum_nonneg

                        source
                        {Ω : Type u_1} (T : ΩΩ) (f : Ω) (n : ) (ω : Ω) :
                        0 maxPartialSum T f n ω
                        Used by
                          theorem

                          InformationTheory.Shannon.maxPartialSum_measurable

                          source
                          {Ω : Type u_1} {m₀ : MeasurableSpace Ω} {T : ΩΩ} (hT : Measurable T) {f : Ω} (hf : Measurable f) (n : ) :
                          Used by
                            theorem

                            InformationTheory.Shannon.birkhoffPartialSum_le_maxPartialSum

                            source
                            {Ω : Type u_1} (T : ΩΩ) (f : Ω) (n : ) {k : } (hk : k n) (ω : Ω) :
                            Used by

                              §2 Integral preservation #

                              theorem

                              InformationTheory.Shannon.integral_comp_iterate_eq

                              source
                              {Ω : Type u_1} {m₀ : MeasurableSpace Ω} (μ : MeasureTheory.Measure Ω) {T : ΩΩ} (hT : MeasureTheory.MeasurePreserving T μ μ) {f : Ω} (hf : MeasureTheory.Integrable f μ) (i : ) :
                              (ω : Ω), f (T^[i] ω) μ = (ω : Ω), f ω μ

                              Each term f ∘ T^[i] has the same integral as f.

                              Used by
                                theorem

                                InformationTheory.Shannon.integral_birkhoffAverageReal_eq

                                source
                                {Ω : Type u_1} {m₀ : MeasurableSpace Ω} (μ : MeasureTheory.Measure Ω) [MeasureTheory.IsFiniteMeasure μ] {T : ΩΩ} (hT : MeasureTheory.MeasurePreserving T μ μ) {f : Ω} (hf : MeasureTheory.Integrable f μ) (n : ) :
                                (ω : Ω), birkhoffAverageReal T f n ω μ = (ω : Ω), f ω μ

                                Integral of the (n+1)-term Birkhoff average equals ∫ f.

                                Used by

                                  §3 Birkhoff sum recursion #

                                  theorem

                                  InformationTheory.Shannon.birkhoffPartialSum_succ_eq

                                  source
                                  {Ω : Type u_1} (T : ΩΩ) (f : Ω) (k : ) (ω : Ω) :
                                  birkhoffPartialSum T f (k + 1) ω = f ω + birkhoffPartialSum T f k (T ω)

                                  Recursion S_{k+1}(ω) = f(ω) + S_k(T ω).

                                  Used by
                                    theorem

                                    InformationTheory.Shannon.birkhoffAverageReal_comp_T

                                    source
                                    {Ω : Type u_1} (T : ΩΩ) (f : Ω) (n : ) (ω : Ω) :
                                    birkhoffAverageReal T f n (T ω) = ((n + 2) * birkhoffAverageReal T f (n + 1) ω - f ω) / (n + 1)

                                    Algebraic recursion for time averages: A_n(T ω) = ((n+2) · A_{n+1}(ω) - f(ω)) / (n+1).

                                    Used by

                                      §4 Garsia maximal ergodic inequality #

                                      theorem

                                      InformationTheory.Shannon.maxPartialSum_le_sum_abs

                                      source
                                      {Ω : Type u_1} (T : ΩΩ) (f : Ω) (n : ) (ω : Ω) :
                                      maxPartialSum T f n ω iFinset.range n, |f (T^[i] ω)|

                                      Bound M_n ≤ ∑_{i < n} |f ∘ T^[i]|, used for integrability.

                                      Used by
                                        theorem

                                        InformationTheory.Shannon.maxPartialSum_integrable

                                        source
                                        {Ω : Type u_1} {m₀ : MeasurableSpace Ω} {μ : MeasureTheory.Measure Ω} {T : ΩΩ} (hT : MeasureTheory.MeasurePreserving T μ μ) {f : Ω} (hf : Measurable f) (hf_int : MeasureTheory.Integrable f μ) (n : ) :

                                        M_n is integrable when f is, in finite measure.

                                        Used by
                                          theorem

                                          InformationTheory.Shannon.exists_pos_index_attaining_max

                                          source
                                          {Ω : Type u_1} (T : ΩΩ) (f : Ω) (n : ) (ω : Ω) (h_pos : 0 < maxPartialSum T f n ω) :
                                          ∃ (k : ), 1 k k n birkhoffPartialSum T f k ω = maxPartialSum T f n ω

                                          Existence of an index k ∈ {1, …, n} achieving the running max when the max is strictly positive.

                                          Used by
                                            theorem

                                            InformationTheory.Shannon.maxPartialSum_sub_comp_T_le_indicator

                                            source
                                            {Ω : Type u_1} (T : ΩΩ) (f : Ω) (n : ) (ω : Ω) :
                                            maxPartialSum T f n ω - maxPartialSum T f n (T ω) {ω : Ω | 0 < maxPartialSum T f n ω}.indicator f ω

                                            The Garsia pointwise inequality (key step for the maximal ergodic inequality): for all ω : Ω,

                                            M_n(ω) - M_n(T ω) ≤ 1_{M_n > 0}(ω) · f(ω).

                                            Proof: on {M_n > 0}, picking k* ∈ {1, …, n} with S_{k*}(ω) = M_n(ω) and using S_{k*}(ω) = f(ω) + S_{k* - 1}(T ω) with S_{k* - 1}(T ω) ≤ M_n(T ω) gives f(ω) ≥ M_n(ω) - M_n(T ω). On {M_n = 0} (the complement), M_n(ω) - M_n(T ω) = -M_n(T ω) ≤ 0.

                                            Used by
                                              theorem

                                              InformationTheory.Shannon.maximal_ergodic_inequality

                                              source
                                              {Ω : Type u_1} {m₀ : MeasurableSpace Ω} {μ : MeasureTheory.Measure Ω} [MeasureTheory.IsFiniteMeasure μ] {T : ΩΩ} (hT : MeasureTheory.MeasurePreserving T μ μ) {f : Ω} (hf : Measurable f) (hf_int : MeasureTheory.Integrable f μ) (n : ) :
                                              0 (ω : Ω) in {ω : Ω | 0 < maxPartialSum T f n ω}, f ω μ

                                              The maximal ergodic inequality (Garsia 1965). For T : Ω → Ω measure-preserving on a probability/finite-measure space and f : Ω → ℝ integrable, for every n : ℕ,

                                              ∫_{ω : 0 < maxPartialSum T f n ω} f dμ ≥ 0.

                                              Used by

                                                §5 Sandwich #

                                                The sandwich proof shows that for ergodic T and integrable f, both limsup A_n ≤ ∫f and liminf A_n ≥ ∫f hold a.e., implying A_n → ∫f a.e.

                                                The argument: fix ε > 0 and let α := ∫f dμ. Define A_ε := {ω : limsup A_n(f, ω) > α + ε}. Then A_ε is T-invariant (via the recursion A_n(T ω) = …). For ergodic T, μ(A_ε) ∈ {0, 1}. Suppose μ(A_ε) = 1. For g := f - α - ε (so ∫g = -ε < 0), apply the maximal ergodic inequality at each n to get ∫_{M_n^g > 0} g dμ ≥ 0. The sets {M_n^g > 0} are monotone in n and exhaust B := {sup_n S_n(g) > 0} ⊇ A_ε. By DCT, ∫_B g dμ = lim ∫_{M_n^g > 0} g dμ ≥ 0. But B ⊇ A_ε (full measure) gives ∫_B g dμ = ∫_Ω g dμ = -ε < 0. Contradiction. Hence μ(A_ε) = 0.

                                                theorem

                                                InformationTheory.Shannon.birkhoff_neg_mean_sup_null

                                                source
                                                {Ω : Type u_1} {m₀ : MeasurableSpace Ω} {μ : MeasureTheory.Measure Ω} [MeasureTheory.IsProbabilityMeasure μ] {T : ΩΩ} (hT : MeasureTheory.MeasurePreserving T μ μ) (_hT_erg : Ergodic T μ) {g : Ω} (hg : Measurable g) (hg_int : MeasureTheory.Integrable g μ) (hg_neg : (ω : Ω), g ω μ < 0) (hA_full : μ {ω : Ω | ∀ (n : ), Nn, birkhoffPartialSum T g N ω > 0} = μ Set.univ) :

                                                For ergodic T and integrable g with ∫g dμ < 0, the "infinitely often positive partial sum" set {ω | ∀ n, ∃ N ≥ n, S_N(g, ω) > 0} cannot have full measure.

                                                Proof: that set is contained in B := ⋃_n {ω | maxPartialSum T g n ω > 0} (= {ω | ∃ N ≥ 1, S_N(g, ω) > 0}). By the maximal ergodic inequality, ∫_{M_n > 0} g dμ ≥ 0 for each n. By dominated convergence, ∫_B g dμ = lim_n ∫_{M_n > 0} g dμ ≥ 0. If the "infinitely often" set has full measure, so does B, hence ∫_B g dμ = ∫_Ω g dμ < 0. Contradiction.

                                                (Ergodicity is not actually needed here; the contradiction is direct from the maximal ergodic inequality + DCT.)

                                                Used by
                                                  theorem

                                                  InformationTheory.Shannon.maxPartialSum_meas_le

                                                  source
                                                  {Ω : Type u_1} {m₀ : MeasurableSpace Ω} {μ : MeasureTheory.Measure Ω} [MeasureTheory.IsProbabilityMeasure μ] {T : ΩΩ} (hT : MeasureTheory.MeasurePreserving T μ μ) {g : Ω} (hg : Measurable g) (hg_int : MeasureTheory.Integrable g μ) (m n : ) :
                                                  m * μ {ω : Ω | 0 < maxPartialSum T (fun (ω : Ω) => g ω - m) n ω} ENNReal.ofReal ( (ω : Ω), |g ω| μ)

                                                  The Hardy bound (finite n): for any m n : ℕ, m · μ({maxPartialSum T (g - m) n > 0}) ≤ ‖g‖₁.

                                                  The maximal ergodic inequality 0 ≤ ∫_E (g - m) rearranges to m · μ(E) ≤ ∫_E g ≤ ∫|g|, where E := {maxPartialSum (g - m) n > 0}. For m = 0 the bound is trivial.

                                                  Used by
                                                    theorem

                                                    InformationTheory.Shannon.maxPartialSum_meas_iUnion_le

                                                    source
                                                    {Ω : Type u_1} {m₀ : MeasurableSpace Ω} {μ : MeasureTheory.Measure Ω} [MeasureTheory.IsProbabilityMeasure μ] {T : ΩΩ} (hT : MeasureTheory.MeasurePreserving T μ μ) {g : Ω} (hg : Measurable g) (hg_int : MeasureTheory.Integrable g μ) (m : ) :
                                                    m * μ (⋃ (n : ), {ω : Ω | 0 < maxPartialSum T (fun (ω : Ω) => g ω - m) n ω}) ENNReal.ofReal ( (ω : Ω), |g ω| μ)

                                                    The Hardy bound (union): the union of {maxPartialSum (g - m) n > 0} over n is bounded by ‖g‖₁ / m (in ENNReal).

                                                    Used by
                                                      theorem

                                                      InformationTheory.Shannon.birkhoffAverageReal_ae_bddAbove

                                                      source
                                                      {Ω : Type u_1} {m₀ : MeasurableSpace Ω} {μ : MeasureTheory.Measure Ω} [MeasureTheory.IsProbabilityMeasure μ] {T : ΩΩ} (hT : MeasureTheory.MeasurePreserving T μ μ) {g : Ω} (hg : Measurable g) (hg_int : MeasureTheory.Integrable g μ) :
                                                      ∀ᵐ (ω : Ω) μ, BddAbove (Set.range fun (n : ) => birkhoffAverageReal T g n ω)

                                                      A.e. boundedness of Birkhoff averages (Hardy-Littlewood-style). For T measure-preserving and g integrable, the sequence n ↦ birkhoffAverageReal T g n ω has bounded range a.e.

                                                      Proof: combine maxPartialSum_meas_iUnion_le (Hardy union bound) with the inclusion {¬BddAbove range A_·} ⊆ ⋂_m ⋃_n {maxPartialSum (g-m) n > 0} (positive Birkhoff sum from A_k > m) and exists_nat_gt (Archimedean choice of m large to push ‖g‖₁/m < ε).

                                                      Used by
                                                        theorem

                                                        InformationTheory.Shannon.birkhoffAverageReal_limsup_comp_T_ae

                                                        source
                                                        {Ω : Type u_1} {m₀ : MeasurableSpace Ω} {μ : MeasureTheory.Measure Ω} [MeasureTheory.IsProbabilityMeasure μ] {T : ΩΩ} (hT : MeasureTheory.MeasurePreserving T μ μ) (f : Ω) (hf : Measurable f) (hf_int : MeasureTheory.Integrable f μ) :
                                                        (fun (ω : Ω) => Filter.limsup (fun (n : ) => birkhoffAverageReal T f n ω) Filter.atTop) T =ᵐ[μ] fun (ω : Ω) => Filter.limsup (fun (n : ) => birkhoffAverageReal T f n ω) Filter.atTop

                                                        The Birkhoff-average limsup is T-invariant (a.e.). For measure preserving T and integrable f, the function limsupAvg ω := limsup_n A_n(f, ω) satisfies limsupAvg ∘ T =ᵐ limsupAvg.

                                                        Proof: from birkhoffAverageReal_ae_bddAbove applied to f and to -f, a.e. the sequence A_n(f, ω) is bounded. The recursion A_n(f, Tω) - A_{n+1}(f, ω) = (A_{n+1}(f, ω) - f(ω))/(n+1) then gives A_n(f, Tω) - A_{n+1}(f, ω) → 0 (bounded numerator / n+1). Combining with Filter.limsup_nat_add shifts back to limsup A_n(f, Tω) = limsup A_n(f, ω).

                                                        Used by
                                                          theorem

                                                          InformationTheory.Shannon.birkhoffAverageReal_limsup_aestronglyMeasurable

                                                          source
                                                          {Ω : Type u_1} {m₀ : MeasurableSpace Ω} {μ : MeasureTheory.Measure Ω} {T : ΩΩ} (hT_meas : Measurable T) {f : Ω} (hf : Measurable f) :

                                                          Measurability of ω ↦ limsup A_n(f, ω) (as a real-valued function; when the sequence is unbounded the value is the Real.limsup junk value but the function remains measurable).

                                                          Used by
                                                            theorem

                                                            InformationTheory.Shannon.birkhoffAverageReal_limsup_le_zero_of_int_neg

                                                            source
                                                            {Ω : Type u_1} {m₀ : MeasurableSpace Ω} {μ : MeasureTheory.Measure Ω} [MeasureTheory.IsProbabilityMeasure μ] {T : ΩΩ} (hT : MeasureTheory.MeasurePreserving T μ μ) (hT_erg : Ergodic T μ) {g : Ω} (hg : Measurable g) (hg_int : MeasureTheory.Integrable g μ) (hg_neg : (ω : Ω), g ω μ < 0) :
                                                            ∀ᵐ (ω : Ω) μ, Filter.limsup (fun (n : ) => birkhoffAverageReal T g n ω) Filter.atTop 0

                                                            For ergodic T and integrable g with ∫g dμ < 0, the limsup of Birkhoff averages of g is ≤ 0 a.e.

                                                            Proof: by T-invariance (birkhoffAverageReal_limsup_comp_T_ae) and ergodicity (Ergodic.ae_eq_const_of_ae_eq_comp_ae), lsa =ᵐ const c for some c : ℝ. We show c ≤ 0 by contradiction: if c > 0, then a.e. ∃ᶠ n, A_n(g, ω) > c/2 > 0 (from limsup = c), hence ∀ k, ∃ N ≥ k, S_N(g, ω) > 0 (with N := n + 1). This full-measure set violates birkhoff_neg_mean_sup_null.

                                                            Used by
                                                              theorem

                                                              InformationTheory.Shannon.birkhoff_eventually_lt_integral_add

                                                              source
                                                              {Ω : Type u_1} {m₀ : MeasurableSpace Ω} {μ : MeasureTheory.Measure Ω} [MeasureTheory.IsProbabilityMeasure μ] {T : ΩΩ} (hT : MeasureTheory.MeasurePreserving T μ μ) (hT_erg : Ergodic T μ) {f : Ω} (hf : Measurable f) (hf_int : MeasureTheory.Integrable f μ) {ε : } ( : 0 < ε) :
                                                              ∀ᵐ (ω : Ω) μ, ∀ᶠ (n : ) in Filter.atTop, birkhoffAverageReal T f n ω < (x : Ω), f x μ + ε

                                                              The upper sandwich: for every ε > 0, a.e. ω, eventually birkhoffAverageReal T f n ω < ∫f dμ + ε.

                                                              Used by
                                                                theorem

                                                                InformationTheory.Shannon.birkhoff_eventually_gt_integral_sub

                                                                source
                                                                {Ω : Type u_1} {m₀ : MeasurableSpace Ω} {μ : MeasureTheory.Measure Ω} [MeasureTheory.IsProbabilityMeasure μ] {T : ΩΩ} (hT : MeasureTheory.MeasurePreserving T μ μ) (hT_erg : Ergodic T μ) {f : Ω} (hf : Measurable f) (hf_int : MeasureTheory.Integrable f μ) {ε : } ( : 0 < ε) :
                                                                ∀ᵐ (ω : Ω) μ, ∀ᶠ (n : ) in Filter.atTop, (x : Ω), f x μ - ε < birkhoffAverageReal T f n ω

                                                                The lower sandwich: for every ε > 0, a.e. ω, eventually ∫f dμ - ε < birkhoffAverageReal T f n ω.

                                                                Proof: apply the upper sandwich to -f and negate.

                                                                Used by

                                                                  §6 Main theorem #

                                                                  theorem

                                                                  InformationTheory.Shannon.birkhoff_ergodic_ae

                                                                  source
                                                                  {Ω : Type u_1} {m₀ : MeasurableSpace Ω} {μ : MeasureTheory.Measure Ω} [MeasureTheory.IsProbabilityMeasure μ] {T : ΩΩ} (hT : MeasureTheory.MeasurePreserving T μ μ) (hT_erg : Ergodic T μ) {f : Ω} (hf : MeasureTheory.Integrable f μ) :
                                                                  ∀ᵐ (ω : Ω) μ, Filter.Tendsto (fun (n : ) => birkhoffAverageReal T f n ω) Filter.atTop (nhds ( (x : Ω), f x μ))

                                                                  The Birkhoff individual ergodic theorem.

                                                                  For a probability-preserving ergodic transformation T : Ω → Ω and an integrable observable f : Ω → ℝ, the Birkhoff time averages

                                                                  A_n ω := (∑_{i=0}^{n} f (T^[i] ω)) / (n + 1)
                                                                  

                                                                  converge almost everywhere to the spatial mean ∫ f dμ.

                                                                  Used by