Consider we have the following state equation: (n-dimensional)
$ \dot x = Ax + bu $ , $ y = cx $
how can I show that $\hat g(s)$ [transfer function] has m zeros if and only if
$ cA^i b = 0 \space\space\space for\space\space i=0,1,2,..., n-m-2$ and $\quad cA^i b \neq 0 \quad i = n - m - 1 , ... , n $.
I don't have a single clue how should I prove this, I just know that $\hat g(s) = c(sI-A)^{-1}b $.
To prove the forward path : differentiating the output consecutively $n$ times it holds true that $$\dot{y}=c\dot{x}=cAx+cbu=cAx\\ \ddot{y}=cA\dot{x}=cA(Ax+bu)=cA^2x+cAbu=cA^2x\\ \vdots \\ y^{(n-m-1)}=cA^{n-m-1}x+cA^{n-m-2}bu=cA^{n-m-1}x\\ y^{(n-m)}=cA^{n-m}x+(cA^{n-m-1}b)u\\ y^{(n-m+1)}=cA^{n-m+1}x+(cA^{n-m}b)u+(cA^{n-m-1}b)\dot{u}\\ \vdots\\ y^{(n)}=cA^{n}x+(cA^{n-1}b)u+(cA^{n-2}b)\dot{u}+\cdots+(cA^{n-m-1}b)u^{(m)}$$
Let $\chi(s)$ the characteristic polynomial of $A$ i.e. $$\chi(s):=\det(sI-A)=s^n+a_1s^{n-1}+\cdots+a_{n-1}s+a_n$$ with the property (Cayley-Hamilton theorem) that $$A^n+a_1A^{n-1}+\cdots+a_{n-1}A+a_nI=0$$ Then, multiplying each of the equations describing $y^{(n-i)}$ by $a_i$ and taking their sum we result in $$y^{(n)}+a_1y^{(n-1)}+\cdots+a_{n-1}\dot{y}+a_ny=c\left[A^n+a_1A^{n-1}+\cdots+a_{n-1}A+a_nI\right]x+\\ +c(a_mA^{n-m-1}+a_{m-1}A^{n-m}+\cdots+a_1A^{n-2}+A^{n-1})bu+c(a_{m-1}A^{n-m-1}+\cdots+a_1A^{n-3}+A^{n-2})b\dot{u}+\cdots+c(a_1A^{n-m-1}+A^{n-m})bu^{(m-1)}+(cA^{n-m-1}b)u^{(m)}$$ or equivalently $$y^{(n)}+a_1y^{(n-1)}+\cdots+a_{n-1}\dot{y}+a_ny= b_0u+b_1\dot{u}+\cdots+b_{m-1}u^{(m-1)}+b_mu^{(m)}\qquad\qquad (1)$$ with $$b_m:=cA^{n-m-1}b\\ b_{m-1}:=c(a_1A^{n-m-1}+A^{n-m})b\\ \vdots\\ b_1:=c(a_{m-1}A^{n-m-1}+\cdots+a_1A^{n-3}+A^{n-2})b\\ b_0:=c(a_mA^{n-m-1}+a_{m-1}A^{n-m}+\cdots+a_1A^{n-2}+A^{n-1})b$$ and $b_m\neq 0$. Considering the Laplace transform of both sides of (1) (with zero initial values) we obtain $$\chi(s)Y(s)=(b_ms^m+b_{m-1}s^{m-1}+\cdots+b_1s+b_0)U(s)$$ and therefore the transfer function is given by $$\frac{Y(s)}{U(s)}=\frac{b_ms^m+b_{m-1}s^{m-1}+\cdots+b_1s+b_0}{\chi(s)}$$ Thus, the numerator of the transfer function is a polynomial of order $m$ and therefore there are exactly $m$ zeros.
We have proved the if part. The reverse can also be proven with a similar reasoning and a contradiction argument i.e. if we assume that $cA^{i}b\neq 0$ for some $i=0,1,2,\cdots,n-m-2$ then repeating the same process a polynomial of order higher than $m$ will appear in the numerator of the transfer function.