text‹Classical implies (‹⟶›) elimination.› lemma impCE: assumes major: ‹P ⟶ Q› and r1: ‹¬ P ==> R› and r2: ‹Q ==> R› shows‹R› apply (rule excluded_middle [THEN disjE]) apply (erule r1) apply (rule r2) apply (erule major [THEN mp]) done
text‹
This version of ‹⟶› elimination works on ‹Q› before ‹P›. It works best for those cases in which P holds ``almost everywhere''.
Can't install as default: would break old proofs. › lemma impCE': assumes major: ‹P ⟶ Q› and r1: ‹Q ==> R› and r2: ‹¬ P ==> R› shows‹R› apply (rule excluded_middle [THEN disjE]) apply (erule r2) apply (rule r1) apply (erule major [THEN mp]) done
(*Better for fast_tac: needs no quantifier duplication!*) lemma alt_ex1E: assumes major: ‹∃! x. P(x)› and r: ‹∧x. [P(x); ∀y y'. P(y) \ P(y') ⟶ y = y'\ \ R\ shows‹R› using major proof (rule ex1E) fix x assume * : ‹∀y. P(y) ⟶ y = x› assume‹P(x)› thenshow‹R› proof (rule r)
{ fix y y' assume‹P(y)›and‹P(y')\ with * have‹x = y›and‹x = y'\ by - (tactic "IntPr.fast_tac \<^context> 1")+ thenhave‹y = y'\ by (rule subst)
} note r' = this show‹∀y y'. P(y) \ P(y') ⟶ y = y'\ by (intro strip, elim conjE) (rule r') qed qed
lemma imp_elim: ‹P ⟶ Q ==> (¬ R ==> P) ==> (Q ==> R) ==> R› by (rule classical) iprover
lemma swap: ‹¬ P ==> (¬ R ==> P) ==> R› by (rule classical) iprover
section‹Classical Reasoner›
ML ‹ 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; ›
(*Quantifier rules*) lemmas [intro!] = allI ex_ex1I and [intro] = exI and [elim!] = exE alt_ex1E and [elim] = allE
ML ‹val FOL_cs = claset_of 🍋›
ML ‹ structure Blast = Blast
( structure Classical = Cla
val Trueprop_const = dest_Const 🍋‹Trueprop›
val equality_name = 🍋‹eq›
val not_name = 🍋‹Not›
val notE = @{thmnotE}
val ccontr = @{thm ccontr}
val hyp_subst_tac = Hypsubst.blast_hyp_subst_tac
);
val blast_tac = Blast.blast_tac; ›
lemma ex1_functional: ‹[∃! z. P(a,z); P(a,b); P(a,c)]==> b = c› by blast
text‹Elimination of ‹True›from assumptions:› lemma True_implies_equals: ‹(True ==>PROP P) ≡PROP P› proof assume‹True ==>PROP P› from this and TrueI show‹PROP P› . next assume‹PROP P› thenshow‹PROP P› . qed
text‹Proper handling of non-atomic rule statements.›
context begin
qualified definition‹induct_forall(P) ≡∀x. P(x)›
qualified definition‹induct_implies(A, B) ≡ A ⟶ B›
qualified definition‹induct_equal(x, y) ≡ x = y›
qualified definition‹induct_conj(A, B) ≡ A ∧ B›
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 und die Messung sind noch experimentell.