proposition: Lemma polynomial_rcs : Pcode.gen C %| 'X^n - 1 <-> rcsP [set cw in C].
proof: Proof. split => [H|]. rewrite /rcsP /= => cw; rewrite inE => cwC. rewrite inE rcs_rcs_poly. move/forallP: (Pcode.P C) => /(_ (poly_rV (rcs_poly (rVpoly cw) n))). rewrite inE => /eqP ->. rewrite poly_rV_K; last by apply size_rcs_poly_old. rewrite /rcs_poly -dvdp_mod // dvdp_mull //. by move/forallP: (Pcode.P C) => /(_ cw); rewrite inE cwC => /eqP/esym. move=> H. move: (@cgen_divides_Xn_sub_1 _ _ (@Ccode.mk _ _ (Pcode.lcode0 C) H) (poly_rV (Pcode.gen C))). rewrite poly_rV_K; last by rewrite ltnW // (Pcode.size_gen C). apply. rewrite -pgen_cgen // poly_rV_K; last by rewrite ltnW // (Pcode.size_gen C). exact: (Pcode.P C). 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