In mathematics, the Iverson bracket, named after Kenneth E. Iverson, is a notation that generalises the Kronecker delta, which is the Iverson bracket of the statement . It maps any statement to a function of the free variables in that statement. This function is defined to take the value 1 for the values of the variables for which the statement is true, and takes the value 0 otherwise. It is generally denoted by putting the statement inside square brackets:In other words, the Iverson bracket of a statement is the indicator function of the set of values for which the statement is true.
The Iverson bracket allows using capital-sigma notation without restriction on the summation index. That is, for any property
P(k)
k
\sumkf(k)
\sumkf(k) ⋅ [P(k)]
f(k)
f(k)[bf{false}]
f(k)
The notation was originally introduced by Kenneth E. Iverson in his programming language APL,[1] [2] 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.[3]
There is a direct correspondence between arithmetic on Iverson brackets, logic, and set operations. For instance, let A and B be sets and
P(k1,...)
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.
We mechanically derive a well-known sum manipulation rule using Iverson brackets:
The well-known rule is likewise easily derived:
\\&=\sum_^n\,\sum_^n f(j,k).\end
For instance, Euler's totient function that counts the number of positive integers up to n which are coprime to n can be expressed by
Another use of the Iverson bracket is to simplify equations with special cases. For example, the formula
is valid for but is off by for . To get an identity valid for all positive integers (i.e., all values for which
\varphi(n)
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 of a set
A
1A(x)
IA(x)
\chiA(x)
The Heaviside step function, sign function,[1] and absolute value function 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 and
The floor and ceiling functions can be expressed asandwhere the index
n
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[4])
In the 1830s, Guglielmo dalla Sommaja used the expression
0x | |
0 |
[x>0]
\left(1-
0-x | |
0 |
\right)\left(1-
0x-a | |
0 |
\right)
[0\leqx\leqa]
0x | |
0 |
In addition to the now-standard square brackets and the original parentheses blackboard bold brackets have also been used, e.g. as well as other unusual forms of bracketing marks available in the publisher's typeface, accompanied by a marginal note.