I am trying to solve the simple lemma "add m (Suc n) = add n (Suc m)" by induction over m. I tried solving the last remaining subgoal after applying auto by another lemma, howerver if i use the simplification rule on that auxiliary lemma it leads to an infinite loop at apply(auto) in the original lemma.
Do you know why that happens? And if my way doesn't work, how would i solve the original lemma?
fun add :: "nat ⇒ nat ⇒ nat" where
"add 0 n = n" |
"add (Suc m) n = Suc(add m n)"
lemma aux:"Suc n = add n (Suc 0)"
apply(induction n)
apply(auto)
done
lemma original:"add m (Suc n) = add n (Suc m)"
apply(induction m arbitrary: n)
apply(auto)
oops
These are the lemmas in question, i also proved commutatvity of add in a seperate lemma. The subgoal of "original" after apply(auto) is
- ⋀n. Suc n = add n (Suc 0) When adding [simp] to the lemma aux, the apply(auto) in the lemma original gets into an infinite loop.
Sorry if this is trivial, i am just getting into Isabelle.