Skip to content

Commit 1bfe5de

Browse files
committed
matrix vector multiplication is differentiable
1 parent 1512c13 commit 1bfe5de

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

SciLean/Data/MatrixType/Operations/Gemv.lean

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,13 @@ abbrev_data_synth MatrixType.gemv in A
406406
-- HMul notation -----------------------------------------------------------------------------------
407407
----------------------------------------------------------------------------------------------------
408408

409+
@[fun_prop]
410+
theorem HMul.hMul.arg_a0a1.Differentiable_rule_matVec_mul.{u_1, u_2, u_3, u_4, u_5, u_6, u_7} {M : Type u_1} {m : Type u_2}
411+
{n : Type u_3} [IndexType m] [IndexType n] {R : Type u_4} {K : Type u_5} [RealScalar R] [Scalar R K] {X : Type u_6}
412+
{Y : Type u_7} [VectorType.Base X n K] [VectorType.Base Y m K] [MatrixType.Base M X Y] [InjectiveGetElem M (m × n)]
413+
[MatrixType.Dense M] [InjectiveGetElem X n] [InjectiveGetElem Y m] :
414+
Differentiable K (fun Ax : M×X => Ax.1 * Ax.2) := by simp[HMul.hMul]; fun_prop
415+
409416
@[fun_trans]
410417
theorem _root_.HMul.hMul.arg_a0a1.revFDeriv_rule_matVec_mul
411418
{M m n : Type*} [IndexType m] [IndexType n]

0 commit comments

Comments
 (0)