Documentation

Complexity.Algorithms.MatrixMultiplication.Schonhage.Alphabets

The alphabets and coefficient forms of Schönhage's tensor #

Seven left variables, seven right variables, ten output variables and ten multiplication terms are represented explicitly. Indices start at zero. Linear forms are coefficient functions over integers; no arithmetic operation is treated as a native machine instruction.

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.

Left input coordinates: three x coordinates and a two-by-two family of p coordinates.

Instances For

    Right input coordinates: three y coordinates and a two-by-two family of q coordinates.

    Instances For

      Output coordinates comprise a three-by-three outer family and one distinguished inner coordinate.

      Instances For

        The multiplication labels consist of nine indexed labels P i j and the additional label P0.

        Instances For

          The linear form consisting of the single left variable x_i.

          Instances For

            The linear form consisting of the single left variable p_ij.

            Instances For

              The linear form consisting of the single right variable y_j.

              Instances For

                The linear form consisting of the single right variable q_ij.

                Instances For

                  The linear form consisting of the single output variable z_ij.

                  Instances For

                    The linear form consisting of the single output variable z₀.

                    Instances For

                      Extend the two-by-two p family to three rows by cancelling each column sum; the third column is zero.

                      Instances For

                        Extend the two-by-two q family to three columns by cancelling each row sum; the third row is zero.

                        Instances For

                          Left coefficients for each multiplication label. An indexed label adds its x coordinate to the corresponding pHat form; P0 negates the sum of the three x coordinates.

                          Instances For

                            Right coefficients for each multiplication label. Indexed labels use y plus qHat, whereas P0 uses the sum of the three y coordinates.

                            Instances For

                              Output coefficients: each indexed label occurs in its own outer coordinate and in z0; P0 occurs only in z0.

                              Instances For

                                Select the distinguished output coordinate, excluding the indexed outer coordinates.

                                Instances For

                                  A label is relevant to an output coordinate when its output coefficient is nonzero.

                                  Instances For

                                    Choose the indexed label for an outer coordinate and P0 for the inner coordinate. Applying this choice coordinatewise defines a private leaf.

                                    Instances For
                                      @[reducible, inline]

                                      A length-L tuple of left coordinates, indexed from zero.

                                      Instances For
                                        @[reducible, inline]

                                        A length-L tuple with entries in RightVar.

                                        Instances For
                                          @[reducible, inline]

                                          A length-L tuple with entries in OutVar.

                                          Instances For
                                            @[reducible, inline]

                                            The sequence of multiplication labels identifying a depth-k recursion vertex.

                                            Instances For
                                              @[reducible, inline]

                                              A terminal vertex, whose label sequence has the full recursion depth.

                                              Instances For

                                                The alphabets #

                                                The left variables, listed: x i is .inl i, and p i j is .inr (i, j).

                                                Instances For

                                                  The right variables, listed: y j is .inl j, and q i j is .inr (i, j).

                                                  Instances For

                                                    The terms, listed: P i j is some (i, j), and P0 is none.

                                                    Instances For

                                                      Which terms contribute to which output variables #

                                                      @[simp]

                                                      The inner coordinate receives a contribution from every multiplication label.

                                                      @[simp]

                                                      For an outer coordinate, relevance determines both indices of the multiplication label.

                                                      Relevance has two possibilities: the output is inner, or the label is the private label selected by that output.

                                                      theorem Cslib.Algorithms.MatrixMultiplication.Schonhage.Term.sum_contributes {A : Type u_1} [AddCommMonoid A] (c : Term → A) (z : OutVar) :
                                                      ∑ lam : Term with lam.Contributes z, c lam = match z with | OutVar.z i j => c (P i j) | OutVar.z0 => ∑ lam : Term, c lam

                                                      Separate decoding into its two cases: an outer output selects one summand; the inner output sums the whole label family.

                                                      Each output coefficient is the zero-or-one indicator of Term.Contributes.