An Extensible User Interface for Lean 4
Open accessThe DOI matches its DataCite record; 40 of the 40 references it cites were found in a registry or an index; none of the 16 sources its claims cite is checked for support yet.
Abstract
Contemporary proof assistants rely on complex automation and process libraries with millions of lines of code. At these scales, understanding the emergent interactions between components can be a serious challenge. One way of managing complexity, long established in informal practice, is through varying external representations. For instance, algebraic notation facilitates term-based reasoning whereas geometric diagrams invoke spatial intuition. Objects viewed one way become much simpler than when viewed differently. In contrast, modern general-purpose ITP systems usually only support limited, textual representations. Treating this as a problem of human-computer interaction, we aim to demonstrate that presentations - UI elements that store references to the objects they are displaying - are a fruitful way of thinking about ITP interface design. They allow us to make headway on two fronts - introspection of prover internals and support for diagrammatic reasoning. To this end we have built an extensible user interface for the Lean 4 prover with an associated ProofWidgets 4 library of presentation-based UI components. We demonstrate the system with several examples including type information popups, structured traces, contextual suggestions, a display for algebraic reasoning, and visualizations of red-black trees. Our interface is already part of the core Lean distribution.
Overview
CoChat Summary
TL;DR
The paper presents an extensible user interface for Lean 4 and the ProofWidgets 4 library, centered on “presentations”: UI elements that retain references to the objects they display. It reports that the UI is part of core Lean and deployed to hundreds of active users, with examples including expression popups, structured traces, contextual suggestions, commutative diagrams, and red-black tree visualizations.
Key findings
- The system combines arbitrary HTML5/web displays, referential presentations, user-extensibility with reusable components, live interactive displays, on-demand lazy computation, and general-purpose design; the authors state it appears to be the first to support all of these cohesively.
- The UI is part of the core Lean distribution and has been deployed widely to hundreds of active users, with integration in the VS Code extension `vscode-lean4` and the Lean 4 Web online editor.
- Demonstrated examples include type information popups, structured traces (e.g., typeclass search), contextual suggestions, algebraic reasoning via commutative diagrams using Penrose, and red-black tree visualizations; the red-black tree visualization using `react-d3-tree` took less than an hour to prototype.
- Implementation uses LSP/JSON-RPC with user-extensible server RPC methods, remote references (`WithRpcRef`), and dynamic code delivery; traces can have thousands of nodes and environments can weigh several gigabytes, motivating lazy and remote handling.
Methods
- Design and implementation paper: describes the architecture of the Lean 4 UI, ProofWidgets 4 library, language server/infoview/editor components, and supporting metaprogramming features.
- No empirical user study or quantitative evaluation is reported; evidence is provided through worked examples and system deployment.
- Data availability lists software repositories for `vscode-lean4` and ProofWidgets 4.
Limitations
- The paper states that compared to the previous version, the system has lost the ability to program UI event handlers directly in Lean rather than JavaScript, and hopes to regain this when a JavaScript or WebAssembly backend is developed for Lean.
- The paper states that remote-reference memory management is cooperative and may fail if client-side errors occur; a client that does not release server-side memory could cause leaks, though keepalive messages mitigate disconnection- and hang-related leaks.
- The paper states that details are highly likely to change as the library evolves; evident from the text, no empirical evaluation or user study is reported, so usefulness claims rest on examples and deployment rather than measured outcomes.
Model-written summary. Check it against the paper before relying on it.
Integrity signals
Registry
Cites
Statistics
Figures


![Figure 3 A JSX-like syntax for writing HTML trees inline is used to write down a term of type Html in the editor. The #check command is used to inspect it in the infoview (1). The type Html has an associated pretty-printer which emits the same custom syntax. The pretty-printer sub-output <b>Lean!</b> is a presentation of the subterm Html.element "b" #[] #["Lean!"] which can be inspected by hovering over it with the mouse (2).](https://figures.cochat.ai/paper-figures/02cf3d22f2e64ccbb23c2a88a9901817/an-extensible-user-interface-for-lean-4-figure-3.png)






Verification
Claims the paper makes
0 Valid · 14 Not valid · 13 Not checked · 100 Own results and interpretations
A result the paper states — it cites no source for it, so there is none to check. The quote shows it is in the paper.
In the paper
“Presentations interact well with other language features including syntax extensions.”
§ An Extensible User Interface for Lean 4 > I T P 2 0 2 3 24:6
boostedstates an association- Asserted: passes — The authors put it forward as true.
- Checkable: passes — It can be checked against evidence.
- Load-bearing: passes — The paper’s conclusions depend on it.
- Based: passes — The paper gives a reason why it holds.
A result the paper states — it cites no source for it, so there is none to check. The quote shows it is in the paper.
In the paper
“For instance, every displayed expression, and each of its subexpressions, stores a reference to the type-theoretic term it corresponds to.”
§ An Extensible User Interface for Lean 4 > 2.1 Expression and trace presentations
plainstates an association- Asserted: passes — The authors put it forward as true.
- Checkable: passes — It can be checked against evidence.
- Load-bearing: passes — The paper’s conclusions depend on it.
- Based: passes — The paper gives a reason why it holds.
A result the paper states — it cites no source for it, so there is none to check. The quote shows it is in the paper.
In the paper
“For example, expressions displayed in the UI can be hovered over to see their types and explicit forms (Section 2.1);”
- Also stated in: § 2.1 Expression and trace presentations · plain
“Users can learn expressions' types, see the values inferred at implicit arguments, and jump to symbols' definitions.”
§ An Extensible User Interface for Lean 4 > 1.1 Contributions
plainstates a cause- Asserted: passes — The authors put it forward as true.
- Checkable: passes — It can be checked against evidence.
- Load-bearing: passes — The paper’s conclusions depend on it.
- Based: passes — The paper gives a reason why it holds.
- Also stated in: § 2.1 Expression and trace presentations · plain
A result the paper states — it cites no source for it, so there is none to check. The quote shows it is in the paper.
In the paper
“To implement expression presentations, the delaborator has been extended with the ability to tag syntax subtrees with references to subexpressions of the original expression.”
§ An Extensible User Interface for Lean 4 > Remote references.
plainstates a cause- Asserted: passes — The authors put it forward as true.
- Checkable: passes — It can be checked against evidence.
- Load-bearing: passes — The paper’s conclusions depend on it.
- Based: passes — The paper gives a reason why it holds.
A result the paper states — it cites no source for it, so there is none to check. The quote shows it is in the paper.
In the paper
“This is achieved by allowing JSON-RPC payloads to contain opaque references to server-side objects.”
§ An Extensible User Interface for Lean 4 > Remote references.
plainstates a cause- Asserted: passes — The authors put it forward as true.
- Checkable: passes — It can be checked against evidence.
- Load-bearing: passes — The paper’s conclusions depend on it.
- Based: passes — The paper gives a reason why it holds.
25 more claims
Create a free account to see all 127 claims and every source verdict.
- Probably not a substantial claim. 88
- It may state two separate claims as one. 23
- The quote only partly states this claim. 1
Self-check
Percentages, sums and reported differences re-computed from the paper’s own numbers.
Each contradiction between two passages listed here was confirmed by an independent check.
Rated minor: it would not touch a result — a value no result rests on, a p-value that stays on the same side of the significance level, or a conflict that is clerical, resolved elsewhere in the paper, or outside its own findings.
In the paper
§ An Extensible User Interface for Lean 4 > I T P 2 0 2 3 24:6
“the backtracking Prolog-like typeclass search procedure [43] of Lean 4 can be traced”
§ An Extensible User Interface for Lean 4 > References
“44. Daniel Selsam, Sebastian Ullrich, and Leonardo de Moura. Tabled Typeclass Resolution.”
Rated minor: it would not touch a result — a value no result rests on, a p-value that stays on the same side of the significance level, or a conflict that is clerical, resolved elsewhere in the paper, or outside its own findings.
In the paper
§ An Extensible User Interface for Lean 4 > 3.2 Selection contexts
“In Figure 6, we copied a balancing function for red-black trees verbatim from Okasaki [37].”
§ An Extensible User Interface for Lean 4 > References
“38. Chris Okasaki. Red-black trees in a functional setting.”
Rated minor: it would not touch a result — a value no result rests on, a p-value that stays on the same side of the significance level, or a conflict that is clerical, resolved elsewhere in the paper, or outside its own findings.
In the paper
§ An Extensible User Interface for Lean 4 > 3.1 Diagrams for algebra
“One such library, Penrose [47], expresses general mathematical diagramming as an optimization problem.”
§ An Extensible User Interface for Lean 4 > References
“48. Katherine Ye, Wode Ni, Max Krieger, Dor Ma'ayan, Jenna Wise, Jonathan Aldrich, Joshua Sunshine, and Keenan Crane. Penrose: from mathematical notation to beautiful diagrams.”
Rated minor: it would not touch a result — a value no result rests on, a p-value that stays on the same side of the significance level, or a conflict that is clerical, resolved elsewhere in the paper, or outside its own findings.
In the paper
§ An Extensible User Interface for Lean 4 > 1 Introduction
“Cognitive science researchers have long suspected that external representations of concepts and objects outside the mind (for example a drawing on a piece of paper, or the physical disks in a Tower of Hanoi puzzle), complementing internal representations within the mind, are not merely an aid but rather an integral component of cognition [49].”
§ An Extensible User Interface for Lean 4 > References
“50. Jiaje Zhang and Donald A. Norman. Representations in distributed cognitive tasks.”
Citations
Cites
Why a Diagram is (Sometimes) Worth Ten Thousand Words
Larkin, J. H., & Simon, H. A. (1987) · Cognitive Science · doi:10.1016/s0364-0213(87)80026-5 · Cited by 3,733
Requirements for Internet Hosts - Communication Layers
(1989) · doi:10.17487/rfc1122 · Cited by 1,370
Representations in Distributed Cognitive Tasks
Zhang, J., & Norman, D. A. (1994) · Cognitive Science · doi:10.1207/s15516709cog1801_3 · Cited by 1,203
AUGMENTING HUMAN INTELLECT: A CONCEPTUAL FRAMEWORK
ENGELBART, D. C. (1962) · doi:10.21236/ad0289565 · Cited by 1,082
Response time in man-computer conversational transactions
Miller, R. B. (1968) · Proceedings of the December 9-11, 1968, fall joint computer conference, part I on - AFIPS '68 (Fall, part I) · doi:10.1145/1476589.1476628 · Cited by 942
SMALLTALK-80: the interactive programming environment
Goldberg, A. (1984) · HAL · Cited by 787
The geometry of tensor calculus, I
Joyal, A., & Street, R. (1991) · Advances in Mathematics · doi:10.1016/0001-8708(91)90003-p · Cited by 660
Deductive Software Verification – The KeY Book
Ulbrich, M., Schmitt, P. H., Hähnle, R., Bubel, R., Beckert, B., & Ahrendt, W. (2016) · Lecture notes in computer science · doi:10.1007/978-3-319-49812-6 · Cited by 403
KeYmaera X: An Axiomatic Tactical Theorem Prover for Hybrid Systems
Fulton, N., Mitsch, S., Quesel, J.-D., Völp, M., & Platzer, A. (2015) · Lecture notes in computer science · doi:10.1007/978-3-319-21401-6_36 · Cited by 335
The Lean 4 Theorem Prover and Programming Language
Moura, L. D., & Ullrich, S. (2021) · Lecture Notes in Computer Science · doi:10.1007/978-3-030-79876-5_37 · Cited by 258
Interacting Quantum Observables
Coecke, B., & Duncan, R. (2008) · Lecture Notes in Computer Science · doi:10.1007/978-3-540-70583-3_25 · Cited by 252
Extending Sledgehammer with SMT Solvers
Blanchette, J. C., Böhme, S., & Paulson, L. C. (2013) · Journal of Automated Reasoning · doi:10.1007/s10817-013-9278-5 · Cited by 175
Proof General: A Generic Tool for Proof Development
Aspinall, D. (2000) · Lecture notes in computer science · doi:10.1007/3-540-46419-0_3 · Cited by 164
Penrose: from mathematical notation to beautiful diagrams
Ye, K., Ni, W., Krieger, M., Ma’ayan, D., Wise, J., Aldrich, J., Sunshine, J. S., & Crane, K. (2020) · ACM Transactions on Graphics · doi:10.1145/3386569.3392375 · Cited by 77
‘CHASING’ THE DIAGRAM—THE USE OF VISUALIZATIONS IN ALGEBRAIC REASONING
Toffoli, S. D. (2016) · The Review of Symbolic Logic · doi:10.1017/s1755020316000277 · Cited by 77
Red-black trees in a functional setting
Okasaki, C. (1999) · Journal of Functional Programming · doi:10.1017/s0956796899003494 · Cited by 75
Bertot, Y., Kahn, G., & Théry, L. (1994) · Lecture notes in computer science · doi:10.1007/3-540-57887-0_94 · Cited by 71
A Generic Approach to Building User Interfaces for Theorem Provers
Bertot, Y., & Théry, L. (1998) · Journal of Symbolic Computation · doi:10.1006/jsco.1997.0171 · Cited by 54
A Graphical User Interface for Formal Proofs in Geometry
Narboux, J. (2007) · Journal of Automated Reasoning · doi:10.1007/s10817-007-9071-4 · Cited by 48
HyperTree Proof Search for Neural Theorem Proving
Lample, G., Lachaux, M.-A., Lavril, T., Martinet, X., Hayat, A., Ebner, G., Rodriguez, A., & Lacroix, T. (2022) · arXiv · doi:10.48550/arxiv.2205.11491 · Cited by 45 · cited 1×
“For example, a piece of Sledgehammer-like automation [12], or a system based on recent advances in deep learning [28], could suggest proof steps that make progress on the proof in a manner related to the current selection context.”
BackgroundSelf-citationHyperTree Proof Search for Neural Theorem Proving
Lample, G., Lacroix, T., Lachaux, M.-A., Rodriguez, A., Hayat, A., Lavril, T., Ebner, G., & Martinet, X. (2022) · Advances in Neural Information Processing Systems 35 · doi:10.52202/068431-1910 · Cited by 45
Self-citationLΩUI: Lovely ΩMEGA User Interface
Siekmann, J., Hess, S., Benzmüller, C., Cheikhrouhou, L., Fiedler, A., Horacek, H., Kohlhase, M., Konrad, K., Meier, A., Melis⋆, E., et al. (1999) · Formal Aspects of Computing · doi:10.1007/s001650050053 · Cited by 43
High-level methods for homotopy construction in associative n-categories
Reutter, D., & Vicary, J. (2019) · ACM/IEEE Symposium on Logic in Computer Science (LICS) · doi:10.1109/lics.2019.8785895 · Cited by 38
Pit-Claudel, C. (2020) · ACM SIGPLAN International Conference on Software Language Engineering (SLE) · doi:10.1145/3426425.3426940 · Cited by 36
Tabled Typeclass ResolutionPreprint
Selsam, D., Ullrich, S., & de Moura, L. (2020) · arXiv (Cornell University) · doi:10.48550/arxiv.2001.04301 · Cited by 33
jsCoq: Towards Hybrid Theorem Proving Interfaces
Arias, E. J. G., Pin, B., & Jouvelot, P. (2017) · Electronic Proceedings in Theoretical Computer Science · doi:10.4204/eptcs.239.2 · Cited by 33
Visualizing Geometrical Statements with GeoView
Bertot, Y., Guilhot, F., & Pottier, L. (2004) · Electronic Notes in Theoretical Computer Science · doi:10.1016/j.entcs.2004.09.013 · Cited by 33
Asynchronous User Interaction and Tool Integration in Isabelle/PIDE
Wenzel, M. (2014) · Lecture notes in computer science · doi:10.1007/978-3-319-08970-6_33 · Cited by 31
Mathematics and Proof Presentation in Pcoq
Amerkad, A., Bertot, Y., Pottier, L., & Rideau, L. (2001) · OpenGrey (Institut de l'Information Scientifique et Technique) · Cited by 31
The CtCoq System: Design and Architecture
Bertot, Y. (1999) · Formal Aspects of Computing · doi:10.1007/s001650050049 · Cited by 28
XBarnacle: Making theorem provers more accessible
Lowe, H., & Duncan, D. (1997) · Lecture notes in computer science · doi:10.1007/3-540-63104-6_39 · Cited by 28
Visual Theorem Proving with the Incredible Proof Machine
Breitner, J. (2016) · Lecture notes in computer science · doi:10.1007/978-3-319-43144-4_8 · Cited by 26
A Web Interface for Isabelle: The Next Generation
Lüth, C., & Ring, M. (2013) · Lecture notes in computer science · doi:10.1007/978-3-642-39320-4_22 · Cited by 18
Donato, P., Strub, P.-Y., & Werner, B. (2022) · ACM SIGPLAN International Conference on Certified Programs and Proofs (CPP) · doi:10.1145/3497775.3503692 · Cited by 14
Front-end tooling for building and maintaining dependently-typed functional programs
Robert, V. (2018) · eScholarship (California Digital Library) · Cited by 14
A Graphical User Interface Framework for Formal Verification
Ayers, E. W., Jamnik, M., & Gowers, W. T. (2021) · DROPS (Schloss Dagstuhl – Leibniz Center for Informatics) · doi:10.4230/lipics.itp.2021.4 · Cited by 8
Self-citationDesign of Point-and-Click User Interfaces for Proof Assistants
Zhan, B., Ji, Z., Zhou, W., Xiang, C., Hou, J., & Sun, W. (2019) · Lecture notes in computer science · doi:10.1007/978-3-030-32409-4_6 · Cited by 8
Plotting in a Formally Verified Way
Melquiond, G. (2021) · Electronic Proceedings in Theoretical Computer Science · doi:10.4204/eptcs.338.6 · Cited by 5
Extensible type-directed editing
Korkut, J., & Christiansen, D. T. (2018) · ACM SIGPLAN International Workshop on Type-Driven Development (TyDe) · doi:10.1145/3240719.3241791 · Cited by 4
Considerations in Representation Selection for Problem Solving: A Review
Stockdill, A., Raggi, D., Jamnik, M., García, G. G., & Cheng, P. (2021) · Lecture notes in computer science · doi:10.1007/978-3-030-86062-2_4 · Cited by 3
Research works printed but not linked: 4
- Krzysztof Bar, Aleks Kissinger, and Jamie Vicary. Globular: an online proof assistant for higher-dimensional rewriting. In Leibniz International Proceedings in Informatics, volume 52, pages 34:1-34:11, 2016. ncatlab.org/nlab/show/Globular.
- Jon Barwise and John Etchemendy. Hyperproof: Logical reasoning with diagrams. In Working Notes of the AAAI Spring Symposium on Reasoning with Diagrammatic Representations, 1992. URL: https://www.aaai.org/Papers/Symposia/Spring/1992/SS-92-02/SS92-02-016.pdf.
- Eugene Charles Ciccarelli. Presentation based user interfaces. PhD thesis, Massachusetts Institute of Technology, Cambridge, MA, USA, 1984. URL: https://hdl.handle.net/1721. 1/15346.
- R.A. Dean. Elements of Abstract Algebra. Wiley international edition. Wiley, 1966. URL: https://books.google.com/books?id=kmulxmBgkxoC.
Cited by
Process-Driven Autoformalization in Lean 4Preprint
Lu, J., Wan, Y., Liu, Z., Huang, Y., Xiong, J., Liu, C., Shen, J., Jin, H., Zhang, J., Wang, H., et al. (2024) · arXiv (Cornell University) · doi:10.48550/arxiv.2406.01940 · Cited by 93
LeanProgress: Guiding Search for Neural Theorem Proving via Proof Progress Prediction
George, R. J., Huang, S., Song, P., & Anandkumar, A. (2025) · Transactions on machine learning research · doi:10.48550/arxiv.2502.17925 · Cited by 23
Teaching Mathematics Using Lean and Controlled Natural Language
Massot, P. (2024) · DROPS (Schloss Dagstuhl – Leibniz Center for Informatics) · doi:10.4230/lipics.itp.2024.27 · Cited by 23
Machine-Learned Premise Selection for Lean
Piotrowski, B., Mir, R. F., & Ayers, E. W. (2023) · Lecture notes in computer science · doi:10.1007/978-3-031-43513-3_10 · Cited by 19
Self-citationVy ZX: Formal Verification of a Graphical Quantum Language
Lehmann, A., Caldwell, B., Shah, B., Spencer, W. D., & Rand, R. W. (2026) · ACM Transactions on Programming Languages and Systems · doi:10.1145/3807780 · Cited by 15
Metadata
- Authors
- Nawrocki, W., Ayers, E. W., & Ebner, G.
- Affiliations
- Carnegie Mellon University (US)
- Microsoft (United States) (US)
- Venue
- Schloss Dagstuhl – Leibniz-Zentrum für Informatik
- Publisher
- Schloss Dagstuhl – Leibniz-Zentrum für Informatik
- Published
- 2023
- OpenAlex
- W6929086236
- Semantic Scholar
- 4f914250a0782981b7013e4aaedca93c94ea0d29
- Cited by
- 33
- References
- 39
- Citations by year
- 2026: 9 · 2025: 8 · 2024: 11 · 2023: 5
- FWCI
- 5.76
- Type
- journal article
- Language
- en
- Open access
- green
- drops.dagstuhl.de
- Licence
- Locations
- DROPS (Schloss Dagstuhl – Leibniz Center for Informatics) (publishedVersion, cc-by)
- Leibniz international proceedings in informatics (cc-by)
- Topics
- Physical Sciences › Computer Science › Software › Logic, programming, and type systems
- Physical Sciences › Computer Science › Computational Theory and Mathematics › Mathematics, Computing, and Information Processing
- Physical Sciences › Computer Science › Human-Computer Interaction › Usability and User Interface Design
- Keywords
- Lean 4, proof assistants, user interface design, presentations, diagrammatic reasoning, interactive theorem proving, algebraic notation, contextual suggestion
About these checks
Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.
A language model drew the claims from the paper on 2026-11-22, under version 3 of the claim definition (model deepseek-v4.1-flash, prompt extract-v3).
A second model labelled each claim on 2026-11-22 (model jev-1.13-20260917, definition revision gold-guideline-v0.2).
Statistics and arithmetic are recomputed, not judged.
Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.
What counts as a claim ›How we measure confidence ›How we check this ›
Are you an author, or do you see a problem with this page? Request a review
Data sources
Bibliographic data: Semantic Scholar, OpenAlex, Crossref.
Contains information from the Semantic Scholar Academic Graph Datasets, made available under the ODC Attribution License (ODC-BY 1.0).
Semantic Scholar’s data is described in: Kinney, R., et al. (2023). The Semantic Scholar Open Data Platform. arXiv:2301.10140.