Documentation

LeanPool.MatrixMultiplicationAllFields.LinearAlgebra.MatrixMultiplication.Arithmetic.NaiveAlgorithm

Division-free arithmetic programs over a field and their operation counts.

Build an arithmetic expression for a finite sum, with zero as the empty sum.

Equations
Instances For
    theorem MatrixMultiplicationAllFields.MatrixMultiplication.Arithmetic.Expression.sumFin_eval {F : Type u_1} [Field F] {Input : Type u_2} {n : ℕ} (f : Fin n → Expression F Input) (inputs : Input → F) :
    eval inputs (sumFin f) = ∑ i : Fin n, eval inputs (f i)
    theorem MatrixMultiplicationAllFields.MatrixMultiplication.Arithmetic.Expression.sumFin_cost {F : Type u_1} [Field F] {Input : Type u_2} {n : ℕ} (f : Fin n → Expression F Input) :
    (sumFin f).cost = ∑ i : Fin n, (f i).cost + n

    The schoolbook dot-product expression for one matrix-product entry.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      theorem MatrixMultiplicationAllFields.MatrixMultiplication.Arithmetic.naiveEntry_eval {F : Type u_1} [Field F] {a b c : ℕ} (i : Fin a) (k : Fin c) (A : Matrix (Fin a) (Fin b) F) (B : Matrix (Fin b) (Fin c) F) :
      Expression.eval (matrixInputs A B) (naiveEntry i k) = ∑ j : Fin b, A i j * B j k

      Compile all schoolbook dot products into one matrix multiplication program.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For