The connection of a Riemannian manifold is a map from tangent vectors at a point x1 to vectors at another point x2, which tells which vectors are parallel. How can it be derived from the distance function?
Define this matrix-valued function, whose dual will turn out to be the connection: g(x2,x1)[i][j] = -0.5 r2[/x2[i]][/x1[j]]. Here the notation [/x2[i]] means covariant differentiation by coordinate i of x2, and it will be abbreviated [2/i], so g[i][j] = -0.5 r2[2/i][1/j]. However, since r is scalar valued, no covariant corrections appear.
When x1 == x2, the matrix (double 1-form) thus defined is the metric tensor, defining an inner product on vectors. The notation q*h means q[i]g[i][j]h[j] (all factors being colocated).
When x2 != x1, g(x2,x1)[i][j] defines a map from vectors at x1 to 1-forms at x2, and the dual (at x2) of that 1-form (i.e. the vector which, lowered by g(x2,x2), gives the same 1-form) is the image of the x1 vector through a uniquely defined map. Thus a single vector at x1 is propagated to a vector field. Annotate this map as N(x2,x1,v1). It's true that N(x1,x2,N(x2,x1,v1)) == v1, but generally N(x2,x3,N(x3,x1,v1)) != N(x2,x4,N(x4,x1,v1)) (for different x3, x4). This would only be true in a flat space.
Given a path through x1, it has there a tangent p. Another path through x2 has a tangent q. When are the paths parallel? The definition of parallel that Euclid used is that if the paths are straightly extended they will never intersect (in two dimensions). More useful in higher dimensions and lumpy spaces is, if an equal displacement is made along each path (each according to its own parameter), the distance between the path points is stationary in the sense that its second derivative is zero versus the (equal) parameters at x1 and x2. Since we're saying that the paths are parallel only at x1 and x2, we should really say that their tangents p and q are parallel. Now let's express parallelism by a formula. Let R = distance between x1 and x2. Use the same parameter t for both paths, and define Q(t) = distance squared between path points as a function of t. (It is squared because the range space of the metric tensor is distance squared.) Let h(x) = tangent to the geodesic from x1 to x2. In 2nd order,
Q(t) = R2(x2+qt, x1+pt) = R2(x2,x1) + R2[2/i]q[i]t + R2[1/i]p[i]t (negative) + 0.5 R2[2/i][2/j]q[i]q[j]t2 + 0.5 R2[1/i][1/j]p[i]p[j]t2 + R2[2/i][1/j]q[i]p[j]t2
By definition (?) of what a geodesic is:
h.g.h = 1 R2[2/i] = 2 g(x2,x2).h(x2) R2[1/i] = -2 g(x1,x1).h(x1)
Let g' represent the inverse of g, and let p' = p mapped by N, that is:
p'[i] = g'(x2,x2)[i][k] g(x2,x1)[k][j] p[j] Q(t) = R2(x2+qt, x1+pt) = R2(x2,x1) + 2 q.g(x2,x2).h(x2)t - 2 p.g(x1,x1).h(x1)t + (q.g(x2,x2).q + p.g(x1,x1).p - 2 q.g(x2,x1).p)t2 = R2(x2,x1) + 2 (q*h(x2) - p*h(x1)) t + (q*q + p*p - 2 q*p')t2
where q*p' uses the metric at x2. Saying that the paths are "parallel" means that R2(t) is constant to 2nd order. That is true when p' == q, which also makes (q*h) == (p*h) and (q*q) == (p*p). (It's necessary that the "speed" of both paths be the same. This isn't Euclid.) In other words, q is parallel to p if map N takes p over to q, showing that the map N, the metric dual of g(x2,x1)[i][j], is the connection.
The connection is also called the geodesic normal map, and mapping by N is also called parallel propagation along the (unique) geodesic between x1 and x2. For each x1 there is a neighborhood such that for all x2 therein, the geodesic between x1 and x2 is unique.
We would like to use the above expression for N to produce a formula for the Christoffel symbols in terms of distance function derivatives. Suppose q(x) is a field of vectors in a neighborhood of x1. Parametrize x2 along the geodesic by u and let p = q(x2(0)) = q(x1). The covariant derivative of the vector field measures the vectors' deviation from parallelism, and is zero at x2 when the field is parallel at x2. The formula for this is:
0 = (q[j][2!i] + q[L] C[L][i][m] g'(x2,x2)[m][j]) h(x2)[i]
The Christoffel symbol of the first kind, normally notated [ij,k], will be referred to as C[i][j][k]. The second derivative by t of Q(t,u) is constant as u varies (it's zero), so it has a zero first derivative by u. From this fact the ordinary derivative of q can be found. (Since q*q is constant equal to p*p, its derivative is 0 and is not written out.)
0 = Q(t,u)[!t!t] = 2(q.g(x2,x2).q + p.g(x1,x1).p - 2 q.g(x2,x1).p) 0 = Q(t,u)[!t!t][!u] = Q(t,u)[!t!t][2!i]h(x2)[i] = 2 (q[j][2!i] g(x2,x1)[j][k] p[k] + q[j] g(x2,x1)[j][k][2!i] p[k]) h(x2)[i] = 2 (q[j][2!i] + q[L] g(x2,x1)[L][m][2!i] g'(x2,x1)[m][j]) g(x2,x1)[j][k] p[k] h(x2)[i]
Where in the last step g'(x2,x1) is the inverse as a matrix of g(x2,x1). This is true if and only if the parenthesized term is in the null space of g(x2,x1)[j][k] p[k], but taking it as zero (not just in the null space) reveals a formula for the Christoffel symbols in terms of derivatives of the distance function. Leave out g(x2,x1)[j][k] p[k], let x2 == x1, and compare with the formula for the covariant derivative:
0 = (q[j][2!i] + q[L] g(x2,x1)[L][m][2!i] g'(x2,x1)[m][j]) h(x2)[i] 0 = (q[j][2!i] + q[L] C[L][i][m] g'(x2,x2)[m][j]) h(x2)[i] C[L][i][m] = g(x2,x1)[L][m][2!i] = -0.5 r2[2/L][1/m][2!i] C[i][j][k] = g(x2,x1)[i][k][2!j] = -0.5 r2[2/i][1/k][2!j]
where in the last line the subscript letters are merely substituted to have their usual values.
Ricci's theorem: g[i][j][/k] == 0. Proof:
g[i][j][/k] = g[i][j][2/k] + g[i][j][1/k] = 0.5(r2[2/i][1/j][2/k] + r2[2/i][1/j][1/k])
Because r2 is symmetric under an end-to-end interchange, then when x2 == x1, the two terms are equal and opposite. QED.