Batch correctness of the tensor product #
Main results #
bilinearProduct_arrays_eq_mul: exact integer matrix multiplication at selected strings.batch_product_spec: arbitrary output strings withminner levels.
The batch arrays vanish on strings with the wrong number of inner positions. The coefficient rules select equal inner indices and the specified outer row and column, yielding the usual product of integer matrices.
References #
Adapted selectively from [AlmanWilliams2026, Section 2] and
Anthropic's pinned formal source.
Source pin: 16a5ce41304fcdaea4e0be7c132e1c361dc26da5. These are finite mathematical
counts and identities; they give no native program or instruction-cost certificate.
Cardinalities of index types #
The outer-index type has N0 L m elements.
The inner-index type has D m elements.
The input arrays #
The entry of the left input array at the string with inner set Q, outer part r and inner
part π is X_Q[r, π].
The entry of the right input array at the string with inner set Q, inner part π and outer
part c is Y_Q[π, c].
Coefficients and batch correctness #
The inner-output coefficient selects equal inner index pairs (Section 2.3.3).
Checked directly on coefficient; no polynomial coefficient bridge is assumed.
With two outer inputs, the outer-output coefficient selects exactly the matching row and column (Section 2.3.3).
At the output string for a size-m set Q and indices r, c, the bilinear product of
the batch arrays equals (X Q * Y Q) r c. The matrices have arbitrary integer entries
(cf. [AlmanWilliams2026, Lemma 9]).
An output string with exactly m inner levels selects the product of the two matrices
indexed by its inner set, at its extracted row and column. This is an equality of integer
values for the arrays arrayL m X and arrayR m Y (cf. [AlmanWilliams2026, Lemma 9]).
Full.result on the batch arrays agrees with the matrix product for every size-m set
Q and every row and column index.