# Set

**Codex:** Mathematics Codex · thecodex.expert/mathematics/  
**Domain:** 01 — Foundations & Logic  
**Type:** Concept  
**URL:** https://thecodex.expert/mathematics/foundations-logic/set/  
**JSON:** https://thecodex.expert/mathematics/foundations-logic/set/index.json  
**Last reviewed:** 2026-05-27  
**Confidence:** High  

---

## One-line summary

A collection of distinct objects considered as a single entity — the foundational concept from which all modern mathematics is built.

---

## Definition

A **set** is a well-defined collection of distinct objects, considered as a single entity. The objects belonging to a set are called its *elements* (or *members*). A set is characterised entirely by its elements: two sets are equal if and only if they have exactly the same elements. Any object — a number, a function, another set, a letter, a physical thing — can be an element of a set. The concept of set was formulated with mathematical precision by Georg Cantor in papers beginning in 1874 and culminating in his 1883 *Grundlagen einer allgemeinen Mannigfaltigkeitslehre*. Set theory became the universal language in which virtually all of modern mathematics is expressed, formalised axiomatically in the Zermelo-Fraenkel system (ZFC) in the early 20th century.

**Notation:** Elements are listed in braces: {1, 2, 3}. Membership is written a ∈ A ("a is in A"). The empty set is ∅.

---

## Curious (no background needed)

Every number you have ever written down, every shape you have ever drawn, every equation you have ever solved — mathematicians proved in the 1870s that all of it can be built from just one idea: a **collection**.

A set is just a bunch of things, grouped together and thought of as a single thing. The set of your family members. The set of prime numbers less than 10: {2, 3, 5, 7}. The set of all even integers. The set containing only the colour blue and the number 47. Sets can contain anything — numbers, words, other sets, and even nothing at all (the empty set, written ∅, is a perfectly valid set that happens to contain no elements).

The person who realised this ordinary idea could be the foundation of all mathematics was Georg Cantor, a German mathematician working in the 1870s. His contemporaries thought he was eccentric. The leading mathematician of his day, Leopold Kronecker, called him a "corrupter of youth" and blocked him from professorships at prestigious universities. Cantor suffered a mental breakdown partly from this professional isolation.

He was also right about something astonishing: **some infinities are bigger than others**. The set of all even numbers is infinite. The set of all natural numbers is also infinite. But the set of all real numbers is a *larger* kind of infinite. Cantor proved this using the diagonal argument — one of the most elegant proofs in mathematics.

Today, sets are the universal language of mathematics. Every function, every number system, every geometric shape is built from sets.

---

## Exploring (practical detail)

**Notation and membership:** A set is typically named with a capital letter. Roster notation lists elements: A = {1, 2, 3}. Set-builder notation describes a rule: B = {x : x is a natural number and x < 6}.

**Key operations:**
- Union (A ∪ B): elements in A or B (or both)
- Intersection (A ∩ B): elements in both A and B
- Difference (A \ B): elements in A but not B
- Power set 𝒫(A): the set of all subsets of A

**Subsets:** A ⊆ B if every element of A is in B. To prove A = B: show A ⊆ B and B ⊆ A.

**Cardinality:** |A| = number of elements. Infinite cardinalities: ℵ₀ for the natural numbers, 2^ℵ₀ for the real numbers — strictly larger (Cantor's theorem).

**Indian context:** While formal set theory is 19th-century European, Pingala's *Chandaḥśāstra* (c. 3rd–2nd century BCE, India) contains systematic enumeration of finite collections — an independent ancient recognition of collection-based reasoning.

---

## Deep Dive (formal and citable)

**Naive set theory and Russell's Paradox:** Cantor's original Comprehension Principle — for any property P, {x : P(x)} is a set — was shown inconsistent by Bertrand Russell in 1903. The set R = {x : x ∉ x} leads to contradiction: R ∈ R iff R ∉ R.

**ZFC:** Nine axioms (Zermelo 1908, Fraenkel 1922) govern which collections are sets: Extensionality, Pairing, Union, Power Set, Infinity, Separation, Replacement, Regularity, Choice. Everything in modern mathematics is encoded as a set.

**Cantor's theorem:** For any set A, |𝒫(A)| > |A|. Proof: define D = {x ∈ A : x ∉ f(x)} for any f : A → 𝒫(A). Then D ∈ 𝒫(A) but D ≠ f(y) for any y — contradiction. So no surjection exists.

**Continuum Hypothesis:** Is there a cardinality strictly between ℵ₀ and 2^ℵ₀? Gödel (1940) proved CH is consistent with ZFC. Cohen (1963) proved its negation is also consistent. CH is independent of ZFC.

---

## Relationships

**Prerequisites:** Proof

**Consequences:** ZFC Axioms · Function · Natural Number · Group · Zero

**Lineage predecessors:** Combinatorics (Pingala, c. 3rd–2nd century BCE)

**Lineage successors:** Gödel's Incompleteness Theorems

---

## Sources

1. **[Tier 1]** Cantor, Georg. "Grundlagen einer allgemeinen Mannigfaltigkeitslehre." *Mathematische Annalen*, vol. 21, pp. 545–591. 1883.
2. **[Tier 1]** Zermelo, Ernst. "Untersuchungen über die Grundlagen der Mengenlehre I." *Mathematische Annalen*, vol. 65, pp. 261–281. 1908.
3. **[Tier 1]** Jech, Thomas. *Set Theory*, 3rd Millennium Edition. Springer, 2003. ISBN 978-3-540-44085-7.
4. **[Tier 3]** Halmos, Paul R. *Naive Set Theory*. D. Van Nostrand Company, 1960.

---

## Provenance

- **Published:** 2026-05-27
- **Last reviewed:** 2026-05-27
- **Review due:** 2027-05-27
- **Confidence:** High
- **Build status:** Complete (Session 1 proof-of-concept)
- **Cite as:** "Set", Mathematics Codex, https://thecodex.expert/mathematics/foundations-logic/set/, last updated 2026-05-27.

---

*Mathematics Codex · thecodex.expert/mathematics/ · © 2026 The Codex · Mumbai · Disclaimer: thecodex.expert/mathematics/disclaimer/*
