The analogy is useful, but the key boundary is proof checking: Lean's kernel checks proof terms against propositions; TypeScript's type checker does not provide that kind of proof guarantee.
I've started using discriminated unions for React props in my SaaS stack to catch these kinds of runtime errors early. It saved me a headache last week when a missing field was causing silent failures.
2
u/adriano-1370 12d ago
The analogy is useful, but the key boundary is proof checking: Lean's kernel checks proof terms against propositions; TypeScript's type checker does not provide that kind of proof guarantee.
1
u/saastryde 7d ago
I've started using discriminated unions for React props in my SaaS stack to catch these kinds of runtime errors early. It saved me a headache last week when a missing field was causing silent failures.