doc-src/TutorialI/Types/numerics.tex
changeset 13750 b5cd10cb106b
parent 12333 ef43a3d6e962
child 13979 4c3a638828b9
equal deleted inserted replaced
13749:6844c38d74df 13750:b5cd10cb106b
   361 is
   361 is
   362 $\isa{a} = 7$, $\isa{b} = 2$ and $\isa{c} = -3$, when the left-hand side of
   362 $\isa{a} = 7$, $\isa{b} = 2$ and $\isa{c} = -3$, when the left-hand side of
   363 \isa{zdiv_zmult2_eq} is $-2$ while the right-hand side is~$-1$.%
   363 \isa{zdiv_zmult2_eq} is $-2$ while the right-hand side is~$-1$.%
   364 \index{integers|)}\index{*int (type)|)}
   364 \index{integers|)}\index{*int (type)|)}
   365 
   365 
       
   366 Induction is less important for integers than it is for the natural numbers, but it can be valuable if the range of integers has a lower or upper bound.  There are four rules for integer induction, corresponding to the possible relations of the bound ($\ge$, $>$, $\le$ and $<$):
       
   367 \begin{isabelle}
       
   368 \isasymlbrakk k\ \isasymle \ i;\ P\ k;\ \isasymAnd i.\ \isasymlbrakk k\ \isasymle \ i;\ P\ i\isasymrbrakk \ \isasymLongrightarrow \ P(i+1)\isasymrbrakk \ \isasymLongrightarrow \ P\ i%
       
   369 \rulename{int_ge_induct}\isanewline
       
   370 \isasymlbrakk k\ <\ i;\ P(k+1);\ \isasymAnd i.\ \isasymlbrakk k\ <\ i;\ P\ i\isasymrbrakk \ \isasymLongrightarrow \ P(i+1)\isasymrbrakk \ \isasymLongrightarrow \ P\ i%
       
   371 \rulename{int_gr_induct}\isanewline
       
   372 \isasymlbrakk i\ \isasymle \ k;\ P\ k;\ \isasymAnd i.\ \isasymlbrakk i\ \isasymle \ k;\ P\ i\isasymrbrakk \ \isasymLongrightarrow \ P(i-1)\isasymrbrakk \ \isasymLongrightarrow \ P\ i%
       
   373 \rulename{int_le_induct}\isanewline
       
   374 \isasymlbrakk i\ <\ k;\ P(k-1);\ \isasymAnd i.\ \isasymlbrakk i\ <\ k;\ P\ i\isasymrbrakk \ \isasymLongrightarrow \ P(i-1)\isasymrbrakk \ \isasymLongrightarrow \ P\ i%
       
   375 \rulename{int_less_induct}
       
   376 \end{isabelle}
       
   377 
   366 
   378 
   367 \subsection{The Type of Real Numbers, {\tt\slshape real}}
   379 \subsection{The Type of Real Numbers, {\tt\slshape real}}
   368 
   380 
   369 \index{real numbers|(}\index{*real (type)|(}%
   381 \index{real numbers|(}\index{*real (type)|(}%
   370 The real numbers enjoy two significant properties that the integers lack. 
   382 The real numbers enjoy two significant properties that the integers lack.