upvote
Lean syntax is alright. You can get used to it. The hardcore part is the jargon.

> Scaled Hecke operators repair divisibility at inert primes pairing tops

Literally every word here has a precise definition. Probability takes forever to get an intuition for all of that. But that's always the problem with math.

reply
I'd say the hardcore part is the complex concepts that are compactly described with the jargon.
reply
applies to any topic of any field, but yes
reply
For me, the hardcore parts are the impenetrable `simp`s and `grind`s. Of course, source code is not the best way to view lean proofs.
reply
Claude's writing style still comes through. In a nine word sentence where most of it is technical terms. I don't even know how to rewrite it but I can still notice it's the same ultra-condensed writing as all the docs on vibe coded GTA 6 projects.
reply
Most of the hard-to-grok code there is proof bodies rather than theorem statements. Assuming you can parse the statements, you can follow the proof pretty loosely and reconstruct it yourself. Such is the tradition in math generally

Plus, these proofs are actually quite tame compared to human-written Lean proofs.

> How realistic is it for a human to read this code, 'grok' it and verify that it is correct ?

You don't need to verify any of this, but for the final theorem statements. That's the point of formal methods.

reply
> verify that it is correct

To be clear, it is not a human who verifies it's correct.

Lean does that.

Humans just have to verify that the statement of the theorem is accurate, and that it is rooted in mathlib.

reply
This is just programming

To properly understand a proof you need to run it interactively (or at least I do), which is kind of running in a debugger

I mean the here's the gist of what takes to understand a proof

To prove a theorem in Lean (or similar theorem provers; I'm actually more familiar with Rocq) you have goals, which are the things that are left to prove. The "main goal" is what you want to prove right now, and the other goals are other things you also need to prove

When the list of goals becomes empty, you have proved the theorem. You start with a single goal: the theorem itself

It proceeds like a game. Depending on what the main goal looks like, you can eliminate it calling some piece of code (there's more to it but let's say it's a tactic). But more often than not, eliminating a complex goal just pushes more, hopefully simpler goals into the goal list. So you need to be, well, strategic in what tactics you employ - you need to go into the direction of making things easier to prove, not harder

So what looks like to run a proof interactively? You can go through the proof step by step, all the while you observe how the goal list changes. That's analogous to run a C program in a debugger, watching the local variables of each stack frame

Ok so that's how you (or at least I would) understand a proof - run it interactively, which is like watching a professor write down each step of the proof in a white board, all the while she carefully keeps track of what's left to prove

But anyway. The innovative thing about theorem provers in general is that to verify a proof you run a program (a kernel) which is just a trusted type checker. Unfortunately the official kernel is written in C++ and agents found bugs before (that made the kernel accept theorems that were false). However, there's multiple kernels, so if all of them type checks the proof (and the proof doesn't contain stuff like "sorry", which means it's not proved at all), there's a high confidence in the result

reply
Thanks, useful explanation!
reply
In the before times you could have made a big fuss if you made a tool to convert js to typescript in this way.

Alas we’re about to stop caring about programming languages at all.

reply
Just for your reference. you linked to the compact version

https://github.com/lsernau/grh-lean/blob/main/grh/src/New/Up...

This is the non-compact 'Human Readable' version. Still pretty intense!

reply
Besides this being the compact version, a decent chunk of it (typically everything after the first `by` in each declaration) is proof tactics, which are not really needed to verify that it's correct because they're mechanically checked by the compiler.
reply
For me, this is more readable than many "human-language" paper proofs.
reply
I don't understand the math or logic here, but the syntax is not half bad.
reply
The grh-compact version is not very readable (it is deliberately minimized), I'd read the 300kloc version in the grh folder instead, which looks fairly clean to me.
reply
Code in the sciences often looks like that. You have to have domain-specific knowledge to read it and there's no escaping that.

>How realistic is it for a human to read this code, 'grok' it and verify that it is correct ?

Data presented this way isn't simply read and understood, it often has to be studied.

reply
This is nearly as ugly as ABAP, only misses the comments in German

Something that I wonder where is the "eureka" part of this proof, or perhaps the top 10 "eureka" moments.

reply