[proofplan]
We first treat the compact case. Using a finite atlas and a subordinate partition of unity, we assemble a smooth map $\Phi: M \to \mathbb{R}^{(n+1)k}$ whose coordinates record both the chart values and the partition weights. Injectivity and immersivity follow by inspecting, at each point, a chart index where the partition weight is positive. Compactness upgrades the injective immersion to a closed embedding into some $\mathbb{R}^N$. Finally, generic linear projections reduce the ambient dimension to $2n$: Sard's theorem forbids the set of bad projection directions (those that destroy injectivity or immersivity) from covering the unit sphere as long as $N$ exceeds $2n$.
[/proofplan]
[step:Cover $M$ by finitely many charts and fix a subordinate partition of unity]
Assume first that $M$ is compact. Every $p \in M$ lies in a chart $(U, \varphi)$ with $\varphi(U) \subset \mathbb{R}^n$ open; shrinking $U$ and composing with a translation, we may also require $\varphi(U) \subset B(0,1)$, so $\varphi$ is bounded. The open cover $\{U\}$ admits a finite subcover $(U_1, \varphi_1), \ldots, (U_k, \varphi_k)$ by compactness of $M$.
By the [partition of unity theorem](/theorems/???), there exists a smooth partition of unity $\{\chi_i\}_{i=1}^k$ subordinate to $\{U_i\}$: each $\chi_i \in C^\infty(M; [0,1])$ satisfies $\mathrm{supp}(\chi_i) \subset U_i$ and $\sum_{i=1}^k \chi_i(p) = 1$ for every $p \in M$.
[/step]
[step:Assemble the global map $\Phi: M \to \mathbb{R}^{(n+1)k}$ from chart-weight pairs]
For each $i$, extend $\chi_i \cdot \varphi_i$ by zero to all of $M$: since $\mathrm{supp}(\chi_i) \subset U_i$ is compact in $U_i$, the map
\begin{align*}
f_i: M &\to \mathbb{R}^n \\
p &\mapsto \begin{cases} \chi_i(p)\, \varphi_i(p) & p \in U_i, \\ 0 & p \in M \setminus \mathrm{supp}(\chi_i) \end{cases}
\end{align*}
is well-defined and smooth, because on the open overlap $U_i \setminus \mathrm{supp}(\chi_i)$ both definitions give $0$.
Define the global map
\begin{align*}
\Phi: M &\to \mathbb{R}^{(n+1)k} \\
p &\mapsto \bigl(\,f_1(p),\, \chi_1(p),\, f_2(p),\, \chi_2(p),\, \ldots,\, f_k(p),\, \chi_k(p)\,\bigr).
\end{align*}
Each component is smooth, so $\Phi \in C^\infty(M; \mathbb{R}^{(n+1)k})$.
[/step]
[step:Verify injectivity of $\Phi$ by comparing at an index where the partition weight is positive]
Let $p, q \in M$ with $\Phi(p) = \Phi(q)$. Comparing the $\chi$-coordinates yields $\chi_i(p) = \chi_i(q)$ for every $i \in \{1, \ldots, k\}$. Since $\sum_i \chi_i(p) = 1$, there exists an index $j$ with $\chi_j(p) > 0$, so $\chi_j(q) = \chi_j(p) > 0$ as well. The condition $\chi_j(\cdot) > 0$ forces both $p, q \in U_j$, since $\mathrm{supp}(\chi_j) \subset U_j$.
Comparing the $f_j$-coordinates gives $\chi_j(p)\varphi_j(p) = \chi_j(q)\varphi_j(q)$. Dividing by the non-zero scalar $\chi_j(p) = \chi_j(q)$ yields $\varphi_j(p) = \varphi_j(q)$. Since $\varphi_j: U_j \to \mathbb{R}^n$ is a diffeomorphism onto its image, $p = q$. Hence $\Phi$ is injective.
[/step]
[step:Verify that $\Phi$ is an immersion by computing the differential at an active chart index]
Fix $p \in M$ and a tangent vector $v \in T_p M$ with $d\Phi_p(v) = 0$. We must show $v = 0$.
Choose $j$ with $\chi_j(p) > 0$, so $p \in U_j$. Write $v$ in the chart $\varphi_j$ as $v = \sum_{l=1}^n v_l\, \partial_{x_l}|_p$. The $f_j$-component of $d\Phi_p(v)$ vanishes, which reads
\begin{align*}
0 = d(f_j)_p(v) = d(\chi_j \varphi_j)_p(v) = \chi_j(p)\, d\varphi_j|_p(v) + \varphi_j(p)\, d\chi_j|_p(v) \in \mathbb{R}^n,
\end{align*}
and the $\chi_j$-component vanishes, giving $d\chi_j|_p(v) = 0$. Substituting this into the preceding line,
\begin{align*}
\chi_j(p)\, d\varphi_j|_p(v) = 0.
\end{align*}
Since $\chi_j(p) > 0$, $d\varphi_j|_p(v) = 0$. But $\varphi_j$ is a diffeomorphism onto its image, so $d\varphi_j|_p$ is a linear isomorphism $T_pM \to \mathbb{R}^n$; hence $v = 0$. Thus $\mathrm{ker}\, d\Phi_p = \{0\}$ for every $p \in M$, i.e., $\Phi$ is an immersion.
[/step]
[step:Upgrade the injective immersion to a closed embedding using compactness of $M$]
By the preceding two steps, $\Phi: M \to \mathbb{R}^{(n+1)k}$ is an injective smooth immersion. For an injective immersion from a compact source into a Hausdorff target, the [standard embedding criterion](/theorems/???) yields that $\Phi$ is a topological embedding onto $\Phi(M)$, which is compact and therefore closed in $\mathbb{R}^{(n+1)k}$. An injective immersion that is a topological embedding is a smooth embedding, so $\Phi(M)$ is a smooth $n$-dimensional submanifold of $\mathbb{R}^{(n+1)k}$. Set $N := (n+1)k$.
[/step]
[step:Reduce the ambient dimension by one via a generic linear projection]
Assume $N > 2n + 1$. For each unit vector $w \in S^{N-1} \subset \mathbb{R}^N$, let $\pi_w: \mathbb{R}^N \to w^\perp \cong \mathbb{R}^{N-1}$ denote orthogonal projection along the line $\mathbb{R}\cdot w$. We show that for a generic $w$, the composition $\pi_w \circ \Phi: M \to \mathbb{R}^{N-1}$ remains an injective immersion.
Define the two obstruction maps:
\begin{align*}
\sigma: (M \times M) \setminus \Delta_M &\to S^{N-1} \\
(p, q) &\mapsto \frac{\Phi(p) - \Phi(q)}{|\Phi(p) - \Phi(q)|},
\end{align*}
where $\Delta_M = \{(p,p) : p \in M\}$ is the diagonal (and $\Phi(p) \ne \Phi(q)$ on the complement because $\Phi$ is injective), and
\begin{align*}
\tau: TM \setminus \{0\text{-section}\} &\to S^{N-1} \\
(p, v) &\mapsto \frac{d\Phi_p(v)}{|d\Phi_p(v)|},
\end{align*}
which is well-defined because $d\Phi_p(v) \ne 0$ for $v \ne 0$ ($\Phi$ is an immersion); $\tau$ descends to the projectivisation $(TM \setminus 0)/\mathbb{R}^*$ of dimension $2n - 1$. The directions $w \in S^{N-1}$ for which $\pi_w \circ \Phi$ fails injectivity are exactly $\pm \mathrm{Image}(\sigma)$; those for which it fails immersivity are exactly $\pm \mathrm{Image}(\tau)$.
The source of $\sigma$ has dimension $2n$, and that of $\tau$ (after projectivising) has dimension $2n - 1 \le 2n$. By [Sard's Theorem](/theorems/???) applied to each of $\sigma$ and $\tau$ (both smooth maps between smooth manifolds, with source dimension $\le 2n < N - 1 = \dim S^{N-1}$), their images have measure zero in $S^{N-1}$. Therefore the union $\pm\mathrm{Image}(\sigma) \cup \pm\mathrm{Image}(\tau) \subset S^{N-1}$ has measure zero, so its complement is non-empty. Pick any $w$ in the complement; then $\pi_w \circ \Phi: M \to w^\perp \cong \mathbb{R}^{N-1}$ is an injective immersion from the compact manifold $M$, hence (by the criterion of the previous step) a smooth embedding.
[/step]
[step:Iterate the projection to reach $\mathbb{R}^{2n+1}$ and refine the double-point count to reach $\mathbb{R}^{2n}$]
Starting from the embedding into $\mathbb{R}^N$ and iterating the previous step while $N > 2n + 1$, we descend one dimension at a time and obtain a smooth embedding $M \hookrightarrow \mathbb{R}^{2n+1}$.
To descend from $\mathbb{R}^{2n+1}$ to $\mathbb{R}^{2n}$, the dimension count above is borderline: the source of $\sigma$ has dimension $2n$ equal to $\dim S^{2n}$, so a direct application of Sard fails to produce an injective projection. The refinement tracks the double-point locus of a generic projection. A generic projection $\pi_w \circ \Phi: M \to \mathbb{R}^{2n}$ is an immersion (the $\tau$-argument still applies, with source dimension $2n - 1 < 2n = \dim S^{2n}$), and its self-intersections are transverse and therefore isolated and finite in number. The [Whitney trick](/theorems/???) then removes double points in pairs by smooth isotopies supported in small neighbourhoods, producing a final smooth embedding $\iota: M \hookrightarrow \mathbb{R}^{2n}$.
[/step]
[step:Handle the non-compact case by an exhaustion argument]
For general (not necessarily compact) $M$, write $M = \bigcup_{m=1}^\infty K_m$ as an exhaustion by compact sets with $K_m \subset \mathrm{int}(K_{m+1})$. A refinement of the partition-of-unity construction (using a locally finite atlas and a proper function $M \to [0,\infty)$) produces a proper embedding $\Phi: M \to \mathbb{R}^{N_0}$ for some $N_0$. The same Sard-based projection argument, now using properness to preserve the embedding property under generic projections, reduces the dimension to $2n$. Combining with the compact case completes the proof that every smooth $n$-manifold embeds as a closed submanifold of $\mathbb{R}^{2n}$.
[/step]