r/mathmemes • cartesian closed category • 8d ago • Bravo 1

Formal Logic Average conversation involving Lean

Post image
1.5k Upvotes

126 comments sorted by

•

u/AutoModerator 8d ago

Check out our new Discord server! https://discord.gg/e7EKRZq3dG

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

190

u/walmartgoon Irrational 8d ago

Of course I know what lean is. I worked at Pizza Hut for 3 years

22

u/omegafixedpoint cartesian closed category 8d ago

lol

10

u/jackalopeswild 8d ago

Next, may I suggest spending a few nights at a Holiday Inn Express to really level up your game?

107

u/Electrical-Ad1886 8d ago

a lean hobbyist whose not happy everyone knows what my favorite langauge is:
You guys are getting paid?

36

u/omegafixedpoint cartesian closed category 8d ago

lean is also my favorite language. perhaps the greatest language ever made in my opinion. the curry howard isomoprhism is my religion.

2

u/SakishimaHabu 7d ago

As would be expected with someone that has a lattice theory reference in their name.

3

u/omegafixedpoint cartesian closed category 7d ago

it is actually a reference to the omega combinator (λx.x x)(λx.x x) = ....

thank you for noticing

1

u/Valuable_Leopard_799 7d ago

perhaps the greatest language ever made in my opinion That is a staggeringly brave phrase to utter. Even if it's just as an opinion.

295

u/viktor8378 8d ago

"the proof is slop" "no it isnt" "are you a mathematician?" "no" "me either"

71

u/SSNFUL 8d ago

This is how I feel every day in this subreddit. I couldn't even understand the memes before this AI controversy, but I still try every time lmao

6

u/INFLATABLE_CUCUMBER Completed math undergrad degree 8d ago

I gather that most of the people here are those that completed or are completing their undergrad math degrees. Some here are likely even minors, or people that completed multivariable calc and believe they’re “part of the club” lol

-13

u/shewel_item Science 8d ago edited 8d ago

The 'hypothetical' 250k page proof is "slop" by the author's own admission. Lean formalization isn't proof; 🤦 it's program/formal verification. my 2 hot cents, basically

edit: for those obsessed with 'humoring' the OP - 'not wrong' ya'll - shit is called proof assistant for a reason.

17

u/godeling 8d ago

Formal verification is proof verification. This is a consequence of the Curry-Howard correspondence. Please if you’re going to criticize proof assistants learn what they are and how they work first.

-9

u/shewel_item Science 8d ago

Calling a proof assistant a proof assistant is not a criticism. Not all programs like lean - which is not just a language - can be verified.

And, claiming that people do not know how lean works is a shitty (forced) way to shut down much needed discussion.

5

u/godeling 8d ago edited 8d ago

Calling a proof assistant a proof assistant is not a criticism.

You seem to be trying to claim something about proof assistants from their name. The name “proof assistant” is not meant to say that they do not verify proofs, rather it is meant to communicate that they do more than merely verify proofs. For example, proof assistants have something called “tactics”, which can help prove theorems mechanically, rather than requiring every part of the proof to be written out explicitly.

Not all programs like lean - which is not just a language - can be verified.

Not sure what you’re getting at here. Are you saying Lean itself cannot be verified? It can, by utilizing another proof assistant. The situation is analogous to how the axioms of set theory cannot be proven, but we can model set theory in some other theory like type theory or category theory. Or maybe you’re making the more general claim that arbitrary programs cannot be verified? This is true; the theories that proof assistants use, when interpreted as programming languages, are not Turing-complete. But in practice this is not really an issue. In any case I’m not really sure how this is actually relevant to what’s being discussed.

Edit: I said that some programs cannot be verified. This is not quite correct. It’s true that proof assistants don’t provide Turing-complete programming languages, but this merely means that not every program can be written in the proof assistant’s language. In fact, you can model the programming language in the proof assistant as a piece of data rather than translating it directly into the proof assistant’s language, and then prove properties of its programs by proving things about the model. (For instance, you can encode the programming language’s syntax tree and its operational semantics, and then prove things about these.)

-2

u/shewel_item Science 8d ago

Are you saying Lean itself cannot be verified?

I'm saying you invoking curry-howard is bs

4

u/godeling 8d ago

I’m sorry but this statement alone doesn’t really clarify anything to me

7

u/viktor8378 8d ago

are you a mathematician

-7

u/shewel_item Science 8d ago

fuck off with your 26 day old account

9

u/fisstech15 8d ago

This dialog is great example of the OP

-1

u/shewel_item Science 8d ago

'Lean' was one of the motives to developing AI. That's part of the point I was raising in response to the OP. It was and is a more philosophical issue I've been involved in for almost a decade now, after reviewing Kevin Buzzard's work.

7

u/viktor8378 8d ago

you were supposed to say "no" then i was gonna say "me either" :(

-2

u/shewel_item Science 8d ago

**me neither

49

u/Good_Bit_777 8d ago

Lean is like meat but less fatty

7

u/NimbleCentipod 8d ago

Less flavor

22

u/slicehyperfunk Transcendental 8d ago

I didn't know you needed so much promethazine and codeine syrup to do math in the modern era, honestly.

6

u/jhomas__tefferson 8d ago

I wonder if the creators of the language ever realized 😂

38

u/FernandoMM1220 8d ago

imagine how readable a human proof would have been lol

24

u/Any_Mode6525 Measuring 8d ago

I mean we got one the same day! It was 700 pages and a critical gap was filled with “TODO: Finish”, essentially.

18

u/banana_buddy Economics/Finance 8d ago

There's a 300 page human readable proof that was AI generated. And by human readable I mean at least the CEO of math is able to read it.

13

u/Mobile-Job-2587 8d ago

Its when you exercise a lot and get all skinny

4

u/Clichedfoil 8d ago

I wanna get into lean

4

u/Mobile-Job-2587 8d ago

so am I :(

9

u/logbybolb 8d ago

it's so funny knowing that the type theory named the Calculus of Inductive Constructions, in a roundabout way, is a component of the biggest change of math in the 21st century, and yet 99.99% of people can't tell you the first thing about it

1

u/ary31415 8d ago

Is that different from the lambda calculus?

2

u/mgomezch 5d ago

yes but they connect in a delightful way that is IMO the most beautiful abstract discovery in the history of the human intellect

1

u/crahs8 5d ago

Very much so. First of all, lambda calculus is not a type theory

1

u/MorganEarlJones 5d ago

...is it anything like Homotopy Type Theory?

1

u/crahs8 5d ago

I'm not really an expert on type theory, so I don't know what the differences and similarities are.

8

u/rairiig 8d ago

But I thought lean was popularized by rappers a while ago

7

u/Legitimate_Handle_86 8d ago

leeeaaan 💜💜💜🟪🟪

2

u/rafaelRiv15 8d ago

That is how I feel about all this conversation. People are not even aware that there is a couple theorem provers in the wild like agda and rocq but they feel so confident about saying that if the proof compile it must mean that the proof is true. That is thinking theorem prover as an oracle. TBF, lean people are lunatic that do really think they have created an oracle

17

u/omegafixedpoint cartesian closed category 8d ago

the calculus of constructions has been formally proven to be consistent. lean is not an oracle. this is because it is semi-decidable. it can only tell you if a valid proof is valid, but it may hang on some invalid proofs and never tell you if it's right or wrong.

-1

u/rafaelRiv15 8d ago

We are on the same page

-2

u/PM_ME_MELTIE_TEARS Irrational 8d ago

Actual software implementation is not necessarily the same as the abstract one.

Are you implying there have been no kernel bugs and there will never be in the future?

10

u/AnswerGrand1878 8d ago

One of the lean checkers was formally proven down to the assembly code. Unless the people that did that lied, that specific kernel does not have soundness bugs

-6

u/PM_ME_MELTIE_TEARS Irrational 8d ago

Was that before or after the kernel bug was found? Who verified the correctness of the lean checker that verified upto assembly? Does every software change of the kernel guarantee a run of that lean checker? Who verified that test harness? Do you see where this is going?

(btw, heard of the pentium fdiv bug?).

But do pardon me if I don't respond further (nothing to do with what you said).

12

u/AnswerGrand1878 8d ago

There are multiple kernels, the formally proven one did not contain the kernel bug.

And, yes, 100% guarantees do not exist. But a lean formalization that compiles for a multitude of different lean checkers has survived significantly higher scrutiny than most human written papers.

7

u/btroycraft 8d ago

I think unless Lean can defeat Descartes's Evil Demon, it's effectively useless. 

/s

-1

u/KermitSnapper 8d ago

Computer engineering 101: if a bug was corrected (even though it shouldn't have been there), it's most likely another one was added.

7

u/AnswerGrand1878 8d ago

For the kernel that I was speaking about, this bug never existed. There are multiple lean checkers

-5

u/KermitSnapper 8d ago

Operating system You can just say operating system dude And no, that doesn't change things because that's about kernel difference, it doesn't have to do with just the code itself but also the arquitecture it's built on.

A bug that didn't exist? It just hasn't been found.

5

u/AnswerGrand1878 8d ago

This is untrue. Formal verification of programs is difficult but has a long standing tradition in areas where mistakes are super costly (e.g. aviation or banking software). There is definitely software that is bug free in some regards

→ More replies

9

u/bwmat 8d ago

No, 'kernel' does not refer to 'operating system kernel' in this context

21

u/Puzzleheaded_Web9584 8d ago

How does knowing agda and rocq have any connection to confidence on proof validity on compilation?

I would be very worried if lean was not an oracle that verified proofs on compilation, barring bugs.

2

u/Dogstar-Blazer2305 8d ago

I'm spending most of my time now in Grace17 (grace17.org) - like Lean, but based on ZFC set theory. We should have our new AI-discovered results formalized both in type theory and in set theory!

-4

u/rafaelRiv15 8d ago

It is more about pointing out that people like to talk about things that they have no understanding

4

u/bwmat 8d ago

But you said "they feel so confident about saying that if the proof compile it must mean that the proof is true", which makes it seem you think it's possible for a lean proof to compile without being 'true'?

I don't think that's the case, ignoring kernel bugs (witch is why you should check with multiple ideally) 

-2

u/rafaelRiv15 8d ago

It is not necessary that it can compile without being true but more that it can compile while pretty much stating nothing useful. What does lean do is type checking but it doesn't check if your code make sense

2

u/bwmat 8d ago

They have a way of determining that a lean proof proves a given lean statement, and they have a peer reviewed lean statement which is equivalent to the RH, and they showed the proof proves that statement, so that's the not the case in this instance

0

u/rafaelRiv15 8d ago

bruh, the proof is 17 millions line of code. It will take time to get peer reviewed. I salute the current effort which is pretty fun

3

u/bwmat 8d ago

But it doesn't need any additional peer review to ensure its validity, that's the point of lean

1

u/Difficult-Bad-3942 8d ago

Do u even know what lean is? That's not how maths work.

2

u/fghjconner 8d ago

But you don't need to review 17 million lines of code to know what it proved, you just need to review the one where it says "I'm proving the Riemann Hypothesis"

0

u/rafaelRiv15 8d ago

In other words, type checking improve considerably the likeness of a proof to be true but it doesn't make it automatically true

2

u/PattuX 8d ago

Going on a limb here, but I don't think you understand how lean works

1

u/rafaelRiv15 8d ago

Well, I've been playing with systems like lean for over a decade now and I program regularly in idris2 but you can surely challenge my assumptions. But please base your arguments on proof theory (https://en.wikipedia.org/wiki/Proof_theory_)

2

u/PattuX 8d ago

So I'm not 100% sure my assessment of idris2 is correct, but afaict idris2 is primarily a functional programming language. Lean is an interactive theorem prover that can also be used as a functional programming language.

They tackle different problems: idris2 is to build correct-by-construction software, whereas Lean is used to formalize mathematical proofs. There is some overlap in the use cases (e.g. verifying the correctness of an algorithm) but for proving mathematical theorems, Lean has an automated proof tactics whereas for Idris2 you have to manually construct all proofs, and at the end check for totality, axioms dependencies, as well as potential holes (similar to lean's sorry). All these checks you don't have to do in lean, which is why the lean community is very certain the GRH proof is correct.

1

u/rafaelRiv15 8d ago

You are correct about this. Idris1 had tactics but this feature is gone in idris2. I am currious about automated proof tactics. Idris2 has the auto keyword where it tell the compiler to look for a proof. I need to go back to David Thrane Christiansen lean book.

1

u/Difficult-Bad-3942 8d ago

Bro, u play league of legends, what do u even know about how lean works.

2

u/PattuX 8d ago

My bad, didn't know these two are incompatible. I'll hand back my PhD in formal verification immediately.

1

u/Difficult-Bad-3942 8d ago

Sometimes I'm like wondering, who am I even arguing with, because for some reason these people clearly don't understand what Lean is, and don't know it's similar to software, passing compilation test does not mean it works to business requirements. Like there's so much people that just for some reason hate people with actual jobs and contributing to society meaningfully while they sit on reddit and shit talk people with actual professions and how their job are going to be rendered obsolete.

2

u/djingo_dango 7d ago

You’re one of these people

4

u/Sufficient-Pear-4496 8d ago

If it compiles, then yeah, more than likely true lol

4

u/godeling 8d ago

This is not what an oracle is. You give an oracle a proposition, and it tells you whether it is true or false. Proof assistants do not work like this. You give the proof assistant not just a proposition, but also a proof of that proposition, and the proof assistant will check whether it really is a proof of that proposition. How this works has been well-described for a very long time, long before computers. You can do it by hand if you learn how natural deduction or sequent calculus and the like work.

1

u/rafaelRiv15 8d ago

I was specifically referring about the dominant discourse and not about how things actually work. And if I talk about oracle is because lean is involved with people like this : https://www.quantabooks.org/books/the-proof-in-the-code/

 Although Lean was originally conceived of as a code-checking program, a small group of mathematicians recognized its potential to become something far more powerful: the “truth oracle” that thinkers have sought for centuries, a tool to definitively verify or refute any mathematical or logical assertion, no matter how complex

The simons fondation is behind this initiative and lean is getting money from the simons fondation

2

u/godeling 8d ago

You’re right to criticize this claim but you did say “[…] they feel so confident that if the proof compile it must mean that the proof is true. That is thinking theorem prover as an oracle.” This statement is false. That is not what an oracle is, and we can indeed prove that if the code compiles then the corresponding proof is correct, assuming the proof assistant does not have any bugs.

1

u/Serious_Bite_7613 8d ago

Out of curiosity, do you think the RH proof is correct?

1

u/rafaelRiv15 8d ago

I don't know but I've been following the progress in the lean zulip and in the officiel lean rh github which have been a pretty good experience so far. I think it is way to early to conclude anything

3

u/PattuX 8d ago

Basically everyone in the lean community agrees the proof is correct. If you followed the community, why are you still doubtful?

1

u/Serious_Bite_7613 8d ago

Have you seen the sub 300 page proof? I noped out of it, my math skill caps out around undergrad level, but it looks like a more manageable starting point.

1

u/rafaelRiv15 8d ago

no not yet. That may be my thanksgiving

4

u/LubberDubDub 8d ago

You idiot, you don’t even know what lean is.

>> alright explain it to me

No

4

u/schizothroaway1 8d ago

So, we're doing drugs now?

4

u/Sad-Pattern-1269 8d ago

Its a tasty purple drink

2

u/pos_vibes_only 7d ago

Helps with math too. I finally understand Terrence Howard’s publications

1

u/-lRexl- 7d ago

Lmao

3

u/TobyWasBestSpiderMan 8d ago

My math PhD friend explained it to me last night, it’s basically all computers

3

u/MetroidvaniaListsGuy 7d ago

What a horrible name for a programming language...

4

u/No_Name_101 7d ago

PURPLE DRANK LEANNN

3

u/EebstertheGreat 8d ago

This reminds me of an old badmathematics comment responding to a ridiculous, vapid web page with a question and answer format full of "math trivia" to "impress your friends." This is the relevant part of the comment (quoting the page):

What is the smallest perfect number?

Six

I find it amusing to imagine someone walking up to their friend, repeating this fact verbatim, having the friend ask "what's a perfect number," and having absolutely no response

Something about this image sticks in my mind.

5

u/Clear_Cranberry_989 8d ago

Lean is law.

6

u/trimski- 8d ago

Lean is love.

8

u/LubberDubDub 8d ago

Live laugh Lean

2

u/psychicesp 8d ago

I do owe my knowing of what Lean is to AI proofs

4

u/P0t4t0W4rri0r 8d ago

I liked lean before it was cool

2

u/jhomas__tefferson 8d ago

I knew about it vaguely because I was a math major for like a year before Covid lol… went into literature for therapy but now since no jobs here I’m going back to school hopefully next year for something else idk yet

2

u/Joyeuse666 8d ago

Nietzsche speaks of this

1

u/Bobing2b 4d ago

No he didn't

1

u/moschles 8d ago

Youtube

/watch?v=prYaTrZUces

1

u/epsilon1856 8d ago

Ask Lil Wayne

1

u/WhatADunderfulWorld 8d ago

GLP1 it. So lean.

1

u/Grzechoooo 8d ago

It's the thing we go to Poland for.

2

u/[deleted] 8d ago

[removed] — view removed comment

3

u/bwmat 8d ago

It's too bad they thought to check for that