
TL;DR
A bug in Lean, a formal proof assistant, allowed for a nonsensical 'proof' of Fermat's Last Theorem, highlighting a critical issue in string handling. The Lean team quickly addressed the bug, demonstrating efficient problem resolution.
✦ Why It Matters
Review your code for similar string handling issues to avoid logical contradictions.
Key Takeaways
How It Works
The bug in Lean arises from a discrepancy between its logical definition and compiled native code for string extraction. When attempting to extract a slice from an extremely large position, the logical definition returns an empty string, while the compiled code returns the entire string.
This inconsistency creates a contradiction, allowing Lean to 'prove' that an empty string equals a non-empty string, thus enabling nonsensical proofs.
Related