Weeknotes 2026-W46 › Project Pterodactyl: András Kovács on why stable elaboration matters [0LY8]

It is easy to point out all the flaws in existing production implementations of dependent type theory, like Lean, Rocq, Agda, etc., but people often want to understand how these flaws map onto actual bizarre user-visible behaviour. András Kovács, who joined the Project Pterodactyl team this year, made a great post detailing a few examples of bizarre and obviously wrong (but not unsound) behaviour that demonstrates the need for a cultured approach to elaboration. Here’s a good example of borked elaboration of implicit functions in Lean:

def pair {A : Type i} (a : A) {B : Type j} (b : B) : Prod A B := 
  Prod.mk a b

def myPair : Prod ({A : Type} -> A -> A) Nat := 
  pair id 0

Under stable elaboration the above would succeed; because Lean commits too early to an (erroneous) solution, the result is a type error. Lean is not alone in this misbehaviour: to my knowledge, all production implementations of dependent type theory with implicit function types have this problem. András Kovács has a first-principles solution that will rule out not only this but many other instances of type-checking misbehaviour.

Let me add a personal note: a lot of the popular focus in the theorem proving world has been on ensuring soundness, because Lean (and not only Lean!) has been historically so deeply unsound and is yet being used as evidence for scientific claims. However, the problems I’m referring to in the context of stable elaboration are not a priori soundness issues. They are rather UX papercuts that undermine the ability of users to develop an intuition that tells apart the code that will likely work from the code that will likely not work.

Because soundness is not difficult to achieve today if you actually know what you are doing, it is rather on these type theory UX issues that we are having to spend most of our brainpower in Project Pterodactyl. I am really, really excited for the delightful language and tool of thought that Pterodactyl will become once it is ready.