Muon Certificate Examples #
These examples show how to obtain and consume the exact and approximate certificates attached to
Muon steps. Runtime code configures Muon through TorchLean.optim.runtimeMuon; proofs about the
algorithm use the canonical Optim.Muon namespace.
Using the QR checked backend, a positive-pivot proof gives a certified step; from that step we can recover both the exact Gram certificate for the direction and the parameter-update equation.
Using the residual-checked Newton-Schulz backend, a residual proof gives a certified approximate step; from that step we can recover the residual-bound certificate and the parameter equation.
If the fresh momentum buffer is already exact-column-orthogonal and fixed by one Newton-Schulz step, the fixed-point checked backend upgrades Newton-Schulz from an approximate residual-checked path to an exact certified step.
At an exact-column-orthogonal matrix, one real Newton-Schulz step acts by the scalar $a+b+c$. This is the algebra behind the fixed-point shortcut below.
The same algebra shows exact column Gram is preserved when the coefficient sum squares to one, including the sign-flip case.
If the coefficient sum is only approximately square-one, the same one-step algebra gives the entrywise residual bound used by the approximate Muon certificate.
Over ℝ, the common coefficient condition $a+b+c=1$ means an already exact-column-orthogonal
fresh buffer is automatically a fixed point, so the Newton-Schulz Muon update is exactly certified.
The initialized QR theorem has the same proof shape as the stateful update theorem, but starts from
the state produced by Optim.Muon.init.
The same QR certificate also exposes the whole next-state equation, not only the direction certificate.
The initialized residual-checked Newton-Schulz theorem is the training-path version: initialize the Muon state, run one update, then consume the certified step.
The initialized residual-checked Newton-Schulz certificate also exposes the whole next-state equation.