ProbabilityTheory.hasLaw_of_forall_eventually_eq
From the authors
Let Y n : Ω → Π i, 𝓧 i be random variables with law μ, indexed by a countably generated
filter L. If for every ω and i, Y n ω i is eventually equal to Y' ω i along L, then Y'
also has law μ.
-
Ω : Type u_1mΩ : MeasurableSpace ΩA measurable space is a space equipped with a σ-algebra. -
ι : Type u_3 -
κ : Type u_5
-
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.IsFiniteMeasure PA measureμis called finite ifμ univ < ∞. -
𝓧 : ι → Type u_4(i : ι) → MeasurableSpace (𝓧 i) -
L : Filter κA filterFon a typeαis a collection of sets ofαwhich contains the wholeα, is upwards-closed, and is stable under intersection.L.NeBotA filter isNeBotif it is not equal to⊥, or equivalently the empty set does not belong to the filter.L.IsCountablyGeneratedIsCountablyGenerated fmeansf = generate sfor some countables. -
μ : MeasureTheory.Measure ((i : ι) → 𝓧 i) -
Y : κ → Ω → (i : ι) → 𝓧 i -
Y' : Ω → (i : ι) → 𝓧 i
-
hY : ∀ (n : κ), Measurable (Y n)A functionfbetween measurable spaces is measurable if the preimage of every measurable set is measurable. -
hY' : AEMeasurable Y' PA function is almost everywhere measurable if it coincides almost everywhere with a measurable function. -
h_law : ∀ (n : κ), HasLaw (Y n) μ PThe predicateHasLaw X μ Pregisters the fact that the random variableXhas lawμunder the measureP, in other words thatP.map X = μ. -
h_lim : ∀ (ω : Ω) (i : ι), ∀ᶠ (n : κ) in L, Y n ω i = Y' ω if.Eventually por∀ᶠ x in f, p xmean that{x | p x} ∈ f.
HasLaw Y' μ PMeasurableSpace : Type u_6 → Type u_6A measurable space is a space equipped with a σ-algebra.
MeasureTheory.IsFiniteMeasure : {α : Type u_1} → {m0 : MeasurableSpace α} → MeasureTheory.Measure α → PropA measure `μ` is called finite if `μ univ < ∞`.
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`.
Filter.NeBot : {α : Type u_1} → Filter α → PropA filter is `NeBot` if it is not equal to `⊥`, or equivalently the empty set does not belong to the filter. Bourbaki include this assumption in the definition of a filter but we prefer to have a `CompleteLattice` structure on `Filter _`, so we use a typeclass argument in lemmas instead.
Filter.IsCountablyGenerated : {α : Type u_1} → Filter α → Prop`IsCountablyGenerated f` means `f = generate s` for some countable `s`.
Filter : Type u_1 → Type u_1A filter `F` on a type `α` is a collection of sets of `α` which contains the whole `α`, is upwards-closed, and is stable under intersection. We do not forbid this collection to be all sets of `α`.
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.
AEMeasurable : {α : Type u_1} →
{β : Type u_2} →
[MeasurableSpace β] →
{_m : MeasurableSpace α} → (α → β) → autoParam (MeasureTheory.Measure α) AEMeasurable._auto_1 → PropA function is almost everywhere measurable if it coincides almost everywhere with a measurable function. A similar notion is `MeasureTheory.NullMeasurable`. That notion is equivalent to `AEMeasurable` if the σ-algebra on the codomain is countably generated, but weaker in general.
ProbabilityTheory.HasLaw : {Ω : Type u_1} →
{𝓧 : Type u_2} →
{mΩ : MeasurableSpace Ω} →
{m𝓧 : MeasurableSpace 𝓧} →
(Ω → 𝓧) → MeasureTheory.Measure 𝓧 → autoParam (MeasureTheory.Measure Ω) ProbabilityTheory.HasLaw._auto_1 → PropThe predicate `HasLaw X μ P` registers the fact that the random variable `X` has law `μ` under the measure `P`, in other words that `P.map X = μ`. We also require `X` to be `AEMeasurable`, to allow for nice interactions with operations on the codomain of `X`. See for instance `HasLaw.comp`, `IndepFun.hasLaw_mul` and `IndepFun.hasLaw_add`.
Filter.Eventually : {α : Type u_1} → (α → Prop) → Filter α → Prop`f.Eventually p` or `∀ᶠ x in f, p x` mean that `{x | p x} ∈ f`. E.g., `∀ᶠ x in atTop, p x`
means that `p` holds true for sufficiently large `x`.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`.Code
lemma hasLaw_of_forall_eventually_eq [IsFiniteMeasure P] {κ : Type*} {L : Filter κ} [L.NeBot]
[L.IsCountablyGenerated] {μ : Measure (Π i, 𝓧 i)} {Y : κ → Ω → Π i, 𝓧 i} {Y' : Ω → Π i, 𝓧 i}
(hY : ∀ n, Measurable (Y n)) (hY' : AEMeasurable Y' P)
(h_law : ∀ n, HasLaw (Y n) μ P) (h_lim : ∀ ω i, ∀ᶠ n in L, Y n ω i = Y' ω i) :
HasLaw Y' μ P where
aemeasurableProof
hY'
map_eq := by
refine ext_of_generate_finite (measurableCylinders _) generateFrom_measurableCylinders.symm
isPiSystem_measurableCylinders (fun s hs ↦ ?_) ?_
· obtain ⟨I, S, hS, rfl⟩ := (mem_measurableCylinders s).1 hs
rw [Measure.map_apply_of_aemeasurable hY' (hS.cylinder _)]
have h_tendsto : Tendsto (fun n ↦ P (Y n ⁻¹' cylinder I S)) L
(𝓝 (P (Y' ⁻¹' cylinder I S))) := by
refine tendsto_measure_of_tendsto_indicator_of_isFiniteMeasure L P
(fun n ↦ (hS.cylinder _).preimage (hY n)) fun ω ↦ ?_
have h_ev : ∀ᶠ n in L, ∀ i ∈ I, Y n ω i = Y' ω i :=
(eventually_all_finset I).2 fun i _ ↦ h_lim ω i
filter_upwards [h_ev] with n hn
simp only [Set.mem_preimage, mem_cylinder]
have : I.restrict (Y n ω) = I.restrict (Y' ω) := funext fun i ↦ hn i i.2
rw [this]
have h_const : Tendsto (fun n ↦ P (Y n ⁻¹' cylinder I S)) L (𝓝 (μ (cylinder I S))) := by
have : (fun n ↦ P (Y n ⁻¹' cylinder I S)) = fun _ ↦ μ (cylinder I S) := by
funext n
rw [← Measure.map_apply (hY n) (hS.cylinder _), (h_law n).map_eq]
rw [this]
exact tendsto_const_nhds
exact tendsto_nhds_unique h_tendsto h_const
· obtain ⟨n⟩ := L.nonempty_of_neBot
rw [Measure.map_apply_of_aemeasurable hY' MeasurableSet.univ, Set.preimage_univ,
← (h_law n).map_eq,
Measure.map_apply (hY n) MeasurableSet.univ, Set.preimage_univ]Meaning last changed in v4.34.0-rc2-76-g565f652 (2026-09-10).
Self-contained, with its dependencies inlined and proofs replaced by sorry: download the raw file · open it in the Lean web editor.
Dependency graph
Nothing to draw. Its statement rests on no other declaration in this project, and names nothing from a package left unaudited — so the graph is this declaration alone. That is the answer, not a missing picture.
Audit surface: 0 project declarations, 12 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.