Database Reference
In-Depth Information
Definition 61
If
A
and
B
are any two objects in
DB
then their distance, denoted
by
d(A,B)
, is defined as follows:
Υ
if
A
B
;
d(A,B)
=
A
B
otherwise
.
The (binary) partial
distance relation
'
'on
closed
database objects is defined as
⊆
the inverse of the set inclusion relation '
'.
TA
): the
minimal distance is the total simple object
Υ
which is closed, the maximal distance
is the zero object
Notice that each
distance
is a
closed database object
(such that
A
=
0
which is closed, and any hom-object
B
A
(
B
A
⊥
=
TA
∩
TB
)is
the intersection of two closed objects, and hence a closed object as well.
Let us show that this definition of the distance for the databases satisfies the
general metric space properties.
A categorical version of a metric space under the name enriched category, or
V-category, is introduced in [
5
,
13
], where the distances become the hom-objects.
In this case, the definition of a database distance in the V-category
DB
(which is a
strictly symmetric monoidal category
(
DB
,
⊗
,Υ)
) is different, as we can see. For
Ob
DB
,
d(A,A)
=
Υ
⊃
A
A
.
example, for every
A
∈
Proposition 62
The transitivity law for the distance relation
and the triangle in-
equality
,
for any three simple databases A,B and C
,
d(A,B)
⊗
d(B,C)
d(A,C)
is valid in the database metric space
.
Moreover
,
•
There exists a strong link between the database PO-relation '
' and the distance
PO-relation '
'
,
-
A
B iff
∀
(C
A)(d(A,C)
d(B,C))
,
thus
-
A
B iff
∀
C(d(A,C)
=
d(B,C))
.
•
The distances in
DB
are locally closed
.
That is
,
for each object A there exists the
bijection
φ
:
d(A,B)
|
B
∈
Ob
DB
,B
A
→
DB
(A,A)
where
DB
(A,A) is the hom-set of all endomorphisms of A
.
Proof
The transitivity of
is valid because it is equal to the inverse set inclusion
⊆
−
1
. Let us show the triangle inequality:
1. If
A
C
then
d(B,C)
=
d(B,A)
=
d(A,B)
, thus
relation
d(A,B)
⊗
d(B,C)
=
d(A,B)
Υ
=
d(A,C).
2. If
A
C
then we have the following possibilities:
2.1. If
A
B
then
d(A,B)
⊗
d(B,C)
=
Υ
⊗
d(B,C)
=
d(B,C)
=
d(A,C)
(from
A
B
), i.e.,
d(A,B)
⊗
d(B,C)
d(A,C)
.
2.2. The case
B
C
is analogous to the case 2.1.
2.3. If
A
B
and
B
C
then
d(A,B)
⊗
d(B,C)
=
TA
∩
TB
∩
TC
⊆
TA
∩
=
⊗
TC
d(A,C)
, i.e.,
d(A,B)
d(B,C)
d(A,C)
.