src/HOL/NatDef.thy
author nipkow
Thu Oct 12 18:38:23 2000 +0200 (2000-10-12)
changeset 10212 33fe2d701ddd
parent 8943 a4f8be72f585
child 10832 e33b47e4246d
permissions -rw-r--r--
*** empty log message ***
nipkow@2608
     1
(*  Title:      HOL/NatDef.thy
nipkow@2608
     2
    ID:         $Id$
nipkow@2608
     3
    Author:     Tobias Nipkow, Cambridge University Computer Laboratory
nipkow@2608
     4
    Copyright   1991  University of Cambridge
nipkow@2608
     5
nipkow@2608
     6
Definition of types ind and nat.
nipkow@2608
     7
nipkow@2608
     8
Type nat is defined as a set Nat over type ind.
nipkow@2608
     9
*)
nipkow@2608
    10
nipkow@10212
    11
NatDef = Wellfounded_Recursion +
nipkow@2608
    12
nipkow@2608
    13
(** type ind **)
nipkow@2608
    14
wenzelm@3947
    15
global
wenzelm@3947
    16
nipkow@2608
    17
types
nipkow@2608
    18
  ind
nipkow@2608
    19
nipkow@2608
    20
arities
nipkow@2608
    21
  ind :: term
nipkow@2608
    22
nipkow@2608
    23
consts
nipkow@2608
    24
  Zero_Rep      :: ind
nipkow@2608
    25
  Suc_Rep       :: ind => ind
nipkow@2608
    26
nipkow@2608
    27
rules
nipkow@2608
    28
  (*the axiom of infinity in 2 parts*)
nipkow@2608
    29
  inj_Suc_Rep           "inj(Suc_Rep)"
nipkow@2608
    30
  Suc_Rep_not_Zero_Rep  "Suc_Rep(x) ~= Zero_Rep"
nipkow@2608
    31
nipkow@2608
    32
nipkow@2608
    33
nipkow@2608
    34
(** type nat **)
nipkow@2608
    35
nipkow@2608
    36
(* type definition *)
nipkow@2608
    37
nipkow@2608
    38
typedef (Nat)
nipkow@2608
    39
  nat = "lfp(%X. {Zero_Rep} Un (Suc_Rep``X))"   (lfp_def)
nipkow@2608
    40
nipkow@2608
    41
instance
paulson@8943
    42
  nat :: {ord, zero}
nipkow@2608
    43
nipkow@2608
    44
nipkow@2608
    45
(* abstract constants and syntax *)
nipkow@2608
    46
nipkow@2608
    47
consts
nipkow@2608
    48
  Suc       :: nat => nat
nipkow@2608
    49
  pred_nat  :: "(nat * nat) set"
nipkow@2608
    50
nipkow@2608
    51
syntax
nipkow@2608
    52
  "1"       :: nat                ("1")
nipkow@2608
    53
  "2"       :: nat                ("2")
nipkow@2608
    54
nipkow@2608
    55
translations
berghofe@5187
    56
  "1"  == "Suc 0"
berghofe@5187
    57
  "2"  == "Suc 1"
nipkow@2608
    58
nipkow@2608
    59
wenzelm@3947
    60
local
wenzelm@3947
    61
nipkow@2608
    62
defs
nipkow@2608
    63
  Zero_def      "0 == Abs_Nat(Zero_Rep)"
nipkow@2608
    64
  Suc_def       "Suc == (%n. Abs_Nat(Suc_Rep(Rep_Nat(n))))"
nipkow@2608
    65
berghofe@7872
    66
  (*nat operations*)
paulson@3236
    67
  pred_nat_def  "pred_nat == {(m,n). n = Suc m}"
nipkow@2608
    68
nipkow@2608
    69
  less_def      "m<n == (m,n):trancl(pred_nat)"
nipkow@2608
    70
nipkow@2608
    71
  le_def        "m<=(n::nat) == ~(n<m)"
nipkow@2608
    72
nipkow@2608
    73
end