(** This file is part of the Coquelicot formalization of real analysis in Coq: http://coquelicot.saclay.inria.fr/  Copyright (C) 2011-2015 Sylvie Boldo #<br /># Copyright (C) 2011-2015 Catherine Lelay #<br /># Copyright (C) 2011-2015 Guillaume Melquiond  This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.  This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the COPYING file for more details. *)
(** This file describes an experiment: most 18-year old French students pass an exam called Baccalaureate which ends the high school and is required for attending the university. We took the 2013 mathematics test of the scientific Baccalaureate at the same time as the students. The pdf of the test is available #<a href="https://www.lri.fr/~lelay/Bac2013/Bac_S_2013_Metropole.pdf">here</a>#. This file is dedicated to the mathematics specialty exercise, done after the exam. *)
Open Scope R_scope.
(** * Bac 2013 - Exercice 4 spécialité *)
(** 1. Exprimer v (S n) et c (S n) en fonction de v n et c n *)
Fixpoint v (n : nat) : R :=
match n with
| O => 7 / 10 * 250000
| S n => 95 / 100 * v n + 1 / 100 * c n
end
with c (n : nat) : R :=
match n with
| O => 3 / 10 * 250000
| S n => 5 / 100 * v n + 99 / 100 * c n
end.
(** 2. Définition de la matrice A *)
Definition A : matrix 2 2 :=
[[95/100, 1/100 ] ,
[ 5/100, 99/100]].
Definition X (n : nat) : matrix 2 1 :=
[[v n],[c n]].

Lemma Q2 : forall n, X (S n) = scal A (X n).
Definition P : matrix 2 2 :=
[[1,-1], [5,1]].