Learning.klDiv_map_trajectory_eq_iSup
From the authors
The divergence between the laws of two trajectories is the supremum over n of the divergences
between the laws of the histories up to time n.
-
๐ : Type u_1m๐ : MeasurableSpace ๐A measurable space is a space equipped with a ฯ-algebra. -
๐ : Type u_2m๐ : MeasurableSpace ๐ -
๐จ : Type u_3m๐จ : MeasurableSpace ๐จ -
ฮฉ : Type u_4mฮฉ : MeasurableSpace ฮฉ -
ฮฉ' : Type u_5mฮฉ' : MeasurableSpace ฮฉ'
-
P : MeasureTheory.Measure ฮฉA measure is defined to be an outer measure that is countably additive on measurable sets, with the additional assumption that the outer measure is the canonical extension of the restricted measure.MeasureTheory.IsProbabilityMeasure PA measureฮผis called a probability measure ifฮผ univ = 1. -
P' : MeasureTheory.Measure ฮฉ'MeasureTheory.IsProbabilityMeasure P' -
O : โ โ ฮฉ โ ๐ -
A : โ โ ฮฉ โ ๐ -
Y : โ โ ฮฉ โ ๐จ -
O' : โ โ ฮฉ' โ ๐ -
A' : โ โ ฮฉ' โ ๐ -
Y' : โ โ ฮฉ' โ ๐จ
-
hO : โ (n : โ), Measurable (O n)A functionfbetween measurable spaces is measurable if the preimage of every measurable set is measurable. -
hA : โ (n : โ), Measurable (A n) -
hY : โ (n : โ), Measurable (Y n) -
hO' : โ (n : โ), Measurable (O' n) -
hA' : โ (n : โ), Measurable (A' n) -
hY' : โ (n : โ), Measurable (Y' n)
InformationTheory.klDiv (MeasureTheory.Measure.map (trajectory O A Y) P)
(MeasureTheory.Measure.map (trajectory O' A' Y') P') =
โจ n,
InformationTheory.klDiv (MeasureTheory.Measure.map (history O A Y n) P)
(MeasureTheory.Measure.map (history O' A' Y' n) P')MeasurableSpace : Type u_6 โ Type u_6A measurable space is a space equipped with a ฯ-algebra.
MeasureTheory.IsProbabilityMeasure : {ฮฑ : Type u_1} โ {m0 : MeasurableSpace ฮฑ} โ MeasureTheory.Measure ฮฑ โ PropA measure `ฮผ` is called a probability measure if `ฮผ univ = 1`.
MeasureTheory.Measure : (ฮฑ : Type u_5) โ [MeasurableSpace ฮฑ] โ Type u_5A measure is defined to be an outer measure that is countably additive on measurable sets, with the additional assumption that the outer measure is the canonical extension of the restricted measure. The measure of a set `s`, denoted `ฮผ s`, is an extended nonnegative real. The real-valued version is written `ฮผ.real s`.
Nat : TypeThe natural numbers, starting at zero. This type is special-cased by both the kernel and the compiler, and overridden with an efficient implementation. Both use a fast arbitrary-precision arithmetic library (usually [GMP](https://gmplib.org/)); at runtime, `Nat` values that are sufficiently small are unboxed.
Measurable : {ฮฑ : Type u_1} โ {ฮฒ : Type u_2} โ [MeasurableSpace ฮฑ] โ [MeasurableSpace ฮฒ] โ (ฮฑ โ ฮฒ) โ PropA function `f` between measurable spaces is measurable if the preimage of every measurable set is measurable.
Eq : {ฮฑ : Sort u_1} โ ฮฑ โ ฮฑ โ PropThe equality relation. It has one introduction rule, `Eq.refl`.
We use `a = b` as notation for `Eq a b`.
A fundamental property of equality is that it is an equivalence relation.
```
variable (ฮฑ : Type) (a b c d : ฮฑ)
variable (hab : a = b) (hcb : c = b) (hcd : c = d)
example : a = d :=
Eq.trans (Eq.trans hab (Eq.symm hcb)) hcd
```
Equality is much more than an equivalence relation, however. It has the important property that every assertion
respects the equivalence, in the sense that we can substitute equal expressions without changing the truth value.
That is, given `h1 : a = b` and `h2 : p a`, we can construct a proof for `p b` using substitution: `Eq.subst h1 h2`.
Example:
```
example (ฮฑ : Type) (a b : ฮฑ) (p : ฮฑ โ Prop)
(h1 : a = b) (h2 : p a) : p b :=
Eq.subst h1 h2
example (ฮฑ : Type) (a b : ฮฑ) (p : ฮฑ โ Prop)
(h1 : a = b) (h2 : p a) : p b :=
h1 โธ h2
```
The triangle in the second presentation is a macro built on top of `Eq.subst` and `Eq.symm`, and you can enter it by typing `\t`.
For more information: [Equality](https://lean-lang.org/theorem_proving_in_lean4/quantifiers_and_equality.html#equality)
Conventions for notations in identifiers:
* The recommended spelling of `=` in identifiers is `eq`.InformationTheory.klDiv : {ฮฑ : Type u_2} โ {mฮฑ : MeasurableSpace ฮฑ} โ MeasureTheory.Measure ฮฑ โ MeasureTheory.Measure ฮฑ โ ENNRealKullback-Leibler divergence between two measures.
MeasureTheory.Measure.map : {ฮฑ : Type u_4} โ
{ฮฒ : Type u_5} โ
[inst : MeasurableSpace ฮฑ] โ
[inst_1 : MeasurableSpace ฮฒ] โ (ฮฑ โ ฮฒ) โ MeasureTheory.Measure ฮฑ โ MeasureTheory.Measure ฮฒThe pushforward of a measure. If `f` is not an almost everywhere measurable function, we define it to be `0` if `ฮผ = 0`, and to be an arbitrary Dirac mass otherwise. That way we always have `map f 0 = 0`, and the push-forward of a probability measure is always a probability measure.
Learning.trajectory : {๐ : Type u_1} โ
{๐ : Type u_2} โ
{๐จ : Type u_3} โ {ฮฉ : Type u_4} โ (โ โ ฮฉ โ ๐) โ (โ โ ฮฉ โ ๐) โ (โ โ ฮฉ โ ๐จ) โ ฮฉ โ โ โ Learning.Round ๐ ๐ ๐จA random variable that gives the sequence of rounds.Go to its page
Learning.history : {๐ : Type u_1} โ
{๐ : Type u_2} โ
{๐จ : Type u_3} โ {ฮฉ : Type u_4} โ (โ โ ฮฉ โ ๐) โ (โ โ ฮฉ โ ๐) โ (โ โ ฮฉ โ ๐จ) โ (n : โ) โ ฮฉ โ Learning.Hist ๐ ๐ ๐จ nHistory of the algorithm-environment sequence before time `n`: the rounds at times `0, ..., n - 1`.Go to its page
Code
lemma klDiv_map_trajectory_eq_iSup (hO : โ n, Measurable (O n)) (hA : โ n, Measurable (A n))
(hY : โ n, Measurable (Y n)) (hO' : โ n, Measurable (O' n)) (hA' : โ n, Measurable (A' n))
(hY' : โ n, Measurable (Y' n)) :
klDiv (P.map (trajectory O A Y)) (P'.map (trajectory O' A' Y')) =
โจ n, klDiv (P.map (history O A Y n)) (P'.map (history O' A' Y' n))Proof
by
have hg : โ n, Measurable fun f : โ โ Round ๐ ๐ ๐จ โฆ fun i : Fin n โฆ f i.1 := fun n โฆ
.of_eval fun i โฆ measurable_pi_apply i.1
rw [klDiv_eq_iSup_map hg ?_ MeasurableSpace.iSup_comap_restrictFin]
ยท refine iSup_congr fun n โฆ ?_
rw [Measure.map_map (hg n) (measurable_trajectory hO hA hY),
Measure.map_map (hg n) (measurable_trajectory hO' hA' hY')]
rfl
ยท intro n m hnm
have : (fun f : โ โ Round ๐ ๐ ๐จ โฆ fun i : Fin n โฆ f i.1) =
(fun h : Fin m โ Round ๐ ๐ ๐จ โฆ fun i : Fin n โฆ h (Fin.castLE hnm i)) โ
fun f : โ โ Round ๐ ๐ ๐จ โฆ fun i : Fin m โฆ f i.1 := rfl
beta_reduce
rw [this, โ MeasurableSpace.comap_comp]
exact MeasurableSpace.comap_mono (Measurable.of_eval fun i โฆ
measurable_pi_apply (Fin.castLE hnm i)).comap_leMeaning last changed in v4.34.0-rc2-76-g565f652 (2026-09-10), the 2th recorded change.
Self-contained, with its dependencies inlined and proofs replaced by sorry: download the raw file ยท open it in the Lean web editor.
Dependency graph
Audit surface: 4 project declarations, 23 external constants
โ Proved: no sorry anywhere in its closure
This is the tool's own reading of one build's recorded axioms, and it is not robust against an author who wants it to pass. Checking meant to be relied on should go through Comparator, which replays the proof through the kernel from an export against an explicit list of permitted axioms.