Samplinglib
Lean gate not recorded for this source state main · 0e31a3cda412
ASTIS mathematical exposition

On a positive retained fiber, the update is normalized target restriction

AutoSamplingTheory.TechnicalLemmas.Probability.CoordinateHeatBath.heatBath_eq_cond · theorem · Teaching coverage

Statement

Let μ be any finite measure on a finite dependent product of measurable coordinate spaces. Fix i with Xi nonempty Standard Borel, assume measurable singletons in the retained product Ri, and choose x whose retained fiber Fi(x) has nonzero μ mass. Then the actual coordinate heat-bath output measure at x equals μ restricted to Fi(x), scaled by the reciprocal of its mass. Thus for every measurable event A in the full state space, the transition probability is μ(Fi(x)∩A)/μ(Fi(x)). This is an equality of whole output measures at this fixed positive fiber, not merely a selected-coordinate marginal identity.

\[0<\mu(F_i(x))<\infty\quad\Longrightarrow\quad K_i(x)=\operatorname{cond}(\mu,F_i(x))=\mu(F_i(x))^{-1}\,\mu|_{F_i(x)},\qquad K_i(x,A)=\frac{\mu(F_i(x)\cap A)}{\mu(F_i(x))}.\]

All objects and hypotheses

  • {n : ℕ} — n is an arbitrary natural number, so Fin (n+1) is a nonempty finite index set. Individual coordinate spaces need not be finite.
  • (X : Fin (n + 1) → Type*) — X is a possibly dependent family: coordinate j may have its own type X j. A state x is a function choosing x j : X j for every j.
  • [∀ j, MeasurableSpace (X j)] — Each coordinate is measurable; the full and retained products use their product sigma-algebras.
  • (μ : Measure (∀ j, X j)) [IsFiniteMeasure μ] — μ is any finite measure on the full state space. It may have zero mass or be unnormalized.
  • (i : Fin (n + 1)) — i is a fixed selected coordinate, not a randomly drawn index.
  • [StandardBorelSpace (X i)] [Nonempty (X i)] — Only the selected coordinate must be nonempty and Standard Borel. The other coordinates need neither condition for the construction, Markovness, or invariance.
  • [MeasurableSingletonClass (∀ j : Fin n, X (i.succAbove j))] — The retained product Ri has measurable singletons. This makes its conditioning atom {r_i(x)} and the full-state fiber Fi(x) measurable. It is a separate assumption from the selected coordinate's Standard Borel structure; no Standard Borel assumption is added on Ri.
  • (x : ∀ j, X j) — x is a fixed input state.
  • (hx : μ {y | (fun j => y (i.succAbove j)) = (fun j => x (i.succAbove j))} ≠ 0) — The entire retained fiber has nonzero μ mass. Because μ is finite, this is exactly 0 < μ(Fi(x)) < ∞. It is not the stronger assumption μ{x}>0, although that would suffice by inclusion.

Notation and interpretation

S

The dependent full state space, written ∀ j, X j in Lean.

\[S=\prod_{j\in\operatorname{Fin}(n+1)}X_j\]
R_i

The retained-coordinate product. i.succAbove lists every original index except i; k is its own Fin n index.

\[R_i=\prod_{k\in\operatorname{Fin}(n)}X_{i.\operatorname{succAbove}(k)}\]
r_i

The tuple of all unselected coordinates; this is explanatory notation, not a newly introduced Lean declaration.

\[r_i(x)(k)=x(i.\operatorname{succAbove}(k))\]
e_i

MeasurableEquiv.piFinSuccAbove X i first places Xi before Ri; composing with prodComm puts retained coordinates first. e_i and its inverse are measurable.

\[e_i:S\simeq_{\mathrm{meas}}R_i\times X_i,\qquad e_i(x)=(r_i(x),x_i)\]
η_i,m_i,q_i

Pushed-forward joint target, retained marginal, and selected conditional version.

\[\eta_i=(e_i)_\#\mu,\qquad m_i=(\operatorname{fst})_\#\eta_i,\qquad q_i(r)=\operatorname{condDistrib}(\operatorname{snd}\mid\operatorname{fst};\eta_i)(r)\]
K_i

The existing public CoordinateHeatBath.heatBath X μ i; this evaluated formula uses HeatBath.heatBathSnd_apply.

\[K_i(x)=(e_i^{-1})_\#\bigl(\delta_{r_i(x)}\otimes q_i(r_i(x))\bigr)\]
F_i(x)

The retained fiber through x; its defining equality is equality of retained dependent tuples, not equality of just one coordinate.

\[F_i(x)=\{y\in S:r_i(y)=r_i(x)\}=r_i^{-1}(\{r_i(x)\})\]
cond(μ,F)

Mathlib's totalized normalized restriction. Its measurable-set values are μ(F)⁻¹ μ(F∩A), with arithmetic in the extended nonnegative reals.

\[\operatorname{cond}(\mu,F)=\mu(F)^{-1}\,\mu|_F\]
a,g,B

Local proof notation for the retained atom, the insertion map from Xi to S, and the preimage of a measurable test set A.

\[a=r_i(x),\qquad g(b)=e_i^{-1}(a,b),\qquad B=g^{-1}(A)\]
  • All sets used to test equality of measures are measurable unless explicitly stated otherwise.
  • All measure values, reciprocals and scalar multiplications in the Lean conditional formula are in ℝ≥0∞. Integral displays of kernel probabilities denote nonnegative extended integrals, not Bochner integrals with unstated integrability hypotheses.
  • The notation r_i, F_i, e_i, q_i and K_i in the teaching text is explanatory mathematical shorthand, not new public Lean definitions.
  • Markovness quantifies over every input; a selected conditional version's law characterization is only marginal-a.e. unless a positive-atom/fiber theorem applies.
  • Finite target mass is not probability normalization. Fin (n+1) counts sites, not states. No law is assumed to have a density.

Mathematical proof

1. Identify the positive atom of the retained marginal

Set e=e_i, η=e#μ, and a=r_i(x)=(e x)1. The marginal mass of the singleton {a} is the mass of its inverse-image fiber. Both pushforward formulas apply to measurable sets: Ri has measurable singletons and e and fst are measurable. The given fiber hypothesis becomes exactly the nonzero-atom condition required by the conditional-law formula.

\[m_i(\{a\})=((\operatorname{fst})_\#\eta)(\{a\})=\mu(\{y:(e y)_1=a\})=\mu(F_i(x))\ne0.\]
Corresponding Lean step

hm; two uses of Measure.map_apply, measurableSet_singleton, measurable_fst, and e.measurable. rwa rewrites the nonzero statement to hx.

2. Reduce equality of measures to a measurable event

To prove equality of two measures, fix an arbitrary measurable A⊆S and compare their masses. Evaluate the coordinate kernel using its construction and the one-block product-law theorem. The inverse split is measurable, so this is a genuine pushforward calculation.

\[K_i(x,A)=\bigl((e^{-1})_\#(\delta_a\otimes q_i(a))\bigr)(A).\]
Corresponding Lean step

apply Measure.ext; intro s hs; change exposes heatBath; Kernel.map_apply, Kernel.comap_apply, HeatBath.heatBathSnd_apply.

3. Collapse the Dirac product to an insertion map

The product δa⊗q_i(a) is the pushforward of q_i(a) along b↦(a,b). Compose that insertion with e⁻¹, defining g(b)=e⁻¹(a,b). Because both maps are measurable, the output event is measured by q_i(a) on B=g⁻¹(A).

\[\delta_a\otimes q_i(a)=(b\mapsto(a,b))_\#q_i(a),\qquad K_i(x,A)=q_i(a,g^{-1}(A)).\]
Corresponding Lean step

Measure.dirac_prod; Measure.map_map e.symm.measurable measurable_prodMk_left; Measure.map_apply (e.symm.measurable.comp measurable_prodMk_left) hs.

4. Evaluate the selected conditional law at the positive atom

Mathlib's conditional-distribution formula applies at a because m_i{a}≠0, and the second projection is measurable. It expresses q_i(a,B) by the joint mass of {a}×B divided by the marginal atom mass. The paired projections map on the split space is the identity, so its pushforward is η itself. This reuses the existing atomic conditional-law theorem, not a new proof of disintegration.

\[q_i(a,B)=m_i(\{a\})^{-1}\,\eta(\{a\}\times B),\qquad B=g^{-1}(A).\]
Corresponding Lean step

condDistrib_apply_of_ne_zero measurable_snd _ hm; simp only [Prod.eta, Measure.map_id'].

5. Pull the numerator and denominator back to the original state space

The rectangle {a}×B is measurable because {a} and B are measurable. Pulling it back through e gives the event that y has retained tuple a and that reconstructing (a,(e y)2) lies in A. The denominator pulls back to Fi(x), as in step 1.

\[\eta(\{a\}\times B)=\mu\bigl(\{y:(e y)_1=a\ \land\ e^{-1}(a,(e y)_2)\in A\}\bigr),\qquad m_i(\{a\})=\mu(F_i(x)).\]
Corresponding Lean step

Measure.map_apply e.measurable on the measurable rectangle; subsequent Measure.map_apply rewrites for the marginal.

6. Use the fiber equality to simplify the reconstruction

On the event (e y)1=a, substitute the actual first component of e y for a. Then (a,(e y)2)=e y and e⁻¹(e y)=y. Therefore the numerator event equals Fi(x)∩A. Prove both inclusions rather than presuming the insertion always returns y off the fiber.

\[\bigl((e y)_1=a\ \land\ e^{-1}(a,(e y)_2)\in A\bigr)\iff\bigl((e y)_1=a\ \land\ y\in A\bigr).\]
Corresponding Lean step

congr 1; congr 1; ext y; constructor; in each direction rintro ⟨hy,hys⟩ and simpa only [← hy, Prod.eta, e.symm_apply_apply] using hys.

7. Recognize normalized restriction

For measurable A, cond_apply' evaluates the normalized restriction at exactly μ(Fi(x))⁻¹ μ(Fi(x)∩A), which is the expression obtained. Equality on every measurable A proves the measure identity. Finiteness rules out an infinite denominator; the explicit hypothesis rules out zero.

\[K_i(x,A)=\mu(F_i(x))^{-1}\mu(F_i(x)\cap A)=\operatorname{cond}(\mu,F_i(x))(A).\]
Corresponding Lean step

cond_apply' hs appears before the final set identity in the Lean rewrite sequence; Measure.ext completes after the numerators are identified.

Lean statement · heatBath_eq_cond

On a fiber with positive target mass, conditioning means keeping only the target mass on that fiber and renormalizing it to total mass one. The proof checks that the abstract kernel already does exactly this, after translating between split coordinates and the original state. For a zero fiber the normalized restriction is the zero measure, while the actual transition remains a probability measure, so the equality genuinely fails there.

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 heatBath_eq_cond (X : Fin (n + 1) → Type*) [∀ j, MeasurableSpace (X j)]
    (μ : Measure (∀ j, X j)) [IsFiniteMeasure μ]
    (i : Fin (n + 1)) [StandardBorelSpace (X i)] [Nonempty (X i)]
    [MeasurableSingletonClass (∀ j : Fin n, X (i.succAbove j))]
    (x : ∀ j, X j)
    (hx : μ {y | (fun j => y (i.succAbove j)) = (fun j => x (i.succAbove j))} ≠ 0) :
    heatBath X μ i x =
      cond μ {y | (fun j => y (i.succAbove j)) = (fun j => x (i.succAbove j))}

Exact module and namespace context

Lean proof · heatBath_eq_cond

`hx` is an explicit mathematical assumption. It is used to prove `hm`, the positive marginal-atom premise for the imported conditional-law theorem; it is not inferred from arbitrary input membership. `Measure.ext` asks for equality on every measurable set. The Lean variables `s` and `hs` correspond to the proof's A and its measurability. `Measure.dirac_prod` changes the retained Dirac product into a measurable insertion pushforward, making a single conditional-law evaluation possible. `condDistrib_apply_of_ne_zero` is imported Mathlib reuse. Its denominator is the retained marginal atom, and the double map rewrites identify that denominator with the original fiber's mass. The two `congr 1` steps reduce equality of scaled measure values to equality of the sets measured in their numerators. `ext y` then proves set equality point by point. `constructor` proves both directions of the final iff. `hy` is crucial: the reconstructed state equals y only on the retained fiber, not for all y. The source uses `n` as an implicitly auto-bound natural number and has the same CoordinateHeatBath namespace as the construction despite being in the separate CoordinateHeatBathConditional module.

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 heatBath_eq_cond (X : Fin (n + 1) → Type*) [∀ j, MeasurableSpace (X j)]
    (μ : Measure (∀ j, X j)) [IsFiniteMeasure μ]
    (i : Fin (n + 1)) [StandardBorelSpace (X i)] [Nonempty (X i)]
    [MeasurableSingletonClass (∀ j : Fin n, X (i.succAbove j))]
    (x : ∀ j, X j)
    (hx : μ {y | (fun j => y (i.succAbove j)) = (fun j => x (i.succAbove j))} ≠ 0) :
    heatBath X μ i x =
      cond μ {y | (fun j => y (i.succAbove j)) = (fun j => x (i.succAbove j))} := by
  let e := (MeasurableEquiv.piFinSuccAbove X i).trans MeasurableEquiv.prodComm
  have hm : (μ.map e).map Prod.fst {(e x).1} ≠ 0 := by
    rwa [Measure.map_apply measurable_fst (measurableSet_singleton _),
      Measure.map_apply e.measurable (measurable_fst (measurableSet_singleton _))]
  apply Measure.ext
  intro s hs
  change (((HeatBath.heatBathSnd (μ.map e)).comap e e.measurable).map e.symm x) s = _
  rw [Kernel.map_apply _ e.symm.measurable, Kernel.comap_apply,
    HeatBath.heatBathSnd_apply, Measure.dirac_prod,
    Measure.map_map e.symm.measurable measurable_prodMk_left,
    Measure.map_apply (e.symm.measurable.comp measurable_prodMk_left) hs,
    condDistrib_apply_of_ne_zero measurable_snd _ hm]
  simp only [Prod.eta, Measure.map_id']
  rw [Measure.map_apply e.measurable
    ((measurableSet_singleton _).prod ((e.symm.measurable.comp measurable_prodMk_left) hs)),
    Measure.map_apply measurable_fst (measurableSet_singleton _),
    Measure.map_apply e.measurable (measurable_fst (measurableSet_singleton _)),
    cond_apply' hs]
  congr 1
  congr 1
  ext y
  change ((e y).1 = (e x).1 ∧ e.symm ((e x).1, (e y).2) ∈ s) ↔
    ((e y).1 = (e x).1 ∧ y ∈ s)
  constructor
  · rintro ⟨hy, hys⟩
    refine ⟨hy, ?_⟩
    simpa only [← hy, Prod.eta, e.symm_apply_apply] using hys
  · rintro ⟨hy, hys⟩
    refine ⟨hy, ?_⟩
    simpa only [← hy, Prod.eta, e.symm_apply_apply] using hys

end AutoSamplingTheory.TechnicalLemmas.Probability.CoordinateHeatBath

Exact module and namespace context

Worked example

S=Fin 3→Bool; a=(false,false,false), b=(false,true,false), c=(true,false,false), off=(false,false,true). Target μ=(1/6)δa+(1/2)δb+(1/3)δc and selected coordinate i=1.

\[\mu(F_1(a))=\tfrac23,\quad K_1(a,\{b\})=\tfrac34,\quad K_1(a,\{a\})=\tfrac14,\quad K_1(a,\{c\})=0.\]

a and b have the same retained coordinates 0 and 2, so their masses normalize by 2/3; c differs at retained coordinate 0 and is excluded.

Why the positive-fiber hypothesis matters

\[\mu(F_1(\mathrm{off}))=0,\quad\operatorname{cond}(\mu,F_1(\mathrm{off}))=0,\quad K_1(\mathrm{off},S)=1.\]

The target is a nonzero probability measure, yet off has a null retained fiber. The normalized restriction has mass zero and cannot equal the always-Markov selected update. This is a counterexample to dropping hx, not a counterexample to the source algorithm's supported-start convention.

Scope and omitted-condition boundaries

  • These are existing source-neutral measure/kernel interfaces, not newly proved claims in this research packet. Reading source and historical tests is not a fresh Lean build or independent verification.
  • Finite target measure means μ(univ) < ∞, not μ(univ) = 1; zero and finite unnormalized targets are allowed unless a positive-fiber hypothesis rules them out.
  • A selected regular conditional distribution is a probability kernel at every conditioning value. Its conditional-law characterization is determined only almost everywhere under the conditioning marginal; null fibers have no asserted feasible/Gibbs-support property.
  • No reversibility, irreducibility, ergodicity, convergence from a different initial law, mixing rate, random scan, scan-order correctness, executable conditional sampling or cost bound follows from these declarations alone.
  • Finite coordinate count is not finite state space. The theorem does not require positive mass for every configuration or impose Standard Borel structure on all retained coordinates.
  • Under μ(Fi(x))≠0 and finiteness, the normalized restriction is a probability law and has full mass on the measurable retained fiber. Neither this formula nor conditional-support conclusions extend to μ-null fibers.
  • Positive singleton starting mass μ{x}≠0 suffices by {x}⊆Fi(x), but that implication is a private test adapter, not a second public theorem in this module.
  • Do not present the formula as a random-site scan theorem, a concrete Gibbs target normalization, or accepted fidelity to the literal conflicting source copy step.

Source and reuse

ASTIS parents called

Mathlib API called (external library)

  • MeasurableEquiv.piFinSuccAbove
  • MeasurableEquiv.prodComm
  • MeasureTheory.Measure.ext
  • ProbabilityTheory.Kernel.map_apply
  • ProbabilityTheory.Kernel.comap_apply
  • MeasureTheory.Measure.dirac_prod
  • MeasureTheory.Measure.map_map
  • MeasureTheory.Measure.map_apply
  • ProbabilityTheory.condDistrib_apply_of_ne_zero
  • ProbabilityTheory.cond_apply'
  • MeasureTheory.Measure.map_id'
  • MeasurableEquiv.symm_apply_apply
  • measurable_prodMk_left
  • measurable_fst
  • measurable_snd
  • measurableSet_singleton

Whole-product equality is proved for the existing kernel. heatBath_invariant, KernelMixture, and KernelInvariance occur in tests/interpretation but are not proof prerequisites of heatBath_eq_cond.

Mathematical sources

Older frontier cells and the coordinate card say the printed copy-index repair is pending. The later positive-fiber card and source-support audit record separate acceptance of the exact one-index correction as ASTIS-REPAIR-20260908-GlauberCopyIndex. The old PositiveFiberUpdate audit remains possible-source-error for its limited page-5 evidence window. Do not overwrite that history, call the original PDF corrected, call a null-fiber start a counterexample to the positive-support source convention, or infer full source fidelity. This packet reads local evidence only; it performs no new PDF/source certification.

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