proposition: Lemma joint_entropy_self : joint_entropy (fdist_self P) = `H P.
proof: Proof. congr (- _). rewrite (eq_bigr (fun a => fdist_self P (a.1, a.2) * log (fdist_self P (a.1, a.2)))); last by case. rewrite -(pair_bigA _ (fun a1 a2 => fdist_self P (a1, a2) * log (fdist_self P (a1, a2)))) /=. apply/eq_bigr => a _. rewrite (bigD1 a) //= !fdist_selfE /= eqxx big1 ?addR0 //. by move=> a' /negbTE; rewrite fdist_selfE /= eq_sym => ->; rewrite mul0R. Qed.
imports: mathcomp(all_ssreflect all_algebra fingroup perm matrix) Reals mathcomp(Rstruct) ssrR Reals_ext realType_ext ssr_ext ssralg_ext bigop_ext logb ln_facts fdist jfdist_cond proba binary_entropy_function divergence