src/HOL/Prod.thy
author clasohm
Fri, 03 Mar 1995 12:02:25 +0100
changeset 923 ff1574a81019
child 967 bfcb53497a99
permissions -rw-r--r--
new version of HOL with curried function application
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
923
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
     1
(*  Title:      HOL/Prod.thy
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
     2
    ID:         Prod.thy,v 1.5 1994/08/19 09:04:27 lcp Exp
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
     4
    Copyright   1992  University of Cambridge
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
     5
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
     6
Ordered Pairs and the Cartesian product type.
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
     7
The unit type.
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
     8
*)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
     9
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    10
Prod = Fun +
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    11
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    12
(** Products **)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    13
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    14
(* type definition *)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    15
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    16
consts
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    17
  Pair_Rep      :: "['a, 'b] => ['a, 'b] => bool"
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    18
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    19
defs
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    20
  Pair_Rep_def  "Pair_Rep == (%a b. %x y. x=a & y=b)"
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    21
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    22
subtype (Prod)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    23
  ('a, 'b) "*"          (infixr 20)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    24
    = "{f. ? a b. f = Pair_Rep (a::'a) (b::'b)}"
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    25
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    26
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    27
(* abstract constants and syntax *)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    28
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    29
consts
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    30
  fst           :: "'a * 'b => 'a"
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    31
  snd           :: "'a * 'b => 'b"
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    32
  split         :: "[['a, 'b] => 'c, 'a * 'b] => 'c"
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    33
  prod_fun      :: "['a => 'b, 'c => 'd, 'a * 'c] => 'b * 'd"
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    34
  Pair          :: "['a, 'b] => 'a * 'b"
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    35
  Sigma         :: "['a set, 'a => 'b set] => ('a * 'b) set"
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    36
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    37
syntax
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    38
  "@Tuple"      :: "args => 'a * 'b"            ("(1<_>)")
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    39
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    40
translations
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    41
  "<x, y, z>"   == "<x, <y, z>>"
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    42
  "<x, y>"      == "Pair x y"
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    43
  "<x>"         => "x"
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    44
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    45
defs
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    46
  Pair_def      "Pair a b == Abs_Prod(Pair_Rep a b)"
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    47
  fst_def       "fst(p) == @a. ? b. p = <a, b>"
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    48
  snd_def       "snd(p) == @b. ? a. p = <a, b>"
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    49
  split_def     "split c p == c (fst p) (snd p)"
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    50
  prod_fun_def  "prod_fun f g == split(%x y.<f(x), g(y)>)"
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    51
  Sigma_def     "Sigma A B == UN x:A. UN y:B(x). {<x, y>}"
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    52
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    53
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    54
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    55
(** Unit **)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    56
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    57
subtype (Unit)
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    58
  unit = "{p. p = True}"
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    59
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    60
consts
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    61
  Unity         :: "unit"                       ("<>")
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    62
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    63
defs
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    64
  Unity_def     "Unity == Abs_Unit(True)"
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    65
ff1574a81019 new version of HOL with curried function application
clasohm
parents:
diff changeset
    66
end