Is there a way to perform strong induction in Isabelle? I cannot find too many working examples on it yet?
proof(induction n rule: less_induct)
You can search for induction principles with command find_theorems
. You can use keywords induct
and nat
, for example find_theorems name: induct name: nat
.
Alternatively, you can prove induction principles yourself. For strong induction:
lemma nat_strong_induct[case_names zero induct]:
assumes "P 0"
and "(⋀n. (⋀m. m ≤ n ⟹ P m) ⟹ P (Suc n))"
shows "P n"
using assms
apply (induct n rule: full_nat_induct)
by simp (metis Suc_le_mono not0_implies_Suc)
Then you can use it as shown below:
lemma "∃m::nat. m > n"
by (induct n rule: nat_strong_induct)
auto
Lekhani Ray has marked this topic as resolved.
Jonathan Julian Huerta y Munive said:
You can search for induction principles with command
find_theorems
. You can use keywordsinduct
andnat
, for examplefind_theorems name: induct name: nat
.Alternatively, you can prove induction principles yourself. For strong induction:
lemma nat_strong_induct[case_names zero induct]: assumes "P 0" and "(⋀n. (⋀m. m ≤ n ⟹ P m) ⟹ P (Suc n))" shows "P n" using assms apply (induct n rule: full_nat_induct) by simp (metis Suc_le_mono not0_implies_Suc)
Then you can use it as shown below:
lemma "∃m::nat. m > n" by (induct n rule: nat_strong_induct) auto
Thank you Jonathan! That really helped!
Last updated: Dec 21 2024 at 16:20 UTC