I want to use induction on an integer variable, doing an inductive step both in the positive and negative direction.
Consider the following theorem (for demonstration, no matter if it makes sense):
theorem exmpl (x : ℤ) : (x = 5):=
begin
induction x,
-- inductive steps
end
which produces in Leans tactic state:
case int.of_nat
x: ℕ
⊢ int.of_nat x = 5
case int.neg_succ_of_nat
x: ℕ
⊢ -[1+ x] = 5
Reasonably, the induction produces two cases, one for the positive and one for the negative direction. But what also happens is that x has now become a natural number and in the goals it changed to int.of_nat x
and -[1+ x]
.
As my induction operates inside of the integers, I would assume that those types are some kind of „subset“ of them, presumably having more useful properties than integers. The Lean Reference states that the second one seems to be „an implicit argument that should be inferred by type class resolution”, without explaining further what that means.
While this conversion is probably necessary for certain applications, in my use case I just want to continue working with integers and have not found a good way to convert the goals back to using integers.
So my questions are:
- What are those new types
x
was converted to, what do they mean and why does the conversion make sense? - And, more important: How do I change the goal back to a case where I can work with integers again?