{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Definition\n\nLet $\\mathcal{C}$ and $\\mathcal{D}$ be [[categories|A2DE66937D]], and let $\\mathcal{D}^{\\mathrm{op}}$ be the [[opposite category|DAMK8XE1FR]] of $\\mathcal{D}$.\nA *profunctor* $P$ from $\\mathcal{C}$ to $\\mathcal{D}$, written $P \\colon \\mathcal{C} \\nrightarrow \\mathcal{D}$, is a [[functor|28NQ0KRHD3]]\n$$P \\colon \\mathcal{D}^{\\mathrm{op}} \\times \\mathcal{C} \\to \\mathbf{Set}$$\non the [[product category|AFNE9C4NH6]].\nA morphism of profunctors is a natural transformation between such functors.\n\n## Remarks\n\nConventions differ: some authors call the same functor a profunctor from $\\mathcal{D}$ to $\\mathcal{C}$.\nFor small $\\mathcal{D}$ it is the same as a functor $\\mathcal{C} \\to [\\mathcal{D}^{\\mathrm{op}}, \\mathbf{Set}]$, from $\\mathcal{C}$ to presheaves on $\\mathcal{D}$.\nExample: the [[hom functor|VJXS8AK67E]] $\\Hom_{\\mathcal{C}} \\colon \\mathcal{C}^{\\mathrm{op}} \\times \\mathcal{C} \\to \\mathbf{Set}$ is a profunctor from $\\mathcal{C}$ to $\\mathcal{C}$, the identity profunctor.\nExample: a functor $F \\colon \\mathcal{C} \\to \\mathcal{D}$ gives the profunctor $(d, c) \\mapsto \\Hom_{\\mathcal{D}}(d, F(c))$ from $\\mathcal{C}$ to $\\mathcal{D}$.\nNon-example: for the same $F$, the functor $(d, c) \\mapsto \\Hom_{\\mathcal{D}}(F(c), d)$ is covariant in $d$ and contravariant in $c$.\nSo it is not a profunctor from $\\mathcal{C}$ to $\\mathcal{D}$; it is a profunctor from $\\mathcal{D}$ to $\\mathcal{C}$.\nFor $P \\colon \\mathcal{C} \\nrightarrow \\mathcal{D}$ and $Q \\colon \\mathcal{D} \\nrightarrow \\mathcal{E}$ with $\\mathcal{D}$ small, the composite is given by the [[coend|W9QTFV0Z8D]] $(Q \\circ P)(e, c) = \\int^{d \\in \\mathcal{D}} Q(e, d) \\times P(d, c)$.\nComposition is associative and unital only up to natural isomorphism.\n",
  "commit": "ff8a40749dc16545e3d2fc637f6b0196e81d0bfa",
  "front": {
    "defines": "EAPHAQVVD5",
    "kind": "definition",
    "msc": [
      "18D60"
    ],
    "name": "Profunctor",
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Profunctor"
      }
    ],
    "tag": "9P83YFRWDJ",
    "uses": [
      "A2DE66937D",
      "28NQ0KRHD3",
      "DAMK8XE1FR",
      "AFNE9C4NH6",
      "VJXS8AK67E",
      "W9QTFV0Z8D"
    ]
  },
  "kind": "definition",
  "link": "https://tamnd.github.io/math2/node/9P83YFRWDJ/",
  "links": [
    {
      "field": "defines",
      "target": "EAPHAQVVD5"
    },
    {
      "field": "uses",
      "target": "A2DE66937D"
    },
    {
      "field": "uses",
      "target": "28NQ0KRHD3"
    },
    {
      "field": "uses",
      "target": "DAMK8XE1FR"
    },
    {
      "field": "uses",
      "target": "AFNE9C4NH6"
    },
    {
      "field": "uses",
      "target": "VJXS8AK67E"
    },
    {
      "field": "uses",
      "target": "W9QTFV0Z8D"
    }
  ],
  "markdown": "https://tamnd.github.io/math2/node/9P83YFRWDJ.md",
  "msc": [
    "18D60"
  ],
  "name": "Profunctor",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/9P8/9P83YFRWDJ.md",
  "status": null,
  "tag": "9P83YFRWDJ",
  "uri": "m2://9P83YFRWDJ",
  "url": "https://tamnd.github.io/math2/wiki/profunctor-definition/",
  "writing": {
    "tag": "9P83YFRWDJ",
    "kind": "definition",
    "level": "W0",
    "next": [
      {
        "what": "a source with a locator",
        "have": 0,
        "want": 1
      }
    ]
  }
}
