Aller au contenu

10 · Diagonalisation

Intuition

Diagonaliser, c'est changer de point de vue.

Une matrice quelconque mélange les coordonnées : chaque composante du résultat dépend de toutes les composantes de l'entrée. Une matrice diagonale, au contraire, agit indépendamment sur chaque coordonnée — elle se contente de multiplier chacune par un facteur.

Diagonaliser \(\mathbf{A}\), c'est trouver une base de l'espace — celle des vecteurs propres — dans laquelle \(\mathbf{A}\) ne fait plus que dilater chaque axe. Le calcul de \(\mathbf{A}^n\), qui était inextricable, devient immédiat.

C'est l'aboutissement de tout le bloc matriciel, et l'outil mathématique derrière l'analyse en composantes principales.

1. Définition

Définition

\(\mathbf{A}\) d'ordre \(n\) est diagonalisable s'il existe une matrice inversible \(\mathbf{P}\) et une matrice diagonale \(\mathbf{D}\) telles que

\[ \mathbf{A} = \mathbf{P}\,\mathbf{D}\,\mathbf{P}^{-1} \qquad\text{équivalent à}\qquad \mathbf{D} = \mathbf{P}^{-1}\mathbf{A}\,\mathbf{P} \]
  • \(\mathbf{D}\) contient les valeurs propres sur sa diagonale ;
  • \(\mathbf{P}\) a pour colonnes les vecteurs propres correspondants, dans le même ordre.

L'ordre doit correspondre

Si la première colonne de \(\mathbf{P}\) est le vecteur propre associé à \(\lambda_2\), alors le premier coefficient de \(\mathbf{D}\) doit être \(\lambda_2\). Une permutation des colonnes de \(\mathbf P\) impose la même permutation sur \(\mathbf D\).

C'est l'erreur la plus fréquente du chapitre, et elle est indétectable si l'on ne vérifie pas.

Pourquoi ça marche. Notons \(\mathbf{p}_1,\dots,\mathbf{p}_n\) les colonnes de \(\mathbf{P}\). L'égalité \(\mathbf{AP} = \mathbf{PD}\) s'écrit colonne par colonne :

\[ \mathbf{A}\mathbf{p}_i = \lambda_i\mathbf{p}_i \]

C'est exactement la définition d'un vecteur propre. Diagonaliser revient donc littéralement à ranger les vecteurs propres en colonnes.

2. Critères de diagonalisabilité

Critère général

\(\mathbf{A}\) d'ordre \(n\) est diagonalisable si et seulement si elle possède \(n\) vecteurs propres linéairement indépendants, c'est-à-dire si et seulement si

\[ \sum_{\lambda} \dim E_\lambda = n \]

Autrement dit : pour chaque valeur propre, la multiplicité géométrique doit égaler la multiplicité algébrique.

Critère suffisant très commode

Si \(\mathbf{A}\) possède \(n\) valeurs propres distinctes, elle est diagonalisable.

La réciproque est fausse : \(\mathbf{I}_n\) est diagonale (donc diagonalisable) et n'a qu'une seule valeur propre.

Théorème spectral (admis)

Toute matrice symétrique réelle est diagonalisable, et on peut choisir \(\mathbf{P}\) orthogonale (\(\mathbf{P}^{-1} = \mathbf{P}^\top\)) : ses vecteurs propres forment une base orthonormée.

C'est le résultat qui rend l'analyse en composantes principales possible, puisqu'une matrice de covariance est symétrique.

3. Méthode complète

Les six étapes

  1. Calculer \(\chi_{\mathbf{A}}(\lambda) = \det(\mathbf{A}-\lambda\mathbf{I})\).
  2. Trouver les valeurs propres et leurs multiplicités algébriques.
  3. Vérifier : somme = trace, produit = déterminant.
  4. Pour chaque \(\lambda\), déterminer \(E_\lambda\) et sa dimension.
  5. Conclure : si \(\sum\dim E_\lambda = n\), diagonalisable ; sinon, non.
  6. Écrire \(\mathbf{P}\) (vecteurs propres en colonnes) et \(\mathbf{D}\) (valeurs propres dans le même ordre), puis calculer \(\mathbf{P}^{-1}\).

3.1 Exemple complet

\[ \mathbf{A} = \begin{pmatrix}1&2\\3&2\end{pmatrix} \]

Étapes 1 à 3. \(\operatorname{tr}=3\), \(\det=-4\), donc \(\chi(\lambda)=\lambda^2-3\lambda-4=(\lambda-4)(\lambda+1)\). Valeurs propres \(4\) et \(-1\), distinctes : diagonalisable.

Étape 4. \(\lambda=4\) : \(\begin{pmatrix}-3&2\\3&-2\end{pmatrix}\) donne \(3x=2y\), vecteur \(\binom23\). \(\lambda=-1\) : \(\begin{pmatrix}2&2\\3&3\end{pmatrix}\) donne \(y=-x\), vecteur \(\binom{1}{-1}\).

Étape 6.

\[ \mathbf{P} = \begin{pmatrix}2&1\\3&-1\end{pmatrix} \qquad \mathbf{D} = \begin{pmatrix}4&0\\0&-1\end{pmatrix} \]

\(\det\mathbf{P} = -2-3 = -5\), donc

\[ \mathbf{P}^{-1} = \frac{1}{-5}\begin{pmatrix}-1&-1\\-3&2\end{pmatrix} = \frac15\begin{pmatrix}1&1\\3&-2\end{pmatrix} \]

Vérification. Calculons \(\mathbf{PD}\) :

\[ \mathbf{PD} = \begin{pmatrix}2&1\\3&-1\end{pmatrix}\begin{pmatrix}4&0\\0&-1\end{pmatrix} = \begin{pmatrix}8&-1\\12&1\end{pmatrix} \]

puis \(\mathbf{PD}\mathbf{P}^{-1}\) :

\[ \frac15\begin{pmatrix}8&-1\\12&1\end{pmatrix}\begin{pmatrix}1&1\\3&-2\end{pmatrix} = \frac15\begin{pmatrix}8-3&8+2\\12+3&12-2\end{pmatrix} = \frac15\begin{pmatrix}5&10\\15&10\end{pmatrix} = \begin{pmatrix}1&2\\3&2\end{pmatrix} \ \checkmark \]

4. L'application principale : calculer \(\mathbf{A}^n\)

La formule

\[ \mathbf{A} = \mathbf{PDP}^{-1} \implies \boxed{\mathbf{A}^n = \mathbf{P}\,\mathbf{D}^n\,\mathbf{P}^{-1}} \]

Démonstration.

\[ \mathbf{A}^2 = (\mathbf{PDP}^{-1})(\mathbf{PDP}^{-1}) = \mathbf{PD}\underbrace{(\mathbf{P}^{-1}\mathbf{P})}_{=\mathbf{I}}\mathbf{DP}^{-1} = \mathbf{PD}^2\mathbf{P}^{-1} \]

puis récurrence immédiate. \(\blacksquare\)

Et \(\mathbf{D}^n\) est trivial : on élève chaque coefficient diagonal à la puissance \(n\).

Application à l'exemple précédent :

\[ \mathbf{A}^n = \frac15\begin{pmatrix}2&1\\3&-1\end{pmatrix} \begin{pmatrix}4^n&0\\0&(-1)^n\end{pmatrix} \begin{pmatrix}1&1\\3&-2\end{pmatrix} \]
\[ = \frac15\begin{pmatrix}2\cdot4^n + 3(-1)^n & 2\cdot4^n - 2(-1)^n\\ 3\cdot4^n - 3(-1)^n & 3\cdot4^n+2(-1)^n\end{pmatrix} \]

Vérification \(n=1\) : \(\frac15\begin{pmatrix}8-3&8+2\\12+3&12-2\end{pmatrix} = \begin{pmatrix}1&2\\3&2\end{pmatrix}\) ✓

Vérifiez toujours en \(n=0\) ou \(n=1\)

\(n=0\) doit redonner \(\mathbf{I}\), \(n=1\) doit redonner \(\mathbf{A}\). Ces deux tests attrapent la quasi-totalité des erreurs de calcul de \(\mathbf{P}^{-1}\).

5. Autres applications

5.1 Suites récurrentes couplées

Un système

\[ \begin{cases}u_{n+1} = au_n+bv_n\\ v_{n+1}=cu_n+dv_n\end{cases} \]

s'écrit \(\mathbf{X}_{n+1} = \mathbf{A}\mathbf{X}_n\), donc \(\mathbf{X}_n = \mathbf{A}^n\mathbf{X}_0\). La diagonalisation fournit la formule close.

5.2 Racine carrée d'une matrice

Si \(\mathbf{A}=\mathbf{PDP}^{-1}\) avec \(\mathbf{D}\) à coefficients positifs, on pose \(\mathbf{B} = \mathbf{P}\sqrt{\mathbf{D}}\mathbf{P}^{-1}\) où \(\sqrt{\mathbf D}\) prend la racine de chaque coefficient diagonal. Alors \(\mathbf{B}^2 = \mathbf{A}\).

5.3 Le lien avec l'ACP

Pourquoi ce chapitre revient en deuxième année

Soit un jeu de données à \(p\) variables. Sa matrice de covariance \(\mathbf{\Sigma}\) est symétrique réelle, donc diagonalisable en base orthonormée :

\[ \mathbf{\Sigma} = \mathbf{P}\mathbf{D}\mathbf{P}^\top \]
  • les vecteurs propres (colonnes de \(\mathbf P\)) sont les directions de variance maximale : les composantes principales ;
  • les valeurs propres sont les variances le long de ces directions ;
  • garder les \(k\) plus grandes valeurs propres, c'est réduire la dimension en perdant le minimum d'information.

L'analyse en composantes principales, enseignée en deuxième année dans le module ANDO23, n'est rien d'autre que ce calcul. Ce chapitre et le chapitre Probabilités 11 en sont les deux moitiés.

6. Quand ça ne marche pas

Deux causes de non-diagonalisabilité

Cause 1 — valeurs propres complexes. Sur \(\mathbb{R}\), une rotation n'a pas de direction propre. Elle est diagonalisable sur \(\mathbb{C}\) mais pas sur \(\mathbb{R}\).

Cause 2 — défaut de vecteurs propres. Même avec des valeurs propres réelles, \(m_g < m_a\) pour au moins une valeur propre. Exemple canonique : \(\begin{pmatrix}1&1\\0&1\end{pmatrix}\).

Dans le second cas, on dispose tout de même d'une forme réduite — la trigonalisation (forme de Jordan), hors programme du S1 — et de la technique du binôme avec matrice nilpotente vue au chapitre 05, qui permet malgré tout de calculer \(\mathbf{A}^n\).

Exemples traités

Exemple 1 — Ordre 3

\[ \mathbf{A} = \begin{pmatrix}3&-1&1\\-1&3&-1\\1&-1&3\end{pmatrix} \]

Cherchons les valeurs propres. La matrice est symétrique : elle est diagonalisable d'avance, il ne reste qu'à trouver les éléments propres.

Testons \(\lambda = 2\) :

\[ \mathbf{A}-2\mathbf{I} = \begin{pmatrix}1&-1&1\\-1&1&-1\\1&-1&1\end{pmatrix} \]

Les trois lignes sont proportionnelles : le rang vaut 1, donc \(\dim E_2 = 3-1 = 2\). Donc \(\lambda = 2\) est bien valeur propre, de multiplicité géométrique 2.

Par la trace : \(2+2+\lambda_3 = 9\), donc \(\lambda_3 = 5\).

Vérification par le déterminant : \(2\times2\times5 = 20\). Calcul direct par Sarrus : \(27-1-1-3-3-3 = ...\) soit \(3(9-1)+1(-3+1)+1(1-3) = 24-2-2 = 20\) ✓

Sous-espaces. \(E_2\) : équation \(x-y+z=0\).

\[ E_2 = \operatorname{Vect}\left\{\begin{pmatrix}1\\1\\0\end{pmatrix},\begin{pmatrix}1\\0\\-1\end{pmatrix}\right\} \]

\(E_5\) : \(\mathbf{A}-5\mathbf{I} = \begin{pmatrix}-2&-1&1\\-1&-2&-1\\1&-1&-2\end{pmatrix}\). En résolvant : \(x = -z\)… détaillons. \(L_1+L_3\) : \(-x-2y-z = 0\). Avec \(L_2\) : \(-x-2y-z=0\), identique. Reste \(L_1\) : \(-2x-y+z=0\). De ces deux : en soustrayant, \(-x+y+2z = 0\)… Prenons \(z = t\) : de \(-2x-y+z=0\) et \(-x-2y-z=0\), on tire \(y = z-2x\) et \(-x-2(z-2x)-z = 3x-3z = 0\), donc \(x = z\) et \(y = -z\).

\[ E_5 = \operatorname{Vect}\begin{pmatrix}1\\-1\\1\end{pmatrix} \]

Vérification : \(\mathbf{A}\begin{pmatrix}1\\-1\\1\end{pmatrix} = \begin{pmatrix}3+1+1\\-1-3-1\\1+1+3\end{pmatrix} = \begin{pmatrix}5\\-5\\5\end{pmatrix}\) ✓

\(\dim E_2 + \dim E_5 = 2+1 = 3\) : diagonalisable.

\[ \mathbf{P}=\begin{pmatrix}1&1&1\\1&0&-1\\0&-1&1\end{pmatrix} \qquad \mathbf{D}=\begin{pmatrix}2&0&0\\0&2&0\\0&0&5\end{pmatrix} \]

Exemple 2 — Suites couplées

\[ \begin{cases}u_{n+1} = u_n + 2v_n\\ v_{n+1} = 3u_n+2v_n\end{cases} \qquad u_0 = 1,\ v_0 = 0 \]

La matrice est \(\mathbf{A}=\begin{pmatrix}1&2\\3&2\end{pmatrix}\), déjà diagonalisée plus haut : \(\lambda = 4\) et \(\lambda = -1\).

D'après la formule de \(\mathbf{A}^n\) obtenue au §4 :

\[ \begin{pmatrix}u_n\\v_n\end{pmatrix} = \mathbf{A}^n\begin{pmatrix}1\\0\end{pmatrix} = \frac15\begin{pmatrix}2\cdot4^n+3(-1)^n\\ 3\cdot4^n-3(-1)^n\end{pmatrix} \]

Vérification \(n=1\) : \(u_1 = \frac{8-3}{5} = 1\) ; or \(u_1 = u_0+2v_0 = 1\) ✓ \(v_1 = \frac{12+3}{5} = 3\) ; or \(v_1 = 3u_0+2v_0 = 3\) ✓

Comportement asymptotique : \(u_n \sim \frac25 4^n\) et \(v_n\sim\frac35 4^n\), donc \(\frac{v_n}{u_n}\to\frac32\). Le rapport converge vers la direction du vecteur propre dominant \(\binom23\).

Exemple 3 — Une matrice non diagonalisable

\[ \mathbf{A} = \begin{pmatrix}2&1&0\\0&2&1\\0&0&2\end{pmatrix} \]

Triangulaire : unique valeur propre \(\lambda=2\), de multiplicité algébrique 3.

\[ \mathbf{A}-2\mathbf{I} = \begin{pmatrix}0&1&0\\0&0&1\\0&0&0\end{pmatrix} \]

Le système donne \(y=0\) et \(z=0\) : \(E_2 = \operatorname{Vect}(1,0,0)^\top\), de dimension 1.

\(1 < 3\) : non diagonalisable.

Calcul de \(\mathbf{A}^n\) malgré tout. Posons \(\mathbf{A} = 2\mathbf{I}+\mathbf{N}\) avec \(\mathbf{N}^3 = \mathbf{0}\). Comme \(2\mathbf I\) commute avec tout :

\[ \mathbf{A}^n = \sum_{k=0}^{2}\binom nk (2)^{n-k}\mathbf{N}^k = 2^n\mathbf{I} + n2^{n-1}\mathbf{N} + \binom n2 2^{n-2}\mathbf{N}^2 \]
\[ = \begin{pmatrix} 2^n & n2^{n-1} & \frac{n(n-1)}{2}2^{n-2}\\ 0 & 2^n & n2^{n-1}\\ 0&0&2^n \end{pmatrix} \]

Vérification \(n=2\) : coefficient \((1,3)\) vaut \(\frac{2\cdot1}{2}\cdot1 = 1\). Calcul direct : \(\mathbf{A}^2\) a bien 1 en position \((1,3)\) (\(2\times0 + 1\times1 + 0\times2 = 1\)) ✓

Erreurs fréquentes

Erreur Correction
Ordre des colonnes de \(\mathbf P\) ≠ ordre de \(\mathbf D\) Correspondance stricte
Conclure « diagonalisable » sans vérifier \(\dim E_\lambda\) Nécessaire si \(m_a > 1\)
\(\mathbf{A}^n = \mathbf{P}^{-1}\mathbf{D}^n\mathbf{P}\) C'est \(\mathbf{PD}^n\mathbf{P}^{-1}\)
Oublier que \(\mathbf{P}\) n'est pas unique Toute base de vecteurs propres convient
Ne pas vérifier en \(n=1\) Erreur non détectée

Exercices

★ Exercice 1. Diagonaliser, en donnant \(\mathbf{P}\), \(\mathbf{D}\) et \(\mathbf{P}^{-1}\).

a) \(\begin{pmatrix}2&0\\1&3\end{pmatrix}\) b) \(\begin{pmatrix}1&4\\2&3\end{pmatrix}\)

★ Exercice 2. Ces matrices sont-elles diagonalisables ? Justifier sans calcul complet quand c'est possible.

a) \(\begin{pmatrix}1&2&3\\0&4&5\\0&0&6\end{pmatrix}\) b) \(\begin{pmatrix}3&1\\0&3\end{pmatrix}\) c) \(\begin{pmatrix}1&2\\2&1\end{pmatrix}\) d) \(\begin{pmatrix}0&-1\\1&0\end{pmatrix}\) (sur \(\mathbb{R}\))

★★ Exercice 3. Soit \(\mathbf{A}=\begin{pmatrix}5&-3\\6&-4\end{pmatrix}\).

a) Diagonaliser \(\mathbf{A}\). b) Calculer \(\mathbf{A}^n\). c) Vérifier pour \(n=1\) et \(n=2\).

★★ Exercice 4. Soit \(\mathbf{A}=\begin{pmatrix}2&1&1\\1&2&1\\1&1&2\end{pmatrix}\).

a) Montrer que \(\mathbf{A} = \mathbf{J}+\mathbf{I}\) où \(\mathbf J\) est la matrice de 1 partout. b) En déduire valeurs propres et sous-espaces propres. c) Diagonaliser.

★★★ Exercice 5. Soit \((u_n)\) et \((v_n)\) définies par

\[ \begin{cases}u_{n+1} = 4u_n - 2v_n\\ v_{n+1} = u_n + v_n\end{cases} \qquad u_0=1,\ v_0=1 \]

Déterminer les expressions closes de \(u_n\) et \(v_n\).

★★★ Exercice 6. Soit \(\mathbf{A}\) diagonalisable avec \(\mathbf{A}=\mathbf{PDP}^{-1}\).

a) Montrer que \(\mathbf{A}\) et \(\mathbf{D}\) ont même trace, même déterminant, même polynôme caractéristique. b) Montrer que \(\mathbf{A}^k = \mathbf{0}\) pour un certain \(k\) implique \(\mathbf{A}=\mathbf{0}\). c) En déduire qu'une matrice nilpotente non nulle n'est jamais diagonalisable.

★★★ Exercice 7. On considère la suite de Fibonacci sous forme matricielle, \(\mathbf{F} = \begin{pmatrix}1&1\\1&0\end{pmatrix}\).

a) Diagonaliser \(\mathbf{F}\) (les valeurs propres ont été trouvées à l'exercice 9 du chapitre 09). b) En déduire \(\mathbf{F}^n\) et retrouver la formule de Binet. c) Comparer cette dérivation avec celle de l'exercice 9c du chapitre 09.

★★★★ Exercice 8. Une matrice \(\mathbf{A}\) vérifie \(\mathbf{A}^2 = \mathbf{A}\) (projecteur) et \(\mathbf{A}\neq\mathbf{I}\), \(\mathbf{A}\neq\mathbf{0}\).

a) Montrer que \(\mathbf{A}\) est diagonalisable. Indication : montrer que tout vecteur \(\mathbf x\) se décompose en \(\mathbf{Ax} + (\mathbf{x}-\mathbf{Ax})\) et identifier les deux morceaux. b) Quelle est la forme de \(\mathbf{D}\) ? c) En déduire que \(\operatorname{tr}\mathbf{A}\) est un entier, égal au rang de \(\mathbf{A}\).

★★★★ Exercice 9. Un modèle de population distingue jeunes (\(j_n\)) et adultes (\(a_n\)) :

\[ \begin{cases} j_{n+1} = 2a_n\\ a_{n+1} = 0{,}3\,j_n + 0{,}8\,a_n \end{cases} \]

a) Écrire la matrice de Leslie \(\mathbf{L}\) et déterminer ses valeurs propres. b) La population croît-elle ou décroît-elle à long terme ? c) Vers quelle proportion jeunes/adultes tend-elle ? d) Quel taux de survie des jeunes (au lieu de 0,3) rendrait la population stationnaire ?

★★★★ Exercice 10 — lien informatique. L'analyse en composantes principales diagonalise une matrice de covariance \(\mathbf{\Sigma}\) d'ordre \(p\).

a) Pourquoi \(\mathbf{\Sigma}\) est-elle toujours diagonalisable ? b) Pourquoi ses valeurs propres sont-elles toujours positives ou nulles ? Indication : \(\mathbf{\Sigma} = \frac1n\mathbf{X}^\top\mathbf{X}\) pour des données centrées ; calculez \(\mathbf{v}^\top\mathbf{\Sigma}\mathbf{v}\). c) La « part de variance expliquée » par la \(k\)-ième composante est \(\lambda_k / \sum_i\lambda_i\). Justifier cette formule à partir de la trace. d) On dispose de \(p = 10^4\) variables et \(n = 100\) observations. Quel est le rang maximal de \(\mathbf{\Sigma}\) ? Combien de composantes principales non triviales peut-on espérer ?


Corrigés

Corrigé — Exercice 1

a) Triangulaire : valeurs propres \(2\) et \(3\), distinctes donc diagonalisable.

\(\lambda=2\) : \(\begin{pmatrix}0&0\\1&1\end{pmatrix}\) donne \(y=-x\), vecteur \(\binom{1}{-1}\). \(\lambda=3\) : \(\begin{pmatrix}-1&0\\1&0\end{pmatrix}\) donne \(x=0\), vecteur \(\binom01\).

\[ \mathbf{P}=\begin{pmatrix}1&0\\-1&1\end{pmatrix},\quad \mathbf{D}=\begin{pmatrix}2&0\\0&3\end{pmatrix},\quad \mathbf{P}^{-1}=\begin{pmatrix}1&0\\1&1\end{pmatrix} \]

b) \(\operatorname{tr}=4\), \(\det=3-8=-5\). \(\chi(\lambda)=\lambda^2-4\lambda-5=(\lambda-5)(\lambda+1)\).

\(\lambda=5\) : \(\begin{pmatrix}-4&4\\2&-2\end{pmatrix}\) donne \(y=x\), vecteur \(\binom11\). \(\lambda=-1\) : \(\begin{pmatrix}2&4\\2&4\end{pmatrix}\) donne \(x=-2y\), vecteur \(\binom{2}{-1}\).

\[ \mathbf{P}=\begin{pmatrix}1&2\\1&-1\end{pmatrix},\quad \mathbf{D}=\begin{pmatrix}5&0\\0&-1\end{pmatrix},\quad \mathbf{P}^{-1}=\frac{1}{-3}\begin{pmatrix}-1&-2\\-1&1\end{pmatrix} = \frac13\begin{pmatrix}1&2\\1&-1\end{pmatrix} \]
Corrigé — Exercice 2

a) Oui. Triangulaire, valeurs propres \(1\), \(4\), \(6\) — trois valeurs distinctes en dimension 3.

b) Non. Unique valeur propre 3, de multiplicité algébrique 2. Or \(\mathbf{A}-3\mathbf{I}=\begin{pmatrix}0&1\\0&0\end{pmatrix}\) est non nulle, donc \(\dim E_3 = 1 < 2\).

c) Oui. Matrice symétrique réelle (théorème spectral). Valeurs propres \(3\) et \(-1\), d'ailleurs distinctes.

d) Non sur \(\mathbb{R}\). \(\chi(\lambda)=\lambda^2+1\) n'a pas de racine réelle. Elle est diagonalisable sur \(\mathbb{C}\), avec valeurs propres \(\pm i\).

Corrigé — Exercice 3

a) \(\operatorname{tr}=1\), \(\det=-20+18=-2\). \(\chi(\lambda)=\lambda^2-\lambda-2 = (\lambda-2)(\lambda+1)\).

\(\lambda=2\) : \(\begin{pmatrix}3&-3\\6&-6\end{pmatrix}\) donne \(y=x\), vecteur \(\binom11\). \(\lambda=-1\) : \(\begin{pmatrix}6&-3\\6&-3\end{pmatrix}\) donne \(y=2x\), vecteur \(\binom12\).

\[ \mathbf{P}=\begin{pmatrix}1&1\\1&2\end{pmatrix},\quad \mathbf{D}=\begin{pmatrix}2&0\\0&-1\end{pmatrix},\quad \mathbf{P}^{-1}=\begin{pmatrix}2&-1\\-1&1\end{pmatrix} \]

(\(\det\mathbf{P}=1\).)

b)

\[ \mathbf{A}^n = \begin{pmatrix}1&1\\1&2\end{pmatrix} \begin{pmatrix}2^n&0\\0&(-1)^n\end{pmatrix} \begin{pmatrix}2&-1\\-1&1\end{pmatrix} \]
\[ = \begin{pmatrix}2^n&(-1)^n\\2^n&2(-1)^n\end{pmatrix} \begin{pmatrix}2&-1\\-1&1\end{pmatrix} = \begin{pmatrix} 2^{n+1}-(-1)^n & -2^n+(-1)^n\\ 2^{n+1}-2(-1)^n & -2^n+2(-1)^n \end{pmatrix} \]

c) \(n=1\) : \(\begin{pmatrix}4+1&-2-1\\4+2&-2-2\end{pmatrix} = \begin{pmatrix}5&-3\\6&-4\end{pmatrix}\) ✓

\(n=2\) : \(\begin{pmatrix}8-1&-4+1\\8-2&-4+2\end{pmatrix} = \begin{pmatrix}7&-3\\6&-2\end{pmatrix}\).

Calcul direct : \(\mathbf{A}^2 = \begin{pmatrix}25-18&-15+12\\30-24&-18+16\end{pmatrix} = \begin{pmatrix}7&-3\\6&-2\end{pmatrix}\) ✓

Corrigé — Exercice 4

a) Évident : \(\mathbf{J}\) a des 1 partout, ajouter \(\mathbf{I}\) ajoute 1 sur la diagonale, ce qui donne des 2 en diagonale et des 1 ailleurs ✓

b) Les valeurs propres de \(\mathbf{J}\) sont \(3\) (multiplicité 1) et \(0\) (multiplicité 2) — exercice 3 du chapitre 09.

Donc celles de \(\mathbf{A} = \mathbf{J}+\mathbf{I}\) sont

\[ 3+1 = 4 \ (\text{mult. } 1) \qquad 0+1 = 1 \ (\text{mult. } 2) \]

avec les mêmes vecteurs propres.

\[ E_4 = \operatorname{Vect}\begin{pmatrix}1\\1\\1\end{pmatrix} \qquad E_1 = \operatorname{Vect}\left\{\begin{pmatrix}1\\-1\\0\end{pmatrix},\begin{pmatrix}1\\0\\-1\end{pmatrix}\right\} \]

Vérification trace : \(4+1+1 = 6 = 2+2+2\) ✓

c) \(1+2 = 3\) : diagonalisable.

\[ \mathbf{P}=\begin{pmatrix}1&1&1\\1&-1&0\\1&0&-1\end{pmatrix}, \qquad \mathbf{D}=\begin{pmatrix}4&0&0\\0&1&0\\0&0&1\end{pmatrix} \]
Corrigé — Exercice 5

\(\mathbf{A}=\begin{pmatrix}4&-2\\1&1\end{pmatrix}\), \(\operatorname{tr}=5\), \(\det=4+2=6\).

\[ \chi(\lambda)=\lambda^2-5\lambda+6=(\lambda-2)(\lambda-3) \]

\(\lambda=2\) : \(\begin{pmatrix}2&-2\\1&-1\end{pmatrix}\) donne \(y=x\), vecteur \(\binom11\). \(\lambda=3\) : \(\begin{pmatrix}1&-2\\1&-2\end{pmatrix}\) donne \(x=2y\), vecteur \(\binom21\).

Décomposons \(\mathbf{X}_0 = \binom11\) dans la base propre :

\[ \binom11 = \alpha\binom11+\beta\binom21 \]

donne \(\alpha+2\beta = 1\) et \(\alpha+\beta=1\), d'où \(\beta=0\) et \(\alpha=1\).

\(\mathbf{X}_0\) est déjà un vecteur propre ! Donc

\[ \mathbf{X}_n = 2^n\binom11 \qquad\text{soit}\qquad u_n = v_n = 2^n \]

Vérification : \(u_1 = 4(1)-2(1) = 2\) ✓ et \(v_1 = 1+1 = 2\) ✓ \(u_2 = 8-4 = 4\) ✓

Le cas favorable

Quand la condition initiale est un vecteur propre, la suite reste sur la même direction et la solution est une simple géométrique. Toujours vérifier ce cas avant de se lancer dans \(\mathbf{A}^n\) complet.

Corrigé — Exercice 6

a) \(\operatorname{tr}(\mathbf{A}) = \operatorname{tr}(\mathbf{PDP}^{-1}) = \operatorname{tr}(\mathbf{DP}^{-1}\mathbf{P}) = \operatorname{tr}(\mathbf{D})\) en utilisant \(\operatorname{tr}(\mathbf{MN})=\operatorname{tr}(\mathbf{NM})\).

\(\det\mathbf{A} = \det\mathbf{P}\det\mathbf{D}\det\mathbf{P}^{-1} = \det\mathbf{D}\).

\(\chi_{\mathbf A}(\lambda) = \det(\mathbf{PDP}^{-1}-\lambda\mathbf{I}) = \det\big(\mathbf{P}(\mathbf{D}-\lambda\mathbf{I})\mathbf{P}^{-1}\big) = \det(\mathbf{D}-\lambda\mathbf{I}) = \chi_{\mathbf D}(\lambda)\). \(\blacksquare\)

b) \(\mathbf{A}^k = \mathbf{PD}^k\mathbf{P}^{-1} = \mathbf{0}\) implique \(\mathbf{D}^k = \mathbf{0}\) (en multipliant à gauche par \(\mathbf{P}^{-1}\) et à droite par \(\mathbf{P}\)).

Or \(\mathbf{D}^k\) est diagonale de coefficients \(\lambda_i^k\). Tous nuls signifie \(\lambda_i = 0\) pour tout \(i\), donc \(\mathbf{D}=\mathbf{0}\), donc \(\mathbf{A} = \mathbf{P}\mathbf{0}\mathbf{P}^{-1} = \mathbf{0}\). \(\blacksquare\)

c) Par contraposée de b) : si \(\mathbf{N}\) est nilpotente et non nulle, elle ne peut pas être diagonalisable. \(\blacksquare\)

Interprétation

Une matrice nilpotente a toutes ses valeurs propres nulles. Si elle était diagonalisable, elle serait semblable à la matrice nulle, donc nulle. Les matrices nilpotentes non nulles sont donc l'exemple type de la non-diagonalisabilité.

Corrigé — Exercice 7

a) Valeurs propres \(\varphi = \frac{1+\sqrt5}{2}\) et \(\psi=\frac{1-\sqrt5}{2}\), vecteurs propres \(\binom\varphi1\) et \(\binom\psi1\).

\[ \mathbf{P}=\begin{pmatrix}\varphi&\psi\\1&1\end{pmatrix},\quad \mathbf{D}=\begin{pmatrix}\varphi&0\\0&\psi\end{pmatrix} \]

\(\det\mathbf{P}=\varphi-\psi=\sqrt5\), donc

\[ \mathbf{P}^{-1}=\frac{1}{\sqrt5}\begin{pmatrix}1&-\psi\\-1&\varphi\end{pmatrix} \]

b)

\[ \mathbf{F}^n = \frac{1}{\sqrt5}\begin{pmatrix}\varphi&\psi\\1&1\end{pmatrix} \begin{pmatrix}\varphi^n&0\\0&\psi^n\end{pmatrix} \begin{pmatrix}1&-\psi\\-1&\varphi\end{pmatrix} \]
\[ = \frac{1}{\sqrt5}\begin{pmatrix}\varphi^{n+1}&\psi^{n+1}\\\varphi^n&\psi^n\end{pmatrix} \begin{pmatrix}1&-\psi\\-1&\varphi\end{pmatrix} \]

Le coefficient \((2,1)\) vaut \(\frac{\varphi^n-\psi^n}{\sqrt5}\). Or on sait que \((\mathbf{F}^n)_{21} = F_n\) (chapitre 05, exercice 10). D'où

\[ F_n = \frac{\varphi^n-\psi^n}{\sqrt5} \]

la formule de Binet. \(\blacksquare\)

c) Au chapitre 09, la formule \(F_n = \alpha\varphi^n+\beta\psi^n\) était admise puis les constantes ajustées. Ici, elle est démontrée : elle sort du calcul de \(\mathbf{F}^n\), sans hypothèse préalable sur la forme de la solution.

C'est la valeur ajoutée de la diagonalisation : elle explique pourquoi les suites récurrentes linéaires ont une forme exponentielle — les exposants sont les valeurs propres.

Corrigé — Exercice 8

a) Soit \(\mathbf{x}\) quelconque. Écrivons

\[ \mathbf{x} = \underbrace{\mathbf{Ax}}_{\mathbf{y}} + \underbrace{(\mathbf{x}-\mathbf{Ax})}_{\mathbf{z}} \]
  • \(\mathbf{A}\mathbf{y} = \mathbf{A}^2\mathbf{x} = \mathbf{Ax} = \mathbf{y}\) : \(\mathbf{y}\in E_1\) ;
  • \(\mathbf{A}\mathbf{z} = \mathbf{Ax}-\mathbf{A}^2\mathbf{x} = \mathbf{Ax}-\mathbf{Ax} = \mathbf{0}\) : \(\mathbf{z}\in E_0\).

Tout vecteur se décompose donc en somme d'un élément de \(E_1\) et d'un élément de \(E_0\). En prenant une base de \(E_1\) et une base de \(E_0\), on obtient une base de l'espace entier formée de vecteurs propres.

Donc \(\dim E_0 + \dim E_1 = n\) : \(\mathbf{A}\) est diagonalisable. \(\blacksquare\)

(L'intersection est réduite à \(\{\mathbf 0\}\) : si \(\mathbf{x}\in E_0\cap E_1\) alors \(\mathbf x = \mathbf{Ax} = \mathbf 0\).)

b) \(\mathbf{D}\) est diagonale avec uniquement des 0 et des 1 :

\[ \mathbf{D} = \begin{pmatrix}\mathbf{I}_r&\mathbf{0}\\\mathbf{0}&\mathbf{0}\end{pmatrix} \]

où \(r = \dim E_1\).

c) \(\operatorname{tr}\mathbf{A} = \operatorname{tr}\mathbf{D} = r\), entier.

De plus, \(\mathbf{A}\) et \(\mathbf{D}\) ont même rang (matrices semblables), et \(\operatorname{rang}\mathbf{D} = r\). Donc

\[ \operatorname{tr}\mathbf{A} = \operatorname{rang}\mathbf{A} \]

\(\blacksquare\)

Un résultat surprenant

Pour un projecteur, la trace — quantité a priori réelle quelconque — est forcément un entier, et c'est la dimension de l'image. C'est le genre de résultat qui rend la diagonalisation utile : une propriété difficile à voir sur \(\mathbf{A}\) devient évidente sur \(\mathbf{D}\).

Corrigé — Exercice 9

a) \(\mathbf{L}=\begin{pmatrix}0&2\\0{,}3&0{,}8\end{pmatrix}\).

\(\operatorname{tr}=0{,}8\), \(\det = 0 - 0{,}6 = -0{,}6\).

\[ \chi(\lambda)=\lambda^2-0{,}8\lambda-0{,}6 \]

\(\Delta = 0{,}64+2{,}4 = 3{,}04\), \(\sqrt\Delta\approx1{,}7436\).

\[ \lambda_1 = \frac{0{,}8+1{,}7436}{2}\approx 1{,}2718 \qquad \lambda_2 = \frac{0{,}8-1{,}7436}{2}\approx -0{,}4718 \]

b) \(\lambda_1 \approx 1{,}27 > 1\) : la population croît exponentiellement, d'environ 27 % par génération.

c) La proportion tend vers la direction du vecteur propre dominant. Pour \(\lambda_1\) :

\[ \mathbf{L}-\lambda_1\mathbf{I} = \begin{pmatrix}-1{,}2718&2\\0{,}3&-0{,}4718\end{pmatrix} \]

La première ligne donne \(j = \frac{2}{1{,}2718}a \approx 1{,}573\,a\).

À long terme, il y a environ 1,57 jeune pour 1 adulte, soit 61 % de jeunes et 39 % d'adultes.

Vérification par la seconde ligne : \(0{,}3(1{,}573) = 0{,}472\), et \(0{,}4718\times1 = 0{,}472\) ✓

d) On cherche \(s\) tel que \(\lambda_1 = 1\), c'est-à-dire \(\chi(1) = 0\) :

\[ 1 - 0{,}8 - 2s = 0 \implies s = 0{,}1 \]

Avec un taux de survie des jeunes de 0,1 au lieu de 0,3, la population serait stationnaire.

Vérification : \(\mathbf{L}=\begin{pmatrix}0&2\\0{,}1&0{,}8\end{pmatrix}\), \(\det = -0{,}2\), \(\chi(\lambda)=\lambda^2-0{,}8\lambda-0{,}2\), et \(\chi(1) = 1-0{,}8-0{,}2 = 0\) ✓

Corrigé — Exercice 10

a) \(\mathbf{\Sigma}\) est symétrique réelle : sa définition \(\Sigma_{ij}=\operatorname{Cov}(X_i,X_j)\) est symétrique par symétrie de la covariance. Le théorème spectral s'applique.

b) Avec \(\mathbf{\Sigma}=\frac1n\mathbf{X}^\top\mathbf{X}\) pour des données centrées, soit \(\mathbf{v}\) un vecteur quelconque :

\[ \mathbf{v}^\top\mathbf{\Sigma}\mathbf{v} = \frac1n\mathbf{v}^\top\mathbf{X}^\top\mathbf{X}\mathbf{v} = \frac1n(\mathbf{Xv})^\top(\mathbf{Xv}) = \frac1n\lVert\mathbf{Xv}\rVert^2 \geqslant 0 \]

Si \(\mathbf{v}\) est un vecteur propre associé à \(\lambda\), alors

\[ \mathbf{v}^\top\mathbf{\Sigma}\mathbf{v} = \lambda\lVert\mathbf{v}\rVert^2 \geqslant 0 \implies \lambda \geqslant 0 \]

\(\blacksquare\)

On dit que \(\mathbf{\Sigma}\) est semi-définie positive.

c) La trace de \(\mathbf{\Sigma}\) est la somme de ses coefficients diagonaux, c'est-à-dire la somme des variances de chaque variable — la variance totale du nuage.

Or la trace est aussi la somme des valeurs propres. Donc

\[ \text{variance totale} = \sum_i \lambda_i \]

et \(\lambda_k\) est la variance portée par la \(k\)-ième composante principale. Le rapport \(\lambda_k/\sum\lambda_i\) est donc bien la fraction de variance expliquée. \(\blacksquare\)

d) \(\mathbf{\Sigma}=\frac1n\mathbf{X}^\top\mathbf{X}\) avec \(\mathbf{X}\) de taille \(n\times p = 100\times10^4\).

Le rang d'un produit est majoré par le rang de chaque facteur :

\[ \operatorname{rang}\mathbf{\Sigma} \leqslant \operatorname{rang}\mathbf{X} \leqslant \min(n,p) = 100 \]

Et comme les données sont centrées, une relation linéaire supplémentaire existe entre les lignes : le rang est en fait au plus \(n-1 = 99\).

Au plus 99 valeurs propres non nulles sur \(10^4\). Les \(9901\) autres sont exactement nulles.

La malédiction de la dimension

Avec plus de variables que d'observations, la matrice de covariance est massivement singulière. Toute méthode qui suppose \(\mathbf{\Sigma}\) inversible — analyse discriminante classique, régression linéaire ordinaire — échoue.

C'est précisément la situation qui motive les méthodes de régression régularisée (ridge, lasso) enseignées en deuxième année dans le module MERR23 : on ajoute \(\lambda\mathbf{I}\) à \(\mathbf{\Sigma}\) pour la rendre inversible, ce qui revient à décaler toutes les valeurs propres de \(\lambda\).


Chapitre suivant : Divisibilité et PGCD.