Phases of Muoncompanion
Section SJ · SignSGD: drift and volatility
Proved in Lean
Lemma SJ.11 (Haar reduction)
In the Haar model, put \(R_j\defeq h_j^\T\Lambda h_j/\norm{h_j}^2\). Then \(c\le R_j\le L\) almost surely, every entry of \(G^\circ\) is nonzero almost surely, \(\norm S_\F^2=\Nout\Nin\), and
\begin{equation}\tag{SJ.40} \mathcal Q=\Nin\Big(1-\frac2\pi\Big)\Tr\Lambda+\frac2\pi\,\Nout\sum_{j=1}^{\Nin}\EE R_j,\qquad \EE\norm{S^\T u_i}^2=\Nin\Big(1-\frac2\pi\Big)+\frac2\pi\,\Nout\sum_{j=1}^{\Nin}\EE\frac{(h_j)_i^2}{\norm{h_j}^2}. \end{equation}
Proof.
Condition on \(H\), which is independent of \(U\) and has nonzero columns almost surely by Lemma SJ.10. The \(j\)th column of \(U^\T S\) is \(U^\T\sign(Uh_j)\), and Lemma SJ.7 applies to it. Taking the trace against \(\Lambda\), and the \((i,i)\) entry, gives
\begin{gather*} \EE_U\big[\sign(Uh_j)^\T U\Lambda U^\T\sign(Uh_j)\big]=\Big(1-\frac2\pi\Big)\Tr\Lambda+\frac2\pi\Nout R_j,\\ \EE_U\big[(e_i^\T U^\T\sign(Uh_j))^2\big]=1-\frac2\pi+\frac2\pi\Nout\frac{(h_j)_i^2}{\norm{h_j}^2}. \end{gather*}
Summing over \(j\) and averaging over \(H\) gives (SJ.40); no independence between columns is needed. A Haar rotation of a fixed nonzero vector has no zero coordinate almost surely, so every entry of \(UH\) is nonzero and \(\norm S_\F^2=\Nout\Nin\).

Uses

Used by

Lean

Proved in Lean
Muon.SignSGD.lem_app_sgd_reduction_i source
theorem lem_app_sgd_reduction_i (P : HaarParams) {n m B : ℕ} (μ : Fin n → ℝ)
    (D : Matrix (Fin n) (Fin m) ℝ) (hP : def_app_sgd_state_law P n m B μ D) (j : Fin m) :
    ∀ᵐ β ∂(batchLaw n m B), P.c ≤ redR μ D β j ∧ redR μ D β j ≤ P.L := by
Muon.SignSGD.lem_app_sgd_reduction_ii source
theorem lem_app_sgd_reduction_ii (P : HaarParams) {n m B : ℕ} (μ : Fin n → ℝ)
    (D : Matrix (Fin n) (Fin m) ℝ) (ν : Measure (Matrix.orthogonalGroup (Fin n) ℝ))
    (hν : Muon.Foundations.IsOrthHaar ν) (hP : def_app_sgd_state_law P n m B μ D) :
    ∀ᵐ p ∂(ν.prod (batchLaw n m B)),
      ∀ i j, physGrad (haarDelta p.1 D) (haarBatch μ p.1 p.2) i j ≠ 0 := by
Muon.SignSGD.lem_app_sgd_reduction_iii source
theorem lem_app_sgd_reduction_iii (P : HaarParams) {n m B : ℕ} (μ : Fin n → ℝ)
    (D : Matrix (Fin n) (Fin m) ℝ) (ν : Measure (Matrix.orthogonalGroup (Fin n) ℝ))
    (hν : Muon.Foundations.IsOrthHaar ν) (hP : def_app_sgd_state_law P n m B μ D) :
    ∀ᵐ p ∂(ν.prod (batchLaw n m B)),
      ∑ i, ∑ j, haarSign μ D p.1 p.2 i j ^ 2 = (n : ℝ) * m := by
Muon.SignSGD.lem_app_sgd_reduction_iv source
theorem lem_app_sgd_reduction_iv (P : HaarParams) {n m B : ℕ} (μ : Fin n → ℝ)
    (D : Matrix (Fin n) (Fin m) ℝ) (ν : Measure (Matrix.orthogonalGroup (Fin n) ℝ))
    (hν : Muon.Foundations.IsOrthHaar ν) (hP : def_app_sgd_state_law P n m B μ D) :
    haarQ B ν μ D = (m : ℝ) * (1 - 2 / Real.pi) * (∑ i, μ i)
      + 2 / Real.pi * (n : ℝ) * ∑ j, ∫ β, redR μ D β j ∂(batchLaw n m B) := by
Muon.SignSGD.lem_app_sgd_reduction_v source
theorem lem_app_sgd_reduction_v (P : HaarParams) {n m B : ℕ} (μ : Fin n → ℝ)
    (D : Matrix (Fin n) (Fin m) ℝ) (ν : Measure (Matrix.orthogonalGroup (Fin n) ℝ))
    (hν : Muon.Foundations.IsOrthHaar ν) (hP : def_app_sgd_state_law P n m B μ D) (i : Fin n) :
    ∫ p, ((haarSign μ D p.1 p.2)ᵀ *ᵥ haarCol p.1 i) ⬝ᵥ ((haarSign μ D p.1 p.2)ᵀ *ᵥ haarCol p.1 i)
        ∂(ν.prod (batchLaw n m B))
      = (m : ℝ) * (1 - 2 / Real.pi)
        + 2 / Real.pi * (n : ℝ) * ∑ j, ∫ β, hCol μ D β j i ^ 2 / (hCol μ D β j ⬝ᵥ hCol μ D β j)
            ∂(batchLaw n m B) := by