# HG changeset patch # User wenzelm # Date 1119462076 -7200 # Node ID 9b442d0e5c0cc86358c380e00f8efd3dca9c911f # Parent 3e493fa130a35f60b3330e78cbd243d654085731 improved proof; diff -r 3e493fa130a3 -r 9b442d0e5c0c src/HOL/Isar_examples/Drinker.thy --- a/src/HOL/Isar_examples/Drinker.thy Wed Jun 22 19:41:15 2005 +0200 +++ b/src/HOL/Isar_examples/Drinker.thy Wed Jun 22 19:41:16 2005 +0200 @@ -8,48 +8,31 @@ theory Drinker imports Main begin text {* - Two parts of de-Morgan's law -- one intuitionistic and one classical: + Here is another example of classical reasoning: the Drinker's + Principle says that for some person, if he is drunk, everybody else + is drunk! + + We first prove a classical part of de-Morgan's law. *} -lemma deMorgan1: "\ (\x. P x) \ \x. \ P x" -proof - - assume a: "\ (\x. P x)" - show ?thesis - proof - fix x - show "\ P x" - proof - assume "P x" - then have "\x. P x" .. - with a show False by contradiction - qed - qed -qed - -lemma deMorgan2: "\ (\x. P x) \ \x. \ P x" -proof (rule classical) - assume a: "\ (\x. P x)" - assume b: "\ (\x. \ P x)" - have "\x. P x" +lemma deMorgan: + assumes "\ (\x. P x)" + shows "\x. \ P x" + using prems +proof (rule contrapos_np) + assume a: "\ (\x. \ P x)" + show "\x. P x" proof fix x show "P x" proof (rule classical) - assume c: "\ P x" - from b have "\x. \ \ P x" by (rule deMorgan1) - then have "\ \ P x" .. - with c show ?thesis by contradiction + assume "\ P x" + then have "\x. \ P x" .. + with a show ?thesis by contradiction qed qed - with a show ?thesis by contradiction qed -text {* - Here is another example of classical reasoning: the Drinker's - Principle says that for some person, if he is drunk, everybody else - is drunk! -*} - theorem Drinker's_Principle: "\x. drunk x \ (\x. drunk x)" proof cases fix a assume "\x. drunk x" @@ -57,7 +40,7 @@ then show ?thesis .. next assume "\ (\x. drunk x)" - then have "\x. \ drunk x" by (rule deMorgan2) + then have "\x. \ drunk x" by (rule deMorgan) then obtain a where a: "\ drunk a" .. have "drunk a \ (\x. drunk x)" proof