Proving criterion establishing subset of euclidean space is smooth manifold Our professor told us the following criterion:

Let $M\subseteq\mathbb{R}^k$ be any subset, and suppose that for all $m\in M$ we have a triplet $(U,\psi,A)$ with $m\in U\subseteq M$ an open subset, $\psi:A\to\mathbb{R}^k$ a smooth immersive map that, when its codomain is restricted to $U$, becomes a homeomorphism, where $A\subseteq\mathbb{R}^d$ is an open subset, then this $M$ is a smooth manifold, and the triplets form a smooth atlas on $M$.

I see how this is a topological atlas, but how do I prove the transition functions are smooth? I cannot use differentials since no differential here is invertible, so how can I proceed?
 A: I posted this, hoping to get a proof I could neither come up with nor find elsewhere. No answer came. I was busy with my thesis, so I let it be for some time. Now I've started going over my notes again, and this cropped up, and the solution presented itself in the middle of another proof.
So we have $M\subseteq\mathbb{R}^k$ and we know that for all $m\in M$ we have an open $U\subseteq M$ (open in the subspace topology), an $A\subseteq\mathbb{R}^d$ for a fixed $d$, and $\psi:A\to U$ which is immersive as $A\to\mathbb{R}^k$, and a homeomorphism as $A\to U$. What we want to show is that the $\psi^{-1}$s are a smooth atlas for $M$.
Evidently they are a topological atlas, since each point is in the domain of one of those inverses, and those are all homeomorphisms, meaning their transition functions also are.
For smoothness, we remember smoothness is local, so if we prove the transition functions are smooth in a neighborhood of any point, we are done.
So assume $\phi:U\to A$ and $\phi':U'\to A'$ are two of those homeomorphisms. What about $\phi\circ\phi'^{-1}$? Is it smooth? It is defined on $\phi'(U\cap U')$, and maps it homeomorphically onto $\phi(U\cap U')$. So let $p$ be a point of its domain. By the rank theorem, $\phi^{-1}$ is locally (perhaps on a subset of $\phi(U\cap U')$) represented by the inclusion, i.e. there is, on this subset of $\phi(U\cap U')$ containing $\phi\circ\phi'^{-1}(m)$, a change of coordinates such that with respect to the new coordinates one has $\phi(x_1,\dotsc,x_d)=(x_1,\dotsc,x_d,0,\dotsc,0)$. So if we compose the change of coordinates with the projection onto the first $d$ coordinate, i.e. consider $\pi_d\circ c$ with $c$ the coordinate change, we have a local inverse of $\phi^{-1}$, in other words, a smooth extension $\tilde\phi$ of $\phi$ to an open set in $\mathbb{R}^k$. Naturally, $\phi\circ\phi'^{-1}$ is, where it is defined, equal to $\tilde\phi\circ\phi'^{-1}$, but that is a composition of smooth functions, hence in the preimage of that set where $\phi^{-1}$ is the inclusion (the one given by the rank theorem) under $\phi\circ\phi'^{-1}$, the transition function is smooth. Such a procedure can be done for any point in the domain of the transition function, which is therefore smooth, proving our claim.
