Learn Set Theory in about a week!

Learning should be fun and quick; no need to spend ages in just one single course.

Start learning  

#36 Mathematics
7 mins   /

What exactly is set algebra?

Just like you can perform algebra of numbers, so can you perform algebra of sets.

Algebra is an overarching term used to refer to the usage and manipulation of symbols based on well-defined rules to solve problems. It originally started out as a small branch related to solving simple problems involving numbers, dating back to older times.

But soon the term algebra well grew beyond its humble roots to refer to any system where symbols get manipulated in the same way as they are in equations such as ::x^2 + y^2 = 1::.

At the moment, the topic of interest is set algebra. In this article, I'll explain what exactly is set algebra, why is it called so, and its practical application of working with sets and finding similar sets.

Set equality

Let's begin with a simple idea: set equality.

Recall that a set equality asserts that two sets ::A:: and ::B:: are equal to one another. This is expressed symbolically as:

::A = B::

There's even a formal, set-theoretic definition of set equality:

::A \subseteq B \land B \subseteq A::

where ::\land:: is the conjunction operator from propositional logic.

That is, ::A = B:: if and only if ::A:: is a subset of ::B:: and ::B:: is a subset of ::A::.

Set identity

The next stage is that of a set identity.

A set identity is also an equality of two sets but now instead of the sets being simple, primitive sets, like ::A:: and ::B::, they are obtained by applying set operations. For example, here's a really simple set identity:

::A \cup B = B \cup A::

This is commonly known as thte commutative law of union. The most important point is that you can replace ::A:: and ::B:: with any set in the world and the given equality — or better to say, identity — would still hold.

There is a rather large collection of set identities to appreciate, some of which are outright evident whereas others are a bit more involved.

Most set identities follow from propositional equivalences so you'll find a nature correspondence between the two.
IdentityName
::A \cup \emptyset = A\\ A \cap \bold{U} = A::Identity laws
::A \cup \bold{U} = \bold{U}\\ A \cap \emptyset = \emptyset::Universal bound laws
::A \cup A' = \bold{U}\\ A \cap A' = \emptyset::Complement laws
::A \cup A = A\\ A \cap A = A::Idempotent laws
::A'' = A::Double complement law
::A \cup B = B \cup A\\ A \cap B = B \cap A::Commutative laws
::A \cup (B \cup C) = (A \cup B) \cup C\\ A \cap (B \cap C) = (A \cap B) \cup C::Associative laws
::A \cup (B \cap C) = (A \cup B) \cap (A \cup C)\\ A \cap (B \cup C) = (A \cap B) \cup (A \cap C)::Distributive laws
::(A \cup B)' = A' \cap B'\\ (A \cap B)' = A' \cup B'::De Morgan's laws

The algebra of sets

Now, let's get to the crux of this article — algebra of sets.

Given an expression consisting of sets and set operators, you can transform it into an equivalent expression by applying set identities to substitute given parts.

For example, given

::(A \cup B)' \cap B::

you can keep on simplifying it (i.e. manipulating the symbols) until you get to an expression with lesser symbols:

::(A \cup B)' \cap B\\[3pt] A' \cap B' \cap B\\[3pt] A' \cap \emptyset\\[3pt] \emptyset::

As you can see, the expression resolves down to the empty set, ::\emptyset::. This kind of simplification, involving set identities, is called the algebra of sets.

Once again, why "algebra"? Because you're manipulating symbols based on well-defined rules (i.e. set identities). And why "sets"? Because... well... you're working with sets.

Bilal Adnan

Hi there! 👋 I'm the founder of Codeguage — basically the guy who's trying to make life easy for absolute beginners entering into computer science. You can follow me on LinkedIn or Medium to stay up-to-date with my conversations.