Category theory without codomains?

Category theory can be formulated entirely without any objects, so that your idea of getting rid of codomains can be realized with an added bonus that you can also get rid of domains. Objects in category theory, formally, are auxiliary notions. Their only purpose in life is to serve as domains and codomains of arrows, but it is the arrows that are important, and nothing else.

A formal way of getting rid of objects is to define a category to be a class of arrows, together with a partial binary operation on the class of arrows. That partial binary operation is called composition. After defining some of the most elementary properties one expects of this composition partial operation, one can 'recover' objects by identifying certain special arrows that behave like identities. So the slogan is: in a category objects can be identified with identity arrows, and thus be disposed of.

A more detailed account can be found in Mac Lane's Categories for the Working Mathematician. A related question, is Category Theory with and without Objects.

That said, there is little to gain (at least conceptually) from disposing of objects (there is something to gain logically since it is easier to describe the first order theory of categories in an object-free manner). Your objection to using objects (codomains specifically) is understandable but your solution seems to introduce a lot of complications and is (pardon my opinion here) far from elegant. The use of domains and codomains really has no adverse consequences. What is so horrible in distinguishing between functions and surjections? do you really want every function to be surjective by working out its image explicitly? If so, then here is a little exercise: Find the codomain of the function $f:[0,1]\to D$ where $f(x)=\sin(x)\cos(x)e^x*1/(1+\sin(x))*\ln(|\sin(x)|+|\cos(x)|)$. I hope you will agree it's a lot easier to simply say: the codomain of $f$ is $\mathbb{R}$ and call it a day.

Later addition incorporating comments and chat information: A situation where functions do not have specified domains or codomains can be incorporated within category theory as follows. Let $Par$ be the category of sets and partial functions. Fix some universal set $U$ in $Par$, then the full subcategory of $Par$ spanned by $U$ can be interpreted as a world where functions can always be composed (albeit sometimes their composition is the empty function).


I agree with Zhen's assessment in the comments that if you think maps should always be surjective you have not done enough mathematics. To be blunt, I can think of so many reasons that maps should not always be surjective that I am having trouble organizing all of my thoughts on this question, so I'm just going to blurt things out (as it were).

First, here are some objections to your specific proposal.

  1. You are implicitly assuming some kind of factorization of morphisms into epimorphisms and monomorphisms. As I pointed out recently, such factorizations neither exist nor are unique in general categories.

  2. "Subobject" and "quotient object" are not relations. A given object can be a subobject resp. a quotient object of another object in different ways given by different isomorphism classes of monomorphisms resp. epimorphisms. This isn't a particularly esoteric claim; it already happens in the category of sets for quotient objects.

Here are some general objections to what you are trying to do, in no particular order.

  1. There are issues here that I don't know a standard language for talking about, so for lack of a better word I'm going to call them "decidability issues." Sometimes it takes a lot of effort to construct a map. After you've constructed it, sometimes it takes a lot of effort to decide whether it's injective or surjective. Maybe it is, maybe it isn't. Before you've determined this, what are you going to call what you've constructed?

  2. Codomains are not an artificial idea at all once you move past thinking of categories of sets and functions and onto more interesting kinds of categories. For example, there are "physical categories" where objects are states of a system and morphisms are ways of transitioning from one state to another. There are "logical categories" where objects are propositions and states are proofs of one proposition from another. There are "cobordism categories" where objects are manifolds and morphisms are ways of connecting those manifolds together using manifolds of one dimension higher. And so forth.

  3. There are general machines (that is, functors) for turning morphisms into other morphisms, and these machines do not preserve epimorphisms in general. This is a general version of the specific point brought up by Mac Lane via Zhen in the comments.

  4. In general, in mathematics we often don't study specific examples of something, but instead study families of examples. For example, we often don't study numbers, but families of numbers (e.g. sequences). In category theory, we often don't study morphisms, but families of morphisms, in particular the family of all morphisms from an object $x$ to an object $y$. It is sensible to group all of these morphisms together even though some of them may not be epimorphisms, and this grouping has good formal properties.