proposition: Lemma rsum_rmul_tuple_pmf {C : finType} n k (Q : {fdist C}) : \sum_(t in {:k.-tuple ('rV[C]_n)}) \prod_(x <- t) (Q `^ n) x = 1.
proof: Proof. rewrite -[X in _ = X](rsum_rmul_tuple_pmf_tnth n k Q). apply eq_bigr => t _. rewrite big_tnth /= (reindex_onto (cast_ord (size_tuple t)) (cast_ord (esym (size_tuple t)))) //=; last first. move=> i _; exact/val_inj. apply eq_big => //= i. - by rewrite cast_ordK eqxx. - move=> _; by rewrite tvalK tcastE esymK. Qed.
imports: mathcomp(all_ssreflect ssralg ssrnum matrix perm) Reals Lra Classical mathcomp(Rstruct classical_sets) ssrZ ssrR Reals_ext realType_ext logb ssr_ext ssralg_ext bigop_ext fdist proba entropy aep typ_seq joint_typ_seq channel channel_code