# HG changeset patch # User wenzelm # Date 1478549621 -3600 # Node ID 6eff987ab7186701538c5be0a5354930c54093f5 # Parent c2191352e908a40f7213d4bcc1089e4433f3a592 misc tuning and modernization; diff -r c2191352e908 -r 6eff987ab718 src/HOL/Proofs/ex/Hilbert_Classical.thy --- a/src/HOL/Proofs/ex/Hilbert_Classical.thy Mon Nov 07 20:05:30 2016 +0100 +++ b/src/HOL/Proofs/ex/Hilbert_Classical.thy Mon Nov 07 21:13:41 2016 +0100 @@ -1,11 +1,12 @@ (* Title: HOL/Proofs/ex/Hilbert_Classical.thy - Author: Stefan Berghofer and Markus Wenzel, TU Muenchen + Author: Stefan Berghofer + Author: Makarius Wenzel *) section \Hilbert's choice and classical logic\ theory Hilbert_Classical -imports Main + imports Main begin text \ @@ -16,79 +17,77 @@ subsection \Proof text\ -theorem tnd: "A \ \ A" +theorem tertium_non_datur: "A \ \ A" proof - - let ?P = "\X. X = False \ X = True \ A" - let ?Q = "\X. X = False \ A \ X = True" + let ?P = "\x. (x \ False) \ (x \ True) \ A" + let ?Q = "\x. (x \ False) \ A \ (x \ True)" have a: "?P (Eps ?P)" proof (rule someI) - have "False = False" .. - thus "?P False" .. + show "?P False" using refl .. qed have b: "?Q (Eps ?Q)" proof (rule someI) - have "True = True" .. - thus "?Q True" .. + show "?Q True" using refl .. qed from a show ?thesis proof - assume "Eps ?P = True \ A" - hence A .. - thus ?thesis .. + assume "(Eps ?P \ True) \ A" + then have A .. + then show ?thesis .. next - assume P: "Eps ?P = False" + assume P: "Eps ?P \ False" from b show ?thesis proof - assume "Eps ?Q = False \ A" - hence A .. - thus ?thesis .. + assume "(Eps ?Q \ False) \ A" + then have A .. + then show ?thesis .. next - assume Q: "Eps ?Q = True" + assume Q: "Eps ?Q \ True" have neq: "?P \ ?Q" proof assume "?P = ?Q" - hence "Eps ?P = Eps ?Q" by (rule arg_cong) + then have "Eps ?P \ Eps ?Q" by (rule arg_cong) also note P also note Q finally show False by (rule False_neq_True) qed have "\ A" proof - assume a: A + assume A have "?P = ?Q" proof (rule ext) - fix x show "?P x = ?Q x" + show "?P x \ ?Q x" for x proof assume "?P x" - thus "?Q x" + then show "?Q x" proof - assume "x = False" - from this and a have "x = False \ A" .. - thus "?Q x" .. + assume "x \ False" + from this and \A\ have "(x \ False) \ A" .. + then show ?thesis .. next - assume "x = True \ A" - hence "x = True" .. - thus "?Q x" .. + assume "(x \ True) \ A" + then have "x \ True" .. + then show ?thesis .. qed next assume "?Q x" - thus "?P x" + then show "?P x" proof - assume "x = False \ A" - hence "x = False" .. - thus "?P x" .. + assume "(x \ False) \ A" + then have "x \ False" .. + then show ?thesis .. next - assume "x = True" - from this and a have "x = True \ A" .. - thus "?P x" .. + assume "x \ True" + from this and \A\ have "(x \ True) \ A" .. + then show ?thesis .. qed qed qed with neq show False by contradiction qed - thus ?thesis .. + then show ?thesis .. qed qed qed @@ -96,57 +95,57 @@ subsection \Proof term of text\ -prf tnd +prf tertium_non_datur subsection \Proof script\ -theorem tnd': "A \ \ A" +theorem tertium_non_datur': "A \ \ A" apply (subgoal_tac - "(((SOME x. x = False \ x = True \ A) = False) \ + "(((SOME x. x = False \ x = True \ A) = False) \ ((SOME x. x = False \ x = True \ A) = True) \ A) \ - (((SOME x. x = False \ A \ x = True) = False) \ A \ + (((SOME x. x = False \ A \ x = True) = False) \ A \ ((SOME x. x = False \ A \ x = True) = True))") - prefer 2 - apply (rule conjI) - apply (rule someI) - apply (rule disjI1) - apply (rule refl) - apply (rule someI) - apply (rule disjI2) - apply (rule refl) + prefer 2 + apply (rule conjI) + apply (rule someI) + apply (rule disjI1) + apply (rule refl) + apply (rule someI) + apply (rule disjI2) + apply (rule refl) apply (erule conjE) apply (erule disjE) - apply (erule disjE) - apply (erule conjE) - apply (erule disjI1) - prefer 2 - apply (erule conjE) - apply (erule disjI1) + apply (erule disjE) + apply (erule conjE) + apply (erule disjI1) + prefer 2 + apply (erule conjE) + apply (erule disjI1) apply (subgoal_tac - "(\x. (x = False) \ (x = True) \ A) \ - (\x. (x = False) \ A \ (x = True))") - prefer 2 - apply (rule notI) - apply (drule_tac f = "\y. SOME x. y x" in arg_cong) - apply (drule trans, assumption) - apply (drule sym) - apply (drule trans, assumption) - apply (erule False_neq_True) + "(\x. (x = False) \ (x = True) \ A) \ + (\x. (x = False) \ A \ (x = True))") + prefer 2 + apply (rule notI) + apply (drule_tac f = "\y. SOME x. y x" in arg_cong) + apply (drule trans, assumption) + apply (drule sym) + apply (drule trans, assumption) + apply (erule False_neq_True) apply (rule disjI2) apply (rule notI) apply (erule notE) apply (rule ext) apply (rule iffI) + apply (erule disjE) + apply (rule disjI1) + apply (erule conjI) + apply assumption + apply (erule conjE) + apply (erule disjI2) apply (erule disjE) - apply (rule disjI1) - apply (erule conjI) - apply assumption - apply (erule conjE) - apply (erule disjI2) - apply (erule disjE) - apply (erule conjE) - apply (erule disjI1) + apply (erule conjE) + apply (erule disjI1) apply (rule disjI2) apply (erule conjI) apply assumption @@ -155,6 +154,6 @@ subsection \Proof term of script\ -prf tnd' +prf tertium_non_datur' end