def
Hex.Matrix.pad
{R : Type u}
{n m : Nat}
[OfNat R 0]
(M : Matrix R n m)
(n' m' : Nat)
:
Matrix R n' m'
M embedded in the top-left corner of an n' × m' matrix, with zeros filling
the rest. Truncation semantics: an entry whose row is ≥ n or column is ≥ m is
0, and if n' < n or m' < m the overhanging entries of M are dropped. The
padding lemmas below assume n ≤ n' / m ≤ m', the regime where this is genuine
zero-padding.
Equations
Instances For
theorem
Hex.Matrix.takeCols_takeRows_mul_pad
{R : Type u}
{n m k : Nat}
[Lean.Grind.Ring R]
(A : Matrix R n m)
(B : Matrix R m k)
(n' m' k' : Nat)
(hn : n ≤ n')
(hm : m ≤ m')
(hk : k ≤ k')
:
Padding lemma. Zero-padding each operand to a common larger middle
dimension and reading back the top-left n × k block of the product returns the
unpadded product A * B. The border entries are zero, so every extended term of
each dot product is 0 * _ or _ * 0 and drops out (dotProduct_extendZero).