05

Check against the foundation.

Lean’s dependent type theory lets propositions be types and proofs be terms. The kernel checks proof terms against their claimed types, relative to the definitions and axioms used.

Learn dependent types ↗

A conceptual map of responsibilities, not a single installed product. Database adapters are alternatives; connecting stored facts to proof obligations is application work.

The working proof pipeline

Elpi finds. Lean checks.

LeanRDF and lean-elpi form a concrete search-and-check pipeline. A search engine produces a derivation certificate; a verified checker relates accepted certificates to the formal semantics.

Data and a claim flow through search, then a certificate crosses the trust boundary to a verified Lean checker
Download the diagram (SVG) ↓
A typed database API prevents particular mistakes in programs. A proof of entailment establishes a logical consequence. These are different contracts; neither alone establishes that an observation is true in the world.
Logic & proof search
λ

lean-elpi

Logic programming that understands binders.

LeanElpi is a Lean implementation of the ELPI dialect of λProlog. Use higher-order terms, scoped variables, hypothetical assumptions, and backtracking to express a search. The engine is usable from Lean and through language bindings.

The boundary. Its optional LF certification layer records derivations and exports evidence for Lean to check. Ordinary interpreter answers are not automatically certified.
The semantic stack
⊢

LeanRDF

A semantic web stack with formal contracts.

LeanRDF starts with RDF terms, graphs, parsing, and interpretations. RDFS entailment connects rules to their model-theoretic meaning. Above that sit a formalized SPARQL evaluator, OWL 2 RL and EL rules, and a SHACL Core validator.

The boundary. Entailment, query evaluation, and shape validation ask different questions. Profile support does not imply arbitrary OWL reasoning. The published project documents the scope and trust assumptions of each layer.
Typed knowledge graphs
◇

typedb-lean

Relations with roles. Types across the boundary.

typedb-lean connects TypeDB to Lean through typed schemas, queries, results, and transaction modes. Lean structures describe entities and relations; migrations and schema verification help keep the application and live database aligned.

The boundary. A typed transaction constrains permitted operations. It does not prove an arbitrary business invariant or the correctness of the database server. Add and discharge those obligations explicitly.
Embedded property graphs
✳

ladybug-lean

A property graph close to your application.

ladybug-lean provides typed node and relationship tables, checked Cypher, and a common interface for LadybugDB and a pure in-memory backend. It is a practical path for embedded graphs, local experiments, and repeatable tests.

The boundary. Schema-aware query construction is not a formal proof of every database result. Differential testing of backends provides useful evidence, with a different role from a theorem.
Choosing a foundation

Use the graph your problem needs.

FoundationNatural fitLean connectionProof boundary
TypeDBRich domain models, role-based relations, shared databaseTyped schemas, transactions, and result decodingApplication invariants need explicit proofs
LadybugDBEmbedded property graphs, local agent memory, CypherTyped graph schema and queries; pure test backendTyped queries do not certify the native engine
RDF / LeanRDFShared vocabularies, interoperable data, semantic entailmentFormal interpretations, derivations, and checkersGuarantees are scoped to the formalized semantics
Read the architecture guide ↗