In the mathematical field of differential geometry, a metric tensor (or simply metric) is an additional structure on a manifold (such as a surface) that allows defining distances and angles, just as the inner product on a Euclidean space allows defining distances and angles there. More precisely, a metric tensor at a point of is a bilinear form defined on the tangent space at (that is, a bilinear function that maps pairs of tangent vectors to real numbers), and a metric field on consists of a metric tensor at each point of that varies smoothly with .

A metric tensor is positive-definite if for every nonzero vector . A manifold equipped with a positive-definite metric tensor is known as a Riemannian manifold. Such a metric tensor can be thought of as specifying infinitesimal distance on the manifold. On a Riemannian manifold , the length of a smooth curve between two points and can be defined by integration, and the distance between and can be defined as the infimum of the lengths of all such curves; this makes a metric space. Conversely, the metric tensor itself is the derivative of the distance function (taken in a suitable manner).

While the notion of a metric tensor was known in some sense to mathematicians such as Gauss from the early 19th century, it was not until the early 20th century that its properties as a tensor were understood by, in particular, Gregorio Ricci-Curbastro and Tullio Levi-Civita, who first codified the notion of a tensor. The metric tensor is an example of a tensor field.

The components of a metric tensor in a coordinate basis take on the form of a symmetric matrix whose entries transform covariantly under changes to the coordinate system. Thus a metric tensor is a covariant symmetric tensor. From the coordinate-independent point of view, a metric tensor field is defined to be a nondegenerate symmetric bilinear form on each tangent space that varies smoothly from point to point.

Introduction Carl Friedrich Gauss in his 1827 Disquisitiones generales circa superficies curvas (General investigations of curved surfaces) considered a surface parametrically, with the Cartesian coordinates , , and of points on the surface depending on two auxiliary variables and . Thus a parametric surface is (in today's terms) a vector-valued function

depending on an ordered pair of real variables , and defined in an open set in the -plane. One of the chief aims of Gauss's investigations was to deduce those features of the surface which could be described by a function which would remain unchanged if the surface underwent a transformation in space (such as bending the surface without stretching it), or a change in the particular parametric form of the same geometrical surface.

One natural such invariant quantity is the length of a curve drawn along the surface. Another is the angle between a pair of curves drawn along the surface and meeting at a common point. A third such quantity is the area of a piece of the surface. The study of these invariants of a surface led Gauss to introduce the predecessor of the modern notion of the metric tensor.

The metric tensor is in the description below; E, F, and G in the matrix can contain any number as long as the matrix is positive definite.

Arc length If the variables and are taken to depend on a third variable, , taking values in an interval , then will trace out a parametric curve in parametric surface . The arc length of that curve is given by the integral

where represents the Euclidean norm. Here the chain rule has been applied, and the subscripts denote partial derivatives:

The integrand is the restrictionMore precisely, the integrand is the pullback of this differential to the curve. to the curve of the square root of the (quadratic) differential

where

The quantity in () is called the line element, while is called the first fundamental form of . Intuitively, it represents the principal part of the square of the displacement undergone by when is increased by units, and is increased by units.

Using matrix notation, the first fundamental form becomes

Coordinate transformations Suppose now that a different parameterization is selected, by allowing and to depend on another pair of variables and . Then the analog of () for the new variables is

The chain rule relates , , and to , , and via the matrix equation

where the superscript T denotes the matrix transpose. The matrix with the coefficients , , and arranged in this way therefore transforms by the Jacobian matrix of the coordinate change

A matrix which transforms in this way is one kind of what is called a tensor. The matrix

with the transformation law () is known as the metric tensor of the surface.

Invariance of arclength under coordinate transformations first observed the significance of a system of coefficients , , and , that transformed in this way on passing from one system of coordinates to another. The upshot is that the first fundamental form () is invariant under changes in the coordinate system, and that this follows exclusively from the transformation properties of , , and . Indeed, by the chain rule,

so that

Length and angle Another interpretation of the metric tensor, also considered by Gauss, is that it provides a way in which to compute the length of tangent vectors to the surface, as well as the angle between two tangent vectors. In contemporary terms, the metric tensor allows one to compute the dot product of tangent vectors in a manner independent of the parametric description of the surface. Any tangent vector at a point of the parametric surface can be written in the form

for suitable real numbers and . If two tangent vectors are given:

then using the bilinearity of the dot product,

This is plainly a function of the four variables , , , and . It is more profitably viewed, however, as a function that takes a pair of arguments and which are vectors in the -plane. That is, put

This is a symmetric function in and , meaning that

It is also bilinear, meaning that it is linear in each variable and separately. That is,

for any vectors , , , and in the plane, and any real numbers and .

In particular, the length of a tangent vector is given by

and the angle between two vectors and is calculated by

Area The surface area is another numerical quantity which should depend only on the surface itself, and not on how it is parameterized. If the surface is parameterized by the function over the domain in the -plane, then the surface area of is given by the integral

where denotes the cross product, and the absolute value denotes the length of a vector in Euclidean space. By Lagrange's identity for the cross product, the integral can be written

where is the determinant.

Definition Let be a smooth manifold of dimension ; for instance a surface (in the case ) or hypersurface in the Cartesian space . At each point there is a vector space , called the tangent space, consisting of all tangent vectors to the manifold at the point . A metric tensor at is a function which takes as inputs a pair of tangent vectors and at , and produces as an output a real number (scalar), so that the following conditions are satisfied: is bilinear. A function of two vector arguments is bilinear if it is linear separately in each argument. Thus if , , are three tangent vectors at and and are real numbers, then is symmetric.In several formulations of classical unified field theories, the metric tensor was allowed to be non-symmetric; however, the antisymmetric part of such a tensor plays no role in the contexts described here, so it will not be further considered. A function of two vector arguments is symmetric provided that for all vectors and , is nondegenerate. A bilinear function is nondegenerate provided that, for every tangent vector , the function obtained by holding constant and allowing to vary is not identically zero. That is, for every there exists a such that .

A metric tensor field on assigns to each point of a metric tensor in the tangent space at in a way that varies smoothly with . More precisely, given any open subset of manifold and any (smooth) vector fields and on , the real function

is a smooth function of .

Components of the metric

The components of the metric in any basis of vector fields, or frame, are given byThe notation of using square brackets to denote the basis in terms of which the components are calculated is not universal. The notation employed here is modeled on that of . Typically, such explicit dependence on the basis is entirely suppressed.

The functions form the entries of an symmetric matrix, . If

are two vectors at , then the value of the metric applied to and is determined by the coefficients () by bilinearity:

Denoting the matrix by and arranging the components of the vectors and into column vectors and ,

where T and T denote the transpose of the vectors and , respectively. Under a change of basis of the form

for some invertible matrix , the matrix of components of the metric changes by as well. That is,

or, in terms of the entries of this matrix,

For this reason, the system of quantities is said to transform covariantly with respect to changes in the frame .

Metric in coordinates A system of real-valued functions , giving a local coordinate system on an open set in , determines a basis of vector fields on

The metric has components relative to this frame given by

Relative to a new system of local coordinates, say

the metric tensor will determine a different matrix of coefficients,

This new system of functions is related to the original by means of the chain rule

so that

Or, in terms of the matrices and ,

where denotes the Jacobian matrix of the coordinate change.

Signature of a metric

Associated to any metric tensor is the quadratic form defined in each tangent space by

If is positive for all non-zero , then the metric is positive-definite at . If the metric is positive-definite at every , then is called a Riemannian metric. More generally, if the quadratic forms have constant signature independent of , then the signature of is this signature, and is called a pseudo-Riemannian metric. If is connected, then the signature of does not depend on .

By Sylvester's law of inertia, a basis of tangent vectors can be chosen locally so that the quadratic form diagonalizes in the following manner

for some between 1 and . Any two such expressions of (at the same point of ) will have the same number of positive signs. The signature of is the pair of integers , signifying that there are positive signs and negative signs in any such expression. Equivalently, the metric has signature if the matrix of the metric has positive and negative eigenvalues.

Certain metric signatures which arise frequently in applications are: If has signature , then is a Riemannian metric, and is called a Riemannian manifold. Otherwise, is a pseudo-Riemannian metric, and is called a pseudo-Riemannian manifold (the term semi-Riemannian is also used). If is four-dimensional with signature or , then the metric is called Lorentzian. More generally, a metric tensor in dimension other than 4 of signature or is sometimes also called Lorentzian. If is -dimensional and has signature , then the metric is called ultrahyperbolic.

Inverse metric Let be a basis of vector fields, and as above let be the matrix of coefficients

One can consider the inverse matrix , which is identified with the inverse metric (or conjugate or dual metric). The inverse metric satisfies a transformation law when the frame is changed by a matrix via

The inverse metric transforms contravariantly, or with respect to the inverse of the change of basis matrix . Whereas the metric itself provides a way to measure the length of (or angle between) vector fields, the inverse metric supplies a means of measuring the length of (or angle between) covector fields; that is, fields of linear functionals.