Is there an induction rule for odd nats somewhere?
have you searched for it
find_theorems odd name:induct
?
I do not think that it exists, but it is also very trivial to prove
lemma odd_induct[consumes 1, case_names 1 Suc]:
fixes n :: nat
assumes ‹odd n› and
‹P 1›
‹⋀n. P n ⟹ P (n+2)›
shows ‹P n›
proof -
obtain k ::nat where k: ‹n = 2*k+1›
using assms(1) oddE by blast
show ‹P n›
unfolding k
apply (induction k)
subgoal using assms(2) by auto
subgoal using assms(3) by auto
done
qed
(and the proof works exactly like you would expect from doing it on paper)
Last updated: Dec 21 2024 at 16:20 UTC