If $f : M \to N$ is $C^k$, then $\Gamma(f)$ is a closed embedded submanifold of $M \times N$ The following problem is part of an assignment in my Differential Topology course.

Exercise. Show the graph of a $C^k$ function $f : M \to N$ between two $C^k$ manifolds $M$ and $N$ defined by $\Gamma(f)=\{(x,y) \in M \times N : y=f(x) \}$ is a closed embedded submanifold of $M \times N$ and is diffeomorphic to $M$.

I have managed to solve this exercise and I have posted my solution below. My instructor sketched an alternative solution, which I am unable to complete. I would appreciate any help on this.
Sketch of Proof. Consider the map $\varphi : M \times N \to N$ given by $\varphi(x,y) = y - f(x)$. Then $\Gamma(f) = \varphi^{-1}(0)$. We will show that $0 \in N$ is a regular value of $f$ by showing that $\mathrm{Jac}(\varphi)|_p$ has maximal rank for all $p \in \varphi^{-1}(0)$. Now, $\mathrm{Jac}(\varphi)$ clearly has the $n \times n$ minor $\begin{pmatrix} \frac{\partial \varphi}{\partial y_i}\Big|_p \end{pmatrix}_{n \times n}$ equal to $I_{n \times n}$. Hence, by the regular level set theorem, we have that $\Gamma(f) = \varphi^{-1}(0)$ is a closed embedded submanifold of $M \times N$. $\tag*{$\blacksquare$}$
Now, by my understanding we need to choose coordinate charts $(V_1,\psi_1)$ and $(V_2,\psi_2)$ around $y$ and $f(x)$, respectively, so that $y - f(x)$ makes sense. 


*

*Ideally, I would like to be able to take both charts to be the same, because only when both charts are the same can I be assured that $y$ and $f(x)$ have the same coordinates precisely when $y = f(x)$. However, it won't always happen that $f(x)$ and $y$ lie in the same chart for all values of $x \in M$ and $y \in N$.

*More importantly, if the charts are distinct then I don't see how to define which point on $N$ corresponds to $y - f(x)$. I've tried playing around with the charts, trying to subtract the images, and pull them back to $N$, etc. but I've either ended up in dead ends or I've started defining nonsense.
At this point, I think I'm either missing something completely straightforward, or this method cannot be used to prove that $\Gamma(f)$ is an embedded submanifold of $M \times N$. Any help is appreciated.

As mentioned previously, I have posted my solution to the problem (not using the above idea) in an answer below. Comments for improvements to that solution are also welcome. I have chosen to not post the answer in the question details because it will be easier to receive feedback this way, and it will not clutter the page so much in my opinion. In any case, I have tagged this question with [alternative-proof].
Thanks in advance.
 A: As mentioned in the question details, here is my original solution to the problem (not following the sketch given by my instructor). Although my question does not concern this solution, any feedback is certainly appreciated.
Thanks.

$\Gamma(f)$ is given the subspace topology induced from $M \times N$. Since the graph
of a continuous function into a Hausdorff space is closed, $\Gamma(f)$ is a closed subspace
of $M \times N$.
To show that $\Gamma(f)$ is a manifold, we show that it is homeomorphic to $M$.
Consider the map $\pi : \Gamma(f) \to M$ given by the restriction of the projection $(x,y) \mapsto x$ to
$\Gamma(f)$. Since $\pi$ is the restriction of a continuous map, it is also continuous.
We want to show that it has a continuous inverse.
The inclusion $\jmath : M \to \Gamma(f)$ given by $\jmath(x) = (x,f(x))$ is continuous
because its component functions are continuous, and $\pi \circ \jmath = \def\identity{\mathrm{id}}\identity_{M}$
and $\jmath \circ \pi = \identity_{\Gamma(f)}$. Hence, $M$ is homeomorphic to $\Gamma(f)$,
so $\Gamma(f)$ can be given the structure of a topological manifold as follows: if $\{ (U_i,\varphi_i) \}_{i \in I}$
is an atlas for $M$, then $\{ (\jmath(U_i),\varphi_i \circ \pi) \}_{i \in I}$ is an atlas for $\Gamma(f)$.
$\Gamma(f)$ is in fact diffeomorphic to $M$, because if we started with a smooth atlas
for $M$, then we get a smooth atlas for $\Gamma(f)$. To see this,
let $\jmath(U_1) \cap \jmath(U_2) \neq \emptyset$. Then the transition map is
$(\varphi_2 \circ \pi) \circ (\varphi_1 \circ \pi)^{-1} : \varphi_1(U_1 \cap U_2) \to \varphi_2(U_1 \cap U_2)$, where
$(\varphi_2 \circ \pi) \circ (\varphi_1 \circ \pi)^{-1} = \varphi_2 \circ \pi \circ \jmath \circ \varphi_1^{-1}
= \varphi_2 \circ \identity_M \circ\, \varphi_1^{-1}$, which is a composition of diffeomorphisms
and hence a diffeomorphism.
Let $\iota : \Gamma(f) \to M \times N$ be the identity map on $M \times N$ restricted to $\Gamma(f)$.
It is smooth because it is the restriction
of the identity map on $M \times N$ which is smooth. Since $\iota$ is injective, it only remains
to show that $\iota$ is an immersion.
Suppose that $\gamma : \Bbb{R} \to \Gamma(f)$ is a smooth curve paassing through $(p,f(p))$ at $t = 0$ and such that $\gamma'(0) \neq 0$. Since $\iota \circ \gamma(t) = \gamma(t)$ for all $t \in \Bbb{R}$, we have
    $$
 \frac{d(\iota \circ \gamma)}{dt} (0) = \frac{d \gamma}{dt} (0) \neq 0.
 $$
Hence, $\iota$ is an immersion. Thus, $\Gamma(f)$ is a closed embedded submanifold of $M \times N$.
A: To show that the set $$\Gamma(f) = \{ (x,y) \in M \times N : y = f(x) \}$$ is a closed embedded submanifold of $M \times N$, it suffices to show that $\Gamma(f)$ is locally the inverse image of a regular value.
So, let $(U,\varphi)$ and $(V,\psi)$ be charts around $p \in M$ and $f(p) \in N$, respectively, such that $f(U) \subset V$.  Let $x_1,\dots,x_m$ be the local coordinates on $U$ and $y_1,\dots,y_n$ the local coordinates on $V$. Consider the map $g \colon U \times V \to \Bbb{R}^n$ given by $g(x,y) = \psi(y) - \psi(f(x))$. Then, $g(p,f(p)) = 0$ and if $g \equiv (g_1,\dots,g_n)$, then
$$
\left( \frac{\partial g_i}{\partial y_j}\bigg|_{(p,f(p))} \right)_{n \times n} = I_n,
$$
so this matrix is invertible. So the implicit function theorem is applicable: there exists a neighbourhood $W \subset U$ of $p$ and a unique $C^k$ function $h : W \to \Bbb{R}^n$ such that $h(p) = f(p)$ and for all $(x,y) \in U \times V$, $g(x,y) = 0$ if and only if $y = h(x)$.
In particular, $g^{-1}(0) \cap (W \times V)$ is an embedded submanifold of $M \times N$.
But, $g(x,f(x)) = 0$ for all $x \in W$, so $h = f|_W$ by the uniqueness of $h$. Hence, $g^{-1}(0) \cap (W \times V) = \Gamma(f) \cap (W \times V)$, so $\Gamma(f)$ is locally an embedded submanifold of $M \times N$.
$\Gamma(f)$ is closed because the graph of a continuous function into a Hausdorff space is closed.
$\Gamma(f)$ is diffeomorphic to $M$ because every point in $M \times N$ lying in $\Gamma(f)$ has a neighbourhood $W \times V \subset M \times N$ such that the coordinates on $\Gamma(f) \cap (W \times V)$ is exactly given by the coordinates on $W$.
