)]}'
{
  "commit": "5dad6c90ecde9f87b32c073f5455d69afe8b35ae",
  "tree": "dce1d0d82a6a8745867f4e84a8ff29717ab80447",
  "parents": [
    "83925b10c4c1e2a9bdd8fbf91f7784ceb3873ef4"
  ],
  "author": {
    "name": "Sebastian Ullrich",
    "email": "sebasti@nullri.ch",
    "time": "Mon Aug 10 09:12:06 2026 +0000"
  },
  "committer": {
    "name": "Sebastian Ullrich",
    "email": "sebasti@nullri.ch",
    "time": "Mon Aug 10 17:01:45 2026 +0000"
  },
  "message": "feat: reduce mutual inductive declarations to a single inductive type\n\nThis PR collapses a mutual inductive block to one inductive family, on the Lean side, and declares the block over it, so that the kernel checks a single inductive type and nothing else.\n\nThe types of a block differ only in which of them a constructor returns, and the kernel already insists they share their parameters and their universe. `Lean.Meta.MutualGen` generates an enumeration `Idx` with one constructor per type carrying that type\u0027s indices, and the block becomes one `M : ∀ params, Idx params → Sort u` whose constructors are the block\u0027s. `Tᵢ` is then `M params (Idx.mkᵢ params indices)`, its constructors are the model\u0027s, and `Tᵢ.rec` is `M.rec` at a motive dispatching through `Idx.rec`. A computation rule fires at a constructor, whose index is a literal `Idx.mkᵢ`, so the dispatch iota-reduces and every rule of the block holds definitionally over the model: unlike the nested case, nothing has to be proved. Lean 3 did the same reduction with `PSum` and `PSigma`, and had to pad the minor premises with `PUnit` because its recursors took only their own component\u0027s; Lean 4 recursors take the whole block\u0027s, in the order the model\u0027s own recursor wants them.\n\n`Lean.Meta.certifyInductive` is the single entry point the kernel calls. The two generators compose without being composed: the model `NestedGen` builds is a mutual block, so declaring it comes back through the same entry point and is reduced in turn.\n\n`add_inductive_fn` is then reduced to the single type it is now ever asked to check. Gone with the block are the same-universe and matching-parameter checks across types, the rule that mutually inductive predicates eliminate only into `Prop`, the family index threaded through occurrence checking and recursor construction, the K-target exclusion for mutual declarations, and the loops in every step; `rec_info` existed to be one per type and becomes plain members. A constructor\u0027s fields are now split into recursive and non-recursive in one place, which the recursor\u0027s type and its computation rules both take rather than each deciding for itself. `add_inductive_fn` goes from 534 lines to 398, and the file from 1010 to 830.\n\nCo-Authored-By: Claude \u003cnoreply@anthropic.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "ebe63cb957a825aeb491e9971e0ccada27c56d63",
      "old_mode": 33188,
      "old_path": "src/Lean/Meta.lean",
      "new_id": "7f6ae65da8e6d76ab10459a40166fd73a9b9c8bf",
      "new_mode": 33188,
      "new_path": "src/Lean/Meta.lean"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "7f42da9a11617f0a27284a211db0540e7a685119",
      "new_mode": 33188,
      "new_path": "src/Lean/Meta/InductiveCertificate.lean"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "59f114b949fa6b0fd7e624cb13dd9da099cef94c",
      "new_mode": 33188,
      "new_path": "src/Lean/Meta/MutualInductive.lean"
    },
    {
      "type": "modify",
      "old_id": "eac04cdaff12b9c5d458791f839c22767e177afc",
      "old_mode": 33188,
      "old_path": "src/Lean/Meta/NestedInductive.lean",
      "new_id": "1d6bd75628a7b3fae758046c8d5391d3bd9beab7",
      "new_mode": 33188,
      "new_path": "src/Lean/Meta/NestedInductive.lean"
    },
    {
      "type": "modify",
      "old_id": "2351f6fa6fe1854e65e275fea22163cb1b70b9ce",
      "old_mode": 33188,
      "old_path": "src/kernel/inductive.cpp",
      "new_id": "b907920455965285b89faa50b363000ec2b26ee0",
      "new_mode": 33188,
      "new_path": "src/kernel/inductive.cpp"
    },
    {
      "type": "modify",
      "old_id": "94eb616bf51c59f231725f8fa70f4f78f020ff32",
      "old_mode": 33188,
      "old_path": "tests/elab/issue_14576.lean",
      "new_id": "5c85285bde99b7529dee1e245b67fe127129413e",
      "new_mode": 33188,
      "new_path": "tests/elab/issue_14576.lean"
    },
    {
      "type": "modify",
      "old_id": "f95d599b366e2896b76bc4f58fea304b3fa4a355",
      "old_mode": 33188,
      "old_path": "tests/elab/issue_14576_min.lean",
      "new_id": "67844ac743845cd3a878ceb72eb173126459ede1",
      "new_mode": 33188,
      "new_path": "tests/elab/issue_14576_min.lean"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "bf777ea24a6de33bb834d2233b2c1ace9f829d5c",
      "new_mode": 33188,
      "new_path": "tests/elab/mutual_inductive_certificate.lean"
    },
    {
      "type": "modify",
      "old_id": "f5019f3abc4afaba107f31ee7fe0466307af9dfd",
      "old_mode": 33188,
      "old_path": "tests/elab/nested_inductive_certificate.lean",
      "new_id": "d6014b912133c76577cb267e488336824a6e0b36",
      "new_mode": 33188,
      "new_path": "tests/elab/nested_inductive_certificate.lean"
    }
  ]
}
