Module 2 Discussion Topics

Strong answers will include an explicit description of objects, morphisms, and verification (or failure) of the category axioms.

Discussion 1: Finding Categories in CS

Below are five CS structures. For each one, determine whether it forms a category. If yes, explicitly state the objects, the morphisms, and verify associativity and identity. If no, identify which axiom fails and construct a specific counterexample.

  1. Types and functions in a statically-typed programming language (e.g., Haskell or Java)
  2. Programs and reductions: objects are programs, morphisms are reduction steps in a term rewriting system
  3. Files and hard links in a Unix filesystem: objects are files, morphisms are hard links pointing from one file to another
  4. Git commits and merges: objects are commit hashes, morphisms are merge operations
  5. Propositions and proofs: objects are logical propositions, morphisms are proofs that one proposition implies another (Curry-Howard correspondence)

Discussion 2: The Database Interpretation

Consider a simple three-table relational database: Employee(id, name, department_id), Department(id, name, location_id), Location(id, city).

Discussion 3: What Is a Morphism in ML?

We often think of machine learning models as functions from inputs to outputs. In a categorical setting, functions are morphisms. But the appropriate choice of category for an ML system is not obvious.

Discussion 4: Equality vs. Isomorphism

In programming, we often ask "are these two objects equal?" In category theory, the correct question is "are these two objects isomorphic?" The distinction matters.