lemma"[ x = f x; P(f x) ]==> P x" by (erule ssubst)
text‹ also provable by simp (re-orients) ›
text‹ the subst method @{thm[display] mult.commute} \rulename{mult.commute} this would fail: apply (simp add: mult.commute) ›
lemma"[P x y z; Suc x < y]==> f z = x*y" txt‹ @{subgoals[display,indent=0,margin=65]} › apply (subst mult.commute) txt‹ @{subgoals[display,indent=0,margin=65]} › oops
(*exercise involving THEN*) lemma"[P x y z; Suc x < y]==> f z = x*y" apply (rule mult.commute [THEN ssubst]) oops
lemma"[x = f x; triple (f x) (f x) x]==> triple x x x" apply (erule ssubst) 🍋‹@{subgoals[display,indent=0,margin=65]}› back🍋‹@{subgoals[display,indent=0,margin=65]}› back🍋‹@{subgoals[display,indent=0,margin=65]}› back🍋‹@{subgoals[display,indent=0,margin=65]}› back🍋‹@{subgoals[display,indent=0,margin=65]}› apply assumption done
lemma"[ x = f x; triple (f x) (f x) x ]==> triple x x x" apply (erule ssubst, assumption) done
text‹ or better still ›
lemma"[ x = f x; triple (f x) (f x) x ]==> triple x x x" by (erule ssubst)
lemma"[ x = f x; triple (f x) (f x) x ]==> triple x x x" apply (erule_tac P="λu. triple u u x"in ssubst) apply (assumption) done
lemma"[ x = f x; triple (f x) (f x) x ]==> triple x x x" by (erule_tac P="λu. triple u u x"in ssubst)
lemma"∀x. P x ⟶ P x" apply (rule allI) by (rule impI)
lemma"(∀x. P ⟶ Q x) ==> P ⟶ (∀x. Q x)" apply (rule impI, rule allI) apply (drule spec) by (drule mp)
text‹rename_tac› lemma"x < y ==>∀x y. P x (f y)" apply (intro allI) 🍋‹@{subgoals[display,indent=0,margin=65]}› apply (rename_tac v w) 🍋‹@{subgoals[display,indent=0,margin=65]}› oops
lemma"[∀x. P x ⟶ P (h x); P a]==> P(h (h a))" apply (frule spec) 🍋‹@{subgoals[display,indent=0,margin=65]}› apply (drule mp, assumption) apply (drule spec) 🍋‹@{subgoals[display,indent=0,margin=65]}› by (drule mp)
lemma"[∀x. P x ⟶ P (f x); P a]==> P(f (f a))" by blast
theorem Least_equality: "[ P (k::nat); ∀x. P x ⟶ k ≤ x ]==> (LEAST x. P(x)) = k" apply (simp add: Least_def)
txt‹ @{subgoals[display,indent=0,margin=65]} ›
apply (rule the_equality)
txt‹ @{subgoals[display,indent=0,margin=65]} first subgoal is existence; second is uniqueness › by (auto intro: order_antisym)
theorem axiom_of_choice: "(∀x. ∃y. P x y) ==>∃f. ∀x. P x (f x)" apply (rule exI, rule allI)
txt‹ @{subgoals[display,indent=0,margin=65]} state after intro rules › apply (drule spec, erule exE)
txt‹ @{subgoals[display,indent=0,margin=65]} applying @text{someI} automatically instantiates 🍋‹f› t ›
by (rule someI)
(*both can be done by blast, which however hasn't been introduced yet*) lemma"[| P (k::nat); ∀x. P x ⟶ k ≤ x |] ==> (LEAST x. P(x)) = k" apply (simp add: Least_def) by (blast intro: order_antisym)
theorem axiom_of_choice': "(∀x. ∃y. P x y) ==>∃f. ∀x. P x (f x)" apply (rule exI [of _ "λx. SOME y. P x y"]) by (blast intro: someI)
text‹end of Epsilon section›
lemma"(∃x. P x) ∨ (∃x. Q x) ==>∃x. P x ∨ Q x" apply (elim exE disjE) apply (intro exI disjI1) apply assumption apply (intro exI disjI2) apply assumption done
lemma"∀y. R y y ==>∃x. ∀y. R x y" apply (rule exI) 🍋‹@{subgoals[display,indent=0,margin=65]}› apply (rule allI) 🍋‹@{subgoals[display,indent=0,margin=65]}› apply (drule spec) 🍋‹@{subgoals[display,indent=0,margin=65]}› oops
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.