{
  "artifactId": "artifact.library.mathlib.chinese-remainder-theorem.v001",
  "candidateOnly": false,
  "category": "Number theory and algebra",
  "claimBoundary": "This target indexes Mathlib's ring equivalence between integers modulo mn and pairs modulo m and n when m and n are coprime. It is the two-modulus ZMod form, not a finite-family formulation, an integer representative algorithm, or a new proof.",
  "collectionSlug": "landmark-theorems-in-mathlib",
  "exactFormalStatement": "def ZMod.chineseRemainder {m n : ℕ} (h : m.Coprime n) : ZMod (m * n) ≃+* ZMod m × ZMod n",
  "family": "Modular arithmetic",
  "id": "library.mathlib.chinese-remainder-theorem.v001",
  "links": {
    "collection": "/collections/landmark-theorems-in-mathlib/",
    "collectionData": "/data/collections/mathlib-landmarks.json",
    "entry": "/library-theorems/chinese-remainder-theorem/",
    "entryData": "/data/library-theorems/chinese-remainder-theorem.json",
    "evidence": "/proofs/artifact.library.mathlib.chinese-remainder-theorem.v001.html",
    "evidenceData": "/data/proofs/artifact.library.mathlib.chinese-remainder-theorem.v001.evidence.json",
    "source": "/sources/upstream/chinese-remainder-theorem/"
  },
  "landmark": {
    "completeFormalType": "def ZMod.chineseRemainder {m n : ℕ} (h : m.Coprime n) : ZMod (m * n) ≃+* ZMod m × ZMod n",
    "concepts": [
      "Chinese remainder theorem",
      "coprime moduli",
      "residue rings",
      "ring equivalence"
    ],
    "plainLanguage": "When two moduli are coprime, one residue modulo their product carries exactly the same information as one ordered pair of component residues, and the correspondence respects both addition and multiplication.",
    "poster": {
      "alt": "Editorial theorem poster connects a gold product-modulus wheel to emerald and cobalt component wheels, states the ring equivalence in words, and gives a four-step reading guide.",
      "byteSize": 2396336,
      "caption": "The two-modulus ZMod correspondence is bijective and preserves addition and multiplication.",
      "description": "The retained poster presents coprimality, the three rings, the forward and reverse reading, ring-operation preservation, and the exact two-modulus boundary of ZMod.chineseRemainder.",
      "derivatives": [
        {
          "byteSize": 114714,
          "height": 960,
          "mediaType": "image/webp",
          "publicPath": "/assets/library-theorems/chinese-remainder-theorem/theorem-poster-v2-640.webp",
          "sha256": "sha256:51a3d3fb2b90be3bdd734793f9b69a00eca40b0b3270367c4e461cd65adc035a",
          "width": 640
        },
        {
          "byteSize": 224568,
          "height": 1536,
          "mediaType": "image/webp",
          "publicPath": "/assets/library-theorems/chinese-remainder-theorem/theorem-poster-v2-1024.webp",
          "sha256": "sha256:d97ef2acd6afb567ccc3358aa58091df9d58b614ffce2f61ceaff7e11508f766",
          "width": 1024
        }
      ],
      "generatedAt": "2026-07-22T05:15:00Z",
      "height": 1536,
      "mediaType": "image/png",
      "modelRequested": "gpt-image-2",
      "publicPath": "/assets/library-theorems/chinese-remainder-theorem/theorem-poster-v2.png",
      "sha256": "sha256:8145cc384142c0f9aa922421e3ce2480dd55c050ceb9e9927074276ecdd9fdf5",
      "title": "Chinese Remainder Theorem — exact two-modulus ring form",
      "width": 1024,
      "kind": "theorem_poster",
      "transcript": "MODULAR ARITHMETIC · TWO COPRIME MODULI\nCHINESE REMAINDER THEOREM\nm.Coprime n\nZMod (m · n)\nZMod m\nZMod n\nZMod (m · n) IS RING-EQUIVALENT TO ZMod m × ZMod n\nONE RESIDUE MODULO m · n\nONE ORDERED PAIR MODULO m AND n\nADDITION AND MULTIPLICATION PRESERVED\nHOW TO READ IT\n1 · Choose coprime moduli m and n\n2 · Reduce one residue modulo each\n3 · Obtain one ordered residue pair\n4 · Reconstruct the product residue\nEXACT SCOPE\nTwo-modulus ZMod ring equivalence. Not a finite-family or representative algorithm statement."
    },
    "visual": {
      "alt": "One antique-gold residue wheel connects reversibly to an ordered emerald and cobalt pair of residue wheels through a selected three-part correspondence.",
      "byteSize": 2465264,
      "caption": "Coprimality makes one residue modulo m*n equivalent to one ordered pair modulo m and n.",
      "description": "The construction reduces a product residue to both component moduli, reconstructs it from the pair, and preserves the two ring operations.",
      "derivatives": [
        {
          "byteSize": 40840,
          "height": 427,
          "mediaType": "image/webp",
          "publicPath": "/assets/library-theorems/chinese-remainder-theorem/theorem-schematic-v2-640.webp",
          "sha256": "sha256:d014dd1916e977d0f77ba61cceb43bb247a04f7b69ba169e4714255d848b331e",
          "width": 640
        },
        {
          "byteSize": 135074,
          "height": 800,
          "mediaType": "image/webp",
          "publicPath": "/assets/library-theorems/chinese-remainder-theorem/theorem-schematic-v2-1200.webp",
          "sha256": "sha256:691f03fe0e8dd05d499b52d14c80a913307b7c447349395412db2d13c38726cd",
          "width": 1200
        }
      ],
      "generatedAt": "2026-07-22T05:15:00Z",
      "height": 1024,
      "mediaType": "image/png",
      "modelRequested": "gpt-image-2",
      "publicPath": "/assets/library-theorems/chinese-remainder-theorem/theorem-schematic-v2.png",
      "sha256": "sha256:2631b6ae8e2f7380c780997c57f6cc1c74ce943f1286323a049d8572fe90d848",
      "title": "One product residue, two component residues",
      "width": 1536
    },
    "walkthrough": {
      "introduction": "Mathlib constructs a ring equivalence between ZMod (m * n) and ZMod m × ZMod n for coprime natural moduli. The source builds the forward reduction map and a case-split inverse, proves both inverse laws, and packages the correspondence with its additive and multiplicative structure.",
      "pages": [
        {
          "alt": "One antique-gold product-residue wheel sends a selected ivory bead along two fine threads to matching positions on an emerald wheel and a cobalt wheel.",
          "byteSize": 2860921,
          "caption": "Reduction sends one product residue to its ordered pair of component residues.",
          "description": "The forward map to_fun is ZMod.castHom into the product ring. Coprimality identifies the least common multiple with the product, so one residue modulo m*n determines both component residues while preserving addition and multiplication.",
          "derivatives": [
            {
              "byteSize": 31894,
              "height": 427,
              "mediaType": "image/webp",
              "publicPath": "/assets/library-theorems/chinese-remainder-theorem/proof-walkthrough-01-v1-640.webp",
              "sha256": "sha256:0e9d20f4501f32348e904966a3629d8965bab03b8322c4883b05d3b6b49e0a76",
              "width": 640
            },
            {
              "byteSize": 122920,
              "height": 800,
              "mediaType": "image/webp",
              "publicPath": "/assets/library-theorems/chinese-remainder-theorem/proof-walkthrough-01-v1-1200.webp",
              "sha256": "sha256:4ce05c750bd9fbcb958a1364b78da062887375ffe2600621106842afff8c5937",
              "width": 1200
            }
          ],
          "generatedAt": "2026-07-21T23:21:49Z",
          "height": 1024,
          "mediaType": "image/png",
          "modelRequested": "gpt-image-2",
          "publicPath": "/assets/library-theorems/chinese-remainder-theorem/proof-walkthrough-01-v1.png",
          "sha256": "sha256:ab42b8535f363a66f854d8bc56cdf6ec8c2911a4f26a3e418b6f671d1e44db5a",
          "title": "Reduce one product residue to a pair",
          "width": 1536,
          "equation": "to_fun : ZMod (m * n) → ZMod m × ZMod n",
          "kind": "proof_walkthrough_page",
          "sequenceIndex": 1
        },
        {
          "alt": "The same three residue wheels remain aligned while the component positions reconnect to one product position, with a quiet lower alcove separating the degenerate branch.",
          "byteSize": 2724709,
          "caption": "The inverse reconstructs a product residue, with the zero-product edge cases kept separate from the nonzero CRT branch.",
          "description": "The inverse map branches on m*n=0. Coprimality reduces that edge case to a trivial factor, while the nonzero branch applies Nat.chineseRemainder to the canonical values of the two component residues.",
          "derivatives": [
            {
              "byteSize": 33002,
              "height": 427,
              "mediaType": "image/webp",
              "publicPath": "/assets/library-theorems/chinese-remainder-theorem/proof-walkthrough-02-v1-640.webp",
              "sha256": "sha256:ba8bb5ae46e8fdcca5f38cb566acd78d1020ce6d88d15a2a9fcee14652300430",
              "width": 640
            },
            {
              "byteSize": 115952,
              "height": 800,
              "mediaType": "image/webp",
              "publicPath": "/assets/library-theorems/chinese-remainder-theorem/proof-walkthrough-02-v1-1200.webp",
              "sha256": "sha256:0a29d23332cb8c35b52464b2ddcab9892af90d4923342d1e956a7f8ec327bae0",
              "width": 1200
            }
          ],
          "generatedAt": "2026-07-21T23:28:46Z",
          "height": 1024,
          "mediaType": "image/png",
          "modelRequested": "gpt-image-2",
          "publicPath": "/assets/library-theorems/chinese-remainder-theorem/proof-walkthrough-02-v1.png",
          "sha256": "sha256:2becabebe1671d57dee3a3a542c2b92fc1fddefbc4ec38b6a68313b67278a52a",
          "title": "Construct the inverse in both product cases",
          "width": 1536,
          "equation": "inv_fun : ZMod m × ZMod n → ZMod (m * n)",
          "kind": "proof_walkthrough_page",
          "sequenceIndex": 2
        },
        {
          "alt": "The product bead and its two component beads close into a continuous correspondence while translucent cross-bands isolate their matching positions and two finite populations balance below.",
          "byteSize": 2792650,
          "caption": "Simultaneous congruences recover the original residue, and finite cardinality closes the reverse identity.",
          "description": "Nat.modEq_and_modEq_iff_modEq_mul turns agreement modulo both coprime factors into agreement modulo their product, proving the left inverse. rightInverse_of_card_le then uses the matching finite cardinalities to obtain the right inverse.",
          "derivatives": [
            {
              "byteSize": 18346,
              "height": 427,
              "mediaType": "image/webp",
              "publicPath": "/assets/library-theorems/chinese-remainder-theorem/proof-walkthrough-03-v1-640.webp",
              "sha256": "sha256:c539ae3ea479a38a4c40d9a80c43a9e851f61c1ec409d25b425d8414f0f91245",
              "width": 640
            },
            {
              "byteSize": 57870,
              "height": 800,
              "mediaType": "image/webp",
              "publicPath": "/assets/library-theorems/chinese-remainder-theorem/proof-walkthrough-03-v1-1200.webp",
              "sha256": "sha256:cadda2b9bf1047d378ede4b7616c66e7efd7336240f92c695eb390ea16b71926",
              "width": 1200
            }
          ],
          "generatedAt": "2026-07-22T01:02:31Z",
          "height": 1024,
          "mediaType": "image/png",
          "modelRequested": "gpt-image-2",
          "publicPath": "/assets/library-theorems/chinese-remainder-theorem/proof-walkthrough-03-v1.png",
          "sha256": "sha256:131353884809a9cdf86d7b263f46b7f602e4630f92f4ea9fa355ab380c6c93a5",
          "title": "Prove the two maps are inverse",
          "width": 1536,
          "equation": "LeftInverse inv_fun to_fun ∧ RightInverse inv_fun to_fun",
          "kind": "proof_walkthrough_page",
          "sequenceIndex": 3
        },
        {
          "alt": "The same product wheel and ordered factor wheels are joined by an arrow-free woven braid, while paired construction rhythms appear on the product and both components.",
          "byteSize": 2867587,
          "caption": "The reversible correspondence preserves addition and multiplication, completing the two-modulus ring equivalence.",
          "description": "The final structure packages to_fun, inv_fun, map_add, map_mul, and the two inverse laws. The endpoint is exactly a ring equivalence between the product modulus and the ordered pair of component moduli.",
          "derivatives": [
            {
              "byteSize": 52108,
              "height": 427,
              "mediaType": "image/webp",
              "publicPath": "/assets/library-theorems/chinese-remainder-theorem/proof-walkthrough-04-v1-640.webp",
              "sha256": "sha256:9812fc48152babd61430a3444f02c2cd17775ffc65c3df4134b499681dd68d38",
              "width": 640
            },
            {
              "byteSize": 168174,
              "height": 800,
              "mediaType": "image/webp",
              "publicPath": "/assets/library-theorems/chinese-remainder-theorem/proof-walkthrough-04-v1-1200.webp",
              "sha256": "sha256:4cd02227a71c4d8ca472c938e05190a7878b21cd5108d5d8cb285508805d5641",
              "width": 1200
            }
          ],
          "generatedAt": "2026-07-21T23:34:15Z",
          "height": 1024,
          "mediaType": "image/png",
          "modelRequested": "gpt-image-2",
          "publicPath": "/assets/library-theorems/chinese-remainder-theorem/proof-walkthrough-04-v1.png",
          "sha256": "sha256:bd189bf0aad143a47d1d55c98e5fb05d3b0dec07a71aa822e209062223399558",
          "title": "Assemble the ring equivalence",
          "width": 1536,
          "equation": "ZMod (m * n) ≃+* ZMod m × ZMod n",
          "kind": "proof_walkthrough_page",
          "sequenceIndex": 4
        }
      ],
      "title": "From one product residue to an ordered residue pair"
    },
    "whyLandmark": "The Chinese Remainder Theorem turns a modular problem into independent coprime components. It is foundational in number theory, algebra, algorithms, and cryptography."
  },
  "nonClaims": [
    "The selected declaration covers exactly two coprime natural moduli.",
    "It states a ZMod ring equivalence, not an exposed integer-representative algorithm.",
    "ProofAtlas is indexing an existing Mathlib construction, not claiming a new theorem or proof."
  ],
  "publicExportEligible": true,
  "relationship": "upstream_direct",
  "schemaVersion": "library-theorem-entry-data.v1",
  "statementId": "statement.library.mathlib.chinese-remainder-theorem.v001",
  "statusAxes": {
    "acceptedAtlasResult": "Not recorded for the preferred artifact",
    "locallyReproduced": "Exact upstream declaration replayed",
    "reviewedPage": "2 of 3 presentation reviews recorded",
    "upstreamIndexed": "Pinned source bytes verified locally"
  },
  "summary": "For coprime natural moduli m and n, residues modulo m*n form a ring equivalent to ordered pairs of residues modulo m and modulo n.",
  "targetId": "target.library.mathlib.chinese-remainder-theorem.v001",
  "title": "Chinese Remainder Theorem",
  "upstreamOrigin": {
    "declarationName": "ZMod.chineseRemainder",
    "immutableSourceUrl": "https://github.com/leanprover-community/mathlib4/blob/5e932f97dd25535344f80f9dd8da3aab83df0fe6/Mathlib/Data/ZMod/Basic.lean#L872",
    "packageName": "mathlib",
    "repositoryUrl": "https://github.com/leanprover-community/mathlib4",
    "sourceArtifactHash": "sha256:b150e3bf79b154b28c1d3fa68cbd837f093f4305bf4fd2e9302db29081135358",
    "sourceByteLength": 48403,
    "sourceCommit": "5e932f97dd25535344f80f9dd8da3aab83df0fe6",
    "sourceFile": "Mathlib/Data/ZMod/Basic.lean",
    "sourceLine": 872,
    "verificationKind": "git_worktree"
  },
  "publicPresentationReview": {
    "status": "reviewed"
  }
}
