[proofplan]
Use the definition of a $C^k$ boundary: after translating and rotating coordinates and shrinking the neighbourhood if necessary, the boundary is locally the graph of a $C^k$ function of the first $n-1$ variables, and the [open set](/page/Open%20Set) is exactly one side of that graph inside the chosen cylinder. In these adapted coordinates, subtract the graph function from the last coordinate, choosing the sign so that the interior is sent to the upper half-space. The map has an explicit inverse obtained by adding the graph function back, so it is a $C^k$ diffeomorphism after restricting to a sufficiently small neighbourhood. Finally, compose with the initial rigid motion to obtain the required local boundary flattening map.
[/proofplan]
[step:Choose adapted coordinates in which the boundary is a graph]
By the local one-sided graph definition of $C^k$ boundary near $x_0$, after shrinking the representing neighbourhood if necessary so that the boundary representation and the one-sided representation hold throughout the same cylinder, there exist an open neighbourhood $N \subset \mathbb{R}^n$ of $x_0$, a rigid motion
\begin{align*}
A: \mathbb{R}^n \to \mathbb{R}^n
\end{align*}
with $A(x_0)=0$, an open neighbourhood $O \subset \mathbb{R}^{n-1}$ of $0$, a number $\rho>0$, a function
\begin{align*}
\gamma: O \to \mathbb{R}
\end{align*}
of class $C^k$ with $\gamma(0)=0$, and a sign $\sigma \in \{1,-1\}$ such that, writing a point of $\mathbb{R}^n$ as $(z',z_n)$ with $z' \in \mathbb{R}^{n-1}$ and $z_n \in \mathbb{R}$, the cylinder
\begin{align*}
C := \{(z',z_n) \in \mathbb{R}^n : z' \in O \text{ and } |z_n|<\rho\}
\end{align*}
satisfies $A^{-1}(C) \subset N$ and
\begin{align*}
A(\partial U \cap A^{-1}(C))=\{(z',z_n) \in C : z_n=\gamma(z')\}.
\end{align*}
Moreover,
\begin{align*}
A(U \cap A^{-1}(C))=\{(z',z_n) \in C : \sigma(z_n-\gamma(z'))>0\}.
\end{align*}
Here $\sigma=1$ corresponds to the case where $U$ lies locally above the graph, and $\sigma=-1$ corresponds to the case where $U$ lies locally below the graph.
[guided]
The meaning of a $C^k$ boundary near $x_0$ used here is the local one-sided graph condition: after a rigid change of coordinates and after shrinking the neighbourhood if needed, the boundary is a graph and the open set $U$ is exactly one of the two sides of that graph in the same sufficiently small cylinder. We choose that coordinate system explicitly.
There is a rigid motion
\begin{align*}
A: \mathbb{R}^n \to \mathbb{R}^n
\end{align*}
with $A(x_0)=0$. In the new coordinates, every point is written as $(z',z_n)$, where $z' \in \mathbb{R}^{n-1}$ records the first $n-1$ coordinates and $z_n \in \mathbb{R}$ records the final coordinate. The $C^k$ boundary hypothesis gives an open set $O \subset \mathbb{R}^{n-1}$ containing $0$, a number $\rho>0$, and a function
\begin{align*}
\gamma: O \to \mathbb{R}
\end{align*}
of class $C^k$ such that $\gamma(0)=0$ and the boundary is represented by the graph $z_n=\gamma(z')$ inside the cylinder
\begin{align*}
C := \{(z',z_n) \in \mathbb{R}^n : z' \in O \text{ and } |z_n|<\rho\}.
\end{align*}
Thus
\begin{align*}
A(\partial U \cap A^{-1}(C))=\{(z',z_n) \in C : z_n=\gamma(z')\}.
\end{align*}
The one-sided part of the $C^k$ boundary hypothesis says that, after possibly shrinking $O$ and $\rho$, the set $U$ occupies exactly one of the two sides of the graph inside this cylinder. We encode the chosen side by a sign $\sigma \in \{1,-1\}$. With that sign chosen, the local interior is
\begin{align*}
A(U \cap A^{-1}(C))=\{(z',z_n) \in C : \sigma(z_n-\gamma(z'))>0\}.
\end{align*}
This sign convention is the mechanism that will make the flattened interior land in the upper half-space rather than sometimes in the lower half-space.
[/guided]
[/step]
[step:Define the flattening map in the adapted coordinates]
Define the coordinate flattening map
\begin{align*}
\Psi: C \to \Psi(C)
\end{align*}
by
\begin{align*}
\Psi(z',z_n)=(z',\sigma(z_n-\gamma(z'))).
\end{align*}
Because $\gamma \in C^k(O)$ and the remaining coordinate functions are affine, $\Psi$ is of class $C^k$ on $C$.
Define
\begin{align*}
\Theta: \Psi(C) \to C
\end{align*}
by
\begin{align*}
\Theta(y',y_n)=(y',\gamma(y')+\sigma y_n).
\end{align*}
For every $(z',z_n) \in C$,
\begin{align*}
\Theta(\Psi(z',z_n))=(z',\gamma(z')+\sigma^2(z_n-\gamma(z')))=(z',z_n),
\end{align*}
since $\sigma^2=1$. For every $(y',y_n) \in \Psi(C)$,
\begin{align*}
\Psi(\Theta(y',y_n))=(y',\sigma(\gamma(y')+\sigma y_n-\gamma(y')))=(y',y_n).
\end{align*}
Thus $\Theta=\Psi^{-1}$ on $\Psi(C)$. Moreover,
\begin{align*}
\Psi(C)=\{(y',y_n) \in \mathbb{R}^n : y' \in O \text{ and } |\gamma(y')+\sigma y_n|<\rho\}.
\end{align*}
This set is open in $\mathbb{R}^n$, because $O$ is open, the map $(y',y_n) \mapsto \gamma(y')+\sigma y_n$ is continuous, and $(-\rho,\rho)$ is open in $\mathbb{R}$. Since $\Theta$ is also of class $C^k$, $\Psi$ is a $C^k$ diffeomorphism from $C$ onto the open set $\Psi(C)$.
[guided]
The construction is designed so that the graph coordinate becomes a flat coordinate. Define
\begin{align*}
\Psi: C \to \Psi(C)
\end{align*}
by
\begin{align*}
\Psi(z',z_n)=(z',\sigma(z_n-\gamma(z'))).
\end{align*}
The first $n-1$ coordinates are unchanged, and the last coordinate is the signed vertical distance from the graph $z_n=\gamma(z')$. Since $\gamma \in C^k(O)$ and affine coordinate functions are smooth, each component of $\Psi$ is of class $C^k$ on $C$.
To prove that this map is a diffeomorphism onto its image, we explicitly construct its inverse. Define
\begin{align*}
\Theta: \Psi(C) \to C
\end{align*}
by
\begin{align*}
\Theta(y',y_n)=(y',\gamma(y')+\sigma y_n).
\end{align*}
This formula reverses the flattening operation: after the signed height $y_n$ is known, adding the graph height $\gamma(y')$ restores the original final coordinate.
For every $(z',z_n) \in C$, substituting $\Psi(z',z_n)$ into $\Theta$ gives
\begin{align*}
\Theta(\Psi(z',z_n))=(z',\gamma(z')+\sigma^2(z_n-\gamma(z')))=(z',z_n),
\end{align*}
because $\sigma \in \{1,-1\}$ implies $\sigma^2=1$. Conversely, for every $(y',y_n) \in \Psi(C)$,
\begin{align*}
\Psi(\Theta(y',y_n))=(y',\sigma(\gamma(y')+\sigma y_n-\gamma(y')))=(y',y_n).
\end{align*}
Thus $\Theta=\Psi^{-1}$ on $\Psi(C)$.
It remains to check that the target is open, because a diffeomorphism is a map between open sets. From the inverse formula, a point $(y',y_n)$ belongs to $\Psi(C)$ exactly when $y' \in O$ and the reconstructed coordinate $\gamma(y')+\sigma y_n$ lies in $(-\rho,\rho)$. Hence
\begin{align*}
\Psi(C)=\{(y',y_n) \in \mathbb{R}^n : y' \in O \text{ and } |\gamma(y')+\sigma y_n|<\rho\}.
\end{align*}
The set $O$ is open, the map $(y',y_n) \mapsto \gamma(y')+\sigma y_n$ is continuous, and $(-\rho,\rho)$ is open. Therefore $\Psi(C)$ is open in $\mathbb{R}^n$. Since both $\Psi$ and its inverse $\Theta$ are of class $C^k$, $\Psi$ is a $C^k$ diffeomorphism from $C$ onto $\Psi(C)$.
[/guided]
[/step]
[step:Verify that the coordinate map sends the boundary to the hyperplane and the interior to the upper half-space]
Let $H$ denote the coordinate hyperplane
\begin{align*}
H := \{y \in \mathbb{R}^n : y_n=0\}.
\end{align*}
If $(z',z_n) \in A(\partial U \cap A^{-1}(C))$, then $z_n=\gamma(z')$, and therefore
\begin{align*}
\Psi(z',z_n)=(z',0) \in H.
\end{align*}
Conversely, if $(z',z_n) \in C$ and $\Psi(z',z_n) \in H$, then $\sigma(z_n-\gamma(z'))=0$, hence $z_n=\gamma(z')$, so $(z',z_n)$ lies on the local boundary graph. Therefore
\begin{align*}
\Psi(A(\partial U \cap A^{-1}(C)))=\Psi(C)\cap H.
\end{align*}
Now let $\mathbb{R}^n_+ := \{y \in \mathbb{R}^n : y_n>0\}$. For $(z',z_n) \in C$,
\begin{align*}
\Psi(z',z_n) \in \mathbb{R}^n_+
\end{align*}
if and only if
\begin{align*}
\sigma(z_n-\gamma(z'))>0.
\end{align*}
By the chosen side condition for $U$, this is equivalent to $(z',z_n) \in A(U \cap A^{-1}(C))$. Hence
\begin{align*}
\Psi(A(U \cap A^{-1}(C)))=\Psi(C)\cap \mathbb{R}^n_+.
\end{align*}
[guided]
We now check that the algebraic definition of $\Psi$ has exactly the desired geometric effect.
First consider boundary points. A point $(z',z_n) \in C$ lies on the local boundary graph exactly when
\begin{align*}
z_n=\gamma(z').
\end{align*}
For such a point, the final coordinate of $\Psi(z',z_n)$ is
\begin{align*}
\sigma(z_n-\gamma(z'))=\sigma(\gamma(z')-\gamma(z'))=0.
\end{align*}
Thus every boundary point is sent into the hyperplane
\begin{align*}
H := \{y \in \mathbb{R}^n : y_n=0\}.
\end{align*}
The converse is equally important: if $\Psi(z',z_n)$ has last coordinate $0$, then
\begin{align*}
\sigma(z_n-\gamma(z'))=0.
\end{align*}
Since $\sigma$ is either $1$ or $-1$, it is nonzero, so this implies
\begin{align*}
z_n=\gamma(z').
\end{align*}
Therefore the only points in $C$ mapped into $H$ are precisely the points on the graph. We have proved
\begin{align*}
\Psi(A(\partial U \cap A^{-1}(C)))=\Psi(C)\cap H.
\end{align*}
Next consider interior points. The upper half-space is
\begin{align*}
\mathbb{R}^n_+ := \{y \in \mathbb{R}^n : y_n>0\}.
\end{align*}
For any $(z',z_n) \in C$, the last coordinate of $\Psi(z',z_n)$ is $\sigma(z_n-\gamma(z'))$. Therefore
\begin{align*}
\Psi(z',z_n) \in \mathbb{R}^n_+
\end{align*}
if and only if
\begin{align*}
\sigma(z_n-\gamma(z'))>0.
\end{align*}
But this inequality is exactly how we chose the sign $\sigma$ to represent the local side occupied by $U$. Hence
\begin{align*}
\Psi(A(U \cap A^{-1}(C)))=\Psi(C)\cap \mathbb{R}^n_+.
\end{align*}
This is the whole purpose of the sign choice: both possible orientations of the original domain are converted into the same target condition $y_n>0$.
[/guided]
[/step]
[step:Compose with the rigid motion to obtain the flattening at $x_0$]
Define
\begin{align*}
V := A^{-1}(C)
\end{align*}
and
\begin{align*}
W := \Psi(C).
\end{align*}
Then $V$ is an open neighbourhood of $x_0$, $W$ is an open neighbourhood of $0$, and the map
\begin{align*}
\Phi: V \to W
\end{align*}
defined by
\begin{align*}
\Phi(x)=\Psi(A(x))
\end{align*}
is a $C^k$ diffeomorphism, because $A$ is a smooth diffeomorphism and $\Psi$ is a $C^k$ diffeomorphism. Also,
\begin{align*}
\Phi(x_0)=\Psi(A(x_0))=\Psi(0,0)=0.
\end{align*}
Using the identities proved in the adapted coordinates gives
\begin{align*}
\Phi(U \cap V)=W \cap \mathbb{R}^n_+
\end{align*}
and
\begin{align*}
\Phi(\partial U \cap V)=W \cap \{y \in \mathbb{R}^n : y_n=0\}.
\end{align*}
Thus $\Phi$ is a local boundary flattening map of class $C^k$ at $x_0$.
[guided]
We now return from the adapted coordinates to the original coordinates. Define
\begin{align*}
V := A^{-1}(C)
\end{align*}
and
\begin{align*}
W := \Psi(C).
\end{align*}
Because $C$ is open and $A$ is a rigid motion, hence a homeomorphism of $\mathbb{R}^n$, the set $V=A^{-1}(C)$ is an open neighbourhood of $x_0$. The set $W$ is open by the construction of the previous step.
Define
\begin{align*}
\Phi: V \to W
\end{align*}
by
\begin{align*}
\Phi(x)=\Psi(A(x)).
\end{align*}
The map $A$ is a smooth diffeomorphism from $V$ onto $C$, and $\Psi$ is a $C^k$ diffeomorphism from $C$ onto $W$. Therefore their composition $\Phi=\Psi \circ A$ is a $C^k$ diffeomorphism from $V$ onto $W$.
The base point is sent to the origin because $A(x_0)=0$ and $\gamma(0)=0$, so
\begin{align*}
\Phi(x_0)=\Psi(A(x_0))=\Psi(0,0)=0.
\end{align*}
The identities already proved in the adapted coordinates transfer through the composition with $A$. Since $V=A^{-1}(C)$, we have
\begin{align*}
\Phi(U \cap V)=\Psi(A(U \cap A^{-1}(C)))=W \cap \mathbb{R}^n_+
\end{align*}
and
\begin{align*}
\Phi(\partial U \cap V)=\Psi(A(\partial U \cap A^{-1}(C)))=W \cap \{y \in \mathbb{R}^n : y_n=0\}.
\end{align*}
These are exactly the defining properties of a local boundary flattening map of class $C^k$ at $x_0$.
[/guided]
[/step]