text\<open>Classical implies (\<open>\<longrightarrow>\<close>) elimination.\<close> lemma impCE: assumes major: \<open>P \<longrightarrow> Q\<close> and r1: \<open>\<not> P \<Longrightarrow> R\<close> and r2: \<open>Q \<Longrightarrow> R\<close> shows\<open>R\<close> apply (rule excluded_middle [THEN disjE]) apply (erule r1) apply (rule r2) apply (erule major [THEN mp]) done
text\<open>
This version of \<open>\<longrightarrow>\<close> elimination works on \<open>Q\<close> before \<open>P\<close>. It works best for those cases in which P holds ``almost everywhere''.
Can't install as default: would break old proofs. \<close> lemma impCE': assumes major: \<open>P \<longrightarrow> Q\<close> and r1: \<open>Q \<Longrightarrow> R\<close> and r2: \<open>\<not> P \<Longrightarrow> R\<close> shows\<open>R\<close> apply (rule excluded_middle [THEN disjE]) apply (erule r2) apply (rule r1) apply (erule major [THEN mp]) done
subsubsection \<open>Tactics for implication and contradiction\<close>
text\<open>
Classical \<open>\<longleftrightarrow>\<close> elimination. Proof substitutes \<open>P = Q\<close> in \<open>\<not> P \<Longrightarrow> \<not> Q\<close> and \<open>P \<Longrightarrow> Q\<close>. \<close> lemma iffCE: assumes major: \<open>P \<longleftrightarrow> Q\<close> and r1: \<open>\<lbrakk>P; Q\<rbrakk> \<Longrightarrow> R\<close> and r2: \<open>\<lbrakk>\<not> P; \<not> Q\<rbrakk> \<Longrightarrow> R\<close> shows\<open>R\<close> apply (rule major [unfolded iff_def, THEN conjE]) apply (elim impCE) apply (erule (1) r2) apply (erule (1) notE)+ apply (erule (1) r1) done
(*Better for fast_tac: needs no quantifier duplication!*) lemma alt_ex1E: assumes major: \<open>\<exists>! x. P(x)\<close> and r: \<open>\<And>x. \<lbrakk>P(x); \<forall>y y'. P(y) \<and> P(y') \<longrightarrow> y = y'\<rbrakk> \<Longrightarrow> R\<close> shows\<open>R\<close> using major proof (rule ex1E) fix x assume * : \<open>\<forall>y. P(y) \<longrightarrow> y = x\<close> assume\<open>P(x)\<close> thenshow\<open>R\<close> proof (rule r)
{ fix y y' assume\<open>P(y)\<close> and \<open>P(y')\<close> with * have\<open>x = y\<close> and \<open>x = y'\<close> by - (tactic "IntPr.fast_tac \<^context> 1")+ thenhave\<open>y = y'\<close> by (rule subst)
} note r' = this show\<open>\<forall>y y'. P(y) \<and> P(y') \<longrightarrow> y = y'\<close> by (intro strip, elim conjE) (rule r') qed qed
lemma imp_elim: \<open>P \<longrightarrow> Q \<Longrightarrow> (\<not> R \<Longrightarrow> P) \<Longrightarrow> (Q \<Longrightarrow> R) \<Longrightarrow> R\<close> by (rule classical) iprover
lemma swap: \<open>\<not> P \<Longrightarrow> (\<not> R \<Longrightarrow> P) \<Longrightarrow> R\<close> by (rule classical) iprover
section \<open>Classical Reasoner\<close>
ML \<open> structure Cla = Classical
(
val imp_elim = @{thm imp_elim}
val not_elim = @{thmnotE}
val swap = @{thm swap}
val classical = @{thm classical}
val sizef = size_of_thm
val hyp_subst_tacs = [hyp_subst_tac]
);
structure Basic_Classical: BASIC_CLASSICAL = Cla; open Basic_Classical; \<close>
(*Quantifier rules*) lemmas [intro!] = allI ex_ex1I and [intro] = exI and [elim!] = exE alt_ex1E and [elim] = allE
ML \<open>val FOL_cs = claset_of \<^context>\<close>
ML \<open> structure Blast = Blast
( structure Classical = Cla
val Trueprop_const = dest_Const \<^Const>\<open>Trueprop\<close>
val equality_name = \<^const_name>\<open>eq\<close>
val not_name = \<^const_name>\<open>Not\<close>
val notE = @{thmnotE}
val ccontr = @{thm ccontr}
val hyp_subst_tac = Hypsubst.blast_hyp_subst_tac
);
val blast_tac = Blast.blast_tac; \<close>
lemma ex1_functional: \<open>\<lbrakk>\<exists>! z. P(a,z); P(a,b); P(a,c)\<rbrakk> \<Longrightarrow> b = c\<close> by blast
text\<open>Elimination of \<open>True\<close> from assumptions:\<close> lemma True_implies_equals: \<open>(True \<Longrightarrow> PROP P) \<equiv> PROP P\<close> proof assume\<open>True \<Longrightarrow> PROP P\<close> from this and TrueI show\<open>PROP P\<close> . next assume\<open>PROP P\<close> thenshow\<open>PROP P\<close> . qed
lemma uncurry: \<open>P \<longrightarrow> Q \<longrightarrow> R \<Longrightarrow> P \<and> Q \<longrightarrow> R\<close> by blast
text\<open>
We do NOT distribute of \<open>\<forall>\<close> over \<open>\<and>\<close>, or dually that of \<open>\<exists>\<close> over \<open>\<or>\<close>.
Baaz and Leitsch, On Skolemization andProof Complexity (1994) show that
this step can increase proof length! \<close>
text\<open>Existential miniscoping.\<close> lemma int_ex_simps: \<open>\<And>P Q. (\<exists>x. P(x) \<and> Q) \<longleftrightarrow> (\<exists>x. P(x)) \<and> Q\<close> \<open>\<And>P Q. (\<exists>x. P \<and> Q(x)) \<longleftrightarrow> P \<and> (\<exists>x. Q(x))\<close> \<open>\<And>P Q. (\<exists>x. P(x) \<or> Q) \<longleftrightarrow> (\<exists>x. P(x)) \<or> Q\<close> \<open>\<And>P Q. (\<exists>x. P \<or> Q(x)) \<longleftrightarrow> P \<or> (\<exists>x. Q(x))\<close> by iprover+
text\<open>Classical rules.\<close> lemma cla_ex_simps: \<open>\<And>P Q. (\<exists>x. P(x) \<longrightarrow> Q) \<longleftrightarrow> (\<forall>x. P(x)) \<longrightarrow> Q\<close> \<open>\<And>P Q. (\<exists>x. P \<longrightarrow> Q(x)) \<longleftrightarrow> P \<longrightarrow> (\<exists>x. Q(x))\<close> by blast+
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.