LeanMachineLearning

Learning.randomSampling.action_tendsto_anyšŸ”—

Theorem

The minimum distance from sampled actions to any point tends to zero.

Types
  • š“ : 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 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 +…SecondCountableTopology š“A second-countable space is one with a countable basis.OpensMeasurableSpace š“A space with MeasurableSpace and TopologicalSpace structures such that all open sets are measurable.
  • š“Ø : Type u_2mš“Ø : MeasurableSpace š“Ø
  • Ī© : Type u_3mĪ© : MeasurableSpace Ī©
Given
  • μ : 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 be IsOpenPosMeasure if it is positive on nonempty open sets.
  • P : MeasureTheory.Measure Ī©MeasureTheory.IsProbabilityMeasure P
  • A : ā„• → Ī© → š“
  • Y : ā„• → Ī© → š“Ø
  • f : š“ → š“Ø
  • a : š“
  • ε : ā„
Assuming
Then
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.
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.