跳转到内容

bend2-vs-lean

  • Both use dependent types + public native toolchains; diverge on proof authoring and execution.
  • Lean: elaborates source + tactic scripts → small kernel; mathlib of lemmas/tactics.
  • Bend2: explicit proofs via functions/match/equality rewrites; no tactics or proof search; safe recursion = structurally smaller input; @unsafe outside discipline.
  • BendTT paper + Lean formalization public; README documents mismatches between formalization and bend.ts implementation.
  • Same types, different jobs: Bend even-halving proof = explicit induction + rewrite motive; Lean tactics can auto-build such terms then kernel-check.
  • Game demo: LAWS.bend / PROOF.bend prove model properties (e.g. safe-position over move lists) — does not cover unmentioned requirements, JS renderer, or compiler correctness.
  • Execution: Bend = compiled balanced fork/join CPU+GPU; Lean = Tasks + reference counting; GPU typically foreign.

On Apple M4 Max, synthetic checker file (12,800 definitions):

ToolTime
Bend0.295 s
Lean36.177 s

Inputs/runner now public under bench/checker/. Caveat from note: “These four synthetic cases do not measure a port of a mathlib-dependent application, and the numbers have not been independently reproduced here.”

RequirementLean 4Bend 2
Proof constructionExplicit terms or tacticsExplicit terms + rewrite motives
Proof reusemathlib + packagesBase lemmas + demos
Native parallelTasksBalanced fork/join
GPUForeign / external pkgsMarked ! on Metal/CUDA
LicenseApache-2.0Apache-2.0
FormalizationKernel checks elaborated termsCore formalization has documented impl mismatches

“Lean elaborates source and tactic scripts into terms checked by a small kernel; Bend instead requires explicit proofs built with its function and match syntax.”

“The theorem does not cover unmentioned requirements, the JavaScript renderer, or the compiler’s correctness.”

“Bend suits an evaluation where affine code and native CPU/GPU execution are requirements and the project can supply its own proofs. Lean supplies existing mathematical libraries and tactics that can remove substantial proof-writing work.”

“Compare a representative program and its actual library dependencies before choosing on checker timings alone.”

  • Choose Lean when: mathlib/tactics matter; agent already strong at Lean (Vero-style); need mature ecosystem / CI (lake); proofs about math or software scaffolds without needing BendRT GPU.
  • Choose Bend2 when: product is the parallel program; laws gate AI edits; willing to write/maintain explicit proofs; accept young compiler + formalization gaps; --safe as extra kernel pass.
  • Do not pick on checker OOM claims alone — proof construction cost dominates agent loops; Bend’s missing tactics may increase LLM token/repair work even if check is fast.
  • Hybrid pattern (future): Lean for hard theory / audit of BendTT; Bend for shipping parallel app with LAWS gate — note does not prescribe this, but mismatch disclosure supports treating Bend checker as engineering trust, not drop-in Lean substitute.