In mathematics, the inverse of an element x, with respect to an operation *, is an element x' such that their compose gives a neutral element. This generalizes the concepts of opposite and reciprocal of a number, and inverse functions, among others. An element is invertible iff it has an inverse.
The idea of inverse element generalises the concepts of (arithmetic) negation, in relation to addition (see additive inverse), and reciprocal, in relation to multiplication. The intuition is of an element that can 'undo' the effect of combination with another given element.
Let S be a set with a binary operation *. If e is an identity element of (S,*) and a * b = e, then a is called a left inverse of b and b is called a right inverse of a. If an element x is both a left inverse and a right inverse of y, then x is called a two-sided inverse, or simply an inverse, of y. An element with a two-sided inverse in S is called invertible in S.
Just like (S,*) can have several left identities or several right identities, it is possible for an element to have several left inverses or several right inverses (but note that their definition above uses a two-sided identity e). It can even have several left inverses and several right inverses.
However if the operation is associative, then if an element has both a left inverse and a right inverse, then they are equal and unique. In this case, the set of (left and right) invertible elements is a group, called the group of units of S, and denoted by U(S) or S*.
In addition to the opposite (− x) and reciprocal (1/x) of numbers, an important example is the notion of an invertible square matrix: An n×n matrix M over a field K is invertible if and only if its determinant is different from zero. If the determinant of M is zero, it is impossible for it to have a one-sided inverse; therefore a left inverse or right inverse implies the existence of the other one.
A function g is the left (resp. right) inverse of a function f (for function composition 'o'), iff g o f (resp. f o g) is the identity function on the domain (resp. codomain) of f. In this example, it is very frequent for a function to have a right inverse and no left inverse, or the converse.