This is a proof from Lee's Introduction To Smooth Manifolds. I don't understand how the red part follows. The Rank Theorem will tell us that on $U$, $\Phi$ has coordinate representation:
$$\hat{\Phi}(x^1,\ldots,x^r,x^{r+1},\ldots,x^n) = (x^1,\ldots,x^r,0,\ldots,0)$$
I suppose something special happens in particular on $S \cap U$ which is that slice set mentioned. Why do $x^{r+1},\ldots,x^n$ switch from being $0$ to non-zero while $x^1,\ldots,x^r$ switch from being non-zero to $0$ on $S \cap U$?