Definition back_sub_internal { n : nat } (mat : Matrix F n n) (x : Vector F n) (b : Vector F n) (sep : ⟦ S n ⟧%stn) (row : ⟦ S n ⟧%stn) : Vector F n. Proof. destruct sep as [sep p]. induction sep as [| m IH]. {exact x. } destruct (natlthorgeh (dualelement (m,, p)) row). 2: {exact x. } refine (back_sub_step (dualelement (m,, p)) mat (IH _) b). apply (istransnatlth _ _ _ (natgthsnn m) p). Defined.
Require Import UniMath.MoreFoundations.PartA. Require Import UniMath.MoreFoundations.Nat. Require Import UniMath.MoreFoundations.Tactics. Require Import UniMath.Algebra.Matrix. Require Import UniMath.Algebra.Domains_and_Fields. Require Import UniMath.Algebra.Matrix. Require Import UniMath.Algebra.RigsAndRings. Require Import UniMath.Algebra.IteratedBinaryOperations. Require Import UniMath.Algebra.GaussianElimination.Auxiliary. Require Import UniMath.Algebra.GaussianElimination.Vectors. Require Import UniMath.Algebra.GaussianElimination.Matrices. Require Import UniMath.Algebra.GaussianElimination.Elimination.