logoalt Hacker News

still_grokking • yesterday at 4:46 AM • 2 replies • view on HN

It's the most natural thing possible to encode math in a programming language like LEAN.

Because logical propositions are types (in such a language). That's just a very fundamental part of math itself.

Watch this and you'll be enlightened:

https://www.youtube.com/watch?v=IOiZatlZtGU

LEAN code looks actually exactly like you propose; it supports most conventional (Unicode-linearizable) math notation, and you just write expressions like in any other functional language. Close to the textbook, but more verbose and stiff as it's a formal language, while math notation isn't.


Replies

dnautics • yesterday at 7:22 PM

> It's the most natural thing possible

It's not intuitive. In isolation, if you took practical computer science and got a theoretical math background and didn't know about curry-howard correspondence, you would not intuitively figure out that propositions are types and proofs are terms. I would have guessed that propositions are functions, sets/classes are types, and elements are terms.

NonHyloMorph • yesterday at 10:15 AM

That lack of relative verbosity and stiffness of mathnotation (what a thing to say haha) to be considered as a proper strength evtly. I'm consider myself as layity in this, but is an interface thinkable?