Theoric (@TheoricLabs) header
Theoric (@TheoricLabs) profile picture

Theoric is an applied AI lab at the intersection of formal methods and agentic AI.

San Francisco
Joined May 2026
Super secret plan 🤫
Rice's Theorem is a *good thing* for formal verification companies. Rice's Theorem says whatever your formalization is, there will always be a correct program which your verifier can't verify. The way to deal with Rice's Theorem is: 1. In short term, ignore the unverifiable programs, say they are out of scope. 2. In long term, grow your formalism to cover the previously unverifiable, but valuable program. Because no formalization is ever enough, you'll eventually find programs which are relevant but unverifiable, so you repeat the process. Infinite money glitch unlocked 🤣
170
Theoric retweeted
Today, at SF Lean Meetup, I'll be talking about "Building mock hardware for real performance gains", where I'll be talking about how I'm building GPU simulators in Lean to optimize the GPU optimization process. If you are in the city, would love to see you there.
7
2
2
54
3,442
Theoric retweeted
Oh wow, we love this. Harsh Gupta's Lean 4 submission to the "$12 server challenge" proves that, under certain conditions, posts are “already stored in the exact order they need,” so it can skip the extra work and read them directly. And bypassing SQLite’s normal query engine cut the time to load the feed from 16.7 ms to 5.4 ms. Congrats @hargup13!
It's official now, my Lean 4 submission is #1 on "$12 server challenge", serving more users than Rust, C or even hand written assembly. The creator of a the challenge did a pretty good job explaining how Lean 4 allows you to create software even more optimized than handwritten C.
5
23
4
262
12,433
Formal Methods allow you to make software bug-free AND make it run as fast as possible.
It's official now, my Lean 4 submission is #1 on "$12 server challenge", serving more users than Rust, C or even hand written assembly. The creator of a the challenge did a pretty good job explaining how Lean 4 allows you to create software even more optimized than handwritten C.
1
4
477
Theoric retweeted
Lean 4 is the ultimate "glue language".
1
7
278
Theoric retweeted
New Post: Introduction to Domain Driven Development in Lean Domain driven development is defining a program purely in the language of its domain. DDD can eliminate large classes of errors which occur because drift between application boundaries.
8
7
3
101
7,861
Theoric retweeted
Introducing LeanAPI v0.1, an api server for your applications written in Lean 4. Think of it as Express/FastAPI equivalent. Includes all the usual stuff, routing, middlewares, auth and headers. Enjoy! github.com/theoriclabs/leana…
2
2
27
1,421
Theoric retweeted
The software of future will be bug free!
I used Opus 5.5 to formally verify the Claude Agent SDK using Lean. A couple short prompts = 16 PRs fixing various bugs and race conditions. Video attached. TLA+ also works well. I sometimes combine Lean and TLA+ to look for issues around data flow, concurrency, and state mgmt. I don't know either language well, but Claude is excellent at both. This approach is super useful for formally modeling your code and finding bugs that a human probably wouldn't have spotted. Is formal verification the future of coding (or at least, bug finding)?
1
4
840
Theoric retweeted
Introducing LeanChess v0.1. An online chess software fully written in Lean. You can play a game on Leanchess right now, go to: leanchess.org/ GitHub: github.com/theoriclabs/leanc… Stay tuned for posts on what makes LeanChess interesting, and why should you care.
2
12
718
Theoric retweeted
The software of future will be bug free.
It’s possible to write bug free code. In ~2 years it’ll be impossible not to.
1
6
501
Theoric retweeted
Introducing LeanHTTP, a HTTP client for Lean 4.
4
2
1
51
2,833
Theoric retweeted
Introducing LeanReact, a framework to write React components in Lean. In the early experience, we saw that LeanReact leads to simpler and more composable components.
7
9
3
71
4,040
Theoric retweeted
Can a theorem prover make database and application code interaction safer? I built LeanDB to explore that question: typed queries, validated data, and typed migrations in Lean.
15
33
4
364
31,120
Theoric retweeted
At Theoric we believe software should be fast and bug free. As part of the mandate, we are rewriting existing existing GPU software in Lean 4, and rewrote TinyGrad in Lean 4, and, it is faster! Why it matters, because this means we can take existing software, rewrite it's core in Lean, and make it better!
2
1
11
1,370