In
mathematics
Mathematics is a field of study that discovers and organizes methods, Mathematical theory, theories and theorems that are developed and Mathematical proof, proved for the needs of empirical sciences and mathematics itself. There are many ar ...
, the symmetric difference of two
sets, also known as the disjunctive union and set sum, 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
(alternatively,
),
, or
.
It can be viewed as a form of
addition modulo 2.
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 po ...
of any set becomes an
abelian group under the operation of symmetric difference, with the
empty set
In mathematics, the empty set or void set is the unique Set (mathematics), set having no Element (mathematics), elements; its size or cardinality (count of elements in a set) is 0, zero. Some axiomatic set theories ensure that the empty set exi ...
as the
neutral element of the group and every element in this group being its own
inverse. The power set of any set becomes a
Boolean ring, with symmetric difference as the addition of the ring and
intersection
In mathematics, the intersection of two or more objects is another object consisting of everything that is contained in all of the objects simultaneously. For example, in Euclidean geometry, when two lines in a plane are not parallel, their ...
as the multiplication of the ring.
Properties

The symmetric difference is equivalent to the
union of both
relative complements, that is:
:
The symmetric difference can also be expressed using the
XOR operation ⊕ on the
predicates describing the two sets in
set-builder notation:
:
The same fact can be stated as the
indicator function
In mathematics, an indicator function or a characteristic function of a subset of a set is a function that maps elements of the subset to one, and all other elements to zero. That is, if is a subset of some set , then the indicator functio ...
(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