Is every embedded submanifold globally a level set?

A closed submanifold $S\subset M$ of codimension $k$ is the inverse image of a regular value of a smooth map $f:M\rightarrow S^k$ if and only if it has trivial normal bundle.

One implication is explained in evgeniamerkulova's answer (and still holds with $S^k$ replaced by any other manifold of dimension $k$).

For the other one, pick a tubular neighbourhood $U$ of $S$ in $M$. Then $U$ is diffeomorphic to $S\times\mathbb{R}^k$, because $S$ has trivial normal bundle. You can now define a map $U\rightarrow \mathbb{R}^k$ by $(x,v)\mapsto v$ and extend it to $M$ by mapping the complement of $U$ to infinity. You can then approximate the resulting map by a smooth map that has $0$ as a regular value and whose zero set is $S$. (This is exercise 4.6.5 in Hirsch's Differential Topology).


Obvious necessary condition is $S$ closed. But it is not sufficient even if $S$ is compact because you have obstruction: fiber of submersion $\phi:M\to N$ at $n \in N$ has trivial normal bundle with fiber equal to $T_n (N)$. So for example if you take nontrivial line bindle on circle (=Möbius bundle) then circle can not be fiber of any submersion defined on bundle. Of course if $S$ is closed it is zero set of smooth function on $M$ by Whitney theorem; but function is not submersion.

Variation on same theme: if you take orientable manifold and submersion to orientable manifold, all fibers are orientable. So if you embed any not orientable manifold in open subset of $\mathbb R^n$ (always possible by other Whitney theorem) it cannot be fiber of submersion.

Edit for to take account Mariano S-A remark: Same proof show that $S$ is not fiber of regular value either: Because points on $M$ where $\phi$ has maximal rank is open subset $M_1 \subset M$ containing $S$. And image of $M_1$ is open subset $N_1 \subset N$ because submersion is always open. Now restrict to $\phi_1:M_1\to N_1$. Normal bundle does not change and apply preceded result for submersions.