Textbook
For any sets $A$ and $B$, their union decomposes into three pairwise disjoint parts:
$$A\cup B=(A\setminus B)\cup(B\setminus A)\cup(A\cap B).$$
Equality follows from two inclusions. Every element of $A\setminus B$ belongs to $A$, every element of $B\setminus A$ belongs to $B$, and every element of $A\cap B$ belongs to both. Thus the right-hand side is included in the left-hand side.
For the converse inclusion, an arbitrary element is $x\in A\cup B$. If $x$ belongs to both sets, it lies in $A\cap B$. Otherwise it belongs to exactly one and lies in $A\setminus B$ or $B\setminus A$, respectively. These cases exhaust the possibilities, so the left-hand side is included in the right-hand side.
The parts are disjoint: “only in $A$” contradicts membership in $B$, “only in $B$” contradicts membership in $A$, and the shared part requires both. For finite sets, their three sizes can therefore be added without double counting.
A union element has exactly three possible membership patterns: only $A$, only $B$, or both sets. The fourth pattern, belonging to neither, is excluded by the premise. The decomposition is therefore both exhaustive and unambiguous. Some parts may be empty: if $A\subseteq B$, then $A\setminus B$ is empty; if $A=B$, only the shared part remains. Empty parts preserve the equality and need no invented elements to fill them.
Related concepts: Set union, Set intersection, Set difference.
In plain language
Decomposing a union resembles three badges for guests from two chats: first only, second only, and both. Each guest receives exactly one badge, including members of both chats. The categories preserve the full guest list and each guest’s origin, and their sizes add without double counting. An empty badge pile is valid; random passersby need not be recruited for symmetry.
Example
For the illustrative sets $A=\{1,2,3\}$ and $B=\{3,4\}$, partition their union $\{1,2,3,4\}$ into three parts.
Decomposing a union into disjoint parts
Only A
The numbers 1 and 2 are absent from B, so they receive the first label.
Step 1 of 3: Only A
Read all steps
Only A
The numbers 1 and 2 are absent from B, so they receive the first label.
- Union
- 1current2current34
- Only A
- 1included2included
Only B
The number 4 is absent from A and forms the second part.
- Only A
- 1included2included
- Only B
- 4included
- Unassigned
- 3current
The shared part
The number 3 belongs to both. Every element has now been assigned exactly once.
- Only A
- 1included2included
- Only B
- 4included
- Both
- 3included
After the first two steps, three remains unassigned because it satisfies neither “only $A$” nor “only $B$.” The last step places it in the shared part. Checking the finished decomposition has two jobs: every original number is covered, and no number belongs to two parts. Placing three in the first part as well would preserve the combined list but destroy disjointness. Equality of the union alone does not establish a valid partition.