In multilinear algebra and tensor analysis, covariance and contravariance describe how the quantitative description of certain geometric or physical entities changes with a change of basis.
In physics, a basis is sometimes thought of as a set of reference axes. A change of scale on the reference axes corresponds to a change of units in the problem. For instance, in changing scale from meters to centimeters (that is, dividing the scale of the reference axes by 100), the components of a measured velocity vector will multiply by 100. Vectors exhibit this behavior of changing scale inversely to changes in scale to the reference axes: they are contravariant. As a result, vectors often have units of distance or distance times some other unit (like the velocity).
In contrast, dual vectors (also called covectors) typically have units the inverse of distance or the inverse of distance times some other unit. An example of a dual vector is the gradient, which has units of a spatial derivative, or distance−1. The components of dual vectors change in the same way as changes to scale of the reference axes: they are covariant.
The components of vectors and covectors also transform in the same manner under more general changes in basis:
Curvilinear coordinate systems, such as cylindrical or spherical coordinates, are often used in physical and geometric problems. Associated to any coordinate system is a natural choice of coordinate basis for vectors based at each point of the space, and covariance and contravariance are particularly important for understanding how the coordinate description of a vector changes in passing from one coordinate system to another.
The terms "covariant" and "contravariant" were introduced by James Joseph Sylvester in 1853 in the context of algebraic invariant theory, where, for instance, a system of simultaneous equations is contravariant in the variables. In the lexicon of category theory, covariance and contravariance are properties of functors; unfortunately, it is the lower-index objects (covectors) that generically have pullbacks, which are contravariant, while the upper-index objects (vectors) instead have pushforwards, which are covariant. This terminological conflict may be avoided by calling contravariant functors "cofunctors"—in accord with the "covector" terminology, and continuing the tradition of treating vectors as the concept and covectors as the coconcept.