(*<*) theory Exercise imports Main begin (*>*) section {* Isar *} subsection {* Propositional Logic *} text {* $\rhd$ Provide Isar proof texts that prove the following lemmas. You may only use the methods @{text rule} and @{text -}. \medskip *} lemma "(A \ A) = (A \ A)" proof assume "A \ A" show "A \ A" sorry next assume "A \ A" show "A \ A" sorry qed lemma "(A \ B) \ C \ A \ (B \ C)" oops subsection {* Predicate Logic *} text {* $\rhd$ Provide Isar proof texts that prove the following lemmas. Again, you may not use automation. \medskip *} lemma "((\ x. P x) \ (\ x. Q x)) = (\ x. (P x \ Q x))" oops lemma "((\ x. P x) \ (\ x. Q x)) = (\ x. (P x \ Q x))" oops text {* The following lemma also requires @{text "classical:"}~@{thm classical[no_vars]} (or an equivalent theorem) in order to be proved. You need to invoke this explicitly with \textbf{proof} @{text "rule classical"} or similar. *} lemma "(\ (\ x. P x)) = (\ x. \ P x)" oops text {* \textit{Hint:} it may be useful to study the natural deduction proofs of these lemmas before attempting to provide Isar proofs. *} section {* Rich Grandfather *} text {* Recall the ``Rich Grandfather'' riddle (Exercises~2). {\it If every poor man has a rich father,\\ then there is a rich man who has a rich grandfather.} $\rhd$ Give an Isar proof of the theorem. You may use automated tactics, but the general proof structure should resemble your informal pen-and-paper proof of the theorem. *} theorem "\x. \ rich x \ rich (father x) \ \x. rich (father (father x)) \ rich x" oops (*<*) end (*>*)