# Symmetric difference of sets

2010 Mathematics Subject Classification: Primary: 03E [MSN][ZBL]

An operation on sets. Given two sets $A$ and $B$, their symmetric difference, denoted by $A \Delta B$, is given by $$A \Delta B = (A \setminus B) \cup (B \setminus A) = (A \cup B) \setminus (A \cap B) = (A \cap B') \cup (A' \cap B)$$ where the symbols $\cup$, $\cap$, $\setminus$, ${}'$ denote the operations of union, intersection, difference, and complementation of sets, respectively.

The symmetric difference operation is associative, i.e. $A \Delta (B \Delta C) = (A \Delta B) \Delta C$, and intersection is distributive over it, i.e. $A \cap (B \Delta C) = (A \cap B) \Delta (A \cap C)$. Thus, $\Delta$ and $\cap$ define a ring structure on the power set $\mathcal{P}(X)$ of a set $X$ (the set of subsets of $X$), in contrast to union and intersection. This ring is the same as the ring of $\mathbb{Z}/2\mathbb{Z}$-valued functions on $X$ (with pointwise multiplication and addition). Cf. also Boolean algebra and Boolean ring for the symmetric difference operation in an arbitrary Boolean algebra.
The indicator function of the symmetric difference may be expressed as $$I_{A \Delta B} = I_A + I_B \bmod 2$$ or as $$I_{A \Delta B} = \left|{ I_A - I_B }\right| \ .$$