Lemma id_pointwise_prod { n : nat } (v : Vector R n) (i : ⟦ n ⟧%stn) : (@identity_matrix R n i) *pw v = (@scalar_lmult_vec R (v i) n (identity_matrix i)). Proof. unfold identity_matrix, scalar_lmult_vec, pointwise, vector_fmap. apply funextfun. intros k. destruct (stn_eq_or_neq i k) as [eq | neq]. - now rewrite riglunax2, rigrunax2, eq. - now rewrite rigmultx0, rigmult0x. Defined.
Require Import UniMath.Foundations.All. Require Import UniMath.MoreFoundations.All. Require Import UniMath.Combinatorics.StandardFiniteSets. Require Import UniMath.Combinatorics.Vectors. Require Import UniMath.Algebra.RigsAndRings. Require Import UniMath.Algebra.IteratedBinaryOperations. Require Import UniMath.Algebra.Matrix. Require Import UniMath.Algebra.Domains_and_Fields. Require Import UniMath.Algebra.GaussianElimination.Auxiliary. Require Import UniMath.Algebra.GaussianElimination.Vectors.