proposition: Lemma divides_Xn_sub_1_is_cyclic (g : {poly F}) : g %| 'X^n - 1 -> rcsP [set c : 'rV[F]_n | g %| rVpoly c].
proof: Proof. move=> gXn x. rewrite !inE => /dvdpP[/= i xig]. rewrite rcs_rcs_poly poly_rV_K; last first. rewrite /rcs_poly -ltnS -(@size_Xn_sub_1 F n erefl). by rewrite ltn_modpN0 // -size_poly_eq0 size_Xn_sub_1. by rewrite /rcs_poly -dvdp_mod // xig mulrA dvdp_mull // modpp. Qed.
imports: mathcomp(all_ssreflect ssralg poly polydiv fingroup perm) mathcomp(finalg zmodp matrix mxalgebra mxpoly polydiv vector) ssralg_ext poly_ext f2 hamming linearcode dft