Reading Category Theory Illustrated, which is a book about Category Theory, on stream!
- Abstract Theory
- There's a quote of Bertrand Russell from Introduction to Mathematical Philosophy that doesn't make any sense. The specific part is: "in terms of which what was our starting-point can be defined or deduced." Looking up the original text on the University of Massachusetts website, I confirmed it's not a typo. I literally don't understand what they're trying to say. I think it makes sense if it instead reads "in terms of which our starting-point can be defined or deduced."
- An abstract theory is a language for defining tools.
- The book says "they can be used to unify and compare different concrete theories, by putting these theories in common grounds", and it reminds me of monads in Haskell. Monads in Haskell are pretty abstract and are applied in many different ways.
- It seems like an abstract theory is one that provides some kind of model which can be applied to many concrete applications.
- Sets
- Set Theory is the theory of collections of things
- Sets are an example of category theory.
- I'm already pretty familiar with everything in this section.
- Sets can contain elements, one element, or no elements.
- Elements in a set have no internal order or are more special than other elements.
- A set A is a subset of another set B, if that B contains all the elements in A.
- The empty set is always a subset of all sets.
- Functions
- My favorite "idea" for what a function is, is one which connects values in one set to values in another set.
- They also mentioned other words used for the
same idea, including:
- input and output
- domain and codomain
- argument type and return type
- premise and conclusion
- Functions represent a many-to-one relationship between the input and output sets.
- Functions must always map every input element to some output element
- Functions cannot map an input element to multiple output elements.
- The identity function can map a set A which is a
subset of another set B into the set B. This reminds
me of converting from
bool
toVariant
in gdscript and fromInt
toInteger
in Haskell. - There is a function to go from the empty set to any other set.
- I think there cannot be a function to go from any non-empty set to the empty set, because earlier in the book, they said that you cannot have a source element that is not mapped to anything.
- I think there should be a function to go from empty set to empty set.
- Another reason i think you cannot have a function that goes from a non-empty set to an empty one, is because a function that goes from a non-empty set to a singleton set must define a mapping from each element in the source set to the single element in the singleton set.
- Functional composition
- Diagrams which show the relationship between sets are called external diagrams, and those that show the relationship between elements between sets are internal diagrams.
- They define composition using a diagram. In
words, I think I would say: The composition of two
functions
f
andg
is a third functionh
such that all internal paths between elements ultimately end up in the same place. - Functional composition is associative (it doesn't matter in which order you combine functions together; it just matters that the functions are still connected in the same order)
- Isomorphism
- Things that are function-like are also known as morphisms
- Isomorphisms are functions which can be inverted into another valid function.
- When there exists an invertible function between two sets, then those two sets are isomorphic.
- Two sets
A
andB
are isomorphic if there exist functionsf: A -> B
and its reverseg: B -> A
, such thatf . g = B
andg . f = A
. - A set is isomorphic to itself (because the identity function is an isomorphism).
- If set
A
is isomorphic to setB
, and setB
is isomorphic to setC
, then setsA
andC
are also isomorphic due to functional composition. - They mention bijective without defining it, but a wikipedia search reveals that is it a function which maps each element in the input set to exactly one element in the output set.
- Equivalency
- An equivalence relationship follows three laws:
- Everything is equivalent with itself.
- Transitivity; things that are both equal to a third thing must also equal between themselves.
- Symmetry; if A = B, then B = A
- An equivalence relationship follows three laws:
A chatter suggested that I should read Bartosz Milewski's 'Category Theory for Programmers'