Lemma dualelement_lt_to_le_s {n k : nat} (i : stn n) (p : k < n) (leh: dualelement (k,, p) < i) : dualelement (k,, istransnatlth _ _ (S n) (natgthsnn k) p) <= i. Proof. rewrite dualelement_defs_eq; rewrite dualelement_defs_eq in leh; unfold dualelement' in leh |- *; simpl in leh |- *. rewrite natminuseqn. apply natgthtogehsn in leh. rewrite pathssminus' in leh. 2: { rewrite pathssminus'. - now rewrite minussn1'. - now apply (stn_implies_ngt0 i). } assert (e : n = S (n - 1)). { change (S (n - 1)) with (1 + (n - 1)). rewrite natpluscomm. apply pathsinv0, minusplusnmm, (natlthtolehp1 _ _ (stn_implies_ngt0 i)). } now destruct (!e). Defined.
Require Import UniMath.Foundations.All. Require Import UniMath.MoreFoundations.All. Require Import UniMath.Combinatorics.Maybe. Require Import UniMath.Combinatorics.StandardFiniteSets. Require Import UniMath.Algebra.Domains_and_Fields. Require Import UniMath.Algebra.RigsAndRings.