Theorem (integral_frobNorm_mul_smul_mul_conjTranspose_self_mul_sub_sq_of_hasLaw_gaussianMatrix). Gaussian approximate matrix multiplication, exact error. For a nonempty sketch, \mathbb{E}\|\mathbf{A}(\mathbf{G}\mathbf{G}^{\mathsf{H}}/\lvert k\rvert) \mathbf{B}-\mathbf{A}\mathbf{B}\|_{\mathsf{F}}^2 =\frac{\|\mathbf{A}\|_{\mathsf{F}}^2\|\mathbf{B}\|_{\mathsf{F}}^2 +\|\mathbf{A}\mathbf{B}\|_{\mathsf{F}}^2}{\lvert k\rvert}\,. [Isserlis1918, fourth-order formula]; the normalized centered Gram contraction.
Headline General form: sizes are index types
Lean statement and details
NLAlib.integral_frobNorm_mul_smul_mul_conjTranspose_self_mul_sub_sq_of_hasLaw_gaussianMatrix.{u_1,
u_2, u_3, u_5, u_6}
{Ω : Type u_1} {mΩ : MeasurableSpace Ω} {μ : Measure Ω} {a : Type u_2} {b : Type u_3}
{n : Type u_5} {k : Type u_6} [Fintype a] [Fintype b] [Fintype n] [Fintype k] [Nonempty k]
{G : Ω → Matrix n k ℝ} (hG : HasLaw G (gaussianMatrix n k) μ) (A : Matrix a n ℝ)
(B : Matrix n b ℝ) :
∫ (ω : Ω), frobNorm (A * (↑(Fintype.card k))⁻¹ • (G ω * (G ω)ᴴ) * B - A * B) ^ 2 ∂μ =
(frobNorm A ^ 2 * frobNorm B ^ 2 + frobNorm (A * B) ^ 2) / ↑(Fintype.card k)