Learning.IsBayesAlgEnvSeq.condDistrib_param_history_zero
From the authors
The posterior over the parameter given the empty history is the prior.
-
π : Type u_1MeasurableSpace πA measurable space is a space equipped with a Ο-algebra.StandardBorelSpace πA standard Borel space is a measurable space arising as the Borel sets of some Polish topology.Nonempty π -
π : Type u_2MeasurableSpace π -
π¨ : Type u_3MeasurableSpace π¨ -
Ξ© : Type u_4MeasurableSpace Ξ©
-
Q : 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 QA measureΞΌis called a probability measure ifΞΌ univ = 1. -
ΞΊ : 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. -
alg : Algorithm Unit π π¨A stochastic, sequential algorithm. -
P : MeasureTheory.Measure Ξ©MeasureTheory.IsProbabilityMeasure P -
E : Ξ© β π -
A : β β Ξ© β π -
Y : β β Ξ© β π¨
π[E | history (noObs Ξ©) A Y 0; P] = ProbabilityTheory.Kernel.const (Hist Unit π π¨ 0) QMeasurableSpace : Type u_6 β Type u_6A measurable space is a space equipped with a Ο-algebra.
StandardBorelSpace : (Ξ± : Type u_1) β [MeasurableSpace Ξ±] β PropA standard Borel space is a measurable space arising as the Borel sets of some Polish topology. This is useful in situations where a space has no natural topology or the natural topology in a space is non-Polish. To endow a standard Borel space `Ξ±` with a compatible Polish topology, use `letI := upgradeStandardBorel Ξ±`. One can then use `eq_borel_upgradeStandardBorel Ξ±` to rewrite the `MeasurableSpace Ξ±` instance to `borel Ξ± t`, where `t` is the new topology.
Nonempty : Sort u β Prop`Nonempty Ξ±` is a typeclass that says that `Ξ±` is not an empty type, that is, there exists an element in the type. It differs from `Inhabited Ξ±` in that `Nonempty Ξ±` is a `Prop`, which means that it does not actually carry an element of `Ξ±`, only a proof that *there exists* such an element. Given `Nonempty Ξ±`, you can construct an element of `Ξ±` *nonconstructively* using `Classical.choice`.
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`.
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)`.
Prod : Type u β Type v β Type (max u v)The product type, usually written `Ξ± Γ Ξ²`. Product types are also called pair or tuple types. Elements of this type are pairs in which the first element is an `Ξ±` and the second element is a `Ξ²`. Products nest to the right, so `(x, y, z) : Ξ± Γ Ξ² Γ Ξ³` is equivalent to `(x, (y, z)) : Ξ± Γ (Ξ² Γ Ξ³)`. Conventions for notations in identifiers: * The recommended spelling of `Γ` in identifiers is `Prod`.
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
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.
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.
Learning.IsBayesAlgEnvSeq : {π : Type u_1} β
{π : Type u_2} β
{π¨ : Type u_3} β
{Ξ© : Type u_4} β
[inst : MeasurableSpace π] β
[inst_1 : MeasurableSpace π] β
[inst_2 : MeasurableSpace π¨] β
[inst_3 : MeasurableSpace Ξ©] β
(Q : MeasureTheory.Measure π) β
[MeasureTheory.IsProbabilityMeasure Q] β
(ΞΊ : ProbabilityTheory.Kernβ¦`IsBayesAlgEnvSeq Q ΞΊ alg E A Y P` states that there is a measure `P : Measure Ξ©` such that the parameter `E : Ξ© β π` has law `Q` and that the sequences of actions `A : β β Ξ© β π` and feedbacks `Y : β β Ξ© β π¨` are generated by the algorithm `alg : Algorithm Unit π π¨` interacting with an underlying environment that depends on `E` and `ΞΊ` (`stationaryEnv (ΞΊ.sectR (E Ο))`). This is `IsAlgEnvSeq` for the announcing environment `bayesStationaryEnv Q ΞΊ` and the algorithm `alg.comapObs (fun _ β¦ ())` that ignores the announced parameter: the observation at every round is `E Ο`.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`.ProbabilityTheory.condDistrib : {Ξ± : Type u_5} β
{Ξ² : Type u_6} β
{Ξ© : Type u_7} β
[inst : MeasurableSpace Ξ©] β
[StandardBorelSpace Ξ©] β
[Nonempty Ξ©] β
{x : MeasurableSpace Ξ±} β
[inst_3 : MeasurableSpace Ξ²] β
(Ξ± β Ξ©) β
(Ξ± β Ξ²) β
(ΞΌ : MeasureTheory.Measure Ξ±) β [MeasureTheory.IsFiniteMeasure ΞΌ] β ProbabilityTheory.Kernelβ¦**Regular conditional probability distribution**: kernel associated with the conditional expectation of `Y` given `X`. For almost all `a`, `condDistrib Y X ΞΌ` evaluated at `X a` and a measurable set `s` is equal to the conditional expectation `ΞΌβ¦Y β»ΒΉ' s | mΞ².comap Xβ§ a`. It also satisfies the equality `ΞΌ[(fun a => f (X a, Y a)) | mΞ².comap X] =α΅[ΞΌ] fun a => β« y, f (X a, y) β(condDistrib Y X ΞΌ (X a))` for all integrable functions `f`.
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
Learning.noObs : (Ξ© : Type u_5) β β β Ξ© β UnitThe observation process of an algorithm-environment sequence without observations.Go to its page
ProbabilityTheory.Kernel.const : (Ξ± : Type u_4) β
{Ξ² : Type u_5} β
[inst : MeasurableSpace Ξ±] β {x : MeasurableSpace Ξ²} β MeasureTheory.Measure Ξ² β ProbabilityTheory.Kernel Ξ± Ξ²Constant kernel, which always returns the same measure.
Learning.Hist : Type u_5 β Type u_6 β Type u_7 β β β Type (max (max u_7 u_6) u_5)History of `n` complete rounds; `n = 0` is the empty history.Go to its page
Code
lemma condDistrib_param_history_zero [StandardBorelSpace π] [Nonempty π]
(h : IsBayesAlgEnvSeq Q ΞΊ alg E A Y P) :
condDistrib E (history (noObs Ξ©) A Y 0) P = Kernel.const _ QProof
by
ext x : 1
rw [Unique.eq_default x, history_zero]
have hc : HasCondDistrib E (fun _ : Ξ© β¦ (default : Hist Unit π π¨ 0)) (Kernel.const _ Q) P :=
h.hasLaw_env.hasCondDistrib_const
have h_ae := hc.condDistrib_eq
rw [Measure.map_const, measure_univ, one_smul, Filter.EventuallyEq,
ae_dirac_iff Subsingleton.measurableSet] at h_ae
exact h_aeMeaning 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: 17 project declarations, 47 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.