(** 3. Diagonalisation *)
Definition Q : matrix 2 2 :=
[[1,1],[-5,1]].
Goal mult P Q = [[6,0],[0,6]].
apply (coeff_mat_ext_aux 0 0) => i j Hi Hj.
rewrite coeff_mat_bij => //.
rewrite /coeff_mat /= /mult /plus /=.
(destruct i as [ | i] ; destruct j as [ | j] ; rewrite /zero /= ; try ring) ;
(try (destruct i as [ | i]) ; try (destruct j as [ | j]) ; rewrite /zero /= ; try ring) ;
rewrite sum_Sn sum_O /= /plus /= ; ring.
Qed.
Goal mult Q P = [[6,0],[0,6]].
apply (coeff_mat_ext_aux 0 0) => i j Hi Hj.
rewrite coeff_mat_bij => //.
rewrite /coeff_mat /= /mult /plus /=.
(destruct i as [ | i] ; destruct j as [ | j] ; rewrite /zero /= ; try ring) ;
(try (destruct i as [ | i]) ; try (destruct j as [ | j]) ; rewrite /zero /= ; try ring) ;
rewrite sum_Sn sum_O /= /plus /= ; ring.
Qed.
Definition P' : matrix 2 2 :=
[[1 / 6,1 / 6],[-5 / 6,1 / 6]].

(* Specifications: *)
Lemma Q3a : mult P P' = Mone /\ mult P' P = Mone.
Definition D : matrix 2 2 := [[1,0],[0,94 / 100]].
Lemma Q3b : mult P' (mult A P) = D.
Lemma Q3c : forall n, pow_n A n = mult P (mult (pow_n D n) P').
(** 4. Terme général et limite de la suite v n *)
Lemma Q4 : forall n, v n = 1 / 6 * (1 + 5 * (94 / 100) ^ n) * v 0
+ 1 / 6 * (1 - (94 / 100) ^ n) * c 0.
Lemma lim_v : is_lim_seq v (41666 + 2 / 3).
Lemma lim_c : is_lim_seq c (208333 + 1 / 3).