proposition: Lemma Cmod_triangle : forall x y, Cmod (x + y) <= Cmod x + Cmod y.
proof: Proof. intros x y ; rewrite /Cmod. apply Rsqr_incr_0_var. apply Rminus_le_0. unfold Rsqr ; simpl ; ring_simplify. rewrite /pow ?Rmult_1_r. rewrite ?sqrt_sqrt ; ring_simplify. replace (-2 * fst x * fst y - 2 * snd x * snd y)%R with (- (2 * (fst x * fst y + snd x * snd y)))%R by ring. rewrite Rmult_assoc -sqrt_mult. rewrite Rplus_comm. apply -> Rminus_le_0. apply Rmult_le_compat_l. apply Rlt_le, Rlt_0_2. apply Rsqr_incr_0_var. apply Rminus_le_0. rewrite /Rsqr ?sqrt_sqrt ; ring_simplify. replace (fst x ^ 2 * snd y ^ 2 - 2 * fst x * snd x * fst y * snd y + snd x ^ 2 * fst y ^ 2)%R with ( (fst x * snd y - snd x * fst y)^2)%R by ring. apply pow2_ge_0. repeat apply Rplus_le_le_0_compat ; apply Rmult_le_pos ; apply pow2_ge_0. apply sqrt_pos. apply Rplus_le_le_0_compat ; apply Rle_0_sqr. apply Rplus_le_le_0_compat ; apply Rle_0_sqr. replace (fst x ^ 2 + 2 * fst x * fst y + fst y ^ 2 + snd x ^ 2 + 2 * snd x * snd y + snd y ^ 2)%R with ((fst x + fst y)^2 + (snd x + snd y)^2)%R by ring. apply Rplus_le_le_0_compat ; apply pow2_ge_0. apply Rplus_le_le_0_compat ; apply pow2_ge_0. apply Rplus_le_le_0_compat ; apply pow2_ge_0. apply Rplus_le_le_0_compat ; apply sqrt_pos. Qed.
imports: Coq(Reals ssreflect) Rcomplements Rbar Continuity Derive Hierarchy