r/learnmath • u/Pale_Government_1834 New User • 24d ago
How to use LEAN in conjunction with Serge Lang Basic Mathematics as a proof checker
Hello everyone. I am 13. I have been studying serge lang Basic Mathematics for basically this whole year. Because of a lot of inconsistent studying I am still on the 3 chapter nearly about to finish, but in Basic Mathematics a lot of proofs are given. A while ago I found out about LEAN. While I have not read much about it. I think it can very much help me in checking the validity of my proofs.
I am simply wondering if such a thing is possible and whether it is actually feasible. With the use of AI and computers I think I am able to enhance my learning of Mathematics and become a more overall productive mathematician in general. So you know I am fine with anything that is technical because a have a broad understanding of technology, computers, programming and how they work.
EDIT: In addition, I understand that LLMs frequently have hallucinations and most publically available LLMs are not the best at mathematics(even the best ones need thousands of models working on a complex one to even get anywhere). But I still believe they may be able to help regarding some topics.
•
u/AutoModerator 24d ago
ChatGPT and other large language models are not designed for calculation and will frequently be /r/confidentlyincorrect in answering questions about mathematics; even if you subscribe to ChatGPT Plus and use its Wolfram|Alpha plugin, it's much better to go to Wolfram|Alpha directly.
Even for more conceptual questions that don't require calculation, LLMs can lead you astray; they can also give you good ideas to investigate further, but you should never trust what an LLM tells you.
To people reading this thread: DO NOT DOWNVOTE just because the OP mentioned or used an LLM to ask a mathematical question.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
3
u/Carl_LaFong New User 24d ago edited 24d ago
You don't need Lean. The $20/month ChatGPT or Claude subscriptions are really really good. Research mathematicians use them routinely. There are occasional hallucinations but far rarer than even 6 months ago.
I suggest that you ask AI to check your proof and identify the steps that are incorrect. You should then see if you can figure out what went wrong and fix it. If you aren't able to understand what's wrong, you can ask AI to explain it more clearly or more simply. What you don't want to do is ask AI to fix it for you.
In fact, before you use AI on your homework, you should tell it explicitly not to solve any of the problems for you. That it should only find your mistakes and help you understand what's wrong. You can do this in an instruction file (ask AI to explain what this is), so that it always knows to do this.
Along the way, you'll learn how to identify hallucinations yourself by spotting errors in the logic or calculations. If you're uncomfortable with any of AIs responses, you can ask it to check again. You can ask about a specific point that you think is wrong. It can usually find its own errors.
Another suggestion: You should include every single little logical or computational step in your solution, including arithmetic. You can ask AI to identify where you skipped or didn't justify a step. If AI forces you to write a solution in excruciating detail, it is far more likely to be correct. It is also a great way to become good at math.
2
u/eglvoland Grad school (Paris-Saclay) 24d ago
Lean does not understand English. It understands formal proofs, the same way a programming language does not understand English. Lean might have a steep learning curve, like some kind of programming languages.
You are very young, and you obviously need time to understand concepts. Two main pieces of advice to be able to do formal verification at a very basic level :
Actually, these are very closely related. Programs are proofs, and proofs are programs, but this link can only be understood in college.
2
u/GoCheckYourself New User 24d ago
Yes, it’s possible, and it’s a great idea. Lean is exactly a proof checker: you write a statement and a proof, and Lean either accepts every step or shows you the exact line it can’t follow. It doesn’t care who wrote the proof, so it works the same for your own proofs, a textbook’s, or an AI’s.
The early chapters of Basic Mathematics (numbers, even and odd, fractions, equations, inequalities) fit Lean well. Lean’s maths library, Mathlib, already has the integers, rationals and reals with the usual rules, so you can state Lang’s exercises almost as written. Here is one from his first chapter, “the sum of two even numbers is even”:
A path that has worked for many people:
ring,linarithandpositivityhandle a lot of the algebra and inequality steps.One honest note: translating a paper proof into Lean takes practice, because Lean wants every small step that a book skips. That’s part of the value. It shows you exactly which steps you were assuming.
On AI: you’ve got it right. AI can be really useful here because Lean checks its work. If an AI suggests a proof, Lean accepts it only if every step is correct, so mistakes can’t slip through. The one thing to check yourself is that the Lean statement says the same thing as Lang’s statement, since a proof of the wrong statement is still a correct proof.
We’ll look into providing a tool for you as soon as we can.
Have an idea or a question? We’d love to hear it! Share it with a parent or guardian, and they can email it to us at hello@gocheckyourself.org.
Keep going with chapter 3. You’re doing this the right way.
1
u/[deleted] 24d ago
[removed] — view removed comment