The union of sets is one of the most basic and useful operations in set theory. It helps in combining elements from two or more sets into a single set.
Many learners often get confused about how to represent this in LaTeX, especially when dealing with multiple sets or disjoint unions.
This tutorial will solve those issues and show you different methods step by step.
Basic Union Symbol
This method is used when you want to write the simple union of two or more sets. It is represented by the command \cup
.
\documentclass{article}
\usepackage{amsmath}
\[ A \cup B = \{x : x\in A \; or \; x\in B \} \]
\[ A \cup \phi \; or \; A\cup \{\} = A \]
\[ (A_1 \cup A_2 \cup A_3 \cup \cdots A_n)^c \]
\[ A\cup (B\cup C)=(A\cup B)\cup C \]
\end{document}
Big Union Symbol
When working with many sets, a big union is often required. It works similar to summation but uses a union symbol.
\cup_{lower limit}^{upper limit}
\cup
- This represents the normal union symbol in LaTeX. It works fine but does not correctly align limits above and below.
_{lower limit}^{upper limit}
- This part defines the lower and upper limits for the index of union. However, they appear beside the symbol instead of above and below.
\[ \cup_{i=1}^{n}F_{i} \]
With bigcup Command
For a properly displayed big union, you need the \bigcup
command.
\bigcup_{lower limit}^{upper limit}
\bigcup
- This command creates a larger union symbol suitable for multiple sets. It automatically adjusts for limits in display style.
_{lower limit}^{upper limit}
- The lower and upper limits appear properly aligned with the symbol, making the notation clear and professional.
\[ \bigcup_{i=1}^{n}F_{i} \]
With limits Command
If you want full control over the positioning, use \limits
.
\bigcup\limits_{i=1}^{n}F_{i}
\limits
- This forces the limits to appear above and below the symbol, even in inline math. It ensures the union looks consistent in every case.
\[ \bigcup\limits_{i=1}^{n}F_{i} \]
Disjoint Union Symbol
Disjoint unions are useful when the sets do not overlap. LaTeX provides multiple notations for this.
Using a Dot Over the Symbol
This is written with \dot\cup
.
\[ S_{1} \dot\cup S_{2} \]
Using a Plus Sign
Another option is \uplus
, which adds a small plus sign inside the symbol.
\[ S_{1} \uplus S_{2} \]
Four-corner U-shaped
You can also use \sqcup
, which makes a four-cornered U shape.
\[ S_{1} \sqcup S_{2} \]
Custom Union with newcommand
If you want a flexible custom union operator, you can define it using \newcommand
with two arguments. The first argument will go as the lower limit and the second as the upper limit of \bigcup
.
\newcommand{\Union}[2]{\bigcup\limits_{#1}^{#2}}
\newcommand{\Union}[2]
- This defines a new command called
\Union
that takes two arguments. The first is used as the lower limit and the second as the upper limit. {\bigcup\limits_{#1}^{#2}}
- Inside the command,
\bigcup
is combined with\limits
so the arguments are placed above and below.#1
goes to the lower limit and#2
goes to the upper limit.
\documentclass{article}
\usepackage{amsmath}
% Custom command with two arguments
\newcommand{\Union}[2]{\bigcup\limits_{#1}^{#2}}
\begin{document}
\[
\Union{i=1}{n} A_i
\]
\end{document}
Best Practice
For normal unions, using \cup
is enough, but for multiple indexed unions, \bigcup
or \bigcup\limits
is always the best choice.
For disjoint unions, \uplus
is more commonly used and looks professional in scientific documents.
Learners should choose symbols that make the mathematical meaning as clear as possible.
Thank you cuh, Appreciate.