proposition: Lemma switch_row_equal_entries {m n : nat} (r1 r2 : ⟦ m ⟧%stn) (mat : Matrix R m n) : ∏ (j : ⟦ n ⟧%stn), (mat r1 j) = (mat r2 j) -> ∏ (r3 : ⟦ m ⟧%stn), (switch_row r1 r2 mat) r3 j = mat r3 j.
proof: Proof. intros j m_eq r3. unfold switch_row. destruct (stn_eq_or_neq _ _) as [eq | neq]. - destruct (stn_eq_or_neq _ _) as [eq' | neq']; cbn. + now apply maponpaths_2. + etrans. apply m_eq. now apply maponpaths_2. - destruct (stn_eq_or_neq _ _) as [eq | cec]; cbn. + etrans. apply(!m_eq). now apply maponpaths_2. + apply idpath. Qed.
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