merged
authorChristian Urban <urbanc@in.tum.de>
Thu, 10 Dec 2009 01:48:39 +0100
changeset 678 569f0e286400
parent 677 35fbace8d48d (current diff)
parent 676 0668d218bfa5 (diff)
child 679 fe64784b38c3
child 680 d003f9e00c29
merged
Quot/Examples/IntEx2.thy
--- a/Quot/Examples/IntEx2.thy	Thu Dec 10 01:47:55 2009 +0100
+++ b/Quot/Examples/IntEx2.thy	Thu Dec 10 01:48:39 2009 +0100
@@ -294,6 +294,26 @@
 apply(simp_all add: left_distrib add_strict_mono)
 done
 
+lemma int_induct_raw:
+  assumes a: "P (0::nat, 0)"
+  and     b: "\<And>i. P i \<Longrightarrow> P (plus_raw i (1,0))"
+  and     c: "\<And>i. P i \<Longrightarrow> P (plus_raw i (minus_raw (1,0)))"
+  shows      "P x"
+apply(case_tac x) apply(simp)
+apply(rule_tac x="b" in spec)
+apply(rule_tac Nat.induct)
+apply(rule allI)
+apply(rule_tac Nat.induct)
+using a b c apply(auto)
+done
+
+lemma int_induct:
+  assumes a: "P (0::int)"
+  and     b: "\<And>i. P i \<Longrightarrow> P (i + 1)"
+  and     c: "\<And>i. P i \<Longrightarrow> P (i + (- 1))"
+  shows      "P x"
+using a b c by (lifting int_induct_raw)
+
 lemma zero_le_imp_eq_int: 
   fixes k::int
   shows "0 < k \<Longrightarrow> \<exists>n > 0. k = of_nat n"