# HG changeset patch # User paulson # Date 978600153 -3600 # Node ID a5a6255748c3855f91487f2cf14c6dc4f06fc27c # Parent 985066e9495d261a0bd3956aa8963e01188358d0 initial material on the Reals diff -r 985066e9495d -r a5a6255748c3 doc-src/TutorialI/Types/Numbers.thy --- a/doc-src/TutorialI/Types/Numbers.thy Wed Jan 03 21:27:15 2001 +0100 +++ b/doc-src/TutorialI/Types/Numbers.thy Thu Jan 04 10:22:33 2001 +0100 @@ -2,7 +2,7 @@ theory Numbers = Real: ML "Pretty.setmargin 64" - +ML "IsarOutput.indent := 0" (*we don't want 5 for listing theorems*) text{* @@ -198,7 +198,8 @@ This last NOT a simprule -real_add_divide_distrib +@{thm[display] real_add_divide_distrib[no_vars]} +\rulename{real_add_divide_distrib} *} end diff -r 985066e9495d -r a5a6255748c3 doc-src/TutorialI/Types/document/Typedef.tex --- a/doc-src/TutorialI/Types/document/Typedef.tex Wed Jan 03 21:27:15 2001 +0100 +++ b/doc-src/TutorialI/Types/document/Typedef.tex Thu Jan 04 10:22:33 2001 +0100 @@ -104,7 +104,7 @@ \end{center} Constant \isa{three} is just an abbreviation (\isa{three{\isacharunderscore}def}): \begin{isabelle}% -\ \ \ \ \ three\ {\isasymequiv}\ {\isacharbraceleft}n{\isachardot}\ n\ {\isasymle}\ {\isadigit{2}}{\isacharbraceright}% +three\ {\isasymequiv}\ {\isacharbraceleft}n{\isachardot}\ n\ {\isasymle}\ {\isadigit{2}}{\isacharbraceright}% \end{isabelle} The situation is best summarized with the help of the following diagram, where squares are types and circles are sets: @@ -204,7 +204,7 @@ Expanding \isa{three{\isacharunderscore}def} yields the premise \isa{n\ {\isasymle}\ {\isadigit{2}}}. Repeated elimination with \isa{le{\isacharunderscore}SucE} \begin{isabelle}% -\ \ \ \ \ {\isasymlbrakk}{\isacharquery}m\ {\isasymle}\ Suc\ {\isacharquery}n{\isacharsemicolon}\ {\isacharquery}m\ {\isasymle}\ {\isacharquery}n\ {\isasymLongrightarrow}\ {\isacharquery}R{\isacharsemicolon}\ {\isacharquery}m\ {\isacharequal}\ Suc\ {\isacharquery}n\ {\isasymLongrightarrow}\ {\isacharquery}R{\isasymrbrakk}\ {\isasymLongrightarrow}\ {\isacharquery}R% +{\isasymlbrakk}{\isacharquery}m\ {\isasymle}\ Suc\ {\isacharquery}n{\isacharsemicolon}\ {\isacharquery}m\ {\isasymle}\ {\isacharquery}n\ {\isasymLongrightarrow}\ {\isacharquery}R{\isacharsemicolon}\ {\isacharquery}m\ {\isacharequal}\ Suc\ {\isacharquery}n\ {\isasymLongrightarrow}\ {\isacharquery}R{\isasymrbrakk}\ {\isasymLongrightarrow}\ {\isacharquery}R% \end{isabelle} reduces \isa{n\ {\isasymle}\ {\isadigit{2}}} to the three cases \isa{n\ {\isasymle}\ {\isadigit{0}}}, \isa{n\ {\isacharequal}\ {\isadigit{1}}} and \isa{n\ {\isacharequal}\ {\isadigit{2}}} which are trivial for simplification:% diff -r 985066e9495d -r a5a6255748c3 doc-src/TutorialI/Types/numerics.tex --- a/doc-src/TutorialI/Types/numerics.tex Wed Jan 03 21:27:15 2001 +0100 +++ b/doc-src/TutorialI/Types/numerics.tex Thu Jan 04 10:22:33 2001 +0100 @@ -1,8 +1,11 @@ Our examples until now have used the type of \textbf{natural numbers}, \isa{nat}. This is a recursive datatype generated by the constructors zero and successor, so it works well with inductive proofs and primitive -recursive function definitions. Isabelle/HOL also has the type \isa{int} -of \textbf{integers}, which gives up induction in exchange for proper subtraction. +recursive function definitions. Isabelle/HOL also has the type \isa{int} of +\textbf{integers}, which gives up induction in exchange for proper +subtraction. The logic HOL-Real also has the type \isa{real} of real +numbers. Isabelle has no subtyping, so the numeric types are distinct and +there are functions to convert between them. The integers are preferable to the natural numbers for reasoning about complicated arithmetic expressions. For example, a termination proof @@ -11,14 +14,6 @@ are usually easier if the integers are used rather than the natural numbers. -The logic Isabelle/HOL-Real also has the type \isa{real} of real numbers -and even the type \isa{hypreal} of non-standard reals. These -\textbf{hyperreals} include infinitesimals, which represent infinitely -small and infinitely large quantities; they greatly facilitate proofs -about limits, differentiation and integration. Isabelle has no subtyping, -so the numeric types are distinct and there are -functions to convert between them. - Many theorems involving numeric types can be proved automatically by Isabelle's arithmetic decision procedure, the method \isa{arith}. Linear arithmetic comprises addition, subtraction @@ -35,11 +30,9 @@ useful lemmas are shown below. \subsection{Numeric Literals} -\label{sec:numerals} Literals are available for the types of natural numbers, integers and reals and denote integer values of arbitrary size. -\REMARK{hypreal?} They begin with a number sign (\isa{\#}), have an optional minus sign (\isa{-}) and then one or more decimal digits. Examples are \isa{\#0}, \isa{\#-3} @@ -243,7 +236,7 @@ operators. The name \isa{zadd_ac} refers to the associativity and commutativity theorems for integer addition, while \isa{zmult_ac} has the analogous theorems for multiplication. The prefix~\isa{z} in many theorem -names recalls the use of $Z$ to denote the set of integers. +names recalls the use of $\Bbb{Z}$ to denote the set of integers. For division and remainder, the treatment of negative divisors follows traditional mathematical practice: the sign of the remainder follows that @@ -304,9 +297,79 @@ \subsection{The type of real numbers, {\tt\slshape real}} +The real numbers enjoy two significant properties that the integers lack. +They are +\textbf{dense}: between every two distinct real numbers there lies another. +This property follows from the division laws, since if $x