This page is a sub-page of our page on Category Theory.

///////

**Related KMR pages**:

• …

• …

• …

///////

**Other relevant sources of information**:

• …

/////// Infrastructures for cross-institutional reasoning (Ch. 9: pp. 76-85)

9. **What are categories and functors?**

9.1. **Patterns, pattern relators, and natural transformations between analogies**

Roughly speaking, categories provide a way to express patterns. The objects of a category represent the ingredients of the corresponding pattern and the arrows between the objects represent the relationships between these ingredients.

Categories may be connected by functors. A functor between two categories/patterns, called the source category and the target category, represents a relationship between the two patterns that respects the structure of each of them. Hence a functor **can be thought of as a form of pattern relator**, i.e., an **analogy** or **a (piece of) reasoning, which connects its source pattern to its target pattern in a compatible wa**y, i.e., in a way that respects the structure of the source pattern.

Let F and G be two functors between the same source and target patterns. If G is related to F by a natural transformation, one says that G is naturally related to F – which indicates that G is compatible (or coherent) with F – This means that the translation from the analogy provided by F to the analogy provided by G can be applied either before or after carrying out the respective analogy itself.

Moreover, if F is compatible with G and G is compatible with F, one says that F and G are naturally equivalent. **Two naturally equivalent functors represent analogies/reasonings between two patterns that can be translated back and forth without losing any information**. An example of two naturally equivalent functors is presented in the next section.

9.2. **Categories as database schemas**

///// Intro paragraph on Spivak

Spivak makes use of databases as a non-mathematical entry point into category theory, because, as he claims in (Spivak, 2012):

[slide 8]: The connection between databases and categories is simple and strong. The reason is that categories and database schemas do the same thing. A schema gives a framework for modelling a situation (using tables and attributes). This is precisely what a category does (using objects and arrows). They both model how entities within a given context interact.

[slide 12]: If mathematics is the art of getting organized, what organizes math? **After thousands of years, people realized that there were some essential features in common throughout much of math. These are objects, arrows, paths and path equivalences. Or: things, tasks, processes, and “sameness of outcome”. Or: primary keys, foreign keys, paths of FKs, and path equations.** […]

In order to provide a mathematical basis for our line of argument we will quote extensively from (Spivak, 2014, 2012). Moreover, following Spivak and Kent 2011 we will make use of **ologs** (= ontology logs) to expand the analogy between databases and category theory to include patterns of thought, i.e., theories or models, and their applications, i.e., experiments, annotations, and structured thinking in general.