Idempotence
lastmod 2025-11-19created 2025-11-191 edits
Idempotence (the idempotent law; English: idempotent) is a property of operations in mathematics and computer science: applying an operation multiple times does not change the result. The concept of idempotence is used in many parts of abstract algebra (especially the theory of projection operators and closure operators) and functional programming (related to the property of referential transparency).
The concept of idempotence has several meanings depending on where it is applied.
- A unary operation (or function) is idempotent if, when applied twice to any value, it gives the same result as when applied once, i.e., f(f(x)) ≡ f(x). For example, the absolute value function is idempotent: abs(abs(x)) ≡ abs(x).
- A binary operation is idempotent if, when applied to two equal values, it always gives that value as the result. For example, the operation that gives the maximum of two values is idempotent: max(x, x) ≡ x. The definition for unary operations is a specialization of the definition for binary operations.
- Given a binary operation, if a value yields itself as the result when used as both operands, that value is called an idempotent element for the operation. For example, the number 1 is an idempotent element of multiplication: 1 × 1 = 1.
About
A mathematical term, also used in computer science and programming as a derived term. Being idempotent means the property of an operation or function whose result does not change when applied multiple times after the first execution.
In other words, the result of an idempotent operation must be the same whether it is performed once or many times.