#### Howdy, Stranger!

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

Options

# Question 1.4 - Almost categories

edited January 2020

Almost categories.

(a) Give an example of some data – objects, morphisms, composition, and identities– that satisfies the associative laws but not the unit law.

(b) Give an example of some data – objects, morphisms, composition, and identities– that satisfies the unit laws but not the associative law.

• Options
1.
edited January 2020

I'll kick this off with my solution because this is a fun one to see a bunch of different answers

a) A single object category whose morphisms are the Natural numbers, composition given by $$x ; y = x * y$$, and the identity morphism on the sole object is $$0$$.

This obeys the associative law because $$(x * y) * z = x * (y * z)$$

This fails to obey the unit law as you can see by the example $$0 * 1 \neq 1$$

b) A single object category whose morphisms are the natural numbers, composition given by $$x ; y = |x - y|$$, and the identity morphism on the sole object is $$0$$.

This obeys the unit law because $$|0 - f| = f$$ and $$|f - 0| = f$$ when $$f \geq 0$$, which is true because $$f \in \mathbb{N}$$

This fails to obey the associative law as you can see by example $$||1 - 2| - 3| = 2$$ and $$| 1 - | 2 - 3 || = 0$$

Comment Source:I'll kick this off with my solution because this is a fun one to see a bunch of different answers a) A single object category whose morphisms are the Natural numbers, composition given by \$$x ; y = x * y \$$, and the identity morphism on the sole object is \$$0 \$$. This obeys the associative law because \$$(x * y) * z = x * (y * z) \$$ This fails to obey the unit law as you can see by the example \$$0 * 1 \neq 1 \$$ b) A single object category whose morphisms are the natural numbers, composition given by \$$x ; y = |x - y| \$$, and the identity morphism on the sole object is \\$$0 \$$. This obeys the unit law because \$$|0 - f| = f \$$ and \$$|f - 0| = f \$$ when \$$f \geq 0 \$$, which is true because \$$f \in \mathbb{N} \$$ This fails to obey the associative law as you can see by example \$$||1 - 2| - 3| = 2 \$$ and \$$| 1 - | 2 - 3 || = 0 \$$
• Options
2.

Can anyone think of an "almost-category" that satisfies everything but the right identity law? (for any $$f : c \to d$$, the equation $$id_c ; f = f$$ holds but $$f ; id_d = f$$ doesn't)

How about an "almost-category" satisfying everything but the left identity law?

Comment Source:Can anyone think of an "almost-category" that satisfies everything but the right identity law? (for any \$$f : c \to d \$$, the equation \$$id_c ; f = f \$$ holds but \$$f ; id_d = f \$$ doesn't) How about an "almost-category" satisfying everything but the left identity law?
• Options
3.
edited January 2020

I didn't know it's legitimate to define (1-2) as |-1| on the naturals.

Comment Source:I didn't know it's legitimate to define $$1-2$$ as |-1| on the naturals. 
• Options
4.

Hmm, I suppose you could look at it like I'm only defining one operation which is "absolute value of x - y" so all we have is |1 - 2| = 1, not the concept of -1. But if there is something wrong with this logic, I would like to know!

Comment Source:Hmm, I suppose you could look at it like I'm only defining one operation which is "absolute value of x - y" so all we have is |1 - 2| = 1, not the concept of -1. But if there is something wrong with this logic, I would like to know!
• Options
5.
edited January 2020

It was regarding your formulation as "only defining one operation" which I found problematic. Coding it would take 2 primitive operations, one of which cannot be coded on the naturals in this example.

Comment Source:It was regarding your formulation as "only defining one operation" which I found problematic. Coding it would take 2 primitive operations, one of which cannot be coded on the naturals in this example.
• Options
6.
edited January 2020

The intended operation can also be defined by f(x,y) = max(x,y) - min(x,y).

Comment Source:The intended operation can also be defined by f(x,y) = max(x,y) - min(x,y). 
• Options
7.
edited January 2020

@JakeGillberg wrote:

How about an "almost-category" satisfying everything but the left identity law?

Here is one based ideas from the web. Let the morphisms of our one-object category be the integers $$\mathbb{Z}$$.

Define the binary operation by a;b = |a|*b.

It's easy to show that this is associative. (So, a semigroup.)

1 is a left identity. But there's no right identity.

Comment Source:@JakeGillberg wrote: > How about an "almost-category" satisfying everything but the left identity law? Here is one based ideas from the web. Let the morphisms of our one-object category be the integers \$$\mathbb{Z}\$$. Define the binary operation by a;b = |a|*b. It's easy to show that this is associative. (So, a semigroup.) 1 is a left identity. But there's no right identity.