1

i am having difficulty understanding why the diagram on page 8 of this presentation is a category. the author claims that it is on page 43.

it looks like the two smaller arrows on the left must be idempotent or we would have an infinite number of arrows there. it would also seem that composing one of the smaller arrows on the left with one of the longer (left pointing) arrows must result in the small arrow. composing either left with right must be the identity on the set on the right

i have some code and tests run fine with the categories with 0,1,2,3, and 4 elements as well as another simple example. in these examples the objects are just things.

one of the users here (mike stay) came up with a concrete example using 2 sets for the things. the thing on the left is a set with two elements where each of the small arrows pick out one element. and the thing on the right is a set with a single element. where the long right arrow maps everything to that single element and the two long left arrows map to one of the elements of the set on the right.

A={a1,a2}
B={b1}
short1(x)=a1, short2(x)=a2
right(x)=b1
left1(x)=a1
left2(x)=a2.

i define short1 o left1 = short1 etc. and right(left?) = identity.

but this causes my tests for composition to fail since the source(short1 o left1)!=source(short1).

associativity seems to fails also in a manner similar to the the thing on the right here

the tests fails if i omit left2 from the category.

edit - @MartianInvader 's idea seems to work. the composition table for:

r:A->B, s1:A->A, s2:A->A, l1:B->A, l2:B->A

is

iA·iA=iA
iA·s1=s1
iA·s2=s2
iA·l1=l1
iA·l2=l2
iB·iB=iB
iB·r=r
r·iA=r
r·s1=r
r·s2=r
r·l1=iB
r·l2=iB
s1·iA=s1
s1·s1=s1
s1·s2=s1
s1·l1=l1
s1·l2=l1
s2·iA=s2
s2·s1=s2
s2·s2=s2
s2·l1=l2
s2·l2=l2
l1·iB=l1
l1·r=s1
l2·iB=l2
l2·r=s2

edit: seems like there are two ways to make this thing a category:

one way:

    iA  iB  r   s1  s2  l1  l2  

iA  iA  ·   ·   s1  s2  l1  l2  
iB  ·   iB  r   ·   ·   ·   ·   
r   r   ·   ·   r   r   iB  iB  
s1  s1  ·   ·   s1  s1  l1  l1  
s2  s2  ·   ·   s2  s2  l2  l2  
l1  ·   l1  s1  ·   ·   ·   ·   
l2  ·   l2  s2  ·   ·   ·   ·

another way:

    iA  iB  r   s1  s2  l1  l2  

iA  iA  ·   ·   s1  s2  l1  l2  
iB  ·   iB  r   ·   ·   ·   ·   
r   r   ·   ·   r   r   iB  iB  
s1  s1  ·   ·   s1  s1  l2  l2  
s2  s2  ·   ·   s2  s2  l1  l1  
l1  ·   l1  s2  ·   ·   ·   ·   
l2  ·   l2  s1  ·   ·   ·   ·   
Ray Tayek
  • 153
  • 2
    Hi rtayek: For writing on MathOverflow, can I recommend that you find the shift key on your keyboard? There are many "good" styles of writing on the internet, but MathOverflow tends to work best in a somewhat "professional" (academic) style, with standard capitalization and so on. That said, the content of your question is probably better suited for Math.StackExchange (where I believe the aesthetics also favor standard academic English over "internet English"). – Theo Johnson-Freyd Jan 31 '14 at 19:10

2 Answers2

3

Since you wrote "short1 $\circ$ left1", you must be using $\circ$ to denote composition in the usual order for functions, where $f\circ g$" means first apply $g$ and then apply $f$. But in your "tests for composition", you seem to be using $\circ$ to mean composition in the opposite order, following the order of the arrows instead. I conjecture that, if you used one convention consistently, your problem(s) would disappear.

Andreas Blass
  • 75,557
  • sorry, i can not see the inconsistency. tests for composition says: short1 o left1. applying left1 first, this is equal to short1 by definition. but the source of short1 o left1 should be the source of left1. but they are different. – Ray Tayek Jan 31 '14 at 19:44
  • No they are not. – Andrej Bauer Jan 31 '14 at 20:04
0

There is a problem when you say "it would also seem that composing one of the smaller arrows on the left with one of the longer (left pointing) arrows must result in the small arrow."

The category you've given is ok, but you are confused about the compositions. Given morphisms $f : A \to B$ and $g : B \to C$, the composition $g \circ f$ is a morphism $A \to C$. That is, the source of $g \circ f$ is the same as the source of $f$. If you apply this to $\text{short1} \circ \text{left1}$ you will see that all is well.

Andrej Bauer
  • 2,999
  • yes, source(short1 o left1) = source(left1). but if i define short1 o left1 = short1, the sources are not equal. i can't seem to see any other way to define short1 o left1. if it's not equal to s1 (or s2), i am missing an arrow and it's not a category :( – Ray Tayek Jan 31 '14 at 21:34
  • It seems the error is yours, you're defining short1 $\circ$ left1 $=$ short1, but it seems that it should be left2. – MartianInvader Jan 31 '14 at 21:59
  • i did not consider that. i will try it and see what my code does. – Ray Tayek Feb 01 '14 at 02:05
  • that seems to work. see edit – Ray Tayek Feb 01 '14 at 02:39
  • Why are you even defining composition? Just use composition of functions and calculate what you get. – Andrej Bauer Feb 01 '14 at 07:19
  • @Andrej Bauer i am a programmer writing some java-8 code using the new lambdas. composing these things just gets another function. i have no idea how to calculate that s1 and s2 need to be idempotent or that s1 o l1 = l2 as MartianInvader pointed out. how would one go about doing that? – Ray Tayek Feb 01 '14 at 16:58
  • Experience, I suppose. The whole thing is a rather silly exercise anyway, so I wouldn't put too much weight on it. And also, why on earth are you using lambdas in Java? There are languages in which lambdas actually work and are not a pain to use. – Andrej Bauer Feb 01 '14 at 17:17
  • @Andrej Bauer i run the orange county java user group. the original idea was to make a presentation about monads in java 1.8. i became confused, so i started out with the basics. i have category and functor working. now all i need are natural transformations or adjoint functors. – Ray Tayek Feb 03 '14 at 07:04
  • Hmm, this is going in a strange direction. Monads appear in programming languages as computational effects (such as I/O and exceptions). By explicitly programming categories in Java you're not really going to hit the gist of it, I would say, at least not from the computational perspective. – Andrej Bauer Feb 03 '14 at 08:21