You're reading the public-facing archive of the Category Theory Zulip server.
To join the server you need an invite. Anybody can get an invite by contacting Matteo Capucci at name dot surname at gmail dot com.
For all things related to this archive refer to the same person.
Assume we are working in a category with morphisms and with domain and codomain . Assume we also have a morphism with domain and codomain .
Let us assume that . I want to show that we must have . I think this is related to showing that is a "congruence relationship" with respect to composition.
I don't immediately see how to prove this from the definition of a category I see in "Category Theory in Context" by Riehl. That definition mentions equality between morphisms, telling us that:
It feels like we need to say a little bit more about to prove the statement I want.
Maybe it is standard to require " is an equivalence relationship". So, is reflexive, symmetric and transitive.
However, doesn't always imply for some notion of composition even if is an equivalence relationship.
For example, say we are working in the integers, and we say exactly when the ratio is of the form for some integer . Then, we generally don't have even though and under this equivalence relationship.
Do we need to additionally require the property that if are morphisms with and , and we can compose after , then we have ? (At least, it seems to me that we would want this to be true, but I don't see how it follows from the definition of a category given in "Category Theory in Context").
is the ordinary equality of elements of a set, which everything respects. You don't get to "say" what is.
So
David Egolf said:
Let us assume that . I want to show that we must have .
is just the ordinary fact that you can substitute equals for equals.
But it's true that if you want to define a category by constructing its hom-sets as quotients by equivalence relations, then you had better check that the composition operation respects those equivalence relations.
Reid Barton said:
is the ordinary equality of elements of a set, which everything respects. You don't get to "say" what is.
That makes sense. Maybe the right way to think about this is that there are restrictions placed on the composition operator, so that certain statements hold. In particular, I am then wondering if it is an additional constraint we are placing on the composition operator to make it so .
After some more thought, I think I get it.
If as sets (and not in some fancier equivalence relationship) then is the same thing as a set as .
This is just because if you put the same things into the composition operator, you must get the same things out.
(Thanks, Reid Barton!)
I don't know if this is helpful or more confusing, but in constructive mathematics and type theory there is also a thing called an "E-category", where the homs are not sets but [[setoids]]. In that case you do need to assume explicitly that the specified "equality" relation is reflexive, symmetric, and transitive, and that it is respected by composition.
But as Reid says, in the ordinary definition of category, the homs are just sets, and is just equality, which is respected by everything automatically. Just like for elements of a group, if then automatically .
That is helpful, @Mike Shulman . Super cool!
David Egolf said:
Let us assume that . I want to show that we must have . I think this is related to showing that is a "congruence relationship" with respect to composition.
People have already answer this perfectly well, but I will too:
In a sense you're right - but in the ordinary rules of logic, called "first-order logic with equality", equality is a congruence relation with respect to everything, so there's no work to be done here! Check out this:
When most mathematicians talk about stuff, they implicitly use these rules, which they typically absorb unconsciously as an undergrads. So when you question these rules as you've just done, they will typically either say "come on, that's obvious", or refer you to material on logic like I just did, or start talking about rarely-used alternative approaches where one might take a new look at these rules.
Thanks! It's great to see those axioms listed explicitly at the link you provided.
If we define the function ("left composition by ") by , then I think the "substitution for functions" axiom tells us that:
And so indeed .
Right! For most purposes, the rules in that Wikipedia article on first-order logic are among the basic "rules of the road" in math. That is, you're supposed to use them almost unconsciously - or in the case of mathematicians who have never formally studied logic, actually unconsciously.
We tell students stuff like "4+1 = 5 so (4+1)/2 = 5/2", and we usually don't say why; we expect them to just pick it up.
But it's good to know what's really going on here.
John Baez said:
We tell students stuff like "4+1 = 5 so (4+1)/2 = 5/2", and we usually don't say why; we expect them to just pick it up.
Yes, I've used statements like that so much so that I unconsciously "know" that I can do this in a number of specific settings.
I think what got me to sit up and pay to attention was the idea that this works in any category, including those I've never worked with.
Perhaps also interesting is that in other foundations for mathematics, like type theory, all those axioms of equality can be proven from a more basic "induction principle".
Yet another way to answer your question is to say that the axioms of a category include that composition is a function. That means that it takes equal things to equal things
I remember being annoyed at the lack of precision surrounding equality too. If that also bothers you, you might find HoTT delightful
Anyone annoyed about lack of precision concerning equality in traditional mathematics (e.g. category theory) should study first-order logic with equality, since this is the theory that underlies all traditional mathematics - and it's completely taken for granted in most math courses.
It's also great to study newer approaches like HoTT, but I don't think you can fully appreciate these if you don't know the nitty-gritty details of the traditional approach.
I'm not going to disagree that people should study first-order logic with equality, but I think the claim that it "is" what underlies traditional mathematics, given that most mathemaicians haven't studied it, is a bit tendentious. It's certainly true that traditional mathematics can be formalized into FOLwE, and that this formalization has been the one traditionally advocated by logicians; but traditional mathematics can also be formalized into other foundational systems, without making much difference at the informal level where most mathematicians work.
I claim it's not tendentious in the following sense: if you take an ordinary graduate math course, you're expected to assent automatically to manipulations of equality permitted by first-order logic with equality, and not to those that don't follow from this and the various theories stacked on top of this. For example a good traditional math grad student should raise their hand if the teacher says the fundamental group of the circle "equals" , at least until this has been discussed. Then the teacher will traditionally say they're really just isomorphic, with a specific isomorphism given when you pick a generator for the fundamental group, but that we "use this isomorphism to identify them", and hereby just say they're equal.
Of course traditional mathematics can be formalized in a host of other systems, some of which are better at dealing with some issues. But that's not what I was talking about.
I've been learning about opposite categories, and ran into a related question on the equality of morphisms - in the context of the source and target functions:
Say we are working in the category of sets and functions between them.
Let and be functions.
Set and .
Viewing each function as a collection of ordered pairs, we have: and .
So, and are equal (as sets), as they have the same elements.
Now, we want to consider the target of and .
The target of a morphism is given by evaluating the target function on , and is given by .
Based on the discussion above, if , we must have .
However, I intended and , and these are not equal.
Something appears to have gone wrong!
To fix this, I think can one require a "function" to actually be a triple, with the first element being the usual ordered-pair information, the second element being its source, and the last element being its target.
However, it seems like this makes working with opposite categories a bit more annoying. For example, in this case I believe we no longer have this equality of hom-sets: for a category and objects and . That is because each function now carries information about its source and target, and so the opposite of a morphism is not equal to itself anymore.
I notice that "Category Theory in Context" and the "opposite category" page on nLab don't seem to do this, so I suspect I am missing a better way to resolve this.
The usual solution, as you suggest, is for the data of a function to include its codomain. This doesn't cause any problems with the opposite category: the function is not encoding its codomain in the category, but rather its codomain as a function. So we really have two codomains: the function codomain and the morphism codomain. These match in Set, but are flipped in Set° (because a morphism from A to B in Set° will be a function with codomain A).
Oh, I see! That is a bit confusing to think about, but it does appear to solve all these problems!
To my knowledge, in category theory, when you consider a category where the morphisms are functions, the target of a morphism is always the codomain of the function. Here, you are confusing the target of your function with the image of the function. Your is the image of and so it is , but previously you have written that the codomain of is which is perfectly fine because the target of a function is always included in the codomain but they are not necessarily equal. If you want these to be equal, you can take the category of sets and functions where the codomain of a function is defined as its image. Or you can take the category of sets and surjective functions. I hope I don't say foolery, I haven't read all the discussion.
I agree with Nathanael's answer. In set theory a function isn't often taken to include its codomain as part of the data, but category theory draws heavily from topology and in topology it's common to talk about maps from one space into another. For example, a closed loop in a space can be identified with a continuous map from the circle to .
There are 2 different equivalent definitions of a category: (1) a class of objects, and for every pair of objects a hom-set between them; and (2) a class of objects, a class of morphism, and a pair of functions mapping every morphism to its source and target object (plus stuff for identities that isn't important here). Both these definitions are important because (1) generalises to enriched categories and (2) generalises to internal categories
Translating from (1) to (2) involves taking a big disjoint union: the class of all morphisms in a category is
So for definition (1) a morphism in is a function, and for definition (2) a morphism in is a triple consisting of a pair of sets and a function between them
Hi @Jean-Baptiste Vienney !
I am not worried about differences between the codomain (the set of possible outputs of a function) and the image (the actual outputs of a function) here. Instead, I was noticing that there can be two functions with different codomains that have the same input-output ordered pairs, and was wondering how to handle this in the context of assigning the categorical source and target of functions.
I hope I understood your comment properly!
Jules Hedges said:
So for definition (1) a morphism in is a function, and for definition (2) a morphism in is a triple consisting of a pair of sets and a function between them
Interesting! Would my and described above be equal, then, under definition (1)? If they would be, then I would be concerned that they would be required to have the same target, too.
Ok, sorry, I didn't understood well what you want to do :grinning_face_with_smiling_eyes: . Well, ok I don't see any other solution that putting the codomain in a triple.
David Egolf said:
Jules Hedges said:
So for definition (1) a morphism in is a function, and for definition (2) a morphism in is a triple consisting of a pair of sets and a function between them
Interesting! Would my and described above be equal, then, under definition (1)? If they would be, then I would be concerned that they would be required to have the same target, too.
This is where things get a bit tricky. Under the One True Official Standard definitions of set theory, as functions, as you say. But in category theory we would consider it meaningless to even ask whether elements of 2 different homsets are equal or not. You can formalise that with a type theoretic foundation, but most people don't bother with foundations and just do this with common sense
There aren't any set-theoretic issues even with this approach. But you no longer associate the codomain to each individual function: the codomain is given by the hom-set you are considering. So may be elements of multiple hom-sets, but it's never ambiguous as to what the target is.
But as Jules says, it's simpler to pretend the hom-sets are all distinct, because it doesn't make a difference in practice, and there is less chance for confusion.
Nathanael Arkor said:
There aren't any set-theoretic issues even with this approach. But you no longer associate the codomain to each individual function: the codomain is given by the hom-set you are considering. So may be elements of multiple hom-sets, but it's never ambiguous as to what the target is.
I see. If I understand, in this approach, if I want to know if I can compose after , then I would need to consider if there exists any hom-sets and so that contains , contains and the target of is the source of .
I would also be curious how this works with functors, which are required to respect sources and targets.
Rather, you have hom-sets and , and you have a composition operator . So in your example, would be an element of and (and others besides), but this doesn't actually cause any problems, because you never consider in isolation: only as an element of a specific hom-set, where the target is known.
Thanks, that clears things up!
Then there is no problem with functors either, because each "version" of has a clearly-defined unique source and target, based on which hom-set it is in.
Which amounts to dealing with types instead of sets. Which is the cleaner way most of the time imo
Great thread to make that point in, as equality in type theory is so clean and simple.
In a sense, the "meaningful" sentences of (1-)category theory are no more or less than "these 2 elements of the same hom-set are equal", which is exactly what we say when we say that a diagram commutes
John Baez said:
I claim it's not tendentious in the following sense: if you take an ordinary graduate math course, you're expected to assent automatically to manipulations of equality permitted by first-order logic with equality, and not to those that don't follow from this and the various theories stacked on top of this.
That's more or less true. But: