---
jupytext:
  formats: md:myst
  text_representation:
    extension: .md
    format_name: myst
    format_version: '0.8'
    jupytext_version: 1.4.1+dev
kernelspec:
  display_name: Python 3
  language: python
  name: python3
---

+++

(section:uge11L-extra)=
# Extra (optional) exercises -- Short Day

+++

These exercises are optional extra material for students who have finished the exercises of the day and have the time and interest for more.

+++

## Extra exercise 1: Cayley-Hamilton for diagonalisable matrices

+++

For a given polynomial $p(Z) =a_0Z^0+a_1Z+\cdots+a_dZ^d \in \mathbb{F}[Z]$ and a square matrix $\mathbf A \in \mathbb{F}^{n \times n}$ we define

$$p(\mathbf A)=a_0 \mathbf{I}_n+a_1 \mathbf{A}+\cdots+a_d \mathbf{A}^d \in \mathbb{F}^{n \times n}.$$

+++

### Question a

+++

Let $p_1(Z)$ and $p_2(Z)$ be two polynomials from $\mathbb{F}[Z]$. Show that $p_1(\mathbf A)\cdot p_2(\mathbf A)=p_2(\mathbf A)\cdot p_1(\mathbf A)$.

```{hint}
:class: dropdown
The key here is that $a_i \mathbf A^i \cdot b_j \mathbf A^j=b_j \mathbf A^j \cdot a_i \mathbf A^i$ holds for all non-negative integers $i,j$ and all constants $a_i,b_j \in \mathbb{F}$. First, check this claim.
```

+++

### Question b

+++

Now assume that $\mathbf A$ can be diagonalised and that $(\mathbf v_1,\dots,\mathbf v_n)$ is an ordered basis for $\mathbb F^n$ consisting of eigenvectors. The characteristic polynomial of $\mathbf A$ is denoted by $p_{\mathbf A}(Z)$ as usual. Show that 

$$p_{\mathbf A}(\mathbf A) \cdot \mathbf v_i=\mathbf 0 \quad \text{for all $i$ from $1$ to $n$}.$$


```{hint}
:class: dropdown
Corollary 12.3.4 in the textbook describes precisely how the characteristic polynomial of $\mathbf A$ will look. 
```

+++

### Question c

+++

Based on your answer to Question b, conclude that $p_{\mathbf A}(\mathbf A)=\mathbf 0$. In other words, conclude that $p_{\mathbf A}(\mathbf A)$ is the zero matrix. 

Remark: In fact, $p_{\mathbf A}(\mathbf A)=\mathbf 0$ holds for every square matrix. This result is known as the *Cayley-Hamilton theorem*.

