Documentation

CslibFrontier.Computability.LogSpaceDerandomization.ConditionalProductMean

Conditional product means #

The conditioning event for a source x and endpoint y is the actual finite slice {σ | X σ x ∧ Y σ y}. Its mean is Cslib.conditionalTableMean. The homogeneous loss contracts through this finite expectation; multiplication by the slice's actual density cancels the conditioning denominator before the source and endpoint sums are taken. Empty slices have mean zero and need no nonemptiness hypothesis.

The resulting root-metric comparison consumes the concrete coupled product estimate of CslibFrontier.Computability.LogSpaceDerandomization.ProductError. For a coarse bin b ≥ a, the common coefficient is (b / a) * (f / πf): homogeneity contributes one factor b / a, and source release contributes exactly f / u to the right error. The conservative comparison constant is (2 ^ (s - 1) * s ^ s) * (2 ^ (2 * (s - 1)) * s ^ s).

The product-seed slice identity connects this finite operator to the actual true-atom expectation in Matrix.expect_correctionAtom_mul_denseAtom. No estimator mean or error contract is assumed. Fine-bin conditioning changes, domination of true signed contributions, and the recursive estimator remain separate.

Main results #

References #

theorem Cslib.homogeneousLoss_expect_le {Ω : Type u_1} (S : Finset Ω) {s : ℕ} (hs : s ≠ 0) {H H' : Ω → ℝ} (hH : ∀ σ ∈ S, 0 ≤ H σ) (hH' : ∀ σ ∈ S, 0 ≤ H' σ) :
homogeneousLoss s (S.expect fun (σ : Ω) => H σ) (S.expect fun (σ : Ω) => H' σ) ≤ S.expect fun (σ : Ω) => homogeneousLoss s (H σ) (H' σ)

The homogeneous loss contracts through an actual finite mean, including the empty mean.

theorem Cslib.dens_mul_homogeneousLoss_expect_le {Ω : Type u_1} [Fintype Ω] [DecidableEq Ω] (S : Finset Ω) {s : ℕ} (hs : s ≠ 0) {H H' : Ω → ℝ} (hH : ∀ σ ∈ S, 0 ≤ H σ) (hH' : ∀ σ ∈ S, 0 ≤ H' σ) :
↑S.dens * homogeneousLoss s (S.expect fun (σ : Ω) => H σ) (S.expect fun (σ : Ω) => H' σ) ≤ Finset.univ.expect fun (σ : Ω) => if σ ∈ S then homogeneousLoss s (H σ) (H' σ) else 0

Multiplying by the actual conditioning density cancels the conditional denominator. All quantities may depend on the same draw, and the slice may be empty.

noncomputable def Cslib.conditionalTableMean {Ω : Type u_1} {V : Type u_2} [Fintype Ω] (X Y : Ω → V → Prop) [(σ : Ω) → (x : V) → Decidable (X σ x)] [(σ : Ω) → (y : V) → Decidable (Y σ y)] (H : Ω → V → V → ℝ) (x y : V) :

The actual finite conditional mean on the source/endpoint slice. It is zero when that slice is empty. The output is a deterministic table, indexed by the source and endpoint.

theorem Cslib.conditionalTableMean_eq_expect_product {V : Type u_2} {ι : Type u_3} {κ : Type u_4} {υ : Type u_5} [Fintype ι] [Fintype κ] [Fintype υ] (X : ι → V → Prop) (Y : υ → V → Prop) [(t : ι) → (x : V) → Decidable (X t x)] [(t : υ) → (y : V) → Decidable (Y t y)] (H : (ι × κ) × υ → V → V → ℝ) (x y : V) :
conditionalTableMean (fun (d : (ι × κ) × υ) (v : V) => X d.1.1 v) (fun (d : (ι × κ) × υ) (v : V) => Y d.2 v) H x y = (({t : ι | X t x} ×ˢ Finset.univ) ×ˢ {t : υ | Y t y}).expect fun (d : (ι × κ) × υ) => H d x y

With separate source, intermediate and terminal seed coordinates, the actual slice is exactly the product slice used by Matrix.expect_correctionAtom_mul_denseAtom.

theorem Cslib.expect_mask_const {Ω : Type u_1} [Fintype Ω] [DecidableEq Ω] (S : Finset Ω) (c : ℝ) :
(Finset.univ.expect fun (σ : Ω) => if σ ∈ S then c else 0) = ↑S.dens * c

A constant restricted to a finite event has expectation equal to its actual density times that constant, including empty events and empty ambient types.

theorem Cslib.rootDistPow_conditionalTableMean_mul_le {Ω : Type u_1} {V : Type u_2} [Fintype Ω] [Fintype V] {s : ℕ} {N u : ℝ} {X Y : Ω → V → Prop} [(σ : Ω) → (x : V) → Decidable (X σ x)] [(σ : Ω) → (y : V) → Decidable (Y σ y)] (hs : s ≠ 0) (hN : 0 < N) (hu : 0 < u) {c : ℝ} (hc : 0 ≤ c) {H H' : Ω → V → V → ℝ} (hH : ∀ (σ : Ω) (x y : V), 0 ≤ H σ x y) (hH' : ∀ (σ : Ω) (x y : V), 0 ≤ H' σ x y) :
(rootDistPow s N u X Y (fun (x : Ω) (x_1 y : V) => c * conditionalTableMean X Y H x_1 y) fun (x : Ω) (x_1 y : V) => c * conditionalTableMean X Y H' x_1 y) ≤ 2 ^ (s - 1) * ↑s ^ s * c * rootDistPow s N u X Y H H'

Integrated conditional-mean comparison. Multiplication by the same nonnegative scalar costs one power of that scalar. The actual conditioning density cancels before summing over source and endpoint coordinates. Neither nonempty slices nor independence are required.

theorem Cslib.rootDistPow_coarseProductMean_le {Ω : Type u_1} {V : Type u_2} [Fintype Ω] [Fintype V] {s : ℕ} {N u : ℝ} {X Y : Ω → V → Prop} [(σ : Ω) → (x : V) → Decidable (X σ x)] [(σ : Ω) → (y : V) → Decidable (Y σ y)] {Z : Ω → V → Prop} [(σ : Ω) → (z : V) → Decidable (Z σ z)] {a b f πf : ℝ} (hs : s ≠ 0) (hN : 0 < N) (hu : 0 < u) (ha : 0 < a) (hab : a ≤ b) (hf : 0 < f) (hπf : 0 < πf) {F F' B B' : Ω → V → V → ℝ} (hF : ∀ (σ : Ω) (x z : V), 0 ≤ F σ x z) (hF' : ∀ (σ : Ω) (x z : V), 0 ≤ F' σ x z) (hB : ∀ (σ : Ω) (z y : V), 0 ≤ B σ z y) (hB' : ∀ (σ : Ω) (z y : V), 0 ≤ B' σ z y) {CF CB : ℝ} (hCF : 0 ≤ CF) (hCB : 0 ≤ CB) (hFbound : ∀ (σ : Ω) (x z : V), F' σ x z ≤ CF) (hBbound : ∀ (σ : Ω) (z y : V), B σ z y ≤ CB) {Kr Kc : ℕ} (hrow : ∀ (σ : Ω) (z : V), Z σ z → {y ∈ {y : V | Y σ y} | B σ z y ≠ 0}.card ≤ Kr) (hcol : ∀ (σ : Ω) (z : V), Z σ z → {x ∈ {x : V | X σ x} | F' σ x z ≠ 0}.card ≤ Kc) :
have P := fun (σ : Ω) (x y : V) => ∑ z : V with Z σ z, F σ x z * B σ z y; have P' := fun (σ : Ω) (x y : V) => ∑ z : V with Z σ z, F' σ x z * B' σ z y; (rootDistPow s N u X Y (fun (x : Ω) (x_1 y : V) => b / a * (f / πf) * conditionalTableMean X Y P x_1 y) fun (x : Ω) (x_1 y : V) => b / a * (f / πf) * conditionalTableMean X Y P' x_1 y) ≤ 2 ^ (s - 1) * ↑s ^ s * (2 ^ (2 * (s - 1)) * ↑s ^ s) * (b / a * (f / πf)) * (CB * ↑Kr * rootDistPow s N u X Z F F' + CF * ↑Kc * (f / u) * rootDistPow s N f Z Y B B')

Coarse-bin conditional product comparison. The sample is the actual finite product mean multiplied by (b / a) * (f / πf), as in (7.2) after division by a, with b ≥ a. The coefficient f / πf is left explicit; identifying πf with the intermediate channel's uniform hit density is part of Matrix.expect_correctionAtom_mul_denseAtom.

This estimate proves the single-power b / a cost and exact right-source factor f / u. It concerns root error; clipped relative error additionally needs domination by the true raw input, and the finer b < a bound requires changing terminal conditioning first.