proposition: Lemma covarianceDl (X Y Z : {RV P >-> R}) : P.-integrable setT (EFin \o X) -> P.-integrable setT (EFin \o (X ^+ 2)%R) -> P.-integrable setT (EFin \o Y) -> P.-integrable setT (EFin \o (Y ^+ 2)%R) -> P.-integrable setT (EFin \o Z) -> P.-integrable setT (EFin \o (Z ^+ 2)%R) -> P.-integrable setT (EFin \o (X * Z)%R) -> P.-integrable setT (EFin \o (Y * Z)%R) -> covariance P (X \+ Y)%R Z = covariance P X Z + covariance P Y Z.
proof: Proof. move=> X1 X2 Y1 Y2 Z1 Z2 XZ1 YZ1. rewrite [LHS]covarianceE//= ?mulrDl ?compreDr// ?integrableD//. rewrite 2?expectationD//=. rewrite muleDl ?fin_num_adde_defr ?expectation_fin_num//. rewrite oppeD ?fin_num_adde_defr ?fin_numM ?expectation_fin_num//. by rewrite addeACA 2?covarianceE. Qed.
imports: mathcomp(all_ssreflect) mathcomp(ssralg poly ssrnum ssrint interval finmap) mathcomp(mathcomp_extra boolp classical_sets functions) mathcomp(cardinality) HB(structures) exp numfun lebesgue_measure lebesgue_integral reals ereal signed topology normedtype sequences esum measure exp numfun lebesgue_measure lebesgue_integral