Samplinglib
Lean gate passed 2026-08-19T06:32:39.895922+00:00 · 7bcd37294df1
Reviewed teaching declaration

dvVariationalScaledTestEnergyBound

CompiledPartial

A one-sided Donsker-Varadhan bound controls the expectation of an energy q under nu by KL(nu||mu)/alpha plus a log-moment term under mu.

Plain-English statement

A one-sided Donsker-Varadhan bound controls the expectation of an energy q under nu by KL(nu||mu)/alpha plus a log-moment term under mu.

Mathematical statement

E_nu[q] <= alpha^{-1} KL(nu||mu) + alpha^{-1} log E_mu[exp(alpha q)], with the latter term named eAlpha.

Intuition

Exponential tilting converts a selected test function into a relative-entropy inequality. ASTIS formalizes this selected-test direction, not the full variational supremum equality.

Conditions

  • nu and mu are probability measures and sigma-finite.
  • nu is absolutely continuous with respect to mu.
  • q is integrable under nu.
  • The alpha0 exponential moment under mu is finite.
  • The log-likelihood ratio is integrable under nu.
  • alpha is positive and no larger than alpha0.

Why these conditions cannot be dropped

  • Absolute continuity and log-likelihood integrability connect Mathlib klDiv to the llr integral.
  • The exponential-moment hypothesis makes the tilted measure and logarithm finite.
  • alpha > 0 is required when dividing the scaled inequality.

Proof route

  • Instantiate the compiled one-sided DV theorem with Z = alpha*q.
  • Obtain integrability of the selected exponential from the alpha0 bound.
  • Rewrite the scaled integral.
  • Divide by positive alpha and substitute the named log-moment quantity.
Lean learning studio · mathematics → formal proof

Read the mathematics first, then descend into Lean

You do not need to know Lean before opening this panel. The page keeps the paper-level theorem, rigorous proof obligations, exact Lean declaration, and proof dependencies as separate layers so a first-time reader can move down one layer at a time.

BeginnerWhy this theorem exists → intuition → statement → one hand calculation. Hide proof-engineering detail.
RigorousExpose assumptions, hidden measure/limit/domain issues, proof route, and rigorous references.
Lean learnerOpen the exact declaration, proof tree/network, syntax glossary, and line-by-line explanation.

Proof architecture

Start with the tree when learning: prerequisites sit below the theorem and downstream results sit above it. Switch to the network when you want to understand where this declaration lives in the local formal library. Every mapped node is clickable.

Loading source-derived dependency evidence…

Graph rule: only dependencies found by the ASTIS source scan are drawn. Missing tactic indirection is treated as an under-approximation; the site never invents an edge just to make a prettier graph.

How to read the exact Lean declaration

Read a Lean theorem left-to-right exactly as you would unpack a mathematical sentence: name → ambient types → automatically inferred structures → explicit hypotheses → conclusion → proof. Then read the proof top-to-bottom as transformations of the current goal.

  1. NameWhat reusable mathematical fact is being created?
  2. ParametersWhich symbols are arbitrary, and which structures are inferred by typeclass search?
  3. PropositionAfter the colon, translate the Lean expression back into a paper statement.
  4. Proof actionsAfter by, ask what each tactic does to the mathematical goal—not only what syntax it uses.

Syntax used on this page

This glossary is filtered to syntax that actually occurs in the declaration above. Open a symbol only when you meet it, rather than memorizing Lean grammar in advance.

Source voice and ASTIS voice stay separate

When Samplinglib shows a short quotation from Chewi, it is labeled as a source excerpt and linked to the canonical book page. Intuition, expanded proof steps, hidden regularity assumptions, and Lean explanations are ASTIS-authored commentary. A quotation never substitutes for a formal proof, and an ASTIS explanation is never attributed to the textbook author.

Lean statement

theorem dvVariationalScaledTestEnergyBound {Ω : Type*} [MeasurableSpace Ω]
    (nu mu : Measure Ω) [IsProbabilityMeasure nu] [IsProbabilityMeasure mu]
    [SigmaFinite mu] [SigmaFinite nu]
    (q : Ω → Real) {alpha alpha0 eAlpha : Real}
    (hAlpha_pos : 0 < alpha) (hAlpha_le : alpha ≤ alpha0)
    (hnu_mu : nu ≪ mu)
    (hq_nu : Integrable q nu)
    (hexp_alpha0_mu : Integrable (fun x ↦ Real.exp (alpha0 * q x)) mu)
    (hllr : Integrable (llr nu mu) nu)
    (heAlpha : eAlpha =
      alpha⁻¹ * Real.log (∫ x, Real.exp (alpha * q x) ∂mu)) :
    (∫ x, q x ∂nu) ≤ alpha⁻¹ * (klDiv nu mu).toReal + eAlpha := by
  have hZ_nu : Integrable (fun x ↦ alpha * q x) nu := by
    simpa [smul_eq_mul] using hq_nu.const_mul alpha
  have hdv := dvVariationalOneSidedOfScaledTest (nu := nu) (mu := mu)
    (q := q) hAlpha_pos.le hAlpha_le hnu_mu hZ_nu hexp_alpha0_mu hllr
  have hscaledIntegral :
      (∫ x, alpha * q x ∂nu) = alpha * ∫ x, q x ∂nu := by
    rw [integral_const_mul]
  have hscaled :
      alpha * (∫ x, q x ∂nu) ≤
        (klDiv nu mu).toReal + Real.log (∫ x, Real.exp (alpha * q x) ∂mu) := by
    have hvar :
        alpha * (∫ x, q x ∂nu) -
            Real.log (∫ x, Real.exp (alpha * q x) ∂mu) ≤
          (klDiv nu mu).toReal := by
      simpa [hscaledIntegral] using hdv
    exact sub_le_iff_le_add.mp hvar
  have hdiv :
      alpha⁻¹ * (alpha * (∫ x, q x ∂nu)) ≤
        alpha⁻¹ * ((klDiv nu mu).toReal +
          Real.log (∫ x, Real.exp (alpha * q x) ∂mu)) := by
    exact mul_le_mul_of_nonneg_left hscaled (inv_nonneg.mpr hAlpha_pos.le)
  calc
    (∫ x, q x ∂nu) = alpha⁻¹ * (alpha * (∫ x, q x ∂nu)) := by
      field_simp [ne_of_gt hAlpha_pos]
    _ ≤ alpha⁻¹ * ((klDiv nu mu).toReal +
          Real.log (∫ x, Real.exp (alpha * q x) ∂mu)) := hdiv
    _ = alpha⁻¹ * (klDiv nu mu).toReal + eAlpha := by
      rw [heAlpha]
      ring

/-- Coefficient-preserving energy form of the selected scaled-test DV bound.

This is the local algebraic shape used before Gronwall in SALD proofs after a
nonnegative prefactor, such as `(1/2)*dot{s}(t)^(-1)`, multiplies the
post-DV energy estimate.
-/

Lean interface notes

  • Measure-theoretic hypotheses are typeclasses and explicit arguments together.
  • klDiv is ENNReal and is converted to Real only under the stated finite representation.
  • This result must not be labeled as the full Donsker-Varadhan variational formula.