Doubts on differentiable manifolds proof: Smooth retraction of compact manifold onto its boundary

This is from Guillemin and Pollack chapter 2.

Theorem: If $X$ is any compact manifold with boundary, then there exists no smooth map $g:X\to \partial X$ with $\partial g:\partial X\to \partial X$ the identity.

The proof proceeds by contradiction: Suppose such a $g$ exists and let $z\in \partial X$ be a regular value. They claim this follows by Sard's theorem, but I don't see why? Couldn't the boundary have measure zero (it could even be empty)?

My second question: They also claim that the codimension of $g^{-1}(z)$ in $X$ is equal to the codimension of $z\in \partial X$, and so is $\dim X-1$, but why is this true?

• The point 1) is an application of the generalization of Sard's theorem proved page $62$ : for any smooth map $f : X \to Y$, $X$ being a manifold possibly with boundary, then almost every point is a regular value of both $f$ and $f_{|\partial X}$. For the second point, this is also an application of the theorem abut transversality page $60$.
– user171326
Apr 26, 2017 at 20:04
• @N.H. thank you very much. if you would like to answer, I would be happy to accept, otherwise I would just delete this. Apr 26, 2017 at 20:20
• Sure I can make an answer. In fact I never read the book by Guillemin and Pollack but it seems to me that it's the same content as Milnor's book on differentiable topology (probably with more details).
– user171326
Apr 26, 2017 at 20:24
• @N.H. yes we are using them in tandem. Milnor doesn't have much exposition haha. Anyway, thank you for your answer. It was an error to skip the transversality section obviously. Apr 26, 2017 at 20:28
• Sure ! In fact, I'm glad the book you're reading is more detailed, since I was never sure to be able to fill rigorously the details... And now I see 50 pages where Milnor was writing 2 pages haha, but on the other hand it's a very pretty book !
– user171326
Apr 26, 2017 at 20:31

The point 1) is an application of the generalization of Sard's theorem proved page $62$ : for any smooth map $f : X \to Y$, $X$ being a manifold possibly with boundary, then almost every point is a regular value of both $f$ and $f_{|\partial X}$.
For the second point, this is also an application of the theorem concerning transversality page $60$.
• There should be some condition on $Y$ there. For example, $\dim X\geq \dim Y$ or something like that. (I don't currently have access to the book, so I can't look it up.) Apr 26, 2017 at 20:33
• @JasonDeVito : Are you sure ? If $\dim X < \dim Y$, then the image has measure zero, so almost every point is a regular value for $f$ and $f_{| \partial X}$.