# HG changeset patch # User haftmann # Date 1252584478 -7200 # Node ID bf781ef40c8193b3ecc4318ccb776325607e475c # Parent b4119bbb2b79ae63d2c83d8085b93c2100a48c92 cleanedup theorems all_nat ex_nat diff -r b4119bbb2b79 -r bf781ef40c81 src/HOL/IntDiv.thy --- a/src/HOL/IntDiv.thy Wed Sep 09 12:29:06 2009 +0200 +++ b/src/HOL/IntDiv.thy Thu Sep 10 14:07:58 2009 +0200 @@ -1102,20 +1102,6 @@ thus ?thesis by simp qed - -theorem ex_nat: "(\x::nat. P x) = (\x::int. 0 <= x \ P (nat x))" -apply (simp split add: split_nat) -apply (rule iffI) -apply (erule exE) -apply (rule_tac x = "int x" in exI) -apply simp -apply (erule exE) -apply (rule_tac x = "nat x" in exI) -apply (erule conjE) -apply (erule_tac x = "nat x" in allE) -apply simp -done - theorem zdvd_int: "(x dvd y) = (int x dvd int y)" proof - have "\k. int y = int x * k \ x dvd y" diff -r b4119bbb2b79 -r bf781ef40c81 src/HOL/Presburger.thy --- a/src/HOL/Presburger.thy Wed Sep 09 12:29:06 2009 +0200 +++ b/src/HOL/Presburger.thy Thu Sep 10 14:07:58 2009 +0200 @@ -382,15 +382,22 @@ lemma uminus_dvd_conv: "(d dvd (t::int)) \ (-d dvd t)" "(d dvd (t::int)) \ (d dvd -t)" by simp_all + text {* \bigskip Theorems for transforming predicates on nat to predicates on @{text int}*} -lemma all_nat: "(\x::nat. P x) = (\x::int. 0 <= x \ P (nat x))" + +lemma all_nat: "(\x. P x) \ (\x\0. P (nat x))" by (simp split add: split_nat) -lemma ex_nat: "(\x::nat. P x) = (\x::int. 0 <= x \ P (nat x))" - apply (auto split add: split_nat) - apply (rule_tac x="int x" in exI, simp) - apply (rule_tac x = "nat x" in exI,erule_tac x = "nat x" in allE, simp) - done +lemma ex_nat: "(\x. P x) \ (\x. 0 \ x \ P (nat x))" +proof + assume "\x. P x" + then obtain x where "P x" .. + then have "int x \ 0 \ P (nat (int x))" by simp + then show "\x\0. P (nat x)" .. +next + assume "\x\0. P (nat x)" + then show "\x. P x" by auto +qed lemma zdiff_int_split: "P (int (x - y)) = ((y \ x \ P (int x - int y)) \ (x < y \ P 0))"