0
|
1 |
(* Title: HOL/prod
|
|
2 |
ID: $Id$
|
|
3 |
Author: Lawrence C Paulson, Cambridge University Computer Laboratory
|
|
4 |
Copyright 1992 University of Cambridge
|
|
5 |
|
|
6 |
Ordered Pairs and the Cartesian product type
|
|
7 |
The unit type
|
|
8 |
|
|
9 |
The type definition admits the following unused axiom:
|
|
10 |
Abs_Unit_inverse "f: Unit ==> Rep_Unit(Abs_Unit(f)) = f"
|
|
11 |
*)
|
|
12 |
|
|
13 |
Prod = Set +
|
51
|
14 |
|
0
|
15 |
types
|
51
|
16 |
('a,'b) "*" (infixr 20)
|
|
17 |
unit
|
|
18 |
|
0
|
19 |
arities
|
51
|
20 |
"*" :: (term,term)term
|
|
21 |
unit :: term
|
|
22 |
|
0
|
23 |
consts
|
51
|
24 |
Pair_Rep :: "['a,'b] => ['a,'b] => bool"
|
|
25 |
Prod :: "('a => 'b => bool)set"
|
|
26 |
Rep_Prod :: "'a * 'b => ('a => 'b => bool)"
|
|
27 |
Abs_Prod :: "('a => 'b => bool) => 'a * 'b"
|
|
28 |
fst :: "'a * 'b => 'a"
|
|
29 |
snd :: "'a * 'b => 'b"
|
|
30 |
split :: "['a * 'b, ['a,'b]=>'c] => 'c"
|
|
31 |
prod_fun :: "['a=>'b, 'c=>'d, 'a*'c] => 'b*'d"
|
|
32 |
Pair :: "['a,'b] => 'a * 'b"
|
|
33 |
"@Tuple" :: "args => 'a*'b" ("(1<_>)")
|
|
34 |
Sigma :: "['a set, 'a => 'b set] => ('a*'b)set"
|
0
|
35 |
|
51
|
36 |
Unit :: "bool set"
|
|
37 |
Rep_Unit :: "unit => bool"
|
|
38 |
Abs_Unit :: "bool => unit"
|
|
39 |
Unity :: "unit" ("<>")
|
0
|
40 |
|
|
41 |
translations
|
|
42 |
|
|
43 |
"<x,y,z>" == "<x,<y,z>>"
|
|
44 |
"<x,y>" == "Pair(x,y)"
|
|
45 |
"<x>" => "x"
|
|
46 |
|
|
47 |
rules
|
|
48 |
|
|
49 |
Pair_Rep_def "Pair_Rep == (%a b. %x y. x=a & y=b)"
|
|
50 |
Prod_def "Prod == {f. ? a b. f = Pair_Rep(a,b)}"
|
|
51 |
(*faking a type definition...*)
|
|
52 |
Rep_Prod "Rep_Prod(p): Prod"
|
|
53 |
Rep_Prod_inverse "Abs_Prod(Rep_Prod(p)) = p"
|
|
54 |
Abs_Prod_inverse "f: Prod ==> Rep_Prod(Abs_Prod(f)) = f"
|
|
55 |
(*defining the abstract constants*)
|
|
56 |
Pair_def "Pair(a,b) == Abs_Prod(Pair_Rep(a,b))"
|
|
57 |
fst_def "fst(p) == @a. ? b. p = <a,b>"
|
|
58 |
snd_def "snd(p) == @b. ? a. p = <a,b>"
|
|
59 |
split_def "split(p,c) == c(fst(p),snd(p))"
|
|
60 |
prod_fun_def "prod_fun(f,g) == (%z.split(z, %x y.<f(x), g(y)>))"
|
|
61 |
Sigma_def "Sigma(A,B) == UN x:A. UN y:B(x). {<x,y>}"
|
|
62 |
|
|
63 |
Unit_def "Unit == {p. p=True}"
|
|
64 |
(*faking a type definition...*)
|
|
65 |
Rep_Unit "Rep_Unit(u): Unit"
|
|
66 |
Rep_Unit_inverse "Abs_Unit(Rep_Unit(u)) = u"
|
|
67 |
(*defining the abstract constants*)
|
|
68 |
Unity_def "Unity == Abs_Unit(True)"
|
|
69 |
end
|