author | wenzelm |
Tue, 23 Dec 2008 00:56:03 +0100 | |
changeset 29152 | 89b0803404d7 |
parent 27271 | ba2a00d35df1 |
child 29853 | e2103746a85d |
permissions | -rw-r--r-- |
25567
5720345ea689
experimental version of automated induction scheme generator (cf. HOL/ex/Induction_Scheme.thy)
krauss
parents:
diff
changeset
|
1 |
(* Title: HOL/ex/Induction_Scheme.thy |
5720345ea689
experimental version of automated induction scheme generator (cf. HOL/ex/Induction_Scheme.thy)
krauss
parents:
diff
changeset
|
2 |
ID: $Id$ |
5720345ea689
experimental version of automated induction scheme generator (cf. HOL/ex/Induction_Scheme.thy)
krauss
parents:
diff
changeset
|
3 |
Author: Alexander Krauss, TU Muenchen |
5720345ea689
experimental version of automated induction scheme generator (cf. HOL/ex/Induction_Scheme.thy)
krauss
parents:
diff
changeset
|
4 |
*) |
5720345ea689
experimental version of automated induction scheme generator (cf. HOL/ex/Induction_Scheme.thy)
krauss
parents:
diff
changeset
|
5 |
|
5720345ea689
experimental version of automated induction scheme generator (cf. HOL/ex/Induction_Scheme.thy)
krauss
parents:
diff
changeset
|
6 |
header {* Examples of automatically derived induction rules *} |
5720345ea689
experimental version of automated induction scheme generator (cf. HOL/ex/Induction_Scheme.thy)
krauss
parents:
diff
changeset
|
7 |
|
5720345ea689
experimental version of automated induction scheme generator (cf. HOL/ex/Induction_Scheme.thy)
krauss
parents:
diff
changeset
|
8 |
theory Induction_Scheme |
5720345ea689
experimental version of automated induction scheme generator (cf. HOL/ex/Induction_Scheme.thy)
krauss
parents:
diff
changeset
|
9 |
imports Main |
5720345ea689
experimental version of automated induction scheme generator (cf. HOL/ex/Induction_Scheme.thy)
krauss
parents:
diff
changeset
|
10 |
begin |
5720345ea689
experimental version of automated induction scheme generator (cf. HOL/ex/Induction_Scheme.thy)
krauss
parents:
diff
changeset
|
11 |
|
5720345ea689
experimental version of automated induction scheme generator (cf. HOL/ex/Induction_Scheme.thy)
krauss
parents:
diff
changeset
|
12 |
subsection {* Some simple induction principles on nat *} |
5720345ea689
experimental version of automated induction scheme generator (cf. HOL/ex/Induction_Scheme.thy)
krauss
parents:
diff
changeset
|
13 |
|
5720345ea689
experimental version of automated induction scheme generator (cf. HOL/ex/Induction_Scheme.thy)
krauss
parents:
diff
changeset
|
14 |
lemma nat_standard_induct: (* cf. Nat.thy *) |
5720345ea689
experimental version of automated induction scheme generator (cf. HOL/ex/Induction_Scheme.thy)
krauss
parents:
diff
changeset
|
15 |
"\<lbrakk>P 0; \<And>n. P n \<Longrightarrow> P (Suc n)\<rbrakk> \<Longrightarrow> P x" |
5720345ea689
experimental version of automated induction scheme generator (cf. HOL/ex/Induction_Scheme.thy)
krauss
parents:
diff
changeset
|
16 |
by induct_scheme (pat_completeness, lexicographic_order) |
5720345ea689
experimental version of automated induction scheme generator (cf. HOL/ex/Induction_Scheme.thy)
krauss
parents:
diff
changeset
|
17 |
|
5720345ea689
experimental version of automated induction scheme generator (cf. HOL/ex/Induction_Scheme.thy)
krauss
parents:
diff
changeset
|
18 |
lemma nat_induct2: (* cf. Nat.thy *) |
5720345ea689
experimental version of automated induction scheme generator (cf. HOL/ex/Induction_Scheme.thy)
krauss
parents:
diff
changeset
|
19 |
"\<lbrakk> P 0; P (Suc 0); \<And>k. P k ==> P (Suc (Suc k)) \<rbrakk> |
5720345ea689
experimental version of automated induction scheme generator (cf. HOL/ex/Induction_Scheme.thy)
krauss
parents:
diff
changeset
|
20 |
\<Longrightarrow> P n" |
5720345ea689
experimental version of automated induction scheme generator (cf. HOL/ex/Induction_Scheme.thy)
krauss
parents:
diff
changeset
|
21 |
by induct_scheme (pat_completeness, lexicographic_order) |
5720345ea689
experimental version of automated induction scheme generator (cf. HOL/ex/Induction_Scheme.thy)
krauss
parents:
diff
changeset
|
22 |
|
5720345ea689
experimental version of automated induction scheme generator (cf. HOL/ex/Induction_Scheme.thy)
krauss
parents:
diff
changeset
|
23 |
lemma minus_one_induct: |
5720345ea689
experimental version of automated induction scheme generator (cf. HOL/ex/Induction_Scheme.thy)
krauss
parents:
diff
changeset
|
24 |
"\<lbrakk>\<And>n::nat. (n \<noteq> 0 \<Longrightarrow> P (n - 1)) \<Longrightarrow> P n\<rbrakk> \<Longrightarrow> P x" |
5720345ea689
experimental version of automated induction scheme generator (cf. HOL/ex/Induction_Scheme.thy)
krauss
parents:
diff
changeset
|
25 |
by induct_scheme (pat_completeness, lexicographic_order) |
5720345ea689
experimental version of automated induction scheme generator (cf. HOL/ex/Induction_Scheme.thy)
krauss
parents:
diff
changeset
|
26 |
|
5720345ea689
experimental version of automated induction scheme generator (cf. HOL/ex/Induction_Scheme.thy)
krauss
parents:
diff
changeset
|
27 |
theorem diff_induct: (* cf. Nat.thy *) |
5720345ea689
experimental version of automated induction scheme generator (cf. HOL/ex/Induction_Scheme.thy)
krauss
parents:
diff
changeset
|
28 |
"(!!x. P x 0) ==> (!!y. P 0 (Suc y)) ==> |
5720345ea689
experimental version of automated induction scheme generator (cf. HOL/ex/Induction_Scheme.thy)
krauss
parents:
diff
changeset
|
29 |
(!!x y. P x y ==> P (Suc x) (Suc y)) ==> P m n" |
5720345ea689
experimental version of automated induction scheme generator (cf. HOL/ex/Induction_Scheme.thy)
krauss
parents:
diff
changeset
|
30 |
by induct_scheme (pat_completeness, lexicographic_order) |
5720345ea689
experimental version of automated induction scheme generator (cf. HOL/ex/Induction_Scheme.thy)
krauss
parents:
diff
changeset
|
31 |
|
5720345ea689
experimental version of automated induction scheme generator (cf. HOL/ex/Induction_Scheme.thy)
krauss
parents:
diff
changeset
|
32 |
lemma list_induct2': (* cf. List.thy *) |
5720345ea689
experimental version of automated induction scheme generator (cf. HOL/ex/Induction_Scheme.thy)
krauss
parents:
diff
changeset
|
33 |
"\<lbrakk> P [] []; |
5720345ea689
experimental version of automated induction scheme generator (cf. HOL/ex/Induction_Scheme.thy)
krauss
parents:
diff
changeset
|
34 |
\<And>x xs. P (x#xs) []; |
5720345ea689
experimental version of automated induction scheme generator (cf. HOL/ex/Induction_Scheme.thy)
krauss
parents:
diff
changeset
|
35 |
\<And>y ys. P [] (y#ys); |
5720345ea689
experimental version of automated induction scheme generator (cf. HOL/ex/Induction_Scheme.thy)
krauss
parents:
diff
changeset
|
36 |
\<And>x xs y ys. P xs ys \<Longrightarrow> P (x#xs) (y#ys) \<rbrakk> |
5720345ea689
experimental version of automated induction scheme generator (cf. HOL/ex/Induction_Scheme.thy)
krauss
parents:
diff
changeset
|
37 |
\<Longrightarrow> P xs ys" |
5720345ea689
experimental version of automated induction scheme generator (cf. HOL/ex/Induction_Scheme.thy)
krauss
parents:
diff
changeset
|
38 |
by induct_scheme (pat_completeness, lexicographic_order) |
5720345ea689
experimental version of automated induction scheme generator (cf. HOL/ex/Induction_Scheme.thy)
krauss
parents:
diff
changeset
|
39 |
|
5720345ea689
experimental version of automated induction scheme generator (cf. HOL/ex/Induction_Scheme.thy)
krauss
parents:
diff
changeset
|
40 |
theorem even_odd_induct: |
5720345ea689
experimental version of automated induction scheme generator (cf. HOL/ex/Induction_Scheme.thy)
krauss
parents:
diff
changeset
|
41 |
assumes "R 0" |
5720345ea689
experimental version of automated induction scheme generator (cf. HOL/ex/Induction_Scheme.thy)
krauss
parents:
diff
changeset
|
42 |
assumes "Q 0" |
5720345ea689
experimental version of automated induction scheme generator (cf. HOL/ex/Induction_Scheme.thy)
krauss
parents:
diff
changeset
|
43 |
assumes "\<And>n. Q n \<Longrightarrow> R (Suc n)" |
5720345ea689
experimental version of automated induction scheme generator (cf. HOL/ex/Induction_Scheme.thy)
krauss
parents:
diff
changeset
|
44 |
assumes "\<And>n. R n \<Longrightarrow> Q (Suc n)" |
5720345ea689
experimental version of automated induction scheme generator (cf. HOL/ex/Induction_Scheme.thy)
krauss
parents:
diff
changeset
|
45 |
shows "R n" "Q n" |
5720345ea689
experimental version of automated induction scheme generator (cf. HOL/ex/Induction_Scheme.thy)
krauss
parents:
diff
changeset
|
46 |
using assms |
27271
ba2a00d35df1
generalized induct_scheme method to prove conditional induction schemes.
krauss
parents:
25567
diff
changeset
|
47 |
by induct_scheme (pat_completeness+, lexicographic_order) |
25567
5720345ea689
experimental version of automated induction scheme generator (cf. HOL/ex/Induction_Scheme.thy)
krauss
parents:
diff
changeset
|
48 |
|
5720345ea689
experimental version of automated induction scheme generator (cf. HOL/ex/Induction_Scheme.thy)
krauss
parents:
diff
changeset
|
49 |
end |