src/Doc/How_to_Prove_it/How_to_Prove_it.thy
changeset 69505 cc2d676d5395
parent 67406 23307fd33906
child 69597 ff784d5a5bfb
equal deleted inserted replaced
69504:bda7527ccf05 69505:cc2d676d5395
    15 \begin{quote}
    15 \begin{quote}
    16 @{thm less_induct}
    16 @{thm less_induct}
    17 \end{quote}
    17 \end{quote}
    18 This is often called ``complete induction''. It is applied like this:
    18 This is often called ``complete induction''. It is applied like this:
    19 \begin{quote}
    19 \begin{quote}
    20 (@{text"induction n rule: less_induct"})
    20 (\<open>induction n rule: less_induct\<close>)
    21 \end{quote}
    21 \end{quote}
    22 In fact, it is not restricted to @{typ nat} but works for any wellfounded
    22 In fact, it is not restricted to @{typ nat} but works for any wellfounded
    23 order @{text"<"}.
    23 order \<open><\<close>.
    24 
    24 
    25 There are many more special induction rules. You can find all of them
    25 There are many more special induction rules. You can find all of them
    26 via the Find button (in Isabelle/jedit) with the following search criteria:
    26 via the Find button (in Isabelle/jedit) with the following search criteria:
    27 \begin{quote}
    27 \begin{quote}
    28 \texttt{name: Nat name: induct}
    28 \texttt{name: Nat name: induct}
    37 \<close>
    37 \<close>
    38 
    38 
    39 lemma fixes x :: int shows "x ^ 3 = x * x * x"
    39 lemma fixes x :: int shows "x ^ 3 = x * x * x"
    40 by (simp add: numeral_eq_Suc)
    40 by (simp add: numeral_eq_Suc)
    41 
    41 
    42 text\<open>This is a typical situation: function ``@{text"^"}'' is defined
    42 text\<open>This is a typical situation: function ``\<open>^\<close>'' is defined
    43 by pattern matching on @{const Suc} but is applied to a numeral.
    43 by pattern matching on @{const Suc} but is applied to a numeral.
    44 
    44 
    45 Note: simplification with @{thm[source] numeral_eq_Suc} will convert all numerals.
    45 Note: simplification with @{thm[source] numeral_eq_Suc} will convert all numerals.
    46 One can be more specific with the lemmas @{thm [source] numeral_2_eq_2}
    46 One can be more specific with the lemmas @{thm [source] numeral_2_eq_2}
    47 (@{thm numeral_2_eq_2}) and @{thm[source] numeral_3_eq_3} (@{thm numeral_3_eq_3}).
    47 (@{thm numeral_2_eq_2}) and @{thm[source] numeral_3_eq_3} (@{thm numeral_3_eq_3}).
    72 
    72 
    73 %Tobias Nipkow
    73 %Tobias Nipkow
    74 \section{Algebraic simplification}
    74 \section{Algebraic simplification}
    75 
    75 
    76 On the numeric types @{typ nat}, @{typ int} and @{typ real},
    76 On the numeric types @{typ nat}, @{typ int} and @{typ real},
    77 proof method @{text simp} and friends can deal with a limited amount of linear
    77 proof method \<open>simp\<close> and friends can deal with a limited amount of linear
    78 arithmetic (no multiplication except by numerals) and method @{text arith} can
    78 arithmetic (no multiplication except by numerals) and method \<open>arith\<close> can
    79 handle full linear arithmetic (on @{typ nat}, @{typ int} including quantifiers).
    79 handle full linear arithmetic (on @{typ nat}, @{typ int} including quantifiers).
    80 But what to do when proper multiplication is involved?
    80 But what to do when proper multiplication is involved?
    81 At this point it can be helpful to simplify with the lemma list
    81 At this point it can be helpful to simplify with the lemma list
    82 @{thm [source] algebra_simps}. Examples:
    82 @{thm [source] algebra_simps}. Examples:
    83 \<close>
    83 \<close>