Riemannian connection on surface in $\mathbb{R}^3$ is torsion-free Let $M \subset \mathbb{R}^3$ be a smooth surface, i.e. a smooth 2-dim. submanifold with a Riemannian metric.
At any point $p \in M$, define the projection map
$\text{pr}_p:T_p \mathbb{R}^3 \to T_pM$ as $ T_pM \ni X_p \mapsto X_p - \langle X_p, N_p \rangle \cdot N_p$ where $N_p$ is the vector orthogonal to $T_pM$.
I want to define the connection $\nabla_X Y := \text{pr}_p(D_X Y)$ on $M$ where $D_X Y$ is just the directional derivative on $\mathbb{R}^3$ and check that it is torsion-free.
I end up with $T(X,Y) = \nabla_X Y - \nabla_Y X - [X,Y] = \text{pr}_p(D_x Y) - \text{pr}_p(D_Y X) - (D_X Y - D_Y X)$.
Now by linearity of the projection $\text{pr}_p(D_x Y) - \text{pr}_p(D_Y X) = \text{pr}_p(D_X Y - D_Y X)$. So it suffices to show that $(D_X Y - D_Y X) \in T_pM$ for $X,Y \in T_pM$
 A: Generally, suppose $M$ is a smooth $m$-dimensional submanifold of an $n$-dimensional smooth manifold $N$. Suppose $X,Y$ are vector fields on the larger manifold $N$, such that for each $p\in M$, we have $X(p),Y(p)\in T_pM$, i.e when restricted to the smaller submanifold, they are tangent to it. Now, if we take the Lie bracket in the larger manifold to get a vector field $[X,Y]:N\to TN$, then we can obviously restrict the domain to $M$, so we get $[X,Y]\bigg|_{M}:M\to TN$. The claim is that we can actually shrink the target space as well to get a mapping $M\to TM$, i.e the Lie bracket of vector fields tangent to a submanifold is again tangent to the submanifold.
A straight-forward proof is obtained by writing things out in local coordinates. Fix a chart $(U,\phi=(x^1,\dots, x^n))$ for the larger manifold $N$, which has the submanifold property for $M$, meaning $\phi(M\cap U)=\phi(U)\cap (\Bbb{R}^m\times \{0_{\Bbb{R}^{n-m}}\})$. With respect to this chart, note that the first $m$ coordinate vector fields $\left\{\frac{\partial}{\partial x^i}\right\}_{i=1}^m$, form at each point $p\in M\cap U$, a basis for the tangent space $T_pM$. Now, we can write on the domain $U$,
\begin{align}
X&=\sum_{i=1}^nX^i\frac{\partial}{\partial x^i}, \quad\text{and}\quad
Y=\sum_{i=1}^nY^i\frac{\partial}{\partial x^i}
\end{align}
for some smooth functions $X^i,Y^i:U\to\Bbb{R}$, with the property that if restricted to $M\cap U$, then
\begin{align}
X^{m+1}=\dots =X^{n}=Y^{m+1}=\dots = Y^n=0.\tag{$*$}
\end{align}
This is the condition that $X,Y$ restrict to vector fields on $M$. Now, the Lie bracket of $X$ and $Y$ (restricted to $U$) is
\begin{align}
[X,Y]&=\sum_{i,j=1}^n\left(X^i\frac{\partial Y^j}{\partial x^i} - Y^i\frac{\partial X^j}{\partial x^i}\right)\frac{\partial}{\partial x^j}.
\end{align}
If we restrict to $M\cap U$, then by $(*)$, it simplifies to
\begin{align}
[X,Y]\bigg|_{M\cap U}&=\sum_{i=1}^{m}\sum_{j=1}^n\left(X^i\frac{\partial Y^j}{\partial x^i} - Y^i\frac{\partial X^j}{\partial x^i}\right)\frac{\partial}{\partial x^j},
\end{align}
but now note that for $j\in\{m+1,\dots, n\}$, we have that $X^j|_{M\cap U}=Y^j|_{M\cap U}=0$, so taking the derivatives along the $\frac{\partial}{\partial x^i}$ direction for $i\in\{1,\dots, m\}$ means taking derivatives along direction tangent to $M$, so the result is zero (since the functions are zero when restricted to $M$, so differentiating along $M$ must yield $0$). So, the summation index above for $j$ can also be restricted:
\begin{align}
[X,Y]\bigg|_{M\cap U}&=\sum_{i=1}^m\sum_{j=1}^m\left(X^i\frac{\partial Y^j}{\partial x^i} - Y^i\frac{\partial X^j}{\partial x^i}\right)\frac{\partial}{\partial x^j}.
\end{align}
This shows that the Lie bracket restricted to $M\cap U$ is spanned by the first $m$ coordinate vector fields, which are tangent to $M$, so $[X,Y]$ restricts to a vector field on $M$. Finally, since we can cover $M$ by such submanifold charts, this completes the proof.

There's also a coordinate-free proof of this fact, which uses that the Lie bracket of '$F$-related' vector fields are again $F$-related; now apply this fact with $F=\iota:M\to N$ being the inclusion map (see for example Lee's smooth manifolds text for more details).
