Documentation

CslibFrontier.Algorithms.MatrixMultiplication.Schonhage.BoxValues

Finite box counts and value recurrence #

The canonical-box bijection counts boxes by a completed leaf and a number of stars. card_boxes_le bounds their total by (m + 1) times the sum of the existing beta counts. It needs only m ≤ L and t ≤ m; the source's stronger 10 * m ≤ L is unnecessary.

boxValue recursively replaces the highest star by each of the ten existing terms. boxValue_eq_val proves that it computes the signed cube value when the supplied star count is exact. This recurrence may recompute subproblems: it is neither a memoized table nor a native program and carries no preprocessing-time or space theorem.

Adapted from [AlmanWilliams2026, Lemma 29] and Lemma29.lean at anthropics/formal-math@16a5ce41304fcdaea4e0be7c132e1c361dc26da5. The encodings, terms, leaf order and beta counts are the existing local notions.

All cubes satisfying the box conditions at the selected parameters.

Boxes whose star count is exactly e.

Finite recursive value evaluation, indexed by the exact number of stars.

@[simp]

Membership is exactly the two box conditions.

@[simp]

Membership combines the box conditions with an exact star count.

theorem Cslib.Algorithms.MatrixMultiplication.Schonhage.card_boxes_with_P0_count (L m t f : ℕ) (hmL : m ≤ L) (hf : f ≤ m - t) :
{π ∈ boxes L m t | π.starLevels.card + π.P0Levels.card = f}.card = (f + 1) * beta L m (m - f)

Boxes with a fixed combined star/P0 count correspond to completed leaves and star counts.

theorem Cslib.Algorithms.MatrixMultiplication.Schonhage.card_boxes_le (L m t : ℕ) (hmL : m ≤ L) (ht : t ≤ m) :
(boxes L m t).card ≤ (m + 1) * ∑ d ∈ Finset.Icc t m, beta L m d

The total count is bounded by completed-leaf counts and at most m + 1 star counts.

Boxes without stars are exactly the eligible fully fixed leaves.

Replacing the highest star gives a box with one fewer star.

theorem Cslib.Algorithms.MatrixMultiplication.Schonhage.boxValue_eq_val (L m t e : ℕ) (a : LeftStr L → ℤ) (b : RightStr L → ℤ) (π : Cube L) (hπ : π ∈ boxesWithStars L m t e) :
boxValue (encodingL a) (encodingR b) e π = Cube.val a b π

The finite recurrence agrees with the signed encoding-product sum of a box.