Samplinglib
Lean gate not recorded for this source state main · 9bb7a7394ab0

RelativeFisher: mathematical reading route

Read the statements and derivations in source order. Every result has its own optional Lean statement and proof. Source assumptions, library reuse and unproved boundaries are kept explicit.

  1. The shared finite-dimensional Euclidean state space
  2. Weighted squared-gradient energy at a point
  3. Integrate the supplied weighted score energy
  4. A nonnegative weight gives nonnegative pointwise energy
  5. A zero supplied gradient gives zero pointwise energy
  6. Almost-everywhere zero gradient gives zero shared information
  7. Equal gradients almost everywhere give equal weighted information
Samplinglib mathematical lesson

The shared finite-dimensional Euclidean state space

AutoSamplingTheory.TechnicalLemmas.InformationTheory.RelativeFisher.State · abbrev · Teaching coverage

Read this first

Mathematical statement

State is the local name for Mathlib's real Euclidean space indexed by ι. The abbreviation itself can be formed for any index type; subsequent energy and gradient declarations in this module assume ι finite.

\[E:=\operatorname{EuclideanSpace}(\mathbb R,\iota).\]
Lean statement · State

This is a shorter type name, not a theorem about a state space or a probability distribution.

Braces mark parameters Lean can infer; square brackets request structures such as a measurable space or probability measure. Named hypotheses are mathematical premises, not facts established by this declaration. Section parameters are described in the mathematical hypotheses above; the module link retains their exact source context.

abbrev State

Exact module and namespace context

Proof roadmap

  1. 1Reuse the existing coordinate space

    The local name unfolds directly to Mathlib's Euclidean type; no geometric structure is constructed anew.

Full assumptions and notation

All objects and hypotheses

  • ι is an index type. No Fintype proof is used by the abbreviation itself; finite-dimensional analysis later uses the surrounding Fintype ι instance.
  • No measure, function, or positive-dimension assumption.

Construction and meaning

1. Reuse the existing coordinate space

The local name unfolds directly to Mathlib's Euclidean type; no geometric structure is constructed anew.

\[\mathrm{State}\equiv\operatorname{EuclideanSpace}(\mathbb R,\iota).\]
Corresponding Lean step

EuclideanSpace

Lean verification

The exact proof begins folded immediately after the mathematical argument; the statement is folded beside the claim above.

Lean construction · State

There is no proof. The abbreviation expands to the existing Mathlib coordinate type.

Braces mark parameters Lean can infer; square brackets request structures such as a measurable space or probability measure. Named hypotheses are mathematical premises, not facts established by this declaration. Section parameters are described in the mathematical hypotheses above; the module link retains their exact source context.

Download module (.lean)
abbrev State := EuclideanSpace ℝ ι

Exact module and namespace context

Scope and omitted-condition boundaries
  • No probability, positivity-of-dimension, or infinite-dimensional Fisher theorem is asserted.
Sources, dependencies, and reuse

Source and reuse

Samplinglib parents called

    Mathlib API called (external library)

    • EuclideanSpace

    Mathematical sources

    Samplinglib prose is not a quotation or a source-equivalence certificate. Definitions and aliases are explained as constructions, not counted as new mathematical proofs.

    Samplinglib mathematical lesson

    Weighted squared-gradient energy at a point

    AutoSamplingTheory.TechnicalLemmas.InformationTheory.RelativeFisher.densityEnergy · def · Teaching coverage

    Read this first

    Mathematical statement

    For finite-dimensional real Euclidean space E, arbitrary functions q,r:E→ℝ, and x∈E, define densityEnergy(q,r,x) to be q(x) times the squared norm of the totalized classical gradient of r at x. The formal inputs need not be a density and a log-ratio despite their suggestive names.

    \[e_{q,r}(x):=q(x)\|\nabla r(x)\|^2.\]
    Lean statement · densityEnergy

    The construction returns one real value from two functions and one point. It contains no assertion that q is an RN density or that r is differentiable.

    Braces mark parameters Lean can infer; square brackets request structures such as a measurable space or probability measure. Named hypotheses are mathematical premises, not facts established by this declaration. Section parameters are described in the mathematical hypotheses above; the module link retains their exact source context.

    noncomputable def densityEnergy
        (q logRatio : State (ι := ι) → ℝ) (x : State (ι := ι)) : ℝ

    Exact module and namespace context

    Proof roadmap

    1. 1Measure the gradient's squared length

      The globally defined gradient expression supplies a vector, and its squared norm supplies a nonnegative real factor.

    2. 2Multiply by the supplied weight

      Use q(x) exactly as provided. The resulting energy need not be nonnegative if q(x) is negative.

    Full assumptions and notation

    All objects and hypotheses

    • ι is a finite index type (Fintype ι), and E=EuclideanSpace ℝ ι has its standard real inner product, topology and Borel measurable structure. Empty ι is allowed.
    • q and r are arbitrary functions E→ℝ. Their argument names do not assert that q is a density or r is a log-density; neither measurability nor differentiability is assumed.
    • x is any point of E; no nonnegativity, normalization, measure, or integrability premise.

    Construction and meaning

    1. Measure the gradient's squared length

    The globally defined gradient expression supplies a vector, and its squared norm supplies a nonnegative real factor.

    \[v(x):=\nabla r(x),\qquad\|v(x)\|^2\ge0.\]
    Corresponding Lean step

    gradient

    2. Multiply by the supplied weight

    Use q(x) exactly as provided. The resulting energy need not be nonnegative if q(x) is negative.

    \[e_{q,r}(x)=q(x)\|v(x)\|^2.\]
    Corresponding Lean step

    RelativeFisher.densityEnergy

    Lean verification

    The exact proof begins folded immediately after the mathematical argument; the statement is folded beside the claim above.

    Lean construction · densityEnergy

    This definition multiplies the supplied weight by a squared gradient norm. Analytic regularity and density interpretation must be justified by a later interface.

    Braces mark parameters Lean can infer; square brackets request structures such as a measurable space or probability measure. Named hypotheses are mathematical premises, not facts established by this declaration. Section parameters are described in the mathematical hypotheses above; the module link retains their exact source context.

    Download module (.lean)
    noncomputable def densityEnergy
        (q logRatio : State (ι := ι) → ℝ) (x : State (ι := ι)) : ℝ :=
      q x * ‖gradient logRatio x‖ ^ 2

    Exact module and namespace context

    Scope and omitted-condition boundaries
    • gradient is the totalized classical gradient, equal to zero at nondifferentiable points. No classical differentiability, weak derivative, Sobolev domain, or selected-representative/score equivalence follows merely from writing it.
    • No RN/log-ratio relation, positive density, source Fisher normalization, or square-root-energy identity is supplied.
    Sources, dependencies, and reuse

    Source and reuse

    Samplinglib parents called

      Mathlib API called (external library)

      • gradient

      Mathematical sources

      Samplinglib prose is not a quotation or a source-equivalence certificate. Definitions and aliases are explained as constructions, not counted as new mathematical proofs.

      Samplinglib mathematical lesson

      Integrate the supplied weighted score energy

      AutoSamplingTheory.TechnicalLemmas.InformationTheory.RelativeFisher.information · def · Teaching coverage

      Read this first

      Mathematical statement

      On finite-dimensional real Euclidean space E, let β be any measure and q,r:E→ℝ arbitrary functions. Define the shared RelativeFisher information to be the real Bochner integral of q‖∇r‖² under β. This layer has no domain guard, so existence of the real-valued expression does not imply genuine finite Fisher energy.

      \[\mathcal I_\beta(q,r):=\int_E e_{q,r}(x)\,d\beta(x)=\int_Eq(x)\|\nabla r(x)\|^2\,d\beta(x).\]
      Lean statement · information

      The base measure is an explicit parameter, not fixed to Lebesgue measure or to a probability law. Unlike CanonicalRelativeFisher.information, this definition takes no admissibility certificate.

      Braces mark parameters Lean can infer; square brackets request structures such as a measurable space or probability measure. Named hypotheses are mathematical premises, not facts established by this declaration. Section parameters are described in the mathematical hypotheses above; the module link retains their exact source context.

      noncomputable def information
          (base : Measure (State (ι := ι)))
          (q logRatio : State (ι := ι) → ℝ) : ℝ

      Exact module and namespace context

      Proof roadmap

      1. 1Form the supplied energy integrand

        Use the existing densityEnergy expression without changing the supplied q or r.

      2. 2Take its totalized real integral

        Integrate against the explicit base β. The integrable case has the usual finite integral; if integrability fails, Mathlib assigns zero.

      Full assumptions and notation

      All objects and hypotheses

      • ι is a finite index type (Fintype ι), and E=EuclideanSpace ℝ ι has its standard real inner product, topology and Borel measurable structure. Empty ι is allowed.
      • q and r are arbitrary functions E→ℝ. Their argument names do not assert that q is a density or r is a log-density; neither measurability nor differentiability is assumed.
      • β is any measure on E; it need not be probability, finite, σ-finite, or Lebesgue measure.
      • No Integrable e β, nonnegative q, normalized q, or differentiability premise.

      Construction and meaning

      1. Form the supplied energy integrand

      Use the existing densityEnergy expression without changing the supplied q or r.

      \[e_{q,r}(x)=q(x)\|\nabla r(x)\|^2.\]
      Corresponding Lean step

      RelativeFisher.densityEnergy

      2. Take its totalized real integral

      Integrate against the explicit base β. The integrable case has the usual finite integral; if integrability fails, Mathlib assigns zero.

      \[\mathcal I_\beta(q,r)=\int_E e_{q,r}\,d\beta,\qquad e_{q,r}\notin L^1(\beta)\Longrightarrow\mathcal I_\beta(q,r)=0.\]
      Corresponding Lean step

      MeasureTheory.integral; integral_undef

      Lean verification

      The exact proof begins folded immediately after the mathematical argument; the statement is folded beside the claim above.

      Lean construction · information

      The body simply integrates the already-defined pointwise energy. It does not prove integrability, density reconstruction, or any equality with a measure-level Fisher quantity.

      Braces mark parameters Lean can infer; square brackets request structures such as a measurable space or probability measure. Named hypotheses are mathematical premises, not facts established by this declaration. Section parameters are described in the mathematical hypotheses above; the module link retains their exact source context.

      Download module (.lean)
      noncomputable def information
          (base : Measure (State (ι := ι)))
          (q logRatio : State (ι := ι) → ℝ) : ℝ :=
        ∫ x, densityEnergy q logRatio x ∂base

      Exact module and namespace context

      Scope and omitted-condition boundaries
      • gradient is the totalized classical gradient, equal to zero at nondifferentiable points. No classical differentiability, weak derivative, Sobolev domain, or selected-representative/score equivalence follows merely from writing it.
      • The real Bochner integral is totalized: a nonintegrable integrand has integral 0. No finite-energy or extended-valued Fisher interpretation is supplied unless the relevant analytic domain is established separately.
      • No general nonnegativity is claimed for arbitrary signed q. No normalization, KL relation, RN measure-change identity, or Sobolev/square-root Fisher equivalence is built into this definition.
      Sources, dependencies, and reuse

      Source and reuse

      Samplinglib parents called

      Mathlib API called (external library)

      • MeasureTheory.integral

      Mathematical sources

      Samplinglib prose is not a quotation or a source-equivalence certificate. Definitions and aliases are explained as constructions, not counted as new mathematical proofs.

      Samplinglib mathematical lesson

      A nonnegative weight gives nonnegative pointwise energy

      AutoSamplingTheory.TechnicalLemmas.InformationTheory.RelativeFisher.densityEnergy_nonneg · theorem · Teaching coverage

      Read this first

      Mathematical statement

      For arbitrary functions q,r:E→ℝ on finite-dimensional Euclidean space and a point x, if q(x)≥0 then the pointwise densityEnergy(q,r,x) is nonnegative.

      \[q(x)\ge0\quad\Longrightarrow\quad e_{q,r}(x)=q(x)\|\nabla r(x)\|^2\ge0.\]
      Lean statement · densityEnergy_nonneg

      The sole mathematical premise is a sign condition at this point. The conclusion is a pointwise real inequality, not an integral bound.

      Braces mark parameters Lean can infer; square brackets request structures such as a measurable space or probability measure. Named hypotheses are mathematical premises, not facts established by this declaration. Section parameters are described in the mathematical hypotheses above; the module link retains their exact source context.

      theorem densityEnergy_nonneg
          {q logRatio : State (ι := ι) → ℝ} {x : State (ι := ι)}
          (hq : 0 ≤ q x) :
          0 ≤ densityEnergy q logRatio x

      Exact module and namespace context

      Proof roadmap

      1. 1Use the squared-norm sign

        The squared norm is a real square and is always nonnegative, including when the gradient is its default zero.

      2. 2Multiply nonnegative factors

        Combine the supplied weight inequality with the squared-norm inequality.

      Full assumptions and notation

      All objects and hypotheses

      • ι is a finite index type (Fintype ι), and E=EuclideanSpace ℝ ι has its standard real inner product, topology and Borel measurable structure. Empty ι is allowed.
      • q and r are arbitrary functions E→ℝ. Their argument names do not assert that q is a density or r is a log-density; neither measurability nor differentiability is assumed.
      • x∈E and hq proves only the pointwise inequality q(x)≥0. No global nonnegativity or measure hypothesis.

      Mathematical proof

      1. Use the squared-norm sign

      The squared norm is a real square and is always nonnegative, including when the gradient is its default zero.

      \[0\le\|\nabla r(x)\|^2.\]
      Corresponding Lean step

      sq_nonneg

      2. Multiply nonnegative factors

      Combine the supplied weight inequality with the squared-norm inequality.

      \[0\le q(x),\quad0\le\|\nabla r(x)\|^2\Longrightarrow0\le e_{q,r}(x).\]
      Corresponding Lean step

      mul_nonneg hq

      Lean verification

      The exact proof begins folded immediately after the mathematical argument; the statement is folded beside the claim above.

      Lean proof · densityEnergy_nonneg

      The proof applies the nonnegative-product rule to the supplied weight and a nonnegative square. No differentiability calculation is involved.

      Braces mark parameters Lean can infer; square brackets request structures such as a measurable space or probability measure. Named hypotheses are mathematical premises, not facts established by this declaration. Section parameters are described in the mathematical hypotheses above; the module link retains their exact source context.

      Download module (.lean)
      theorem densityEnergy_nonneg
          {q logRatio : State (ι := ι) → ℝ} {x : State (ι := ι)}
          (hq : 0 ≤ q x) :
          0 ≤ densityEnergy q logRatio x := by
        exact mul_nonneg hq (sq_nonneg _)

      Exact module and namespace context

      Scope and omitted-condition boundaries
      • gradient is the totalized classical gradient, equal to zero at nondifferentiable points. No classical differentiability, weak derivative, Sobolev domain, or selected-representative/score equivalence follows merely from writing it.
      • No global sign condition on q, density normalization, or integrated Fisher inequality is proved here.
      Sources, dependencies, and reuse

      Source and reuse

      Samplinglib parents called

      Mathlib API called (external library)

      • mul_nonneg
      • sq_nonneg

      Mathematical sources

      Samplinglib prose is not a quotation or a source-equivalence certificate. Definitions and aliases are explained as constructions, not counted as new mathematical proofs.

      Samplinglib mathematical lesson

      A zero supplied gradient gives zero pointwise energy

      AutoSamplingTheory.TechnicalLemmas.InformationTheory.RelativeFisher.densityEnergy_eq_zero_of_gradient_eq_zero · theorem · Teaching coverage

      Read this first

      Mathematical statement

      For arbitrary functions q,r:E→ℝ on finite-dimensional Euclidean space, if the totalized gradient of r at x is zero, then densityEnergy(q,r,x)=0. No restriction on the sign or magnitude of q(x) is needed.

      \[\nabla r(x)=0\quad\Longrightarrow\quad e_{q,r}(x)=q(x)\|0\|^2=0.\]
      Lean statement · densityEnergy_eq_zero_of_gradient_eq_zero

      The gradient equality is supplied, not inferred from equality or constancy of function values at a point. The weight is arbitrary.

      Braces mark parameters Lean can infer; square brackets request structures such as a measurable space or probability measure. Named hypotheses are mathematical premises, not facts established by this declaration. Section parameters are described in the mathematical hypotheses above; the module link retains their exact source context.

      theorem densityEnergy_eq_zero_of_gradient_eq_zero
          {q logRatio : State (ι := ι) → ℝ} {x : State (ι := ι)}
          (hgrad : gradient logRatio x = 0) :
          densityEnergy q logRatio x = 0

      Exact module and namespace context

      Proof roadmap

      1. 1Substitute the zero gradient

        Its norm and squared norm are zero, so multiplication by any real q(x) leaves zero.

      Full assumptions and notation

      All objects and hypotheses

      • ι is a finite index type (Fintype ι), and E=EuclideanSpace ℝ ι has its standard real inner product, topology and Borel measurable structure. Empty ι is allowed.
      • q and r are arbitrary functions E→ℝ. Their argument names do not assert that q is a density or r is a log-density; neither measurability nor differentiability is assumed.
      • x∈E and hgrad asserts gradient r x=0 as an equality of vectors. No differentiability premise is included.

      Mathematical proof

      1. Substitute the zero gradient

      Its norm and squared norm are zero, so multiplication by any real q(x) leaves zero.

      \[e_{q,r}(x)=q(x)\|0\|^2=q(x)\cdot0=0.\]
      Corresponding Lean step

      simp [RelativeFisher.densityEnergy, hgrad]

      Lean verification

      The exact proof begins folded immediately after the mathematical argument; the statement is folded beside the claim above.

      Lean proof · densityEnergy_eq_zero_of_gradient_eq_zero

      Unfold the energy, replace the gradient by zero, and simplify the norm, square and product.

      Braces mark parameters Lean can infer; square brackets request structures such as a measurable space or probability measure. Named hypotheses are mathematical premises, not facts established by this declaration. Section parameters are described in the mathematical hypotheses above; the module link retains their exact source context.

      Download module (.lean)
      theorem densityEnergy_eq_zero_of_gradient_eq_zero
          {q logRatio : State (ι := ι) → ℝ} {x : State (ι := ι)}
          (hgrad : gradient logRatio x = 0) :
          densityEnergy q logRatio x = 0 := by
        simp [densityEnergy, hgrad]

      Exact module and namespace context

      Scope and omitted-condition boundaries
      • gradient is the totalized classical gradient, equal to zero at nondifferentiable points. No classical differentiability, weak derivative, Sobolev domain, or selected-representative/score equivalence follows merely from writing it.
      • A zero totalized gradient may reflect nondifferentiability; this implication does not establish genuine differentiability or characterize when the energy vanishes.
      Sources, dependencies, and reuse

      Source and reuse

      Samplinglib parents called

      Mathlib API called (external library)

      • norm_zero
      • zero_pow
      • mul_zero

      Mathematical sources

      Samplinglib prose is not a quotation or a source-equivalence certificate. Definitions and aliases are explained as constructions, not counted as new mathematical proofs.

      Samplinglib mathematical lesson

      Almost-everywhere zero gradient gives zero shared information

      AutoSamplingTheory.TechnicalLemmas.InformationTheory.RelativeFisher.information_eq_zero_of_gradient_ae_eq_zero · theorem · Teaching coverage

      Read this first

      Mathematical statement

      Let β be any measure on finite-dimensional Euclidean space E and q,r:E→ℝ arbitrary functions. If the totalized gradient of r is zero β-almost everywhere, then the shared information integral is zero. No positivity, normalization, or independent integrability premise is needed.

      \[\nabla r=0\quad\beta\text{-a.e.}\quad\Longrightarrow\quad\mathcal I_\beta(q,r)=\int_Eq\|\nabla r\|^2\,d\beta=0.\]
      Lean statement · information_eq_zero_of_gradient_ae_eq_zero

      The a.e. premise refers to gradients themselves under the explicit base measure. It is not merely an assertion that r equals a constant a.e.

      Braces mark parameters Lean can infer; square brackets request structures such as a measurable space or probability measure. Named hypotheses are mathematical premises, not facts established by this declaration. Section parameters are described in the mathematical hypotheses above; the module link retains their exact source context.

      theorem information_eq_zero_of_gradient_ae_eq_zero
          (base : Measure (State (ι := ι)))
          (q logRatio : State (ι := ι) → ℝ)
          (hgrad : ∀ᵐ x ∂base, gradient logRatio x = 0) :
          information base q logRatio = 0

      Exact module and namespace context

      Proof roadmap

      1. 1Expose the defining integral

        Unfold the shared information functional; the integrand remains the same weighted score energy.

      2. 2Obtain a zero integrand on the supplied full-measure set

        At every point where the supplied gradient vanishes, the preceding pointwise theorem gives zero energy regardless of the weight.

      3. 3Integrate the a.e. zero function

        The Bochner integral of a function equal to zero a.e. is zero; no separate integrability hypothesis is needed for this theorem.

      Full assumptions and notation

      All objects and hypotheses

      • ι is a finite index type (Fintype ι), and E=EuclideanSpace ℝ ι has its standard real inner product, topology and Borel measurable structure. Empty ι is allowed.
      • q and r are arbitrary functions E→ℝ. Their argument names do not assert that q is a density or r is a log-density; neither measurability nor differentiability is assumed.
      • β is an arbitrary measure on E, without probability or finiteness assumptions.
      • hgrad is the β-a.e. equality gradient r x=0. No differentiability or integrability condition on q or r is present.

      Mathematical proof

      1. Expose the defining integral

      Unfold the shared information functional; the integrand remains the same weighted score energy.

      \[\mathcal I_\beta(q,r)=\int_Ee_{q,r}\,d\beta.\]
      Corresponding Lean step

      RelativeFisher.information

      2. Obtain a zero integrand on the supplied full-measure set

      At every point where the supplied gradient vanishes, the preceding pointwise theorem gives zero energy regardless of the weight.

      \[\nabla r(x)=0\Longrightarrow e_{q,r}(x)=0,\qquad e_{q,r}=0\quad\beta\text{-a.e.}.\]
      Corresponding Lean step

      filter_upwards; RelativeFisher.densityEnergy_eq_zero_of_gradient_eq_zero

      3. Integrate the a.e. zero function

      The Bochner integral of a function equal to zero a.e. is zero; no separate integrability hypothesis is needed for this theorem.

      \[e_{q,r}=0\quad\beta\text{-a.e.}\Longrightarrow\int_E e_{q,r}\,d\beta=0.\]
      Corresponding Lean step

      MeasureTheory.integral_eq_zero_of_ae

      Lean verification

      The exact proof begins folded immediately after the mathematical argument; the statement is folded beside the claim above.

      Lean proof · information_eq_zero_of_gradient_ae_eq_zero

      The proof first unfolds information, then transfers the supplied zero-gradient equality to a zero-energy equality a.e., and finally uses the zero-integral rule.

      Braces mark parameters Lean can infer; square brackets request structures such as a measurable space or probability measure. Named hypotheses are mathematical premises, not facts established by this declaration. Section parameters are described in the mathematical hypotheses above; the module link retains their exact source context.

      Download module (.lean)
      theorem information_eq_zero_of_gradient_ae_eq_zero
          (base : Measure (State (ι := ι)))
          (q logRatio : State (ι := ι) → ℝ)
          (hgrad : ∀ᵐ x ∂base, gradient logRatio x = 0) :
          information base q logRatio = 0 := by
        rw [information]
        apply integral_eq_zero_of_ae
        filter_upwards [hgrad] with x hx
        exact densityEnergy_eq_zero_of_gradient_eq_zero hx

      Exact module and namespace context

      Scope and omitted-condition boundaries
      • gradient is the totalized classical gradient, equal to zero at nondifferentiable points. No classical differentiability, weak derivative, Sobolev domain, or selected-representative/score equivalence follows merely from writing it.
      • An equality a.e. of function values does not by itself identify classical gradients. No pointwise choice on exceptional null sets or independence under arbitrary null-set changes is proved.
      • This is a sufficient condition, not a converse: zero totalized information does not in general imply a zero genuine score or equality of measures.
      Sources, dependencies, and reuse

      Source and reuse

      Samplinglib parents called

      Mathlib API called (external library)

      • MeasureTheory.integral_eq_zero_of_ae

      Mathematical sources

      Samplinglib prose is not a quotation or a source-equivalence certificate. Definitions and aliases are explained as constructions, not counted as new mathematical proofs.

      Samplinglib mathematical lesson

      Equal gradients almost everywhere give equal weighted information

      AutoSamplingTheory.TechnicalLemmas.InformationTheory.RelativeFisher.information_congr_gradient_ae · theorem · Teaching coverage

      Read this first

      Mathematical statement

      Let β be any measure on finite-dimensional Euclidean space and let q,r,s:E→ℝ be arbitrary functions. If the totalized gradients of r and s agree β-almost everywhere, their shared weighted information values with the same weight q and base β are equal. No equality of r and s themselves is required.

      \[\nabla r=\nabla s\quad\beta\text{-a.e.}\quad\Longrightarrow\quad\mathcal I_\beta(q,r)=\mathcal I_\beta(q,s).\]
      Lean statement · information_congr_gradient_ae

      The hypothesis compares gradients, not log-ratio values. No equality of function values is required. Conversely, an a.e. function-value identity alone is not the premise here: the gradient equality must be supplied separately.

      Braces mark parameters Lean can infer; square brackets request structures such as a measurable space or probability measure. Named hypotheses are mathematical premises, not facts established by this declaration. Section parameters are described in the mathematical hypotheses above; the module link retains their exact source context.

      theorem information_congr_gradient_ae
          (base : Measure (State (ι := ι)))
          (q r s : State (ι := ι) → ℝ)
          (hgrad : ∀ᵐ x ∂base, gradient r x = gradient s x) :
          information base q r = information base q s

      Exact module and namespace context

      Proof roadmap

      1. 1Open both energy integrals

        Use the same base measure and weight, leaving only the squared-gradient factor to compare.

      2. 2Transfer gradient equality to energy equality

        At points in the supplied full-β-measure set, equal vectors have equal squared norms, and multiplication by the same q preserves equality.

      3. 3Use a.e. integral congruence

        The two integrands are equal a.e., so their totalized Bochner integrals agree without needing separate integrability proofs.

      Full assumptions and notation

      All objects and hypotheses

      • ι is a finite index type (Fintype ι), and E=EuclideanSpace ℝ ι has its standard real inner product, topology and Borel measurable structure. Empty ι is allowed.
      • β is any measure on E, and q,r,s are arbitrary real-valued functions on E.
      • hgrad supplies gradient r x=gradient s x for β-almost every x; no function-value equality, differentiability, nonnegativity or integrability premise is included.
      • The base β and the weight q are identical on both sides.

      Mathematical proof

      1. Open both energy integrals

      Use the same base measure and weight, leaving only the squared-gradient factor to compare.

      \[\mathcal I_\beta(q,r)=\int_Eq\|\nabla r\|^2\,d\beta,\qquad\mathcal I_\beta(q,s)=\int_Eq\|\nabla s\|^2\,d\beta.\]
      Corresponding Lean step

      RelativeFisher.information; RelativeFisher.densityEnergy

      2. Transfer gradient equality to energy equality

      At points in the supplied full-β-measure set, equal vectors have equal squared norms, and multiplication by the same q preserves equality.

      \[\nabla r(x)=\nabla s(x)\Longrightarrow q(x)\|\nabla r(x)\|^2=q(x)\|\nabla s(x)\|^2.\]
      Corresponding Lean step

      filter_upwards; simp [RelativeFisher.densityEnergy, hx]

      3. Use a.e. integral congruence

      The two integrands are equal a.e., so their totalized Bochner integrals agree without needing separate integrability proofs.

      \[e_{q,r}=e_{q,s}\quad\beta\text{-a.e.}\Longrightarrow\int_Ee_{q,r}\,d\beta=\int_Ee_{q,s}\,d\beta.\]
      Corresponding Lean step

      MeasureTheory.integral_congr_ae

      Lean verification

      The exact proof begins folded immediately after the mathematical argument; the statement is folded beside the claim above.

      Lean proof · information_congr_gradient_ae

      The proof rewrites both functional names as integrals, uses the gradient hypothesis to make their integrands equal a.e., and applies integral congruence. It does not prove the gradient equality.

      Braces mark parameters Lean can infer; square brackets request structures such as a measurable space or probability measure. Named hypotheses are mathematical premises, not facts established by this declaration. Section parameters are described in the mathematical hypotheses above; the module link retains their exact source context.

      Download module (.lean)
      theorem information_congr_gradient_ae
          (base : Measure (State (ι := ι)))
          (q r s : State (ι := ι) → ℝ)
          (hgrad : ∀ᵐ x ∂base, gradient r x = gradient s x) :
          information base q r = information base q s := by
        rw [information, information]
        apply integral_congr_ae
        filter_upwards [hgrad] with x hx
        simp [densityEnergy, hx]
      
      end
      
      end RelativeFisher
      end InformationTheory
      end TechnicalLemmas
      end AutoSamplingTheory

      Exact module and namespace context

      Scope and omitted-condition boundaries
      • gradient is the totalized classical gradient, equal to zero at nondifferentiable points. No classical differentiability, weak derivative, Sobolev domain, or selected-representative/score equivalence follows merely from writing it.
      • The real Bochner integral is totalized: a nonintegrable integrand has integral 0. No finite-energy or extended-valued Fisher interpretation is supplied unless the relevant analytic domain is established separately.
      • This is not automatic independence of Fisher information under arbitrary a.e. changes to an RN/log-ratio representative. Actual a.e. gradient equality is the required adapter.
      • No change of base measure, weight, weak/classical derivative domain or source Fisher definition is covered.
      Sources, dependencies, and reuse

      Source and reuse

      Samplinglib parents called

      Mathlib API called (external library)

      • MeasureTheory.integral_congr_ae

      Mathematical sources

      Samplinglib prose is not a quotation or a source-equivalence certificate. Definitions and aliases are explained as constructions, not counted as new mathematical proofs.