Theory IFOL_examples
section‹Examples of Intuitionistic Reasoning›
theory IFOL_examples imports IFOL begin
text‹Quantifier example from the book Logic and Computation›
lemma "(EX y. ALL x. Q(x,y)) --> (ALL x. EX y. Q(x,y))"
apply (rule impI)
apply (rule allI)
apply (rule exI)
apply (erule exE)
apply (erule allE)
txt‹Now ‹apply assumption› fails›
oops
text‹Trying again, with the same first two steps›
lemma "(EX y. ALL x. Q(x,y)) --> (ALL x. EX y. Q(x,y))"
apply (rule impI)
apply (rule allI)
apply (erule exE)
apply (rule exI)
apply (erule allE)
apply assumption
done
lemma "(EX y. ALL x. Q(x,y)) --> (ALL x. EX y. Q(x,y))"
by (tactic ‹IntPr.fast_tac \<^context> 1›)
text‹Example of Dyckhoff's method›
lemma "~ ~ ((P-->Q) | (Q-->P))"
apply (unfold not_def)
apply (rule impI)
apply (erule disj_impE)
apply (erule imp_impE)
apply (erule imp_impE)
apply assumption
apply (erule FalseE)+
done
end