{
  "schema_version": "1.0",
  "codex": {
    "name": "Mathematics Codex",
    "url": "https://thecodex.expert/mathematics/",
    "domain": "mathematics",
    "llms_txt": "https://thecodex.expert/mathematics/llms.txt"
  },
  "entry": {
    "id": "set",
    "status": "active",
    "url_html": "https://thecodex.expert/mathematics/foundations-logic/set/",
    "url_json": "https://thecodex.expert/mathematics/foundations-logic/set/index.json",
    "url_markdown": "https://thecodex.expert/mathematics/foundations-logic/set/index.md",
    "url_changelog": "https://thecodex.expert/mathematics/foundations-logic/set/changelog.json",
    "name": "Set",
    "type": "concept",
    "aliases": ["mathematical set", "collection", "family", "class"],
    "domain": "01",
    "domain_name": "Foundations & Logic",
    "domain_url": "https://thecodex.expert/mathematics/foundations-logic/",
    "msc2020": ["03-XX", "03Exx"],
    "one_line": "A collection of distinct objects considered as a single entity — the foundational concept from which all modern mathematics is built.",
    "definition": {
      "canonical": "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.",
      "summary": "A collection of distinct objects, from which all modern mathematics is built.",
      "is_contested": false,
      "contested_positions": []
    },
    "type_specific": {
      "definition_formal": "In ZFC, a set is any object satisfying the ZFC axioms. The axiom of extensionality states: ∀A ∀B [∀x(x∈A ↔ x∈B) → A=B]. The axiom of separation states: for any set A and formula φ(x), {x∈A : φ(x)} is a set.",
      "definition_formal_latex": "\\forall A \\forall B [\\forall x(x\\in A \\leftrightarrow x\\in B) \\rightarrow A=B]",
      "examples": [
        "The empty set: ∅ = {} — the unique set with no elements",
        "A finite set: {1, 2, 3, 4, 5}",
        "An infinite set: the set of all natural numbers ℕ = {0, 1, 2, 3, …}",
        "A set of sets: {{1,2}, {3,4}, {5}} — sets can contain other sets as elements",
        "A set defined by a property: {x ∈ ℝ : x² < 2} — the open interval (−√2, √2)"
      ],
      "notation": "Roster notation: {a, b, c}. Set-builder notation: {x : P(x)} or {x ∈ A : P(x)}. Membership: a ∈ A. Non-membership: a ∉ A. Empty set: ∅."
    },
    "why_true": {
      "intuition": "The diagonal argument that proves Cantor's theorem — that the power set is always strictly larger than the set — works by constructing a set D that differs from every possible output of any proposed surjection f. For each element x, D includes x if f(x) excludes x, and excludes x if f(x) includes x. This forces D to disagree with f(x) at the element x, for every x. So D cannot be any output of f, meaning f is not surjective. The self-referential nature of the construction — D is defined using f itself — is what makes it work.",
      "sketch": "Suppose f : A → 𝒫(A) is any function. Define D = {x ∈ A : x ∉ f(x)}. Then D ∈ 𝒫(A). If D = f(y) for some y, then y ∈ D iff y ∉ f(y) = D — contradiction. So D is not in the range of f, and f is not surjective. Since f was arbitrary, no surjection A → 𝒫(A) exists, so |𝒫(A)| > |A|.",
      "proof": {
        "type": "reference",
        "reference": {
          "author": "Thomas Jech",
          "title": "Set Theory, 3rd Millennium Edition",
          "publisher": "Springer",
          "year": "2003",
          "pages": "pp. 27–30",
          "isbn": "978-3-540-44085-7"
        }
      }
    },
    "prerequisites": [
      {
        "slug": "proof",
        "canonical_name": "Proof",
        "rel": "prerequisite",
        "note": "Understanding what constitutes a valid mathematical proof is necessary before the formal theory of sets can be developed rigorously.",
        "url": "/mathematics/foundations-logic/proof/"
      }
    ],
    "consequences": [
      {
        "slug": "zfc-axioms",
        "canonical_name": "ZFC Axioms",
        "rel": "consequence",
        "note": "The Zermelo-Fraenkel axioms with Choice are the formal axiomatic system built to govern which collections are legitimate sets, resolving the paradoxes of naive set theory.",
        "url": "/mathematics/foundations-logic/zfc-axioms/"
      },
      {
        "slug": "function",
        "canonical_name": "Function",
        "rel": "consequence",
        "note": "In modern mathematics, a function is formally defined as a special kind of set — a set of ordered pairs satisfying the function property.",
        "url": "/mathematics/foundations-logic/function/"
      },
      {
        "slug": "natural-number",
        "canonical_name": "Natural Number",
        "rel": "consequence",
        "note": "The natural numbers are constructed from the empty set via the von Neumann ordinal construction inside ZFC.",
        "url": "/mathematics/number-theory/natural-number/"
      },
      {
        "slug": "group",
        "canonical_name": "Group",
        "rel": "consequence",
        "note": "A group is a set equipped with a binary operation satisfying four axioms; the set-theoretic framework is the language in which the group axioms are stated.",
        "url": "/mathematics/algebra/group/"
      }
    ],
    "lineage": {
      "predecessors": [
        {
          "slug": "combinatorics",
          "canonical_name": "Combinatorics (Pingala, c. 3rd–2nd century BCE)",
          "rel": "lineage_predecessor",
          "note": "Pingala's Chandaḥśāstra contained the earliest systematic enumeration of combinatorial arrangements — collection-based reasoning that is a distant precursor to the formalisation of collections as mathematical objects.",
          "url": "/mathematics/discrete/combinatorics/"
        }
      ],
      "successors": [
        {
          "slug": "godels-incompleteness-theorems",
          "canonical_name": "Gödel's Incompleteness Theorems",
          "rel": "lineage_successor",
          "note": "Gödel's theorems, proved within set-theoretic formal systems, showed that any sufficiently powerful axiomatic system contains true statements it cannot prove.",
          "url": "/mathematics/foundations-logic/godels-incompleteness-theorems/"
        }
      ]
    },
    "civilisations": ["European (modern, 19th–20th century)", "Precursors: Indian (Pingala, combinatorics)"],
    "era": "19th–20th century (formal), ancient (precursors)",
    "sources": [
      {
        "id": "cantor-1883",
        "tier": 1,
        "type": "journal",
        "author": "Georg Cantor",
        "title": "Grundlagen einer allgemeinen Mannigfaltigkeitslehre",
        "journal": "Mathematische Annalen",
        "volume": "21",
        "year": 1883,
        "pages": "545–591",
        "notes": "The foundational paper establishing set theory as a mathematical discipline."
      },
      {
        "id": "zermelo-1908",
        "tier": 1,
        "type": "journal",
        "author": "Ernst Zermelo",
        "title": "Untersuchungen über die Grundlagen der Mengenlehre I",
        "journal": "Mathematische Annalen",
        "volume": "65",
        "year": 1908,
        "pages": "261–281",
        "notes": "The first axiom system for set theory."
      },
      {
        "id": "jech-2003",
        "tier": 1,
        "type": "book",
        "author": "Thomas Jech",
        "title": "Set Theory, 3rd Millennium Edition",
        "publisher": "Springer",
        "year": 2003,
        "isbn": "978-3-540-44085-7",
        "notes": "Standard comprehensive treatment of axiomatic set theory."
      },
      {
        "id": "halmos-1960",
        "tier": 3,
        "type": "book",
        "author": "Paul R. Halmos",
        "title": "Naive Set Theory",
        "publisher": "D. Van Nostrand Company",
        "year": 1960,
        "notes": "Standard graduate-level introduction to informal set theory."
      }
    ],
    "confidence": "high",
    "confidence_note": "Definition sourced from Cantor's original 1883 paper (Tier 1) and Jech's Set Theory (Tier 1). Stable, settled definition.",
    "published": "2026-05-27",
    "last_reviewed": "2026-05-27",
    "review_due": "2027-05-27",
    "build_status": "complete",
    "citation": "\"Set\", Mathematics Codex, https://thecodex.expert/mathematics/foundations-logic/set/, last updated 2026-05-27."
  }
}
