Phases of Muoncompanion
Section SJ · SignSGD: drift and volatility
Proved in Lean
Lemma SJ.6 (Spherical moments)
Let \(v\) be uniform on the unit sphere of \(\R^n\), \(n\ge2\). Then
\begin{equation}\tag{SJ.21} \EE\norm v_1^2=1+\frac{2(n-1)}\pi . \end{equation}
For a vector \(a\), a positive semidefinite \(T\) and an integer \(1\le q\le4\),
\begin{equation}\tag{SJ.22} \EE\abs{v^\T a}^{2q}=\frac{(2q-1)!!\,\norm a^{2q}}{d_q(n)},\qquad \EE\big(v^\T Tv\big)^q\le\frac{(2q-1)!!\,(\Tr T)^q}{d_q(n)}. \end{equation}
For symmetric \(H\) with \(\Tr H=0\),
\begin{equation}\tag{SJ.23} \EE\big(v^\T Hv\big)^4=\frac{12(\Tr H^2)^2+48\Tr H^4}{d_4(n)} . \end{equation}
In particular, if \(c\Id\preceq\Lambda\preceq L\Id\) in dimension \(n\) and \(\bar\mu=\Tr\Lambda/n\), then \(\EE(v^\T\Lambda v-\bar\mu)^4\le60L^4/n^2\).
Proof.
A standard Gaussian vector \(g\) in \(\R^n\) is \(g=Rv\) with radius \(R\) and direction \(v\) independent, and \(\EE R^{2q}=d_q(n)\) by the Gaussian moments of \(\norm g^2\). Every identity follows by computing a Gaussian moment and dividing by \(\EE R^{2q}\).
For (SJ.21), \(\EE R^2=n\), and \(\EE\abs{g_ig_j}=2/\pi\) for \(i\ne j\) gives \(\EE\abs{v_iv_j}=2/(\pi n)\). Expanding the square of the \(\ell^1\) norm,
\[ \EE\norm v_1^2=\sum_i\EE v_i^2+\sum_{i\ne j}\EE\abs{v_iv_j}=1+n(n-1)\frac2{\pi n}. \]
For (SJ.22), rotation invariance gives \(\EE\abs{g^\T a}^{2q}=(2q-1)!!\norm a^{2q}\). For \(T\), write \(g^\T Tg=\Tr T\sum_l\pi_lg_l^2\) with weights \(\pi_l\ge0\) summing to \(1\); Jensen’s inequality gives \(\EE(\sum_l\pi_lg_l^2)^q\le(2q-1)!!\).
For (SJ.23), diagonalize \(H\) with eigenvalues \(h_l\) of sum zero. Then \(g^\T Hg=\sum_lh_l(g_l^2-1)\) is a sum of independent centered terms with \(\EE(g_l^2-1)^2=2\) and \(\EE(g_l^2-1)^4=60\). Only multiplicities four and two-two survive in the fourth power:
\[ \EE(g^\T Hg)^4=60\sum_lh_l^4+24\sum_{l<l'}h_l^2h_{l'}^2=12(\Tr H^2)^2+48\Tr H^4 . \]
For \(H=\Lambda-\bar\mu\Id\), \(\norm H\le L\), so \(\Tr H^2\le nL^2\) and \(\Tr H^4\le nL^4\), and \(d_4(n)\ge n^4\) gives the last bound.

Used by

Lean

Proved in Lean
Muon.SignSGD.lem_app_sgd_sphere_i source
theorem lem_app_sgd_sphere_i (n : ℕ) (hn : 2 ≤ n) :
    ∫ v, (∑ i, |v i|) ^ 2 ∂(sphereGauss n) = 1 + 2 * ((n : ℝ) - 1) / Real.pi := by
Muon.SignSGD.lem_app_sgd_sphere_ii source
theorem lem_app_sgd_sphere_ii (n q : ℕ) (hn : 2 ≤ n) (hq : 1 ≤ q ∧ q ≤ 4)
    (a : Fin n → ℝ) :
    ∫ v, |dotProduct v a| ^ (2 * q) ∂(sphereGauss n)
      = ((Nat.doubleFactorial (2 * q - 1) : ℕ) : ℝ) * euclidNorm n a ^ (2 * q) / dq n q := by
Muon.SignSGD.lem_app_sgd_sphere_iii source
theorem lem_app_sgd_sphere_iii (n q : ℕ) (hn : 2 ≤ n) (hq : 1 ≤ q ∧ q ≤ 4)
    (T : Matrix (Fin n) (Fin n) ℝ) (hT : T.PosSemidef) :
    ∫ v, (dotProduct v (T.mulVec v)) ^ q ∂(sphereGauss n)
      ≤ ((Nat.doubleFactorial (2 * q - 1) : ℕ) : ℝ) * (Matrix.trace T) ^ q / dq n q := by
Muon.SignSGD.lem_app_sgd_sphere_iv source
theorem lem_app_sgd_sphere_iv (n : ℕ) (hn : 2 ≤ n) (H : Matrix (Fin n) (Fin n) ℝ)
    (hH : H.IsHermitian) (htr : Matrix.trace H = 0) :
    ∫ v, (dotProduct v (H.mulVec v)) ^ 4 ∂(sphereGauss n)
      = (12 * (Matrix.trace (H ^ 2)) ^ 2 + 48 * Matrix.trace (H ^ 4)) / dq n 4 := by
Muon.SignSGD.lem_app_sgd_sphere_v source
theorem lem_app_sgd_sphere_v (n : ℕ) (hn : 2 ≤ n) (c L : ℝ) (hc : 0 ≤ c)
    (Λ : Matrix (Fin n) (Fin n) ℝ)
    (hlo : (Λ - c • (1 : Matrix (Fin n) (Fin n) ℝ)).PosSemidef)
    (hhi : (L • (1 : Matrix (Fin n) (Fin n) ℝ) - Λ).PosSemidef) :
    ∫ v, (dotProduct v (Λ.mulVec v) - Matrix.trace Λ / (n : ℝ)) ^ 4 ∂(sphereGauss n)
      ≤ 60 * L ^ 4 / (n : ℝ) ^ 2 := by