# How to define submanifolds of $\mathbb{R}^n$ with boundary without using (explicitly) the notion of diffeomorphism?

How to define submanifolds of $$\mathbb{R}^n$$ with boundary without using (explicitly) the notion of diffeomorphism?

I know how to define submanifolds of $$\mathbb{R}^n$$ (without boundary) without using the notion of diffeomorphism:

Definition: Let $$M\subseteq \mathbb{R}^n$$ be any subset. We say that $$M$$ is a $$C^\infty$$-submanifold of $$\mathbb{R}^n$$ with dimension $$m$$ if $$m\leq n$$ and for all $$p\in M$$ there're an open neighborhood $$U\subseteq \mathbb{R}^n$$ of $$p$$ and a smooth map $$\varphi :U\to \mathbb{R}^{n-m}$$ such that the differential $$(d\varphi)_p$$ is surjective and $$\varphi ^{-1}(\{0\})=U\cap M$$.

At first I don't want to use the notion of diffeomorphism because I don't want initially define differentiability of a map defined in a non-open subset of $$\mathbb{R}^n$$.

Def: $$M\subseteq\mathbb{R}^n$$ is an $$m$$-manifold with boundary if for each $$p\in M$$ there exist open sets $$U,V\subseteq\mathbb{R}^n$$ with $$p\in U$$ and a diffeomorphism $$\varphi:U\to V$$ such that $$M\cap U=\varphi^{-1}\left([0,\infty)\times\mathbb{R}^{m-1}\times\{0\}^{n-m}\right)$$.
Note that while we do take the image of a nonopen set, the domain and codomain of $$\varphi$$ are open, and so there's no issue with defining smoothness only on open sets.
Def: $$M\subseteq\mathbb{R}^n$$ is an $$m$$-manifold with boundary if for each $$p\in M$$ there exist an open set $$U\subseteq\mathbb{R}^n$$ with $$p\in U$$ and a smooth submersion $$\varphi:U\to\mathbb{R}^{n-m+1}$$ such that $$M\cap U=\varphi^{-1}\left([0,\infty)\times\{0\}^{n-m}\right)$$.