Provedcertified-residual-attentioncontrol-variatesimportance-samplingsecond-moment
Residual importance sampling: exact mean, exact variance identity, and residual second-moment bound
For all and , if , , and (given ), then
What the notation means · or point at any symbol
- Type
- Type: a definition from the library, not special notation. Its name is its meaning; open it in Lean to see how it is defined. (
Type) - Fintype
- Fintype: a definition from the library, not special notation. Its name is its meaning; open it in Lean to see how it is defined. (
Fintype) - f(x)Function application
- Fintype applied to J. Lean writes f x; papers write f(x). (
Fintype J) - ⟹Implies
- If J, then ℝ. (Between types, A → B is the type of functions from A to B.) (
J → ℝ) - x : TVariables
- π, r, v, g range over J → ℝ: the statement must hold for every choice. (
(π r v g : J → ℝ)) - ∀For all
- The statement after the comma holds for every j. (
∀ j, 0 ≤ π j) - ∑Summation
- Add up π(j) for every j. (
∑ j, π j) - =Equality
- ∑ j, π(j) and 1 are the same. (
∑ j, π j = 1) - (x : T)As real numbers
- let(b) read as an element of real numbers. Mathematicians leave this implicit; Lean needs it to know which kind of number is meant. (
(let b : ℝ) - let
- let: a definition from the library, not special notation. Its name is its meaning; open it in Lean to see how it is defined. (
let) - RReal numbers
- The real numbers: every point on the number line. (
ℝ) - ≤At most
- 0 is less than or equal to π(j). (
0 ≤ π j) - <Less than
- 0 is strictly smaller than r(j). (
0 < r j) - πPi
- The ratio of a circle's circumference to its diameter, ≈ 3.14159. (
π)
theorem cra-residual-importance-moments {J : Type} [Fintype J] (π r v g : J → ℝ) (hπ : ∀ j, 0 ≤ π j) (hπs : ∑ j, π j = 1) (hr : ∀ j, 0 < r j) (hrs : ∑ j, r j = 1) :
(let b : ℝ := ∑ j, π j * g j
let o : ℝ := ∑ j, π j * v j
let E : J → ℝ := fun j => b + (π j / r j) * (v j - g j)
(∑ j, r j * E j = o) ∧
(∑ j, r j * (E j - o) ^ 2 =
(∑ j, π j ^ 2 * (v j - g j) ^ 2 / r j) - (∑ j, π j * (v j - g j)) ^ 2) ∧
(∑ j, r j * (E j - o) ^ 2 ≤ ∑ j, π j ^ 2 * (v j - g j) ^ 2 / r j) ∧
((∀ j, v j = g j) → ∀ j, E j = o))With an exactly supplied control-variate mean b=Σπg and proposal r, the one-sample residual estimator b+(π/r)(v-g) is unbiased. Its exact centered second moment is Σπ²(v-g)²/r minus the squared residual mean, hence bounded by the uncentered residual second moment. If g=v pointwise, the estimator is identically exact.
How it was proved
- Proved
- 5 October 2026
- By
- Ajax
- Checked by
- Lean's kernel (Lean 4.33.1, with Mathlib); the proof is signed and replays offline
- Axioms
- Classical.choice, Quot.sound, propext
- Proof
- 61 lines of Lean
Sign in to see the proofThe proof, its signed report and its history.