Is every embedded submanifold globally a level set?

It’s a well-known theorem (Corollary 8.10 in Lee Smooth) that given a smooth map of manifolds $\phi:M\rightarrow N$ and a regular value $p\in N$ of $\phi$, the level set $\phi^{-1}(p)\subset M$ is a closed embedded submanifold. Is the converse true? That is, given an embedded submanifold $S\subset M$, is there necessarily a manifold $N$, smooth map $\phi:M\rightarrow N$, and regular value $p\in N$ of $\phi$ such that $S=\phi^{-1}(p)$?

Prop. 8.12 in Lee Smooth shows that this is true locally; specifically,

Let $S$ be a subset of a smooth $n$-manifold $M$. Then $S$ is an embedded $k$-submanifold of $M$ if and only if every point $p\in S$ has a neighborhood $U\subset M$ such that $U\cap S$ is a level set of a submersion $\phi:U\rightarrow\mathbb{R}^{n-k}$.

(and any level set of a submersion is of course the level set of a regular value). I feel like this is the kind of question where, if there is a counterexample, it probably is very simple, but I wasn’t able to come up with one.

Solutions Collecting From Web of "Is every embedded submanifold globally a level set?"

If $M$ is compact, you can find a tubular neighborhood $U$ of $M$, which is diffeomorphic to the normal bundle $\mathcal N$ of $M$ in $N$, by some diffeo $h:\mathcal N\to U$. Now pick a metric on $\mathcal N$, and let $q:\mathcal N\to\mathbb R$ be the square of the corresponding norm. If $\phi:\mathcal N\to\mathbb R$ is a smooth function such that $\phi(v)\sim\tfrac1{q(v)}$ outside of the unit balls in each fiber, with the approximation better and better as $q(v)$ grows, and constantly equal to $1$ inside the balls of radius $\tfrac12$ in each fiber, then the product $\phi\cdot q$ composed with $h$ gives you a map $U\to\mathbb R$, which extends to a smooth map $N\to\mathbb R$ (with value $1$ outside of $U$), whose zero-set is precisely $N$.

If $M$ is not compact, you can have problems: for example, consider the map $t\in\mathbb R\mapsto ((1+e^t)\cos t,(1+e^t)\sin t)\in\mathbb R^2$. Any function vanishing in its image also vanishes on the unit circle.

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.

I think the answer is no if the codimension of the embedding is 1. Consider M being the $\mathbb R^3$ and $S$ the Open Mobius strip embedded in $\mathbb R^3$, if S is a regular level set of some map $\phi$:$\mathbb R^3$→N, then N is 1-dimensinal, so N=$S^1$ or $\mathbb R$.
Case1 N=$\mathbb R$, namely $\phi$ is real-valued, then grad$\phi$ is nowhere vanishing along $S$ and normal to $S$, a contradiction.
Case2 N=$S^1$, consider the global non-vanishing form $d\theta$ on $S^1$, consider its pullback $\phi^*d\theta$, which should be non-vanishing along $S$ (Because $\phi_*$ is full-rank along $S$), then the metrically equivalent vector field of $\phi^*d\theta$ is nowhere vanishing on $S$ and is normal to $S$, contradiction. I think the same argument should work for any non-orientable hypersurface embedded in orientable manifolds.