The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V21. Dynamics, ergodic theory and information theory

Mathlib.Dynamics.BirkhoffSum.Average

23 declarations and 4 deprecated aliases. Mathlib docs · Source

Birkhoff average

In this file we define birkhoffAverage f g n x to be $$ \frac{1}{n}\sum_{k=0}^{n-1}g(f^{[k]}(x)), $$ where f : α → α is a self-map on some type α, g : α → M is a function from α to a module over a division semiring R, and R is used to formalize division by n as (n : R)⁻¹ • _.

While we need an auxiliary division semiring R to define birkhoffAverage, the definition does not depend on the choice of R, see birkhoffAverage_congr_ring.

def birkhoffAverage E1 #

(R : Type u_1) →
  {α : Type u_2} →
    {M : Type u_3} →
      [inst : DivisionSemiring R] → [inst_1 : AddCommMonoid M] → [Module R M] → (α → α) → (α → M) → ℕ → α → M

The average value of g on the first n points of the orbit of x under f, i.e. the Birkhoff sum ∑ k ∈ Finset.range n, g (f^[k] x) divided by n.

This average appears in many ergodic theorems which say that (birkhoffAverage R f g · x) converges to the "space average" ⨍ x, g x ∂μ as n → ∞.

We use an auxiliary [DivisionSemiring R] to define division by n. However, the definition does not depend on the choice of R, see birkhoffAverage_congr_ring.

theorem birkhoffAverage_zero_apply E0 #

∀ (R : Type u_1) {α : Type u_2} {M : Type u_3} [inst : DivisionSemiring R] [inst_1 : AddCommMonoid M]
  [inst_2 : Module R M] (f : α → α) (g : α → M) (x : α), birkhoffAverage R f g 0 x = 0

theorem birkhoffAverage_zero E0 #

∀ (R : Type u_1) {α : Type u_2} {M : Type u_3} [inst : DivisionSemiring R] [inst_1 : AddCommMonoid M]
  [inst_2 : Module R M] (f : α → α) (g : α → M), birkhoffAverage R f g 0 = 0

theorem birkhoffAverage_one_apply E0 #

∀ (R : Type u_1) {α : Type u_2} {M : Type u_3} [inst : DivisionSemiring R] [inst_1 : AddCommMonoid M]
  [inst_2 : Module R M] (f : α → α) (g : α → M) (x : α), birkhoffAverage R f g 1 x = g x

theorem birkhoffAverage_one E0 #

∀ (R : Type u_1) {α : Type u_2} {M : Type u_3} [inst : DivisionSemiring R] [inst_1 : AddCommMonoid M]
  [inst_2 : Module R M] (f : α → α) (g : α → M), birkhoffAverage R f g 1 = g

theorem map_birkhoffAverage E0 #

∀ (R : Type u_1) {α : Type u_2} {M : Type u_3} [inst : DivisionSemiring R] [inst_1 : AddCommMonoid M]
  [inst_2 : Module R M] (S : Type u_4) {F : Type u_5} {N : Type u_6} [inst_3 : DivisionSemiring S]
  [inst_4 : AddCommMonoid N] [inst_5 : Module S N] [inst_6 : FunLike F M N] [AddMonoidHomClass F M N] (g' : F)
  (f : α → α) (g : α → M) (n : ℕ) (x : α), g' (birkhoffAverage R f g n x) = birkhoffAverage S f (⇑g' ∘ g) n x

theorem map_comp_birkhoffAverage E0 #

∀ (R : Type u_1) {α : Type u_2} {M : Type u_3} [inst : DivisionSemiring R] [inst_1 : AddCommMonoid M]
  [inst_2 : Module R M] (S : Type u_4) {F : Type u_5} {N : Type u_6} [inst_3 : DivisionSemiring S]
  [inst_4 : AddCommMonoid N] [inst_5 : Module S N] [inst_6 : FunLike F M N] [AddMonoidHomClass F M N] (g' : F)
  (f : α → α) (g : α → M) (n : ℕ), ⇑g' ∘ birkhoffAverage R f g n = birkhoffAverage S f (⇑g' ∘ g) n

theorem birkhoffAverage_apply_congr_ring E1 #

∀ (R : Type u_1) {α : Type u_2} {M : Type u_3} [inst : DivisionSemiring R] [inst_1 : AddCommMonoid M]
  [inst_2 : Module R M] (S : Type u_4) [inst_3 : DivisionSemiring S] [inst_4 : Module S M] (f : α → α) (g : α → M)
  (n : ℕ) (x : α), birkhoffAverage R f g n x = birkhoffAverage S f g n x

theorem birkhoffAverage_congr_ring E1 #

∀ (R : Type u_1) {α : Type u_2} {M : Type u_3} [inst : DivisionSemiring R] [inst_1 : AddCommMonoid M]
  [inst_2 : Module R M] (S : Type u_4) [inst_3 : DivisionSemiring S] [inst_4 : Module S M],
  birkhoffAverage R = birkhoffAverage S

theorem birkhoffAverage_comp_apply E0 #

∀ (R : Type u_1) {α : Type u_2} {M : Type u_3} [inst : DivisionSemiring R] [inst_1 : AddCommMonoid M]
  [inst_2 : Module R M] (f : α → α) (g : α → M) (n : ℕ) (x : α),
  birkhoffAverage R f (g ∘ f) n x = birkhoffAverage R f g n (f x)

theorem birkhoffAverage_comp E1 #

∀ (R : Type u_1) {α : Type u_2} {M : Type u_3} [inst : DivisionSemiring R] [inst_1 : AddCommMonoid M]
  [inst_2 : Module R M] (f : α → α) (g : α → M) (n : ℕ), birkhoffAverage R f (g ∘ f) n = birkhoffAverage R f g n ∘ f

theorem Function.IsFixedPt.birkhoffAverage_eq E0 #

∀ (R : Type u_1) {α : Type u_2} {M : Type u_3} [inst : DivisionSemiring R] [inst_1 : AddCommMonoid M]
  [inst_2 : Module R M] {f : α → α} {x : α},
  Function.IsFixedPt f x → ∀ (g : α → M) {n : ℕ}, ↑n ≠ 0 → birkhoffAverage R f g n x = g x

theorem birkhoffAverage_add_apply E0 #

∀ (R : Type u_1) {α : Type u_2} {M : Type u_3} [inst : DivisionSemiring R] [inst_1 : AddCommMonoid M]
  [inst_2 : Module R M] {f : α → α} {g g' : α → M} (n : ℕ) (x : α),
  birkhoffAverage R f (g + g') n x = birkhoffAverage R f g n x + birkhoffAverage R f g' n x

theorem birkhoffAverage_add E1 #

∀ (R : Type u_1) {α : Type u_2} {M : Type u_3} [inst : DivisionSemiring R] [inst_1 : AddCommMonoid M]
  [inst_2 : Module R M] {f : α → α} {g g' : α → M},
  birkhoffAverage R f (g + g') = birkhoffAverage R f g + birkhoffAverage R f g'

theorem birkhoffAverage_apply_of_comp_eq E0 #

∀ (R : Type u_1) {α : Type u_2} {M : Type u_3} [inst : DivisionSemiring R] [inst_1 : AddCommMonoid M]
  [inst_2 : Module R M] {f : α → α} {g : α → M},
  g ∘ f = g → ∀ {n : ℕ}, ↑n ≠ 0 → ∀ (x : α), birkhoffAverage R f g n x = g x

If a function g is invariant under a function f (i.e., g ∘ f = g), then the Birkhoff average of g over f for n iterations is equal to g x at every point x. Requires that 0 < n.

theorem birkhoffAverage_of_comp_eq E0 #

∀ (R : Type u_1) {α : Type u_2} {M : Type u_3} [inst : DivisionSemiring R] [inst_1 : AddCommMonoid M]
  [inst_2 : Module R M] {f : α → α} {g : α → M}, g ∘ f = g → ∀ {n : ℕ}, ↑n ≠ 0 → birkhoffAverage R f g n = g

If a function g is invariant under a function f (i.e., g ∘ f = g), then the Birkhoff average of g over f for n iterations is equal to g. Requires that 0 < n.

theorem birkhoffAverage_const E0 #

∀ (R : Type u_1) {α : Type u_2} {M : Type u_3} [inst : DivisionSemiring R] [inst_1 : AddCommMonoid M]
  [inst_2 : Module R M] (f : α → α) (a : M) {n : ℕ},
  autoParam (↑n ≠ 0) birkhoffAverage_const._auto_1 → birkhoffAverage R f (fun x ↦ a) n = fun x ↦ a

theorem birkhoffAverage_neg_apply E0 #

∀ {R : Type u_1} {α : Type u_2} {M : Type u_3} [inst : DivisionSemiring R] [inst_1 : AddCommGroup M]
  [inst_2 : Module R M] {f : α → α} {g : α → M} (n : ℕ) (x : α),
  birkhoffAverage R f (-g) n x = -birkhoffAverage R f g n x

theorem birkhoffAverage_neg E1 #

∀ {R : Type u_1} {α : Type u_2} {M : Type u_3} [inst : DivisionSemiring R] [inst_1 : AddCommGroup M]
  [inst_2 : Module R M] {f : α → α} {g : α → M}, birkhoffAverage R f (-g) = -birkhoffAverage R f g

theorem birkhoffAverage_sub_apply E0 #

∀ {R : Type u_1} {α : Type u_2} {M : Type u_3} [inst : DivisionSemiring R] [inst_1 : AddCommGroup M]
  [inst_2 : Module R M] {f : α → α} {g g' : α → M} (n : ℕ) (x : α),
  birkhoffAverage R f (g - g') n x = birkhoffAverage R f g n x - birkhoffAverage R f g' n x

theorem birkhoffAverage_sub E1 #

∀ {R : Type u_1} {α : Type u_2} {M : Type u_3} [inst : DivisionSemiring R] [inst_1 : AddCommGroup M]
  [inst_2 : Module R M] {f : α → α} {g g' : α → M},
  birkhoffAverage R f (g - g') = birkhoffAverage R f g - birkhoffAverage R f g'

theorem birkhoffAverage_apply_sub_birkhoffAverage E1 #

∀ {R : Type u_1} {α : Type u_2} {M : Type u_3} [inst : DivisionSemiring R] [inst_1 : AddCommGroup M]
  [inst_2 : Module R M] (f : α → α) (g : α → M) (n : ℕ) (x : α),
  birkhoffAverage R f g n (f x) - birkhoffAverage R f g n x = (↑n)⁻¹ • (g (f^[n] x) - g x)

Birkhoff average is "almost invariant" under f: the difference between birkhoffAverage R f g n (f x) and birkhoffAverage R f g n x is equal to (n : R)⁻¹ • (g (f^[n] x) - g x).

theorem birkhoffAverage_comp_sub_birkhoffAverage E1 #

∀ {R : Type u_1} {α : Type u_2} {M : Type u_3} [inst : DivisionSemiring R] [inst_1 : AddCommGroup M]
  [inst_2 : Module R M] (f : α → α) (g : α → M) (n : ℕ),
  birkhoffAverage R f g n ∘ f - birkhoffAverage R f g n = (↑n)⁻¹ • (g ∘ f^[n] - g)

Birkhoff average is "almost invariant" under f: the difference between birkhoffAverage R f g n ∘ f and birkhoffAverage R f g n is equal to (n : R)⁻¹ • (g ∘ f^[n] - g).

Deprecated aliases

NameNew nameSince
birkhoffAverage_congr_ring'birkhoffAverage_congr_ring2026-08-19
birkhoffAverage_one'birkhoffAverage_one2026-08-19
birkhoffAverage_zero'birkhoffAverage_zero2026-08-19
birkhoffSum_add'birkhoffSum_add_apply2026-08-19