[proofplan]
We build the Levi-Civita connection in two moves. First, produce any metric-compatible connection by trivialising $TM$ over a local orthonormal frame (Gram-Schmidt), declaring the frame parallel, then gluing with a partition of unity. Next, use that the space of connections is an affine space over $\Omega^1(\mathrm{End}(TM))$: metric compatibility restricts the difference tensor to live in $\Omega^1(\mathfrak{so}(TM))$ (skew-symmetric endomorphisms), and the torsion of the modified connection differs from the torsion of the original by a tensorial expression. We show the map "skew-symmetric $1$-form valued endomorphism $\mapsto$ torsion correction" is a linear isomorphism between equidimensional vector spaces, so any prescribed torsion (in particular, zero torsion) is uniquely achievable. This gives both existence and uniqueness.
[/proofplan]
[step:Construct a local metric-compatible connection from an orthonormal frame]
Fix $p \in M$ and choose a coordinate chart $(U, \varphi)$ around $p$ small enough that $TM|_U$ is trivial. Apply [Gram-Schmidt](/theorems/???) pointwise to a local frame of $TU$ to produce a smooth orthonormal frame
\begin{align*}
(X_1, \dots, X_n) : U &\to TM, & g(X_i, X_j) &= \delta_{ij} \quad \text{on } U.
\end{align*}
Define a connection $A^U$ on $TU \to U$ by declaring the frame parallel:
\begin{align*}
A^U : \Gamma(TU) \times \Gamma(TU) &\to \Gamma(TU), & A^U_Y X_i &:= 0 \text{ for all } Y \in \Gamma(TU),\ 1 \le i \le n,
\end{align*}
extended $C^\infty(U)$-linearly in the first slot and via the Leibniz rule in the second: $A^U_Y(f X_i) = (Y \cdot f)X_i$, and by $\mathbb R$-bilinearity to arbitrary sections. We check compatibility with $g$: for any $Y \in \Gamma(TU)$ and $1 \le i, j \le n$,
\begin{align*}
Y \cdot g(X_i, X_j) = Y \cdot \delta_{ij} = 0 = g(A^U_Y X_i, X_j) + g(X_i, A^U_Y X_j),
\end{align*}
which is the metric-compatibility condition evaluated on frame elements. Since both sides are $C^\infty$-linear in both slots and the frame spans, the condition holds on all sections: $Y \cdot g(Z, W) = g(A^U_Y Z, W) + g(Z, A^U_Y W)$ for all $Z, W \in \Gamma(TU)$.
[guided]
We first build a *local* object, then glue. Locally over $U$, the tangent bundle $TU \to U$ is trivialisable by any frame, and by [Gram-Schmidt](/theorems/???) applied pointwise (smoothly) to any frame we obtain an orthonormal frame $X_1, \dots, X_n$, meaning $g(X_i, X_j) = \delta_{ij}$ everywhere on $U$.
Declaring the frame parallel — $A^U_Y X_i = 0$ — and extending by the Leibniz rule uniquely determines a connection on $TU$. Metric compatibility amounts to the identity $Y\cdot g(Z,W) = g(A^U_Y Z, W) + g(Z, A^U_Y W)$. Both sides of this identity are $C^\infty(U)$-linear in $Z$ and $W$, so it suffices to check it on frame elements $Z = X_i$, $W = X_j$: the LHS is $Y \cdot \delta_{ij} = 0$ and the RHS is $g(0, X_j) + g(X_i, 0) = 0$. So compatibility holds on the frame, hence everywhere.
Note this local connection depends on the chosen frame; different choices give different local connections. We will glue them by a partition of unity, using that metric compatibility is preserved under convex combinations.
[/guided]
[/step]
[step:Glue into a global metric-compatible connection via a partition of unity]
Choose an open cover $\{U_\alpha\}_{\alpha \in I}$ of $M$ over which $TM$ is trivial, and build a local metric-compatible connection $A^\alpha$ on each $U_\alpha$ by the previous step. Let $\{\rho_\alpha\}_{\alpha \in I}$ be a smooth [partition of unity](/theorems/???) subordinate to $\{U_\alpha\}$: $\rho_\alpha \in C^\infty_c(U_\alpha; [0,1])$, $\sum_\alpha \rho_\alpha = 1$, with the sum locally finite. Define
\begin{align*}
A : \Gamma(TM) \times \Gamma(TM) &\to \Gamma(TM), & A_Y Z &:= \sum_{\alpha \in I} \rho_\alpha\, A^\alpha_Y Z,
\end{align*}
where each term is extended by zero outside $\operatorname{supp}\rho_\alpha \subset U_\alpha$ (so the sum is well-defined and locally finite).
We verify $A$ is a connection and is metric-compatible. Linearity in $Y$ and the Leibniz rule in $Z$ are *not* preserved by arbitrary linear combinations of connections, but they *are* preserved by convex combinations (i.e.\ coefficients summing to $1$). Indeed, the space of connections is an affine space modelled on tensors: if $A^\alpha$ are connections and $\sum_\alpha \rho_\alpha = 1$, then $A = \sum_\alpha \rho_\alpha A^\alpha$ is again a connection because the non-tensorial Leibniz defect cancels:
\begin{align*}
A_Y(fZ) - fA_Y Z &= \sum_\alpha \rho_\alpha\,(A^\alpha_Y(fZ) - fA^\alpha_Y Z) = \sum_\alpha \rho_\alpha (Y\cdot f) Z = (Y\cdot f)Z.
\end{align*}
Metric compatibility is preserved because it is a linear condition:
\begin{align*}
g(A_Y Z, W) + g(Z, A_Y W) &= \sum_\alpha \rho_\alpha \bigl(g(A^\alpha_Y Z, W) + g(Z, A^\alpha_Y W)\bigr) = \sum_\alpha \rho_\alpha (Y \cdot g(Z, W)) \\
&= Y \cdot g(Z, W).
\end{align*}
Hence $A$ is a global metric-compatible connection on $TM$. In general $A$ need not be torsion-free.
[/step]
[step:Parameterise metric-compatible connections by $\Omega^1(\mathfrak{so}(TM))$]
Let $\mathcal C$ be the set of affine connections on $TM$. By the [affine structure on connections](/theorems/???), $\mathcal C$ is an affine space over the vector space $\Omega^1(\mathrm{End}(TM))$: for any two connections $A, \tilde A$ there is a unique $a \in \Omega^1(\mathrm{End}(TM))$ with
\begin{align*}
\tilde A_Y Z = A_Y Z + (\iota_Y a)(Z), \qquad Y, Z \in \Gamma(TM).
\end{align*}
Suppose $A$ and $\tilde A$ are both metric-compatible. Subtracting the two compatibility equations yields
\begin{align*}
g((\iota_Y a)(Z), W) + g(Z, (\iota_Y a)(W)) = 0 \quad \forall\, Y, Z, W \in \Gamma(TM),
\end{align*}
i.e.\ $(\iota_Y a)$ is skew-symmetric with respect to $g$ for each $Y$. Hence $a$ takes values in
\begin{align*}
\mathfrak{so}(TM) := \{\varphi \in \mathrm{End}(TM) : g(\varphi v, w) + g(v, \varphi w) = 0\ \forall\, v, w\},
\end{align*}
and equivalently $a \in \Omega^1(\mathfrak{so}(TM))$. Conversely, any $a \in \Omega^1(\mathfrak{so}(TM))$ added to a metric-compatible $A$ gives another metric-compatible connection. Thus the set of metric-compatible connections is an affine space over $\Omega^1(\mathfrak{so}(TM))$.
[/step]
[step:Relate torsions via the difference tensor]
The [torsion](/page/Torsion) of a connection $A$ on $TM$ is
\begin{align*}
\tau_A : \Gamma(TM) \times \Gamma(TM) &\to \Gamma(TM), & \tau_A(Y, Z) &:= A_Y Z - A_Z Y - [Y, Z],
\end{align*}
and is $C^\infty(M)$-bilinear and alternating, i.e.\ $\tau_A \in \Omega^2(TM)$. If $\tilde A = A + a$ with $a \in \Omega^1(\mathrm{End}(TM))$, then
\begin{align*}
\tau_{\tilde A}(Y, Z) = \tau_A(Y, Z) + (\iota_Y a)(Z) - (\iota_Z a)(Y),
\end{align*}
as a direct computation from the definition: the Lie bracket terms cancel since they are independent of the connection.
[/step]
[step:Show the symmetrisation map $a \mapsto T(a)$ is a linear isomorphism]
Define the linear map
\begin{align*}
T : \Omega^1(\mathfrak{so}(TM)) &\to \Omega^2(TM), & T(a)(Y, Z) &:= (\iota_Y a)(Z) - (\iota_Z a)(Y).
\end{align*}
The fibre of $\Omega^1(\mathfrak{so}(TM))$ at $p$ is $T^*_pM \otimes \mathfrak{so}(T_pM)$ with dimension $n \cdot \binom{n}{2} = \frac{n^2(n-1)}{2}$, using $\dim \mathfrak{so}(n) = \binom{n}{2}$. The fibre of $\Omega^2(TM)$ at $p$ is $\Lambda^2 T^*_pM \otimes T_pM$ with dimension $\binom{n}{2}\cdot n = \frac{n^2(n-1)}{2}$. The two vector bundles have the same rank, so $T$ is a bundle map between equidimensional bundles; it suffices to prove injectivity fibrewise.
[claim:Injectivity of $T$]
If $a \in \Omega^1(\mathfrak{so}(TM))$ satisfies $(\iota_Y a)(Z) = (\iota_Z a)(Y)$ for all $Y, Z$, then $a = 0$.
[/claim]
[proof]
Write $a_Y := \iota_Y a \in \mathrm{End}(TM)$; the hypothesis is $a_Y Z = a_Z Y$ and skew-symmetry with respect to $g$ gives $g(a_Y Z, W) = -g(Z, a_Y W)$.
Compute, cycling the three vectors $Y, Z, W$:
\begin{align*}
g(a_Y Z, W) &= -g(Z, a_Y W) && \text{(skew-symmetry of } a_Y\text{)}\\
&= -g(Z, a_W Y) && \text{(hypothesis with } Y, W \text{ swapped in arg)}\\
&= g(a_W Z, Y) && \text{(skew-symmetry of } a_W\text{)}\\
&= g(a_Z W, Y) && \text{(hypothesis with } W, Z \text{ swapped in arg)}\\
&= -g(W, a_Z Y) && \text{(skew-symmetry of } a_Z\text{)}\\
&= -g(W, a_Y Z) && \text{(hypothesis with } Z, Y \text{ swapped in arg)}\\
&= -g(a_Y Z, W) && \text{(symmetry of } g\text{)}.
\end{align*}
Therefore $g(a_Y Z, W) = -g(a_Y Z, W)$, so $g(a_Y Z, W) = 0$. Since $W$ is arbitrary and $g$ is non-degenerate, $a_Y Z = 0$ for all $Y, Z$, so $a = 0$.
[/proof]
By the claim, $T$ is fibrewise injective, hence (by equality of fibre dimensions) fibrewise bijective, hence a global bundle isomorphism. Consequently $T$ is an $\mathbb R$-linear isomorphism of the space of global sections $\Omega^1(\mathfrak{so}(TM)) \to \Omega^2(TM)$.
[guided]
The key claim is the fibrewise injectivity of $T$. It follows from a "three-term cycle" argument that is a staple of Riemannian geometry: apply skew-symmetry (three times) and the symmetry hypothesis (three times), alternating, to recover $g(a_Y Z, W) = -g(a_Y Z, W)$.
The key arithmetic that makes the dimensions match is
\begin{align*}
n \cdot \dim \mathfrak{so}(n) = n\binom{n}{2} = \binom{n}{2}\cdot n = \dim \Lambda^2 T^*_pM \otimes \dim T_pM.
\end{align*}
This is not a coincidence: it reflects the fact that a torsion-free metric-compatible connection in dimension $n$ has the "right" number of free parameters. Equivalently, the Koszul formula solves for $A_Y Z$ uniquely from torsion-freeness and compatibility.
[/guided]
[/step]
[step:Conclude existence and uniqueness]
Start with any metric-compatible connection $A$, which exists by the gluing step. Consider the difference tensor $a \in \Omega^1(\mathfrak{so}(TM))$. We wish to find $a$ with
\begin{align*}
\tau_{A + a} = \tau_A + T(a) = 0 \quad \iff \quad T(a) = -\tau_A.
\end{align*}
By the previous step, $T$ is an isomorphism, so $a = -T^{-1}(\tau_A) \in \Omega^1(\mathfrak{so}(TM))$ exists and is unique. Set $A_{LC} := A + a$. Then:
- $A_{LC}$ is metric-compatible (difference lies in $\Omega^1(\mathfrak{so}(TM))$ by construction).
- $\tau_{A_{LC}} = 0$ by choice of $a$.
Uniqueness: if $\tilde A$ is another metric-compatible torsion-free connection, then $\tilde A - A_{LC} = b$ for a unique $b \in \Omega^1(\mathfrak{so}(TM))$, and $\tau_{\tilde A} - \tau_{A_{LC}} = T(b) = 0$, so injectivity of $T$ gives $b = 0$, i.e.\ $\tilde A = A_{LC}$. This completes the proof.
[/step]