How to show that the dimension of the output subspace $D_K$ is $m$? I have some problems with a homework question, and would appreciate if I can get some help.
Consider a single-input-single-output system
$$\dot{x} = Ax + Bu \\
y = Cx$$
and its corresponding transfer function
$$G(s) = C(sI-A)^{-1}B = \frac{s^m + b_{m-1}s^{m-1} + ...+b_0}{s^n + a_1s^{n-1}+...+ a_n},$$
where $A \in {\rm I\!R}^{n \times n}$, $B \in {\rm I\!R}^{n \times 1}$, $C \in {\rm I\!R}^{1 \times n}$. The relative degree $r = n - m$ is the excess degree of the denominator compared to the numerator.
Let $u = Kx$. Then the collection of all initial states such that $y(t) = 0$, denoted by $D_K = \{x_0: Ce^{(A+BK)t}x_0 = 0 \; \forall t\}$ is a subspace in ${\rm I\!R}^n$. Show that there is a solution $K$ such that the dimension of $D_K$ is $m$.
I do not really understand what a dimension means in this case, and how to show the dimension of a output subspace. I have earlier shown that the Markov parameters $CA^kB = 0,\; k= 0,1,2\dots r-2 $ and $CA^{r-1}B \ne0$. Also, I know that the matrix $ \begin{bmatrix}
C\\
CA\\
\vdots \\
CA^{r-1}
\end{bmatrix}$ has full row rank.
Any help is appreciated.
EDIT: The system (A,B) is not necessarily controllable. The solution given to this question is given below. I understand everything except how this implies that $D_K$ has dimension $m$:
"We can compute that $y^{k}(t) = CA^kx(t), \; k = 0,...,r-1$ and $y^r(t) = CA^rx(t) + CA^{r-1}Bu$. Then $y(t) = 0$ implies that $CA^kx(t) = 0, \; k = 0,...,r-1$ and $u = -(CA^{r-1}B)^{-1}CA^rx(t)$, which gives that $D_K$ dimension $n-r = m$."
 A: By using the relation of the matrix exponential with the Cayley-Hamilton theorem it is also possible to write $D_K$ as
$$
D_K = \left\{x\,|\,M\,x = 0\right\},
$$
with
$$
M = 
\begin{bmatrix}
C \\ C\,(A + B\,K) \\ \vdots \\ C\,(A + B\,K)^{n-1}
\end{bmatrix}.
$$
The set $D_K$ is thus essentially equivalent to the null-space of $M$. It can also be noted that $M$ is the observability matrix associated with the pair $(A+B\,K, C)$, so for example $D_K$ would be empty if $(A+B\,K, C)$ is observable. The relation between observability (and controllability) of the state space representation and its corresponding transfer function is that if the state space representation is not observability (or controllability) then the corresponding transfer function would have one or more pole-zero-cancellations. For each pole-zero-cancellation either the observability or controllability matrix would reduce its rank by one.
When assuming that $(A,B)$ is controllable then when using pole-placement for choosing $K$ and place a subset of the poles at the zeros of the corresponding transfer function would result in $m$ pole-zero-cancellations. It can be noted that using state feedback does not alter the controllability, thus the rank of closedloop observability matrix has to become $n-m$. Or in other words the null-space of the closedloop observability matrix would be of dimension $m$.
I am not sure if this could also be shown for systems who are not controllable. I think it would still work for systems whose controllability matrix has at least a rank of $m$, but below that I suspect that it would not work. For example consider the extreme case of $B=0$.

Edit:
Given that $y^{(r)}(t) = C\,A^r x(t) + C\,A^{r-1} B\,u$ and $u = -(C\,A^{r-1} B)^{-1} C\,A^r x(t)$, it follows that $y^{(r)}(t) = 0\ \forall\ x(t) \in \mathbb{R}^n$. Here $z^{(n)}(t)$ denotes the $n\text{th}$ derivative of $z(t)$ with respect to $t$ to avoid the confusion with raising to the power. The fact that $y^{(r)}(t) = 0$ does not yet imply that $y(t) = 0$. This would only follow if all the "initial conditions"  of the output are zero, thus $y^{(k)}(t) = 0\ \forall\ k = 0,\dots,r-1$. Those time derivative are also shown to be related to each other using $y^{(k)}(t) = C\,A^k x(t), \forall\ k = 0,\dots,r-1$. Thus the zero "initial conditions" is equivalent to
$$
R =
\begin{bmatrix}
C \\ C\,A \\ \vdots \\ C\,A^{r-1}
\end{bmatrix}, \\ 
R\,x(0) = 0.
$$
The solutions for $x(0)$ which satisfy this all lie in the null-space of $R \in \mathbb{R}^{r \times n}$. It is stated that $R$ has full row rank or equivalently has a rank of $r$, therefore the null-space of $R$ should have a dimension of $n - r = m$. One might think that having $x(0)$ would only ensure that $y^{(k)}(0) = 0\ \forall\ k = 0,\dots,r-1$, but that fact that $y^{(r)}(t) = 0\ \forall\ x(t) \in \mathbb{R}^n$ ensures that $y(t) = 0$ (since none of $y^{(k)}(t)\ \forall\ k = 0,\dots,r-1$ can become non-zero) which would also imply that $x(t)$ remains in the null-space of $R$.
