proposition: Lemma switch_row_as_matrix {m n} (r1 r2 : ⟦ m ⟧%stn) (mat : Matrix R m n) : ((switch_row_matrix r1 r2) ** mat) = switch_row r1 r2 mat.
proof: Proof. apply funextfun; intros i; apply funextfun; intros j. rewrite matrix_mult_eq; unfold matrix_mult_unf. unfold switch_row_matrix, switch_row. destruct (stn_eq_or_neq i r1) as [i_eq_r1 | i_neq_r1]; destruct (stn_eq_or_neq i r2) as [i_eq_r2 | i_neq_r2]; simpl; use sum_stdb_vector_pointwise_prod. Defined.
imports: UniMath.Foundations.All UniMath.MoreFoundations.All UniMath.Combinatorics.StandardFiniteSets UniMath.Combinatorics.Vectors UniMath.Algebra.Matrix UniMath.Algebra.RigsAndRings UniMath.Algebra.IteratedBinaryOperations UniMath.Algebra.Domains_and_Fields UniMath.Algebra.GaussianElimination.Auxiliary UniMath.Algebra.GaussianElimination.Vectors UniMath.Algebra.GaussianElimination.Matrices