{
  "aliases": null,
  "backlinks": [
    {
      "field": "uses",
      "target": "06WRV8HFDY"
    }
  ],
  "body": "\n## Statement\n\nLet $p$ be a [[prime number|0SN0MAEKYX]].\nThen $(p - 1)! \\equiv -1 \\pmod p$.\n\n## Remarks\n\nA proof: in $\\mathbb{Z}/p\\mathbb{Z}$, each element of $\\{ \\overline{1}, \\dots, \\overline{p - 1} \\}$ has an inverse. Only $\\overline{1}$ and $\\overline{-1}$ are their own inverses. The other elements cancel in pairs in the product.\nFor example, $4! = 24 \\equiv -1 \\pmod 5$ and $6! = 720 \\equiv -1 \\pmod 7$.\nThe [[converse of Wilson's theorem|06WRV8HFDY]] also holds, so the congruence characterizes the primes.\n\n## History\n\nIbn al-Haytham stated the result about the year 1000. Edward Waring announced it in 1770 and named his student John Wilson as its discoverer. Lagrange gave the first proof in 1771.\n\n## Explanations\n\n### L1 human\n\nMultiply all the numbers from $1$ to $p - 1$, and divide by $p$. The remainder is always $p - 1$.\nFor $p = 7$: $1 \\cdot 2 \\cdot 3 \\cdot 4 \\cdot 5 \\cdot 6 = 720 = 102 \\cdot 7 + 6$.\n",
  "commit": "6ac761d40018146541484a9e8b9eafd6ecc303dc",
  "front": {
    "kind": "statement",
    "msc": [
      "11A07"
    ],
    "name": "Wilson's theorem",
    "role": "theorem",
    "same_as": {
      "wikidata": "Q276082",
      "wikipedia": "Wilson's theorem"
    },
    "sources": [
      {
        "locator": "lead section",
        "url": "https://en.wikipedia.org/wiki/Wilson%27s_theorem"
      }
    ],
    "tag": "03KGGKTB2E",
    "uses": [
      "0SN0MAEKYX",
      "0TPW25CBN6"
    ]
  },
  "kind": "statement",
  "link": "https://math2.tamnd.com/node/03KGGKTB2E/",
  "links": [
    {
      "field": "uses",
      "target": "0SN0MAEKYX"
    },
    {
      "field": "uses",
      "target": "0TPW25CBN6"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/03KGGKTB2E.md",
  "msc": [
    "11A07"
  ],
  "name": "Wilson's theorem",
  "prov": null,
  "role": "theorem",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/03K/03KGGKTB2E.md",
  "status": null,
  "tag": "03KGGKTB2E",
  "uri": "m2://03KGGKTB2E",
  "url": "https://math2.tamnd.com/wiki/wilsons-theorem/",
  "writing": {
    "tag": "03KGGKTB2E",
    "kind": "statement",
    "level": "W1",
    "next": [
      {
        "what": "edge about out",
        "note": "the concepts that the statement is about",
        "have": 0,
        "want": 1
      },
      {
        "what": "edge proves in",
        "note": "at least one proof node",
        "have": 0,
        "want": 1
      },
      {
        "what": "edge instance_of or illustrates in",
        "note": "one example that shows the statement at work",
        "have": 0,
        "want": 1
      },
      {
        "what": "explanation L2",
        "have": 0,
        "want": 1
      }
    ]
  }
}
