# “Oh, the morphisms you’ll see!”

17 Oct 2019 ⇐ Notes archive(This is an entry in my technical diary. There will likely be typos, mistakes, or wider logical leaps — the intent here is to “[let] others look over my shoulder while I figure things out.”)

There are many prefixes placed in front of the word “morphism”—here’s a glossary of the ones I’ve seen so far:

- Epimorphism
- The categorical analog to surjectivity—the “epi” root connotes morphisms mapping “over” the entirety of the codomain. Bartosz covers this well in lecture 2.1 (timestamped) of Part I of his category theory course.

- Monomorphism
- Injectivity’s analog and epimorphism’s dual (it blew my mind to realize injectivity and surjectivity, two properties I never thought twice about, are duals). “Mono” in that it generalizes one-to-one functions. Bartosz also mentions them in 2.1.

- Bimorphism
- “A morphism that is both an epimorphism and a monomorphism is called a bimorphism.”
- I don’t quite have the foundation needed to grok when a bimorphism
*isn’t*an isomorphism—maybe because I spend most of my time working in**Hask**and**Swift**(**Set**, in disguise) and Wikipedia mentions “a category, such as**Set**, in which every bimorphism is an isomorphism is known as a balanced category.” On the other hand, and I need to read more into what “split” means in the following, “while every isomorphism is a bimorphism, a bimorphism is not necessarily an isomorphism. For example, in the category of commutative rings the inclusion**Z**⇒**Q**is a bimorphism that is not an isomorphism. However, any morphism that is both an epimorphism and a split monomorphism, or both a monomorphism and a split epimorphism, must be an isomorphism.”

- Isomorphism
- Show up all over mathematics. A morphism that “admits a two-sided inverse, meaning that there is another morphism in [the] category [at hand] such that [their forward and backward compositions emit identity arrows on the domain and codomain, respectively].” “Iso” for equal in the sense that if an isomorphism exists, there is an sort of sameness to the two objects.

- Endomorphism
- A morphism from an object onto itself that isn’t necessarily an identity arrow. “Endo” for “within” or “inner.” The prefix shed light on why the Point-Free folks named functions in the form
`(A) -> A`

,`Endo<A>`

. Looking at that file now, I wonder what the “i” in`imap`

stands for and I may or may not have gotten nerd sniped into checking if`imap`

’s definition shakes out from`Func.dimap`

when dealing with`Func<A, A>`

s and`Z == C == B`

(the`B`

being`imap`

’s generic parameter). Looks like it does?…a few messages later and Peter Tomaselli helped me out! The “i” stands for “invariant,” which reads nicely in that`imap`

’s co- and contravariant parameters kind of cancel out to*invariance*.

- A morphism from an object onto itself that isn’t necessarily an identity arrow. “Endo” for “within” or “inner.” The prefix shed light on why the Point-Free folks named functions in the form
- Automorphism
- An isomorphic endomorphism. “Auto” for same or self.

- Homomorphism
- The star of algebra, a structure-preserving mapping between two algebraic structures. i.e. a homomorphism
`f`

on some structure with a binary operation, say`*`

, will preserve it across the mapping—`f(a * b) = f(a) * f(b)`

. I’ll cover the etymological relationship between “hom” and its appearances in category theory—hom-sets and hom-functors—that isn’t quite restricted to sets in the way algebra generally is in a future note.

- The star of algebra, a structure-preserving mapping between two algebraic structures. i.e. a homomorphism
- Homeomorphism
- The one I’m least familiar with—in another life (or maybe later in this one), I want to dig into (algebraic) topology. Seems to be the topologist’s isomorphism (in the category
**Top**).

- The one I’m least familiar with—in another life (or maybe later in this one), I want to dig into (algebraic) topology. Seems to be the topologist’s isomorphism (in the category
- Catamorphism, Anamorphism, and Hylomorphism
- I’ve only dealt with these three in the functional programming sense. Catamorphisms break down a larger structure into a reduced value (“cata” for “down”), anamorphisms build structure from a smaller set of values (“ana” for “up”), and hylomorphism is an ana- followed by a catamorphism (oddly, “hylo” stands for “matter” or “wood,” wat).
- I ran into catamorphism the other day when trying to put a name on a function in the form
`((Left) -> T) -> ((Right) -> T) -> (Either<Left, Right>) -> T`

. Turns out folks call this`either`

,`analysis`

,`converge`

, or`fold`

(the last of which was somewhat surprising to me in that the`Foldable`

type class requires a monoidal instance, whereas this transformation doesn’t quite have the same requirement). This function is catamorphic in that it*reduces*an`Either`

into a`T`

. `zip`

is an example of an anamorphism that builds a`Zip2Sequence`

from two`Sequence`

s and by extension,`zipWith`

is a hylomorphism that`zip`

s and then reduces down to a summary value by a transformation.- Hylomorphisms and
`imap`

both seem to be*compositions of dual transformations*. Wonder if this pattern pops up elsewhere?