equal
deleted
inserted
replaced
631 shows "P" |
631 shows "P" |
632 proof (cases k "0::int" rule: linorder_cases) |
632 proof (cases k "0::int" rule: linorder_cases) |
633 case equal with assms(1) show P by simp |
633 case equal with assms(1) show P by simp |
634 next |
634 next |
635 case greater |
635 case greater |
636 then have "nat k > 0" by simp |
636 then have *: "nat k > 0" by simp |
637 moreover from this have "k = int (nat k)" by auto |
637 moreover from * have "k = int (nat k)" by auto |
638 ultimately show P using assms(2) by blast |
638 ultimately show P using assms(2) by blast |
639 next |
639 next |
640 case less |
640 case less |
641 then have "nat (- k) > 0" by simp |
641 then have *: "nat (- k) > 0" by simp |
642 moreover from this have "k = - int (nat (- k))" by auto |
642 moreover from * have "k = - int (nat (- k))" by auto |
643 ultimately show P using assms(3) by blast |
643 ultimately show P using assms(3) by blast |
644 qed |
644 qed |
645 |
645 |
646 theorem int_of_nat_induct [case_names nonneg neg, induct type: int]: |
646 theorem int_of_nat_induct [case_names nonneg neg, induct type: int]: |
647 "[|!! n. P (int n); !!n. P (- (int (Suc n))) |] ==> P z" |
647 "[|!! n. P (int n); !!n. P (- (int (Suc n))) |] ==> P z" |