{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Definition\n\nA *category* $\\mathcal{C}$ consists of the following data:\n\n1. a class $\\mathrm{Ob}(\\mathcal{C})$, whose members are called the objects of $\\mathcal{C}$;\n2. for each pair of objects $A, B$, a class $\\Hom_{\\mathcal{C}}(A, B)$ of morphisms from $A$ to $B$, written $f \\colon A \\to B$, with these classes pairwise disjoint;\n3. for each triple of objects $A, B, C$, a composition map $\\Hom_{\\mathcal{C}}(B, C) \\times \\Hom_{\\mathcal{C}}(A, B) \\to \\Hom_{\\mathcal{C}}(A, C)$, written $(g, f) \\mapsto g \\circ f$;\n4. for each object $A$, an identity morphism $1_A \\in \\Hom_{\\mathcal{C}}(A, A)$.\n\nThese data must satisfy two axioms:\n\n1. associativity: $h \\circ (g \\circ f) = (h \\circ g) \\circ f$ for all $f \\colon A \\to B$, $g \\colon B \\to C$ and $h \\colon C \\to D$;\n2. identity: $f \\circ 1_A = f = 1_B \\circ f$ for all $f \\colon A \\to B$.\n\n## Remarks\n\nThe category is *locally small* when every $\\Hom_{\\mathcal{C}}(A, B)$ is a [[set|0BSJ7RQ9BW]], and *small* when moreover $\\mathrm{Ob}(\\mathcal{C})$ is a set.\nExample: $\\mathbf{Set}$ has sets as objects and [[functions|0EPAT51DXQ]] $A \\to B$ as morphisms, with the usual composition and the identity functions.\nComposition of functions is associative and the identity functions are neutral, so both axioms hold.\nNon-example: take sets as objects and, as morphisms $A \\to B$, the functions $A \\to B$ whose image has at most one point.\nA composite of two such functions again has at most one point in its image, so composition is defined.\nThe identity function of a set with two elements is not such a morphism, so clause 4 fails.\nMany authors write $\\mathcal{C}(A, B)$ or $\\hom(A, B)$ for $\\Hom_{\\mathcal{C}}(A, B)$, and $gf$ for $g \\circ f$.\n",
  "commit": "ff8a40749dc16545e3d2fc637f6b0196e81d0bfa",
  "front": {
    "defines": "A2DE66937D",
    "kind": "definition",
    "msc": [
      "18A05",
      "18A15"
    ],
    "name": "Category",
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Category_(mathematics)"
      }
    ],
    "tag": "MCEE53VGBQ",
    "uses": [
      "0BSJ7RQ9BW",
      "0EPAT51DXQ"
    ]
  },
  "kind": "definition",
  "link": "https://tamnd.github.io/math2/node/MCEE53VGBQ/",
  "links": [
    {
      "field": "defines",
      "target": "A2DE66937D"
    },
    {
      "field": "uses",
      "target": "0BSJ7RQ9BW"
    },
    {
      "field": "uses",
      "target": "0EPAT51DXQ"
    }
  ],
  "markdown": "https://tamnd.github.io/math2/node/MCEE53VGBQ.md",
  "msc": [
    "18A05",
    "18A15"
  ],
  "name": "Category",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/MCE/MCEE53VGBQ.md",
  "status": null,
  "tag": "MCEE53VGBQ",
  "uri": "m2://MCEE53VGBQ",
  "url": "https://tamnd.github.io/math2/wiki/category-definition/",
  "writing": {
    "tag": "MCEE53VGBQ",
    "kind": "definition",
    "level": "W0",
    "next": [
      {
        "what": "a source with a locator",
        "have": 0,
        "want": 1
      }
    ]
  }
}
