proposition: Lemma reduce_reduced s : reduced s -> reduce s = rev s.
proof: Proof. move=> rs; rewrite /reduce; set S := foldr _ _ _. have ->: S = rev s; rewrite {}/S. elim: s rs => [//|[k x] s IHs]; rewrite reduced_cons /=. case/and3P=> nz_k x_notin_s rs; rewrite IHs //. rewrite rev_cons outdom_augmentE //; move: x_notin_s. by rewrite /predom map_rev mem_rev. rewrite (eq_in_filter (a2 := predT)) ?filter_predT //. by move=> kx; rewrite mem_rev /=; case/andP: rs => _ /allP /(_ kx). Qed.
imports: HB(structures) mathcomp(ssreflect ssrfun ssrbool eqtype ssrnat seq choice) mathcomp(fintype bigop order generic_quotient) mathcomp(ssralg ssrnum ssrint)