Proof with auto with real.
induction x; intros.
simpl.
rewrite Ravg_nil.
rewrite Rmult_0_l.
rewrite Rplus_0_l.
rewrite Rmult_comm.
rewrite Rmult_assoc.
destruct y.
rewrite Ravg_nil.
rewrite Rmult_0_l...
rewrite Rinv_r...
simpl @length...
simpl @length.
simpl app.
do 2 rewrite Ravg_cons.
rewrite IHx.
rewrite app_length.
unfold Rdiv.
rewrite (Rmult_assoc (a + Ravg x * INR (length x)) ).
rewrite (Rmult_comm (/ INR (S (length x)))).
rewrite Rinv_r...
rewrite Rmult_1_r.
simpl plus.
rewrite Rmult_comm.
apply Rmult_eq_compat_l.
rewrite Rplus_assoc.
apply Rplus_eq_compat_l.
case_eq ((length x + length y)%nat); intros.
destruct x.
destruct y.
simpl.
repeat rewrite Rmult_0_r...
elimtype False.
simpl in H.
discriminate.
elimtype False.
simpl in H.
discriminate.
rewrite Rmult_comm.
rewrite <- Rmult_assoc.
rewrite Rinv_r...
Qed.

Lemma Ravg_0_inv (l: list R): Ravg l = 0 -> (forall x, In x l -> 0 <= x) -> forall x, In x l -> x = 0.
Proof with auto with real.