Proofs as papers
An Entails file can be the source of both the formal check and the paper.
Write the title with paper and the abstract with abstract. Use
section and paragraph for the
argument in the author’s own words. The compiler renders the code into
prose and derives mathematical notation for transitions and checked
invariants. See the guarded loop article.
entails paper docs/article.entails --check
entails paper docs/article.entails --check --format unicode
entails paper docs/article.entails --check --format latex > guarded.tex
entails paper docs/article.entails --check --format katex > article.html
The default Markdown output uses math blocks. The LaTeX export is a body
fragment for a manuscript you control. The HTML export loads a pinned KaTeX build from a CDN
and retains readable formulas when offline. --check includes Lean’s
result for each certificate and returns a failing exit code for a failed
proof. A replay or a successful parse alone supplies no proof evidence.
Include a proof in a LaTeX manuscript
\documentclass{article}
\usepackage{amsmath,amssymb}
\newcommand{\EntailsTitle}[1]{\section{#1}}
\begin{document}
\input{guarded.tex}
\end{document}
Set the class, packages, margins, and fonts in the parent document.
Define \EntailsTitle, \EntailsSection, or \EntailsDefinition before
the input to replace the fragment’s default unnumbered headings. The
fragment uses those definitions locally.
The Stanford-inspired theme is an
optional parent preamble. The sample manuscript
uses that theme and inputs guarded.tex. Keep the three files together
when building the manuscript. The preamble follows the research paper’s
formatting, including its centered title, Palatino body, cardinal sans-serif
headings, numbered theorems with a left rule, and cardinal proof square.
It also sets up figure and table captions, ruled tables, TikZ and PGFPlots,
numeric citations, linked cross-references, and a two-column glossary style.
Set \EntailsAuthor, \EntailsContact, and \EntailsDate in the parent
preamble when you want those fields shown. Use \bibliographystyle{plainnat}
with your own bibliography. For a glossary, activate its entries in the
parent manuscript and select \setglossarystyle{entails}.
The fragment labels the invariant and each checked proof obligation. Override its heading, abstract, claim, proof, and label commands in your own preamble to change their presentation.
Jupyter
uv sync --locked --extra notebook
uv run entails kernel install
Select the Entails kernel. Each cell accepts complete Entails
declarations, extends the manuscript on a successful parse, and displays
its rendered Markdown. Use %paper --check to check all certificates and
render the manuscript, or %check guarded_safe to inspect one Proof
Forest. %clear clears the session.