Verso is a platform for writing documents, books, course materials, and websites with Lean.
Every code example is type-checked. Every rendered page is interactive. And it's all
built on the tools you already use.
The type of all predicates over a type is that type's _powerset_. Elements of one of these subsets satisfy the predicate:
```leandef Set (α : Type u) : Type u :=
α → Prop
instance : Membership α (Set α) where
mem xs x := xs x
```
A function $`f` is surjective if each element of the range is covered by an element of the domain:
```leandef Surjective (f : α → β) :=
∀ y, ∃ x, f x = y
```:::theorem"Cantor"
Given a function $`f ∈ S → \mathcal{P}(S)`, [Cantor's diagonal argument](https://en.wikipedia.org/wiki/Cantor%27s_diagonal_argument) involves the diagonal set $`\{x ∈ S \mid x \not\in f(x)\}`. The {tactic}`grind` tactic takes care of many reasoning steps:
```leantheorem cantor (f : S → Set S) : ¬ Surjective f := by
intro h
have ⟨x, p⟩ := h (fun x : S => x ∉ f x)
have : x ∈ f x ↔ x ∉ f x := by
constructor <;>
simp [Membership.mem] at * <;>
grind
grind
```:::
The type of all predicates over a type is that type's powerset. Elements of one of these subsets satisfy the predicate:
A function f is surjective if each element of the range is covered by an element of the domain:
defSurjective(f:α→β):=∀y,∃x,fx=y
Cantor
Given a function f ∈ S → \mathcal{P}(S), Cantor's diagonal argument involves the diagonal set \{x ∈ S \mid x \not\in f(x)\}. The grind tactic takes care of many reasoning steps:
Verso files are Lean files. While writing, you get the full IDE experience, including autocomplete, error checking, go-to-definition, and tactic states. Readers get the same richness: rendered pages include proof states, hover information, and clickable links to documentation.
Correct
Verso helps you catch mistakes while writing, not after publishing. Every code example is checked by Lean as part of the build. If a described behavior doesn't match reality, you find out immediately. The Lean Reference Manual uses this to stay up to date with the latest developments.
Integrated
Built on Lean and Lake. Verso uses a lightweight Markdown-like markup language with a built-in extension mechanism. Extensions are ordinary Lean functions, not a separate plugin system or templating language. Syntax highlighting uses Lean's actual parser, so it's always accurate.
What Can You Build?
Verso's provides a shared foundation for rendering, cross-referencing, and code integration, without requiring a single core model that only really fits one kind of document.
Different kinds of documents are called genres.
Each genre builds on common infrastructure, so improvements to one benefit all, and anyone can implement a new genre.
Reference Manuals
Comprehensive API and language documentation
Course Notes & Textbooks
Structured educational material with worked examples
Websites & Blogs
A static site generator for project homepages, landing pages, and blog posts with integrated Lean code
Mathematical Blueprints
Plans for large-scale formalization projects
Your Document Here
Verso's genre system is extensible: you can define new document types with custom rendering and cross-referencing
Verso lets you write rich, correct, and interactive documents with Lean. Whether you're starting a new textbook, blog, or reference manual, now is a great time to begin.