src/ZF/Finite.thy
author paulson
Tue Aug 01 15:28:21 2000 +0200 (2000-08-01)
changeset 9491 1a36151ee2fc
parent 6053 8a1059aa01f0
child 12175 5cf58a1799a7
permissions -rw-r--r--
natify, a coercion to reduce the number of type constraints in arithmetic
clasohm@1478
     1
(*  Title:      ZF/Finite.thy
lcp@516
     2
    ID:         $Id$
clasohm@1478
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
lcp@516
     4
    Copyright   1994  University of Cambridge
lcp@516
     5
lcp@516
     6
Finite powerset operator
lcp@516
     7
*)
lcp@516
     8
paulson@9491
     9
Finite = Inductive + Nat +
paulson@9491
    10
paulson@9491
    11
setup setup_datatypes
paulson@9491
    12
paulson@9491
    13
(*The natural numbers as a datatype*)
paulson@9491
    14
rep_datatype 
paulson@9491
    15
  elim		natE
paulson@9491
    16
  induct	nat_induct
paulson@9491
    17
  case_eqns	nat_case_0, nat_case_succ
paulson@9491
    18
  recursor_eqns recursor_0, recursor_succ
paulson@9491
    19
paulson@9491
    20
lcp@534
    21
consts
clasohm@1478
    22
  Fin       :: i=>i
clasohm@1478
    23
  FiniteFun :: [i,i]=>i         ("(_ -||>/ _)" [61, 60] 60)
lcp@534
    24
lcp@516
    25
inductive
lcp@516
    26
  domains   "Fin(A)" <= "Pow(A)"
lcp@516
    27
  intrs
lcp@516
    28
    emptyI  "0 : Fin(A)"
lcp@516
    29
    consI   "[| a: A;  b: Fin(A) |] ==> cons(a,b) : Fin(A)"
paulson@6053
    30
  type_intrs empty_subsetI, cons_subsetI, PowI
lcp@516
    31
  type_elims "[make_elim PowD]"
lcp@534
    32
lcp@534
    33
inductive
lcp@534
    34
  domains   "FiniteFun(A,B)" <= "Fin(A*B)"
lcp@534
    35
  intrs
lcp@534
    36
    emptyI  "0 : A -||> B"
clasohm@1155
    37
    consI   "[| a: A;  b: B;  h: A -||> B;  a ~: domain(h)   
clasohm@1478
    38
             |] ==> cons(<a,b>,h) : A -||> B"
lcp@534
    39
  type_intrs "Fin.intrs"
lcp@516
    40
end