3

I often run into term "adjoin" when trying to understand some concepts. Those things are too abstract for me to understand as I'm neither expert in field nor category theory.

The simplest case I found is a Monoid Maybe a instance which often behaves not as I would sometimes expect with regard to Nothing.

From Wikipedia we can learn that by "adjoining" an element to a semigroup we can get a different Monoid instance. I don't understand the sentence but the equations given suggest it's exactly what I need (and is not default for some reason):

Any semigroup S may be turned into a monoid simply by adjoining an element e not in S and defining e • s = s = s • e for all s ∈ S.

  • Doe "adjoining" mean the same as "adding" at least in this case?
  • Are there other simple examples of this concept?
  • What would be simplest possible instance of something that is "left-adjoint"?
sevo
  • 4,559
  • 1
  • 15
  • 31
  • An important use of adjoint functors in Haskell is monads (en.wikipedia.org/wiki/Monad_(category_theory)) : a monad is the composition of two such functors. – V. Semeria Sep 23 '16 at 15:29

1 Answers1

10

Sometimes "adjoining" means "adding something new", as in the semigroup-related sentence you quote. E.g. someone might say that using Maybe a means adding/adjoining a new element Nothing to the type a. Personally, I would only use "adding" for this, though.

This has nothing to do with adjoints in the categorical sense, which are a tricky concept.

Roughly put, assume you have a functional type of the form

F a -> b

where F is some mapping from types to types (more precisely, a functor). Sometimes, you can express an isomorphic type to the above one having the form

a -> G b

where "magically" the function F on the left side moved to the right side, changing into G.

The canonical example is currying: Let e.g.

F T = (T, Int)
G T = Int -> T

Then we have

   (F a) -> b 
-- definition of F
=  (a, Int) -> b
-- currying
=~ a -> (Int -> b)
-- definition of G
=  a -> G b

In such case, we write F -| G which is read as "F is left adjoint to G".

Every time you can "nicely move" an operation on the input type on the other side of the arrow, changing it into another operation on the output type, you have an adjoint. (Technically, "nicely" means we have a natural isomorphism)

chi
  • 111,837
  • 3
  • 133
  • 218