proposition: Lemma back_sub_inv0 { n : nat } (mat : Matrix F n n) (b : Vector F n) (ut : @is_upper_triangular F _ _ mat) (df : @diagonal_all_nonzero F _ mat) : back_sub_stmt mat b ut df.
proof: Proof. exists (back_sub mat b). intros; unfold back_sub. destruct (natchoice0 n) as [eq0 | ?]. { apply funextfun. intros i. apply fromstn0. now rewrite eq0. } apply funextfun; intros i. apply back_sub_internal_inv2; try assumption; unfold dualelement; try easy. 2: { exact (pr2 i). } destruct (natchoice0 _) as [eq0 | ?]. { apply fromempty; now apply negpaths0sx in eq0. } simpl; now rewrite natminuseqn, minuseq0'. Defined.
imports: UniMath.MoreFoundations.PartA UniMath.MoreFoundations.Nat UniMath.MoreFoundations.Tactics UniMath.Algebra.Matrix UniMath.Algebra.Domains_and_Fields UniMath.Algebra.Matrix UniMath.Algebra.RigsAndRings UniMath.Algebra.IteratedBinaryOperations UniMath.Algebra.GaussianElimination.Auxiliary UniMath.Algebra.GaussianElimination.Vectors UniMath.Algebra.GaussianElimination.Matrices UniMath.Algebra.GaussianElimination.Elimination