Mathematics for the interested outsider

Sets and functions

I’m soon going to need to really use the notion of a function, and I want to make sure that I lay the groundwork properly. This is also a good place to mention a few things about sets.

For most of my purposes, a naïve concept of sets will suffice. A set is a collection of objects, called the elements of the set. In formal treatments of set theory, the elements are themselves sets. In fact, everything in sight is “really” a set. This sort of foundationalist approach, though, tends to obscure the real structure of mathematical theories, so I’ll avoid talking about formal set theory unless it’s absolutely necessary. What we’ll need from set theory are a few operations on sets.

Specification: If we have a set and some statement that can be unambiguously determined true or false for each element of , there is a set containing exactly those elements of so that is true. We write this set as , read “the set of those elements of such that is true of “.

Intersection: This is actually a special case of specification. For our statement we use “ is an element of the set “. This gives us the set of all elements in both and , and we write this set . In practice, we will allow intersections not just of two sets, but of any number of sets — even infinitely many.

Union: For any two sets and there is a set containing any element in either or . We write this set as . As for intersection, we will allow unions of any collection of sets.

Cartesian product: For any two sets and there is the set of ordered pairs , where is an element of and is an element of . We write this set . Again, we allow Cartesian products of any number of sets, though only a finite number at a time here.

Empty set: While not a “construction”, per se, the empty set is something important to pay attention to. This is, predictably enough, the set containing no elements at all. We write it .

Subset: If every element of is also an element of we say is a subset of — written . Note that specification gives us a subset of .

Power set: For any set we have the set of all subsets of. We write this set .

I may have forgotten some, but I will mention those (and add them here) if I realize it later.

Anyhow, a function is basically a rule that assigns to each element of one set an element of another. Formally, we need to specify a “domain” set and a “codomain” set (the codomain is often called the “range”). For every element of the domain, there is a uniquely specified element in the codomain. Often there is some sort of calculational method to determine the value of the function, but a simple lookup table will suffice. We write to specify a function with domain and codomain .

There are a few properties a function may have that are worth mentioning here. Every function assigns a value in its codomain to every element in its domain. If every element in the codomain is the value of the function at some element of the domain we say that the function is “onto” or a “surjection”. Every function assigns only one value to every element in the domain. If no element in the codomain is the value of the function at more than one element of the domain, we say that the function is “one-to-one” or an “injection”. If both of these properties hold, we say the function is a “bijection”.

Let’s consider four sets: , , , . We use these to define a number of examples of functions.

If we think of a function as setting up a correspondence between elements of the domain and elements of the codomain, like a tables of input and output values, we see that every element of the domain shows up as an input, and it shows up only once. A surjection is a function where every element of the codomain shows up at least once and an injection is one where every element shows up at most once.

These two properties — “shows up at least once” and “shows up at most once” — must hold for elements on the domain side of the table. They don’t need to hold on the codomain side, but if they do we have special names for those sorts of functions.

[…] of homomorphisms. For now, there are a few definitions we will find useful later. Recall from the discussion about functions that a surjection is a function between functions that hits every point in its codomain at least […]

In my experience, the codomain is called the `range’ only when the function is surjective (onto). In general, the range (also called the `image’) of the function is a subset of the codomain, consisting of those elements y satisfying the property (so we are using the Specification principle here!) that y is assigned to at least one element of the domain.

In other words: The codomain is the set of potential values of the function, while the range is the set of actual values of the function.

In the example g, the range is only {x, y, z}, not all of the codomain V. And in the example h, the range is only {2, 3}, not all of the codomain N. (The other two examples are onto; for them the range is all of the codomain.)

[…] on the left of exactly one pair in . In this case if is in the relation we write . Remember from our discussion of functions that I was saying every element of has to show up both at least once and at most once (that is, […]

[…] The standard example here (which will motivate much of our later definitions) is : the category of sets. This has as objects the class of all sets (which can’t itself be a set). The morphisms are […]

I certainly once suffered from the ‘foundationalist fallacy’ (if you know how it’s built, you have a clue what it’s for), probably due to a combination of intellectual style defects and osmosis of misguided New Math principles. But, I think the axiom of extensionality for sets and especially functions is worth focussing on a bit, since the standard technique for proving two functions to be identical is proving that the do the same thing to their inputs.

& isn’t what you are calling specification the one that’s more usually called separation (I think ‘culling’ would be better, but I’ve never seen it called that).

MO, it’s really more a philosophical point. I tend to take the language of sets as being a very convenient one, but far from the only one that’s available. Compare this situation with that of the natural numbers. Both the Church and the von Neumann numerals provide models, but neither is inherently any better than the other.

And yes, specification, separation, comprehension, and so on are all different names for the same thing. “Separation” has the sense of taking a set and separating those elements which satisfy a predicate from those which don’t. “Specification” (which I prefer) has the sense of taking a set and specifying (by a predicate) which of its elements are in a subset. “Culling” would have the sense of taking a set and removing those of its elements which don’t satisfy a predicate. They’re all slightly different ways of thinking about the same thing.

About this weblog

This is mainly an expository blath, with occasional high-level excursions, humorous observations, rants, and musings. The main-line exposition should be accessible to the “Generally Interested Lay Audience”, as long as you trace the links back towards the basics. Check the sidebar for specific topics (under “Categories”).

I’m in the process of tweaking some aspects of the site to make it easier to refer back to older topics, so try to make the best of it for now.