FinMatrix.Matrix.MatrixRFun


Require Export RExt RFunExt.
Require Export MatrixModule.

Matrix theory come from common implementations


Module Export MatrixTheoryRFun := RingMatrixTheory RingElementTypeRFun.

Open Scope R_scope.
Open Scope Rfun_scope.
Open Scope vec_scope.
Open Scope mat_scope.

Matrix theory applied to this type

Derivative of matrix

标量(函数)对矩阵(函数)的梯度

Usage demo


Section test.
  Let f00 : A := fun t => 1%R.
  Let f01 : A := fun t => 2.
  Let f10 : A := fun t => 3.
  Let f11 : A := fun t => 4.
  Let l1 := [[f00;f01];[f10;f11]].
  Let m1 := @l2m 2 2 l1.

End test.

Section Example4CoordinateSystem.
  Open Scope A_scope.
  Open Scope fun_scope.
  Notation "1" := Aone : fun_scope.
  Notation "0" := Azero : fun_scope.

  Variable ψ θ ϕ : A.
  Let : A := fun t => cos (θ t).
  Let : A := fun t => sin (θ t).
  Let cψ : A := fun t => cos (ψ t).
  Let sψ : A := fun t => sin (ψ t).
  Let : A := fun t => cos (ϕ t).
  Let : A := fun t => sin (ϕ t).

  Let Rx := mkmat_3_3 1 0 0 0 0 (-) .
  Let Ry := mkmat_3_3 0 (-) 0 1 0 0 .
  Let Rz := mkmat_3_3 cψ sψ 0 (-sψ) cψ 0 0 0 1.
  Let Rbe :=
        mkmat_3_3
          ( * cψ) (cψ * * - sψ * )
          (cψ * * + * sψ) ( * sψ)
          (sψ * * + cψ * )
          (sψ * * - cψ * )
          (-) ( * ) ( * ).
  Lemma Rbe_ok : (Rbe = Rz\T * Ry\T * Rx\T)%M.
  Proof. apply m2l_inj. cbv. list_eq; extensionality x; ring. Qed.

End Example4CoordinateSystem.