Hacker News new | ask | show | jobs
by jkhdigital 14 days ago
Yeah I’m wondering how on Earth a single conjecture can require 17 million lines of code to prove, but if it involved building up an entire ecosystem of theorems that had not yet been formalized then I suppose it makes sense.
8 comments

> ...if it involved building up an entire ecosystem of theorems that had not yet been formalized then I suppose it makes sense.

This is pretty much it. Pre LLMs very little maths had been formally verified and a lot of it relied on proofs from humans convincing other humans, and issues did arise which would occasionally mean chunks of maths we previously thought were true had to be reconsidered.

Proving something in lean probably involves writing a lot of proofs for new areas, and the formal proofs are usually significantly more verbose than a human proof where a lot is often left for the reader.

Out of interest, which maths needed to be reconsidered as a result of attempted lean proofs failing?
I believe they were talking about humans correcting human proofs pre-LLMs enabling us to define things in Lean at a useful scale.

But, to your question, I don't think any important error findings due to Lean have been unrepairable yet (for some definition of important). So far the ones which have really failed to be patched or been plain incorrect conclusions have, thankfully, had a very small blast radius.

> issues did arise which would occasionally mean chunks of maths we previously thought were true had to be reconsidered

Examples?

The four colour theorem is a nice example. There was an early proof from Alfred Kempe which stood for 10 years until a flaw was found. [1] It was later proved using a different technique, so the status of the theorem went roughly

undecided -> 'proven' -> undecided -> proven

[1] https://en.wikipedia.org/wiki/Four_color_theorem#Early_proof...

I wouldn't say that's "chunks of maths we previously thought were true had to be reconsidered".
Yes, it's a nice small example to illustrate the point. Perhaps "chunks" was overstating it a bit, fortunately it's unusual to build lots of new maths on an unstable foundation, but finding problems in proofs is somewhat common.
ask Terrence Howard
https://youtu.be/fS68pXbzy7U

For the uninitiated

Our legal systems across the planet desperately need this.
Laws are supposed to be applied (by judges, bureaucrats, etc) with discretion and common sense, not mechanically. Of course, that can sometimes result in injustices – exceptions being made for some people not others for reasons of political or societal biases – but it also avoids a lot of injustices: thoughtless/mechanical application of the law can result in outcomes which the legislator never intended and few would consider just or fair or reasonable.

I think, if we actually started applying laws in such a mechanical way, we'd end up with laws changing a lot more frequently, and with a lot more special cases written in to them – now, if applying a law in a certain situation seems unreasonable, judges will often choose not to apply it; with mechanical application, they'd have no choice, and then the people negatively impacted would lobby the legislature for a change in the legal text, and they'd probably get it. It could also see increased use of executive clemency (the power of pardon), or its legislative equivalent (legislation retroactively declaring certain convictions null and void).

It wouldn't be about replacing judges and judgement with computers, but about having laws that are clear and minimally ambiguous as a starting point.

Laws can't even consistently get "and" and "or" right.

Again, I think you are missing the point that many instances the ambiguity in law is entirely intentional and by design, either with the intent to defer these ambiguous cases to the discretion of judges / admin agencies or as a part of political compromises or because those exact ambiguous/edge cases can't be agreed upon, or with the intent of future proofing. The specific example you gave is potentially exemplary. Don't assume that there aren't any lawmakers that have not taken a formal logic course

So the clarity you are proposing would in many instances have rather brutal and likely unintended impacts if broadly applied.

Not to mention that rewriting that verbiage probably wouldn't even have the intended effect as the semantics may already be determined by years of caselaw. But regardless, the dominating factor here is that the ambiguity is (usually or at least very often) baked in and that is in part meant as a stopgap against the particular kinds of injustices that arise when laws are applied purely procedurally without regard for the situational reality

See also Chesterton's Fence

Ambiguous "and" versus "or" is not future proofing and causes nothing but pain.

If they actually couldn't decide on such a thing, they would need to suck it up and do their job. Your idea of brutal consequences is ridiculous in a situation like that.

And as I said before you can still have ambiguity and discretion with a good formal wording. But it's clearer where it is.

"law can result in outcomes which the legislator never intended"

But what has always baffled me, AFAIK, the original legislators don't file Amicus Briefs when the meaning of laws are argued in court. I mean in situations where the original legislator is still alive and of good mind, why doesn't the Judge just ask them what the spirt of the law is?

> But what has always baffled me, AFAIK, the original legislators don't file Amicus Briefs when the meaning of laws are argued in court. I mean in situations where the original legislator is still alive and of good mind, why doesn't the Judge just ask them what the spirt of the law is?

In a parliamentary system such as the UK, Canada or Australia, this tends to be less of an issue – the executive government is under the direct control of the legislature, so if the Attorney-General or Solicitor-General submits a brief arguing for a particular interpretation of legislation, the current legislative majority (which might not necessarily be the majority which enacted that legislation to begin with) can be understood as effectively endorsing it.

In a presidential system such as the US, where there is a strong separation between the executive and legislative branches, legislator amicus briefs make somewhat more sense – and members of US Congress submitting amicus briefs to appellate courts actually does happen reasonably frequently; however, the courts tend not to put much weight on them.

The parliament as a whole holds legislative powers, not just the person who wrote the proposal for the act. That's the actual interpretation that matters.
Of course, but still perplexing from a pragmatic perspective.
It's going to be fun when legal systems are analyzed by LLMs. The chances that hundreds of thousands (millions?) of laws and regulations written by legislators, judges and bureaucrats over hundreds of years are self consistent and contain no internal contradictions is very, very, very close to zero.
Laws aren't supposed to be strict logical statements that contain no internal contradictions. Laws are intended to be interpreted by judges for a reason.
Why would contradictions be beneficial though? Seems to me like they're harmless at best, and more likely they'd be harmful.
> Why would contradictions be beneficial though?

It benefits the police to have a population composed of people who are breaking the law, even unknowingly, since that means any inhumane action by police is still "fighting criminals".

On the other hand police unions have obtained "qualified immunity" which means ignorance of the law is a defense for police.

Which is itself a demonstration of how contradictions can be beneficial.

Contradictions that actually matter can be dealt with through the legal process. Contraditions that don't matter, don't matter.

It isn't necessary to have law be defined as strictly as a mathematical proof or a statement of formal logic because we have human beings interpreting those laws who understand things like context and precedent, to allow for fairness and mercy when necessary, and to be able to handle edge cases.

We want humans to create, debate and interpret laws rather than machines because we value humans more than machines.

Not at all. What an anti pattern that would be.
Lawmakers often make laws and regulations that aren't consistent with existing body of law, but it's sometimes hard to see (esp. if they're doing a tight schedule, like having a 500-page document dropped in their lap over the weekend).

Having a way to say "here, this new bill you're proposing is provably in conflict with those three" would maaaybe nudge some people to take a second look or raise concerns?

It would also be nice at the judiciary appelate level if you could ask "does this particular finding conflict with law" directly as opposed to "do you, judge, as a fallable human being, agree with this/these other judge/s" in a turtles all the way down to the supreme court which is just a group of fallable humans rather than an individual.
> It would also be nice at the judiciary appelate level if you could ask "does this particular finding conflict with law" directly

That wouldn't get you very far. The answer is almost always "yes".

Leading to the worst trolley problem outcomes.

"Yes, you avoided running over a family, but you crossed over the yellow line, didn't signal properly, that also counts as reckless driving and a number of other violations. You'll be fined thousands of dollars, your license taken, and you'll spend one week in jail"

"I guess next time I'll run them over"

Why would it lead to that? There are many structural errors, inconsistent terms, unintended gaps. Fixing them doesn’t mean that judges will be less flexible in circumstances where the law was supposed to rely on their judgment.

We are talking about people seriously arguing over how to interpret a comma, or the lack thereof [1], or claiming that obstructing guards outside a military base is a crime, while doing it inside the base is completely legal [2].

[1] O'Connor v. Oakhurst Dairy (1st Cir. 2017)

[2] Adler v. George [1964] 2 QB 7

You could probably use AI to reform legal systems but it's very different from mathematical proofs, being fundamentally about human behaviour.
Imagine the volume of exploits we have in software, but in the law. It’s happening in the law world, just slower and we barely hear about it here on HN.

It’s going to be a proper mess before it gets better.

The proof has also been built in parallel, so it's possible to mechanically shrink it a lot. Some equivalent lemmas have been proven more than a hundred times independently because different agents needed them.
I can confirm that agents often re-implement logic that I already have in my libraries.
Do the agents have access to your libraries and is ignoring it? Or it doesn't have access and is doing some "clean room" wasteful duplication?
I mapped the 175k files by imports into 2,647 clusters in 63 themes: https://riemannhypothesissolved.com

The main theorem's cluster directly imports only three others: a zero-free region, primes in progressions and Mertens-type zero sums. Most of the code sits 3–5 import steps below those, and no theme is more than about 4% of the code.

(I made the map. Cluster names are written by Claude from code samples, so they can be wrong.)

this is cool! Not sure this is up your alley, but I built a tool so anyone can run the lean proof at home, and there's a global leaderboard like SETI@home

Come join! Maybe I can integrate some of your visualization into our map.

https://riemann-at-home.github.io/riemann-at-home/

Nice! Working on improving the visualization first, esp. for mobile, and adding modes for viewers of different levels
Great! I added mobile support to the Riemann@home page too.
Nice, will explore these!
One of the biggest things that I've learned with agentic coding is that the idea that the best or most robust solution is necessarily simple and elegant is simply false. Sometimes the right solution is extremely complex.
Interesting website!
Thanks!
I can imagine that this is the equivalent of the Principia Mathematica of modern times.
Anyone who has taken a coffee break during vibe coding will be familiar with the perils of unsupervised universe reinvention.
I don’t know about anyone else, but I’m yet to come back from a coffee break and find my agent has solved a millennium math problem. I guess there’s always P vs NP?
> I guess there’s always P vs NP?

This seems inevitable now. Would not be surprised if we hear about it within weeks at the rate things are going.

> I don’t know about anyone else, but I’m yet to come back from a coffee break and find my agent has solved a millennium math problem.

Have you tried asking it to?

I guess its the same way a trivial statically compiled hello world gui app might take many megabytes after pulling in all the libraries.
it doesnt. a cursory pass suggests 3-9 million of these LOC are duplicate or dead on the low end. it'll probably be faster to remove the dead code than to run it end to end in its current state against everything.
I didn't check but I'm a bit skeptical, I'd struggle to believe that they wouldn't have done at least a surface clean-up of the code before publishing this massive breakthrough. Dead code is the lowest-hanging of fruits, hard to believe they wouldn't have bothered to prompt an agent "remove dead code".
i mean its up you can take a look:

https://github.com/leanprover-community/riemann-hypothesis

i dont think dead/unused/duplicated code matters as much as "does it lean?" so waiting around to pretty up the codebase would probably draw some ire. i mean, whether its 7 million lines or 17 million, who's really gonna read it?

raises hand

7 million would mean it is substantially shorter than the FLT formalization, and even within that a lot of it is proofs of existing mainstream theory that were translated to lean or basically copied from the algebraic stacks project formalization. There's probably a reasonably short and beautiful proof hidden in there if you refactor it to use theory and be pretty

> Yeah I’m wondering how on Earth a single conjecture can require 17 million lines of code to prove,

It's 100% slop and bullshit.

If you've ever done simpler math with an AI you know what I mean.

A proof is a proof. Simplification is left as an exercise.
It's not a proof, it's 17 million lines of code that might (or might not) compile to a proof.

You just have to trust the vibes that it's a proof.

Trusting LEAN isn’t “trust the vibes”.
Yes it is, because Lean is just a piece of software like any other, and no software is proven mathematically.
“not proven mathematically” is quite a leap from “just trusting vibes”.

there is a huge area of quality in between, and there are multiple independent implementations of LEAN that all confirm the RH proof.

it sounds like if LEAN was proven to be correct using something like Coq you’d still make the argument “but Coq is just a piece of software like any other”.