A subset of a set S is a set A whose elements all belong to S. Written : for every x, if then . Every set is a subset of itself. The empty set is a subset of every set.
Subset is not the same as element. The number 3 is an element of {1, 2, 3}. The set {3} is a subset of {1, 2, 3}. An element belongs to a set; a subset is contained within a set. These are different relations — but , and but (unless 3 itself happens to be the set {3}).
The collection of all subsets of S is the power set . If S has n elements, has elements. The power set is ordered by inclusion: defines a partial order on . Under this ordering, intersection is the meet (greatest lower bound) and union is the join (least upper bound). Every subset has a complement , making a Boolean algebra.
A binary relation from A to B is defined as a subset of . So subset is the concept that connects sets to relations: a relation IS a subset of a product. This makes subset one of the load-bearing concepts in the chain from sets to categories — without it, you cannot define relations, and without relations, you cannot define functions.
In a category, subsets generalize to subobjects: a subobject of an object A is an equivalence class of monomorphisms into A. Each subset of S corresponds to a characteristic function that says yes or no for each element. In categories beyond Set, this characteristic function targets a richer object — the subobject classifier — which may have more values than just true and false.