If $M_1 \subset M_2$ are manifolds and $M_1$ is relatively open in $M_2$, then $\dim(M_1) = \dim(M_2)$ Let $M_1 \subset \mathbb{R}^k$ be a smooth $n_1$-dimensional manifold and $M_2 \subset \mathbb{R}^k$ be a smooth $n_2$-dimensional manifold, such that $M_1 \subset M_2$.
The task is to show that if $M_1$ is relatively open in $M_2$ then $n_1=n_2$.
By definition, since $M_1$ is relatively open in $M_2$, then there is an open set $U \subset \mathbb{R}^k$ such that $M_1 = M_2 \cap U$.
Let $x \in M_1$, then there is an open set $x \in U_1 \subset \mathbb{R}^k$ and a map $r: G \to M_1$ such that $r(G) = M_1 \cap U_1$ and $G \subset \mathbb{R}^{n_1}$ is open.
Now, I get $r(G) = M_2 \cap (U \cap U_1)$ so I want to somehow expand $r$ to be a map of $M_2$, since I need it to be from an open domain $G' \subset \mathbb{R}^{n_2}$, but I don't know how to do it without losing regularity and injectivity.
Moreover, there is a hint that says to show that for every $x \in M_1$ it satisfies $T_xM_1 = T_xM_2$ and then use it somehow.
While I know how to show $T_xM_1 \subset T_xM_2$ by using the definition with curves, but I don't know how to show the other direction and what is the use of it in the solution.
Help would be appreciated.
 A: Open subsets of $M_2$ are exactly those that can be written in the form $U \cap M_2$ where $U$ is an open set of $\Bbb R^k$ . Thus $M_1$ is an open subset of $M_2$ . 
From the definition of tangent space  at a point, note that $T_x (V)= T_x(M_2) , \forall $ open subsets $V$ of $M_2$ such that $x \in V$ .Thus in our case, $T_x (M_1)=T_x (M_2), \forall x \in M_1$ . Thus $$dim(M_1)=dim(T_x(M_1))=dim(T_x(M_2))=dim(M_2)$$
A: The dimension of a (connected) manifold is the dimension of any of its tangent spaces.  Thus to show that $\dim M_1=\dim M_2$, it suffices to show that the inclusion $i:M_1\hookrightarrow M_2$ induces an isomorphism $i_*:T_xM_1\to T_xM_2$ for some (hence any) $x\in M_1$.  
Fix $x\in M_1$.  To do this, we use the definition of tangent spaces as equivalence classes of smooth curves passing through $x$.  To show surjectivity, it suffices to show that every smooth curve at $x$ in $M_2$ is eventually a smooth curve in $M_1$, which is an easy consequence of $M_1$ being open in $M_2$.  To show injectivity, if two curves are equivalent in $M_2$, use the fact that every chart in $M_1$ is a chart in $M_2$ to show that these curves are equivalent in $M_1$.
