{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Definition\n\nLet $G$ be a [[directed graph|0KFYGSHHF5]], allowed to have loops and several edges between two vertices.\nEach edge $e$ of $G$ has a source vertex $s(e)$ and a target vertex $t(e)$.\nA *path* from $x$ to $y$ of length $n \\ge 1$ is a sequence $(e_1, \\dots, e_n)$ of edges with $s(e_1) = x$, $t(e_n) = y$ and $t(e_i) = s(e_{i+1})$ for $1 \\le i \u003c n$.\nVertices and edges may repeat, as in a directed [[walk|085CH3CYMX]].\nFor each vertex $x$ there is also an empty path of length $0$ from $x$ to $x$.\nThe *free category* $F(G)$ on $G$ is the [[category|A2DE66937D]] whose objects are the vertices of $G$.\nIts morphisms $x \\to y$ are the paths from $x$ to $y$.\nComposition is concatenation of paths, and the identities are the empty paths.\n\n## Remarks\n\nConcatenation is associative and the empty paths are units for it, so $F(G)$ is a category.\nIt has the universal property of a free object: for every category $\\mathcal{C}$, each graph morphism from $G$ to the underlying graph of $\\mathcal{C}$ extends to exactly one [[functor|28NQ0KRHD3]] $F(G) \\to \\mathcal{C}$.\n\nExample: let $G$ have one vertex and one loop $a$.\nThe paths are $a^n = (a, \\dots, a)$ with $n \\ge 0$ letters, and $a^m \\circ a^n = a^{m + n}$, so $F(G)$ is the one-object category of the monoid $(\\N, +)$, the [[free monoid|CV013KHVJG]] on one generator.\n\nNon-example: the category with one object and morphisms $\\Z/2\\Z$ is generated by one loop $a$, but it satisfies $a \\circ a = \\id$.\nIn the free category on one loop, $a \\circ a$ has length $2$ and the identity has length $0$, so they differ.\nSo the category of $\\Z/2\\Z$ is not free on that graph.\n",
  "commit": "ff8a40749dc16545e3d2fc637f6b0196e81d0bfa",
  "front": {
    "defines": "THRHFW3SMP",
    "kind": "definition",
    "msc": [
      "18A10",
      "18A40"
    ],
    "name": "Free category",
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Free_category"
      }
    ],
    "tag": "FN6P3CTPTS",
    "uses": [
      "0KFYGSHHF5",
      "085CH3CYMX",
      "A2DE66937D",
      "28NQ0KRHD3",
      "CV013KHVJG"
    ]
  },
  "kind": "definition",
  "link": "https://tamnd.github.io/math2/node/FN6P3CTPTS/",
  "links": [
    {
      "field": "defines",
      "target": "THRHFW3SMP"
    },
    {
      "field": "uses",
      "target": "0KFYGSHHF5"
    },
    {
      "field": "uses",
      "target": "085CH3CYMX"
    },
    {
      "field": "uses",
      "target": "A2DE66937D"
    },
    {
      "field": "uses",
      "target": "28NQ0KRHD3"
    },
    {
      "field": "uses",
      "target": "CV013KHVJG"
    }
  ],
  "markdown": "https://tamnd.github.io/math2/node/FN6P3CTPTS.md",
  "msc": [
    "18A10",
    "18A40"
  ],
  "name": "Free category",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/FN6/FN6P3CTPTS.md",
  "status": null,
  "tag": "FN6P3CTPTS",
  "uri": "m2://FN6P3CTPTS",
  "url": "https://tamnd.github.io/math2/wiki/free-category-definition/",
  "writing": {
    "tag": "FN6P3CTPTS",
    "kind": "definition",
    "level": "W0",
    "next": [
      {
        "what": "a source with a locator",
        "have": 0,
        "want": 1
      }
    ]
  }
}
