Theory Tacticals
theory Tacticals imports Main begin
text‹REPEAT›
lemma "⟦P⟶Q; Q⟶R; R⟶S; P⟧ ⟹ S"
apply (drule mp, assumption)
apply (drule mp, assumption)
apply (drule mp, assumption)
apply (assumption)
done
lemma "⟦P⟶Q; Q⟶R; R⟶S; P⟧ ⟹ S"
by (drule mp, assumption)+
text‹ORELSE with REPEAT›
lemma "⟦Q⟶R; P⟶Q; x<5⟶P; Suc x < 5⟧ ⟹ R"
by (drule mp, (assumption|arith))+
text‹exercise: what's going on here?›
lemma "⟦P∧Q⟶R; P⟶Q; P⟧ ⟹ R"
by (drule mp, (intro conjI)?, assumption+)+
text‹defer and prefer›
lemma "hard ∧ (P ∨ ~P) ∧ (Q⟶Q)"
apply (intro conjI)
defer 1
apply blast+
oops
lemma "ok1 ∧ ok2 ∧ doubtful"
apply (intro conjI)
prefer 3
oops
lemma "bigsubgoal1 ∧ bigsubgoal2 ∧ bigsubgoal3 ∧ bigsubgoal4 ∧ bigsubgoal5 ∧ bigsubgoal6"
apply (intro conjI)
txt‹@{subgoals[display,indent=0,margin=65]}
A total of 6 subgoals...
›
oops
lemma "(P∨Q) ∧ (R∨S) ⟹ PP"
apply (elim conjE disjE)
oops
lemma "((P∨Q) ∧ R) ∧ (Q ∧ (P∨S)) ⟹ PP"
apply (elim conjE)
oops
lemma "((P∨Q) ∧ R) ∧ (Q ∧ (P∨S)) ⟹ PP"
apply (erule conjE)+
oops
end