Documentation

HexMatrix.Winograd

structure Hex.Matrix.Winograd {R : Type u} {n m k : Nat} [Lean.Grind.Ring R] (A₁₁ A₁₂ A₂₁ A₂₂ : Matrix R n m) (B₁₁ B₁₂ B₂₁ B₂₂ : Matrix R m k) :

The Winograd seven-product schedule over eight blocks of a 2×2 product.

The eight base blocks are the structure parameters; the fifteen operand and result sums S₁…S₄, T₁…T₄, U₁…U₇ and the seven products P₁…P₇ are fields, each pinned to the schedule by a defining equation. A consumer (the mulStrassen correctness proof) instantiates the fields with its recursively-computed intermediates and discharges the equations, then reads off the four output-block identities c11, c12, c21, c22.

Instances For
    theorem Hex.Matrix.Winograd.c11 {R : Type u} {n m k : Nat} [Lean.Grind.Ring R] {A₁₁ A₁₂ A₂₁ A₂₂ : Matrix R n m} {B₁₁ B₁₂ B₂₁ B₂₂ : Matrix R m k} (w : A₁₁.Winograd A₁₂ A₂₁ A₂₂ B₁₁ B₁₂ B₂₁ B₂₂) :
    w.U₁ = A₁₁ * B₁₁ + A₁₂ * B₂₁

    Output block C₁₁ = U₁ of the Winograd schedule equals A₁₁·B₁₁ + A₁₂·B₂₁.

    theorem Hex.Matrix.Winograd.c12 {R : Type u} {n m k : Nat} [Lean.Grind.Ring R] {A₁₁ A₁₂ A₂₁ A₂₂ : Matrix R n m} {B₁₁ B₁₂ B₂₁ B₂₂ : Matrix R m k} (w : A₁₁.Winograd A₁₂ A₂₁ A₂₂ B₁₁ B₁₂ B₂₁ B₂₂) :
    w.U₅ = A₁₁ * B₁₂ + A₁₂ * B₂₂

    Output block C₁₂ = U₅ of the Winograd schedule equals A₁₁·B₁₂ + A₁₂·B₂₂.

    theorem Hex.Matrix.Winograd.c21 {R : Type u} {n m k : Nat} [Lean.Grind.Ring R] {A₁₁ A₁₂ A₂₁ A₂₂ : Matrix R n m} {B₁₁ B₁₂ B₂₁ B₂₂ : Matrix R m k} (w : A₁₁.Winograd A₁₂ A₂₁ A₂₂ B₁₁ B₁₂ B₂₁ B₂₂) :
    w.U₆ = A₂₁ * B₁₁ + A₂₂ * B₂₁

    Output block C₂₁ = U₆ of the Winograd schedule equals A₂₁·B₁₁ + A₂₂·B₂₁.

    theorem Hex.Matrix.Winograd.c22 {R : Type u} {n m k : Nat} [Lean.Grind.Ring R] {A₁₁ A₁₂ A₂₁ A₂₂ : Matrix R n m} {B₁₁ B₁₂ B₂₁ B₂₂ : Matrix R m k} (w : A₁₁.Winograd A₁₂ A₂₁ A₂₂ B₁₁ B₁₂ B₂₁ B₂₂) :
    w.U₇ = A₂₁ * B₁₂ + A₂₂ * B₂₂

    Output block C₂₂ = U₇ of the Winograd schedule equals A₂₁·B₁₂ + A₂₂·B₂₂.