In mathematics, the Iverson bracket, named after Kenneth E. Iverson, is a notation that generalises the Kronecker delta. It converts any logical proposition into a number that is 1 if the proposition is satisfied, and 0 otherwise, and is generally written by putting the proposition inside square brackets:
Contents
- Properties
- Examples
- Double counting rule
- Summation interchange
- Counting
- Simplification of special cases
- Common functions
- Formulation in terms of usual functions
- References
where P is a statement that can be true or false.
In the context of summation, the notation can be used to write any sum as an infinite sum without limits: If
Note that by this convention, a summand
The notation was originally introduced by Kenneth E. Iverson in his programming language APL, though restricted to single relational operators enclosed in parentheses, while the generalisation to arbitrary statements, notational restriction to square brackets, and applications to summation, was advocated by Donald Knuth to avoid ambiguity in parenthesized logical expressions.
Properties
There is a direct correspondence between arithmetic on Iverson brackets, logic, and set operations. For instance, let A and B be sets and
Examples
The notation allows moving boundary conditions of summations (or integrals) as a separate factor into the summand, freeing up space around the summation operator, but more importantly allowing it to be manipulated algebraically.
Double-counting rule
We mechanically derive a well-known sum manipulation rule using Iverson brackets:
Summation interchange
The well-known rule
Counting
For instance, the Euler phi function that counts the number of positive integers up to n which are coprime to n can be expressed by
Simplification of special cases
Another use of the Iverson bracket is to simplify equations with special cases. For example, the formula
is valid for n > 1 but is off by 1/2 for n = 1. To get an identity valid for all positive integers n (i.e., all values for which
Common functions
Many common functions, especially those with a natural piecewise definition, may be expressed in terms of the Iverson bracket. The Kronecker delta notation is a specific case of Iverson notation when the condition is equality. That is,
The indicator function, often denoted
The Heaviside step function, sign function, and absolute value function and are also easily expressed in this notation:
and
The comparison functions max and min (returning the larger or smaller of two arguments) may be written as
The floor and ceiling functions can be expressed as
and
where the index
The ramp function can be expressed
The trichotomy of the reals is equivalent to the following identity:
The Möbius function has the property (and can be defined by recurrence as)
Formulation in terms of usual functions
In the 1830s, Guglielmo Libri Carucci dalla Sommaja used