Theorem 3.1 from Milnor's Morse Theory Milnor is in the business of proving that if $f: M \to \mathbb{R}$ is a smooth function, $a < b$, and $f^{-1} ([a,b])$ is a compact subset of $M$ containing no critical points, then $M^a$ is diffeomorphic to $M^b$, where $M^x = f^{-1} (-\infty, x]$.
In the proof, he starts by equipping $M$ with a Riemannian metric $g$ and then considering a smooth vector field $X$ such that $X = g(\nabla f, \nabla f)^{-1} \nabla f$ on $f^{-1}([a,b])$ and $X$ is compactly supported.  He then generates a maximal flow $\theta :\mathbb{R} \times M \to M$ for $X$.  He then notes that if $\theta_q(t) \in f^{-1}([a,b])$, then $\frac{d (f \circ \theta_q(t)}{dt}$ = 1, and hence the diffeomorphism $\theta_{b-a}$ takes $M^a$ diffeomorphically onto $M^b$.
I do not understand how this follows.  I understand essentially that what I'm supposed to see is that if $f(q) = a$ then I can write $f \circ \theta_q(t) = t + a$ and then taking $t = b - a$.  
I do not see why I'm justified in getting the above expression for $f \circ \theta_q(t)$, despite knowing that $(f \circ \theta_q)' (0) = 1$ (wouldn't I need to know that the derivative is 1 on some neighborhood of 0 to deduce that $f \circ \theta_q$ is locally given by the linear function?  Maybe $\theta_q$ intersects $f^{-1}([a,b])$ only at $t = 0$).
 A: Hint: What you need is a compactly supported vector field $X$ with the following properties:
\begin{eqnarray}
0\le\langle X, \text{grad} \,f \rangle \le &1& \ \text{everywhere on } M \\
\langle X, \text{grad}\,f \rangle = &1& \text{ on } f^{-1}[a,b]
\end{eqnarray}
To get $X$, start with $X_1 = \frac{\text{grad}\, f}{||\text{grad}\, f||^2}$ on $f^{-1}[a,b]$ and tone it down with a compactly supported function $\psi$ with values in $[0,1]$, $\ \psi = 1$ on an open set containing $f^{-1}[a,b]$, and $\psi=0$ on an open set containing the possible zeroes of the gradient field $\text{grad}\, f$ (the critical points of $f$). So $X= \psi \cdot X_1$. Since $X$ is compactly supported, the $1$ parameter group of diffeomorphisms associated to $X$ is globally defined
$$\theta\colon \mathbb{R} \times M \to M$$
The statement is that 
$$\theta_{b-a}(M^a)=(M^b)$$
Here are some easy checks that will prove the statement:


*

*For any $m \in M$ we have
$$\frac{d}{dt} f( \theta_t(m)) = \langle X\, (\theta_t(m)) , (\text{grad }\, f)\,(\theta_t(m))\rangle \in [0,1]$$

*For any $d \ge 0$ we have 
$$f (\theta_d(m)) - f (m)= \int_0^d \frac{d}{dt} f( \theta_t(m))\, dt \in [0,d] $$

*For any $d\ge 0$ and $m \in M$ we have
$$ 0 \le f(\theta_d(m) ) - f(m) \le d$$


*For any $d \ge 0$ we have 


\begin{eqnarray}
\theta_d(M^h) &\subset& M^{h+d} \\
\theta_{-d}(M^h) &\subset& M^{h}
\end{eqnarray}


*$$\theta_{b-a}(M^a) \subset M^b$$

*$$\theta_{-(b-a)}(f^{-1}[a,b]) \subset M^a$$
This is the only point where we need some argument. Let  and $m \in f^{-1}[b,a]$, $\ f(m) = a + \delta$ where $0 \le \delta \le b-a$. We claim that $f(\theta_{-s}(m)) = a+ \delta -s$ for all $s \in [0,\delta]$ $\tiny{\text{ the tire meets the road right here}}$. Let's check first that $\theta_{-s}(m) \in f^{-1}[a,b]$. Indeed, $f(\theta_{-s}(m)) \ge a+ \delta -s$ for all $s \ge 0$. However, for $s \in  [0,\delta]$ we get that $a+ \delta -s\ge a$, and so $f(\theta_{-s}(m) \ge a$. Moreover, $f(\theta_{-s}(m)) \le f(m) \le b$. Therefore $\theta_{-s}(m)\in [f^{-1}(a), f^{-1}(b)]$ for all $s \in [0, \delta]$. Now we obtain
$$\frac{d}{dt} f(\theta_{-s}(m)) = -1$$ for all $s \in [0, \delta]$
because $\langle X, \text{grad}\,f \rangle = 1$ on $ f^{-1}[a,b]$ and $\theta_{-s}(m)$ stays in $f^{-1}[a,b]$. Integrating we get $f(\theta_{-s}(m) = f(m)-s$ for $s \in [0, \delta]$ and in particular 
$$f(\theta_{-\delta}(m)) = f(m) - \delta = a$$
Now applying the transformation $\theta_{-(b-a-\delta)}$ to $\theta_{-\delta}(m)$ will take it to a point with a lower value of $f$, that is, still in $M^a$. Therefore $\theta_{-(b-a)}(m) \in M^a$


*$$\theta_{-(b-a)} M^b \subset M^a$$
Indeed, $\theta_{-(b-a)}(M^a) \subset M^a$ and $\theta_{-(b-a)}(f^{-1}[a,b]) \subset M^a$ so for union also. 

*Therefore we have \begin{eqnarray}
\theta_{b-a}(M^a ) &\subset& M^b \\
\theta_{-(b-a)}(M^b) &\subset& M^a
\end{eqnarray}
and so $$\theta_{b-a}(M^a) = M^b$$
