# A Morse Function with Minimum Number of Critical Points

Let $$M$$ be a closed manifold. If $$f$$ is a Morse function on $$M$$, then by Morse inequalities we know that $$f$$ must have at least $$\sum_i\beta_i(M;\mathbb{Z}_2)$$ critical points. When is it possible to find such a function with exactly this number of critical points? If one can find such a function, then the boundary maps in the Morse complex must be zero. Does there exist any sort of topological property that can prevent from boundary maps being zero?

For instance, on a closed surface, this is possible since if we take a Morse function with only one max point and one min point, then the boundary maps in the Morse complex must be zero and we have $$\beta_1(M;\mathbb{Z}_2)$$ critical points of index $$1$$, one with zero index and one with index $$2$$.

Permit me to talk about the Morse complex over $$\mathbb {Z}$$. For $$\mathbb{Z}_2$$ a similar argument works.
Simple examples of manifold which will never have perfect Morse functions can be made as follows: Take a group $$G$$, whose abelianization is trivial. Construct a manifold $$M$$, with fundamental group $$G$$ (This is always possible if $$G$$ is finitely presented group for a manifold $$M$$ of dimension $$4$$). Then $$H_1(M;\mathbb{Z})=G_{\mathrm{ab}}=0$$. A perfect Morse function would not have critical points of index $$1$$. But since $$\pi_1(M)=G$$, this cannot be the case.