In
mathematics
Mathematics is an area of knowledge that includes the topics of numbers, formulas and related structures, shapes and the spaces in which they are contained, and quantities and their changes. These topics are represented in modern mathematics ...
, the symmetric difference of two
sets, also known as the disjunctive union, is the set of elements which are in either of the sets, but not in their intersection. For example, the symmetric difference of the sets
and
is
.
The symmetric difference of the sets ''A'' and ''B'' is commonly denoted by
or
The
power set
In mathematics, the power set (or powerset) of a set is the set of all subsets of , including the empty set and itself. In axiomatic set theory (as developed, for example, in the ZFC axioms), the existence of the power set of any set is post ...
of any set becomes an
abelian group
In mathematics, an abelian group, also called a commutative group, is a group in which the result of applying the group operation to two group elements does not depend on the order in which they are written. That is, the group operation is comm ...
under the operation of symmetric difference, with the
empty set as the
neutral element
In mathematics, an identity element, or neutral element, of a binary operation operating on a set is an element of the set that leaves unchanged every element of the set when the operation is applied. This concept is used in algebraic structures su ...
of the group and every element in this group being its own
inverse. The power set of any set becomes a
Boolean ring In mathematics, a Boolean ring ''R'' is a ring for which ''x''2 = ''x'' for all ''x'' in ''R'', that is, a ring that consists only of idempotent elements. An example is the ring of integers modulo 2.
Every Boolean ring gives rise to a Boolean al ...
, with symmetric difference as the addition of the ring and
intersection as the multiplication of the ring.
Properties
The symmetric difference is equivalent to the
union
Union commonly refers to:
* Trade union, an organization of workers
* Union (set theory), in mathematics, a fundamental operation on sets
Union may also refer to:
Arts and entertainment
Music
* Union (band), an American rock group
** ''Un ...
of both
relative complement
In set theory, the complement of a set , often denoted by (or ), is the set of elements not in .
When all sets in the universe, i.e. all sets under consideration, are considered to be members of a given set , the absolute complement of is th ...
s, that is:
:
The symmetric difference can also be expressed using the
XOR operation ⊕ on the
predicates
Predicate or predication may refer to:
* Predicate (grammar), in linguistics
* Predication (philosophy)
* several closely related uses in mathematics and formal logic:
**Predicate (mathematical logic)
**Propositional function
**Finitary relation, ...
describing the two sets in
set-builder notation:
:
The same fact can be stated as the
indicator function (denoted here by
) of the symmetric difference, being the XOR (or addition
mod 2) of the indicator functions of its two arguments:
or using the
Iverson bracket notation