Documentation

Complexity.Algorithms.MatrixMultiplication.Schonhage.Identity

Schönhage's ten-term polynomial identity #

The ten products of linear forms equal the wanted inner/outer product polynomial plus an explicit error polynomial. This is an identity over integers in 24 formal variables. The error term is retained; it cannot be discarded for unrestricted inputs.

Main definitions #

Main results #

References #

Part of [AlmanWilliams2026, Section 2]. Direct mathematical adaptation of Anthropic's pinned formal source. Definitions are selectively extracted from that pin's PaperStatements.lean; no machine semantics or running-time statement is imported. The docstrings below explain the local declarations in our own words.

@[reducible, inline]

All 24 variables of the identity: the left, the right and the output variables.

Instances For
    @[reducible, inline]

    The polynomials in which Schönhage's identity is an identity.

    Instances For

      A left variable, as a polynomial.

      Instances For

        A right variable, as a polynomial.

        Instances For

          An output variable, as a polynomial.

          Instances For

            A linear form in the left variables, as a polynomial.

            Instances For

              A linear form in the right variables, as a polynomial.

              Instances For

                A linear form in the output variables, as a polynomial.

                Instances For

                  The target polynomial combines the nine outer x-y products with the four p-q products attached to the inner coordinate.

                  Instances For

                    The error polynomial collects the additional outer-coordinate terms involving pHat or qHat. It has no inner-coordinate summand.

                    Instances For

                      Linear forms as polynomials #

                      formL is the linear map that sends the form consisting of the single variable s to the polynomial s.

                      formR is the linear map that sends the form consisting of the single variable t to the polynomial t.

                      formO is the linear map that sends the form consisting of the single variable z to the polynomial z.

                      The form consisting of a single left variable is that variable.

                      The form consisting of a single right variable is that variable.

                      The form consisting of a single output variable is that variable.

                      Interpret an indexed left coefficient form as the sum of its x variable and its extended p form.

                      Interpret an indexed right coefficient form as the sum of its y variable and its extended q form.

                      Interpret an indexed output form as the sum of the corresponding outer variable and the inner variable.

                      The distinguished left form is the negative sum of the three x polynomials.

                      The distinguished right form is the sum of the three y polynomials.

                      The distinguished output form denotes the inner polynomial variable alone.

                      Lemma 6 #

                      Summing pHat over the row index gives the zero coefficient function.

                      Summing qHat over the column index gives the zero coefficient function.

                      theorem Cslib.Algorithms.MatrixMultiplication.Schonhage.sum_pHat_mul_qHat :
                      ∑ i : Fin 3, ∑ j : Fin 3, formL (pHat i j) * formR (qHat i j) = ∑ i : Fin 2, ∑ j : Fin 2, polyL (LeftVar.p i j) * polyR (RightVar.q i j)

                      The product sum for the extended arrays reduces to the four products from their original two-by-two arrays.

                      The ten products of the coefficient forms equal the wanted polynomial G plus the explicit error polynomial E.