Phases of Muoncompanion
Section SJ · SignSGD: drift and volatility
Proved in Lean
Proposition SJ.2 (Isotropic volatility)
Let \(\Sigmain=\Idin\) and \(\Sigmaout=\Idout\) in Assumption S1, let \(\Delta\in\R^{\Nout\times\Nin}\) be deterministic, and let \(S=\sign(G^\circ)\) for a batch of size \(B\ge1\). Then
\begin{equation}\tag{SJ.8} \EE\norm S_\Sigma^2=\EE\norm S_\F^2=\begin{cases}\Nin\Nout,&\Delta\ne0,\\ 0,&\Delta=0.\end{cases} \end{equation}
In particular the step (SJ.1) satisfies
\begin{equation}\tag{SJ.9} \EE\,\cR(\Delta^+)=\cR(\Delta)-\lr\,\langle\Delta,\EE S\rangle_\F+\frac{\lr^2}2\,\Nin\Nout\,\mathbf 1_{\{\Delta\ne0\}} . \end{equation}
Proof.
With identity covariances, \(\norm S_\Sigma^2=\Tr(SS^\T)=\norm S_\F^2\) by (SA.2), so the first equality holds pointwise.
If \(\Delta=0\) then \(G^\circ=0\) and \(S=0\).
If \(\Delta\ne0\), every entry of \(G^\circ\) is nonzero almost surely. Indeed \(BG^\circ_{ij}\) is a polynomial in the batch coordinates. Setting all samples but the first to zero leaves the polynomial
\[ (z_1)_i\,(w_1)_j\,\big(z_1^\T\Delta w_1\big), \]
a product of three polynomials that are not identically zero, the last one because some \(\Delta_{kl}\ne0\). A product of polynomials that are not identically zero is not identically zero. The batch has a Gaussian density, so the zero set of this polynomial has probability zero [91]. A finite union over the entries shows that \(\norm S_\F^2=\Nin\Nout\) almost surely.
The risk identity is (SJ.2) at a deterministic state, with \(\langle\Delta,\EE S\rangle_\Sigma=\langle\Delta,\EE S\rangle_\F\) for identity covariances.

Uses

Used by

Lean

Proved in Lean
Muon.SignSGD.prop_app_sgd_iso_volatility_i source
theorem prop_app_sgd_iso_volatility_i {Nout Nin B : ℕ} {Ω : Type*} [MeasurableSpace Ω]
    (P : Measure Ω) [IsProbabilityMeasure P] (hB : 1 ≤ B)
    (C : Covariances Nout Nin) (hSout : C.Sout = 1) (hSin : C.Sin = 1)
    (ν : Measure (Vec Nout × Vec Nin)) (hν : Muon.Setup.assum_data_target C ν)
    (β : Ω → Batch Nout Nin B)
    (hβ : Muon.Setup.IIDBatch P ν (fun a ω => ((β ω).xout a, (β ω).xin a)))
    (Δ : Matrix (Fin Nout) (Fin Nin) ℝ) :
    ∫ ω, Muon.Setup.pairSigma C (signGrad Δ (β ω)) (signGrad Δ (β ω)) ∂P
        = ∫ ω, frobNorm (signGrad Δ (β ω)) ^ 2 ∂P ∧
      (Δ = 0 → ∫ ω, Muon.Setup.pairSigma C (signGrad Δ (β ω)) (signGrad Δ (β ω)) ∂P = 0) ∧
      (Δ ≠ 0 → ∫ ω, Muon.Setup.pairSigma C (signGrad Δ (β ω)) (signGrad Δ (β ω)) ∂P
        = (Nin : ℝ) * (Nout : ℝ)) := by
Muon.SignSGD.prop_app_sgd_iso_volatility_ii source
theorem prop_app_sgd_iso_volatility_ii {Nout Nin B : ℕ} {Ω : Type*} [MeasurableSpace Ω]
    (P : Measure Ω) [IsProbabilityMeasure P] (hB : 1 ≤ B)
    (C : Covariances Nout Nin) (hSout : C.Sout = 1) (hSin : C.Sin = 1)
    (ν : Measure (Vec Nout × Vec Nin)) (hν : Muon.Setup.assum_data_target C ν)
    (β : Ω → Batch Nout Nin B)
    (hβ : Muon.Setup.IIDBatch P ν (fun a ω => ((β ω).xout a, (β ω).xin a)))
    (Δ : Matrix (Fin Nout) (Fin Nin) ℝ) (η : ℝ) (hη : 0 ≤ η) :
    ∫ ω, Muon.Setup.riskSigma C (def_app_sgd_update η Δ (β ω)) ∂P
      = Muon.Setup.riskSigma C Δ
        - η * ∑ i, ∑ j, Δ i j * batchMean P (fun ω => signGrad Δ (β ω)) i j
        + η ^ 2 / 2 * (if Δ = 0 then 0 else (Nin : ℝ) * (Nout : ℝ)) := by