{
  "$schema": "folio-library-document/v1",
  "id": "arxiv-2601.22554v1",
  "title": "LeanArchitect: Automating Blueprint Generation for Humans and AI",
  "variant": "pdf",
  "pages": 15,
  "tocSource": "outline",
  "tocMethod": null,
  "toc": [
    {
      "level": 1,
      "title": "Introduction",
      "number": null,
      "page": 2,
      "pageLabel": null,
      "confidence": null,
      "evidence": null,
      "source": "outline",
      "section": "sec-000-introduction"
    },
    {
      "level": 1,
      "title": "Related Work",
      "number": null,
      "page": 2,
      "pageLabel": null,
      "confidence": null,
      "evidence": null,
      "source": "outline",
      "section": "sec-001-related-work"
    },
    {
      "level": 1,
      "title": "Methods",
      "number": null,
      "page": 3,
      "pageLabel": null,
      "confidence": null,
      "evidence": null,
      "source": "outline",
      "section": "sec-002-methods"
    },
    {
      "level": 2,
      "title": "Overview",
      "number": null,
      "page": 3,
      "pageLabel": null,
      "confidence": null,
      "evidence": null,
      "source": "outline",
      "section": "sec-003-overview"
    },
    {
      "level": 2,
      "title": "Blueprint Attribute",
      "number": null,
      "page": 3,
      "pageLabel": null,
      "confidence": null,
      "evidence": null,
      "source": "outline",
      "section": "sec-005-blueprint-attribute"
    },
    {
      "level": 2,
      "title": "Environment Extension",
      "number": null,
      "page": 4,
      "pageLabel": null,
      "confidence": null,
      "evidence": null,
      "source": "outline",
      "section": "sec-004-environment-extension"
    },
    {
      "level": 2,
      "title": "LaTeX Export",
      "number": null,
      "page": 5,
      "pageLabel": null,
      "confidence": null,
      "evidence": null,
      "source": "outline",
      "section": "sec-006-latex-export"
    },
    {
      "level": 2,
      "title": "Project Management Using LeanArchitect",
      "number": null,
      "page": 5,
      "pageLabel": null,
      "confidence": null,
      "evidence": null,
      "source": "outline",
      "section": "sec-007-project-management-using-leanarchitect"
    },
    {
      "level": 1,
      "title": "Case Studies",
      "number": null,
      "page": 5,
      "pageLabel": null,
      "confidence": null,
      "evidence": null,
      "source": "outline",
      "section": "sec-008-case-studies"
    },
    {
      "level": 2,
      "title": "PrimeNumberTheoremAnd",
      "number": null,
      "page": 5,
      "pageLabel": null,
      "confidence": null,
      "evidence": null,
      "source": "outline",
      "section": "sec-009-primenumbertheoremand"
    },
    {
      "level": 2,
      "title": "Converting Existing Projects to LeanArchitect Format",
      "number": null,
      "page": 6,
      "pageLabel": null,
      "confidence": null,
      "evidence": null,
      "source": "outline",
      "section": "sec-010-converting-existing-projects-to-leanarchitect-fo"
    },
    {
      "level": 2,
      "title": "Blueprint-Based Autoformalization",
      "number": null,
      "page": 7,
      "pageLabel": null,
      "confidence": null,
      "evidence": null,
      "source": "outline",
      "section": "sec-011-blueprint-based-autoformalization"
    },
    {
      "level": 1,
      "title": "Limitations",
      "number": null,
      "page": 9,
      "pageLabel": null,
      "confidence": null,
      "evidence": null,
      "source": "outline",
      "section": "sec-012-limitations"
    },
    {
      "level": 1,
      "title": "Technical Details",
      "number": null,
      "page": 11,
      "pageLabel": null,
      "confidence": null,
      "evidence": null,
      "source": "outline",
      "section": "sec-013-technical-details"
    },
    {
      "level": 2,
      "title": "Example",
      "number": null,
      "page": 11,
      "pageLabel": null,
      "confidence": null,
      "evidence": null,
      "source": "outline",
      "section": "sec-014-example"
    },
    {
      "level": 2,
      "title": "Implementation",
      "number": null,
      "page": 12,
      "pageLabel": null,
      "confidence": null,
      "evidence": null,
      "source": "outline",
      "section": "sec-015-implementation"
    }
  ],
  "sections": [
    {
      "id": "sec-front-matter",
      "number": null,
      "title": "Front matter",
      "level": 1,
      "pageStart": 1,
      "pageEnd": 2,
      "labelStart": null,
      "labelEnd": null,
      "words": 202,
      "summary": null,
      "keywords": [
        {
          "term": "formal declarations",
          "heading": false
        },
        {
          "term": "blueprints",
          "heading": false
        },
        {
          "term": "leanarchitect",
          "heading": false
        },
        {
          "term": "collaboration",
          "heading": false
        },
        {
          "term": "university",
          "heading": false
        },
        {
          "term": "projects",
          "heading": false
        },
        {
          "term": "informal",
          "heading": false
        },
        {
          "term": "latex",
          "heading": false
        }
      ],
      "extract": "LeanArchitect 1 LeanArchitect Automating Blueprint Generation for Humans and AI Thomas Zhu1 Pietro Monticone2 Jeremy Avigad1 Sean Welleck1 1Carnegie Mellon University 2University of Trento Abstract Large-scale formalization projects in Lean rely on blueprints: structured dependency graphs linking informal mathematical exposition to formal declarations. While blueprints are central to human collaboration, existing",
      "extractCut": true
    },
    {
      "id": "sec-000-introduction",
      "number": null,
      "title": "Introduction",
      "level": 1,
      "pageStart": 2,
      "pageEnd": 2,
      "labelStart": null,
      "labelEnd": null,
      "words": 385,
      "summary": null,
      "keywords": [
        {
          "term": "blueprint workflows",
          "heading": false
        },
        {
          "term": "latex blueprint",
          "heading": false
        },
        {
          "term": "projects",
          "heading": false
        },
        {
          "term": "managing",
          "heading": false
        },
        {
          "term": "leanarchitect",
          "heading": false
        },
        {
          "term": "limitations",
          "heading": false
        },
        {
          "term": "duplication",
          "heading": false
        },
        {
          "term": "information",
          "heading": false
        }
      ],
      "extract": "A long-term goal of formal mathematics is to represent mathematical knowledge in a precise, machine-checked language that supports both verification and large-scale collaboration. Proof assistants such as Lean [7, 8] have made substantial progress toward this goal, with libraries like Mathlib [20] formalizing much of undergraduate mathematics and an increasing body of research-level material. As formalization",
      "extractCut": true
    },
    {
      "id": "sec-001-related-work",
      "number": null,
      "title": "Related Work",
      "level": 1,
      "pageStart": 2,
      "pageEnd": 3,
      "labelStart": null,
      "labelEnd": null,
      "words": 363,
      "summary": null,
      "keywords": [
        {
          "term": "blueprint structure",
          "heading": false
        },
        {
          "term": "leanblueprint",
          "heading": false
        },
        {
          "term": "problems",
          "heading": false
        },
        {
          "term": "leanblueprint-extract",
          "heading": false
        },
        {
          "term": "systems",
          "heading": false
        },
        {
          "term": "leanarchitect",
          "heading": false
        },
        {
          "term": "projects",
          "heading": false
        },
        {
          "term": "tool",
          "heading": false
        }
      ],
      "extract": "Blueprints in Lean. The term blueprint originates from Patrick Massot’s leanblueprint project [16], a plasTEX-based system that generates dependency graphs from LATEX documents using macros such as \\uses and \\leanok. Leanblueprint has been widely adopted in non-Mathlib projects due to its effectiveness in organizing large formalization efforts (such as [2–4, 9, 13, 19]). Although leanblueprint already has a",
      "extractCut": true
    },
    {
      "id": "sec-002-methods",
      "number": null,
      "title": "Methods",
      "level": 1,
      "pageStart": 3,
      "pageEnd": 3,
      "labelStart": null,
      "labelEnd": null,
      "words": 1,
      "summary": null,
      "keywords": [],
      "extract": "3.1",
      "extractCut": false
    },
    {
      "id": "sec-003-overview",
      "number": null,
      "title": "Overview",
      "level": 2,
      "pageStart": 3,
      "pageEnd": 3,
      "labelStart": null,
      "labelEnd": null,
      "words": 97,
      "summary": null,
      "keywords": [
        {
          "term": "attribute",
          "heading": false
        },
        {
          "term": "blueprint",
          "heading": false
        },
        {
          "term": "metadata",
          "heading": false
        }
      ],
      "extract": "LeanArchitect is a tool for extracting blueprint information directly from Lean code. Its core design principle is to minimize duplication between LATEX and Lean, by treating Lean as the authoritative source of information for any formalized blueprint node. The system introduces a new attribute, @[blueprint], which can be attached to Lean definitions and theorems. This attribute records metadata such as a LATEX",
      "extractCut": true
    },
    {
      "id": "sec-004-environment-extension",
      "number": null,
      "title": "Environment Extension",
      "level": 2,
      "pageStart": 3,
      "pageEnd": 3,
      "labelStart": null,
      "labelEnd": null,
      "words": 50,
      "summary": null,
      "keywords": [
        {
          "term": "evolve",
          "heading": false
        },
        {
          "term": "fragments",
          "heading": false
        },
        {
          "term": "integrate",
          "heading": false
        }
      ],
      "extract": "exported artifacts consist of LATEX fragments, which integrate seamlessly with existing leanblueprint documents through macros such as \\inputleannode. See Figure 1 for a diagram. This design supports a workflow in which informal exposition and formal proofs evolve together, while minimizing manual duplication and enabling structured interaction with AI automation. 3.2",
      "extractCut": false
    },
    {
      "id": "sec-005-blueprint-attribute",
      "number": null,
      "title": "Blueprint Attribute",
      "level": 2,
      "pageStart": 3,
      "pageEnd": 5,
      "labelStart": null,
      "labelEnd": null,
      "words": 370,
      "summary": null,
      "keywords": [
        {
          "term": "cref lem",
          "heading": false
        },
        {
          "term": "blueprint",
          "heading": true
        },
        {
          "term": "web blueprint",
          "heading": false
        },
        {
          "term": "latex blueprint",
          "heading": false
        },
        {
          "term": "add comm",
          "heading": false
        },
        {
          "term": "attribute",
          "heading": true
        },
        {
          "term": "blueprint generation",
          "heading": false
        },
        {
          "term": "formalization status",
          "heading": false
        }
      ],
      "extract": "LeanArchitect provides a new Lean attribute @[blueprint] that can be attached to definitions and theorems. Users can optionally supply metadata such as a LATEX label, natural language statement and proof, and other project-management annotations. The attribute serves as the user interface between Lean code and the blueprint system. A typical example is: 1See the GitHub repository. 2See the GitHub repository.",
      "extractCut": true
    },
    {
      "id": "sec-006-latex-export",
      "number": null,
      "title": "LaTeX Export",
      "level": 2,
      "pageStart": 5,
      "pageEnd": 5,
      "labelStart": null,
      "labelEnd": null,
      "words": 146,
      "summary": null,
      "keywords": [
        {
          "term": "latex blueprint",
          "heading": false
        },
        {
          "term": "lem",
          "heading": false
        },
        {
          "term": "succ-add",
          "heading": false
        },
        {
          "term": "zero-add",
          "heading": false
        },
        {
          "term": "begin",
          "heading": false
        },
        {
          "term": "add-comm",
          "heading": false
        }
      ],
      "extract": "To build the LATEX blueprint from such data, LeanArchitect provides a build-time export mechanism integrated with Lean’s Lake build system, inspired by doc-gen4. For each module, blueprint data is ex- tracted and rendered into LATEX fragments that can be imported into an existing blueprint document using the macro \\inputleannode{label}. Multiple Lean declarations are allowed to correspond to a single blueprint node.",
      "extractCut": true
    },
    {
      "id": "sec-007-project-management-using-leanarchitect",
      "number": null,
      "title": "Project Management Using LeanArchitect",
      "level": 2,
      "pageStart": 5,
      "pageEnd": 5,
      "labelStart": null,
      "labelEnd": null,
      "words": 165,
      "summary": null,
      "keywords": [
        {
          "term": "latex blueprint",
          "heading": false
        },
        {
          "term": "project",
          "heading": true
        },
        {
          "term": "leanarchitect",
          "heading": true
        },
        {
          "term": "script",
          "heading": false
        },
        {
          "term": "inputleannode",
          "heading": false
        }
      ],
      "extract": "We envision the workflow of a large Lean project using LeanArchitect to be as follows. 1. Mathematicians write a detailed exposition of the formalization target in a LATEX document (e.g. on Overleaf), following some source material. 2. A new formalization project is set up (e.g. on GitHub) with the document as a blueprint. 3. Lean experts translate each theorem or definition into Lean, tagging each one with",
      "extractCut": true
    },
    {
      "id": "sec-008-case-studies",
      "number": null,
      "title": "Case Studies",
      "level": 1,
      "pageStart": 5,
      "pageEnd": 6,
      "labelStart": null,
      "labelEnd": null,
      "words": 3,
      "summary": null,
      "keywords": [],
      "extract": "LeanArchitect 6 4.1",
      "extractCut": false
    },
    {
      "id": "sec-009-primenumbertheoremand",
      "number": null,
      "title": "PrimeNumberTheoremAnd",
      "level": 2,
      "pageStart": 6,
      "pageEnd": 6,
      "labelStart": null,
      "labelEnd": null,
      "words": 337,
      "summary": null,
      "keywords": [
        {
          "term": "leanok tags",
          "heading": false
        },
        {
          "term": "primenumbertheoremand",
          "heading": true
        },
        {
          "term": "blueprint metadata",
          "heading": false
        },
        {
          "term": "project",
          "heading": false
        },
        {
          "term": "leanarchitect",
          "heading": false
        },
        {
          "term": "tao",
          "heading": false
        },
        {
          "term": "custom",
          "heading": false
        },
        {
          "term": "maintenance",
          "heading": false
        }
      ],
      "extract": "PrimeNumberTheoremAnd [13] is a large community-driven project aiming to formalize the prime number theorem and related results in analytic number theory in Lean. It is the first external project to adopt LeanArchitect as its primary blueprint infrastructure. The project began in 2023 and was migrated to LeanArchitect in January 2026. Prior to migration, PrimeNumberTheoremAnd used a custom tool",
      "extractCut": true
    },
    {
      "id": "sec-010-converting-existing-projects-to-leanarchitect-fo",
      "number": null,
      "title": "Converting Existing Projects to LeanArchitect Format",
      "level": 2,
      "pageStart": 6,
      "pageEnd": 7,
      "labelStart": null,
      "labelEnd": null,
      "words": 219,
      "summary": null,
      "keywords": [
        {
          "term": "conversion script",
          "heading": false
        },
        {
          "term": "brownian motion",
          "heading": false
        },
        {
          "term": "infinity cosmos",
          "heading": false
        },
        {
          "term": "leanarchitect",
          "heading": true
        },
        {
          "term": "projects",
          "heading": true
        },
        {
          "term": "carleson",
          "heading": false
        },
        {
          "term": "distribution",
          "heading": false
        }
      ],
      "extract": "We tested the conversion script on the following projects into LeanArchitect, at Lean version v4.25.0: 1. Carleson [2] 2. Brownian Motion [9] 3. Infinity Cosmos [19] 4. Fermat’s Last Theorem [4] 5. Prime Number Theorem And [13] For each project, we first added LeanArchitect to the lakefile, and then ran the conversion script. For the most part, the script is able to automatically convert blueprint nodes into Lean",
      "extractCut": true
    },
    {
      "id": "sec-011-blueprint-based-autoformalization",
      "number": null,
      "title": "Blueprint-Based Autoformalization",
      "level": 2,
      "pageStart": 7,
      "pageEnd": 9,
      "labelStart": null,
      "labelEnd": null,
      "words": 707,
      "summary": null,
      "keywords": [
        {
          "term": "initial blueprint",
          "heading": false
        },
        {
          "term": "multivariate taylor",
          "heading": false
        },
        {
          "term": "refined blueprint",
          "heading": false
        },
        {
          "term": "intermediate lemmas",
          "heading": false
        },
        {
          "term": "aristotle",
          "heading": false
        },
        {
          "term": "integral form",
          "heading": false
        },
        {
          "term": "nodes",
          "heading": false
        },
        {
          "term": "dependency graph",
          "heading": false
        }
      ],
      "extract": "We evaluate LeanArchitect as an interface for human–AI collaboration by semi-automatically formalizing a theorem that is both technically nontrivial and naturally decomposable: multivariate Taylor’s theorem in integral form. At the time of writing, Mathlib contains Taylor’s theorem only in one-dimensional settings and does not have the multivariate Fréchet-derivative formulation in integral form. Target theorem. Let",
      "extractCut": true
    },
    {
      "id": "sec-012-limitations",
      "number": null,
      "title": "Limitations",
      "level": 1,
      "pageStart": 9,
      "pageEnd": 11,
      "labelStart": null,
      "labelEnd": null,
      "words": 1083,
      "summary": null,
      "keywords": [
        {
          "term": "arxiv preprint",
          "heading": false
        },
        {
          "term": "url https",
          "heading": false
        },
        {
          "term": "floris van",
          "heading": false
        },
        {
          "term": "van doorn",
          "heading": false
        },
        {
          "term": "doi",
          "heading": false
        },
        {
          "term": "reinforcement learning",
          "heading": false
        },
        {
          "term": "thomas zhu",
          "heading": false
        },
        {
          "term": "yong lin",
          "heading": false
        }
      ],
      "extract": "LeanArchitect introduces a new integration point between Lean and blueprint workflows and has several limitations. First, authoring LATEX inside Lean files is currently unergonomic: mainstream Lean IDE support provides neither syntax highlighting nor interactive feedback for embedded LATEX in .lean files, and existing keybindings interfere with natural LATEX input. Second, LeanArchitect supports a many-to-one",
      "extractCut": true
    },
    {
      "id": "sec-013-technical-details",
      "number": null,
      "title": "Technical Details",
      "level": 1,
      "pageStart": 11,
      "pageEnd": 11,
      "labelStart": null,
      "labelEnd": null,
      "words": 1,
      "summary": null,
      "keywords": [],
      "extract": "A.1",
      "extractCut": false
    },
    {
      "id": "sec-014-example",
      "number": null,
      "title": "Example",
      "level": 2,
      "pageStart": 11,
      "pageEnd": 13,
      "labelStart": null,
      "labelEnd": null,
      "words": 286,
      "summary": null,
      "keywords": [
        {
          "term": "succ add",
          "heading": false
        },
        {
          "term": "cref mynat",
          "heading": false
        },
        {
          "term": "zero add",
          "heading": false
        },
        {
          "term": "simp",
          "heading": false
        },
        {
          "term": "dependency graph",
          "heading": false
        },
        {
          "term": "natural numbers",
          "heading": false
        },
        {
          "term": "def",
          "heading": false
        }
      ],
      "extract": "We begin with an illustrative example of LeanArchitect. import Architect @[blueprint] inductive MyNat : Type where | zero : MyNat | succ : MyNat →MyNat namespace MyNat @[blueprint \"def:nat-add\" (statement := /-- Natural number addition. -/)] def add (a b : MyNat) : MyNat := match b with | zero => a | succ b => succ (add a b) LeanArchitect 12 @[simp, blueprint (statement := /-- For any natural number $a$, $0 + a =",
      "extractCut": true
    },
    {
      "id": "sec-015-implementation",
      "number": null,
      "title": "Implementation",
      "level": 2,
      "pageStart": 13,
      "pageEnd": 15,
      "labelStart": null,
      "labelEnd": null,
      "words": 1401,
      "summary": null,
      "keywords": [
        {
          "term": "node depends",
          "heading": false
        },
        {
          "term": "lake script",
          "heading": false
        },
        {
          "term": "lake build",
          "heading": false
        },
        {
          "term": "latex blueprint",
          "heading": false
        },
        {
          "term": "latex label",
          "heading": false
        },
        {
          "term": "add comm",
          "heading": false
        },
        {
          "term": "latex environment",
          "heading": false
        },
        {
          "term": "tagged constant",
          "heading": false
        }
      ],
      "extract": "We briefly introduce the implementation of LeanArchitect. However, note that since writing this section, the LeanArchitect implementation has changed and will continue to change for new features, performance, and bug fixes. At its foundation, LeanArchitect is built upon the following Node datatype, which represents a @[blueprint]- tagged Lean declaration with relevant metadata. /-- The statement or proof of a node.",
      "extractCut": true
    }
  ],
  "checks": {},
  "withheld": false,
  "keywords": [
    {
      "term": "latex blueprint",
      "heading": false
    },
    {
      "term": "blueprint node",
      "heading": false
    },
    {
      "term": "blueprint metadata",
      "heading": false
    },
    {
      "term": "blueprint information",
      "heading": false
    },
    {
      "term": "build blueprint",
      "heading": false
    },
    {
      "term": "existing blueprint",
      "heading": false
    },
    {
      "term": "blueprint workflows",
      "heading": false
    },
    {
      "term": "blueprint structure",
      "heading": false
    },
    {
      "term": "blueprint document",
      "heading": false
    },
    {
      "term": "initial blueprint",
      "heading": false
    },
    {
      "term": "blueprint content",
      "heading": false
    },
    {
      "term": "web blueprint",
      "heading": false
    }
  ],
  "links": {
    "repo": "litlfred/folio-assistant-sci",
    "branch": "main",
    "dir": "library/arxiv-2601.22554v1"
  }
}
