Riemannian metric (source code)

= Riemannian metric
{c}
{title2=$g$}
{wiki}

A Riemannian metric is a smoothly varying <positive-definite> <inner product> $g_p$ on each <tangent space> $T_pM$ of a <smooth manifold>. It measures <tangent vectors> before measuring entire journeys:
$$
\|v\|_g=\sqrt{g_p(v,v)},\qquad
\cos\theta=\frac{g_p(u,v)}{\|u\|_g\|v\|_g}\quad(u,v\ne0).
$$
Integrating this speed along a <curve> gives <arc length>; taking the <infimum> over routes gives <Riemannian distance>. A <smooth manifold> together with this measuring rule is a <Riemannian manifold>.

In a <coordinate chart> $(x^1,\ldots,x^n)$, the rule is represented by a smooth <positive-definite symmetric matrix> $G=(g_{ij})$:
$$
ds^2=\sum_{i,j}g_{ij}(x)\,dx^i\,dx^j,\qquad
g(v,v)=\sum_{i,j}g_{ij}(x)v^iv^j.
$$
The notation $ds^2$ describes the squared infinitesimal line element, rather than an ordinary distance between distinct points. Changing coordinates changes the <matrix> entries; it preserves the measured <norm> of the same <tangent vector>.

For the plane with $ds^2=4dx^2+dy^2$, the <vector> $(1,0)$ has <norm> $2$ and $(0,1)$ has <norm> $1$. The coordinate change $X=2x,Y=y$ turns this into $ds^2=dX^2+dY^2$: coefficients that look different can describe the same geometry. On a <circular cylinder> the <induced metric> $R^2d\theta^2+dz^2$ similarly becomes Euclidean when unrolled. On a round <sphere>, polar coordinates give $R^2d\phi^2+R^2\sin^2\phi\,d\theta^2$, away from the poles; the apparent degeneracy at a pole belongs to this coordinate choice, not to the <Riemannian metric>.

The point of the construction is that measurements make sense intrinsically, even without a chosen surrounding <Euclidean space>. It gives a common starting point for <geodesics>, <curvature> encoded by the <Riemann curvature tensor>, and the <Laplace-Beltrami operator>. https://www.math.ucla.edu/~petersen/RG.pdf[Peter Petersen, Riemannian Geometry, §1.1: smoothly varying tangent-space inner products]{ref}.