Phases of Muoncompanion
Section SJ · SignSGD: drift and volatility
Proved in Lean
Proposition SJ.5 (One sample)
Let \(B=1\), \(\Nout\ge2\), \(\Sigmaout=U\Lambda U^\T\) with \(U\) Haar, \(\Lambda=\diag(\mu_i)\succ0\), \(\Sigmain=\Idin\) and \(u_i\defeq Ue_i\), and let the sample be \(\Xout=U\Lambda^{1/2}z\), \(\Xin=w\) with \((z,w)\) standard Gaussian and independent of \(U\). Let \(\Delta\) be any function of \(U\) with \(\Delta\ne0\) almost surely, and \(S=\sign(G^\circ)\). Then
\[ \EE\norm{S^\T u_i}^2=\Nin\,\EE\big[u_i^\T\Sigmaoutsign u_i\big]=\Nin\Big(1-\frac2\pi+\frac{2\Nout}\pi\,\EE\frac{\mu_ig_i^2}{\sum_l\mu_lg_l^2}\Big), \]
where \((\Sigmaoutsign)_{kl}\defeq\frac2\pi\arcsin\big((\Sigmaout)_{kl}/\sqrt{(\Sigmaout)_{kk}(\Sigmaout)_{ll}}\big)\) and \(g\) is a standard Gaussian vector in \(\R^{\Nout}\).
Proof.
For one sample the update factorizes. Given \(U\), the vector \(y=\Xout\) has the nondegenerate law \(\mathcal N(0,\Sigmaout)\), so its coordinates are nonzero almost surely, and so are those of \(x=\Xin\). The residual \(y^\T\Delta x\) is, given \(U\) and \(x\), Gaussian with variance \(\norm{\Sigmaout^{1/2}\Delta x}^2\), which is positive almost surely because \(\Delta\ne0\). Hence, entrywise,
\[ S=\sign\big(y^\T\Delta x\big)\,\sign(y)\tensor\sign(x), \]
and therefore
\[ \norm{S^\T u_i}^2=\big(u_i^\T\sign(y)\big)^2\norm{\sign(x)}^2=\Nin\big(u_i^\T\sign(y)\big)^2 . \]
The residual sign has disappeared, so the state no longer enters.
Given \(U\), Lemma SJ.1 applies to every pair of coordinates of \(y\), whose variances \((\Sigmaout)_{kk}\) are positive, and gives \(\EE[\sign(y)\tensor\sign(y)\mid U]=\Sigmaoutsign\). This is the first equality.
For the second, write \(y=Ua\) with \(a=\Lambda^{1/2}g\), nonzero almost surely and independent of \(U\). Then \(u_i^\T\sign(y)=e_i^\T U^\T\sign(Ua)\), and Lemma SJ.7 gives
\[ \EE\big[(u_i^\T\sign(y))^2\,\big|\,g\big]=1-\frac2\pi+\frac{2\Nout}\pi\,\frac{\mu_ig_i^2}{\sum_l\mu_lg_l^2}.\qedhere \]

Uses

Lean

Proved in Lean
Muon.SignSGD.prop_app_sgd_one_sample source
theorem prop_app_sgd_one_sample {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω)
    [IsProbabilityMeasure P] (n m : ℕ) (hn : 2 ≤ n)
    (ν : Measure (Matrix.orthogonalGroup (Fin n) ℝ)) (hν : IsOrthHaar ν)
    (U : Ω → Matrix.orthogonalGroup (Fin n) ℝ) (hU : Measurable U) (hUlaw : P.map U = ν)
    (Z : Ω → Fin n → ℝ) (W : Ω → Fin m → ℝ)
    (hZW : P.map (fun ω => (Z ω, W ω)) = (stdGaussianPi n).prod (stdGaussianPi m))
    (hind : IndepFun U (fun ω => (Z ω, W ω)) P)
    (μ : Fin n → ℝ) (hμ : ∀ k, 0 < μ k)
    (Δfun : Matrix.orthogonalGroup (Fin n) ℝ → Matrix (Fin n) (Fin m) ℝ) (hΔ : Measurable Δfun)
    (hΔ0 : ∀ᵐ ω ∂P, Δfun (U ω) ≠ 0) (i : Fin n) :
    (∫ ω, ∑ j, (∑ k, oneSampleSign (Δfun (U ω)) (oneSampleBatch μ (U ω) (Z ω) (W ω)) k j
          * (U ω : Matrix (Fin n) (Fin n) ℝ) k i) ^ 2 ∂P
        = (m : ℝ) * ∫ ω, ∑ k, ∑ l, (U ω : Matrix (Fin n) (Fin n) ℝ) k i
            * sigmaSignMat (haarSigmaOut (U ω) μ) k l * (U ω : Matrix (Fin n) (Fin n) ℝ) l i ∂P) ∧
    (∫ ω, ∑ k, ∑ l, (U ω : Matrix (Fin n) (Fin n) ℝ) k i
            * sigmaSignMat (haarSigmaOut (U ω) μ) k l * (U ω : Matrix (Fin n) (Fin n) ℝ) l i ∂P
        = 1 - 2 / Real.pi + 2 * (n : ℝ) / Real.pi *
            ∫ g, μ i * g i ^ 2 / ∑ l, μ l * g l ^ 2 ∂(stdGaussianPi n)) := by