118 also have "... + 4 * (n + 1)^3 = ((n + 1) * ((n + 1) + 1))^Suc (Suc 0)" |
118 also have "... + 4 * (n + 1)^3 = ((n + 1) * ((n + 1) + 1))^Suc (Suc 0)" |
119 by (simp add: power_eq_if distrib) |
119 by (simp add: power_eq_if distrib) |
120 finally show "?P (Suc n)" by simp |
120 finally show "?P (Suc n)" by simp |
121 qed |
121 qed |
122 |
122 |
123 text {* Comparing these examples with the tactic script version |
123 text {* Note that in contrast to older traditions of tactical proof |
124 @{file "~~/src/HOL/ex/NatSum.thy"}, we note an important difference |
124 scripts, the structured proof applies induction on the original, |
125 of how induction vs.\ simplification is |
125 unsimplified statement. This allows to state the induction cases |
126 applied. While \cite[\S10]{isabelle-ref} advises for these examples |
126 robustly and conveniently. Simplification (or other automated) |
127 that ``induction should not be applied until the goal is in the |
127 methods are then applied in terminal position to solve certain |
128 simplest form'' this would be a very bad idea in our setting. |
128 sub-problems completely. |
129 |
129 |
130 Simplification normalizes all arithmetic expressions involved, |
130 As a general rule of good proof style, automatic methods such as |
131 producing huge intermediate goals. With applying induction |
131 $\idt{simp}$ or $\idt{auto}$ should normally be never used as |
132 afterwards, the Isar proof text would have to reflect the emerging |
132 initial proof methods with a nested sub-proof to address the |
133 configuration by appropriate sub-proofs. This would result in badly |
133 automatically produced situation, but only as terminal ones to solve |
134 structured, low-level technical reasoning, without any good idea of |
134 sub-problems. *} |
135 the actual point. |
|
136 |
|
137 \medskip As a general rule of good proof style, automatic methods |
|
138 such as $\idt{simp}$ or $\idt{auto}$ should normally be never used |
|
139 as initial proof methods, but only as terminal ones, solving certain |
|
140 goals completely. *} |
|
141 |
135 |
142 end |
136 end |