Definition transposition_self_inverse {n} (i j : ⟦ n ⟧%stn) : transposition_fun i j ∘ transposition_fun i j = idfun _. Proof. apply funextsec; intros k; simpl; unfold transposition_fun. destruct (stn_eq_or_neq i k) as [i_eq_k | i_neq_k]; destruct (stn_eq_or_neq i j) as [i_eq_j | i_neq_j]. - now destruct i_eq_j. - now rewrite stn_eq_or_neq_refl. - destruct i_eq_j. do 2 rewrite (stn_eq_or_neq_right i_neq_k). reflexivity. - destruct (stn_eq_or_neq j k) as [j_eq_k | j_neq_k]. + now rewrite stn_eq_or_neq_refl. + rewrite (stn_eq_or_neq_right i_neq_k). rewrite (stn_eq_or_neq_right j_neq_k). reflexivity. 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.