LeanMachineLearning

Learning.randomSampling.tendsto_maxโ‚€๐Ÿ”—

Lemma

The maximum image action converges to the function's global maximum.

๐Ÿ”—theorem
Learning.randomSampling.tendsto_maxโ‚€.{u_1, u_3} {๐“ : Type u_1} {ฮฉ : Type u_3} {m๐“ : MeasurableSpace ๐“} {mฮฉ : MeasurableSpace ฮฉ} {ฮผ : MeasureTheory.Measure ๐“} [MeasureTheory.IsProbabilityMeasure ฮผ] {P : MeasureTheory.Measure ฮฉ} [MeasureTheory.IsProbabilityMeasure P] {A : โ„• โ†’ ฮฉ โ†’ ๐“} [PseudoMetricSpace ๐“] [SecondCountableTopology ๐“] [OpensMeasurableSpace ๐“] [MeasureTheory.Measure.IsOpenPosMeasure ฮผ] {R : โ„• โ†’ ฮฉ โ†’ โ„} {f : ๐“ โ†’ โ„} (hfc : Continuous f) {a : ๐“} (h : IsAlgEnvSeq A R (randomSampling ฮผ) (evalEnv f โ‹ฏ) P) (hf_max : โˆ€ (x : ๐“), f x โ‰ค f a) : MeasureTheory.TendstoInMeasure P (fun n ฯ‰ => Function.max fun i => f (A (โ†‘i) ฯ‰)) Filter.atTop fun x => f a
Learning.randomSampling.tendsto_maxโ‚€.{u_1, u_3} {๐“ : Type u_1} {ฮฉ : Type u_3} {m๐“ : MeasurableSpace ๐“} {mฮฉ : MeasurableSpace ฮฉ} {ฮผ : MeasureTheory.Measure ๐“} [MeasureTheory.IsProbabilityMeasure ฮผ] {P : MeasureTheory.Measure ฮฉ} [MeasureTheory.IsProbabilityMeasure P] {A : โ„• โ†’ ฮฉ โ†’ ๐“} [PseudoMetricSpace ๐“] [SecondCountableTopology ๐“] [OpensMeasurableSpace ๐“] [MeasureTheory.Measure.IsOpenPosMeasure ฮผ] {R : โ„• โ†’ ฮฉ โ†’ โ„} {f : ๐“ โ†’ โ„} (hfc : Continuous f) {a : ๐“} (h : IsAlgEnvSeq A R (randomSampling ฮผ) (evalEnv f โ‹ฏ) P) (hf_max : โˆ€ (x : ๐“), f x โ‰ค f a) : MeasureTheory.TendstoInMeasure P (fun n ฯ‰ => Function.max fun i => f (A (โ†‘i) ฯ‰)) Filter.atTop fun x => f a

Code

lemma tendsto_maxโ‚€ (h : IsAlgEnvSeq A R (randomSampling ฮผ) (evalEnv f hfc.measurable) P)
    (hf_max : โˆ€ x, f x โ‰ค f a) :
    TendstoInMeasure P (fun n ฯ‰ โ†ฆ (fun (i : Iic n) โ†ฆ f (A i.1 ฯ‰)).max) atTop (fun _ โ†ฆ f a)
Proof
by
  rw [tendstoInMeasure_iff_dist]
  intro ฮต hฮต
  refine image_action_tendsto_any hfc h a hฮต |> tendsto_zero_of_le <| ?_
  intro n
  refine measure_mono ?_
  simp only [Set.ofPred_subset_ofPred]
  intro ฯ‰ hฯ‰
  rw [โ† argmin_spec]
  set j := argmin (fun (i : Iic n) โ†ฆ dist (f (A i ฯ‰)) (f a))
  refine hฯ‰.trans ?_
  rw [โ† argmax_spec]
  set k := argmax (fun (i : Iic n) โ†ฆ f (A i ฯ‰))
  have := hf_max (A k ฯ‰)
  have : f (A j ฯ‰) โ‰ค f (A k ฯ‰) :=
    isMaxOn_argmax (fun (i : Iic n) โ†ฆ f (A i ฯ‰)) j
  simp [Real.dist_eq]
  grind

Actions: Source ยท Open Issue

Meaning last changed in v4.34.0-rc2-1-g439785b (2026-08-23), the 4th 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.