by still_grokking · 2w ago · 0 comments
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.
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.
And how do you proof anything here? You need a system which tells you about properties of the named entities.
It was always the type checker which gave you the feedback whether something is sound or not, in any programming language.
In a more rigid one it not only says whether something is more or less OK, it proves it free of contradictions.
This is very intuitive, even if you never heard about the Curry-Howard correspondence (which you anyway definitively should in case you do any formal logic, a prerequisite to create formal proofs).