Scholia DSH Plugin

Preface

In the development and reading of Lean 4 / Mathlib, a single theorem often relies on a vast collection of modules; the dependency cone can potentially contain 1829 modules. Directly reading through such complex dependency relations is extremely difficult. Scholia aims to solve this problem by using algorithms to simplify the massive dependency cone into a readable mainline, transforming formalized theorems into paper-style pages readable by mathematicians.

Plugin Introduction

  • Name: h2co3w/scholia (Package name: dsh-scholia)
  • Maintainer: H2CO3w
  • Core Value: Renders Lean 4 / Mathlib theorems as paper-style pages and reduces their 1829-module dependency cone into a readable mainline.

Core Features

  1. Paper View Rendering: Renders Lean 4 / Mathlib theorems as paper pages, including rendered mathematical formulas, Lean source code, and step-by-step annotations.
  2. Mainline Outline Generation: Uses algorithms to extract the mainline of the dependency cone, compressing the originally unreadable module dependencies into an ordered sequence of reading steps, with summaries written by the author for each step.
  3. Step Pages and Dependency Graphs: Generates specific step pages displaying the modules introduced at each step along with their summaries; also generates statically rendered module-level dependency graphs (DAGs).

Technical Requirements and Environment

  • Runtime Environment: Uses Node.js 24+ and SQLite.
  • Test Status: 360 tests passed.

Typical Usage

The artifacts generated by the plugin are located in the out directory, including the following parts:

  • Paper view: out/render/*.html. One page per theorem, containing rendered formulas, source code, and annotations, without script tags.
  • Mainline outline: out/outline/<root>/index.html. The mainline of the proof’s dependency cone.
  • Step pages: out/outline/<root>/NN.html. Detailed pages for individual steps.
  • Dependency graph: out/graph/*.svg. Static rendering of the module-level import DAG.

When using the tool, the --order reading parameter can be used to specify building the reading order starting from the foundation. Example entry files include out/outline/Euler.Solution/index.html and out/render/CHSH_inequality_of_comm.html.

Notes and Limitations

  • Early Version: The current version is v0.1, which is an early and incomplete version; interfaces are subject to change.
  • Data Dependency: The repository does not include the Corpus (data/lsv2.l) and Lexicon DB (cache/lexicon.db); these files are not contained within the repository.
  • Known Limitations: There are gaps in Unicode-to-LaTeX conversion, and there is a certain dependency on surface syntax.
  • Third-party Libraries: The plugin integrates KaTeX (MIT) and Lean fixtures (Apache-2.0).

Installation and Ecosystem

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye