Documentation

Complexity.Algorithms.WordRAM.MatrixMultiplication.Schonhage.Controller

Alternating buffers for the shared native encoder #

Main definitions #

References #

The shared encodings are from [AlmanWilliams2026, Section 2.4.1]; see Encoding for provenance.

Destination of the next coordinate transform; always one of the two fixed buffers.

Instances For

    Source of the next coordinate transform; initially the preserved input segment.

    Instances For

      A destination is either the fixed output block or the scratch block.

      After the initial transform, the source is also one of the two buffers.

      The two alternating buffer addresses differ at every stage.

      Both current addresses are bounded by the end of the second buffer.

      theorem Cslib.Algorithms.WordRAM.MatrixMultiplication.Schonhage.Encoding.buffers_separated {L j k N : ℕ} (hjk : j + k = L) (hN : N ≤ 10 ^ L) :
      source L j + 10 ^ j * 7 ^ k ≤ destination L j ∨ destination L j + N ≤ source L j

      Arrays stored at consecutive buffers are disjoint, in either order. The initial input ends exactly at the first output address.

      structure Cslib.Algorithms.WordRAM.MatrixMultiplication.Schonhage.Encoding.Progress (side : Bool) (L j : ℕ) (arr : ℕ → ℤ) (initial : ℕ → ℕ) (y : WordRAM.Data 32) :

      The shared-array invariant at depth j. All fields describe ordinary registers or mathematical memory values. Execution, timing and width are proved separately.

      Instances For
        theorem Cslib.Algorithms.WordRAM.MatrixMultiplication.Schonhage.Encoding.progress_zero (side : Bool) (L : ℕ) (arr : ℕ → ℤ) (x y : WordRAM.Data 32) (hy : SetupPost L x y) (hinput : ∀ i < 7 ^ L, x.mem (2 + i) = WordRAM.Signed.encode (arr i)) :
        Progress side L 0 arr x.mem y

        The actual header initialization establishes the zero-stage invariant from the original flat input segment. No scratch values or preinitialized coefficient tables are required.

        theorem Cslib.Algorithms.WordRAM.MatrixMultiplication.Schonhage.Encoding.progress_step {w L j : ℕ} (hw : 0 < w) (hj : j < L) (side : Bool) (arr : ℕ → ℤ) (initial : ℕ → ℕ) (x : WordRAM.Data 32) (hx : Progress side L j arr initial x) (A : ℤ) (hA : 0 ≤ A) (ha : ∀ i < 7 ^ L, |arr i| ≤ A) (hmag : ↑(7 ^ L) * A < 2 ^ (w - 1)) (haddr : WordRAM.Fits (w + 2) (addressBound L)) :
        ∃ (y : WordRAM.Data 32), WordRAM.ExecWithin (w + 2) (stageBody side) x y (207 * 10 ^ L + 12) ∧ Progress side L (j + 1) arr initial y

        One proved native stage advances the mixed-radix invariant. The signed magnitude bound comes from the original input and the number of coordinates already transformed.