replikativ

replikativ / ansatz

Public

Dependently typed Clojure DSL with a Lean4 compatible kernel.

19
0
100% credibility
Found Apr 08, 2026 at 19 stars -- GitGems finds repos before they trend. Get early access to the next one.
Sign Up Free
AI Analysis
Clojure
AI Summary

Ansatz is a Clojure library that implements Lean 4's proof-verified kernel in Java, enabling users to define typed functions and data structures, prove properties using tactics and Mathlib/CSLib theorems, and compile them to ordinary JVM code.

How It Works

1
📰 Discover Ansatz

You learn about a tool that lets you write reliable code with built-in proofs of correctness.

2
📦 Set up your project

Add the library to your coding workspace with a simple addition.

3
📚 Load math knowledge

Bring in a huge collection of proven math facts so your code can use them.

4
✏️ Write safe functions

Define data like lists or trees, and functions like sorting, using patterns and types.

5
Prove it correct

Use easy commands to verify your functions always work as promised, like sorting lists perfectly.

6
▶️ Run your code

Call your proven functions just like normal code, fast and reliable.

🎉 Build trustworthy apps

Create software you can trust won't have critical bugs in sorting, searching, or math.

Sign up to see the full architecture

5 more

Sign Up Free

Star Growth

See how this repo grew from 19 to 19 stars Sign Up Free
Repurpose This Repo

Repurpose is a Pro feature

Generate ready-to-use prompts for X threads, LinkedIn posts, blog posts, YouTube scripts, and more -- with full repo context baked in.

Unlock Repurpose
AI-Generated Review

What is ansatz?

Ansatz lets Clojure developers write dependently typed functions, data structures, and proofs using s-expressions, then compiles them to fast JVM code. It embeds Lean 4's kernel for type-checking against Mathlib's 210k theorems and CSLib's verified algorithms like merge sort—write `(a/defn merge ...)` with `:termination-by`, prove properties via tactics like `(grind)` or `(omega)`, and call it like any Clojure fn. This dependently typed Lisp bridges theorem proving with practical Clojure programming languages, solving the gap between verification and JVM performance.

Why is it gaining traction?

Unlike Agda or Lean, ansatz uses Clojure's REPL-friendly syntax for dependently typed higher-order logic and lambda calculus, with auto-generated defrecords and pattern matching that just works on the JVM. The `grind` tactic automates most proofs via E-graphs, and one-time setup scripts import massive libraries—no need to rewrite math from scratch. Developers hook on verified red-black trees or gradient descent that run at native speed, without leaving their Clojure workflow.

Who should use this?

Clojure backend engineers building reliable data structures like sorted lists or trees, where bugs cost real money. Theorem provers exploring dependently typed assembly language or Gatech-style research in Clojure. Anyone tired of unproven code in fintech, simulations, or algorithms needing provable termination.

Verdict

Try it if dependently typed programming in Clojure excites you—solid tutorial, examples, and REPL integration make onboarding fast. At 19 stars and 1.0% credibility, it's early (setup takes 20min first time), but mature docs and tests signal real potential over toy prototypes.

(198 words)

Sign up to read the full AI review Sign Up Free

Similar repos coming soon.