Learning.IsAlgEnvSeq.klDiv_map_trajectory
From the authors
Chain rule for trajectories of a single algorithm versus two stationary environments.
-
š : Type u_2mš : MeasurableSpace šA measurable space is a space equipped with a Ļ-algebra. -
šØ : Type u_3mšØ : MeasurableSpace šØMeasurableSpace.CountablyGenerated šØWe say a measurable space is countably generated if it can be generated by a countable set of sets. -
Ω : 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' -
A : ā ā Ī© ā š -
Y : ā ā Ī© ā šØ -
A' : ā ā Ī©' ā š -
Y' : ā ā Ī©' ā šØ -
O : ā ā Ī© ā Unit -
O' : ā ā Ī©' ā Unit -
alg : Algorithm Unit š šØA stochastic, sequential algorithm. -
Īŗ : ProbabilityTheory.Kernel š šØA kernel from a measurable spaceαto another measurable spaceβis a measurable functionĪŗ : α ā Measure β.ProbabilityTheory.IsMarkovKernel ĪŗA kernel is a Markov kernel if every measure in its image is a probability measure. -
Īŗ' : ProbabilityTheory.Kernel š šØProbabilityTheory.IsMarkovKernel Īŗ'
-
h : IsAlgEnvSeq O A Y alg (stationaryEnv Īŗ) PAn algorithm-environment sequence: a sequence of observations, actions and feedbacks generated by an algorithm interacting with an environment. -
h' : IsAlgEnvSeq O' A' Y' alg (stationaryEnv Īŗ') P'
InformationTheory.klDiv (MeasureTheory.Measure.map (trajectory O A Y) P)
(MeasureTheory.Measure.map (trajectory O' A' Y') P') =
ā' (t : ā), ā«ā» (Ļ : Ī©), InformationTheory.klDiv (Īŗ (A t Ļ)) (Īŗ' (A t Ļ)) āPMeasurableSpace : Type u_6 ā Type u_6A measurable space is a space equipped with a Ļ-algebra.
MeasurableSpace.CountablyGenerated : (α : Type u_3) ā [m : MeasurableSpace α] ā PropWe say a measurable space is countably generated if it can be generated by a countable set of sets.
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.
Unit : TypeThe canonical type with one element. This element is written `()`. `Unit` has a number of uses: * It can be used to model control flow that returns from a function call without providing other information. * Monadic actions that return `Unit` have side effects without computing values. * In polymorphic types, it can be used to indicate that no data is to be stored in a particular field.
Learning.Algorithm : (š : Type u_5) ā
(š : Type u_6) ā
(šØ : Type u_7) ā [MeasurableSpace š] ā [MeasurableSpace š] ā [MeasurableSpace šØ] ā Type (max (max u_5 u_6) u_7)A stochastic, sequential algorithm. At each round, it sees an observation in `š`, then takes an action in `š`, and finally receives feedback in `šØ`. The action is a random function of the past rounds and the current observation.Go to its page
ProbabilityTheory.IsMarkovKernel : {α : Type u_1} ā
{β : Type u_2} ā {mα : MeasurableSpace α} ā {mβ : MeasurableSpace β} ā ProbabilityTheory.Kernel α β ā PropA kernel is a Markov kernel if every measure in its image is a probability measure.
ProbabilityTheory.Kernel : (α : Type u_1) ā (β : Type u_2) ā [MeasurableSpace α] ā [MeasurableSpace β] ā Type (max u_1 u_2)A kernel from a measurable space `α` to another measurable space `β` is a measurable function `Īŗ : α ā Measure β`. The measurable space structure on `MeasureTheory.Measure β` is given by `MeasureTheory.Measure.instMeasurableSpace`. A map `Īŗ : α ā MeasureTheory.Measure β` is measurable iff `ā s : Set β, MeasurableSet s ā Measurable (fun a ⦠κ a s)`.
Learning.IsAlgEnvSeq : {š : Type u_1} ā
{š : Type u_2} ā
{šØ : Type u_3} ā
{Ī© : Type u_4} ā
{mš : MeasurableSpace š} ā
{mš : MeasurableSpace š} ā
{mšØ : MeasurableSpace šØ} ā
{mĪ© : MeasurableSpace Ī©} ā
(ā ā Ī© ā š) ā
(ā ā Ī© ā š) ā
(ā ā Ī© ā šØ) ā
Learning.Algorithm š š šØ āā¦An algorithm-environment sequence: a sequence of observations, actions and feedbacks generated by an algorithm interacting with an environment.Go to its page
Learning.stationaryEnv : {š : Type u_2} ā
{šØ : Type u_3} ā
{mš : MeasurableSpace š} ā
{mšØ : MeasurableSpace šØ} ā
(ν : ProbabilityTheory.Kernel š šØ) ā [ProbabilityTheory.IsMarkovKernel ν] ā Learning.Environment Unit š šØA stationary environment without observations, in which the distribution of the next feedback depends only on the last action.Go to its page
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
tsum : {α : Type u_4} ā
{β : Type u_5} ā
[AddCommMonoid α] ā
[TopologicalSpace α] ā (β ā α) ā optParam (SummationFilter β) (SummationFilter.unconditional β) ā α`ā' i, f i` is the unconditional sum of `f` if it exists, or 0 otherwise. More generally, if `L` is a `SummationFilter`, `ā'[L] i, f i` is the sum of `f` with respect to `L` if it exists, and `0` otherwise. (Note that even if the unconditional sum exists, it might not be unique if the topology is not separated. When the support of `f` is finite, we make the most reasonable choice, to use the sum over the support. Otherwise, we choose arbitrarily an `a` satisfying `HasSum f a`. Similar remarks apply to more general summation filters.)
MeasureTheory.lintegral : {α : Type u_4} ā {m : MeasurableSpace α} ā MeasureTheory.Measure α ā (α ā ENNReal) ā ENNRealThe **lower Lebesgue integral** of a function `f` with respect to a measure `μ`.
Code
lemma IsAlgEnvSeq.klDiv_map_trajectory [MeasurableSpace.CountablyGenerated šØ]
(h : IsAlgEnvSeq O A Y alg (stationaryEnv Īŗ) P)
(h' : IsAlgEnvSeq O' A' Y' alg (stationaryEnv Īŗ') P') :
klDiv (P.map (trajectory O A Y)) (P'.map (trajectory O' A' Y')) =
ā' t : ā, ā«ā» Ļ, klDiv (Īŗ (A t Ļ)) (Īŗ' (A t Ļ)) āPProof
by
rw [h.klDiv_map_trajectory_compProd h']
refine tsum_congr fun t ⦠?_
rw [klDiv_compProd_right_eq_lintegral,
lintegral_map (measurable_klDiv_kernel Īŗ Īŗ') (h.measurable_action t)]Meaning 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: 9 project declarations, 44 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.