The terminals of matrix multiplication #
- Distinct terminals (
terminal_injective). The3 n²terminals lie on distinct wires, whereE i kis the matrix unit: the outputsC i kandC i' k'differ onA = 1,B = E i k; an inputA i jand an output differ onA = E i j,B = 0; an inputB j kand an output differ onA = 0,B = E j k. - One component (
mem_component_of_trace). The component of the outputC 0 0is closed, so it is crossed by no signal, and byapply_eq_zero_of_closed_of_tracethe linear maps obtained by fixing one factor send vectors supported inside it to vectors vanishing outside it, and vice versa. With the factorB = E j kthe unit vector atA i jmoves the outputC i k, and withA = E i jthe unit vector atB j kmovesC i k; spreading fromC 0 0, the component holds the rowA 0 ·, the rowC 0 ·, all ofB, all ofCand all ofA.
theorem
Algebraic.Cutwidth.MultiOutput.MatMul.Internal.shiftLeft_single_single
{n : ℕ}
{F : Type u_1}
[Field F]
(i j k : Fin n)
:
theorem
Algebraic.Cutwidth.MultiOutput.MatMul.Internal.shiftRight_single_single
{n : ℕ}
{F : Type u_1}
[Field F]
(i j k : Fin n)
:
theorem
Algebraic.Cutwidth.MultiOutput.MatMul.Internal.out_injective
{σ : Signature}
{n s : ℕ}
{F : Type u_1}
[Field F]
{p : Program σ (n * n + n * n) s}
{I : Interpretation σ F}
{out : Fin (n * n) → Wire (n * n + n * n) s}
(hf : ∀ (z : Fin (n * n + n * n) → F) (o : Fin (n * n)), p.trace I z (out o) = matMul n z o)
:
Distinct outputs lie on distinct wires.
theorem
Algebraic.Cutwidth.MultiOutput.MatMul.Internal.out_ne_termA
{σ : Signature}
{n s : ℕ}
{F : Type u_1}
[Field F]
{p : Program σ (n * n + n * n) s}
{I : Interpretation σ F}
{out : Fin (n * n) → Wire (n * n + n * n) s}
(hf : ∀ (z : Fin (n * n + n * n) → F) (o : Fin (n * n)), p.trace I z (out o) = matMul n z o)
(i j i' k' : Fin n)
:
No output lies on the wire of an input A i j.
theorem
Algebraic.Cutwidth.MultiOutput.MatMul.Internal.out_ne_termB
{σ : Signature}
{n s : ℕ}
{F : Type u_1}
[Field F]
{p : Program σ (n * n + n * n) s}
{I : Interpretation σ F}
{out : Fin (n * n) → Wire (n * n + n * n) s}
(hf : ∀ (z : Fin (n * n + n * n) → F) (o : Fin (n * n)), p.trace I z (out o) = matMul n z o)
(j k i' k' : Fin n)
:
No output lies on the wire of an input B j k.
theorem
Algebraic.Cutwidth.MultiOutput.MatMul.Internal.terminal_injective
{σ : Signature}
{n s : ℕ}
{F : Type u_1}
[Field F]
{p : Program σ (n * n + n * n) s}
{I : Interpretation σ F}
{out : Fin (n * n) → Wire (n * n + n * n) s}
(hf : ∀ (z : Fin (n * n + n * n) → F) (o : Fin (n * n)), p.trace I z (out o) = matMul n z o)
:
Function.Injective (Sum.elim (matMulTermA n s) (Sum.elim (matMulTermB n s) (matMulTermC out)))
Distinct terminals. The inputs A i j, B j k and the outputs C i k lie on 3 n²
distinct wires.
One component #
theorem
Algebraic.Cutwidth.MultiOutput.MatMul.Internal.mem_component_of_trace
{σ : Signature}
{n s : ℕ}
{F : Type u_1}
[Field F]
{p : Program σ (n * n + n * n) s}
{I : Interpretation σ F}
{out : Fin (n * n) → Wire (n * n + n * n) s}
(hn : 0 < n)
(hf : ∀ (z : Fin (n * n + n * n) → F) (o : Fin (n * n)), p.trace I z (out o) = matMul n z o)
:
All terminals lie in one component. If the wires out of a program over any field carry
matMul n and n ≥ 1, the component of the output C 0 0 contains every input and every
output.