{
  "aliases": [
    "modular-inverse",
    "inverse-modulo-n"
  ],
  "backlinks": [
    {
      "field": "uses",
      "target": "0HM584C465"
    },
    {
      "field": "uses",
      "target": "0M67FWZWPQ"
    }
  ],
  "body": "\n## Definition\n\nLet $n$ be a positive integer and let $a$ be an integer.\nA modular multiplicative inverse of $a$ modulo $n$ is an integer $x$ such that $a x \\equiv 1 \\pmod n$.\n\n## Remarks\n\nAn inverse of $a$ modulo $n$ exists if and only if $\\gcd(a, n) = 1$. See [[existence of inverses modulo n|0M67FWZWPQ]].\nIf $x$ is an inverse of $a$, then the inverses of $a$ are exactly the integers $y \\equiv x \\pmod n$. So the inverse is unique as a residue class, and we write it as $a^{-1} \\bmod n$.\nIn the ring of [[integers modulo n|01N3AYAA6N]], the class $\\overline{x}$ is the inverse of $\\overline{a}$.\nFor example, $3^{-1} \\equiv 5 \\pmod 7$, because $3 \\cdot 5 = 15 \\equiv 1 \\pmod 7$.\n\n## Explanations\n\n### L1 human\n\nModulo $n$, the inverse of $a$ plays the part of the fraction $1/a$.\nTo solve $3 x \\equiv 4 \\pmod 7$, multiply both sides by $5$, the inverse of $3$. You get $x \\equiv 20 \\equiv 6 \\pmod 7$.\n",
  "commit": "6ac761d40018146541484a9e8b9eafd6ecc303dc",
  "front": {
    "aliases": [
      "modular-inverse",
      "inverse-modulo-n"
    ],
    "defines": "0CEC45PRJN",
    "kind": "definition",
    "msc": [
      "11A07"
    ],
    "name": "Modular multiplicative inverse",
    "sources": [
      {
        "locator": "lead section",
        "url": "https://en.wikipedia.org/wiki/Modular_multiplicative_inverse"
      }
    ],
    "tag": "00GXTQMY8Z",
    "uses": [
      "0TPW25CBN6"
    ]
  },
  "kind": "definition",
  "link": "https://math2.tamnd.com/node/00GXTQMY8Z/",
  "links": [
    {
      "field": "defines",
      "target": "0CEC45PRJN"
    },
    {
      "field": "uses",
      "target": "0TPW25CBN6"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/00GXTQMY8Z.md",
  "msc": [
    "11A07"
  ],
  "name": "Modular multiplicative inverse",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/00G/00GXTQMY8Z.md",
  "status": null,
  "tag": "00GXTQMY8Z",
  "uri": "m2://00GXTQMY8Z",
  "url": "https://math2.tamnd.com/wiki/modular-multiplicative-inverse-definition/",
  "writing": {
    "tag": "00GXTQMY8Z",
    "kind": "definition",
    "level": "W1",
    "next": [
      {
        "what": "edge instance_of in",
        "note": "one example",
        "have": 0,
        "want": 1
      },
      {
        "what": "edge not_instance_of in",
        "note": "one non-example that fails one clause",
        "have": 0,
        "want": 1
      }
    ]
  }
}
