In mathematics, a duality translates concepts, theorems, or mathematical structures into other concepts, theorems, or structures, in a one-to-one fashion, often (but not always) using an involution operation: if the dual of A is B, then the dual of B is A. Such involutions sometimes have fixed points so that the dual of A is A itself. For example, Desargues’ theorem is self-dual in this sense under the standard duality in projective geometry.

In mathematical contexts, duality has numerous meanings although it is “a very pervasive and important concept in (modern) mathematics” and “an important general theme that has manifestations in almost every area of mathematics”.

Many mathematical dualities between objects of two types correspond to pairings, bilinear functions from an object of one type and another object of the second type to some family of scalars. For instance, linear algebra duality corresponds in this way to bilinear maps from pairs of vector spaces to scalars, the duality between distributions and the associated test functions corresponds to the pairing in which one integrates a distribution against a test function, and Poincaré duality corresponds similarly to intersection number, viewed as a pairing between submanifolds of a given manifold.

From a category theory viewpoint, duality can also be seen as a functor, at least in the realm of vector spaces. This functor assigns to each space its dual space, and the pullback construction assigns to each arrow f: V → W its dual f∗: W∗ → V∗.

Duality in mathematics is not a theorem, but a “principle”.

The following list of examples shows the common features of many dualities, but also indicates that the precise meaning of duality may vary from case to case.

A complement of a subset

A simple, maybe the most simple, duality arises from considering subsets of a fixed set S. To any subset A ⊆ S, the complement Ac consists of all those elements in S that are not contained in A. It is again a subset of S. Taking the complement has the following properties:|

Applying it twice gives back the original set, i.e., (Ac)c = A. This is referred to by saying that the operation of taking the complement is an involution.

An inclusion of sets A ⊆ B is turned into inclusion in the opposite direction Bc ⊆ Ac.

Given two subsets A and B of S, A is contained in Bc if and only if B is contained in Ac.

This duality appears in topology as a duality between open and closed subsets of some fixed topological space X: a subset U of X is closed if and only if its complement in X is open. Because of this, many theorems about closed sets are dual to theorems about open sets. For example, any union of open sets is open, so dually, any intersection of closed sets is closed. The interior of a set is the largest open set contained in it, and the closure of the set is the smallest closed set that contains it. Because of the duality, the complement of the interior of any set U is equal to the closure of the complement of U.

There are many distinct but interrelated dualities in which geometric or topological objects correspond to other objects of the same type, but with a reversal of the dimensions of the features of the objects. A classical example of this is the duality of the platonic solids, in which the cube and the octahedron form a dual pair, the dodecahedron, and the icosahedron form a dual pair, and the tetrahedron is self-dual. The dual polyhedron of any of these polyhedra may be formed as the convex hull of the center points of each face of the primal polyhedron, so the vertices of the dual correspond one-for-one with the faces of the primal. Similarly, each edge of the dial corresponds to an edge of the primal, and each face of the dial corresponds to a vertex of the primal. These correspondences are incidence-preserving: if two parts of the primal polyhedron touch each other, so do the corresponding two parts of the dual polyhedron. More generally, using the concept of polar reciprocation, any convex polyhedron, or more generally any convex polytope, corresponds to a dual polyhedron or dual polytope, with an i-dimensional feature of an n-dimensional polytope corresponding to an (n − i − 1)-dimensional feature of the dual polytope. The incidence-preserving nature of the duality is reflected in the fact that the face lattices of the primal and dual polyhedra or polytopes are themselves order-theoretic duals. The duality of polytopes and order-theoretic duality are both involutions: the dual polytope of any polytope is the original polytope, and reversing all order-relations twice returns to the original order. Choosing a different center of polarity leads to geometrically different dual polytopes, but all have the same combinatorial structure.

A planar graph in blue, and its dual graph in red.

From any three-dimensional polyhedron, one can form a planar graph, the graph of its vertices and edges. The dual polyhedron has a dual graph, a graph with one vertex for each face of the polyhedron and with one edge for every two adjacent faces. The same concept of planar graph duality may be generalized to graphs that are drawn in the plane but that do not come from a three-dimensional polyhedron, or more generally to graph embeddings on surfaces of higher genus: one may draw a dual graph by placing one vertex within each region bounded by a cycle of edges in the embedding and drawing an edge connecting any two regions that share a boundary edge. An important example of this type comes from computational geometry: the duality for any finite set S of points in the plane between the Delaunay triangulation of S and the Voronoi diagram of S. As with dual polyhedra and dual polytopes, the duality of graphs on surfaces is a dimension-reversing involution: each vertex in the primal embedded graph corresponds to a region of the dual embedding, each edge in the primal is crossed by an edge in the dual, and each region of the primal corresponds to a vertex of the dual. The dual graph depends on how the primal graph is embedded: different planar embeddings of a single graph may lead to different dual graphs. Matroid duality is an algebraic extension of planar graph duality, in the sense that the dual matroid of the graphic matroid of a planar graph is isomorphic to the graphic matroid of the dual graph.

A kind of geometric duality also occurs in optimization theory, but not one that reverses dimensions. A linear program may be specified by a system of real variables (the coordinates for a point in Euclidean space {\displaystyle \mathbb {R} ^{n}}\mathbb {R} ^{n}), a system of linear constraints (specifying that the point lies in a halfspace; the intersection of these halfspaces is a convex polytope, the feasible region of the program), and a linear function (what to optimize). Every linear program has a dual problem with the same optimal solution, but the variables in the dual problem correspond to constraints in the primal problem and vice versa.