# Metric tensor

In the mathematical field of differential geometry, a **metric tensor** is a type of function defined on a manifold (such as a surface in space) which takes as input a pair of tangent vectors *v* and *w* and produces a real number (scalar) *g*(*v*,*w*) in a way that generalizes many of the familiar properties of the dot product of vectors in Euclidean space. In the same way as a dot product, metric tensors are used to define the length of, and angle between, tangent vectors.

A metric tensor is called *positive-definite* if it assigns a positive value to every nonzero vector. A manifold equipped with a positive-definite metric tensor is known as a Riemannian manifold. By integration, the metric tensor allows one to define and compute the length of curves on the manifold. The curve connecting two points that (locally) has the smallest length is called a geodesic, and its length is the distance that a passenger in the manifold needs to traverse to go from one point to the other. Equipped with this notion of length, a Riemannian manifold is a metric space, meaning that it has a distance function *d*(*p*,*q*) whose value at a pair of points *p* and *q* is the distance from *p* to *q*. Conversely, the metric tensor itself is the derivative of the distance function (taken in a suitable manner). Thus the metric tensor gives the *infinitesimal* distance on the manifold.

While the notion of a metric tensor was known in some sense to mathematicians such as Carl 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.

With a holonomic basis on the manifold, a metric tensor takes 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 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 *x*, *y*, and *z* of points on the surface depending on two auxiliary variables *u* and *v*. Thus a parametric surface is (in today's terms) a vector valued function

depending on an ordered pair of real variables (*u*,*v*), and defined in an open set *D* in the *uv*-plane. One of the chief aims of Gauss' 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, or tangent vectors at the same point of the surface. 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.

### Arclength

If the variables *u* and *v* are taken to depend on a third variable, *t*, taking values in an interval [*a*,*b*], then will trace out a parametric curve in parametric surface *M*. The arclength 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 restriction^{[1]} to the curve of the square root of the (quadratic) differential

where

The quantity *ds* in (Template:EquationNote) is called the **line element**, while *ds*^{2} is called the **first fundamental form** of *M*. Intuitively, it represents the principal part of the square of the displacement undergone by when *u* is increased by *du* units, and *v* is increased by *dv* units.

Using matrix notation, the first fundamental form becomes

### Coordinate transformations

Suppose now that a different parameterization is selected, by allowing *u* and *v* to depend on another pair of variables *u*′ and *v*′. Then the analog of (Template:EquationNote) for the new variables is
Template:NumBlk

The chain rule relates *E*′, *F*′, and *G*′ to *E*,*F*, and *G* via the matrix equation

Template:NumBlk
where the superscript *T* denotes the matrix transpose. The matrix with the coefficients *E*, *F*, and *G* 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 (Template:EquationNote) is known as the **metric tensor** of the surface.

### Invariance of arclength under coordinate transformations

Template:Harvtxt first observed the significance of a system of coefficients *E*, *F*, and *G*, that transformed in this way on passing from one system of coordinates to another. The upshot is that the first fundamental form (Template:EquationNote) is *invariant* under changes in the coordinate system, and that this follows exclusively from the transformation properties of *E*, *F*, and *G*. 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 *M* can be written in the form

for suitable real numbers *p*_{1} and *p*_{2}. If two tangent vectors are given

then using the bilinearity of the dot product,

This is plainly a function of the four variables *a*_{1}, *b*_{1}, *a*_{2}, and *b*_{2}. It is more profitably viewed, however, as a function that takes a pair of arguments **a** = [*a*_{1} *a*_{2}] and **b** = [*b*_{1} *b*_{2}] which are vectors in the *uv*-plane. That is, put

This is a symmetric function in **a** and **b**, meaning that

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

for any vectors **a**, **a**′, **b**, and **b**′ in the *uv* plane, and any real numbers μ and λ.

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

and the angle θ between two vectors **a** and **b** 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 *M* is parameterized by the function over the domain *D* in the *uv*-plane, then the surface area of *M* 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 det is the determinant.

## Definition

Let *M* be a smooth manifold of dimension *n*; for instance a surface (in the case *n* = 2) or hypersurface in the Cartesian space **R**^{n+1}. At each point *p* ∈ *M* there is a vector space T_{p}*M*, called the tangent space, consisting of all tangent vectors to the manifold at the point *p*. A **metric at p** is a function

*g*

_{p}(

*X*

_{p},

*Y*

_{p}) which takes as inputs a pair of tangent vectors

*X*

_{p}and

*Y*

_{p}at

*p*, and produces as an output a real number (scalar), so that the following conditions are satisfied:

*g*_{p}is**bilinear**. A function of two vector arguments is bilinear if it is linear separately in each argument. Thus if*U*_{p},*V*_{p},*Y*_{p}are three tangent vectors at*p*and*a*and*b*are real numbers, then

*g*_{p}is**symmetric**.^{[2]}A function of two vector arguments is symmetric provided that for all vectors*X*_{p}and*Y*_{p},

*g*_{p}is**nondegenerate**. A bilinear function is nondegenerate provided that, for every tangent vector*X*_{p}≠ 0, the function

- obtained by holding
*X*_{p}constant and allowing*Y*_{p}to vary is not identically zero. That is, for every*X*_{p}≠ 0 there exists a*Y*_{p}such that*g*_{p}(*X*_{p},*Y*_{p}) ≠ 0.

A **metric tensor** *g* on *M* assigns to each point *p* of *M* a metric *g*_{p} in the tangent space at *p* in a way that varies smoothly with *p*. More precisely, given any open subset *U* of manifold *M* and any (smooth) vector fields *X* and *Y* on *U*, the real function

is a smooth function of *p*.

## Components of the metric

{{#invoke:Hatnote|hatnote}}
The components of the metric in any basis of vector fields, or frame, **f** = (*X*_{1}, …, *X*_{n}) are given by^{[3]}
Template:NumBlk
The *n*^{2} functions *g*_{ij}[**f**] form the entries of an *n*×*n* symmetric matrix, *G*[**f**]. If

are two vectors at *p* ∈ *U*, then the value of the metric applied to *v* and *w* is determined by the coefficients (Template:EquationNote) by bilinearity:

Denoting the matrix (*g*_{ij}[**f**]) by *G*[**f**] and arranging the components of the vectors *v* and *w* into column vectors **v**[**f**] and **w**[**f**],

where **v**[**f**]^{T} and **w**[**f**]^{T} denote the transpose of the vectors **v**[**f**] and **w**[**f**], respectively. Under a change of basis of the form

for some invertible *n*×*n* matrix *A* = (*a*_{ij}), the matrix of components of the metric changes by *A* as well. That is,

or, in terms of the entries of this matrix,

For this reason, the system of quantities *g*_{ij}[**f**] is said to **transform covariantly** with respect to changes in the frame **f**.

### Metric in coordinates

A system of *n* real valued functions (*x*^{1}, …, *x*^{n}), giving a local coordinate system on an open set *U* in *M*, determines a basis of vector fields on *U*

The metric *g* 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 *g*_{ij}(**f**) by means of the chain rule

so that

Or, in terms of the matrices *G*[**f**] = (*g*_{ij}[**f**]) and *G*[**f**′] = (*g*_{ij}[**f**′]),

where *Dy* denotes the Jacobian matrix of the coordinate change.

### Signature of a metric

{{#invoke:main|main}}

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

If *q*_{m} is positive for all non-zero *X*_{m}, then the metric is positive definite at *m*. If the metric is positive definite at every *m* ∈ *M*, then *g* is called a Riemannian metric. More generally, if the quadratic forms *q*_{m} have constant signature independent of *m*, then the **signature of g** is this signature, and

*g*is called a pseudo-Riemannian metric.

^{[4]}If

*M*is connected, then the signature of

*q*

_{m}does not depend on

*m*.

^{[5]}

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

for some *p* between 1 and *n*. Any two such expressions of *q* (at the same point *m* of *M*) will have the same number *p* of positive signs. The signature of *g* is the pair of integers (*p*, *n* − *p*), signifying that there are *p* positive signs and *n* − *p* negative signs in any such expression. Equivalently, the metric has signature (*p*,*n* − *p*) if the matrix *g*_{ij} of the metric has *p* positive and *n* − *p* negative eigenvalues.

Certain metric signatures which arise frequently in applications are:

- If
*g*has signature (*n*, 0), then*g*is a Riemannian metric, and*M*is called a Riemannian manifold. Otherwise,*g*is a pseudo-Riemannian metric, and*M*is called a pseudo-Riemannian manifold (the term semi-Riemannian is also used). - If
*M*is four-dimensional with signature (1,3) or (3,1), then the metric is called Lorentzian. More generally, a metric tensor in dimension*n*other than 4 of signature (1,*n*− 1) or (*n*− 1, 1) is sometimes also called Lorentzian. - If
*M*is 2*n*-dimensional and*g*has signature (*n*,*n*), then the metric is called ultrahyperbolic.

### Inverse metric

Let **f** = (*X*_{1}, …, *X*_{n}) be a basis of vector fields, and as above let *G*[**f**] be the matrix of coeffients

One can consider the inverse matrix *G*[**f**]^{−1}, which is identified with the **inverse metric** (or *conjugate* or *dual metric*). The inverse metric satisfies a transformation law when the frame **f** is changed by a matrix *A* via

The inverse metric transforms *contravariantly*, or with respect to the inverse of the change of basis matrix *A*. 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.

To see this, suppose that α is a covector field. To wit, for each point *p*, α determines a function α_{p} defined on tangent vectors at *p* so that the following linearity condition holds for all tangent vectors *X*_{p} and *Y*_{p}, and all real numbers *a* and *b*:

As *p* varies, α is assumed to be a smooth function in the sense that

is a smooth function of *p* for any smooth vector field *X*.

Any covector field α has components in the basis of vector fields **f**. These are determined by

Denote the row vector of these components by

Under a change of **f** by a matrix *A*, α[**f**] changes by the rule

That is, the row vector of components α[**f**] transforms as a *covariant* vector.

For a pair α and β of covector fields, define the inverse metric applied to these two covectors by

The resulting definition, although it involves the choice of basis **f**, does not actually depend on **f** in an essential way. Indeed, changing basis to **f***A* gives

So that the right-hand side of equation (Template:EquationNote) is unaffected by changing the basis **f** to any other basis **f***A* whatsoever. Consequently, the equation may be assigned a meaning independently of the choice of basis. The entries of the matrix *G*[**f**] are denoted by *g*^{ij}, where the indices *i* and *j* have been raised to indicate the transformation law (Template:EquationNote).

### Raising and lowering indices

{{#invoke:see also|seealso}}
In a basis of vector fields **f** = (*X*_{1}, …, *X*_{n}), any smooth tangent vector field *X* can be written in the form

for some uniquely determined smooth functions *v*^{1}, …, *v*^{n}. Upon changing the basis **f** by a nonsingular matrix *A*, the coefficients *v*^{i} change in such a way that equation (Template:EquationNote) remains true. That is,

Consequently, *v*[**f***A*] = *A*^{−1}*v*[**f**]. In other words, the components of a vector transform *contravariantly* (with respect to the inverse) under a change of basis by the nonsingular matrix *A*. The contravariance of the components of *v*[**f**] is notationally designated by placing the indices of *v*^{i}[**f**] in the upper position.

A frame also allows covectors to be expressed in terms of their components. For the basis of vector fields **f** = (*X*_{1}, …, *X*_{n}) define the dual basis to be the linear functionals (θ^{1}[**f**], …, θ^{n}[**f**]) such that

That is, θ^{i}[**f**](*X*_{j}) = δ_{j}^{i}, the Kronecker delta. Let

Under a change of basis **f** → **f***A* for a nonsingular matrix *A*, θ[**f**] transforms via

Any linear functional α on tangent vectors can be expanded in terms of the dual basis θ

where *a*[**f**] denotes the row vector [*a*_{1}[**f**] … *a*_{n}[**f**] ]. The components *a*_{i} transform when the basis **f** is replaced by **f***A* in such a way that equation (Template:EquationNote) continues to hold. That is,

whence, because θ[**f***A*] = *A*^{−1}θ[**f**], it follows that *a*[**f***A*] = *a*[**f**]*A*. That is, the components *a* transform *covariantly* (by the matrix *A* rather than its inverse). The covariance of the components of *a*[**f**] is notationally designated by placing the indices of *a*_{i}[**f**] in the lower position.

Now, the metric tensor gives a means to identify vectors and covectors as follows. Holding *X*_{p} fixed, the function

of tangent vector *Y*_{p} defines a linear functional on the tangent space at *p*. This operation takes a vector *X*_{p} at a point *p* and produces a covector *g*_{p}(*X*_{p}, −). In a basis of vector fields **f**, if a vector field *X* has components *v*[**f**], then the components of the covector field *g*(*X*, −) in the dual basis are given by the entries of the row vector

Under a change of basis **f**→**f***A*, the right-hand side of this equation transforms via

so that *a*[**f***A*] = *a*[**f**]*A*: *a* transforms covariantly. The operation of associating to the (contravariant) components of a vector field *v*[**f**] = [*v*^{1}[**f**] *v*^{2}[**f**] … *v*^{n}[**f**] ]^{T} the (covariant) components of the covector field *a*[**f**] = [*a*_{1}[**f**] *a*_{2}[**f**] … *a*_{n}[**f**] ] where

is called **lowering the index**.

To *raise the index*, one applies the same construction but with the inverse metric instead of the metric. If *a*[**f**] = [*a*_{1}[**f**] *a*_{2}[**f**] … *a*_{n}[**f**] ] are the components of a covector in the dual basis θ[**f**], then the column vector
Template:NumBlk
has components which transform contravariantly:

Consequently, the quantity *X* = **f**v[**f**] does not depend on the choice of basis **f** in an essential way, and thus defines a vector field on *M*. The operation (Template:EquationNote) associating to the (covariant) components of a covector *a*[**f**] the (contravariant) components of a vector *v*[**f**] given is called **raising the index**. In components, (Template:EquationNote) is

### Induced metric

Let *U* be an open set in **R**^{n}, and let φ be a continuously differentiable function from *U* into the Euclidean space **R**^{m} where *m* > *n*. The mapping φ is called an immersion if its differential is injective at every point of *U*. The image of φ is called an immersed submanifold.

Suppose that φ is an immersion onto the submanifold *M* ⊂ **R**^{m}. The usual Euclidean dot product in **R**^{m} is a metric which, when restricted to vectors tangent to *M*, gives a means for taking the dot product of these tangent vectors. This is called the **induced metric**.

Suppose that *v* is a tangent vector at a point of *U*, say

where **e**_{i} are the standard coordinate vectors in **R**^{n}. When φ is applied to *U*, the vector *v* goes over to the vector tangent to *M* given by

(This is called the pushforward of *v* along φ.) Given two such vectors, *v* and *w*, the induced metric is defined by

It follows from a straightforward calculation that the matrix of the induced metric in the basis of coordinate vector fields **e** is given by

where Dφ is the Jacobian matrix:

## Intrinsic definitions of a metric

The notion of a metric can be defined intrinsically using the language of fiber bundles and vector bundles. In these terms, a **metric tensor** is a function

from the fiber product of the tangent bundle of *M* with itself to **R** such that the restriction of *g* to each fiber is a nondegenerate bilinear mapping

The mapping (Template:EquationNote) is required to be continuous, and often continuously differentiable, smooth, or real analytic, depending on the case of interest, and whether *M* can support such a structure.

### Metric as a section of a bundle

By the universal property of the tensor product, any bilinear mapping (Template:EquationNote) gives rise naturally to a section *g*_{⊗} of the dual of the tensor product bundle of T*M* with itself

The section *g*_{⊗} is defined on simple elements of T*M*⊗T*M* by

and is defined on arbitrary elements of T*M*⊗T*M* by extending linearly to linear combinations of simple elements. The original bilinear form *g* is symmetric if and only if

where

is the braiding map.

Since *M* is finite-dimensional, there is a natural isomorphism

so that *g*_{⊗} is regarded also as a section of the bundle T**M*⊗T**M* of the cotangent bundle T**M* with itself. Since *g* is symmetric as a bilinear mapping, it follows that *g*_{⊗} is a symmetric tensor.

### Metric in a vector bundle

More generally, one may speak of a metric in a vector bundle. If *E* is a vector bundle over a manifold *M*, then a metric is a mapping

from the fiber product of *E* to **R** which is bilinear in each fiber:

Using duality as above, a metric is often identified with a section of the tensor product bundle , (See metric (vector bundle).)

### Tangent-cotangent isomorphism

{{#invoke:see also|seealso}}
The metric tensor gives a natural isomorphism from the tangent bundle to the cotangent bundle, sometimes called the musical isomorphism.^{[6]} This isomorphism is obtained by setting, for each tangent vector *X*_{p} ∈ T_{p}*M*,

the linear functional on T_{p}*M* which sends a tangent vector *Y*_{p} at *p* to *g*_{p}(*X*_{p},*Y*_{p}). That is, in terms of the pairing [−,−] between T_{p}*M* and its dual space *T*_{p}**M*,

for all tangent vectors *X*_{p} and *Y*_{p}. The mapping *S*_{g} is a linear transformation from T_{p}*M* to T_{p}**M*. It follows from the definition of non-degeneracy that the kernel of *S*_{g} is reduced to zero, and so by the rank-nullity theorem, *S*_{g} is a linear isomorphism. Furthermore, *S*_{g} is a symmetric linear transformation in the sense that

for all tangent vectors *X*_{p} and *Y*_{p}.

Conversely, any linear isomorphism *S* : T_{p}*M* → T_{p}**M* defines a non-degenerate bilinear form on T_{p}*M* by means of

This bilinear form is symmetric if and only if *S* is symmetric. There is thus a natural one-to-one correspondence between symmetric bilinear forms on T_{p}*M* and symmetric linear isomorphisms of T_{p}*M* to the dual T_{p}**M*.

As *p* varies over *M*, *S*_{g} defines a section of the bundle Hom(T*M*,T**M*) of vector bundle isomorphisms of the tangent bundle to the cotangent bundle. This section has the same smoothness as *g*: it is continuous, differentiable, smooth, or real-analytic according as *g*. The mapping *S*_{g}, which associates to every vector field on *M* a covector field on *M* gives an abstract formulation of "lowering the index" on a vector field. The inverse of *S*_{g} is a mapping T**M* → T*M* which, analogously, gives an abstract formulation of "raising the index" on a covector field.

The inverse *S*_{g}^{−1} defines a linear mapping

which is nonsingular and symmetric in the sense that

for all covectors α, β. Such a nonsingular symmetric mapping gives rise (by the tensor-hom adjunction) to a map

or by the double dual isomorphism to a section of the tensor product

## Arclength and the line element

Suppose that *g* is a Riemannian metric on *M*. In a local coordinate system *x*^{i}, *i* = 1,2,…,*n*, the metric tensor appears as a matrix, denoted here by **G**, whose entries are the components *g*_{ij} of the metric tensor relative to the coordinate vector fields.

Let be a piecewise differentiable parametric curve in *M*, for *a* ≤*t* ≤ *b*. The **arclength** of the curve is defined by

In connection with this geometrical application, the quadratic differential form

is called the first fundamental form associated to the metric, while *ds* is the line element. When *ds*^{2} is pulled back to the image of a curve in *M*, it represents the square of the differential with respect to arclength.

For a pseudo-Riemannian metric, the length formula above is not always defined, because the term under the square root may become negative. We generally only define the length of a curve when the quantity under the square root is always of one sign or the other. In this case, define

Note that, while these formulas use coordinate expressions, they are in fact independent of the coordinates chosen; they depend only on the metric, and the curve along which the formula is integrated.

### The energy, variational principles and geodesics

Given a segment of a curve, another frequently defined quantity is the (kinetic) **energy** of the curve:

This usage comes from physics, specifically, classical mechanics, where the integral *E* can be seen to directly correspond to the kinetic energy of a point particle moving on the surface of a manifold. Thus, for example, in Jacobi's formulation of Maupertuis principle, the metric tensor can be seen to correspond to the mass tensor of a moving particle.

In many cases, whenever a calculation calls for the length to be used, a similar calculation using the energy may be done as well. This often leads to simpler formulas by avoiding the need for the square-root. Thus, for example, the geodesic equations may be obtained by applying variational principles to either the length or the energy. In the latter case, the geodesic equations are seen to arise from the principle of least action: they describe the motion of a "free particle" (a particle feeling no forces) that is confined to move on the manifold, but otherwise moves freely, with constant momentum, within the manifold.^{[7]}

## Canonical measure and volume form

In analogy with the case of surfaces, a metric tensor on an *n*-dimensional paracompact manifold *M* gives rise to a natural way to measure the *n*-dimensional volume of subsets of the manifold. The resulting natural positive Borel measure allows one to develop a theory of integrating functions on the manifold by means of the associated Lebesgue integral.

A measure can be defined, by the Riesz representation theorem, by giving a positive linear functional Λ on the space *C*_{0}(*M*) of compactly supported continuous functions on *M*. More precisely, if *M* is a manifold with a (pseudo-)Riemannian metric tensor *g*, then there is a unique positive Borel measure μ_{g} such that for any coordinate chart (*U*,φ),

for all *ƒ* supported in *U*. Here det *g* is the determinant of the matrix formed by the components of the metric tensor in the coordinate chart. That Λ is well-defined on functions supported in coordinate neighborhoods is justified by Jacobian change of variables. It extends to a unique positive linear functional on *C*_{0}(*M*) by means of a partition of unity.

If *M* is in addition oriented, then it is possible to define a natural volume form from the metric tensor. In a positively oriented coordinate system (*x*^{1},...,*x*^{n}) the volume form is represented as

where the *dx*^{i} are the coordinate differentials and the wedge ∧ denotes the exterior product in the algebra of differential forms. The volume form also gives a way to integrate functions on the manifold, and this geometric integral agrees with the integral obtained by the canonical Borel measure.

## Examples

### The *Euclidean metric*

The most familiar example is that of elementary Euclidean geometry: the two-dimensional Euclidean metric tensor. In the usual - coordinates, we can write

The length of a curve reduces to the formula:

The Euclidean metric in some other common coordinate systems can be written as follows.

So