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

Successful stopped executions have one output and count

Fan Chen, Sinho Chewi, Jianfeng Lu and Matthew S. Zhang; ASTIS explicitly scoped implementation restatement, not a full D.4 or main theorem.

arXiv:2609.06906v1 · Algorithm D.2 deterministic stopped-gradient routine; implementation identity needed to use the same routine in D.4 · faithful paraphrase

Complete source statement (Samplinglib restatement)

For the deterministic stopped gradient interpreter of Algorithm D.2, any two successful finite-fuel executions from the same y and initial x, using the same g,eta,eps, return exactly the same pair (output point, actual gradient-test count), independently of the sufficient fuels.

  • E is a real normed vector space; g:E->E, eta,eps,y and initial state x are arbitrary. Two supplied finite fuels n,m yield successful returned pairs r,s under the same deterministic interpreter. No positivity, contractivity or termination hypothesis.

Actual implementation component

\[\operatorname{run}(g,\eta,\varepsilon,y,n,x)=\operatorname{some}(r),\quad\operatorname{run}(g,\eta,\varepsilon,y,m,x)=\operatorname{some}(s)\quad\Longrightarrow\quad r=s.\]

Read the formalized proofs

Each statement and proof below has its own closed Lean disclosure. Samplinglib parents, Mathlib calls and external mathematical sources are distinguished in each proof.

Samplinglib mathematical lesson

Successful stopped executions have one output and count

AutoSamplingTheory.ExampleCases.SmoothedPicardHMC.ProximalExecutionIdentity.successful_query_unique · theorem · Teaching coverage

Read this first

Mathematical statement

For the deterministic stopped gradient interpreter of Algorithm D.2, any two successful finite-fuel executions from the same y and initial x, using the same g,eta,eps, return exactly the same pair (output point, actual gradient-test count), independently of the sufficient fuels.

\[\operatorname{run}(g,\eta,\varepsilon,y,n,x)=\operatorname{some}(r),\quad\operatorname{run}(g,\eta,\varepsilon,y,m,x)=\operatorname{some}(s)\quad\Longrightarrow\quad r=s.\]
Lean statement · successful_query_unique

Arbitrary real normed E, g, eta, eps, y, x and finite fuels n,m; successful interpreter equations for both returned pairs imply exact equality r=s. No measure or probability law occurs.

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 successful_query_unique {E : Type*} [NormedAddCommGroup E]
    [NormedSpace ℝ E] (g : E → E) (eta eps : ℝ) (y : E)
    {n m : ℕ} {x : E} {r s : E × ℕ}
    (hr : ApproximateProximalExecution.proximalQuery g eta eps y n x = some r)
    (hs : ApproximateProximalExecution.proximalQuery g eta eps y m x = some s) : r = s

Exact module and namespace context

Proof roadmap

  1. 1Exclude zero fuel

    Zero fuel returns none, so a supplied successful run cannot have zero fuel. Induct on the first fuel and eliminate zero fuel for the second.

  2. 2Compare identical stopping branches

    Both positive-fuel runs evaluate the same gradient at the same current x and the same residual test. If that test succeeds, both return the current x with count one. This counts the final gradient evaluation.

  3. 3Compare identical continuing branches

    If the common residual test fails, both recurse at the same next point y-eta*g(x). Successful Option.map outputs imply successful recursive returned pairs. The induction hypothesis identifies those pairs; applying the same count increment gives equality of the outer returned pairs. No mathematical contraction or termination claim is needed.

Full assumptions and notation

All objects and hypotheses

  • E is a real normed vector space; g:E→E, eta,eps,y and initial state x are arbitrary. Two supplied finite fuels n,m yield successful returned pairs r,s under the same deterministic interpreter. No positivity, contractivity or termination hypothesis.

Mathematical proof

1. Exclude zero fuel

Zero fuel returns none, so a supplied successful run cannot have zero fuel. Induct on the first fuel and eliminate zero fuel for the second.

\[\operatorname{run}(\cdot,0,x)=\operatorname{none}.\]
Corresponding Lean step

induction n; cases m; simp [proximalQuery] at hr hs

2. Compare identical stopping branches

Both positive-fuel runs evaluate the same gradient at the same current x and the same residual test. If that test succeeds, both return the current x with count one. This counts the final gradient evaluation.

\[\|y-\eta g(x)-x\|\le(1-\eta)\varepsilon\ \Longrightarrow\ r=s=(x,1).\]
Corresponding Lean step

split_ifs; Option.some.inj

3. Compare identical continuing branches

If the common residual test fails, both recurse at the same next point y-eta*g(x). Successful Option.map outputs imply successful recursive returned pairs. The induction hypothesis identifies those pairs; applying the same count increment gives equality of the outer returned pairs. No mathematical contraction or termination claim is needed.

\[r\prime=s\prime\ \Longrightarrow\ (r\prime_1,r\prime_2+1)=(s\prime_1,s\prime_2+1).\]
Corresponding Lean step

Option.map_eq_some_iff; induction hypothesis; congrArg

Lean verification

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

Lean proof · successful_query_unique

Induct on the first fuel, eliminate zero successful fuel for either run, then compare the identical residual test. A stopping branch returns the same pair; a continuing branch uses recursive pair equality and the same count increment.

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 successful_query_unique {E : Type*} [NormedAddCommGroup E]
    [NormedSpace ℝ E] (g : E → E) (eta eps : ℝ) (y : E)
    {n m : ℕ} {x : E} {r s : E × ℕ}
    (hr : ApproximateProximalExecution.proximalQuery g eta eps y n x = some r)
    (hs : ApproximateProximalExecution.proximalQuery g eta eps y m x = some s) : r = s := by
  classical
  induction n generalizing m x r s with
  | zero => simp [ApproximateProximalExecution.proximalQuery] at hr
  | succ n ih =>
    cases m with
    | zero => simp [ApproximateProximalExecution.proximalQuery] at hs
    | succ m =>
      rw [ApproximateProximalExecution.proximalQuery] at hr hs
      split_ifs at hr hs with hstop
      · exact Option.some.inj (hr.symm.trans hs)
      · obtain ⟨r', hr', hrr⟩ := Option.map_eq_some_iff.mp hr
        obtain ⟨s', hs', hss⟩ := Option.map_eq_some_iff.mp hs
        have heq := ih hr' hs'
        simpa [← hrr, ← hss] using congrArg (fun z : E × ℕ => (z.1, z.2 + 1)) heq

end AutoSamplingTheory.ExampleCases.SmoothedPicardHMC.ProximalExecutionIdentity

Exact module and namespace context

Source assumptions versus formal assumptions

SourceActual LeanDifference kindWhy it matters
Euclidean source algorithm and its normalized C2 potential.E is a real normed vector space; g:E->E, eta,eps,y and initial state x are arbitrary. Two supplied finite fuels n,m yield successful returned pairs r,s under the same deterministic interpreter. No positivity, contractivity or termination hypothesis.generalizationThe scope and typeclasses are explicit; no full source theorem is asserted.
D.4 uses run-wide D.7 before Jensen and phase/run query aggregation.Conditional deterministic identity for successful runs only. No existence of a successful run, proximal accuracy, count bound, Gaussian law or main theorem. Reusable interface extracted for the same-witness full-phase consumer; no independent paper-progress credit for extraction.source-implicitThis isolates the actual implementation component and states all remaining boundaries.

Conditional deterministic identity for successful runs only. No existence of a successful run, proximal accuracy, count bound, Gaussian law or main theorem. Reusable interface extracted for the same-witness full-phase consumer; no independent paper-progress credit for extraction.

Encoder–denoiser: source-reviewed · equivalent-after-elaboration

Detected semantic differences

  • scopes: The formal result is an explicitly scoped deterministic implementation identity, generalized to arbitrary normed real E and arbitrary g/parameters. It does not separately reproduce a named source theorem or receive additional paper-progress credit. — The proof uses only exact successful-run equations; current lesson scope retains all termination, accuracy, Gaussian and cost obligations separately.

A generalization is not a source correction. Proposed missing conditions require separate independent repair review. No proposed repair silently changes the original theorem.

Scope and omitted-condition boundaries
  • Conditional deterministic identity for successful runs only. No existence of a successful run, proximal accuracy, count bound, Gaussian law or main theorem. Reusable interface extracted for the same-witness full-phase consumer; no independent paper-progress credit for extraction.
Sources, dependencies, and reuse

Source and reuse

Samplinglib parents called

    Mathlib API called (external library)

    • Option.map_eq_some_iff

    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.

    Which proof obligations and prerequisites are covered?

    • Formalized proof edge; source adapter/review separate Successful stopped executions have one output and count
    • TODO — not closed by these contributions Run-wide moment, executable aggregation and source parameter complexity (remaining)