A set is a collection of distinct objects, called elements, with a definite membership criterion: for any candidate object, either it belongs to the set or it does not. Sets are specified by listing their elements ({1, 2, 3}) or by a property ({x : x is even}). Two sets are equal if and only if they have the same elements — a set is determined entirely by its membership, not by how it is described.
The axioms of set theory (Zermelo-Fraenkel with Choice, ZFC) regulate which collections count as sets, avoiding paradoxes like Russell’s (the set of all sets not containing themselves). Without these axioms, unrestricted set formation leads to contradictions — the set of all sets not containing themselves both contains and does not contain itself.
The basic operations build new sets from existing ones. The union collects everything in either set. The intersection collects everything in both. The complement collects everything not in A. The Cartesian product collects all ordered pairs with and . The power set collects all subsets of A.
Sets are the standard foundation for mathematics. A binary relation is a subset of a Cartesian product. A function is a relation where each input has exactly one output. Numbers are constructed from sets — zero is the empty set , one is , two is , and so on.
The category Set has sets as objects and functions as morphisms. Composition of functions is composition of morphisms. The identity function is the identity morphism. Set is the category that most other mathematical categories generalize — groups are sets with extra structure, topological spaces are sets with extra structure, and the category-theoretic definitions of product, coproduct, and exponential all generalize the set-theoretic Cartesian product, disjoint union, and function set.