Tran Chieu Minh recently asked on Math Overflow why the definition of a function is asymmetric: it treats the domain and the codomain differently. In other words, why privilege functions over relations? (Edit: Tran has since deleted the question.)
I think this is an interesting question, but I don’t think it’s appropriate for Math Overflow, so I’m redirecting discussion of it here. My own answer is below.
First, I think it’s important to recognize that thinking of mathematics in terms of sets and functions is a specific historical choice that mathematicians have made. Mathematics wasn’t always done this way, and it won’t always be done this way. For example, consider Terence Tao’s recent blog post where he replaces sets and functions with oracles and algorithms. There’s no reason to expect that more radical shifts in perspective aren’t possible, although admittedly when you’ve been trained to think in terms of sets and functions it’s a hard habit to break.
With that caveat in mind, here’s one idea I learned about from a discussion on the n-category cafe. The definition of a function has its roots in the arrow of time and in determinism. If you believe in determinism, you believe that the future state of the universe is a function of its current state: in other words, that to every current state there is associated a particular choice of future state, say one second in the future. Determinism and the arrow of time privilege the past over the future because a given past always leads to a given future, but the same future may be the result of multiple pasts: that’s why the codomain and domain of a function are treated asymmetrically. Indeed, think about the naive definition of a function: it’s a rule or process for starting with one thing and getting another. These processes are supposed to be deterministic and run in some amount of time: you start with an input and at some future time you obtain an output.
What else can we say? Well, a fundamental reason to study functions on a set is to study some property of the elements of , where the function is precisely that property. Properties, of course, may take values in any other kind of set. (An equivalent way to say this is that functions on a set are tantamount to equivalence relations.) There is a sort of “dual” reason to study functions into a set, but I don’t think it’s as interesting in as it is in other categories because a function is just a special type of function . There is some very interesting discussion of these kinds of questions for more general categories in Lawvere and Schanuel.
I think there is a second question in the subtext of this question, though:
Why are functions such a successful framework for organizing mathematics?
In other words, why are functions so powerful that it isn’t necessary to step up to relations, for example? (Relations can, of course, themselves be described using functions.) I think one answer here is Yoneda’s lemma, which implies that any locally small category can be “represented” as a certain category of sets and functions between those sets. (It implies, for example, that the category of sets and relations can be represented in this way!) There is probably a deeper reason, although I can’t think of anything intelligent to say about it at the moment.