{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Statement\n\nLet $m$ and $n$ be positive integers, and let $a$ and $b$ be integers. Let $g = \\gcd(m, n)$ and $M = \\operatorname{lcm}(m, n)$.\nThe system $x \\equiv a \\pmod m$, $x \\equiv b \\pmod n$ has an integer solution if and only if $a \\equiv b \\pmod g$.\nIn this case, two solutions are congruent modulo $M$.\n\n## Remarks\n\nWhen $g = 1$, this is the [[Chinese remainder theorem|0FNN9B4W64]] for two moduli.\nThe condition is necessary: a solution $x$ gives $a \\equiv x \\equiv b \\pmod g$, since $g$ divides $m$ and $n$.\nFor $k$ moduli $n_1, \\dots, n_k$, the system $x \\equiv a_i \\pmod{n_i}$ has a solution if and only if $\\gcd(n_i, n_j) \\mid a_i - a_j$ for all $i \\neq j$.\nFor example, $x \\equiv 1 \\pmod 4$ and $x \\equiv 3 \\pmod 6$ has the solutions $x \\equiv 9 \\pmod{12}$. But $x \\equiv 1 \\pmod 4$ and $x \\equiv 2 \\pmod 6$ has no solution.\n\n## Explanations\n\n### L1 human\n\nWhen the moduli share a factor $g$, the two conditions both say something about $x$ modulo $g$.\nThey must agree there. If they agree, there is a solution, and it is unique modulo the lcm.\n",
  "commit": "f591989ed15704e9d8755a7a5a6426d73de7a3ae",
  "front": {
    "kind": "statement",
    "msc": [
      "11A07"
    ],
    "name": "Chinese remainder theorem for non-coprime moduli",
    "role": "theorem",
    "sources": [
      {
        "locator": "Generalization to non-coprime moduli",
        "url": "https://en.wikipedia.org/wiki/Chinese_remainder_theorem"
      }
    ],
    "tag": "04SJTX9P4N",
    "uses": [
      "0FNN9B4W64",
      "02WF878BH1",
      "09S5SN35DJ"
    ]
  },
  "kind": "statement",
  "link": "https://math2.tamnd.com/node/04SJTX9P4N/",
  "links": [
    {
      "field": "uses",
      "target": "0FNN9B4W64"
    },
    {
      "field": "uses",
      "target": "02WF878BH1"
    },
    {
      "field": "uses",
      "target": "09S5SN35DJ"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/04SJTX9P4N.md",
  "msc": [
    "11A07"
  ],
  "name": "Chinese remainder theorem for non-coprime moduli",
  "prov": null,
  "role": "theorem",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/04S/04SJTX9P4N.md",
  "status": null,
  "tag": "04SJTX9P4N",
  "uri": "m2://04SJTX9P4N",
  "url": "https://math2.tamnd.com/wiki/chinese-remainder-theorem-for-non-coprime-moduli/",
  "writing": {
    "tag": "04SJTX9P4N",
    "kind": "statement",
    "level": "W0",
    "next": [
      {
        "what": "an inventory row",
        "note": "the row of the inventory that the node accounts for",
        "have": 0,
        "want": 1
      }
    ]
  }
}
