src/FOL/ex/Nat.thy
author lcp
Tue, 03 May 1994 15:00:00 +0200
changeset 352 fd3ab8bcb69d
parent 0 a5a9c433f639
child 1322 9b3d3362a048
permissions -rw-r--r--
removal of obsolete type-declaration syntax
clasohm@0
     1
(*  Title: 	FOL/ex/nat.thy
clasohm@0
     2
    ID:         $Id$
clasohm@0
     3
    Author: 	Lawrence C Paulson, Cambridge University Computer Laboratory
clasohm@0
     4
    Copyright   1992  University of Cambridge
clasohm@0
     5
clasohm@0
     6
Examples for the manual "Introduction to Isabelle"
clasohm@0
     7
clasohm@0
     8
Theory of the natural numbers: Peano's axioms, primitive recursion
clasohm@0
     9
clasohm@0
    10
INCOMPATIBLE with nat2.thy, Nipkow's example
clasohm@0
    11
*)
clasohm@0
    12
clasohm@0
    13
Nat = FOL +
lcp@352
    14
types   nat
lcp@352
    15
arities nat :: term
lcp@352
    16
consts  "0" :: "nat"    ("0")
lcp@352
    17
        Suc :: "nat=>nat"
lcp@352
    18
        rec :: "[nat, 'a, [nat,'a]=>'a] => 'a"
lcp@352
    19
        "+" :: "[nat, nat] => nat"              (infixl 60)
clasohm@0
    20
rules   induct      "[| P(0);  !!x. P(x) ==> P(Suc(x)) |]  ==> P(n)"
clasohm@0
    21
        Suc_inject  "Suc(m)=Suc(n) ==> m=n"
clasohm@0
    22
        Suc_neq_0   "Suc(m)=0      ==> R"
clasohm@0
    23
        rec_0       "rec(0,a,f) = a"
clasohm@0
    24
        rec_Suc     "rec(Suc(m), a, f) = f(m, rec(m,a,f))"
clasohm@0
    25
        add_def     "m+n == rec(m, n, %x y. Suc(y))"
clasohm@0
    26
end