# Difference between a class and a set

I know what a set is. I have no idea what a class is.

As best as I can make out, every set is also a class, but a class can be "larger" than any set. (A so-called "proper class".)

This obviously makes no sense whatsoever, since sets are of unlimited size. It's not like you get to 25 elements and go "oh, hey, sets are limited to a maximum of 20 elements, so we'll have to call this 25-element thing something else".

Does anybody know what the actual difference between a set and a class is?

Edit: Several people have pointed out that you can write paradoxes which involve sets. I get that. But where do classes come into the picture?

-
I think it depends on what system you are working in, but in ZFC it's not a formally defined notion: it pretty much means "a collection of objects which we can define and talk about, but which can't be a set because otherwise things would break". – Tara B May 1 '12 at 10:24
I do not find your attitude towards something you don't understand productive. A lot of very smart people have thought very hard about set theory and concluded that there is a useful distinction to make between sets and proper classes, so to dismiss it as obviously making no sense whatsoever seems to me extremely arrogant. – Qiaochu Yuan May 3 '12 at 20:50
@QiaochuYuan I didn't say that the notion of classes makes no sense. I said defining a class as "like a set, but bigger" makes no sense. As the answers indicate, apparently the real definition is much more specific than that. – MathematicalOrchid May 4 '12 at 8:33
@MathematicalOrchid: "like a set, but bigger" is an intuition, and I think it holds water (although of course not all intuitions will make sense to all people). The point is that collections like $\{ x : P(x) \}$ where $P(x)$ is some property generally form a proper class, whereas collections like $\{ x : x \in S, P(x) \}$ where $S$ is some set form a set. I think you would agree that there is a strong intuitive sense in which the former is bigger than the latter. – Qiaochu Yuan May 4 '12 at 14:35

Your intuition about size limitations is wrong. Think about finite sets: there are sets which are finite but as large as you would want them, $6$ elements, $25$ elements, $216$ elements, whatever. But does that mean that the set of natural numbers is a finite set?

The idea behind the transfinite is what happens after you've gone to infinity and beyond. So there are sets and they grow larger and larger, then they become infinite, and they continue to grow larger and larger... eventually you have gone "all the way". There comes a question - is the collection of everything you have accumulated so far is a set? If so, we can keep on going. Classes tell us that eventually (which is a pretty far eventually) we have to stop somewhere.

In the naive approach to mathematics we think that every collection we can talk about is a set. Simply because in the naive approach there is no definition of a set.

However once axiomatic set theory came into play we have the seemingly circular definition: Sets are elements of a model of set theory.

For example, one of the axioms about sets is that they have power sets. One of the theorems linking a set and its power set is that there is no surjective function from a set to its power set.

Suppose the collection of all sets, $V$ was a set itself, what would its power set be? Well, every subcollection of $V$ is a set and therefore in $V$. This means that $P(V)\subseteq V$. However this means that there is a surjective function from $V$ onto its power set!

Cantor's paradox (as above), as well Russell's paradox (all sets which are not elements of themselves is a collection which is not a set), and so several other paradoxes tell us one thing: not all collections we can define are sets.

In ZFC classes are simply definable collections of sets. What does it mean definable? It means "all sets which has a property which we can describe in the given language".

One simple way to describe the difference between sets and classes in ZFC is that sets are elements of other sets. Classes are not elements of any other class, so if $A\in B$ then $A$ is a set.

The first thing to want from a foundational mathematical theory (one which you hope to later build most of your mathematics on) is that if you have a certain property, then you can talk about all the things in your universe with this property. The various paradoxes tell us that in ZFC (and its spawns) some of these collections are not sets. The notion of "proper class" tells us that we can still talk about this collection, but it is not a set per se.

For example, we can talk about ordinals (which are a transfinite generalization of the natural numbers in some sense), the collection of all ordinals is a proper class. We can still talk about "all the ordinals" or prove that some property holds for all of them, despite that this is not a set.

-
So what you're saying is "if calling this thing a set would yield a paradox, call it a class instead". (?) How does that fix the actual paradox? – MathematicalOrchid May 1 '12 at 12:54
@MathematicalOrchid: Because sets are actual things in your universe. Classes are collections which are not actual objects in the universe. These are formulas, syntactic objects. – Asaf Karagila May 1 '12 at 13:06
Great answer (+1), but "The first thing to want from a mathematical theory is that if you have a certain property, then you can talk about all the things in your universe with this property." is a bit of an exaggeration. I don't think that's the first thing everyone wants or should want. :-) – ShreevatsaR May 1 '12 at 14:21
@ShreevatsaR: Let me make my point clearer, then. This is one of the first things you would want from a foundational theory, i.e. a theory on which you would later want to build the rest of the mathematical universe you will work with. :-) – Asaf Karagila May 3 '12 at 19:04
@AsafKaragila: Ah, that I can easily agree with. :-) – ShreevatsaR May 3 '12 at 20:20

From what I understand, the notion of class was invented in order to distinguish those objects that can be described by the language used in Set Theory but which cannot be a set because it can lead to contradictions.

For analogy, consider that it is possible in the English language to create sentences that are grammatically correct but which make no sense at all or are contradictory. Examples would be: "The planet is reading stones inside the glass." or "The red blueberry is colored yellow."

If a language is sufficiently sophisticated, then it is possible to create sentences with that language which does not have any meaning or which would lead to contradictions. The language used in Set Theory is of that kind. It can create descriptions of sets that cannot exist. The canonical example is: "The set that contains elements which are not elements of themselves." Russel showed that this particular set would lead to a contradiction in that the application of elementary logic would lead to $x \in x \leftrightarrow x \not\in x$.

To save Set Theory one solution is to invent a new mathematical object called class which is defined as any object describable by the language of Set Theory. One then shows that not all classes can properly be called sets. One then states that the axioms of Set Theory apply only to sets and not to classes.

Another solution is to restrict the construction of sets such that it is only possible to construct a set from members of already existing sets. This is the approach used by books where the Axiom of Abstraction is replaced by the Axiom of Separation.

If you ask me I would rather have the second solution instead of adding another mathematical object to the things we have to keep in mind. But what do I know? I am not a mathematician!

-

In my site http://settheory.net/ I provided detailed explanations about the difference between sets and classes.

To sum it up, there is a metamathematical time order between possible theories and universes that form an endless hierarchy, where each theory can only study a past universe and add itself to it for forming a later universe. Thus the idea that the purpose of set theory is to modelize this open hierarchy or flow of time. Then the difference between sets and classes takes meaning in an open, dynamical way : contrary to sets, a class remains potentially able to contain elements that do not yet exist (even if we cannot always know it for sure).

This explanation provides a justification for some axioms of set theory, for which it can be shown that some classes are sets because they have a well-known extension, with no risk to receive in the future any further yet unknown element that would still satisfy the given property. The powerset axiom is the main exception, the one axiom that cannot be properly justified. This fact is the key to many paradoxes in the foundations of mathematics.

-

If you are familiar with first-order logic, this may help.

If we look at a model $M$ of ZFC from the outside, as in model theory, a "class" is simply a definable subset of the model. However, there may or may not be a element in the model whose extension is exactly that class. If there is, we say that the class "is a set" (in the context of that model). Otherwise, the class "is not a set", it is a "proper" class.

For example:

• In any model of ZFC, there is an empty set, which corresponds to the class $\{x : x \not = x\}$. Therefore this class is a set.

• In any model of ZFC, there is never a set in the model whose extension contains all the sets in the model, no $x \in M$ such that $y \in x$ for all $y \in M$. Therefore the class $\{x : x = x\}$ is not a set, it is a proper class.

Where does the "too big" idea come from? There are several ways to understand it. Here is one. First, we can verify that if $M$ is a model of ZFC, $C$ is a class from $M$, and $x$ is a set in $M$, then $x \cap C$ is a set in $M$. This is exactly what the axiom of separation says if you read it in this way. Thus, the only way that $C$ could fail to be a set is that there is no $x \in M$ with $C \subseteq x$, and in this sense a proper class is "too big" to be a set in $M$.

-

Unfortunately, your intuition is failing you! Don't worry though, Cantor thought the same thing when he invented it :).

There are, in fact, classes which are "too big" to be sets. For example, the class of "all sets" is too big to be a set by the famous Russell's paradox, which directly counters your intuition from earlier. It is called a paradox because it defies the very intuition you were using: Russell's paradox shows us that if "the set of all sets" exists as a set, then set theory contains false statements (and is therefore inconsistent and worthless). It's a major problem and the primary motivation for why we study axiomatic set theory in the first place.

When you start studying the hierarchy of infinities, you learn quickly that there is no "set of all ordinals" as it is too large to be a set! That is the Burali-forti paradox. When you dive into set theory, you run into a lot of examples.

The technical term for what you are speaking of is a "proper class", but you should be aware that the ones I've mentioned here are proper classes in the system ZFC (where the use of ANY proper classes is NOT ALLOWED). If you want to study proper classes further in detail I suggest you read about NBG set theory and New Foundations, where proper classes are allowed to be used.

-
Here is a decent (5 minute long) Youtube video that explains Russell's paradox pretty well: youtube.com/watch?v=KdK0SDrm_24 – tomcuchta May 1 '12 at 10:21