src/HOL/Hilbert_Choice.thy
 changeset 39943 0ef551d47783 parent 39900 549c00e0e89b child 39950 f3c4849868b8
1.1 --- a/src/HOL/Hilbert_Choice.thy	Mon Oct 04 21:50:32 2010 +0200
1.2 +++ b/src/HOL/Hilbert_Choice.thy	Mon Oct 04 21:55:54 2010 +0200
1.3 @@ -7,8 +7,7 @@
1.5  theory Hilbert_Choice
1.6  imports Nat Wellfounded Plain
1.7 -uses ("Tools/meson.ML")
1.8 -     ("Tools/choice_specification.ML")
1.9 +uses ("Tools/choice_specification.ML")
1.10  begin
1.12  subsection {* Hilbert's epsilon *}
1.13 @@ -81,16 +80,6 @@
1.15  subsection{*Axiom of Choice, Proved Using the Description Operator*}
1.17 -ML {*
1.18 -structure Meson_Choices = Named_Thms
1.19 -(
1.20 -  val name = "meson_choice"
1.21 -  val description = "choice axioms for MESON's (and Metis's) skolemizer"
1.22 -)
1.23 -*}
1.24 -
1.25 -setup Meson_Choices.setup
1.26 -
1.27  lemma choice [meson_choice]: "\<forall>x. \<exists>y. Q x y ==> \<exists>f. \<forall>x. Q x (f x)"
1.28  by (fast elim: someI)
1.30 @@ -451,128 +440,6 @@
1.31    done
1.34 -subsection {* The Meson proof procedure *}
1.35 -
1.36 -subsubsection {* Negation Normal Form *}
1.37 -
1.38 -text {* de Morgan laws *}
1.39 -
1.40 -lemma meson_not_conjD: "~(P&Q) ==> ~P | ~Q"
1.41 -  and meson_not_disjD: "~(P|Q) ==> ~P & ~Q"
1.42 -  and meson_not_notD: "~~P ==> P"
1.43 -  and meson_not_allD: "!!P. ~(\<forall>x. P(x)) ==> \<exists>x. ~P(x)"
1.44 -  and meson_not_exD: "!!P. ~(\<exists>x. P(x)) ==> \<forall>x. ~P(x)"
1.45 -  by fast+
1.46 -
1.47 -text {* Removal of @{text "-->"} and @{text "<->"} (positive and
1.48 -negative occurrences) *}
1.49 -
1.50 -lemma meson_imp_to_disjD: "P-->Q ==> ~P | Q"
1.51 -  and meson_not_impD: "~(P-->Q) ==> P & ~Q"
1.52 -  and meson_iff_to_disjD: "P=Q ==> (~P | Q) & (~Q | P)"
1.53 -  and meson_not_iffD: "~(P=Q) ==> (P | Q) & (~P | ~Q)"
1.54 -    -- {* Much more efficient than @{prop "(P & ~Q) | (Q & ~P)"} for computing CNF *}
1.55 -  and meson_not_refl_disj_D: "x ~= x | P ==> P"
1.56 -  by fast+
1.57 -
1.58 -
1.59 -subsubsection {* Pulling out the existential quantifiers *}
1.60 -
1.61 -text {* Conjunction *}
1.62 -
1.63 -lemma meson_conj_exD1: "!!P Q. (\<exists>x. P(x)) & Q ==> \<exists>x. P(x) & Q"
1.64 -  and meson_conj_exD2: "!!P Q. P & (\<exists>x. Q(x)) ==> \<exists>x. P & Q(x)"
1.65 -  by fast+
1.66 -
1.67 -
1.68 -text {* Disjunction *}
1.69 -
1.70 -lemma meson_disj_exD: "!!P Q. (\<exists>x. P(x)) | (\<exists>x. Q(x)) ==> \<exists>x. P(x) | Q(x)"
1.71 -  -- {* DO NOT USE with forall-Skolemization: makes fewer schematic variables!! *}
1.72 -  -- {* With ex-Skolemization, makes fewer Skolem constants *}
1.73 -  and meson_disj_exD1: "!!P Q. (\<exists>x. P(x)) | Q ==> \<exists>x. P(x) | Q"
1.74 -  and meson_disj_exD2: "!!P Q. P | (\<exists>x. Q(x)) ==> \<exists>x. P | Q(x)"
1.75 -  by fast+
1.76 -
1.77 -
1.78 -subsubsection {* Generating clauses for the Meson Proof Procedure *}
1.79 -
1.80 -text {* Disjunctions *}
1.81 -
1.82 -lemma meson_disj_assoc: "(P|Q)|R ==> P|(Q|R)"
1.83 -  and meson_disj_comm: "P|Q ==> Q|P"
1.84 -  and meson_disj_FalseD1: "False|P ==> P"
1.85 -  and meson_disj_FalseD2: "P|False ==> P"
1.86 -  by fast+
1.87 -
1.88 -
1.89 -subsection{*Lemmas for Meson, the Model Elimination Procedure*}
1.90 -
1.91 -text{* Generation of contrapositives *}
1.92 -
1.93 -text{*Inserts negated disjunct after removing the negation; P is a literal.
1.94 -  Model elimination requires assuming the negation of every attempted subgoal,
1.95 -  hence the negated disjuncts.*}
1.96 -lemma make_neg_rule: "~P|Q ==> ((~P==>P) ==> Q)"
1.97 -by blast
1.98 -
1.99 -text{*Version for Plaisted's "Postive refinement" of the Meson procedure*}
1.100 -lemma make_refined_neg_rule: "~P|Q ==> (P ==> Q)"
1.101 -by blast
1.103 -text{*@{term P} should be a literal*}
1.104 -lemma make_pos_rule: "P|Q ==> ((P==>~P) ==> Q)"
1.105 -by blast
1.107 -text{*Versions of @{text make_neg_rule} and @{text make_pos_rule} that don't
1.108 -insert new assumptions, for ordinary resolution.*}
1.110 -lemmas make_neg_rule' = make_refined_neg_rule
1.112 -lemma make_pos_rule': "[|P|Q; ~P|] ==> Q"
1.113 -by blast
1.115 -text{* Generation of a goal clause -- put away the final literal *}
1.117 -lemma make_neg_goal: "~P ==> ((~P==>P) ==> False)"
1.118 -by blast
1.120 -lemma make_pos_goal: "P ==> ((P==>~P) ==> False)"
1.121 -by blast
1.124 -subsubsection{* Lemmas for Forward Proof*}
1.126 -text{*There is a similarity to congruence rules*}
1.128 -(*NOTE: could handle conjunctions (faster?) by
1.129 -    nf(th RS conjunct2) RS (nf(th RS conjunct1) RS conjI) *)
1.130 -lemma conj_forward: "[| P'&Q';  P' ==> P;  Q' ==> Q |] ==> P&Q"
1.131 -by blast
1.133 -lemma disj_forward: "[| P'|Q';  P' ==> P;  Q' ==> Q |] ==> P|Q"
1.134 -by blast
1.136 -(*Version of @{text disj_forward} for removal of duplicate literals*)
1.137 -lemma disj_forward2:
1.138 -    "[| P'|Q';  P' ==> P;  [| Q'; P==>False |] ==> Q |] ==> P|Q"
1.139 -apply blast
1.140 -done
1.142 -lemma all_forward: "[| \<forall>x. P'(x);  !!x. P'(x) ==> P(x) |] ==> \<forall>x. P(x)"
1.143 -by blast
1.145 -lemma ex_forward: "[| \<exists>x. P'(x);  !!x. P'(x) ==> P(x) |] ==> \<exists>x. P(x)"
1.146 -by blast
1.149 -subsection {* Meson package *}
1.151 -use "Tools/meson.ML"
1.153 -setup Meson.setup
1.156  subsection {* Specification package -- Hilbertized version *}
1.158  lemma exE_some: "[| Ex P ; c == Eps P |] ==> P c"
1.159 @@ -580,5 +447,4 @@
1.161  use "Tools/choice_specification.ML"
1.164  end