← All papers
First page of DSLean: A Framework for Type-Correct Interoperability Between Lean 4 and External DSLs

DSLean: A Framework for Type-Correct Interoperability Between Lean 4 and External DSLs

Tate Rowney, Riyaz Ahuja, Jeremy Avigad, Sean Welleck

cs.LO Feb 20, 2026 · v1
DSLean is a Lean 4 framework for bidirectional translation between Lean expressions and external DSL syntax for solver tactics.
Domain-specific languages (DSLs) mediate interactions between interactive proof assistants and external automation, but translating between the prover's internal representation and such DSLs is a tedious engineering chore. To simplify this task, we present DSLean, a framework for bidirectional translation between expressions in the Lean proof assistant and external syntax. DSLean requires only a specification of an external language and its Lean equivalents, abstracting away meta-level implementation details. We demonstrate DSLean's capabilities by implementing three new automation tactics, providing access to external solvers for interval arithmetic, ordinary differential equations, and ring ideal membership.

Translating between a proof assistant's internal representation and domain-specific languages used by external solvers is a tedious engineering chore with little reusable infrastructure, especially in the Lean ecosystem.

The authors present DSLean, a framework for bidirectional translation between Lean 4 expressions and external DSL syntax. DSLean requires only a specification of an external language and its Lean equivalents, abstracting away meta-level implementation details. Users declare equivalences between Lean objects and external syntax strings, including patterns with free variables that are iteratively filled during translation. The framework ensures type-correctness throughout. Three new automation tactics are implemented as demonstrations: interval arithmetic, ordinary differential equations, and ring ideal membership solvers.

DSLean enables three new Lean 4 automation tactics providing access to external solvers for interval arithmetic, ODEs, and ring ideal membership, each requiring only a declarative specification rather than bespoke translation code.