Let $f:M\to \Bbb{R}$ be a Morse function, where $M$ is a $k$-manifold. The index $i_{f,p}$ is defined to be the number of negative eigenvalues of the Hessian $H_f$ at the critical point $p$. For instance, let $f:\Bbb{D}^2\to\Bbb{R}$ be defined as $(x,y)\to x+y$. Then there are no critical points of this function, and the Hessian $\begin{pmatrix} 0&0\\0&0\end{pmatrix}$ has no negative eigenvalues.
The Euler characteristic of $M$ is defined to be $\sum\limits_{i=0}^n {(-1)^i T_{f,i}}$, where $T_{f,i}$ is the number of critical points of index $i$.
I wonder why this is a valid definition. For example, we know that the Euler characteristic of $\Bbb{D^2}$ is $1$. However, the map $f:\Bbb{D^2}\to\Bbb{R}$ has no critical points. Hence, according to the formula above, its Euler characteristic should come out to be $0$. Isn't this a contradiction?