Phases of Muoncompanion
Section SA · Setup: model, momentum, regularized SignSVD, normalization
Proved in Lean
Lemma SA.5 (Stationary EMA law)
In the frozen-state model, index the samples by time as above, and write \(\Sigma_G\defeq\Cov(\operatorname{vec}\Gt)\) for the batch covariance (SA.28).
  1. (i)
    The series \(\Mt=\sum_{j\ge0}\emaw{j}G_{t+1-j}\) and the sample series \(\sum_{j,a}\emaw{j}\abs{d_{ja}}\norm{z_{ja}}\norm{w_{ja}}\) converge absolutely.
  2. (ii)
    For every integer \(t\), \(\Mt=\bmom M_{t-1}+(1-\bmom)\Gt\), and the sequence \((\Mt)_{t\in\mathbb Z}\) is strictly stationary.
  3. (iii)
    \(\EE\Mt=\EE\Gt\), \(\Cov(\operatorname{vec}\Mt)=\sw2\,\Sigma_G\), and \(\EE\norm{\Mt-\EE\Gt}_\F^2=\sw2\,\mathsf V_B\).
  4. (iv)
    For every lag \(\ell\ge0\), \(\Cov(\operatorname{vec}\Mt,\operatorname{vec}M_{t+\ell})=\bmom^\ell\,\sw2\,\Sigma_G\).
  5. (v)
    For every positive integer \(T\),
    \begin{equation}\tag{SA.31} \Cov\Big(\sum_{t=1}^T\operatorname{vec}(\Mt-\EE\Gt)\Big) =\sw2\Big[T+2\sum_{\ell=1}^{T-1}(T-\ell)\bmom^\ell\Big]\Sigma_G =\Big[T-\frac{2\bmom(1-\bmom^T)}{1-\bmom^2}\Big]\Sigma_G , \end{equation}
    the two-sided lag sum \(\sum_{\ell\in\mathbb Z}\Cov(\operatorname{vec}\Mt,\operatorname{vec}M_{t+\ell})\) converges absolutely and equals \(\Sigma_G\), and \(T^{-1}\Cov(\sum_{t\le T}\operatorname{vec}(\Mt-\EE\Gt))\to\Sigma_G\) as \(T\to\infty\).
Proof.
Part (i) holds because \(\sum_j\emaw j=1\) and the batches are identically distributed.
The recursion is a reindexing of the series:
\[ \bmom M_{t-1}+(1-\bmom)\Gt=\sum_{j\ge0}(1-\bmom)\bmom^{j+1}G_{t-j}+(1-\bmom)G_{t+1} =\sum_{j\ge1}\emaw{j}G_{t+1-j}+\emaw0G_{t+1}=\Mt . \]
Strict stationarity holds because the batches are independent and identically distributed, so that a common shift of the times is a relabeling of the batches. This proves (ii).
The moments follow from the orthogonality of the centered batches. For \(k\le l\), independence and centering give
\begin{equation}\tag{SA.32} \EE\Big\|\sum_{j=k}^l\emaw{j}\big(G_{t+1-j}-\EE\Gt\big)\Big\|_\F^2=\mathsf V_B\sum_{j=k}^l\emaw{j}^2 . \end{equation}
The mean is \(\sum_j\emaw j\,\EE\Gt=\EE\Gt\) by (SA.18); the covariance is \(\sum_j\emaw j^2\,\Sigma_G=\sw2\Sigma_G\) by the same orthogonality; and the Frobenius variance is (SA.32) with \(k=0\), \(l\to\infty\). This proves (iii).
The lag covariance follows from the decomposition of a later buffer into the past and a new part. By the reindexing of the series, for \(\ell\ge0\),
\begin{equation}\tag{SA.33} M_{t+\ell}=\bmom^\ell\,\Mt+\sum_{r=0}^{\ell-1}\emaw{r}\,G_{t+\ell+1-r}, \end{equation}
where the finite sum involves only batches of times larger than \(t+1\) and is therefore independent of \(\Mt\). Centering and bilinearity of the covariance give \(\Cov(\operatorname{vec}\Mt,\operatorname{vec}M_{t+\ell})=\bmom^\ell\Cov(\operatorname{vec}\Mt)=\bmom^\ell\sw2\Sigma_G\). This proves (iv).
The block covariance is a sum over the \(T^2\) pairs of times. By (iii) and (iv), and the symmetry of the covariance under exchanging the two times,
\[ \Cov\Big(\sum_{t=1}^T\operatorname{vec}(\Mt-\EE\Gt)\Big)=\sum_{t,t'=1}^T\bmom^{\abs{t-t'}}\sw2\Sigma_G =\sw2\Big[T+2\sum_{\ell=1}^{T-1}(T-\ell)\bmom^\ell\Big]\Sigma_G , \]
which is the first form of (SA.31). The scalar identity
\[ \sum_{\ell=1}^{T-1}(T-\ell)\bmom^\ell=\sum_{k=1}^{T-1}\sum_{\ell=1}^k\bmom^\ell=\frac{\bmom}{1-\bmom}\sum_{k=1}^{T-1}(1-\bmom^k) =\frac{T\bmom}{1-\bmom}-\frac{\bmom(1-\bmom^T)}{(1-\bmom)^2} \]
follows from writing \(T-\ell\) as the number of \(k\) with \(\ell\le k\le T-1\) and exchanging the order of summation, and inserting it with \(\sw2=(1-\bmom)/(1+\bmom)\) gives the second form. The two-sided lag sum converges absolutely by the geometric majorant \(\bmom^{\abs\ell}\) and equals
\[ \sw2\Big(1+2\sum_{\ell\ge1}\bmom^\ell\Big)\Sigma_G=\frac{1-\bmom}{1+\bmom}\cdot\frac{1+\bmom}{1-\bmom}\,\Sigma_G=\Sigma_G , \]
and the limit of \(T^{-1}\) times (SA.31) is the same value. This proves (v).

Uses

Used by

Lean

Proved in Lean
Muon.Setup.SigmaG source
def SigmaG (S : FrozenSamples P m n B) (F : FrozenParams m n B) :
    Fin m → Fin n → Fin m → Fin n → ℝ :=
Muon.Setup.crossCovT source
def crossCovT {m n : ℕ} (P : Measure Ω) (X Y : Ω → Mat m n) :
    Fin m → Fin n → Fin m → Fin n → ℝ :=
Muon.Setup.StrictlyStationary source
def StrictlyStationary {E : Type*} [MeasurableSpace E] (P : Measure Ω) (X : ℤ → Ω → E) :
    Prop :=
Muon.Setup.blockSum source
def blockSum (S : FrozenSamples P m n B) (F : FrozenParams m n B) (T : ℕ) : Ω → Mat m n :=
Muon.Setup.eucNorm source
def eucNorm {k : ℕ} (z : Vec k) : ℝ :=
Muon.Setup.frozenVB source
def frozenVB (S : FrozenSamples P m n B) (F : FrozenParams m n B) : ℝ :=
Muon.Setup.lem_app_setup_ema_law_i source
theorem lem_app_setup_ema_law_i [IsProbabilityMeasure P] (F : FrozenParams m n B)
    (S : FrozenSamples P m n B) :
    (∀ᵐ ω ∂P, ∀ t : ℤ, Summable fun j : ℕ =>
        fro (emaW F.β j • frozenBatchG F S (t + 1 - (j : ℤ)) ω)) ∧
      (∀ᵐ ω ∂P, ∀ t : ℤ, Summable fun p : ℕ × Fin B =>
        emaW F.β p.1 *
          |dotProduct (S.zw (t + 1 - (p.1 : ℤ)) p.2 ω).1
              (Matrix.mulVec F.A (S.zw (t + 1 - (p.1 : ℤ)) p.2 ω).2)| *
          eucNorm (S.zw (t + 1 - (p.1 : ℤ)) p.2 ω).1 *
          eucNorm (S.zw (t + 1 - (p.1 : ℤ)) p.2 ω).2) := by
Muon.Setup.lem_app_setup_ema_law_ii source
theorem lem_app_setup_ema_law_ii [IsProbabilityMeasure P] (F : FrozenParams m n B)
    (S : FrozenSamples P m n B) :
    (∀ᵐ ω ∂P, ∀ t : ℤ, frozenBuf F S t ω =
        F.β • frozenBuf F S (t - 1) ω + (1 - F.β) • frozenBatchG F S (t + 1) ω) ∧
      StrictlyStationary P (frozenBuf F S) := by
Muon.Setup.lem_app_setup_ema_law_iii source
theorem lem_app_setup_ema_law_iii [IsProbabilityMeasure P] (F : FrozenParams m n B)
    (S : FrozenSamples P m n B) (t : ℤ) :
    mean P (frozenBuf F S t) = mean P (frozenBatchG F S (t + 1)) ∧
      covT P (frozenBuf F S t) = sPow F.β 2 • SigmaG S F ∧
      ∫ ω, (fro (frozenBuf F S t ω - mean P (frozenBatchG F S (t + 1)))) ^ 2 ∂P =
        sPow F.β 2 * frozenVB S F := by
Muon.Setup.lem_app_setup_ema_law_iv source
theorem lem_app_setup_ema_law_iv [IsProbabilityMeasure P] (F : FrozenParams m n B)
    (S : FrozenSamples P m n B) (t : ℤ) (ℓ : ℕ) :
    crossCovT P (frozenBuf F S t) (frozenBuf F S (t + (ℓ : ℤ))) =
      (F.β ^ ℓ * sPow F.β 2) • SigmaG S F := by
Muon.Setup.lem_app_setup_ema_law_v source
theorem lem_app_setup_ema_law_v [IsProbabilityMeasure P] (F : FrozenParams m n B)
    (S : FrozenSamples P m n B) :
    (∀ T : ℕ, 0 < T →
      (covT P (blockSum S F T) = (sPow F.β 2 * ((T : ℝ) +
          2 * ∑ ℓ ∈ Finset.Ico 1 T, ((T : ℝ) - (ℓ : ℝ)) * F.β ^ ℓ)) • SigmaG S F ∧
        covT P (blockSum S F T) = ((T : ℝ) - 2 * F.β * (1 - F.β ^ T) / (1 - F.β ^ 2)) •
          SigmaG S F)) ∧
    (∀ (t : ℤ) (i : Fin m) (j : Fin n) (k : Fin m) (l : Fin n),
      Summable (fun ℓ : ℤ => |crossCovT P (frozenBuf F S t) (frozenBuf F S (t + ℓ)) i j k l|) ∧
        HasSum (fun ℓ : ℤ => crossCovT P (frozenBuf F S t) (frozenBuf F S (t + ℓ)) i j k l)
          (SigmaG S F i j k l)) ∧
    Tendsto (fun T : ℕ => ((T : ℝ))⁻¹ • covT P (blockSum S F T)) atTop (𝓝 (SigmaG S F)) := by
Muon.Setup.eqn_app_setup_orthogonality source
theorem eqn_app_setup_orthogonality [IsProbabilityMeasure P] (F : FrozenParams m n B)
    (S : FrozenSamples P m n B) (t : ℤ) {k l : ℕ} (hkl : k ≤ l) :
    ∫ ω, (fro (∑ j ∈ Finset.Icc k l,
        emaW F.β j • (frozenBatchG F S (t + 1 - (j : ℤ)) ω - mean P (frozenBatchG F S 0)))) ^ 2
      ∂P
      = frozenVB S F * ∑ j ∈ Finset.Icc k l, emaW F.β j ^ 2 := by
Muon.Setup.eqn_app_setup_lag_decomposition source
theorem eqn_app_setup_lag_decomposition [IsProbabilityMeasure P] (F : FrozenParams m n B)
    (S : FrozenSamples P m n B) :
    ∀ᵐ ω ∂P, ∀ (t : ℤ) (ℓ : ℕ), frozenBuf F S (t + (ℓ : ℤ)) ω =
      F.β ^ ℓ • frozenBuf F S t ω
        + ∑ r ∈ Finset.range ℓ, emaW F.β r • frozenBatchG F S (t + (ℓ : ℤ) + 1 - (r : ℤ)) ω := by