Alectryon supports literate programs and documents (combinations of code and prose) written in Lean3 and reStructuredText. Here is an example written in Lean3. It can be converted to reST, HTML, or LaTeX using the following commands:
alectryon --frontend lean3+rst literate_lean3.lean
# Lean3+reST → HTML; produces ‘literate_lean3.html’
alectryon --frontend lean3+rst literate_lean3.lean --backend latex \
--latex-dialect lualatex \
-o literate_lean3.lua.tex
# Lean3+reST → LaTeX; produces ‘literate_lean3.lua.tex’
alectryon --frontend lean3+rst literate_lean3.lean --backend rst
# Lean3+reST → reST; produces ‘literate_lean3.lean3.rst’
Alectryon captures the results of #check, #eval, and the like:
By default, these results are folded and are displayed upon hovering or clicking. We can unfold them by default using annotations or directives:
Other flags can be used to control display, like .no-in:
Alectryon also captures goals and hypotheses as proofs progress:
example (p q r : Prop) : p ∧ q ↔ q ∧ p :=p, q, r: Propp ∧ q → q ∧ pp, q, r: Propq ∧ p → p ∧ qp, q, r: Propp ∧ q → q ∧ pp, q, r: Prop
H: p ∧ qq ∧ pp, q, r: Prop
H: p ∧ q2qp, q, r: Prop
H: p ∧ qpapply (and.elim_left H), },p, q, r: Prop
H: p ∧ qpp, q, r: Propq ∧ p → p ∧ qp, q, r: Prop
H: q ∧ pp ∧ qp, q, r: Prop
H: q ∧ ppp, q, r: Prop
H: q ∧ pqapply (and.elim_left H), } endp, q, r: Prop
H: q ∧ pq
Most features available for Coq are also available for Lean3; in particular, references (1, 2), quotes (p ∧ q) and assertions should work.
q ∧ p → p ∧ q
For now, please refer to the main README and to the Coq examples for more information.