Idempotence is the property of an operation or element for which repetition produces no further change after the first application. For a function , it means for every . For an element equipped with a multiplication, it means . These formulations are closely related: composing transformations is itself a form of multiplication.
The concept identifies processes that reach their final state in one step, elements that act as projections, and operations for which duplicate inputs or repeated requests are redundant. Examples include taking the absolute value of a real number, projecting a vector onto a subspace, forming the closure of a set, and assigning a specified value to a database field. In computing, the relevant equality often concerns the intended effect on system state rather than identical responses or identical execution histories.
The term arose in nineteenth-century algebra, notably in Benjamin Peirce’s work on linear associative algebras. It now connects structural questions in algebra and geometry with conditional expectation, logical operations, optimization, and the design of reliable software. Its precise meaning depends on what is being repeated and what counts as an unchanged result.
Functions, fixed points, and retractions
An endofunction is idempotent when
where denotes function composition. Consequently, every positive iterate equals the original function:
This does not normally include the zeroth iterate, which is the identity function. An idempotent function need not leave every input unchanged; it leaves unchanged every output that it can produce.
The decisive characterization is that the image of is exactly its set of fixed points:
If , then . Conversely, any fixed point belongs to the image because . Thus an idempotent function sends all inputs into a distinguished subset and acts as the identity on that subset. The absolute-value function on the real numbers is an example: its image is the nonnegative real numbers, all of which it fixes. The floor function, regarded as a real-valued function on the reals, similarly fixes its image, the integers.
This description gives a general construction. Choose a subset , and choose a function that fixes every member of . If is the inclusion, then is idempotent because . Such a map is a retraction. For nonempty , an idempotent function also determines a partition into its nonempty fibers: each fiber contains exactly one fixed point, which serves as its selected representative.
Idempotence is different from invertibility, periodicity, or convergence under iteration. If an idempotent function is injective, the equation implies ; the same conclusion follows if it is surjective. Thus the only bijective idempotent endofunction is the identity. By contrast, a nonidentity involution satisfies , undoing itself rather than stabilizing its first output. An iterative algorithm may approach a limit without being idempotent: repeated application changes the result at every finite stage. Idempotence describes exact stabilization after one application, not merely eventual or asymptotic stability.
Semigroups and the algebra of repeated multiplication
A semigroup is a set with an associative binary operation. An element of a semigroup is idempotent if . Associativity then gives for every positive integer . An identity element is always idempotent, but an idempotent need not be an identity for the whole semigroup. For example, a constant transformation is idempotent under composition, although it does not act as the identity on other transformations. In a group, the identity is the only idempotent: multiplying by gives .
The terminology is associated with Benjamin Peirce’s Linear Associative Algebra, presented in 1870 and published posthumously in 1881. Peirce used “idempotent” for elements unchanged by squaring, alongside “nilpotent” for elements whose sufficiently high powers vanish. These two kinds of elements remain fundamental in abstract algebra. Idempotence expresses persistence under multiplication, whereas nilpotence expresses eventual disappearance. Their interaction helps describe algebras through decompositions and representations.
Every nonempty finite semigroup contains an idempotent. To see why, begin with an element . Since only finitely many elements are available, its powers eventually repeat: there are positive integers such that
Choose a positive multiple of with . The exponents and lie in the periodic part and differ by a multiple of , so . Hence is idempotent. This result explains why idempotents occur throughout the study of finite transformation systems and finite-state computation.
A semigroup in which every element is idempotent is called a band. Commutativity is not part of that definition. For instance, the operation is associative and idempotent but is not commutative when the set has more than one element. A commutative band is a semilattice, connecting semigroup multiplication with order: defining
makes multiplication the greatest-lower-bound operation. Thus an algebraic identity can encode an ordering relation.
Idempotents also determine local identities inside larger semigroups. If , the subset
is a monoid with identity , even if has no global identity. Such local structures help organize semigroups whose elements are not globally invertible but contain regions with group-like behavior. This is one reason idempotents are structural objects rather than merely isolated solutions of a quadratic equation.
Idempotents in rings and Boolean algebra
In a ring , an idempotent is an element satisfying . In a ring with identity, both and are idempotent. If the ring has no zero divisors, the equation
forces or . Nontrivial idempotents therefore signal structure that cannot occur in a field or an integral domain. They are especially useful for detecting decompositions of rings and their modules.
If is idempotent, then is also idempotent, and
When commutes with every element of , it is called a central idempotent. In that case,
The two component rings have identities and , respectively. Conversely, a product of two nonzero rings has nontrivial central idempotents and . Thus nontrivial central idempotents characterize decompositions into products of nonzero unital rings.
A concrete example comes from modular arithmetic. In , the residue classes are idempotent:
The decomposition into arithmetic modulo and modulo explains the four possibilities: in each field component an idempotent must be either or . More generally, if a positive integer has distinct prime divisors, then has idempotents. Each prime-power component contributes an independent choice between zero and one.
A Boolean ring is a ring in which every element is idempotent. Such a ring necessarily has characteristic two and is commutative. Indeed, applying idempotence to gives , and expanding then yields , which in characteristic two means . The power set of a set supplies an example: multiplication is intersection, addition is symmetric difference, zero is the empty set, and the identity is the full set.
This construction corresponds to Boolean algebra. Intersection and union satisfy the idempotent laws
For logical propositions, the corresponding laws are and . Nevertheless, Boolean-ring addition is not idempotent: . The distinction matters because the same underlying objects can carry several operations, only some of which satisfy an idempotent law.
Linear projections and matrix structure
A linear operator on a vector space is idempotent when . Such operators are precisely linear projections, although the projection need not be orthogonal. Every vector has the decomposition
with and . The intersection of these two subspaces is zero, giving
Conversely, every decomposition determines a unique idempotent linear map that fixes and annihilates . An idempotent therefore records both a retained component and a discarded component.
For a finite-dimensional space, an idempotent matrix is diagonalizable over its underlying field. Its minimal polynomial divides
whose two roots are distinct over every field. Accordingly, all its eigenvalues belong to , with the eigenspace for equal to its image and the eigenspace for equal to its kernel. In a suitable basis,
Over the real or complex numbers, this implies that the trace equals the rank. Over a field of positive characteristic, the trace is the corresponding field element represented by that integer.
In an inner-product space, an orthogonal projection satisfies an additional symmetry condition: , where is the adjoint. Idempotence alone does not imply this. For example,
is idempotent for every real , but is orthogonal only when . For nonzero , it projects onto the horizontal axis along a nonperpendicular direction. Such oblique projections can increase vector lengths, whereas an orthogonal projection has operator norm at most one.
The interaction of multiple projections requires care. If and are commuting idempotents, then
Without commutativity, their product need not be idempotent. Alternating orthogonal projections onto two subspaces may converge to a projection onto their intersection, but a single product generally does not already perform that projection. This distinguishes exact algebraic projection from iterative projection methods.
Numerical computations introduce a further distinction. A mathematically idempotent matrix represented in floating-point arithmetic may satisfy , not exact equality. The residual measures failure of the algebraic identity, while measures failure of self-adjointness. Neither quantity alone describes every aspect of numerical quality: oblique projections, in particular, may be exactly idempotent but highly sensitive to perturbations because of the geometry of their image and kernel.
Closure, interior, and ordered structures
Idempotence appears throughout order theory, where it describes operations that completely impose a specified condition in one application. On a partially ordered set, a closure operator is a map satisfying three conditions:
These are extensivity, monotonicity, and idempotence. Together they mean that is the least closed object above , where “closed” means fixed by . Idempotence alone does not supply the ordering properties.
In topology, taking the closure of a subset is the standard example. If lies in a topological space, its closure is the smallest closed set containing it, and
Taking the interior is the order-dual construction: it is monotone, contractive, and idempotent. The interior of is the largest open subset contained in . Neither operation is normally invertible, because different subsets can have the same closure or the same interior.
Other closure operators arise from generation processes. In a vector space, the linear span of a set is unchanged by taking its span again. In a group, the subgroup generated by a set is already closed under the group operations. In logic, the set of all consequences of a collection of premises is deductively closed, provided consequence is defined with its usual closure properties. These examples have different mathematical objects but the same mechanism: the first application includes everything required by a condition, so another application adds nothing.
For a topological space , the closure operation on its power set has additional properties:
Together with extensivity and idempotence, these are the Kuratowski closure axioms. They allow a topology to be recovered from an operator rather than specified through its open sets. More general closure operators need not preserve finite unions, so not every order-theoretic closure comes from a topology.
Idempotence also underlies the meet and join operations of a lattice:
Here the repeated item is an operand, rather than the output of a unary operation. This difference is important: closure operators are idempotent under composition, whereas meet and join are idempotent binary operations. Moreover, composing two closure operators need not yield an idempotent operator. If they commute, their composition is again a closure operator; without commutativity, alternating them may require multiple stages before reaching a common fixed point.
Conditional expectation and statistical projections
In probability theory, conditional expectation is an important idempotent operation. Let be a probability space and let be a sub--algebra. For an integrable random variable , define
The result is already measurable with respect to , so conditioning it on again changes nothing:
These equalities hold almost surely, or exactly when random variables are treated as equivalence classes modulo almost-sure equality.
For square-integrable random variables, conditional expectation has a geometric interpretation in the Hilbert space . The -measurable square-integrable variables form a closed linear subspace, and is the orthogonal projection onto it. The residual satisfies
for every square-integrable -measurable . This characterizes conditional expectation as the least-squares approximation to obtainable from the information represented by . The defining conditional expectation also exists in , where the orthogonal Hilbert-space interpretation is no longer available.
For nested information sets , the tower property gives
Conditioning first on finer information and then on coarser information produces the coarser conditional expectation. Conditioning a variable already determined by the coarser information on the finer information leaves it unchanged. Setting recovers idempotence. For two nonnested information sets, their conditional-expectation operators need not commute, paralleling the behavior of general linear projections.
In ordinary least squares, a full-column-rank design matrix gives the fitted-value matrix
It satisfies and . The fitted response is , and fitting these fitted values again with the same design changes nothing. The residual-maker matrix is also an orthogonal projection. If the design has rank , these projections have ranks and , respectively, connecting the geometry to regression degrees of freedom.
Not all statistical smoothing is idempotent. For ridge regression, the smoother
generally has eigenvalues strictly between zero and one along nonzero design directions when . A second application shrinks those components again. Thus the distinction between projection and shrinkage can be expressed directly as a distinction between idempotent and nonidempotent linear operators.
Splitting idempotents in category theory
In category theory, an idempotent is an endomorphism satisfying
This abstracts the functional equation without assuming that objects are sets or that morphisms are ordinary functions. An idempotent splits if there are an object and morphisms
such that
The map is a retraction and is a section. Their composite on projects onto a copy of .
In the category of sets, every idempotent splits through its image. The same is true for vector spaces, groups, modules, and topological spaces, using the image with the appropriate inherited structure. For vector spaces, the resulting retract is also a direct summand, because the kernel supplies a complementary subspace. In other categories, “retract” is the more general notion and need not imply a direct-sum decomposition of the same kind.
Splitting is not automatic in an arbitrary category because the required object may be absent. Consider the category with one object whose endomorphisms are the integers under multiplication. The endomorphism is idempotent. A splitting would require integers with and , which is impossible. Although the multiplication law contains an idempotent, the category has no separate object available to represent its image. This illustrates why a familiar elementwise construction may fail when expressed only through objects and morphisms.
A category in which every idempotent splits is called idempotent-complete, or Karoubian. Every category has an idempotent completion, also called its Karoubi envelope. Its objects are pairs , where is an idempotent endomorphism of . A morphism from to is a morphism satisfying
The identity on is , rather than necessarily the original identity on . The construction formally supplies the images needed to split all idempotents.
This language is especially useful for modules. A finitely generated module is projective precisely when it is a direct summand of a finite-rank free module. Equivalently, it is isomorphic to the image of an idempotent matrix acting on that free module. The matrix equation therefore becomes a concrete way to specify an abstract summand. Idempotent completion expresses this passage from free objects to their retracts in a form that applies across many algebraic settings.
Idempotent addition and optimization
An idempotent semiring is a semiring whose addition satisfies
Unlike a ring, a semiring need not have additive inverses. This omission is essential: in an additive group, the equation would imply . Idempotent addition therefore supports algebraic systems in which combining alternatives removes duplication rather than accumulating multiplicity.
The max-plus semiring is a central example. Its underlying set is
with operations
The additive identity is , while the multiplicative identity is the ordinary number . The convention makes the additive identity absorbing for multiplication. Addition is idempotent because , but multiplication generally is not: . The min-plus version uses minimum and ordinary addition, with as its additive identity.
These operations encode path problems in graph theory. In min-plus matrix multiplication,
If matrix entries represent edge costs, the product selects the cheapest route through an intermediate vertex. Matrix powers represent minimum costs among walks with a specified number of edges, and appropriate combinations of powers address broader shortest-path questions. Duplicate descriptions of the same candidate cost do not change a minimum, which is the operational role of idempotent addition. Negative cycles require separate treatment because repeated traversal can drive costs downward without a finite optimum.
Any commutative idempotent addition defines a natural order by
For max-plus this is the usual numerical order; for min-plus it is the reverse order. Addition is the least upper bound in this induced order. This supplies a direct bridge between semiring algebra and order-theoretic formulations of optimization, including dynamic programming recurrences that combine candidate values by minimum or maximum.
The wider subject is often called tropical mathematics, although that term covers several related conventions and constructions. Tropical polynomials replace ordinary addition by minimum or maximum and multiplication by addition, producing piecewise-linear functions. Their geometric loci are consequently described by ties among affine expressions rather than ordinary polynomial zeros. Idempotence is thus not limited to operations that project existing objects: it can also serve as a basic arithmetic law for systems in which choosing the best alternative replaces summing all alternatives.
Repeated requests and software state
In computer science, an operation is commonly called idempotent when repeating it has the same intended effect on system state as performing it once. If a command induces a state transformation , the mathematical requirement is
Assigning a fixed value, such as setting a status to “closed,” can satisfy this equation. Incrementing a counter ordinarily does not. The crucial unit is the complete command, including its arguments: assigning the same value twice differs from assigning two different values in sequence.
This state-based interpretation does not require every observable aspect of execution to be identical. A repeated deletion might report success initially and “not found” later while leaving the same final resource state. Logging, monitoring counters, and response timestamps may differ. Consequently, an idempotence claim needs a defined scope: the application’s intended state transition, the entire database, or every externally observable event. An operation can be idempotent under one interpretation and nonidempotent under another.
The Hypertext Transfer Protocol uses idempotence to classify request methods. Under HTTP semantics, PUT and DELETE are idempotent, as are the safe methods, including GET and HEAD. This concerns the intended server-side effect of multiple identical requests, not a promise of identical response messages. POST is not defined to be idempotent, although an application can design a particular POST operation to suppress duplicates. An idempotent DELETE can remove a resource on its first execution and find it already absent on later executions.
Idempotence matters in distributed systems because a client may lose a connection after the server has executed a request but before the response arrives. Retrying can then duplicate an effect. An application programming interface may accept an idempotency key, a client-supplied identifier associated with one logical operation. A server can store the key with the operation’s result and reuse that result on a retry. Correct duplicate suppression requires coordination: recording the key separately from performing the state change can leave a failure window. Payload validation, retention periods, and concurrent requests with the same key also affect the guarantee.
Related systems exploit intrinsically idempotent operations. Adding an item to a set twice has the same set-valued effect as adding it once. In replicated data structures, merging states by a join operation can provide associativity, commutativity, and idempotence, allowing repeated or reordered deliveries without changing the merged result. These algebraic properties are central to many conflict-free replicated data types, although convergence also depends on the structure’s other rules.
Idempotence remains distinct from determinism, transactional atomicity, and exactly-once processing. A deterministic increment still increments twice; an atomic transaction can commit twice; and duplicate suppression can make repeated executions appear once without ensuring that the underlying code ran only once. The shared mathematical criterion is narrower: after the first application, repetition introduces no further change in the state or effect being specified.