Verify Lean 4 proofs inside your test graph.

Check Lean 4 theorems carried directly in your flows. Reflow verifies every proof with a bundled Lean 4.36 toolchain, rejects sorry and non-standard axioms, and caches unchanged modules across your DAG.

Optional plugin · installed on demand

flows/discount-proofs.md · lean.checkLean 4.36.0 · checked
Carried Lean module · Discount.lean
namespace Discount
def total (price discount : Nat) : Nat :=
  price - min discount price

theorem total_le (price discount : Nat) :
    total price discount ≤ price :=
  Nat.sub_le price _

theorem total_eq_zero (price discount : Nat) :
    total price discount = 0 ↔ price ≤ discount := by
  unfold total
  omega
end Discount
Kernel verdict & axiom audit · lean-output.txt
  • Discount.total_lechecked · 0 sorry
  • Discount.total_eq_zerochecked · 0 sorry
  • Statement checkexact kernel match
  • Axioms usedpropext · Classical.choice · Quot.sound
  • Upstream lemmasreused via needs

Self-contained, zero-sorry verification.

Carry Lean 4 modules right inside your Markdown flow and check them with lean.check. Reflow verifies every declared theorem against Lean’s kernel, fails on sorry or custom axioms, and pins exact theorem signatures via statements.

  • Verified theorem signatures and kernel verdict
  • Axiom audit (propext, Classical.choice, Quot.sound — zero sorry)
  • Compiler diagnostics (lean-output.txt) and exact checked source bytes

Scale proofs incrementally with needs.

Decompose larger proof trees into dependent flows connected by needs. When a downstream lemma changes, reflow plan reuses verified upstream modules and rechecks only affected theorems.

A pricing refactor leaves an unproved sorry or silently weakens a theorem statement. lean.check fails the step immediately, reports the exact file and line diagnostic, and retains the full axiom audit for PR review.

Land this evidence in PR review

A machine-checked proof, carried in the flow

reflow init --upgrade Lean \
  --collection <collection-id>

Lean is installed on demand and ships a pinned Lean 4.36.0 toolchain with Init, Std, and the bv_decide SAT solver—no local elan or PATH toolchain required. Once locked in your application, teammates and CI install it automatically with reflow init.

Your coding agent inspects installed plugin commands via MCP, authors flows against your application knowledge, and pins versions in the application lock.

Flow excerptLean
---
name: Discount rule proofs
providers:
  lean: Lean
---

```rfl step="Discount rule keeps its invariants"
lean.check (
  file="Discount.lean"
  statements=json(
    {"Discount.total_le": "∀ (price discount : Nat), price - min discount price ≤ price"}
  )
)
```

```lean file="Discount.lean"
namespace Discount
def total (price discount : Nat) : Nat := price - min discount price
theorem total_le (price discount : Nat) : total price discount ≤ price :=
  Nat.sub_le price _
end Discount
```

Plugin locks and private target bindings are managed separately from flow source.

Check the rest
of the application.