{
  "$schema": "folio-library-entry/v1",
  "id": "arxiv-2601.22554v1",
  "blocks": [
    {
      "id": "library/arxiv-2601.22554v1/blocks/prose-sec-front-matter",
      "types": [
        "folio-assistant-core:Prose",
        "doco:Section"
      ],
      "kind": "prose",
      "title": "Front matter",
      "pageStart": 1,
      "pageEnd": 2,
      "target": "../sections/sec-front-matter.md",
      "narrative": null,
      "content": "LeanArchitect\n1\nLeanArchitect\nAutomating Blueprint Generation for Humans and AI\nThomas Zhu1\nPietro Monticone2\nJeremy Avigad1\nSean Welleck1\n1Carnegie Mellon University\n2University of Trento\nAbstract\nLarge-scale formalization projects in Lean rely on blueprints: structured dependency graphs linking informal\nmathematical exposition to formal declarations. While blueprints are central to human collaboration, existing\ntooling treats the informal (LATEX) and formal (Lean) components as largely decoupled artifacts, leading\nto maintenance overhead and limiting integration with AI automation. We presen",
      "truncated": true,
      "provenance": "ingested",
      "summary": {
        "status": "not-summarised"
      }
    },
    {
      "id": "library/arxiv-2601.22554v1/blocks/prose-sec-000",
      "types": [
        "folio-assistant-core:Prose",
        "doco:Section"
      ],
      "kind": "prose",
      "title": "Introduction",
      "pageStart": 2,
      "pageEnd": 2,
      "target": "../sections/sec-000-introduction.md",
      "narrative": null,
      "content": "A long-term goal of formal mathematics is to represent mathematical knowledge in a precise, machine-checked\nlanguage that supports both verification and large-scale collaboration. Proof assistants such as Lean [7, 8] have\nmade substantial progress toward this goal, with libraries like Mathlib [20] formalizing much of undergraduate\nmathematics and an increasing body of research-level material.\nAs formalization projects scale, managing structure becomes as important as managing proofs.\nLarge\ndevelopments are typically decomposed into many interdependent definitions and theorems, spread across\nmu",
      "truncated": true,
      "provenance": "ingested",
      "summary": {
        "status": "not-summarised"
      }
    },
    {
      "id": "library/arxiv-2601.22554v1/blocks/prose-sec-001",
      "types": [
        "folio-assistant-core:Prose",
        "doco:Section"
      ],
      "kind": "prose",
      "title": "Related Work",
      "pageStart": 2,
      "pageEnd": 3,
      "target": "../sections/sec-001-related-work.md",
      "narrative": null,
      "content": "Blueprints in Lean. The term blueprint originates from Patrick Massot’s leanblueprint project [16], a\nplasTEX-based system that generates dependency graphs from LATEX documents using macros such as \\uses\nand \\leanok. Leanblueprint has been widely adopted in non-Mathlib projects due to its effectiveness in\norganizing large formalization efforts (such as [2–4, 9, 13, 19]). Although leanblueprint already has a checkdecls\ncommand for checking whether all formal declarations in the blueprint have a corresponding Lean part, there\nis no support for syncing dependency and proof status information. Lea",
      "truncated": true,
      "provenance": "ingested",
      "summary": {
        "status": "not-summarised"
      }
    },
    {
      "id": "library/arxiv-2601.22554v1/blocks/prose-sec-002",
      "types": [
        "folio-assistant-core:Prose",
        "doco:Section"
      ],
      "kind": "prose",
      "title": "Methods",
      "pageStart": 3,
      "pageEnd": 3,
      "target": "../sections/sec-002-methods.md",
      "narrative": null,
      "content": "3.1",
      "truncated": false,
      "provenance": "ingested",
      "summary": {
        "status": "not-summarised"
      }
    },
    {
      "id": "library/arxiv-2601.22554v1/blocks/prose-sec-003",
      "types": [
        "folio-assistant-core:Prose",
        "doco:Section"
      ],
      "kind": "prose",
      "title": "Overview",
      "pageStart": 3,
      "pageEnd": 3,
      "target": "../sections/sec-003-overview.md",
      "narrative": null,
      "content": "LeanArchitect is a tool for extracting blueprint information directly from Lean code. Its core design principle is\nto minimize duplication between LATEX and Lean, by treating Lean as the authoritative source of information\nfor any formalized blueprint node.\nThe system introduces a new attribute, @[blueprint], which can be attached to Lean definitions and theorems.\nThis attribute records metadata such as a LATEX label, natural language statements and proofs, and project-\nmanagement annotations. In addition, LeanArchitect automatically infers metadata such as:\n• Dependencies between definitions",
      "truncated": true,
      "provenance": "ingested",
      "summary": {
        "status": "not-summarised"
      }
    },
    {
      "id": "library/arxiv-2601.22554v1/blocks/prose-sec-004",
      "types": [
        "folio-assistant-core:Prose",
        "doco:Section"
      ],
      "kind": "prose",
      "title": "Environment Extension",
      "pageStart": 3,
      "pageEnd": 3,
      "target": "../sections/sec-004-environment-extension.md",
      "narrative": null,
      "content": "exported artifacts consist of LATEX fragments, which integrate seamlessly with existing leanblueprint documents\nthrough macros such as \\inputleannode. See Figure 1 for a diagram.\nThis design supports a workflow in which informal exposition and formal proofs evolve together, while\nminimizing manual duplication and enabling structured interaction with AI automation.\n3.2",
      "truncated": false,
      "provenance": "ingested",
      "summary": {
        "status": "not-summarised"
      }
    },
    {
      "id": "library/arxiv-2601.22554v1/blocks/prose-sec-005",
      "types": [
        "folio-assistant-core:Prose",
        "doco:Section"
      ],
      "kind": "prose",
      "title": "Blueprint Attribute",
      "pageStart": 3,
      "pageEnd": 5,
      "target": "../sections/sec-005-blueprint-attribute.md",
      "narrative": null,
      "content": "LeanArchitect provides a new Lean attribute @[blueprint] that can be attached to definitions and theorems.\nUsers can optionally supply metadata such as a LATEX label, natural language statement and proof, and\nother project-management annotations. The attribute serves as the user interface between Lean code and the\nblueprint system. A typical example is:\n1See the GitHub repository.\n2See the GitHub repository.\nLeanArchitect\n4\nLaTeX\nTheorems & proofs\nDependency relations\nFormalization status\nLean\nDefinitions\nTheorems\nProofs (sorry?)\nManual sync\nleanblueprint\nWeb blueprint\nHTML\nPDF\nDependency grap",
      "truncated": true,
      "provenance": "ingested",
      "summary": {
        "status": "not-summarised"
      }
    },
    {
      "id": "library/arxiv-2601.22554v1/blocks/prose-sec-006",
      "types": [
        "folio-assistant-core:Prose",
        "doco:Section"
      ],
      "kind": "prose",
      "title": "LaTeX Export",
      "pageStart": 5,
      "pageEnd": 5,
      "target": "../sections/sec-006-latex-export.md",
      "narrative": null,
      "content": "To build the LATEX blueprint from such data, LeanArchitect provides a build-time export mechanism\nintegrated with Lean’s Lake build system, inspired by doc-gen4. For each module, blueprint data is ex-\ntracted and rendered into LATEX fragments that can be imported into an existing blueprint document\nusing the macro \\inputleannode{label}. Multiple Lean declarations are allowed to correspond to a single\nblueprint node. The export process is deterministic and incremental. For example, when the user writes\n\\inputleannode{thm:add-comm} in the LATEX blueprint, it will be expanded to:\n% Statement\n\\beg",
      "truncated": true,
      "provenance": "ingested",
      "summary": {
        "status": "not-summarised"
      }
    },
    {
      "id": "library/arxiv-2601.22554v1/blocks/prose-sec-007",
      "types": [
        "folio-assistant-core:Prose",
        "doco:Section"
      ],
      "kind": "prose",
      "title": "Project Management Using LeanArchitect",
      "pageStart": 5,
      "pageEnd": 5,
      "target": "../sections/sec-007-project-management-using-leanarchitect.md",
      "narrative": null,
      "content": "We envision the workflow of a large Lean project using LeanArchitect to be as follows.\n1. Mathematicians write a detailed exposition of the formalization target in a LATEX document (e.g. on\nOverleaf), following some source material.\n2. A new formalization project is set up (e.g. on GitHub) with the document as a blueprint.\n3. Lean experts translate each theorem or definition into Lean, tagging each one with @[blueprint]. This\ntranslation can leave sorry placeholders in the code.\n4. In the LATEX blueprint, managers can then use \\inputleannode to replace existing theorems with\nautomatically infe",
      "truncated": true,
      "provenance": "ingested",
      "summary": {
        "status": "not-summarised"
      }
    },
    {
      "id": "library/arxiv-2601.22554v1/blocks/prose-sec-008",
      "types": [
        "folio-assistant-core:Prose",
        "doco:Section"
      ],
      "kind": "prose",
      "title": "Case Studies",
      "pageStart": 5,
      "pageEnd": 6,
      "target": "../sections/sec-008-case-studies.md",
      "narrative": null,
      "content": "LeanArchitect\n6\n4.1",
      "truncated": false,
      "provenance": "ingested",
      "summary": {
        "status": "not-summarised"
      }
    },
    {
      "id": "library/arxiv-2601.22554v1/blocks/prose-sec-009",
      "types": [
        "folio-assistant-core:Prose",
        "doco:Section"
      ],
      "kind": "prose",
      "title": "PrimeNumberTheoremAnd",
      "pageStart": 6,
      "pageEnd": 6,
      "target": "../sections/sec-009-primenumbertheoremand.md",
      "narrative": null,
      "content": "PrimeNumberTheoremAnd [13] is a large community-driven project aiming to formalize the prime number\ntheorem and related results in analytic number theory in Lean. It is the first external project to adopt\nLeanArchitect as its primary blueprint infrastructure. The project began in 2023 and was migrated to\nLeanArchitect in January 2026.\nPrior to migration, PrimeNumberTheoremAnd used a custom tool (leanblueprint-extract) that embedded\nblueprint information as specially formatted comments inside Lean files and extracted them into LATEX for\nblueprint generation. This workflow enabled co-locating fo",
      "truncated": true,
      "provenance": "ingested",
      "summary": {
        "status": "not-summarised"
      }
    },
    {
      "id": "library/arxiv-2601.22554v1/blocks/prose-sec-010",
      "types": [
        "folio-assistant-core:Prose",
        "doco:Section"
      ],
      "kind": "prose",
      "title": "Converting Existing Projects to LeanArchitect Format",
      "pageStart": 6,
      "pageEnd": 7,
      "target": "../sections/sec-010-converting-existing-projects-to-leanarchitect-fo.md",
      "narrative": null,
      "content": "We tested the conversion script on the following projects into LeanArchitect, at Lean version v4.25.0:\n1. Carleson [2]\n2. Brownian Motion [9]\n3. Infinity Cosmos [19]\n4. Fermat’s Last Theorem [4]\n5. Prime Number Theorem And [13]\nFor each project, we first added LeanArchitect to the lakefile, and then ran the conversion script. For the\nmost part, the script is able to automatically convert blueprint nodes into Lean @[blueprint] attributes.\n3See the GitHub pull request.\n4See the Zulip comment.\nLeanArchitect\n7\nDuring conversion, we found some discrepancies between the converted blueprint and the o",
      "truncated": true,
      "provenance": "ingested",
      "summary": {
        "status": "not-summarised"
      }
    },
    {
      "id": "library/arxiv-2601.22554v1/blocks/prose-sec-011",
      "types": [
        "folio-assistant-core:Prose",
        "doco:Section"
      ],
      "kind": "prose",
      "title": "Blueprint-Based Autoformalization",
      "pageStart": 7,
      "pageEnd": 9,
      "target": "../sections/sec-011-blueprint-based-autoformalization.md",
      "narrative": null,
      "content": "We evaluate LeanArchitect as an interface for human–AI collaboration by semi-automatically formalizing a\ntheorem that is both technically nontrivial and naturally decomposable: multivariate Taylor’s theorem in\nintegral form. At the time of writing, Mathlib contains Taylor’s theorem only in one-dimensional settings and\ndoes not have the multivariate Fréchet-derivative formulation in integral form.\nTarget theorem. Let E, F be normed vector spaces over R with F complete. Let U ⊆E be open and let\nf : U →F be Cn with n > 0. For x, h ∈E such that [x, x + h] ⊆U, we aim to formalize:\nf(x + h) =\nn−1\nX",
      "truncated": true,
      "provenance": "ingested",
      "summary": {
        "status": "not-summarised"
      }
    },
    {
      "id": "library/arxiv-2601.22554v1/blocks/figure-img-p008-1",
      "types": [
        "folio-assistant-core:Figure",
        "doco:Figure"
      ],
      "kind": "figure",
      "title": "",
      "pageStart": 8,
      "pageEnd": 8,
      "target": "../images/img-p008-1.png",
      "narrative": "draft",
      "content": "Figure 2(a): the first blueprint produced for multivariate Taylor's theorem in integral form, before any automated proving. Rectangles are definitions and ellipses are theorems; dashed arrows mark a statement-level use and solid arrows a proof-level use. Definition nodes taylorKernel, taylorRemainderKernel, taylorPoly, lineMap and lineCurve sit at the top; the target frechet_taylor_integral is the sink at the bottom. Most theorem nodes are light blue (unproved); only taylor_integral_one_shot, integrationByParts_smul and ftoc_bochner_wrapper are dark green.",
      "truncated": false,
      "provenance": "ingested",
      "summary": null
    },
    {
      "id": "library/arxiv-2601.22554v1/blocks/figure-img-p008-2",
      "types": [
        "folio-assistant-core:Figure",
        "doco:Figure"
      ],
      "kind": "figure",
      "title": "",
      "pageStart": 8,
      "pageEnd": 8,
      "target": "../images/img-p008-2.png",
      "narrative": "draft",
      "content": "Figure 2(b): the same initial blueprint after the automated prover's sorry-filling pass. Rectangles are definitions and ellipses are theorems; dashed arrows mark a statement-level use and solid arrows a proof-level use. Definition nodes taylorKernel, taylorRemainderKernel, taylorPoly, lineMap and lineCurve sit at the top; the target frechet_taylor_integral is the sink at the bottom. The leaf lemmas taylorKernel_deriv_t, taylorKernel_at_right and taylorRemainder_eq_explicit have turned dark green; taylor_integral_kernel and lineCurve_iteratedDeriv remain light blue, and taylor_integral_explicit and frechet_taylor_integral are filled a lighter green; the caption distinguishes only blue (unproved) from green (proved), so what the two shades of green separate is not stated in the paper.",
      "truncated": false,
      "provenance": "ingested",
      "summary": null
    },
    {
      "id": "library/arxiv-2601.22554v1/blocks/figure-img-p008-3",
      "types": [
        "folio-assistant-core:Figure",
        "doco:Figure"
      ],
      "kind": "figure",
      "title": "",
      "pageStart": 8,
      "pageEnd": 8,
      "target": "../images/img-p008-3.png",
      "narrative": "draft",
      "content": "Figure 2(c): the refined blueprint after the planner model decomposed the stuck nodes further. Rectangles are definitions and ellipses are theorems; dashed arrows mark a statement-level use and solid arrows a proof-level use. Definition nodes taylorKernel, taylorRemainderKernel, taylorPoly, lineMap and lineCurve sit at the top; the target frechet_taylor_integral is the sink at the bottom. New intermediate nodes appear -- taylor_remainder_by_parts, taylor_integral_kernel_base, taylorPoly_succ, ftoc_bochner_on_uIcc and lineCurve_contDiffOn_onSeg -- and every theorem node is light blue, i.e. nothing is yet proved in this version.",
      "truncated": false,
      "provenance": "ingested",
      "summary": null
    },
    {
      "id": "library/arxiv-2601.22554v1/blocks/figure-img-p008-4",
      "types": [
        "folio-assistant-core:Figure",
        "doco:Figure"
      ],
      "kind": "figure",
      "title": "",
      "pageStart": 8,
      "pageEnd": 8,
      "target": "../images/img-p008-4.png",
      "narrative": "draft",
      "content": "Figure 2(d): the refined blueprint after the prover's second pass. Rectangles are definitions and ellipses are theorems; dashed arrows mark a statement-level use and solid arrows a proof-level use. Definition nodes taylorKernel, taylorRemainderKernel, taylorPoly, lineMap and lineCurve sit at the top; the target frechet_taylor_integral is the sink at the bottom. Nearly every lemma is dark green; three remain light blue -- taylor_remainder_by_parts, lineCurve_iteratedDeriv and frechet_taylor_integral -- which are the nodes the text says were left for a human. taylor_integral_kernel, taylor_integral_explicit and taylor_integral_one_shot are a lighter green.",
      "truncated": false,
      "provenance": "ingested",
      "summary": null
    },
    {
      "id": "library/arxiv-2601.22554v1/blocks/figure-img-p008-5",
      "types": [
        "folio-assistant-core:Figure",
        "doco:Figure"
      ],
      "kind": "figure",
      "title": "",
      "pageStart": 8,
      "pageEnd": 8,
      "target": "../images/img-p008-5.png",
      "narrative": "draft",
      "content": "Figure 2(e): the completed formalization after a human proved the remaining nodes. Rectangles are definitions and ellipses are theorems; dashed arrows mark a statement-level use and solid arrows a proof-level use. Definition nodes taylorKernel, taylorRemainderKernel, taylorPoly, lineMap and lineCurve sit at the top; the target frechet_taylor_integral is the sink at the bottom. Every theorem node is dark green, meaning the whole graph, including the target frechet_taylor_integral, is proved without sorry.",
      "truncated": false,
      "provenance": "ingested",
      "summary": null
    },
    {
      "id": "library/arxiv-2601.22554v1/blocks/prose-sec-012",
      "types": [
        "folio-assistant-core:Prose",
        "doco:Section"
      ],
      "kind": "prose",
      "title": "Limitations",
      "pageStart": 9,
      "pageEnd": 11,
      "target": "../sections/sec-012-limitations.md",
      "narrative": null,
      "content": "LeanArchitect introduces a new integration point between Lean and blueprint workflows and has several\nlimitations. First, authoring LATEX inside Lean files is currently unergonomic: mainstream Lean IDE support\nprovides neither syntax highlighting nor interactive feedback for embedded LATEX in .lean files, and existing\nkeybindings interfere with natural LATEX input. Second, LeanArchitect supports a many-to-one correspondence\nfrom Lean declarations to blueprint nodes: multiple Lean declarations may correspond to the same blueprint\nnode, but a given Lean declaration cannot correspond to more than",
      "truncated": true,
      "provenance": "ingested",
      "summary": {
        "status": "not-summarised"
      }
    },
    {
      "id": "library/arxiv-2601.22554v1/blocks/prose-sec-013",
      "types": [
        "folio-assistant-core:Prose",
        "doco:Section"
      ],
      "kind": "prose",
      "title": "Technical Details",
      "pageStart": 11,
      "pageEnd": 11,
      "target": "../sections/sec-013-technical-details.md",
      "narrative": null,
      "content": "A.1",
      "truncated": false,
      "provenance": "ingested",
      "summary": {
        "status": "not-summarised"
      }
    },
    {
      "id": "library/arxiv-2601.22554v1/blocks/prose-sec-014",
      "types": [
        "folio-assistant-core:Prose",
        "doco:Section"
      ],
      "kind": "prose",
      "title": "Example",
      "pageStart": 11,
      "pageEnd": 13,
      "target": "../sections/sec-014-example.md",
      "narrative": null,
      "content": "We begin with an illustrative example of LeanArchitect.\nimport Architect\n@[blueprint]\ninductive MyNat : Type where\n| zero : MyNat\n| succ : MyNat →MyNat\nnamespace MyNat\n@[blueprint \"def:nat-add\"\n(statement := /-- Natural number addition. -/)]\ndef add (a b : MyNat) : MyNat :=\nmatch b with\n| zero => a\n| succ b => succ (add a b)\nLeanArchitect\n12\n@[simp, blueprint\n(statement := /-- For any natural number $a$, $0 + a = a$,\nwhere $+$ is \\cref{def:nat-add}. -/)]\ntheorem zero_add (a : MyNat) : add zero a = a := by\n/-- The proof follows by induction. -/\ninduction a <;> simp [*, add]\n@[blueprint\n(stateme",
      "truncated": true,
      "provenance": "ingested",
      "summary": {
        "status": "not-summarised"
      }
    },
    {
      "id": "library/arxiv-2601.22554v1/blocks/figure-img-p012-1",
      "types": [
        "folio-assistant-core:Figure",
        "doco:Figure"
      ],
      "kind": "figure",
      "title": "",
      "pageStart": 12,
      "pageEnd": 12,
      "target": "../images/img-p012-1.png",
      "narrative": "draft",
      "content": "Figure 3(a): the web blueprint generated from the appendix's MyNat example. It lists Definition 1 (Natural numbers) and Definition 2 (Natural number addition), each with a check mark; Theorem 3, for any natural number a, 0 + a = a, where + is definition 2, with a check mark and a collapsed proof; Theorem 4, (a + 1) + b = (a + b) + 1, with no check mark and the proof text 'Proof by induction on b'; and Theorem 5, a + b = b + a, with no check mark and a proof reading 'The base case follows from theorem 3. The inductive case follows from theorem 4.', both references rendered as links.",
      "truncated": false,
      "provenance": "ingested",
      "summary": null
    },
    {
      "id": "library/arxiv-2601.22554v1/blocks/figure-img-p012-2",
      "types": [
        "folio-assistant-core:Figure",
        "doco:Figure"
      ],
      "kind": "figure",
      "title": "",
      "pageStart": 12,
      "pageEnd": 12,
      "target": "../images/img-p012-2.png",
      "narrative": "draft",
      "content": "Figure 3(b): the dependency graph of the MyNat example. Green rectangles MyNat and nat-add at the top, with dashed arrows from nat-add to a blue-bordered rectangle MyNat.mul and to the ellipses MyNat.succ_add (light blue) and MyNat.zero_add (dark green); solid arrows run from both of those into MyNat.add_comm (light blue), and a dashed arrow from MyNat.mul to a white ellipse MyNat.mul_comm, whose outgoing edge is cut off at the bottom of the image.",
      "truncated": false,
      "provenance": "ingested",
      "summary": null
    },
    {
      "id": "library/arxiv-2601.22554v1/blocks/prose-sec-015",
      "types": [
        "folio-assistant-core:Prose",
        "doco:Section"
      ],
      "kind": "prose",
      "title": "Implementation",
      "pageStart": 13,
      "pageEnd": 15,
      "target": "../sections/sec-015-implementation.md",
      "narrative": null,
      "content": "We briefly introduce the implementation of LeanArchitect. However, note that since writing this section, the\nLeanArchitect implementation has changed and will continue to change for new features, performance, and\nbug fixes.\nAt its foundation, LeanArchitect is built upon the following Node datatype, which represents a @[blueprint]-\ntagged Lean declaration with relevant metadata.\n/-- The statement or proof of a node. -/\nstructure NodePart where\n/-- The natural language description of this part. -/\ntext : String\n/-- The specified set of nodes that this node depends on, in addition to inferred one",
      "truncated": true,
      "provenance": "ingested",
      "summary": {
        "status": "not-summarised"
      }
    }
  ]
}
