Phases of Muoncompanion
Proved in LeanTheorem numbering in the paper: Definition F.1
Definition SA.2 (The algorithm)
Fix a momentum \(\bmom\in[0,1)\), a normalized ridge \(\ridge>0\), a deterministic step sequence \((\lr_t)_{t\ge0}\) with \(\lr_t\ge0\), an initial parameter \(W_0\) and an initial buffer \(M_{-1}^\circ\in\R^{\Nout\times\Nin}\), both given before the first batch is drawn (the default is \(M_{-1}^\circ=0\)). Let \(t_{\mathrm{stop}}\defeq\inf\{t\ge0:\cR(t)=0\}\in\{0,1,\dots\}\cup\{\infty\}\). The algorithm is, for \(t\ge0\),
\begin{equation}\tag{SA.15} \begin{gathered} M_t^\circ=\bmom\,M_{t-1}^\circ+(1-\bmom)\,\Gt^\circ,\qquad W_{t+1}=\Wt-\lr_t\,\Gtilde^\circ,\\ \Gtilde^\circ\defeq\begin{cases}\Qridge{\ridgephys_t}(M_t^\circ),&t<t_{\mathrm{stop}},\\ 0,&t\ge t_{\mathrm{stop}},\end{cases} \qquad \ridgephys_t\defeq2\cR(t)\,\ridge . \end{gathered} \end{equation}
This is Muon\(_\varphi\) of Section 1.2 with the regularized polar map \(\Qridge\ridge\), applied at the physical ridge \(2\cR(t)\ridge\). Since \(\Qridge{2\cR\ridge}(\sqrt{2\cR}\,K)=\Qridge\ridge(K)\) (Proposition SA.3), the update is the regularized polar factor, at the fixed normalized ridge \(\ridge\), of the buffer divided by \(\sqrt{2\cR(t)}\); this is why the laws computed later do not depend on the risk. The stopping time only matters with momentum, where the buffer can be nonzero at a state of zero risk. A heavy-ball buffer at ridge \(\ridge'\) is the same algorithm at ridge \((1-\bmom)^2\ridge'\) (Remark SA.2), and no statement concerns \(\ridge\downarrow0\) or Newton–Schulz iterations.
Read the full proofOpens over this page; close it to come back here.

Proof engines

none

Depth

0 levels, 0 statements below it.

Lean

Proved in Lean
Muon.Setup.def_app_setup_algorithm source
def def_app_setup_algorithm (C : Covariances m n) (p : AlgParams m n) {B : ℕ}
    (s₀ : AlgState m n) (x : ℕ → Batch m n B) : (ℕ → AlgState m n) × ℕ∞ :=
Muon.Setup.AlgParams source
structure AlgParams (m n : ℕ) where
Muon.Setup.AlgState source
structure AlgState (m n : ℕ) where
Muon.Setup.initState source
def initState (W0 Mm1 : Mat m n) : AlgState m n := ⟨W0, Mm1⟩
Muon.Setup.errorOf source
def errorOf (p : AlgParams m n) (s : AlgState m n) : Mat m n := s.W - p.Wstar
Muon.Setup.stepBuffer source
def stepBuffer (p : AlgParams m n) {B : ℕ} (s : AlgState m n) (b : Batch m n B) : Mat m n :=
Muon.Setup.stepUpdate source
def stepUpdate (C : Covariances m n) (p : AlgParams m n) {B : ℕ} (s : AlgState m n)
    (b : Batch m n B) : Mat m n :=
Muon.Setup.step source
def step (C : Covariances m n) (p : AlgParams m n) {B : ℕ} (t : ℕ) (s : AlgState m n)
    (b : Batch m n B) : AlgState m n :=
Muon.Setup.run source
def run (C : Covariances m n) (p : AlgParams m n) {B : ℕ} (s₀ : AlgState m n)
    (x : ℕ → Batch m n B) : ℕ → AlgState m n
  | 0 => s₀
  | t + 1 => step C p t (run C p s₀ x t) (x t)

/-- The stopping time `t_stop = inf {t : 𝓡(t) = 0}` of the trajectory, with values in `ℕ∞`
(`⊤` if the risk never vanishes). -/
def tstop (C : Covariances m n) (p : AlgParams m n) {B : ℕ} (s₀ : AlgState m n)
    (x : ℕ → Batch m n B) : ℕ∞ :=
Muon.Setup.tstop source
def tstop (C : Covariances m n) (p : AlgParams m n) {B : ℕ} (s₀ : AlgState m n)
    (x : ℕ → Batch m n B) : ℕ∞ :=
Muon.Setup.runRand source
def runRand (C : Covariances m n) (p : AlgParams m n) {Ω : Type*} {B : ℕ}
    (s₀ : Ω → AlgState m n) (x : ℕ → Ω → Batch m n B) (t : ℕ) (ω : Ω) : AlgState m n :=
Muon.Setup.devRand source
def devRand (C : Covariances m n) (p : AlgParams m n) {Ω : Type*} {B : ℕ}
    (s₀ : Ω → AlgState m n) (x : ℕ → Ω → Batch m n B) (t : ℕ) : Ω → Mat m n :=
Muon.Setup.gtRand source
def gtRand (C : Covariances m n) (p : AlgParams m n) {Ω : Type*} {B : ℕ}
    (s₀ : Ω → AlgState m n) (x : ℕ → Ω → Batch m n B) (t : ℕ) : Ω → Mat m n :=
Muon.Setup.tstopRand source
def tstopRand (C : Covariances m n) (p : AlgParams m n) {Ω : Type*} {B : ℕ}
    (s₀ : Ω → AlgState m n) (x : ℕ → Ω → Batch m n B) : Ω → ℕ∞ :=
Muon.Setup.stepUpdate_eq_paper source
theorem stepUpdate_eq_paper (C : Covariances m n) (p : AlgParams m n) {B : ℕ}
    (s₀ : AlgState m n) (x : ℕ → Batch m n B) (t : ℕ) :
    stepUpdate C p (run C p s₀ x t) (x t)
      = if (t : ℕ∞) < tstop C p s₀ x then
          Q (2 * riskSigma C (errorOf p (run C p s₀ x t)) * p.ϱ)
            (stepBuffer p (run C p s₀ x t) (x t))
        else 0 := by
Muon.Setup.update_eq_zero_iff source
theorem update_eq_zero_iff (C : Covariances m n) (p : AlgParams m n) {B : ℕ}
    (s₀ : AlgState m n) (x : ℕ → Batch m n B) (t : ℕ) :
    tstop C p s₀ x ≤ (t : ℕ∞)
      ↔ riskSigma C (errorOf p (run C p s₀ x t)) = 0 := by
Muon.Setup.tstop_le_iff source
theorem tstop_le_iff (C : Covariances m n) (p : AlgParams m n) {B : ℕ}
    (s₀ : AlgState m n) (x : ℕ → Batch m n B) (t : ℕ) :
    tstop C p s₀ x ≤ (t : ℕ∞)
      ↔ ∃ u ≤ t, riskSigma C (errorOf p (run C p s₀ x u)) = 0 :=
Muon.Setup.devRand_succ source
theorem devRand_succ (C : Covariances m n) (p : AlgParams m n) {Ω : Type*} {B : ℕ}
    (s₀ : Ω → AlgState m n) (x : ℕ → Ω → Batch m n B) (t : ℕ) (ω : Ω) :
    devRand C p s₀ x (t + 1) ω = devRand C p s₀ x t ω - p.η t • gtRand C p s₀ x t ω := by
Muon.Setup.runRand_measurable source
theorem runRand_measurable {Ω : Type*} [mΩ : MeasurableSpace Ω] (P : Measure Ω)
    [IsProbabilityMeasure P] {C : Covariances m n} {ν : Measure (Vec m × Vec n)}
    [IsProbabilityMeasure ν] {B : ℕ} (hM : ModelLaw P ν B) (p : AlgParams m n)
    (s₀ : Ω → AlgState m n)
    (hs₀W : ∀ i j, Measurable[hM.ℱ 0] fun ω => (s₀ ω).W i j)
    (hs₀M : ∀ i j, Measurable[hM.ℱ 0] fun ω => (s₀ ω).Mprev i j) (t : ℕ) :
    (∀ i j, Measurable[hM.ℱ t] fun ω => (runRand C p s₀ hM.x t ω).W i j)
      ∧ (∀ i j, Measurable[hM.ℱ t] fun ω => (runRand C p s₀ hM.x t ω).Mprev i j) := by