Samplinglib
Lean gate passed 2026-08-19T06:32:39.895922+00:00 · 7bcd37294df1
Reviewed teaching declaration · langevin.whole-space-gibbs-weighted-generator-ibp-compact-test

integral_expNeg_langevinGenerator_rhs_eq_zero_of_contDiff_of_hasCompactSupport

compiled Samplinglib leaf Compiled explicit smoke test

For every compactly supported twice continuously differentiable test function, the unnormalized Gibbs-weighted Langevin generator has integral zero.

Plain-English statement

For every compactly supported twice continuously differentiable test function, the unnormalized Gibbs-weighted Langevin generator has integral zero.

Scope guard. This card records a compiled local declaration. Its mathematical scope is exactly the Lean statement below; the Registry note and source correspondence may describe motivation but do not strengthen it.

Mathematical statement

If V is C1 and f is C2 with compact support, then integral exp(-V(x)) (Delta f(x) - <grad V(x), grad f(x)>) dx = 0.

Intuition

The displayed integrand is the divergence of exp(-V) grad f. Since f is compactly supported, its derivative and the weighted vector field vanish near infinity, so no boundary flux remains.

Conditions

  • The potential V is globally C1.
  • The test function f is globally C2.
  • The test function f has compact topological support.

Why these conditions cannot be dropped

  • C1 regularity gives the Gibbs-weight chain rule and a continuous gradient of V on the relevant compact region.
  • C2 regularity gives the differentiable gradient field and Laplacian appearing in the generator.
  • Compact support removes the boundary term without requiring finite total Gibbs mass or a globally bounded potential gradient.

Proof route

  • Build the raw finite-Pi field exp(-V) times the coordinate derivatives of f.
  • Prove that field is C1 and supported in the transported topological support of f.
  • Apply the generic compact-support whole-space divergence theorem.
  • Use the compiled trace identity to identify the divergence with the Gibbs-weighted Langevin display pointwise.
  • Transport the integral through the volume-preserving PiLp equivalence.

Lean interface notes

  • The result is the analytic core integral Lf d pi = 0 before normalization; multiplying by the finite normalizing constant is downstream algebra.
  • It proves no closed-generator membership or derivative of a semigroup pairing.
  • The invariant-law milestone remains red until those operator and semigroup contracts compile.
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 integral_expNeg_langevinGenerator_rhs_eq_zero_of_contDiff_of_hasCompactSupport
    {n : ℕ}
    {V f : EuclideanSpace ℝ (Fin (n + 1)) → ℝ}
    (hV : ContDiff ℝ 1 V)
    (hf : ContDiff ℝ 2 f)
    (hf_support : HasCompactSupport f) :
    ∫ y : EuclideanSpace ℝ (Fin (n + 1)),
        Real.exp (-V y) *
          (Laplacian.laplacian f y - inner ℝ (gradient V y) (gradient f y)) = 0 := by
  let e : EuclideanSpace ℝ (Fin (n + 1)) ≃L[ℝ] (Fin (n + 1) → ℝ) :=
    PiLp.continuousLinearEquiv 2 ℝ (fun _ : Fin (n + 1) => ℝ)
  let F : (Fin (n + 1) → ℝ) → Fin (n + 1) → ℝ :=
    fun z => fun i =>
      Real.exp (-V (e.symm z)) *
        fderiv ℝ f (e.symm z) (EuclideanSpace.single i (1 : ℝ))
  have hF : ContDiff ℝ 1 F := by
    apply contDiff_pi.2
    intro i
    exact (hV.comp e.symm.contDiff).neg.exp.mul
      (((hf.fderiv_right (m := 1) (by norm_num)).comp e.symm.contDiff).clm_apply
        contDiff_const)
  have hF_support : HasCompactSupport F := by
    refine HasCompactSupport.of_support_subset_isCompact
      (hf_support.isCompact.image e.continuous) ?_
    intro x hx
    have hxe : e.symm x ∈ tsupport f := by
      by_contra hxe
      have hzero : fderiv ℝ f (e.symm x) = 0 :=
        fderiv_of_notMem_tsupport ℝ hxe
      exact hx (by
        funext i
        simp [F, hzero])
    exact ⟨e.symm x, hxe, e.apply_symm_apply x⟩
  have hdiv :=
    _root_.AutoSamplingTheory.TechnicalLemmas.Analysis.Calculus.Divergence.integral_coordinateDivergence_wrapped_eq_zero_of_contDiff_of_hasCompactSupport
      F hF hF_support
  have hraw :
      ∫ x : Fin (n + 1) → ℝ,
          Real.exp (-V (e.symm x)) *
            (Laplacian.laplacian f (e.symm x) -
              inner ℝ (gradient V (e.symm x)) (gradient f (e.symm x))) = 0 := by
    calc
      ∫ x : Fin (n + 1) → ℝ,
          Real.exp (-V (e.symm x)) *
            (Laplacian.laplacian f (e.symm x) -
              inner ℝ (gradient V (e.symm x)) (gradient f (e.symm x))) =
          ∫ x : Fin (n + 1) → ℝ,
            _root_.AutoSamplingTheory.TechnicalLemmas.Analysis.Calculus.Divergence.coordinateDivergence
              (fun y : EuclideanSpace ℝ (Fin (n + 1)) =>
                (WithLp.toLp 2 (F (WithLp.ofLp y)) :
                  EuclideanSpace ℝ (Fin (n + 1))))
              (WithLp.toLp 2 x : EuclideanSpace ℝ (Fin (n + 1))) := by
        apply integral_congr_ae
        exact Filter.Eventually.of_forall fun x => by
          have htrace :=
            trace_expNeg_fderivCoordinateField_langevinGenerator_display_of_hasFDerivAt
              (V := V) (f := f) (x := x) (F' := fderiv ℝ F x)
              (by simpa [F, e] using (hF.differentiable one_ne_zero x).hasFDerivAt)
              (hV.differentiable one_ne_zero _)
              ((hf.fderiv_right (m := 1) (by norm_num)).differentiable one_ne_zero _)
              (hf.differentiable (by norm_num) _)
          have hwrapped :=
            _root_.AutoSamplingTheory.TechnicalLemmas.Analysis.Calculus.Divergence.coordinateDivergence_wrapped_toPi_trace_of_hasFDerivAt
              (ι := Fin (n + 1)) (hF.differentiable one_ne_zero x).hasFDerivAt
          change
            Real.exp (-V (e.symm x)) *
                (Laplacian.laplacian f (e.symm x) -
                  inner ℝ (gradient V (e.symm x)) (gradient f (e.symm x))) =
              _root_.AutoSamplingTheory.TechnicalLemmas.Analysis.Calculus.Divergence.coordinateDivergence
                (fun y : EuclideanSpace ℝ (Fin (n + 1)) =>
                  (WithLp.toLp 2 (F (WithLp.ofLp y)) :
                    EuclideanSpace ℝ (Fin (n + 1))))
                (WithLp.toLp 2 x : EuclideanSpace ℝ (Fin (n + 1)))
          calc
            _ = ∑ i, fderiv ℝ F x (Pi.single i (1 : ℝ)) i := by
              simpa [e] using htrace.symm
            _ = _ := hwrapped.symm
      _ = 0 := by simpa [F, e] using hdiv
  rw [← (PiLp.volume_preserving_toLp (Fin (n + 1))).integral_comp
    (MeasurableEquiv.toLp 2 _).measurableEmbedding]
  simpa [e] using hraw

/-- Whole-space integrability of the Gibbs-weighted coordinate derivative
field from finiteness of the unnormalized Gibbs mass and a uniform operator
norm bound on the test-function derivative.

This theorem proves only source-field integrability.  It does not prove a
cutoff main-term limit, weighted integration by parts, stationarity, or an
invariant Gibbs law. -/
Common pitfall. A wrapper or display identity is not a new analytic theorem merely because it has its own Lean name. Check the statement, hypotheses, and downstream consumers before interpreting its mathematical contribution.