It looks like you're new here. If you want to get involved, click one of these buttons!

- All Categories 2.3K
- Chat 496
- Study Groups 10
- Epidemiology 5
- Network Theory 2
- Leaf Modeling 1
- Review Sections 9
- MIT 2020: Programming with Categories 52
- MIT 2020: Lectures 21
- MIT 2020: Exercises 25
- MIT 2019: Applied Category Theory 339
- MIT 2019: Lectures 79
- MIT 2019: Exercises 149
- MIT 2019: Chat 50
- UCR ACT Seminar 4
- General 64
- Azimuth Code Project 110
- Statistical methods 2
- Drafts 1
- Math Syntax Demos 15
- Wiki - Latest Changes 2
- Strategy 111
- Azimuth Project 1.1K
- - Spam 1
- News and Information 147
- Azimuth Blog 149
- - Conventions and Policies 21
- - Questions 43
- Azimuth Wiki 707

Options

We can do many things with databases using category theory. In fact David Spivak helps run a company called Categorical Informatics that specializes in this! And his partner, Ryan Wisnesky, would be happy to talk to people about it: click the link, he's attending this course.

One important thing we can do is transform databases. Suppose we have a database schema \(\mathcal{C}\). Remember, this is just a category. And suppose we have a database built using this schema:

$$ F: \mathcal{C} \to \mathbf{Set} .$$
Remember, this is just a functor. How can we we transform our database into a *different* database built using a *different* schema?

There's an easy way and two harder, more interesting ways. Today I'll only talk about the easy way.

Suppose we have another database schema \(\mathcal{D}\): that is, another category. And suppose we have a functor

$$ G : \mathcal{D} \to \mathcal{C} . $$ Then we can turn our database

$$ F: \mathcal{C} \to \mathbf{Set} $$ into a new database by 'composing it' with \(G\). The result is called

$$ F \circ G : \mathcal{D} \to \mathbf{Set} .$$ This is a database built using the schema \(\mathcal{D}\).

To understand this, you need to understand what it means to 'compose' functors. And, you need to think about some examples!

Let's start with the first part. We will define composition of functors quite generally, not just for databases, because it's an incredibly important concept with tons of applications:

**Definition.** Given functors \( A: \mathcal{X} \to \mathcal{Y} \) and \( B: \mathcal{Y} \to \mathcal{Z}\) there is a functor \(B \circ A : \mathcal{X} \to \mathcal{Z}\), called the **composite** of \(A\) and \(B\), defined as follows:

1) For any object \(x\) of \(\mathcal{X}\) we have

$$ (B \circ A)(x) = B(A(x)) .$$ 2) For any morphism \(f : x \to x'\) of \(\mathcal{X}\) we have

$$ (B \circ A)(f) = B(A(f)) .$$ So, it's just what you'd guess! Of course you need to show that it's a functor.

**Puzzle 119.** Show that if \( A: \mathcal{X} \to \mathcal{Y} \) and \( B: \mathcal{Y} \to \mathcal{Z}\) are functors, \(B \circ A : \mathcal{X} \to \mathcal{Z}\) defined as above is really a functor. (Hint: see the definition of functor in Lecture 38 and check all the conditions.)

Anything called 'composition' should be associative. Luckily, it's easy to check that composition of functors really is associative. It's so easy that I'll actually do it! Suppose we have three functors \(A,B,C\) that can be composed. On objects we have

$$ ((C \circ B) \circ A)(x) = (C\circ B)(A(x)) = C(B(A(x)) = C((B\circ A)(x)) = (C \circ (B \circ A))(x) .$$ We can do the same calculation for morphisms, too! A functor is determined by what it does to objects and morphisms. So, we have

$$ (C \circ B) \circ A = C \circ (B \circ A) .$$ Whenever you have something called 'composition', there should also be 'identities'. Indeed:

**Definition.** For any category \(\mathcal{X}\) there is an **identity functor** \( 1_\mathcal{X} : \mathcal{X} \to \mathcal{X}\), defined as follows:

1) For any object \(x\) of \(\mathcal{X}\) we have

$$ 1_{\mathcal{X}} (x) = x .$$ 2) For any morphism \(f : x \to x'\) of \(\mathcal{X}\) we have

$$ 1_{\mathcal{X}} (f) = f .$$ Again, it's just what you'd guess.

By this point, you should be ready for this mind-blowing idea:

**Definition.** There is a category \(\mathbf{Cat}\) where:

the objects of \(\mathbf{Cat}\) are categories,

if \(\mathcal{X},\mathcal{X}'\) are sets, a morphism \(F: \mathcal{X} \to \mathcal{X}'\) is a functor from \(\mathcal{X}\) to \(\mathcal{X}'\),

and composition and identities are defined as above.

The category of all categories! Logicians know this gives rise to paradoxes, just like the set of all sets. But it's easy to sidestep these, and it's not a big deal unless you're into this kind of thing, so I won't go into it now. I've spent years in the coal mines of mathematical logic, and it has its charm, but I'm trying to get to a point about databases here!

*Namely*, we can take a database, which is just a functor:

$$ F: \mathcal{C} \to \mathbf{Set} $$ and take another functor:

$$ G : \mathcal{D} \to \mathcal{C} $$ and get a new database by composing them:

$$ F \circ G : \mathcal{D} \to \mathbf{Set} .$$
But *what does this actually do for us?* Let's do an example!

In Lecture 36 we saw how to turn any graph into a category, the 'free category' on that graph. So let's create a category \(\mathcal{C}\) from this graph:

and imagine we have a database \( F: \mathcal{C} \to \mathbf{Set} \), which tells us an actual set of employees, an actual set of departments, an actual function mapping each employee to their department, etc.

Then, let's create a new category \(\mathcal{D}\) from a smaller graph that forgets everything about the departments:

This is a 'subgraph' of our earlier graph: simply put, it sits inside that bigger graph! So, we get a functor

$$ G : \mathcal{D} \to \mathcal{C} $$ which does this on objects:

$$ G(\textrm{Employee}) = \textrm{Employee} $$ $$ G(\textrm{String}) = \textrm{String} $$ and this on morphisms:

$$ G(\textrm{Manager}) = \textrm{Manager} $$ $$ G(\textrm{FirstName}) = \textrm{FirstName} .$$ Boring, huh? It looks almost like an identity functor, but it's not, because \(\mathcal{D}\) has more objects and morphisms. We say that \(\mathcal{C}\) is a subcategory of \(\mathcal{D}\).

Now, we can compose \(F\) and \(G\) and get a new database:

$$ F \circ G : \mathcal{D} \to \mathbf{Set} .$$ What is this like? Simple! It's just like our original database

$$ F : \mathcal{C} \to \mathbf{Set} $$ except it forgets all the data involving departments! If you don't see this, please draw an example.

In short, we've taken a database and 'trimmed it down' to a smaller database by leaving out some objects and morphisms in our original database schema.

We can also do other things using composition:

**Puzzle 120.** Take a database \( F: \mathcal{C} \to \mathbf{Set}\) and some functor \( H : \mathcal{E} \to \mathcal{C} \) that is not one-to-one on objects and morphisms, and see what the resulting database \( F \circ H : \mathcal{E} \to \mathbf{Set} \) looks like.

There are also millions of other things to say about functors. Just to give you a little practice:

**Puzzle 121.** Let \(\mathbf{N}\) be the free category on this graph:

It has one morphism for each natural number. What are all the functors \(F: \mathbf{N} \to \mathbf{N}\)? What happens when we compose them?

## Comments

(

EDIT:You deleted Puzzle 122! But I liked that one! :'( )Puzzle 121:The free category on this graph is a monoid isomorphic to \(\langle \mathbb{N}, + \rangle\), so endofunctors will be monoid endomorphisms. That means functors \(\mathbf{N} \to \mathbf{N}\) identify submonoids of \(\langle \mathbb{N}, + \rangle\), i.e. the homomorphic images of these functors. It is a theorem that every monoid homomorphism over a finitely presented monoid is determined by where the generators are sent, so it suffices to consider where \(1\) is mapped. As it happens, we get a monoid homomorphism for every natural number \(n\), determined by \(1 \mapsto n\) (i.e., \(x \mapsto n x\)). These are our desired functors. (It's worth noting that when \(n = 1\), we get the identity functor.)Composing these functors ends up multiplying their associated scaling factors. In other words, \(\langle \mathbb{N}, \cdot \rangle\) arises as the class of functors on \(\langle \mathbb{N}, + \rangle\).

Puzzle 122\({}^\ast\):\(F\) will pick a set and a class of automorphisms on that set that is closed under composition, again giving a monoid. Since \(\mathbf{N}\) is finitely generated, \(F\) is fully determined by where it sends \(s\). If \(F(z)\) is a finite set, then \(F(s)\) must have finite order, i.e. \((F(s))^{(k)} = \mathrm{id}\) for some \(k\). This means that \(F(\mathbf{N})\) is isomorphic to the finite group \(\mathbb{Z}_k\) for some \(k\), if \(F(z)\) is finite. If \(F(z)\) is infinite, then we gain the additional opportunity for \(F(s)\) to have infinite order. We can do this by mapping \(z \to \mathbb{Z}\) and \(s \to \lambda x. x + 1\); then we recover a structure isomorphic to \(\langle \mathbb{N}, + \rangle\).Every image of a functor \(F: \mathbf{N} \to \mathbf{Set}\) is isomorphic to one of the cases listed above; so while there may be uncountably many specific functors of this kind, there is only a countably infinite set of classes that produce different structures.

Incidentally, the finite set cases above give the same result as if we had imposed an equation on our finite presentation, namely that \(s^k = \mathrm{id}\) for some \(k\). Is it a general rule that for every finite presentation of a category with equations, there is a suitable functor from the free category that imposes these equations?

`(**EDIT:** You deleted Puzzle 122! But I liked that one! :'( ) **Puzzle 121:** The free category on this graph is a monoid isomorphic to \\(\langle \mathbb{N}, + \rangle\\), so endofunctors will be monoid endomorphisms. That means functors \\(\mathbf{N} \to \mathbf{N}\\) identify submonoids of \\(\langle \mathbb{N}, + \rangle\\), i.e. the homomorphic images of these functors. It is a theorem that every monoid homomorphism over a finitely presented monoid is determined by where the generators are sent, so it suffices to consider where \\(1\\) is mapped. As it happens, we get a monoid homomorphism for every natural number \\(n\\), determined by \\(1 \mapsto n\\) (i.e., \\(x \mapsto n x\\)). These are our desired functors. (It's worth noting that when \\(n = 1\\), we get the identity functor.) Composing these functors ends up multiplying their associated scaling factors. In other words, \\(\langle \mathbb{N}, \cdot \rangle\\) arises as the class of functors on \\(\langle \mathbb{N}, + \rangle\\). **Puzzle 122\\({}^\ast\\):** \\(F\\) will pick a set and a class of automorphisms on that set that is closed under composition, again giving a monoid. Since \\(\mathbf{N}\\) is finitely generated, \\(F\\) is fully determined by where it sends \\(s\\). If \\(F(z)\\) is a finite set, then \\(F(s)\\) must have finite order, i.e. \\((F(s))^{(k)} = \mathrm{id}\\) for some \\(k\\). This means that \\(F(\mathbf{N})\\) is isomorphic to the finite group \\(\mathbb{Z}_k\\) for some \\(k\\), if \\(F(z)\\) is finite. If \\(F(z)\\) is infinite, then we gain the additional opportunity for \\(F(s)\\) to have infinite order. We can do this by mapping \\(z \to \mathbb{Z}\\) and \\(s \to \lambda x. x + 1\\); then we recover a structure isomorphic to \\(\langle \mathbb{N}, + \rangle\\). Every image of a functor \\(F: \mathbf{N} \to \mathbf{Set}\\) is isomorphic to one of the cases listed above; so while there may be uncountably many specific functors of this kind, there is only a countably infinite set of classes that produce different structures. Incidentally, the finite set cases above give the same result as if we had imposed an equation on our finite presentation, namely that \\(s^k = \mathrm{id}\\) for some \\(k\\). Is it a general rule that for every finite presentation of a category with equations, there is a suitable functor from the free category that imposes these equations?`

Such a functor, \(F\), must map 0 (\(id_\mathbf{N}\)) to 0,

\[ F(id_\mathbf{N}) = id_\mathbf{N} = 0, \]

and it must send the non-identity \(s\) to either \(id_\mathbf{N}\), \(s\), or \(s\) repeated a certain finite number of times (\(s\circ s\circ \cdots \circ s \)),

\[ F(s) =id_\mathbf{N} \]

\[ \Leftrightarrow \\ F(s\circ s) = F(s)\circ F(s) = id_\mathbf{N} \circ id_\mathbf{N} = 0 + 0, \]

\[ \Leftrightarrow \\ F(\underbrace{s\circ s\circ \cdots \circ s}_{n \text{ times }}) \\ = \underbrace{F(s)\circ F(s)\circ \cdots \circ F(s)}_{n \text{ times }} \\ =\underbrace{id_\mathbf{N} \circ id_\mathbf{N} \circ \cdots \circ id_\mathbf{N} }_{n \text{ times }} \\ =\underbrace{0 + 0 + \cdots 0}_{n \text{ times }} = 0 \]

and, \[ F(s) =s = 1 \] \[ \Leftrightarrow \\ F(s\circ s) = F(s)\circ F(s) =s \circ s =1+1 , \] \[ \Leftrightarrow \\ F(\underbrace{s\circ s\circ \cdots \circ s}_{n \text{ times }}) \\ = \underbrace{F(s)\circ F(s)\circ \cdots \circ F(s)}_{n \text{ times }} \\ =\underbrace{s\circ s\circ \cdots \circ s}_{n \text{ times }} \\ =\underbrace{1 + 1 + \cdots 1}_{n \text{ times }} = n \]

which makes such an \(F\) the identity functor and,

\[ F(s) = \underbrace{s\circ s\circ \cdots \circ s}_{m \text{ times }} = m \] \[ \Leftrightarrow \\ F(s\circ s) = F(s)\circ F(s) = \underbrace{s\circ s\circ \cdots \circ s}_{m \text{ times }} \circ \underbrace{s\circ s\circ \cdots \circ s}_{m \text{ times }} = m+m = 2m, \] \[ \Leftrightarrow \\ F(\underbrace{s\circ s\circ \cdots \circ s}_{n \text{ times }}) \\ = \underbrace{F(s)\circ F(s)\circ \cdots \circ F(s)}_{n \text{ times }} \\ =\underbrace{ \underbrace{s\circ s\circ \cdots \circ s}_{m \text{ times }}\circ

\underbrace{s\circ s\circ \cdots \circ s}_{m \text{ times }}\circ \cdots \circ

\underbrace{s\circ s\circ \cdots \circ s}_{m \text{ times }}}_{n \text{ times }} \\ =\underbrace{m + m + \cdots m}_{n \text{ times }} = m*n \]

which would imply that functors \(F: \mathbf{N} \to \mathbf{N}\) are multiplication.

`>**Puzzle 121.** Let \\(\mathbf{N}\\) be the free category on this graph: ><img src="http://math.ucr.edu/home/baez/mathematical/7_sketches/graph_loop.png" > >It has one morphism for each natural number. What are all the functors \\(F: \mathbf{N} \to \mathbf{N}\\)? What happens when we compose them? Such a functor, \\(F\\), must map 0 (\\(id_\mathbf{N}\\)) to 0, \\[ F(id_\mathbf{N}) = id_\mathbf{N} = 0, \\] and it must send the non-identity \\(s\\) to either \\(id_\mathbf{N}\\), \\(s\\), or \\(s\\) repeated a certain finite number of times (\\(s\circ s\circ \cdots \circ s \\)), \\[ F(s) =id_\mathbf{N} \\] \\[ \Leftrightarrow \\\\ F(s\circ s) = F(s)\circ F(s) = id_\mathbf{N} \circ id_\mathbf{N} = 0 + 0, \\] \\[ \Leftrightarrow \\\\ F(\underbrace{s\circ s\circ \cdots \circ s}\_{n \text{ times }}) \\\\ = \underbrace{F(s)\circ F(s)\circ \cdots \circ F(s)}\_{n \text{ times }} \\\\ =\underbrace{id_\mathbf{N} \circ id_\mathbf{N} \circ \cdots \circ id_\mathbf{N} }\_{n \text{ times }} \\\\ =\underbrace{0 + 0 + \cdots 0}\_{n \text{ times }} = 0 \\] and, \\[ F(s) =s = 1 \\] \\[ \Leftrightarrow \\\\ F(s\circ s) = F(s)\circ F(s) =s \circ s =1+1 , \\] \\[ \Leftrightarrow \\\\ F(\underbrace{s\circ s\circ \cdots \circ s}\_{n \text{ times }}) \\\\ = \underbrace{F(s)\circ F(s)\circ \cdots \circ F(s)}\_{n \text{ times }} \\\\ =\underbrace{s\circ s\circ \cdots \circ s}\_{n \text{ times }} \\\\ =\underbrace{1 + 1 + \cdots 1}\_{n \text{ times }} = n \\] which makes such an \\(F\\) the identity functor and, \\[ F(s) = \underbrace{s\circ s\circ \cdots \circ s}\_{m \text{ times }} = m \\] \\[ \Leftrightarrow \\\\ F(s\circ s) = F(s)\circ F(s) = \underbrace{s\circ s\circ \cdots \circ s}\_{m \text{ times }} \circ \underbrace{s\circ s\circ \cdots \circ s}\_{m \text{ times }} = m+m = 2m, \\] \\[ \Leftrightarrow \\\\ F(\underbrace{s\circ s\circ \cdots \circ s}\_{n \text{ times }}) \\\\ = \underbrace{F(s)\circ F(s)\circ \cdots \circ F(s)}\_{n \text{ times }} \\\\ =\underbrace{ \underbrace{s\circ s\circ \cdots \circ s}\_{m \text{ times }}\circ \underbrace{s\circ s\circ \cdots \circ s}\_{m \text{ times }}\circ \cdots \circ \underbrace{s\circ s\circ \cdots \circ s}\_{m \text{ times }}}\_{n \text{ times }} \\\\ =\underbrace{m + m + \cdots m}\_{n \text{ times }} = m*n \\] which would imply that functors \\(F: \mathbf{N} \to \mathbf{N}\\) are multiplication.`

Puzzle 120.This transformed database \( F \circ H : \mathcal{E} \to \mathbf{Set} \) will obey the schema of \(\mathcal{C}\) where applicable but might be partial. The functor can be very general in terms of forgetting data or computing derived data. Splitting or combining "database columns" is essentially mapping between algebraic data types. I believe splitting or combining rows is also possible because as a functor \(H\) is polymorphic, a collection of general morphisms that don't have to be an element-wise function on sets. ETL "Extract Transfrom Load" (e.g. from CSV text to Dates) is ubiquitous, the source data \(E\) is typically validated, enriched, often grouped, sometimes filtered.

`**Puzzle 120.** > Take a database \\( F: \mathcal{C} \to \mathbf{Set}\\) and some functor \\( H : \mathcal{E} \to \mathcal{C} \\) that is not one-to-one on objects and morphisms This transformed database \\( F \circ H : \mathcal{E} \to \mathbf{Set} \\) will obey the schema of \\(\mathcal{C}\\) where applicable but might be partial. The functor can be very general in terms of forgetting data or computing derived data. Splitting or combining "database columns" is essentially mapping between algebraic data types. I believe splitting or combining rows is also possible because as a functor \\(H\\) is polymorphic, a collection of general morphisms that don't have to be an element-wise function on sets. ETL "Extract Transfrom Load" (e.g. from CSV text to Dates) is ubiquitous, the source data \\(E\\) is typically validated, enriched, often grouped, sometimes filtered.`

As Jonathan Castello writes \(\langle \mathbf{N}, \circ, id_{\star} \rangle \) isomorphic to the monoid \(\langle \mathbb{N}, +, 0\rangle\).

An endofunctor \(F\) obeys the law:

$$ F(x \circ y) = F(x) \circ F(y) $$ Hence \(F\) is a bit like a linear map. We also have

$$ F(id_{\star}) = id_{\star} $$ So we know that \(F\) is kind of

scaling.Hence the functors \(F\) behave like multiplying constants on \(\mathbb{N}\). There is one for each morphism in \(\mathbb{N}\).

For one, we get a category, which I am going to call \(\mathbf{Mor}\)

As Jonathan alluded to in #1, this category is like the covariant Cayley representation of \(\langle \mathbb{N}, \times, 1\rangle\).

Now that we have \(\mathbf{Mult}\), I have another idea...

Puzzle MD 1: Consider the functors \(E : \mathbf{N} \to \mathbf{Mult}\). What are these functors like?`> **Puzzle 121.** Let \\(\mathbf{N}\\) be the free category on this graph: > > <center>![N](http://math.ucr.edu/home/baez/mathematical/7_sketches/graph_loop.png)</center> > > It has one morphism for each natural number. What are all the functors \\(F: \mathbf{N} \to \mathbf{N}\\)? As Jonathan Castello writes \\(\langle \mathbf{N}, \circ, id_{\star} \rangle \\) isomorphic to the monoid \\(\langle \mathbb{N}, +, 0\rangle\\). An endofunctor \\(F\\) obeys the law: \[ F(x \circ y) = F(x) \circ F(y) \] Hence \\(F\\) is a bit like a [linear map](https://en.wikipedia.org/wiki/Linear_map). We also have \[ F(id_{\star}) = id_{\star} \] So we know that \\(F\\) is kind of [*scaling*](https://en.wikipedia.org/wiki/Scaling_(geometry)). Hence the functors \\(F\\) behave like multiplying constants on \\(\mathbb{N}\\). There is one for each morphism in \\(\mathbb{N}\\). > What happens when we compose them? For one, we get a category, which I am going to call \\(\mathbf{Mor}\\) - The objects are the morphisms of \\(\mathbf{N}\\) - The identity is the identity functor \\(\mathbf{1}_{\bullet}\\), corresponding to the scaling \\(1 \times \cdot\\) - Morphisms in this category are functors \\(F : \mathbf{N} \to \mathbf{N}\\) - Morphism composition is functor composition \\(\bullet\\) As Jonathan alluded to in [#1](https://forum.azimuthproject.org/discussion/comment/19163/#Comment_19163), this category is like the covariant [Cayley representation](https://en.wikipedia.org/wiki/Cayley%27s_theorem#Proof_of_the_theorem) of \\(\langle \mathbb{N}, \times, 1\rangle\\). Now that we have \\(\mathbf{Mult}\\), I have another idea... **Puzzle MD 1**: Consider the functors \\(E : \mathbf{N} \to \mathbf{Mult}\\). What are these functors like?`

Matthew Doty wrote:

You haven't said this outright, but the morphisms of this category are functors, correct? The functors we've been discussing are of kind \(\mathbf{N} \to \mathbf{N}\). How do these associate to morphisms in \(\mathbf{Mult}\)?

`Matthew Doty wrote: > For one, we get a category, which I am going to call \\(\mathbf{Mult}\\) You haven't said this outright, but the morphisms of this category are functors, correct? The functors we've been discussing are of kind \\(\mathbf{N} \to \mathbf{N}\\). How do these associate to morphisms in \\(\mathbf{Mult}\\)?`

Yes. The morphisms are the functors \(F : \mathbf{N} \to \mathbf{N}\)

I went back and fixed my post to make this more explicit.

Each functor corresponds to a morphism and vice versa.

`> You haven't said this outright, but the morphisms of this category are functors, correct? Yes. The morphisms are the functors \\(F : \mathbf{N} \to \mathbf{N}\\) I went back and fixed my post to make this more explicit. > The functors we've been discussing are of kind \\(\mathbf{N} \to \mathbf{N}\\). How do these associate to morphisms in \\(\mathbf{Mult}\\)? Each functor corresponds to a morphism and vice versa.`

But you've stated that the objects of \(\mathbf{Mult}\) are the morphisms of \(\mathbf{N}\). Is this not a something of a level slip?

I would have expected \(\textbf{Mult}\) to be the single-object category with \(\mathbf{N}\) as its object, and functors \(\mathbf{N} \to \mathbf{N}\) as morphisms. After all, the set of endofunctors on \(\mathbf{N}\) forms a commutative monoid by their identification with integer scaling, and monoids are the same as single-object categories.

`> Each functor corresponds to a morphism and vice versa. But you've stated that the objects of \\(\mathbf{Mult}\\) are the morphisms of \\(\mathbf{N}\\). Is this not a something of a level slip? I would have expected \\(\textbf{Mult}\\) to be the single-object category with \\(\mathbf{N}\\) as its object, and functors \\(\mathbf{N} \to \mathbf{N}\\) as morphisms. After all, the set of endofunctors on \\(\mathbf{N}\\) forms a commutative monoid by their identification with integer scaling, and monoids are the same as single-object categories.`

I don't think so.

Below I am going to use \(\bullet\) for functorial composition.

For a category \(\mathcal{C}\) an endofunctor \(F: \mathbf{Mor}(\mathcal{C}) \to \mathbf{Mor}(\mathcal{C})\) maps morphisms to morphisms.

If I have three endofunctors \(A,B,C\) and a morphism \(f\) then we have associativity of functorial composition:

$$ ((A \bullet B) \bullet C)(f) = (A \bullet (B \bullet C))(f) $$ We also have the

identity functor\(\mathbf{1}_{\bullet}\) that leaves morphisms alone, so it obeys:$$ (\mathbf{1}_{\bullet} \bullet F)(f) = (F \bullet \mathbf{1}_{\bullet})(f) = F(f) $$ I don't think this is my construction. Saunder's MacLane defines exactly the same thing on page 128 of

Categories for the Working Mathematician(1968).Well, truth be told I am not sure what the convention is.

I think you could define \(\textbf{Mult}\) either way I think.

Hopefully someone can come along and say definitively what the objects are in the category of endofunctors of a category \(\mathcal{C}\).

I don't think it makes a big difference for the puzzle I invented...

`> > Each functor corresponds to a morphism and vice versa. > > But you've stated that the objects of \\(\mathbf{Mult}\\) are the morphisms of \\(\mathbf{N}\\). Is this not a something of a level slip? I don't think so. Below I am going to use \\(\bullet\\) for functorial composition. For a category \\(\mathcal{C}\\) an endofunctor \\(F: \mathbf{Mor}(\mathcal{C}) \to \mathbf{Mor}(\mathcal{C})\\) maps morphisms to morphisms. If I have three endofunctors \\(A,B,C\\) and a morphism \\(f\\) then we have associativity of functorial composition: \[ ((A \bullet B) \bullet C)(f) = (A \bullet (B \bullet C))(f) \] We also have the *identity functor* \\(\mathbf{1}_{\bullet}\\) that leaves morphisms alone, so it obeys: \[ (\mathbf{1}\_{\bullet} \bullet F)(f) = (F \bullet \mathbf{1}\_{\bullet})(f) = F(f) \] I don't think this is my construction. Saunder's MacLane defines exactly the same thing on page 128 of [*Categories for the Working Mathematician* (1968)](https://books.google.com/books?id=MXboNPdTv7QC&pg=PA138&lpg=PA138&dq=%22monoid+in+the+category+of+endofunctors%22+mac+lane&source=bl&ots=feQWTkH2Uw&sig=tv-1JwaMOygKGmFE2vM2FhJVS9o&hl=en&ei=5iWsTJCkBIPSsAPQwJ36Aw&sa=X&oi=book_result&ct=result&resnum=1&ved=0CBIQ6AEwAA#v=onepage&q&f=false). > I would have expected \\(\textbf{Mult}\\) to be the single-object category with \\(\mathbf{N}\\) as its object, and functors \\(\mathbf{N} \to \mathbf{N}\\) as morphisms. After all, the set of endofunctors on \\(\mathbf{N}\\) forms a commutative monoid by their identification with integer scaling, and monoids are the same as single-object categories. Well, truth be told I am not sure what the convention is. I think you could define \\(\textbf{Mult}\\) either way I think. Hopefully someone can come along and say definitively what the objects are in the category of endofunctors of a category \\(\mathcal{C}\\). I don't think it makes a big difference for the puzzle I invented...`

So we have \(A, B, C : \mathbf{Hom}(\mathcal{C}) \to \mathbf{Hom}(\mathcal{C})\). Are there endofunctors with any other signature?

I think the difference between our constructions amounts to the difference between Puzzle 99 and Puzzle 100. In Puzzle 100, we can

labelarrows from one object to another with particular endomorphisms (group elements), buteveryobject has some out-arrow labeled with this element. There isn't a one-to-one correspondence between endomorphisms and arrows, because we're applying \(F\) specially to each object and relating the single input to the single output.Put differently, if we take each \(s^{k}\) as an object in our new category, and we induce all arrows \(s^k \to s^{nk}\) for each endofunctor \(n\), we end up with a partial order (except for zero). Indeed, this is the divisibility lattice on the positive natural numbers, augmented with a lonely \(0\) object that behaves like the single-object category I described, with one endomorphism for each \(n\).

(

EDIT:Some confusion might arise from the fact that we often construct the naturals by \(z, s(z), s(s(z)), \cdots\), and we have a morphism \(s\) and an object \(z\) in evidence here. But \(s(z)\) is a nonsensical construction in \(\textbf{N}\)! Morphisms are not applied to objects. Objects represent the domain and codomain of morphisms. If \(z\) were a set, then we could take \(x \in z\) and have \(s(x) \in z\).)He seems to be doing something with a single fixed endofunctor \(T\) and some natural transformations \(\eta, \mu\), the latter of which I have no familiarity with. We have a whole family of endofunctors and no obvious maps between any of them.

If \(\textbf{Mult}\) is the divisibility lattice augmented with zero, then we have essentially two classes of functor \(F : \mathbf{N} \to \mathbf{Mult}\). One functor maps \(z\) onto a non-zero element, forcing all morphisms onto the identity morphism. It doesn't much matter which number we map onto; the image of the functor will be a single object with its identity morphism. The other functors are covered by the case below.

If \(\textbf{Mult}\) is the single-object category with functors \(\mathbf{N} \to \mathbf{N}\) as morphisms, then functors \(\mathbf{N} \to \mathbf{Mult}\) are monoid homomorphisms between \(\langle \mathbb{N}, + \rangle\) and \(\langle \mathbb{N}, \cdot \rangle\). It suffices to consider where \(1\) is mapped to. If \(1\) maps to \(n\) for a choice of \(n\), then \(k\) maps to \(n^k\). In other words, we get exponentiation.

If we do this again, what do we get? There's a name for what's happening here.

`> For a category \\(\mathcal{C}\\) an endofunctor \\(F: \mathbf{Hom}(\mathcal{C}) \to \mathbf{Hom}(\mathcal{C})\\) maps morphisms to morphisms. > > If I have three endofunctors \\(A,B,C\\) and a morphism \\(f\\) then we have associativity of functorial composition: So we have \\(A, B, C : \mathbf{Hom}(\mathcal{C}) \to \mathbf{Hom}(\mathcal{C})\\). Are there endofunctors with any other signature? I think the difference between our constructions amounts to the difference between [Puzzle 99 and Puzzle 100](https://forum.azimuthproject.org/discussion/2198/lecture-34-chapter-3-categories/p1). In Puzzle 100, we can _label_ arrows from one object to another with particular endomorphisms (group elements), but _every_ object has some out-arrow labeled with this element. There isn't a one-to-one correspondence between endomorphisms and arrows, because we're applying \\(F\\) specially to each object and relating the single input to the single output. Put differently, if we take each \\(s^{k}\\) as an object in our new category, and we induce all arrows \\(s^k \to s^{nk}\\) for each endofunctor \\(n\\), we end up with a partial order (except for zero). Indeed, this is the divisibility lattice on the positive natural numbers, augmented with a lonely \\(0\\) object that behaves like the single-object category I described, with one endomorphism for each \\(n\\). (**EDIT:** Some confusion might arise from the fact that we often construct the naturals by \\(z, s(z), s(s(z)), \cdots\\), and we have a morphism \\(s\\) and an object \\(z\\) in evidence here. But \\(s(z)\\) is a nonsensical construction in \\(\textbf{N}\\)! Morphisms are not applied to objects. Objects represent the domain and codomain of morphisms. If \\(z\\) were a set, then we could take \\(x \in z\\) and have \\(s(x) \in z\\).) > I don't think this is my construction. Saunder's MacLane defines exactly the same thing on page 128 of [*Categories for the Working Mathematician* (1968)](https://books.google.com/books?id=MXboNPdTv7QC&pg=PA138&lpg=PA138&dq=%22monoid+in+the+category+of+endofunctors%22+mac+lane&source=bl&ots=feQWTkH2Uw&sig=tv-1JwaMOygKGmFE2vM2FhJVS9o&hl=en&ei=5iWsTJCkBIPSsAPQwJ36Aw&sa=X&oi=book_result&ct=result&resnum=1&ved=0CBIQ6AEwAA#v=onepage&q&f=false). He seems to be doing something with a single fixed endofunctor \\(T\\) and some natural transformations \\(\eta, \mu\\), the latter of which I have no familiarity with. We have a whole family of endofunctors and no obvious maps between any of them. > I don't think it makes a big difference for the puzzle I invented... If \\(\textbf{Mult}\\) is the divisibility lattice augmented with zero, then we have essentially two classes of functor \\(F : \mathbf{N} \to \mathbf{Mult}\\). One functor maps \\(z\\) onto a non-zero element, forcing all morphisms onto the identity morphism. It doesn't much matter which number we map onto; the image of the functor will be a single object with its identity morphism. The other functors are covered by the case below. If \\(\textbf{Mult}\\) is the single-object category with functors \\(\mathbf{N} \to \mathbf{N}\\) as morphisms, then functors \\(\mathbf{N} \to \mathbf{Mult}\\) are monoid homomorphisms between \\(\langle \mathbb{N}, + \rangle\\) and \\(\langle \mathbb{N}, \cdot \rangle\\). It suffices to consider where \\(1\\) is mapped to. If \\(1\\) maps to \\(n\\) for a choice of \\(n\\), then \\(k\\) maps to \\(n^k\\). In other words, we get exponentiation. If we do this again, what do we get? There's a [name](https://en.wikipedia.org/wiki/Hyperoperation#Examples) for what's happening here.`

Jonathan wrote:

I'm not sure what "do this again" means. I would love to get hyperoperations this way. But there are some puzzling features.

Note that addition and multiplication are associative but exponentiation is not. Composition of morphisms is automatically associative. So, \( (\mathbb{N},+,0)\) and \( (\mathbb{N},\cdot,1)\) can be regarded as one-object categories but \( (\mathbb{N},\uparrow,???)\) cannot, where \(a \uparrow b = a^b\) is exponentation.

Exponentiation also lacks an identity, which is why I write \(???\): we have \(a\uparrow 1 = a\) but not \(1 \uparrow a = a\).

For these reasons, we were able to get nice category-theoretic descriptions of \( (\mathbb{N},+,0)\) and \( (\mathbb{N},\cdot,1)\), but the pattern must change a bit when we hit exponentation and higher hyperoperations:

\( (\mathbb{N},+,0)\) is isomorphic to \(\mathbf{N}\), the free category on the graph

\( (\mathbb{N},\cdot,1)\) is isomorphic to a category I'll call \(\mathbf{M}\) with \(\mathbf{N}\) as its only object and functors from \(\mathbf{N}\) to itself as morphisms.

We could try to charge ahead naively:

Puzzle.What is the category with \(\mathbf{M}\) as its only object and functors from \(\mathbf{M}\) to itself as morphisms?This could be interesting, and we could keep repeating this. But you are wisely taking a detour: to get exponentation, you're looking at functors from \(\mathbf{N}\) to \(\mathbf{M}\). What does it mean to "do this again"?

`Jonathan wrote: > If we do this again, what do we get? I'm not sure what "do this again" means. I would love to get [hyperoperations](https://en.wikipedia.org/wiki/Hyperoperation#Examples) this way. But there are some puzzling features. Note that addition and multiplication are associative but exponentiation is not. Composition of morphisms is automatically associative. So, \\( (\mathbb{N},+,0)\\) and \\( (\mathbb{N},\cdot,1)\\) can be regarded as one-object categories but \\( (\mathbb{N},\uparrow,???)\\) cannot, where \\(a \uparrow b = a^b\\) is exponentation. Exponentiation also lacks an identity, which is why I write \\(???\\): we have \\(a\uparrow 1 = a\\) but not \\(1 \uparrow a = a\\). For these reasons, we were able to get nice category-theoretic descriptions of \\( (\mathbb{N},+,0)\\) and \\( (\mathbb{N},\cdot,1)\\), but the pattern must change a bit when we hit exponentation and higher hyperoperations: * \\( (\mathbb{N},+,0)\\) is isomorphic to \\(\mathbf{N}\\), the free category on the graph <img width = "25" src = "http://math.ucr.edu/home/baez/mathematical/7_sketches/graph_loop.png"> * \\( (\mathbb{N},\cdot,1)\\) is isomorphic to a category I'll call \\(\mathbf{M}\\) with \\(\mathbf{N}\\) as its only object and functors from \\(\mathbf{N}\\) to itself as morphisms. We could try to charge ahead naively: **Puzzle.** What is the category with \\(\mathbf{M}\\) as its only object and functors from \\(\mathbf{M}\\) to itself as morphisms? This could be interesting, and we could keep repeating this. But you are wisely taking a detour: to get exponentation, you're looking at functors from \\(\mathbf{N}\\) to \\(\mathbf{M}\\). What does it mean to "do this again"?`

Matthew wrote:

A purely botational comment:

I guess you're using \(\mathbf{Hom}(\mathcal{C})\) to mean the set of all morphisms in \(\mathcal{C}\). The usual notation for the set of all morphisms in \(\mathcal{C}\) is \(\mathbf{Mor}(\mathcal{C})\), so I recommend this; it goes along with \(\mathbf{Ob}(\mathcal{C})\) for the set of objects.

I've never seen anyone write \(\mathbf{Hom}(\mathcal{C})\). We often see \(\mathrm{Hom}(c,c')\), which means the set of morphisms from some object \(c\) to some object \(c'\).

`Matthew wrote: > For a category \\(\mathcal{C}\\) an endofunctor \\(F: \mathbf{Hom}(\mathcal{C}) \to \mathbf{Hom}(\mathcal{C})\\) maps morphisms to morphisms. A purely botational comment: I guess you're using \\(\mathbf{Hom}(\mathcal{C})\\) to mean the set of all morphisms in \\(\mathcal{C}\\). The usual notation for the set of all morphisms in \\(\mathcal{C}\\) is \\(\mathbf{Mor}(\mathcal{C})\\), so I recommend this; it goes along with \\(\mathbf{Ob}(\mathcal{C})\\) for the set of objects. I've never seen anyone write \\(\mathbf{Hom}(\mathcal{C})\\). We often see \\(\mathrm{Hom}(c,c')\\), which means the set of morphisms from some object \\(c\\) to some object \\(c'\\).`

Matthew wrote:

In a category, each morphism goes from one particular object to one particular object. You're not specifying how this works for \(\mathbf{Mult}\).

But I can guess: morphisms in \(\mathbf{Mult}\) are not really functors \(F : \mathbf{N} \to \mathbf{N}\); rather, each functor \(F : \mathbf{N} \to \mathbf{N}\) gives infinitely many morphisms in \(\mathbf{Mult}\), one for each object of \(\mathbf{Mult}\). Objects of \(\mathbf{Mult}\) can be identified with natural numbers, and if a functor \(F : \mathbf{N} \to \mathbf{N}\) maps the object \(n\) to the object \(n'\), we decree that there's a morphism

$$ (F,n) : n \to n' $$ in \(\mathbf{Mult}\). We compose these in the obvious way:

$$ (F',n') \circ (F,n) = (F' \circ F, n) .$$ This is an example of a sort of well-known construction.

`Matthew wrote: > For one, we get a category, which I am going to call \\(\mathbf{Mult}\\) > - The objects are the morphisms of \\(\mathbf{N}\\) > - The identity is the identity functor \\(\mathbf{1}_{\bullet}\\), corresponding to the scaling \\(1 \times \cdot\\) > - Morphisms in this category are functors \\(F : \mathbf{N} \to \mathbf{N}\\) > - Morphism composition is functor composition \\(\bullet\\) In a category, each morphism goes from one particular object to one particular object. You're not specifying how this works for \\(\mathbf{Mult}\\). But I can guess: morphisms in \\(\mathbf{Mult}\\) are not really functors \\(F : \mathbf{N} \to \mathbf{N}\\); rather, each functor \\(F : \mathbf{N} \to \mathbf{N}\\) gives infinitely many morphisms in \\(\mathbf{Mult}\\), one for each object of \\(\mathbf{Mult}\\). Objects of \\(\mathbf{Mult}\\) can be identified with natural numbers, and if a functor \\(F : \mathbf{N} \to \mathbf{N}\\) maps the object \\(n\\) to the object \\(n'\\), we decree that there's a morphism \[ (F,n) : n \to n' \] in \\(\mathbf{Mult}\\). We compose these in the obvious way: \[ (F',n') \circ (F,n) = (F' \circ F, n) .\] This is an example of a sort of well-known construction.`

Matthew wrote:

The objects of the endofunctor category of \(\mathcal{C}\) are functors \(F : \mathcal{C} \to \mathcal{C}\). The morphisms are natural transformations between such functors.

This is a special case of something we'll talk about soon. Given two categories \(\mathcal{C}, \mathcal{D}\), the

functor category\(\mathcal{D}^\mathcal{C}\) has:In this notation the endofunctor category of \(\mathcal{C}\) is \(\mathcal{C}^\mathcal{C}\).

We haven't talked about natural transformations in this course yet, so the following puzzles are "unfair", but I can't resist mentioning them. Maybe I'll make them official puzzles later.

Puzzle.If \(\mathbf{N}\) is the free category on the graphwhat is the endofunctor category \(\mathbf{N}^\mathbf{N}\)?

Puzzle.What is the functor category$$ \mathbf{N}^{(\mathbf{N}^\mathbf{N})} ? $$ We could go on...

`Matthew wrote: > Hopefully someone can come along and say definitively what the objects are in the category of endofunctors of a category \\(\mathcal{C}\\). The objects of the endofunctor category of \\(\mathcal{C}\\) are functors \\(F : \mathcal{C} \to \mathcal{C}\\). The morphisms are natural transformations between such functors. This is a special case of something we'll talk about soon. Given two categories \\(\mathcal{C}, \mathcal{D}\\), the **functor category** \\(\mathcal{D}^\mathcal{C}\\) has: * functors \\(F: \mathcal{C} \to \mathcal{D}\\) as objects, * natural transformations between such functors as morphisms. In this notation the endofunctor category of \\(\mathcal{C}\\) is \\(\mathcal{C}^\mathcal{C}\\). We haven't talked about natural transformations in this course yet, so the following puzzles are "unfair", but I can't resist mentioning them. Maybe I'll make them official puzzles later. <img width = "150" src = "http://math.ucr.edu/home/baez/mathematical/warning_sign.jpg"> **Puzzle.** If \\(\mathbf{N}\\) is the free category on the graph <center> <img src = "http://math.ucr.edu/home/baez/mathematical/7_sketches/graph_loop.png"></center> what is the endofunctor category \\(\mathbf{N}^\mathbf{N}\\)? **Puzzle.** What is the functor category \[ \mathbf{N}^{(\mathbf{N}^\mathbf{N})} ? \] We could go on...`

No, there are not. All endofunctors have that signature.

Now that I've slept on this, I believe you are right. I made a level slip.

The revised definition of the category \(\mathbf{Mult}\) should be:

First, I was wrong. Saunders MacLane has a different construction, based on the Category of Functors. He is considering a whole family of endofunctors, however.

Moreover, I think you

mayhave seen the \(\eta\) and \(\mu\) MacLane is talking about using different names. In Haskell, we write \(\eta\) as`return`

(from the`Prelude`

) and \(\mu\) as`Control.Monad.join`

.I don't think we can map to any other constant other than \(1_{\mathbf{Mult}}\), sadly.

Exactly!

I am not sure how to do this again.

Both \(\mathbf{Nat}\) and \(\mathbf{Mult}\) are monoids.

However, the exponential functors \(E : \mathbf{Nat} \to \mathbf{Mult}\) don't compose, so they don't form a monoid.

In particular, if I have \(3^k\) and \(5^k\), there is no natural number \(n\) where \(n^k = 3^{5^k}\) for all \(k\).

But I know what you are getting at, so I want to try to puzzle it out.

One strategy might be to make the functors \(E : \mathbf{Nat} \to \mathbf{Mult}\) into a category with natural transformations as morphisms, following the Category of Functors construction I mentioned. Then look at endofunctors on this and see what those are. And then we get

hypedup about it if this works! But I am not sure if that will work, it's just an idea.`> So we have \\(A, B, C : \mathbf{Hom}(\mathcal{C}) \to \mathbf{Hom}(\mathcal{C})\\). Are there endofunctors with any other signature? No, there are not. All endofunctors have that signature. Now that I've slept on this, I believe you are right. I made a level slip. The revised definition of the category \\(\mathbf{Mult}\\) should be: > - The objects of this category are defined to be \\(\mathrm{Obj}(\mathbf{Mult}) = \lbrace\mathbf{Mor}(\mathbf{N})\rbrace\\). In other words there is a single object. > - The identity is the identity functor \\(\mathbf{1}_{\bullet}\\), corresponding to the scaling \\(1 \times \cdot\\) > - Morphisms in this category are functors \\(F : \mathbf{N} \to \mathbf{N}\\) > - Morphism composition is functor composition \\(\bullet\\) ------------------------------------ > > I don't think this is my construction. Saunders MacLane defines exactly the same thing on page 128 of [*Categories for the Working Mathematician* (1968)](https://books.google.com/books?id=MXboNPdTv7QC&pg=PA138&lpg=PA138&dq=%22monoid+in+the+category+of+endofunctors%22+mac+lane&source=bl&ots=feQWTkH2Uw&sig=tv-1JwaMOygKGmFE2vM2FhJVS9o&hl=en&ei=5iWsTJCkBIPSsAPQwJ36Aw&sa=X&oi=book_result&ct=result&resnum=1&ved=0CBIQ6AEwAA#v=onepage&q&f=false). > > He seems to be doing something with a single fixed endofunctor \\(T\\) and some natural transformations \\(\eta, \mu\\), the latter of which I have no familiarity with. We have a whole family of endofunctors and no obvious maps between any of them. First, I was wrong. Saunders MacLane has a different construction, based on the [Category of Functors](https://en.wikipedia.org/wiki/Functor_category). He is considering a whole family of endofunctors, however. Moreover, I think you *may* have seen the \\(\eta\\) and \\(\mu\\) MacLane is talking about using different names. In Haskell, we write \\(\eta\\) as [`return`](https://hackage.haskell.org/package/base-4.11.1.0/docs/Prelude.html#v:return) (from the `Prelude`) and \\(\mu\\) as [`Control.Monad.join`](https://hackage.haskell.org/package/base-4.11.1.0/docs/Control-Monad.html#v:join). > If \\(\textbf{Mult}\\) is the divisibility lattice augmented with zero, then we have essentially two classes of functor \\(F : \mathbf{N} \to \mathbf{Mult}\\). One functor maps \\(z\\) onto a non-zero element, forcing all morphisms onto the identity morphism. It doesn't much matter which number we map onto; the image of the functor will be a single object with its identity morphism. The other functors are covered by the case below. I don't think we can map to any other constant other than \\(1_{\mathbf{Mult}}\\), sadly. > If \\(\textbf{Mult}\\) is the single-object category with functors \\(\mathbf{N} \to \mathbf{N}\\) as morphisms, then functors \\(\mathbf{N} \to \mathbf{Mult}\\) are monoid homomorphisms between \\(\langle \mathbb{N}, + \rangle\\) and \\(\langle \mathbb{N}, \cdot \rangle\\). It suffices to consider where \\(1\\) is mapped to. If \\(1\\) maps to \\(n\\) for a choice of \\(n\\), then \\(k\\) maps to \\(n^k\\). In other words, we get exponentiation. Exactly! > If we do this again, what do we get? There's a [name](https://en.wikipedia.org/wiki/Hyperoperation#Examples) for what's happening here. I am not sure how to do this again. Both \\(\mathbf{Nat}\\) and \\(\mathbf{Mult}\\) are monoids. However, the exponential functors \\(E : \mathbf{Nat} \to \mathbf{Mult}\\) don't compose, so they don't form a monoid. In particular, if I have \\(3^k\\) and \\(5^k\\), there is no natural number \\(n\\) where \\(n^k = 3^{5^k}\\) for all \\(k\\). But I know what you are getting at, so I want to try to puzzle it out. One strategy might be to make the functors \\(E : \mathbf{Nat} \to \mathbf{Mult}\\) into a category with natural transformations as morphisms, following the [Category of Functors](https://en.wikipedia.org/wiki/Functor_category) construction I mentioned. Then look at endofunctors on this and see what those are. And then we get *hyped* up about it if this works! But I am not sure if that will work, it's just an idea.`

John wrote:

You are right.

I attempted to clean this up above:

Since there's only one object, every morphism fixes it.

This category is the same as the monoid \(\langle \mathbb{N}, \times, 1\rangle\) Jonathan mentioned in #1.

This wasn't what I had in mind but I am curious to know the name of this construction.

`John wrote: > Matthew wrote: > > For one, we get a category, which I am going to call \\(\mathbf{Mult}\\) > > > - The objects are the morphisms of \\(\mathbf{N}\\) > > - The identity is the identity functor \\(\mathbf{1}_{\bullet}\\), corresponding to the scaling \\(1 \times \cdot\\) > > - Morphisms in this category are functors \\(F : \mathbf{N} \to \mathbf{N}\\) > > - Morphism composition is functor composition \\(\bullet\\) > > In a category, each morphism goes from one particular object to one particular object. You're not specifying how this works for \\(\mathbf{Mult}\\). You are right. I attempted to clean this up above: - The objects of this category are defined to be \\(\mathrm{Obj}(\mathbf{Mult}) = \lbrace\mathbf{Mor}(\mathbf{N})\rbrace\\). In other words there is a single object. - The identity is the identity functor \\(\mathbf{1}_{\bullet}\\), corresponding to the scaling \\(1 \times \cdot\\) - Morphisms in this category are functors \\(F : \mathbf{N} \to \mathbf{N}\\) - Morphism composition is functor composition \\(\bullet\\) Since there's only one object, every morphism fixes it. This category is the same as the monoid \\(\langle \mathbb{N}, \times, 1\rangle\\) Jonathan mentioned in [#1](https://forum.azimuthproject.org/discussion/comment/19163/#Comment_19163). > But I can guess: morphisms in \\(\mathbf{Mult}\\) are not really functors \\(F : \mathbf{N} \to \mathbf{N}\\); rather, each functor \\(F : \mathbf{N} \to \mathbf{N}\\) gives infinitely many morphisms in \\(\mathbf{Mult}\\), one for each object of \\(\mathbf{Mult}\\). Objects of \\(\mathbf{Mult}\\) can be identified with natural numbers, and if a functor \\(F : \mathbf{N} \to \mathbf{N}\\) maps the object \\(n\\) to the object \\(n'\\), we decree that there's a morphism > > \[ (F,n) : n \to n' \] > > in \\(\mathbf{Mult}\\). We compose these in the obvious way: > > \[ (F',n') \circ (F,n) = (F' \circ F, n) .\] > > This is an example of a sort of well-known construction. This wasn't what I had in mind but I am curious to know the name of this construction.`

The composition of the multiplication functors is explicitly given by,

first let,

\[ F(s)=\underbrace{s \circ s \circ \cdots \circ s}_{m \text{ times }}= m \\ G(s)=\underbrace{s \circ s \circ \cdots \circ s}_{n \text{ times }}= n \\ s \circ s \circ \cdots \circ s = x \]

then,

\[ (G \circ F)(s \circ s \circ \cdots \circ s) \\ = G(F(s \circ s \circ \cdots \circ s)) \\ = G(F(s) \circ F(s) \circ \cdots \circ F(s)) \\ = G(m \circ m \circ \cdots m) \]

\[ = G(\underbrace{s \circ s \circ \cdots \circ s}_{m }) \circ G(\underbrace{s \circ s \circ \cdots \circ s}_{m }) \circ \cdots G(\underbrace{s \circ s \circ \cdots \circ s}_{m }) \\ = \underbrace{G(s) \circ G(s) \circ \cdots \circ G(s)}_{m } \circ \underbrace{G(s) \circ G(s) \circ \cdots \circ G(s)}_{m } \circ \cdots \underbrace{G(s) \circ G(s) \circ \cdots \circ G(s)}_{m } \]

\[ = \underbrace{n \circ n \circ \cdots \circ n}_{m} \circ \underbrace{n \circ n \circ \cdots \circ n}_{m } \circ \cdots \underbrace{n \circ n \circ \cdots \circ n}_{m } \] \[ = n \ast m \ast x, \]

which follows simply from the functor laws!

`The composition of the multiplication functors is explicitly given by, first let, \\[ F(s)=\underbrace{s \circ s \circ \cdots \circ s}\_{m \text{ times }}= m \\\\ G(s)=\underbrace{s \circ s \circ \cdots \circ s}\_{n \text{ times }}= n \\\\ s \circ s \circ \cdots \circ s = x \\] then, \\[ (G \circ F)(s \circ s \circ \cdots \circ s) \\\\ = G(F(s \circ s \circ \cdots \circ s)) \\\\ = G(F(s) \circ F(s) \circ \cdots \circ F(s)) \\\\ = G(m \circ m \circ \cdots m) \\] \\[ = G(\underbrace{s \circ s \circ \cdots \circ s}\_{m }) \circ G(\underbrace{s \circ s \circ \cdots \circ s}\_{m }) \circ \cdots G(\underbrace{s \circ s \circ \cdots \circ s}\_{m }) \\\\ = \underbrace{G(s) \circ G(s) \circ \cdots \circ G(s)}\_{m } \circ \underbrace{G(s) \circ G(s) \circ \cdots \circ G(s)}\_{m } \circ \cdots \underbrace{G(s) \circ G(s) \circ \cdots \circ G(s)}\_{m } \\] \\[ = \underbrace{n \circ n \circ \cdots \circ n}\_{m} \circ \underbrace{n \circ n \circ \cdots \circ n}\_{m } \circ \cdots \underbrace{n \circ n \circ \cdots \circ n}\_{m } \\] \\[ = n \ast m \ast x, \\] which follows simply from the functor laws!`

John wrote:

Hmm, you're quite right! I saw the start of a pattern and charged ahead rather blindly. What I wanted to do was iteratively consider the sequence of categories \(\mathcal{X}_n\) with morphisms all functors \(F_n : \mathbf{N} \to \mathcal{X}_{n-1}\). But once you get \(\mathcal{X}_2 = \mathbf{Exp}\), the category with two objects consisting of functors \(\mathbf{N} \to \mathbf{Mult}\), you no longer have any useful cycles, so you can no longer iterate your morphisms, and everything locks up. (I think \(\mathcal{X}_3 = \mathbf{Unit}\), if we forced onwards with functors \(\mathbf{N} \to \mathbf{Exp}\), which is a good sign we've gone as far as we can.)

Firstly, thanks to the prime decomposition theorem, we can treat \(\mathbf{M}\) as generated by an infinite set of elements: the prime numbers. So this gives us something to hang on to when considering the action of our functors. It isn't a finite presentation, but we should still have as a theorem that every arrow can be factored into a finite set of primes.

Therefore, a functor \(F : \mathbf{M} \to \mathbf{M}\) is determined by its action on the prime numbers. One interesting thing to note is that two functors give isomorphic images if their action on the primes is different only by a permutation of the primes. For instance, if \(F\) sends \(2\) to \(42\) and \(3\) to \(101\), \(F'\) sends \(3\) to \(42\) and \(2\) to \(101\), and both fix all other primes, then they only differ by the permutation \((42\ 101)\). So it seems that permutations on the set of prime numbers give some kind of equivalence between functors.

So it suffices to consider functors based on how much they flatten the set of primes. If \(\lvert F(\mathbf{Prime}) \rvert = \lvert \mathbf{Prime} \rvert\), we get a category equivalent to what we started with. If, however, \(\lvert F(\mathbf{Prime}) \rvert = k\) for finite \(k\), then the image category has only a finite set of generators.

This seems like a kind of projection, or almost a kind of division, but it's sufficiently strange that I'm not sure what to do with it.

`[John wrote](https://forum.azimuthproject.org/discussion/comment/19191/#Comment_19191): > I'm not sure what "do this again" means. I would love to get [hyperoperations](https://en.wikipedia.org/wiki/Hyperoperation#Examples) this way. But there are some puzzling features. Hmm, you're quite right! I saw the start of a pattern and charged ahead rather blindly. What I wanted to do was iteratively consider the sequence of categories \\(\mathcal{X}\_n\\) with morphisms all functors \\(F\_n : \mathbf{N} \to \mathcal{X}\_{n-1}\\). But once you get \\(\mathcal{X}\_2 = \mathbf{Exp}\\), the category with two objects consisting of functors \\(\mathbf{N} \to \mathbf{Mult}\\), you no longer have any useful cycles, so you can no longer iterate your morphisms, and everything locks up. (I think \\(\mathcal{X}\_3 = \mathbf{Unit}\\), if we forced onwards with functors \\(\mathbf{N} \to \mathbf{Exp}\\), which is a good sign we've gone as far as we can.) > **Puzzle.** What is the category with \\(\mathbf{M}\\) as its only object and functors from \\(\mathbf{M}\\) to itself as morphisms? Firstly, thanks to the prime decomposition theorem, we can treat \\(\mathbf{M}\\) as generated by an infinite set of elements: the prime numbers. So this gives us something to hang on to when considering the action of our functors. It isn't a finite presentation, but we should still have as a theorem that every arrow can be factored into a finite set of primes. Therefore, a functor \\(F : \mathbf{M} \to \mathbf{M}\\) is determined by its action on the prime numbers. One interesting thing to note is that two functors give isomorphic images if their action on the primes is different only by a permutation of the primes. For instance, if \\(F\\) sends \\(2\\) to \\(42\\) and \\(3\\) to \\(101\\), \\(F'\\) sends \\(3\\) to \\(42\\) and \\(2\\) to \\(101\\), and both fix all other primes, then they only differ by the permutation \\((42\ 101)\\). So it seems that permutations on the set of prime numbers give some kind of equivalence between functors. So it suffices to consider functors based on how much they flatten the set of primes. If \\(\lvert F(\mathbf{Prime}) \rvert = \lvert \mathbf{Prime} \rvert\\), we get a category equivalent to what we started with. If, however, \\(\lvert F(\mathbf{Prime}) \rvert = k\\) for finite \\(k\\), then the image category has only a finite set of generators. This seems like a kind of projection, or almost a kind of division, but it's sufficiently strange that I'm not sure what to do with it.`

Such a category with morphisms being functors from a category to itself would be the category of endomorphisms of \(\mathbf{M}\).

Endo- comes from the Greek, ἔνδον [endon] meaning "within, inner, absorbing, or containing".

`> **Puzzle.** What is the category with \\(\mathbf{M}\\) as its only object and functors from \\(\mathbf{M}\\) to itself as morphisms? Such a category with morphisms being functors from a category to itself would be the category of [endomorphisms](https://ncatlab.org/nlab/show/endomorphism) of \\(\mathbf{M}\\). Endo- comes from the Greek, ἔνδον [endon] meaning "within, inner, absorbing, or containing".`

(Redacted)

`(Redacted)`

Matthew and I both made this mistake and hid the evidence sometime over the course of this seminar.

EDIT:Darn it, everyone's changing their posts :'( It's like force-pushing in Git!`Matthew and I both made this mistake and hid the evidence sometime over the course of this seminar. **EDIT:** Darn it, everyone's changing their posts :'( It's like force-pushing in Git!`

Well, a lot of projects demand you squash all your commits before a merge, so I force push quite a bit.

Anyway, I am sorry for editing my old post. I will try to do less of that.

I really am stumped regarding \(\mathbf{M}\), so I'm inclined not to say anything.

`Well, a lot of projects demand you squash all your commits before a merge, so I force push quite a bit. Anyway, I am sorry for editing my old post. I will try to do less of that. I really am stumped regarding \\(\mathbf{M}\\), so I'm inclined not to say anything.`

Here's my take on the category with one object whose morphisms are functors \(\mathbf{M}\to\mathbf{M}\): Like Jonathan said, such a functor is entirely determined by where it sends morphisms corresponding to prime numbers (although I would include \(0\) in that list), and we're completely free to decide where to send them (except, because \(0\cdot n = 0\) for all \(n\), we must either send \(0\) to \(0\) or send

everythingto \(1\)).Therefore the set of morphisms in this category can be indexed by \(\mathbb{N}^\mathbb{N}\cup \{\ast\}\), infinite sequences of natural numbers together with a special extra element, where a sequence \((n_0,n_1,n_2,\dots)\in\mathbb{N}^\mathbb{N}\) corresponds to the functor \(\mathbf{M}\to\mathbf{M}\) sending each \(k\)th prime \(p_k\) to \(n_k\), and \(\ast\) corresponds to the "send everything to the identity" morphism. All that's left is to describe how these compose.

First, \(\ast\) composed with anything, in either order, is itself. So we just need to worry about how to compose infinite sequences. For that, say we have two sequences \((m_0,m_1,m_2,\dots), (n_0,n_1,n_2,\dots)\); what is their composite \((m_0,m_1,m_2,\dots)\circ(n_0,n_1,n_2,\dots)\)? Well, let's see where the \(k\)th prime \(p_k\) goes. Under the first map it gets sent to \(n_k\). If \(n_k=0\), then the second map will leave it as zero, so under the composite, \(p_k\mapsto 0\). Otherwise, write \(n_k\) as a product of primes \(p_0^{a_0}p_1^{a_1}p_2^{a_2}\ldots\); then \(p_k\mapsto n_k \mapsto m_0^{a_0}m_1^{a_1}m_2^{a_2}\ldots\).

In symbolic form: $$(m_k)_{k\in\mathbb{N}} \circ (n_k)_{k\in\mathbb{N}} = \left(\begin{cases}0&\text{ if }n_k=0\\ m_0^{a_0}m_1^{a_1}m_2^{a_2}\ldots&\text{ if }n_k = p_0^{a_0}p_1^{a_1}p_2^{a_2}\ldots\end{cases}\right)_{k\in\mathbb{N}}.$$ It occurs to me that we could also describe how the functors \(F:\mathbf{M}\to\mathbf{M}\) act on morphisms as the

multiplicative functionsfrom \(\mathbb{N}\) to itself, namely, those functions \(f:\mathbb{N}\to\mathbb{N}\) such that \(f(1)=1\) and \(f(mn)=f(m)f(n)\) for all \(m,n\in\mathbb{N}\). Each non-constant multiplicative function corresponds to an infinite sequence as I described above.Just please don't call this category \(\mathbf{P}\) and ask me to find its endofunctor monoid.

`Here's my take on the category with one object whose morphisms are functors \\(\mathbf{M}\to\mathbf{M}\\): Like Jonathan said, such a functor is entirely determined by where it sends morphisms corresponding to prime numbers (although I would include \\(0\\) in that list), and we're completely free to decide where to send them (except, because \\(0\cdot n = 0\\) for all \\(n\\), we must either send \\(0\\) to \\(0\\) or send *everything* to \\(1\\)). Therefore the set of morphisms in this category can be indexed by \\(\mathbb{N}^\mathbb{N}\cup \\{\ast\\}\\), infinite sequences of natural numbers together with a special extra element, where a sequence \\((n_0,n_1,n_2,\dots)\in\mathbb{N}^\mathbb{N}\\) corresponds to the functor \\(\mathbf{M}\to\mathbf{M}\\) sending each \\(k\\)th prime \\(p_k\\) to \\(n_k\\), and \\(\ast\\) corresponds to the "send everything to the identity" morphism. All that's left is to describe how these compose. First, \\(\ast\\) composed with anything, in either order, is itself. So we just need to worry about how to compose infinite sequences. For that, say we have two sequences \\((m_0,m_1,m_2,\dots), (n_0,n_1,n_2,\dots)\\); what is their composite \\((m_0,m_1,m_2,\dots)\circ(n_0,n_1,n_2,\dots)\\)? Well, let's see where the \\(k\\)th prime \\(p_k\\) goes. Under the first map it gets sent to \\(n_k\\). If \\(n_k=0\\), then the second map will leave it as zero, so under the composite, \\(p_k\mapsto 0\\). Otherwise, write \\(n_k\\) as a product of primes \\(p_0^{a_0}p_1^{a_1}p_2^{a_2}\ldots\\); then \\(p_k\mapsto n_k \mapsto m_0^{a_0}m_1^{a_1}m_2^{a_2}\ldots\\). In symbolic form: \[(m_k)_{k\in\mathbb{N}} \circ (n_k)_{k\in\mathbb{N}} = \left(\begin{cases}0&\text{ if }n_k=0\\ m_0^{a_0}m_1^{a_1}m_2^{a_2}\ldots&\text{ if }n_k = p_0^{a_0}p_1^{a_1}p_2^{a_2}\ldots\end{cases}\right)_{k\in\mathbb{N}}.\] It occurs to me that we could also describe how the functors \\(F:\mathbf{M}\to\mathbf{M}\\) act on morphisms as the *multiplicative functions* from \\(\mathbb{N}\\) to itself, namely, those functions \\(f:\mathbb{N}\to\mathbb{N}\\) such that \\(f(1)=1\\) and \\(f(mn)=f(m)f(n)\\) for all \\(m,n\in\mathbb{N}\\). Each non-constant multiplicative function corresponds to an infinite sequence as I described above. Just please don't call this category \\(\mathbf{P}\\) and ask me to find its endofunctor monoid.`

Matthew wrote:

The "proper" way to do that is to rebase against master, so that your squashed commit can be applied as a straightforward merge (or fast-forward if you don't even want the merge commit). Force pushing forcibly updates a publically known branch head in a non-monotonic manner, so that if someone else has checked out that head and is working against it, they'll be working on history that essentially no longer exists, as far as the remote is concerned.

Nobody minds editing posts (I edit

a ton), but if something published needs to be altered or removed, it's kind to those who might have seen it to leave some remnant of it around, even if just as an edit saying "I said something about X before here, but it was wrong". It helps to preserve some semblance of linear continuity of a forum thread.Owen wrote:

I think you have a better handle on this problem than I do... Do you have any thoughts on the possibility I mentioned about having equivalent functors? It seems like we essentially have a "change of base" property taking us between certain functors, mediated by bijections on the set of prime numbers.

`Matthew wrote: > Well, a lot of projects demand you squash all your commits before a merge, so I force push quite a bit. The "proper" way to do that is to rebase against master, so that your squashed commit can be applied as a straightforward merge (or fast-forward if you don't even want the merge commit). Force pushing forcibly updates a publically known branch head in a non-monotonic manner, so that if someone else has checked out that head and is working against it, they'll be working on history that essentially no longer exists, as far as the remote is concerned. Nobody minds editing posts (I edit _a ton_), but if something published needs to be altered or removed, it's kind to those who might have seen it to leave some remnant of it around, even if just as an edit saying "I said something about X before here, but it was wrong". It helps to preserve some semblance of linear continuity of a forum thread. Owen wrote: > Therefore the set of morphisms in this category can be indexed by \\(\mathbb{N}^\mathbb{N}\cup \\{\ast\\}\\), infinite sequences of natural numbers together with a special extra element, where a sequence \\((n_0,n_1,n_2,\dots)\in\mathbb{N}^\mathbb{N}\\) corresponds to the functor \\(\mathbf{M}\to\mathbf{M}\\) sending each \\(k\\)th prime \\(p_k\\) to \\(n_k\\), and \\(\ast\\) corresponds to the "send everything to the identity" morphism. I think you have a better handle on this problem than I do... Do you have any thoughts on the possibility I mentioned about having equivalent functors? It seems like we essentially have a "change of base" property taking us between certain functors, mediated by bijections on the set of prime numbers.`

I can appreciate this perspective.

However, I have a PR in flight as we speak. For this particular absurd little thing the only way I can tell if my code is broken is Travis CI. Instead of having a string of commits with silly messages like

`Struggling to get CI to work`

, I've been force pushing. I know it's evil. The politics of open source are such that you are much more likely to get your PR in if it's tidy, even if that's a lie.The logic of that argument does not apply to etiquette in this forum.

I will try to be better about that.

I am sorry.

`> The "proper" way to do that is to rebase against master, so that your squashed commit can be applied as a straightforward merge (or fast-forward if you don't even want the merge commit). Force pushing forcibly updates a publicly known branch head in a non-monotonic manner, so that if someone else has checked out that head and is working against it, they'll be working on history that essentially no longer exists, as far as the remote is concerned. I can appreciate this perspective. However, I have a PR in flight as we speak. For this particular absurd little thing the only way I can tell if my code is broken is Travis CI. Instead of having a string of commits with silly messages like `Struggling to get CI to work`, I've been force pushing. I know it's evil. The politics of open source are such that you are much more likely to get your PR in if it's tidy, even if that's a lie. The logic of that argument does not apply to etiquette in this forum. > Nobody minds editing posts (I edit a ton), but if something published needs to be altered or removed, it's kind to those who might have seen it to leave some remnant of it around, even if just as an edit saying "I said something about X before here, but it was wrong". It helps to preserve some semblance of linear continuity of a forum thread. I will try to be better about that. I am sorry.`

Can category theory be used to formalize git operators?

Because I have no idea what the git metaphor is all about.

`Can category theory be used to formalize git operators? Because I have no idea what the git metaphor is all about.`

In git you can revise history by typing

`git push <remote> <branch> --force`

If you have coworkers who are working off of your code, this can be infuriating to them. It makes everything inconsistent.

This is like deleting posts as I had done.

This happened a few times to Jonathan in this thread - first John did it to John by deleting **Puzzle 122* and then I did it with my deleted post.

`> Can category theory be used to formalize git operators? > > Because I have no idea what the git metaphor is all about. In git you can revise history by typing `git push <remote> <branch> --force` If you have coworkers who are working off of your code, this can be infuriating to them. It makes everything inconsistent. This is like deleting posts as I had done. This happened a few times to Jonathan in this thread - first John did it to John by deleting **Puzzle 122* and then I did it with my deleted post.`

Matthew:

Is it to a feature branch that you own, specifically for the purpose of getting it merged into master? Then it's fine. That's what those branches are for. Force pushing is in no way evil if it is known that nobody should be messing with that branch except you (or by taking turns, or

somepre-established external protocol.) It's just that it's unsafe without knowing that context. (Just as I didn't know the context in which you were force pushing to begin with.)Look, text is awfully bad at conveying tone; we've known this for decades. I'm not in any way intending to browbeat you about this. It was a minor thing spawned from a bad joke, with a weird tangent on git and monotonic updates. I don't think we disagree about anything, we're just coming at the discussion from different angles and missing each other. (It's nothing worth apologizing over!)

Keith:

In this context, Git is like a forum thread. Committing to a git branch is posting a reply to another comment. This particular forum is of a more linear sort, but you've probably seen truly threaded forums where every comment can have multiple children. Reddit counts as one of those.

Editing a post is like creating a new comment and deleting the old one. Any post that was added in the interim was written with the original post in mind, so updating the original post has the power to change the context in which later posts are read. A force push in Git is like this: it says, "I know you were all working based off of the original content of these files, but I'm going to change it under your feet, and now you're going to have to rebase and handle any conflicts that fall on your head." It's a safe operation if you're the only one with access to the thread/branch, or if it's externally understood that you have the "privilege" to do so (e.g. a feature staging branch, as in Matthew's PR case, which is 100% valid and totally common, as he says). What isn't safe is to force push to "master", or any other branch which is more broadly shared between contributors.

(Again, I'm dramatizing it for effect; it was at worst worth a rueful laugh in the specific case at hand.)

At any rate, yes, there is a mathematical formalization of how version control systems like Git might work. It's called patch theory, and here's a paper putting it in a categorical setting.

`Matthew: > However, I have a PR in flight as we speak. For this particular absurd little thing the only way I can tell if my code is broken is Travis CI. Instead of having a string of commits with silly messages like `Struggling to get CI to work`, I've been force pushing. I know it's evil. Is it to a feature branch that you own, specifically for the purpose of getting it merged into master? Then it's fine. That's what those branches are for. Force pushing is in no way evil if it is known that nobody should be messing with that branch except you (or by taking turns, or _some_ pre-established external protocol.) It's just that it's unsafe without knowing that context. (Just as I didn't know the context in which you were force pushing to begin with.) Look, text is awfully bad at conveying tone; we've known this for decades. I'm not in any way intending to browbeat you about this. It was a minor thing spawned from a bad joke, with a weird tangent on git and monotonic updates. I don't think we disagree about anything, we're just coming at the discussion from different angles and missing each other. (It's nothing worth apologizing over!) Keith: > Because I have no idea what the git metaphor is all about. In this context, Git is like a forum thread. Committing to a git branch is posting a reply to another comment. This particular forum is of a more linear sort, but you've probably seen truly threaded forums where every comment can have multiple children. Reddit counts as one of those. Editing a post is like creating a new comment and deleting the old one. Any post that was added in the interim was written with the original post in mind, so updating the original post has the power to change the context in which later posts are read. A force push in Git is like this: it says, "I know you were all working based off of the original content of these files, but I'm going to change it under your feet, and now you're going to have to rebase and handle any conflicts that fall on your head." It's a safe operation if you're the only one with access to the thread/branch, or if it's externally understood that you have the "privilege" to do so (e.g. a feature staging branch, as in Matthew's PR case, which is 100% valid and totally common, as he says). What isn't safe is to force push to "master", or any other branch which is more broadly shared between contributors. (Again, I'm dramatizing it for effect; it was at worst worth a rueful laugh in the specific case at hand.) At any rate, yes, there is a mathematical formalization of how version control systems like Git might work. It's called [patch theory](https://en.wikibooks.org/wiki/Understanding_Darcs/Patch_theory), and [here's a paper](https://arxiv.org/abs/1311.3903) putting it in a categorical setting.`

I don't 100% follow the git metaphor either... it sounds like Jonathan is saying "Don't edit posts people may be responding to! It's like this thing you can do in git which is bad!" And Matthew is saying "Sorry it was confusing, and by the way sometimes that bad git thing is the best option." So I think everybody is good now?

Anyway, Jonathan wrote:

What it sounds like to me is you're thinking about which functors from \(\mathbf{M}\) to itself are

isomorphisms: I think that the answer is exactly those functors that just permute the primes, corresponding to sequences in \(\mathbb{N}^\mathbb{N}\) consisting of all the primes in some order. Then you could regard two functors \(\mathbf{M}\to\mathbf{M}\) as equivalent if you can get from one to the other by precomposing with an isomorphism, and Ithinkthat's the notion of equivalence you described above.In general, if you have two objects \(A\) and \(B\) in a category, the set of morphisms \(\mathrm{Hom}(A,B)\) between them gets two group actions automatically: the group of automorphisms of \(A\) (isomorphisms from \(A\) to itself) acts on the set by precomposition, and the group of automorphisms of \(B\) acts by postcomposition. Sometimes it does make sense to look at the orbits of one or both group actions, and then we're regarding morphisms as equivalent in the way you describe.

Soon, I think, John will tell us about another kind of equivalence between functors:

natural isomorphisms. Instead of being related by pre- or postcomposition by an invertible functor, two functors are naturally isomorphic if they're related by something that looks more like conjugation.`I don't 100% follow the git metaphor either... it sounds like Jonathan is saying "Don't edit posts people may be responding to! It's like this thing you can do in git which is bad!" And Matthew is saying "Sorry it was confusing, and by the way sometimes that bad git thing is the best option." So I think everybody is good now? Anyway, Jonathan wrote: > I think you have a better handle on this problem than I do... Do you have any thoughts on the possibility I mentioned about having equivalent functors? It seems like we essentially have a "change of base" property taking us between certain functors, mediated by bijections on the set of prime numbers. What it sounds like to me is you're thinking about which functors from \\(\mathbf{M}\\) to itself are *isomorphisms*: I think that the answer is exactly those functors that just permute the primes, corresponding to sequences in \\(\mathbb{N}^\mathbb{N}\\) consisting of all the primes in some order. Then you could regard two functors \\(\mathbf{M}\to\mathbf{M}\\) as equivalent if you can get from one to the other by precomposing with an isomorphism, and I *think* that's the notion of equivalence you described above. In general, if you have two objects \\(A\\) and \\(B\\) in a category, the set of morphisms \\(\mathrm{Hom}(A,B)\\) between them gets two group actions automatically: the group of automorphisms of \\(A\\) (isomorphisms from \\(A\\) to itself) acts on the set by precomposition, and the group of automorphisms of \\(B\\) acts by postcomposition. Sometimes it does make sense to look at the orbits of one or both group actions, and then we're regarding morphisms as equivalent in the way you describe. Soon, I think, John will tell us about another kind of equivalence between functors: *natural isomorphisms*. Instead of being related by pre- or postcomposition by an invertible functor, two functors are naturally isomorphic if they're related by something that looks more like conjugation.`

Haha. Yes, Owen, I think you've nailed the summary.

Hmm, not quite. I'm not particularly interested in invertible functors, but rather how we can compare two different functors. Consider the example I gave earlier:

Here we have two distinct functors that are not inverses (indeed, are not invertible, since both \(101\) is mapped onto by two elements), but the image categories they produce seem to be isomorphic. I'm hoping that these functors are related by natural transformations (induced by bijections between the primes, yes), but every time I try to understand natural transformations, I come away feeling like I know less than I started with.

`Haha. Yes, Owen, I think you've nailed the summary. > What it sounds like to me is you're thinking about which functors from \\(\mathbf{M}\\) to itself are *isomorphisms* Hmm, not quite. I'm not particularly interested in invertible functors, but rather how we can compare two different functors. Consider the example I gave earlier: > One interesting thing to note is that two functors give isomorphic images if their action on the primes is different only by a permutation of the primes. For instance, if \\(F\\) sends \\(2\\) to \\(42\\) and \\(3\\) to \\(101\\), \\(F'\\) sends \\(3\\) to \\(42\\) and \\(2\\) to \\(101\\), and both fix all other primes, then they only differ by the permutation \\((42\ 101)\\). Here we have two distinct functors that are not inverses (indeed, are not invertible, since both \\(101\\) is mapped onto by two elements), but the image categories they produce seem to be isomorphic. I'm hoping that these functors are related by natural transformations (induced by bijections between the primes, yes), but every time I try to understand natural transformations, I come away feeling like I know less than I started with.`

You're right, those two functors \(F\) and \(F'\) are not isomorphisms, but they are

relatedby an isomorphism: \(F' = F \circ S\), where \(S: \mathbf{M}\to\mathbf{M}\) is the functor represented by the sequence \((3, 2, 5, 7, 11, 13, \dots)\), which is its own inverse. What I think is true is that two functors \(F_1, F_2\) are "equivalent" in the sense you describe, having the same image, just reordered, exactly when \(F_1=F_2\circ S\) for some invertible functor \(S\).`You're right, those two functors \\(F\\) and \\(F'\\) are not isomorphisms, but they are *related* by an isomorphism: \\(F' = F \circ S\\), where \\(S: \mathbf{M}\to\mathbf{M}\\) is the functor represented by the sequence \\((3, 2, 5, 7, 11, 13, \dots)\\), which is its own inverse. What I think is true is that two functors \\(F_1, F_2\\) are "equivalent" in the sense you describe, having the same image, just reordered, exactly when \\(F_1=F_2\circ S\\) for some invertible functor \\(S\\).`

Summary: Objects in \(\mathbf{N}^\mathbf{N}\) correspond to scalar multipliers \(k \times \cdot : \mathbb{N} \to \mathbb{N}\), while morphisms act like scalar addition \(c+ \cdot : \mathbb{N} \to \mathbb{N} \). There is no morphism from one functor to another in \(\mathbf{N}^\mathbf{N}\).We have seen that functors \(F: \mathbf{N} \to \mathbf{N}\) are just scalar multipliers.

From Wikipedia's definition of a

Functor Category, we have:Wikipedia gives the following definition of

natural transformations:There is only one object in \(\mathbf{N}\) and it is \(\star\). The definition of natural transformation simplifies to:

$$ \eta _{\star} \circ_{\mathbf{N}} F(f) =G(f) \circ_{\mathbf{N}} \eta _{\star} \tag{✴} $$ Since both \(\mathbf{C}\) and \(\mathbf{D}\) are \(\mathbf{N}\) for functors in \(\mathbf{N} \to \mathbf{N}\), we have \(\circ_{\mathbf{D}} = \circ_{\mathbf{N}}\).

Note that \(\circ\) in \(\mathbf{N}\) reflects addition and \(\eta _{\star}\) corresponds to some \(c \in \mathbb{N}\).

Also note that \(F \in \mathbf{N}^\mathbf{N} \) reflects \(k \times \cdot: \mathbb{N} \to \mathbb{N}\) for some \(k \in \mathbb{N}\) and \(G \in \mathbf{N}^\mathbf{N} \) reflects \(l \times \cdot: \mathbb{N} \to \mathbb{N}\) for some \(l \in \mathbb{N}\).

This means (✴) is corresponds to, for all \(n \in \mathbb{N}\):

$$ c + k \times n = l \times n + c$$ However, we know that addition is commutative and all scalar additions \(c + \cdot : \mathbb{N} \to \mathbb{N}\) are injective. So we may cancel \(c\) on either side of (✴). Thus we have for all morphisms \(f \in \mathbf{Mor}(\mathbf{N}) \):

$$ k \times n =l \times n $$ Hence \(k = l\), and thus \(F = G\).

This means that every natural transformation \(\eta : F \to F\) is an endomorphism in \(\mathbf{N}^\mathbf{N}\).

We also have that every \(c \in \mathbf{Mor}(\mathbf{N})\) gives rise to some endomorphism for a functor \(F : \mathbf{N} \to \mathbf{N}\).

To see this, note that for every functor there is constant \(k \in \mathbb{N} \) such that \(F(f) \in \mathbf{N} \) reflects \(k \times f \in \mathbb{N}\). Since addition commutes in arithmetic, for all \(c \in \mathbb{N} \) we have:

$$ c + k \times f = k \times f + c $$ which corresponds to:

$$ \eta \circ_{\mathbf{N}} F(f) = F(f) \circ_{\mathbf{N}} \eta $$ For all \(\eta \in \mathbf{Mor}(\mathbf{N}) \).

`>**Puzzle.** If \\(\mathbf{N}\\) is the free category on the graph > <center>![](http://math.ucr.edu/home/baez/mathematical/7_sketches/graph_loop.png)</center> >what is the endofunctor category \\(\mathbf{N}^\mathbf{N}\\)? **Summary**: Objects in \\(\mathbf{N}^\mathbf{N}\\) correspond to scalar multipliers \\(k \times \cdot : \mathbb{N} \to \mathbb{N}\\), while morphisms act like scalar addition \\(c+ \cdot : \mathbb{N} \to \mathbb{N} \\). There is no morphism from one functor to another in \\(\mathbf{N}^\mathbf{N}\\). -------------------------------------------------- We have seen that functors \\(F: \mathbf{N} \to \mathbf{N}\\) are just scalar multipliers. From Wikipedia's definition of a [*Functor Category*](https://en.wikipedia.org/wiki/Functor_category), we have: > In category theory, a branch of mathematics, the functors between two given categories form a category, where the objects are the *functors* and the morphisms are *natural transformations* between the functors. Wikipedia gives the following definition of *natural transformations*: > A natural transformation \\(\eta\\) from functors \\(F: \mathbf{C} \to \mathbf{D}\\) to \\(G: \mathbf{C} \to \mathbf{D}\\) is a family of morphisms that satisfies two requirements. > 1. The natural transformation must associate to every object \\(X\\) in \\(\mathbf{C}\\) a morphism \\(\eta_X : F(X) → G(X)\\) between objects of \\(\mathbf{D}\\). The morphism \\(\eta_X\\) is called the component of \\(\eta\\) at \\(X\\). > 2. Components must be such that for every morphism \\(f : X \to Y\\) in \\(\mathbf{C}\\) we have: > $$\eta_{Y}\circ_{\mathbf{D}} F(f) =G(f)\circ_{\mathbf{D}} \eta _{X}$$ There is only one object in \\(\mathbf{N}\\) and it is \\(\star\\). The definition of natural transformation simplifies to: \[ \eta _{\star} \circ\_{\mathbf{N}} F(f) =G(f) \circ\_{\mathbf{N}} \eta _{\star} \tag{✴} \] Since both \\(\mathbf{C}\\) and \\(\mathbf{D}\\) are \\(\mathbf{N}\\) for functors in \\(\mathbf{N} \to \mathbf{N}\\), we have \\(\circ\_{\mathbf{D}} = \circ\_{\mathbf{N}}\\). Note that \\(\circ\\) in \\(\mathbf{N}\\) reflects addition and \\(\eta _{\star}\\) corresponds to some \\(c \in \mathbb{N}\\). Also note that \\(F \in \mathbf{N}^\mathbf{N} \\) reflects \\(k \times \cdot: \mathbb{N} \to \mathbb{N}\\) for some \\(k \in \mathbb{N}\\) and \\(G \in \mathbf{N}^\mathbf{N} \\) reflects \\(l \times \cdot: \mathbb{N} \to \mathbb{N}\\) for some \\(l \in \mathbb{N}\\). This means (✴) is corresponds to, for all \\(n \in \mathbb{N}\\): \[ c + k \times n = l \times n + c\] However, we know that addition is commutative and all scalar additions \\(c + \cdot : \mathbb{N} \to \mathbb{N}\\) are injective. So we may cancel \\(c\\) on either side of (✴). Thus we have for all morphisms \\(f \in \mathbf{Mor}(\mathbf{N}) \\): \[ k \times n =l \times n \] Hence \\(k = l\\), and thus \\(F = G\\). This means that every natural transformation \\(\eta : F \to F\\) is an endomorphism in \\(\mathbf{N}^\mathbf{N}\\). We also have that every \\(c \in \mathbf{Mor}(\mathbf{N})\\) gives rise to some endomorphism for a functor \\(F : \mathbf{N} \to \mathbf{N}\\). To see this, note that for every functor there is constant \\(k \in \mathbb{N} \\) such that \\(F(f) \in \mathbf{N} \\) reflects \\(k \times f \in \mathbb{N}\\). Since addition commutes in arithmetic, for all \\(c \in \mathbb{N} \\) we have: \[ c + k \times f = k \times f + c \] which corresponds to: \[ \eta \circ_{\mathbf{N}} F(f) = F(f) \circ_{\mathbf{N}} \eta \] For all \\(\eta \in \mathbf{Mor}(\mathbf{N}) \\).`

Interestingly, a natural transformation from any other functor to the identity functor, \(\nu: \mathbf{n} \to \mathbf{1}\), looks like a multiplicative inverse.

`Interestingly, a natural transformation from any other functor to the identity functor, \\(\nu: \mathbf{n} \to \mathbf{1}\\), looks like a multiplicative inverse.`