Learning.randomSampling.action_tendsto_any
The minimum distance from sampled actions to any point tends to zero.
-
š : Type u_1mš : MeasurableSpace šA measurable space is a space equipped with a Ļ-algebra.PseudoMetricSpace šA pseudometric space is a type endowed with aā-valued distancedistsatisfying reflexivitydist x x = 0, commutativitydist x y = dist y x, and the triangle inequalitydist x z ⤠dist x y +ā¦SecondCountableTopology šA second-countable space is one with a countable basis.OpensMeasurableSpace šA space withMeasurableSpaceandTopologicalSpacestructures such that all open sets are measurable. -
šØ : Type u_2mšØ : MeasurableSpace šØ -
Ω : Type u_3mΩ : MeasurableSpace Ω
-
μ : 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 μA measureμis called a probability measure ifμ univ = 1.μ.IsOpenPosMeasureA measure is said to beIsOpenPosMeasureif it is positive on nonempty open sets. -
P : MeasureTheory.Measure ΩMeasureTheory.IsProbabilityMeasure P -
A : ā ā Ī© ā š -
Y : ā ā Ī© ā šØ -
f : š ā šØ -
a : š -
ε : ā
-
hf : Measurable fimplicitA functionfbetween measurable spaces is measurable if the preimage of every measurable set is measurable. -
h : IsAlgEnvSeq A Y (randomSampling μ) (evalEnv f hf) PAn algorithm-environment sequence: a sequence of actions and feedbacks generated by an algorithm interacting with an environment. -
hε : 0 < ε
Filter.Tendsto (fun i => P {x | ε ⤠Function.min fun j => dist (A (āj) x) a}) Filter.atTop (nhds 0)Filter.Tendsto is the generic "limit of a function" predicate.MeasurableSpace : Type u_6 ā Type u_6A measurable space is a space equipped with a Ļ-algebra.
PseudoMetricSpace : Type u ā Type uA pseudometric space is a type endowed with a `ā`-valued distance `dist` satisfying reflexivity `dist x x = 0`, commutativity `dist x y = dist y x`, and the triangle inequality `dist x z ⤠dist x y + dist y z`. Note that we do not require `dist x y = 0 ā x = y`. See metric spaces (`MetricSpace`) for the similar class with that stronger assumption. Any pseudometric space is a topological space and a uniform space (see `TopologicalSpace`, `UniformSpace`), where the topology and uniformity come from the metric. Note that a T1 pseudometric space is just a metric space. We make the uniformity/topology part of the data instead of deriving it from the metric. This e.g. ensures that we do not get a diamond when doing `[PseudoMetricSpace α] [PseudoMetricSpace β] : TopologicalSpace (α à β)`: The product metric and product topology agree, but not definitionally so. See Note [forgetful inheritance].
SecondCountableTopology : (α : Type u) ā [t : TopologicalSpace α] ā PropA second-countable space is one with a countable basis.
OpensMeasurableSpace : (α : Type u_6) ā [TopologicalSpace α] ā [h : MeasurableSpace α] ā PropA space with `MeasurableSpace` and `TopologicalSpace` structures such that all open sets are measurable.
MeasureTheory.IsProbabilityMeasure : {α : Type u_1} ā {m0 : MeasurableSpace α} ā MeasureTheory.Measure α ā PropA measure `μ` is called a probability measure if `μ univ = 1`.
MeasureTheory.Measure.IsOpenPosMeasure : {X : Type u_1} ā [TopologicalSpace X] ā {m : MeasurableSpace X} ā MeasureTheory.Measure X ā PropA measure is said to be `IsOpenPosMeasure` if it is positive on nonempty open sets.
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.
Real : TypeThe type `ā` of real numbers constructed as equivalence classes of Cauchy sequences of rational numbers.
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.
Learning.IsAlgEnvSeq : {š : Type u_1} ā
{šØ : Type u_2} ā
{Ī© : Type u_3} ā
{mš : MeasurableSpace š} ā
{mšØ : MeasurableSpace šØ} ā
{mĪ© : MeasurableSpace Ī©} ā
(ā ā Ī© ā š) ā
(ā ā Ī© ā šØ) ā
Learning.Algorithm š šØ ā
Learning.Environment š šØ ā (P : MeasureTheory.Measure Ī©) ā [MeasureTheory.IsFiniteMeasure P] ā PropAn algorithm-environment sequence: a sequence of actions and feedbacks generated by an algorithm interacting with an environment.Go to its page
Learning.randomSampling : {š : Type u_1} ā
{šØ : Type u_2} ā
{mš : MeasurableSpace š} ā
{mšØ : MeasurableSpace šØ} ā
(μ : MeasureTheory.Measure š) ā [MeasureTheory.IsProbabilityMeasure μ] ā Learning.Algorithm š šØThe _Random Sampling_ algorithm, which samples from a fixed probability measure at each iteration.Go to its page
Learning.evalEnv : {š : Type u_1} ā
{šØ : Type u_2} ā
{mš : MeasurableSpace š} ā {mšØ : MeasurableSpace šØ} ā (f : š ā šØ) ā Measurable f ā Learning.Environment š šØThe evaluation environment where the feedback is given by evaluating a fixed measurable function `f` at the chosen action.Go to its page
LT.lt : {α : Type u} ā [self : LT α] ā α ā α ā PropThe less-than relation: `x < y` Conventions for notations in identifiers: * The recommended spelling of `<` in identifiers is `lt`.
Filter.Tendsto : {α : Type u_1} ā {β : Type u_2} ā (α ā β) ā Filter α ā Filter β ā Prop`Filter.Tendsto` is the generic "limit of a function" predicate. `Tendsto f lā lā` asserts that for every `lā` neighborhood `a`, the `f`-preimage of `a` is an `lā` neighborhood.
Set.ofPred : {α : Type u} ā (α ā Prop) ā Set αTurn a predicate `p : α ā Prop` into a set, also written as `{x | p x}`LE.le : {α : Type u} ā [self : LE α] ā α ā α ā PropThe less-equal relation: `x ⤠y` Conventions for notations in identifiers: * The recommended spelling of `ā¤` in identifiers is `le`.
Function.min : {ι : Type u_1} ā {α : Type u_2} ā [LinearOrder α] ā [Fintype ι] ā [Nonempty ι] ā (ι ā α) ā αThe minimum value of a tuple.Go to its page
Dist.dist : {α : Type u_3} ā [self : Dist α] ā α ā α ā āDistance between two points
Filter.atTop : {α : Type u_2} ā [Preorder α] ā Filter α`atTop` is the filter representing the limit `ā ā` on an ordered set.
It is generated by the collection of up-sets `{b | a ⤠b}`.
(The preorder need not have a top element for this to be well defined,
and indeed is trivial when a top element `x` exists, i.e., it coincides with `pure x`.)nhds : {X : Type u_3} ā [TopologicalSpace X] ā X ā Filter XA set is called a neighborhood of `x` if it contains an open set around `x`. The set of all neighborhoods of `x` forms a filter, the neighborhood filter at `x`, is here defined as the infimum over the principal filters of all open sets containing `x`.
Code
theorem action_tendsto_any (h : IsAlgEnvSeq A Y (randomSampling μ) (evalEnv f hf) P) (a : š)
{ε : ā} (hε : 0 < ε) :
Tendsto (fun i => P {x | ε ⤠(fun (j : Iic i) ⦠dist (A j.1 x) a).min}) atTop (š 0)Proof
by
set randomSampling_alg := randomSampling (šØ := šØ) μ
refine tendsto_zero_of_le (g := fun n ⦠P (ā i ā Iic n, {x | ε ⤠dist (A i x) a})) ?_ ?_
Ā· have inter_prod (n : ā) : P (ā j ā Iic n, {x | ε ⤠dist (A j x) a}) =
ā j ā Iic n, P {x | ε ⤠dist (A j x) a} := by
refine iIndepSet.meas_biInter ?_ _
rw [iIndepSet_iff_meas_biInter fun i ⦠?_]
Ā· intro s
have iIndep_actions := randomSampling.iIndep_action h
rw [iIndepFun_iff_measure_inter_preimage_eq_mul] at iIndep_actions
have meas_dist : ā i ā s, MeasurableSet {x | ε ⤠dist x a} := by
intro i hs
measurability
specialize iIndep_actions s meas_dist
simpa [Set.preimage] using iIndep_actions
Ā· have hAi := h.measurable_action i
measurability
simp_rw [inter_prod]
have prod_law (n : ā) : ā j ā Iic n, P {x | ε ⤠dist (A j x) a} =
ā j ā Iic n, μ {x | ε ⤠dist x a} := by
refine prod_congr rfl fun j hj ⦠?_
have hlaw (n : ā) : HasLaw (A n) μ P := randomSampling.hasLaw_action h n
rw [ā (hlaw j).map_eq, P.map_apply]
Ā· simp
Ā· exact h.measurable_action j
Ā· measurability
simp_rw [prod_law]
simp only [prod_const, Nat.card_Iic]
refine tendsto_pow_atTop_nhds_zero_of_lt_one ?_ |> Tendsto.comp <| tendsto_add_atTop_nat 1
have compl : {x | ε ⤠dist x a} = {x | dist x a < ε}ᶠ:= by
ext a
simp
rw [compl, measure_compl (by measurability) (by simp), measure_univ]
refine ENNReal.sub_lt_self (by simp) (by simp) ?_
exact (Metric.measure_ball_pos μ a hε).ne'
Ā· intro n
refine measure_mono ?_
simp only [mem_Iic, Set.subset_iInter_iff, Set.ofPred_subset_ofPred]
intro i hi Ļ (hĻ : ε ⤠(fun (j : Iic n) ⦠dist (A j.1 Ļ) a).min)
simp_all only [univ_eq_attach, le_inf'_iff, mem_attach, forall_const, Subtype.forall, mem_Iic]Actions: Source Ā· Open Issue
Meaning last changed in v4.34.0-rc2-39-gb743f31 (2026-09-08), the 5th 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: 10 project declarations, 87 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.