Documentation

CslibFrontier.Computability.LogSpaceDerandomization.TrueSampleMeans

True means of sampled atom products #

The direct and correction--dense sample terms of [OpenAI2026LogSpace, Lemma 7.1] use a broad terminal conditioning slice and a possibly narrower usage slice. Their exact retention-density ratio changes the conditioning. In a product, a second ratio cancels the sampling of the intermediate vertex.

These results use the concrete Matrix.denseAtom and Matrix.correctionAtom definitions. The true dense atom is a function of the terminal seed alone, while the correction atom uses the source and intermediate seeds. Thus the required factorization follows from finite product averages. No independence of estimated factors, estimator correctness, or machine certificate is assumed.

The formulas are the raw direct and product terms before division by the parent first-channel scale. Copy projections, detector and reward assembly, and the conditional-walk schedule remain separate parts of the estimator construction.

Main results #

References #

theorem Finset.expect_mul_dens_div_of_subset {Ω : Type u_1} [Fintype Ω] {S T : Finset Ω} (hTS : T ⊆ S) (hT : T.Nonempty) (v : Ω → ℝ) (hv : ∀ σ ∈ S, σ ∉ T → v σ = 0) :
(S.expect fun (σ : Ω) => ↑S.dens / ↑T.dens * v σ) = T.expect fun (σ : Ω) => v σ

A function supported on T ⊆ S has the same mean after restricting to T and multiplying its mean on S by the exact ratio of the two uniform densities.

theorem Finset.expect_eq_dens_mul_expect_of_eq_zero {Ω : Type u_1} [Fintype Ω] (S : Finset Ω) (v : Ω → ℝ) (hv : ∀ σ ∉ S, v σ = 0) :
(univ.expect fun (σ : Ω) => v σ) = ↑S.dens * S.expect fun (σ : Ω) => v σ

Averaging a supported function over the full seed space multiplies its conditional mean by the exact retention density.

theorem Matrix.expect_denseAtom_change_usage {V : Type u_1} {κ : Type u_2} [Fintype V] [Fintype κ] {Y Ya Yt : κ → V → Prop} [(t : κ) → (v : V) → Decidable (Y t v)] [(t : κ) → (v : V) → Decidable (Ya t v)] [(t : κ) → (v : V) → Decidable (Yt t v)] {k h ρ : ℝ → ℝ} {K : ℕ} {b : ℝ} {G : Matrix V V ℝ} {x y : V} (hYt : ∀ (t : κ), Yt t y → Ya t y) (hS : {t : κ | Yt t y}.Nonempty) (hkh : ∀ (d : ℝ), k d ≠ 0 → h d = 1) (hρ0 : ∀ (r : ℝ), 0 ≤ ρ r) (hρ1 : ∀ (r : ℝ), ρ r ≤ 1) {η : ℝ} (hη : 0 < η) (hρη : ∀ r ≤ η, ρ r = 1) (hb : 0 < b) (hG0 : ∀ (w : V), 0 ≤ G x w) {M : ℝ} (hGM : ∑ w : V, G x w ≤ M) {c : ℝ} (hc : 0 ≤ c) (hK : 2 * (1 + c * M / η) ≤ ↑K) (hpair : ∀ (w : V), w ≠ y → ↑{t : κ | Yt t y ∧ Y t w}.card ≤ c * b * ↑{t : κ | Yt t y}.card) :
({t : κ | Ya t y}.expect fun (t : κ) => b * (↑{t : κ | Ya t y}.dens / ↑{t : κ | Yt t y}.dens) * denseAtom Y Yt k h ρ K b G t x y) = b * k (G x y / b)

The actual dense atom, averaged on a broader terminal slice, has the correct mean after the exact density-ratio importance correction [OpenAI2026LogSpace, Lemma 7.1]. The sufficient gate hypotheses are those of Matrix.expect_denseAtom.

theorem Matrix.expect_correctionAtom_unconditioned {V : Type u_1} {κ : Type u_2} [Fintype V] [Fintype κ] {ι : Type u_3} [Fintype ι] {I : ℝ → ℝ → ℝ} {τ Q h ρ : ℝ → ℝ} {K Kc : ℕ} {f : ℝ} {G : Matrix V V ℝ} {g₀ : V → ℝ} {X : ι → V → Prop} {Z Zt : κ → V → Prop} [(s : ι) → (v : V) → Decidable (X s v)] [(t : κ) → (v : V) → Decidable (Z t v)] [(t : κ) → (v : V) → Decidable (Zt t v)] {x z : V} (hSx : {s : ι | X s x}.Nonempty) (hSz : {t : κ | Zt t z}.Nonempty) (hQh : ∀ (v : ℝ), Q v ≠ 0 → h v = 1) (hρ0 : ∀ (r : ℝ), 0 ≤ ρ r) (hρ1 : ∀ (r : ℝ), ρ r ≤ 1) {η : ℝ} (hη : 0 < η) (hρη : ∀ r ≤ η, ρ r = 1) (hτ0 : ∀ (r : ℝ), 0 ≤ τ r) (hτ1 : ∀ (r : ℝ), τ r ≤ 1) {τ₀ : ℝ} (hτ₀ : 0 ≤ τ₀) (hττ : ∀ r ≤ τ₀, τ r = 1) {e : ℝ} (hI : ∀ (v r : ℝ), v ≤ e → I v r = 0) (hf : 0 < f) (hG0 : ∀ (w : V), 0 ≤ G x w) {M : ℝ} (hGM : ∑ w : V, G x w ≤ M) {c : ℝ} (hc : 0 ≤ c) (hK : 4 * (1 + c * M / η) ≤ ↑K) (hpairZ : ∀ (w : V), w ≠ z → ↑{t : κ | Zt t z ∧ Z t w}.card ≤ c * f * ↑{t : κ | Zt t z}.card) {p : ℝ} (hp : 0 ≤ p) (hpairX : ∀ (w : V), w ≠ x → ↑{s : ι | X s x ∧ X s w}.card ≤ p * ↑{s : ι | X s x}.card) {B : ℝ} (hB : g₀ z ≠ 0 → p * ↑{w : V | e < G w z / f}.card ≤ B) (hKc : 4 * (1 + B) ≤ ↑Kc) :
(({s : ι | X s x} ×ˢ Finset.univ).expect fun (d : ι × κ) => correctionAtom I τ K Kc f G X Z Zt Q h ρ g₀ d x z) = ↑{t : κ | Zt t z}.dens * (Q (G x z / f) * g₀ z)

The intermediate seed may be left unconditioned: the actual correction atom then has mean π_f * Q (G x z / f) * g₀ z, where π_f is the exact density of its usage slice. Its built-in mask supplies the support condition.

theorem Matrix.expect_correctionAtom_mul_denseAtom {V : Type u_1} {κ : Type u_2} [Fintype V] [Fintype κ] {ι : Type u_3} [Fintype ι] {υ : Type u_4} [Fintype υ] {I : ℝ → ℝ → ℝ} {τ Q hF ρF k hB ρB : ℝ → ℝ} {KF Kc KB : ℕ} {f b πf : ℝ} {G H : Matrix V V ℝ} {g₀ : V → ℝ} {X : ι → V → Prop} {Z Zt : κ → V → Prop} {Y Ya Yt : υ → V → Prop} [(s : ι) → (v : V) → Decidable (X s v)] [(t : κ) → (v : V) → Decidable (Z t v)] [(t : κ) → (v : V) → Decidable (Zt t v)] [(t : υ) → (v : V) → Decidable (Y t v)] [(t : υ) → (v : V) → Decidable (Ya t v)] [(t : υ) → (v : V) → Decidable (Yt t v)] {x y : V} (hSx : {s : ι | X s x}.Nonempty) (hZπ : ∀ (z : V), ↑{t : κ | Zt t z}.dens = πf) (hπf : 0 < πf) (hYt : ∀ (t : υ), Yt t y → Ya t y) (hSy : {t : υ | Yt t y}.Nonempty) (hQh : ∀ (v : ℝ), Q v ≠ 0 → hF v = 1) (hρF0 : ∀ (r : ℝ), 0 ≤ ρF r) (hρF1 : ∀ (r : ℝ), ρF r ≤ 1) {ηF : ℝ} (hηF : 0 < ηF) (hρFη : ∀ r ≤ ηF, ρF r = 1) (hτ0 : ∀ (r : ℝ), 0 ≤ τ r) (hτ1 : ∀ (r : ℝ), τ r ≤ 1) {τ₀ : ℝ} (hτ₀ : 0 ≤ τ₀) (hττ : ∀ r ≤ τ₀, τ r = 1) {e : ℝ} (hI : ∀ (v r : ℝ), v ≤ e → I v r = 0) (hf : 0 < f) (hG0 : ∀ (w : V), 0 ≤ G x w) {MF : ℝ} (hGM : ∑ w : V, G x w ≤ MF) {cF : ℝ} (hcF : 0 ≤ cF) (hKF : 4 * (1 + cF * MF / ηF) ≤ ↑KF) (hpairZ : ∀ (z w : V), w ≠ z → ↑{t : κ | Zt t z ∧ Z t w}.card ≤ cF * f * ↑{t : κ | Zt t z}.card) {p : ℝ} (hp : 0 ≤ p) (hpairX : ∀ (w : V), w ≠ x → ↑{s : ι | X s x ∧ X s w}.card ≤ p * ↑{s : ι | X s x}.card) {R : ℝ} (hR : ∀ (z : V), g₀ z ≠ 0 → p * ↑{w : V | e < G w z / f}.card ≤ R) (hKc : 4 * (1 + R) ≤ ↑Kc) (hkh : ∀ (v : ℝ), k v ≠ 0 → hB v = 1) (hρB0 : ∀ (r : ℝ), 0 ≤ ρB r) (hρB1 : ∀ (r : ℝ), ρB r ≤ 1) {ηB : ℝ} (hηB : 0 < ηB) (hρBη : ∀ r ≤ ηB, ρB r = 1) (hb : 0 < b) (hH0 : ∀ (z w : V), 0 ≤ H z w) {MB : ℝ} (hHM : ∀ (z : V), ∑ w : V, H z w ≤ MB) {cB : ℝ} (hcB : 0 ≤ cB) (hKB : 2 * (1 + cB * MB / ηB) ≤ ↑KB) (hpairY : ∀ (w : V), w ≠ y → ↑{t : υ | Yt t y ∧ Y t w}.card ≤ cB * b * ↑{t : υ | Yt t y}.card) :
((({s : ι | X s x} ×ˢ Finset.univ) ×ˢ {t : υ | Ya t y}).expect fun (d : (ι × κ) × υ) => b * (↑{t : υ | Ya t y}.dens / ↑{t : υ | Yt t y}.dens) * (f / πf) * ∑ z : V, correctionAtom I τ KF Kc f G X Z Zt Q hF ρF g₀ d.1 x z * denseAtom Y Yt k hB ρB KB b H d.2 z y) = ∑ z : V, f * Q (G x z / f) * g₀ z * (b * k (H z y / b))

The true correction--dense product mean [OpenAI2026LogSpace, Lemma 7.1]. Average the actual sample over the source slice, all intermediate seeds, and the broad terminal slice. The terminal density ratio changes to the usage slice; f / πf cancels intermediate sampling. The result is the product of the two deterministic entries in their original matrix units.

The uniform intermediate hit probability is stated as the actual density equality hZπ. All atom normalizations follow from their gate and pair-count hypotheses; none are postulated as mean identities. The true right atom only uses the third seed coordinate.