Lemma zero_row_to_non_right_invertibility { m n : nat } (A : Matrix R m n) (i : ⟦ m ⟧%stn) (zero_row : A i = (const_vec 0%ring)) : (@matrix_right_inverse R m n A) -> empty. Proof. intros [inv isrightinv]. contradiction (@nonzeroax R). etrans. { apply pathsinv0, (@id_mat_ii R). } do 2 (apply toforallpaths in isrightinv; specialize (isrightinv i)). etrans. { apply pathsinv0, isrightinv. } refine (toforallpaths _ _ _ _ i). apply (@zero_row_product R). apply zero_row. 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.