Beyond Booleans
7 days ago
- #Type Theory
- #Lean
- #Proofs
- Logical expressions in TypeScript and most languages have a Boolean type with values true and false.
- Lean treats logical propositions like 2 + 2 = 4 as values of type Prop, not Booleans.
- In Lean, proving a proposition means producing a value of its type, where the proof is a value of that proposition's type.
- Lean's type system allows propositions to act as types, and proofs as values of those types.
- Proof irrelevance in Lean means all proofs of the same proposition are considered equal.
- Lean enables typed truthfulness, where facts like 'x is between 0 and 1' can be encoded in types and verified at compile time.
- Lean's proof composition allows combining existing proofs and axioms to derive new conclusions.
- Lean's Eq type and Eq.refl constructor ensure that only valid equalities can be proven.
- Lean's approach bridges mathematics and programming by encoding logical proofs as typed values.