Entails
Browse documentation

AI Native Theorem Prover

Inspect executable models, check their proofs, and publish them from the same Entails source. Start with a guarded binary counter and see exactly where a change breaks its proof.

Open the WebAssembly playground to edit a machine and check the invariant in your browser.

Setup

From the repository root, install the package with uv. The proof commands use Elan with Lean v4.36.0.

uv sync
uv run entails parse docs/counter.entails --tree

Guarded counter

Open the editable Entails source to inspect both tables and the shared certificate. In a transition, keep writes back the symbol just read. A bare declaration such as region rewind covers the head at cell zero and at positive cells.

Learn by replay

Replay both machines

Use 1–6 bits. The widget prepends the guard at cell zero.

Loading the transition table…

uv run entails experiment docs/counter.entails original_safe altered

The two machines share all 14 training traces at widths 1–3. With a deadline of 4,096 steps, the original accepts none of the 112 holdout inputs at widths 4–6 and the altered machine accepts all of them.

Check with Lean

uv run entails check docs/counter.entails original_safe
uv run entails check docs/counter.entails original_safe --machine altered

Lean checks initialization, preservation, and exclusion of acceptance. For the original table, induction proves nonacceptance at every deadline whenever cell zero initially contains the guard. The altered check fails at carry_three(bit_one), where the destination is flip. Use entails emit-lean with the same arguments to inspect the generated proof.

Add --forest for the Proof Forest rendered by Entails. Lines that exceed the terminal width end in ....

Use --engine entails to check the same certificate independently against the Entails runtime. The default engine checks the emitted proof with Lean.

Use --paranoid to require an axiom audit, independent replay, and agreement with the Entails checker. See the proof checking guide.

Compare the checked certificates

Original table · proved
✓ original_safe · original
├─ ✓ initialization
├─ ✓ preservation
└─ ✓ acceptance exclusion

The proof applies to every natural deadline for tapes whose first cell is guarded.

∀d∈ℕ,run(d).control≠accepted
Altered table · preservation fails
✗ original_safe · altered
├─ ○ initialization (unchecked)
├─ ✗ preservation
│  ├─ ✗ at cell 1: carry_three(bit_one) → flip
│  └─ ✗ at a cell ≥ 2: carry_three(bit_one) → flip
└─ ○ acceptance exclusion (unchecked)

The shared invariant has no region for flip. Lean refutes the preservation premise for the altered row at cell 1 and at cells farther right.

Supply input

Pass tape symbols with --tape or pipe one line with --stdin. A blank line starts with an empty tape. A replay that exhausts its local budget before reaching a halt or its deadline exits with status 2.

printf 'guard bit_one bit_one bit_one bit_one\n' |
  uv run entails run docs/counter.entails altered --stdin --deadline 11

See proof checking, proofs as papers, editor and package tools, the complexity proof syntax draft, the runtime and reference design, and the development roadmap.