還以為LEAN這類會必須寫得更嚴謹 原來會存在這種隱式轉型問題
No, you just have to know a little bit about what you're doing. Here's a simpler instance.
The first example tries to prove that 2 - 3 = -1; this is true in the integers, and so that's how the question is interpreted (to be helpful to the user), and `by simp` solves the goal.
The second example tries to prove that 2 - 3 = 0; this is true in the natural numbers (because of "total functions"), and so that's how the question is interpreted (to be helpful to the user), and `by simp` solves the goal.
So no, you shouldn't just blindly "trust the Lean"; you should learn what you're doing.
And *then* you can trust the Lean. :)
1
24














