Hi there, I’m not a mathematician, so idk if my question is silly, but why is it that integers in set theory are defined as a composition of all the previous integers instead of something simpler like for example just the set containing the previous integer? Is there something that makes the way we official define integers useful, or was it something like “this works, good enough”?
Hey, thanks for your question. What you're describing is actually Zermelo's construction of the integers, which uses the successor function S(n)={n}. You may recognize the name "Zermelo" from his greatest hit "Zermelo-Frankel set theory", the all-time most popular theory of sets, and arguably the de facto foundation of all modern mathematics. So, you are in good company in thinking that's the obvious implementation. However, the Von Neumann implementation (used in Hazel's "count to 100" challenge) is considered to be superior, which I think is for three main reasons.
The first and probably weakest reason is its convenience in defining the "<" relation. Under the Zermelo convention, you need to define "<" using the Recursion theorem, but it's much easier to prove Recursion when you already have "<" at your disposal. Having to prove the Recursion theorem without ever mentioning "<" is a pain in the ass. It's not terribly difficult to prove Recursion if you have access to the axiom of infinity, but it's way harder from a finitistic set theory, and that difficulty is compounded if you can't mention the "<" relation (I've done it and it's fucking annoying). I'm not a dirty finitist*, but I do have a deep interest in reverse mathematics, so these kinds of pragmatic concerns are important to me. Under the Von Neumann implementation, we simply have n<k if and only if n∈k, and the successor operation S(n)=n∪{n} isn't much more complicated. (*finitism is an unpopular but nonetheless respected mathematical philosophy, me calling it "dirty" is a joke.)
The second reason is its relationship to cardinality: as a set, a finite ordinal n contains exactly n elements, provided we use Von Neumann's implementation. For example, 0={} has 0 members, similarly 2={0,1} has 2 members, and so on. Besides being elegant for obvious subjective reasons, it's also pretty convenient in certain technical aspects. For example, there's an important set theoretic operation called set exponentiation, where Y^X denotes the set of all functions f mapping X→Y. In the finite case, it holds that |Y^X|=|Y|^|X|, hence the name and notation. This overlaps with the ordinary notation for the set of ordered pairs, X^2 = {(a,b) : a,b∈X}. This is compatible with the set exponentiation operation, but only if we use the convention 2={0,1}. That is, the ordered pair can be thought of as a function with domain {0,1}, in the sense that (a,b)[0]=a and similarly (a,b)[1]=b. This doesn't work under Zermelo's convention. A similar issue arises for triplets at 3, quadruplets at 4, and so on, essentially forcing the Von Neumann implementation all the way up, if we want this elegance. There are other technical roadblocks I'm sweeping under the rug (roadblock shaped like "a function is a set of ordered pairs"), but this answer is long enough already.
The third reason I'll say, and certainly the strongest, is its relationship to infinite ordinal numbers. Infinite ordinals are unbelievably important in set theory, for like a trillion reasons I could talk about for an entire decade, so it's pretty important to have some kind of implementation. The least infinite ordinal is named ω, which is the least nonzero ordinal obeying the property ∀(n<ω), n+1<ω. In other words, ω has no immediate predecessor. Under the Von Neumann implementation, we can simply say ω={n : n is a finite ordinal}, albeit the formal way to say "n is a finite ordinal" is a mouthful of logic. This extends to larger ordinals, in the sense that Von Neumann's convention allows us to easily construct ordinals of any infinite size. There's no good way to extend Zermelo's implementation to the infinite ordinals, so it's just not as good.
TL;DR Zermelo's convention works, but it's very slightly more inconvenient in almost every conceivable way. Nobody actually writes out Von Neumann ordinals by hand (except as a fun joke), so there are no downsides.... unless you don't have Axiom of Replacement, since then you have to use a completely different third convention which almost nobody knows about.