2906
|
1 |
(* Title: HOL/Quot/NPAIR.thy
|
|
2 |
ID: $Id$
|
|
3 |
Author: Oscar Slotosch
|
|
4 |
Copyright 1997 Technische Universitaet Muenchen
|
|
5 |
|
|
6 |
Example: define a PER on pairs of natural numbers (with embedding)
|
|
7 |
|
|
8 |
*)
|
|
9 |
NPAIR = Arith + Prod + PER + (* representation for rational numbers *)
|
|
10 |
|
|
11 |
types np = "(nat * nat)" (* is needed for datatype *)
|
|
12 |
|
|
13 |
datatype NP = abs_NP np
|
|
14 |
|
|
15 |
consts rep_NP :: "NP => nat * nat"
|
|
16 |
|
|
17 |
defs rep_NP_def "rep_NP x == (case x of abs_NP y => y)"
|
|
18 |
|
|
19 |
(* NPAIR (continued) *)
|
|
20 |
defs per_NP_def
|
3842
|
21 |
"eqv ==(%x y. fst(rep_NP x)*snd(rep_NP y)=fst(rep_NP y)*snd(rep_NP x))"
|
2906
|
22 |
|
|
23 |
(* for proves of this rule see [Slo97diss] *)
|
|
24 |
rules
|
|
25 |
per_trans_NP "[| eqv (x::NP) y;eqv y z |] ==> eqv x z"
|
|
26 |
end |