QED

QED (Quite Easy Deduction) is a theorem prover for higher-order logic written in MoonBit. It follows the LCF approach: a small trusted kernel implements the primitive inference rules of HOL and is the only code that can create theorems, and everything else, from the parser to the command-line tool, builds on it without being trusted. Proofs are written as short theorem scripts with goal-directed steps; a script either yields a kernel theorem, fails with a structured diagnostic, or reports an unfinished proof. A formal specification defines the kernel, and a Lean 4 pack in formal_verification/ checks the specification’s conformance claims.

The shipped proof language covers propositional logic with equality, theorem-header binders and goal-level forall; the user manual has the exact support matrix.

Formal specification

The formal specification is the only normative source for the kernel.

QED formal specification

Packages

The packages are layered: each depends only on packages to its left, kernel → logic/elab → parser → tactics → prover → cmd, and only kernel is trusted.

PackageRolePages
kernelTrusted kernel: types, terms, the abstract theorem type, primitive rules, scoped signature, extension gatesAPI · design · tutorial
logicPropositional connectives as definitions, derived rules, replay helpers, theorem catalogAPI · design · tutorial
elabName resolution with frozen constant identities, core typing, lowering to kernel termsAPI · design · tutorial
parserText frontend: normalisation, terms, goals, theorem scripts, source positionsAPI · design · tutorial
tacticsBackward proof states and steps, replayed forward to kernel theoremsAPI · design · tutorial
proverTheorem-script driver with structured results, and the regression corpusAPI · design · tutorial
cmdThe command-line tool qed-cmd (executable package)API · design · tutorial
research_rewriteResearch-only rewriting prototype, not shippedAPI · design · tutorial

Blackbox test files (*_test.mbt) and the alias files alias.mbt and alias_test.mbt belong to their packages; code governance defines their rules. The theorem files in examples/ and prelude/ are inputs for the command-line tool, not packages.

Where to start

New to proof assistants. Read “For readers new to HOL” and the quick start in the user manual, then run the examples with the cmd tutorial. The syntax guide answers “how do I write this step”.

Using QED from MoonBit. Start with the prover tutorial to run scripts and read results. Go down to the tactics tutorial to drive proofs step by step, and to the logic and kernel tutorials to build theorems forwards.

Checking why it is sound. Read the kernel design, which derives the rules and explains why soundness reduces to the kernel, then the logic and tactics designs, which show that the upper layers add no authority. The formal specification above is normative.

Contributing. Read code governance and documentation governance first, then specification conformance for the code/test mapping and the rules for examples. The workspace audit lists open risks; the specification changelog records revisions of the specification.

Guides

Install and build

QED requires the MoonBit toolchain with moonc 0.10 or later, and depends on moonbitlang/x for file access in the command-line tool. To use the library from another module:

moon add Luna-Flow/QED@0.1.0

To work in the repository:

moon check --target all
moon test
moon run src/cmd examples/truth_file.qed

The Lean formalisation builds separately with lake build in formal_verification/.