src/FOLP/ex/Nat.thy
changeset 17480 fd19f77dcf60
parent 1477 4c51ab632cda
child 25991 31b38a39e589
     1.1 --- a/src/FOLP/ex/Nat.thy	Sat Sep 17 20:49:14 2005 +0200
     1.2 +++ b/src/FOLP/ex/Nat.thy	Sun Sep 18 14:25:48 2005 +0200
     1.3 @@ -2,15 +2,16 @@
     1.4      ID:         $Id$
     1.5      Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
     1.6      Copyright   1992  University of Cambridge
     1.7 -
     1.8 -Examples for the manual "Introduction to Isabelle"
     1.9 -
    1.10 -Theory of the natural numbers: Peano's axioms, primitive recursion
    1.11  *)
    1.12  
    1.13 -Nat = IFOLP +
    1.14 -types   nat
    1.15 -arities nat         :: term
    1.16 +header {* Theory of the natural numbers: Peano's axioms, primitive recursion *}
    1.17 +
    1.18 +theory Nat
    1.19 +imports FOLP
    1.20 +begin
    1.21 +
    1.22 +typedecl nat
    1.23 +arities nat         :: "term"
    1.24  consts  "0"         :: "nat"    ("0")
    1.25          Suc         :: "nat=>nat"
    1.26          rec         :: "[nat, 'a, [nat,'a]=>'a] => 'a"
    1.27 @@ -18,19 +19,24 @@
    1.28  
    1.29    (*Proof terms*)
    1.30         nrec         :: "[nat,p,[nat,p]=>p]=>p"
    1.31 -       ninj,nneq    :: "p=>p"
    1.32 -       rec0, recSuc :: "p"
    1.33 +       ninj         :: "p=>p"
    1.34 +       nneq         :: "p=>p"
    1.35 +       rec0         :: "p"
    1.36 +       recSuc       :: "p"
    1.37 +
    1.38 +axioms
    1.39 +  induct:     "[| b:P(0); !!x u. u:P(x) ==> c(x,u):P(Suc(x))
    1.40 +              |] ==> nrec(n,b,c):P(n)"
    1.41  
    1.42 -rules   
    1.43 -  induct     "[| b:P(0); !!x u. u:P(x) ==> c(x,u):P(Suc(x)) 
    1.44 -             |] ==> nrec(n,b,c):P(n)"
    1.45 -  
    1.46 -  Suc_inject "p:Suc(m)=Suc(n) ==> ninj(p) : m=n"
    1.47 -  Suc_neq_0  "p:Suc(m)=0      ==> nneq(p) : R"
    1.48 -  rec_0      "rec0 : rec(0,a,f) = a"
    1.49 -  rec_Suc    "recSuc : rec(Suc(m), a, f) = f(m, rec(m,a,f))"
    1.50 -  add_def    "m+n == rec(m, n, %x y. Suc(y))"
    1.51 +  Suc_inject: "p:Suc(m)=Suc(n) ==> ninj(p) : m=n"
    1.52 +  Suc_neq_0:  "p:Suc(m)=0      ==> nneq(p) : R"
    1.53 +  rec_0:      "rec0 : rec(0,a,f) = a"
    1.54 +  rec_Suc:    "recSuc : rec(Suc(m), a, f) = f(m, rec(m,a,f))"
    1.55 +  add_def:    "m+n == rec(m, n, %x y. Suc(y))"
    1.56  
    1.57 -  nrecB0     "b: A ==> nrec(0,b,c) = b : A"
    1.58 -  nrecBSuc   "c(n,nrec(n,b,c)) : A ==> nrec(Suc(n),b,c) = c(n,nrec(n,b,c)) : A"
    1.59 +  nrecB0:     "b: A ==> nrec(0,b,c) = b : A"
    1.60 +  nrecBSuc:   "c(n,nrec(n,b,c)) : A ==> nrec(Suc(n),b,c) = c(n,nrec(n,b,c)) : A"
    1.61 +
    1.62 +ML {* use_legacy_bindings (the_context ()) *}
    1.63 +
    1.64  end