proposition: Lemma leading_entry_compute_impl {n : nat} (v : Vector F n) (i_1 : ⟦ n ⟧%stn) (e_1 : leading_entry_compute_internal v (n,, natgthsnn _) = just i_1) : ∑ (i_2 : ⟦ n ⟧%stn), leading_entry_compute_dual_internal (λ i : ⟦ n ⟧%stn, v (dualelement i)) (n,, natgthsnn _) = just i_2.
proof: Proof. unfold leading_entry_compute_internal in * |-. destruct (leading_entry_compute_dual_internal (λ i : (⟦ n ⟧)%stn, _) (n,, natgthsnn _)) as [s | contr]. - assert (e_2 : dualelement s = i_1). { apply just_injectivity. apply e_1. } apply dualelement_eq in e_2; rewrite e_2. exists s; now rewrite e_2. - unfold just, nothing in e_1. contradiction (negpathsii1ii2 i_1 tt). apply pathsinv0, e_1. Defined.
imports: UniMath.Foundations.PartA UniMath.Foundations.NaturalNumbers UniMath.MoreFoundations.PartA UniMath.MoreFoundations.Nat UniMath.MoreFoundations.Tactics UniMath.Combinatorics.StandardFiniteSets UniMath.Combinatorics.FiniteSequences UniMath.Combinatorics.Vectors UniMath.Combinatorics.Maybe UniMath.Algebra.BinaryOperations UniMath.Algebra.IteratedBinaryOperations UniMath.Algebra.RigsAndRings UniMath.Algebra.Matrix UniMath.Algebra.Domains_and_Fields UniMath.Algebra.GaussianElimination.Auxiliary UniMath.Algebra.GaussianElimination.Vectors UniMath.Algebra.GaussianElimination.Matrices UniMath.Algebra.GaussianElimination.RowOps