# HG changeset patch # User paulson # Date 1161595130 -7200 # Node ID 5a59f8ff96cc854006af52e7e948075b13a53544 # Parent 8f3dffd52db227b9b328418d8e2150ea9fa09ccf new single-step proofs diff -r 8f3dffd52db2 -r 5a59f8ff96cc src/HOL/ex/Classical.thy --- a/src/HOL/ex/Classical.thy Mon Oct 23 11:18:25 2006 +0200 +++ b/src/HOL/ex/Classical.thy Mon Oct 23 11:18:50 2006 +0200 @@ -837,39 +837,68 @@ qed -text{*A lengthy proof of a significant theorem.*} +text{*A lengthy proof of a significant theorem: @{text singleton_example_1}*} lemmas subsetI_0 = subsetI[skolem, clausify 0] lemmas subsetI_1 = subsetI[skolem, clausify 1] +text{*Full single-step proof*} +lemma "\S::'a set set. \x \ S. \y \ S. x \ y \ \z. S \ {z}" +proof (rule ccontr, skolemize, make_clauses) + fix S :: "'a set set" + assume CL1: "\Z. S \ {Z} \ False" + and CL2: "\X Y. \X \ S; Y \ S; \ X \ Y\ \ False" + have CL10: "!!U V. \U \ S; V \ S; V \ U; V \ U\ \ False" + by (meson equalityI CL2) + have CL11: "!!U V. \U \ S; V \ S; V \ U\ \ False" + by (meson CL10 CL2) + have CL13: "!!U V. \U \ S; ~ (S \ V); U \ Set_XsubsetI_sko1_ S V\ \ False" + by (meson subsetI_0 CL11) + have CL14: "!!U V. \~ (S \ U); ~(S \ V); Set_XsubsetI_sko1_ S U \ Set_XsubsetI_sko1_ S V\ \ False" + by (meson subsetI_0 CL13) + have CL29: "!!U V. \~ (S \ U); Set_XsubsetI_sko1_ S U \ Set_XsubsetI_sko1_ S {V}\ \ False" + by (meson CL1 CL14) + have CL58: "!!U V. \Set_XsubsetI_sko1_ S {U} \ Set_XsubsetI_sko1_ S {V}\ \ False" + by (meson CL1 CL29) + have CL82: "!!U V. \Set_XsubsetI_sko1_ S {U} \ {V}; ~ (S \ {V})\ \ False" + by (iprover intro: subsetI_1 CL58 elim: ssubst) + have CL85: "!!U V. \Set_XsubsetI_sko1_ S {U} \ {V}\ \ False" + by (meson CL1 CL82) + show False + by (meson insertI1 CL85) +qed + +text{*Partially condensed proof*} lemma singleton_example_1: "\S::'a set set. \x \ S. \y \ S. x \ y \ \z. S \ {z}" proof (rule ccontr, skolemize, make_clauses) fix S :: "'a set set" assume CL1: "\Z. S \ {Z} \ False" and CL2: "\X Y. \X \ S; Y \ S; \ X \ Y\ \ False" - have CL10: "!!U V. [|U \ S; V \ S; V \ U; V \ U|] ==> False" - by (iprover intro: equalityI CL2) - have CL11: "!!U V. [|U \ S; V \ S; V \ U|] ==> False" - by (iprover intro: CL10 CL2) - have CL13: "!!U V. [|U \ S; ~ (S \ V); U \ Set_XsubsetI_sko1_ S V|] ==> False" - by (iprover intro: subsetI_0 CL11) - have CL14: "!!U V. [|~ (S \ U); ~(S \ V); Set_XsubsetI_sko1_ S U \ Set_XsubsetI_sko1_ S V|] ==> False" - by (iprover intro: subsetI_0 CL13) - have CL29: "!!U V. [|~ (S \ U); Set_XsubsetI_sko1_ S U \ Set_XsubsetI_sko1_ S {V}|] ==> False" - by (iprover intro: CL1 CL14) - have CL58: "!!U V. [| Set_XsubsetI_sko1_ S {U} \ Set_XsubsetI_sko1_ S {V}|] ==> False" - by (iprover intro: CL1 CL29) - have CL82: "!!U V. [| Set_XsubsetI_sko1_ S {U} \ {V}; ~ (S \ {V})|] ==> False" + have CL13: "!!U V. \U \ S; ~ (S \ V); U \ Set_XsubsetI_sko1_ S V\ \ False" + by (meson subsetI_0 equalityI CL2) + have CL58: "!!U V. \Set_XsubsetI_sko1_ S {U} \ Set_XsubsetI_sko1_ S {V}\ \ False" + by (meson CL1 subsetI_0 CL13) + have CL82: "!!U V. \Set_XsubsetI_sko1_ S {U} \ {V}; ~ (S \ {V})\ \ False" by (iprover intro: subsetI_1 CL58 elim: ssubst) - have CL85: "!!U V. [| Set_XsubsetI_sko1_ S {U} \ {V}|] ==> False" - by (blast intro: CL1 CL82) show False - by (iprover intro: insertI1 CL85) + by (meson insertI1 CL1 CL82) +qed + +text{*More condensed proof*} +lemma "\S::'a set set. \x \ S. \y \ S. x \ y \ \z. S \ {z}" +proof (rule ccontr, skolemize, make_clauses) + fix S :: "'a set set" + assume CL1: "\Z. S \ {Z} \ False" + and CL2: "\X Y. \X \ S; Y \ S; \ X \ Y\ \ False" + have CL58: "!!U V. \Set_XsubsetI_sko1_ S {U} \ Set_XsubsetI_sko1_ S {V}\ \ False" + by (meson CL1 subsetI_0 equalityI CL2) + show False + by (iprover intro: subsetI_1 insertI1 CL1 CL58 elim: ssubst) qed -(*Based on this SPASS proof: +(*These are based on the following SPASS proof: Here is a proof with depth 6, length 15 : 1[0:Inp] || -> c_in(U,c_insert(U,V,W),W)*.