7.1   DB (Database) category

Based on an observational point of view for relational databases, based on the power-view operator T introduced in Section A.3.2 in the Appendix, and on the theory of R-algebras for mapping operads, presented in Section A.3.5 by Definition 66 in the Appendix, we are able to introduce a category DB [ 61 ] for instance-databases and view-based mappings between them, with the set of its objects Ob DB and the set of its morphisms Mor DB .

For the instance-database mappings, in Section A.3.4 and Example 31 in the Appendix, we considered the R-algebras that transform the set of schema-mapping operad’s operations M A B \= MakeOperads ( M A B ) \= { q 1 , … , q k , 1 r ∅ } , of a given schema mapping M A B : A → B , into the set of functions 1 α ∗ ( M A B ) \= { α ( q 1 ) , … , α ( q k ) , q ⊥ } . Consequently, each morphism in the base denotational DB category has to be a set of functions from an instance-database A into an instance-database B (of schemas A and B , respectively).

However, we need to characterize such an instance-mapping morphism also by its information flux (introduced in Definition 67 in the Appendix) corresponding to this set of functions obtained from a mapping interpretation α (in Definition 66 ) of operad’s operations q i above.

In order to facilitate the presentation of the properties of this category, we will begin with simple objects and simple arrows, and then extend all to complex objects and complex arrows. In this section, we will establish the principal properties for the objects and morphisms in DB , and after that we will consider in dedicated sections the other particular properties.

Theorem 10. Let us define, for a fixed enough big universe U \= dom ⋃ SK where dom is a finite set of values and SK \= { ω 0 , ω 1 , . , , } infinite set of indexed Skolem constants, the sets of objects Ob DB and morphisms Mor DB of this DB category:

1.

A simple object is an instance-database A, composed of an set of n-ary (finite n ≥ 0 ) relations R i \= a i ∈ A , i \= 1 , 2 , … also called “elements of A” with unique nullary empty relation ⊥ ∈ A such that A ⋂ ⊥ 0 \= ⊥ 0 \= { ⊥ } .

Complex objects are obtained by disjunctive union of simple objects.

A closed object is an instance-database A such that A \= T A ≜ T ( A ) .

By Υ , we denote the top-closed object in DB , such that Υ \= ⋃ A ∈ Ob DB A .

2.

Let us define the set: S DB \= ⋃ A , B ∈ Ob DB { ( α ∗ ( M A B ) , Flux ( α , M A B ) ) ∣ M A B : A → B is a simple atomic sketch’s mapping or a complex ⨄ -atomic sketch’s mapping, and α is a mapping interpretation such that A \= α ∗ ( A ) , B \= α ∗ ( B ) } .

The set of morphisms includes atomic morphisms in π 1 ( S DB ) and all other morphisms that can be obtained by well-defined compositions of atomic morphisms.

3.

We define recursively the mapping B ⊤ : Mor DB → Ob DB such that for any simple morphism f : A → B :

B ⊤ ( f ) ≜ f ˜ if ( f , f ˜ ) ∈ S DB ; B ⊤ ( g ) ⋂ B ⊤ ( h ) otherwise ( when f \= g ∘ h , h , g ∈ Mor DB with cod ( h ) \= dom ( g ) ) .

These sets of objects and morphisms define the principal part of database category DB . The extension of the mapping B ⊤ to complex arrows (and their compositions) obtained by structural operators _ ⨄ _ , [ _ , _ ] , ⟨ _ , _ ⟩ and ⌈ _ , _ ⌋ is given in this section by Definition 41 .

Proof.

For each simple object A \= α ∗ ( A ) , we have its identity morphism id A : A → A where id A \= α ∗ ( MakeOperads ( { ⋀ { ∀ x i ( r i ( x i ) ⇒ r i ( x i ) ) ∣ r i ∈ A } } ) ) \= α ∗ ( { 1 r i ∈ O ( r i , r i ) ∣ r i ∈ A } ⋃ { 1 r ∅ } ) \= { id r i : α ( r i ) → α ( r i ) ∣ r i ∈ A } ⋃ { q ⊥ } and id A ˜ \= T A . For a complex object A \= α ∗ ( A 1 † ⋯ † A k ) \= ⨄ 1 ≤ i ≤ k A i , where A i \= α ∗ ( A i ) , its identity arrow is id A \= ⨄ 1 ≤ i ≤ k id A i with simple atomic identity arrows id A i : A i → A i . Moreover, id A ˜ \= T A \= ⨄ 1 ≤ i ≤ k id A i ˜ \= ⨄ 1 ≤ i ≤ k T A i , which is a closed object as well.

Let M A B \= MakeOperads ( M A B ) \= { q 1 A , … , q m A , 1 r ∅ } and

M B C \= MakeOperads ( M B C ) \= { q 1 B , … , q n B , 1 r ∅ } .

Then

α ∗ ( M B C ∘ M A B ) \= α ∗ ( { q i B · ( q i 1 A , … , q i k i A ) ∣ 1 ≤ i ≤ n and 1 ≤ i j ≤ m for 1 ≤ j ≤ k i } ⋃ { 1 r ∅ · 1 r ∅ } ) \= (from the definition of R-algebras) \= { α ( q i B ) ( α ( q i 1 A ) × ⋯ × α ( q i k i A ) ) ∣ 1 ≤ i ≤ n and 1 ≤ i j ≤ m for 1 ≤ j ≤ k i } ⋃ { q ⊥ } \= ( from α ( 1 r ∅ ) \= q ⊥ ) \= { α ( q 1 B ) , … , α ( q n B ) , q ⊥ } ∘ { α ( q 1 A ) , … , α ( q M A ) , q ⊥ } \= α ∗ ( { q 1 B , … , q n B , 1 r ∅ } ) ∘ α ∗ ( { q 1 A , … , q m A , 1 r ∅ } ) \= α ∗ ( M B C ) ∘ α ∗ ( M A B ) .

Thus, for given two morphisms f \= α ∗ ( M A B ) : A → B and g \= α ∗ ( M B C ) : B → C their composition is equal t

g ∘ f \= α ∗ ( M B C ) ∘ α ∗ ( M A B ) \= α ∗ ( M B C ∘ M A B ) : A → C .

Let as show the associativity of composition of morphisms in DB , with h \= α ∗ ( M C D ) :

h ∘ ( g ∘ f ) \= α ∗ ( M C D ) ∘ ( α ∗ ( M B C ) ∘ α ∗ ( M A B ) ) \= α ∗ ( M C D ∘ ( M B C ∘ M A B ) ) (from the associativity of the operad-mapping composition) \= α ∗ ( ( M C D ∘ M B C ) ) ∘ α ∗ ( M A B ) \= ( α ∗ ( M C D ) ∘ α ∗ ( M B C ) ) ∘ α ∗ ( M A B ) \= ( h ∘ g ) ∘ f .

The left and right compositions of ⨄-atomic arrows in Definition 69 , in Section A.3.5 in the Appendix, are based on component-to-component composition of atomic arrows and are specified in detail in the rest of this section. Thus, the properties above hold for the ⨄-atomic arrows as well. Consequently, DB is a well-defined category.  □

The object composed of the empty relation only is denoted by ⊥ 0 and T ⊥ 0 \= ⊥ 0 \= { ⊥ } . It is shown that the empty database (a database with only empty relations) is isomorphic to this bottom object ⊥ 0 . Notice that this theorem introduces, for each two simple objects A and B , the morphism ⊥ 1 \= α ∗ ( M A , B ) where M A , B \= MakeOperads ( { r ∅ ⇒ r ∅ } ) \= { 1 r ∅ } , with the empty information flux ⊥ 1 ˜ \= ⊥ 0 (from Definition 67 in Section A.3.5 in the Appendix). The objects ⊥ 0 and Υ are the bottom- and the top-closed objects in DB .

From definitions of morphisms, each morphism f ∈ Mor DB is a set of functions in α ∗ ( M A B ) , such that α ( q i ) \= α ( v i ) ( α ( q A , i ) ) is a function that satisfies the mapping-interpretation conditions of Definition 66 . Consequently, DB is different from the Set category (where each morphism is a single function). In the algorithm MakeOperads , each operad’s operation q i of a schema mapping between a schema A and a schema B is generally composed of two components: the first one corresponds to conjunctive query q A , i over a source database A that defines this view-based mapping and the second component v i defines which contribution of this mapping is transferred into the target relation, i. e., a kind of Global-or-Local-As-View (GLAV) mapping (sound or exact) [ 92 ].

Based on the atomic schema mappings, we can introduce the atomic morphisms for instance-mappings in DB category as follows.

Definition 39 (Atomic morphisms in DB category).

An atomic morphism in DB is a set of functions f \= α ∗ ( M A B ) with the information flux f ˜ \= B ⊤ ( f ) such that M A B \= { q 1 , … , q k , 1 r ∅ } : A → B is an atomic sketch’s schema mapping and α is a mapping interpretation (Definition 66 in Section A.3.5 in the Appendix) with A \= α ∗ ( A ) , B \= α ∗ ( B ) .

Let the schema mapping M A B \= InverseOperads ( M A B ) : A → B be satisfied by α . Then for each operad’s operation q i \= v i · q A , i ∈ M A B , with q A , i ∈ O ( r i 1 , … , r im , r q ) and v i ∈ O ( r q , r i ) , r i ∈ B , the function α ( v i ) is an injection used to distinguish sound and exact assumption on the views as follows:

1.

Sound case, i. e., when α ( r q ) ⊆ α ( r i ) .

2.

Exact case, i. e., special inclusion case when α ( r q ) \= α ( r i ) .

We extend the operators ∂ 0 and ∂ 1 to DB morphisms as well, so that ∂ k ( f ) \= ⋃ q i ∈ α ∗ ( M A B ) ∂ k ( q i ) , for k \= 0 , 1 .

A complete morphism (c-morphism) f : A → B satisfies the condition ∂ 0 ( f ) ⊆ A .

Every atomic morphism is a complete morphism. Thus, each view-map q A i , i. e., an atomic morphism f \= { q A i , q ⊥ } : A ⟶ T A , is a complete morphism (the case when B \= T A and α ( v i ) belongs to the “exact case”).

As we have seen from Definition 69 , in Section A.3.5 in the Appendix, for the ⨄-atomic sketch’s mappings, α ∗ ( ⨄ ( M D A 1 , … , M D A n ) ) \= ⨄ ( α ∗ ( M D A 1 ) , … , α ∗ ( M D A n ) ) , and hence, they are compositions of atomic simple morphisms as well.

Remark.

In the rest of this book, we will use A \= ( S A , Σ A ) also for the set of relational symbols in S A and an instance-database A for α ∗ ( A ) \= α ∗ ( S A ) : it will simply be called a “database” when it is clear from the context. The functions ∂ 0 and ∂ 1 are different from dom and cod functions used for the category arrows. For an atomic morphism, or more generally, for a complete morphism f : A → B , the ∂ 0 ( f ) specifies exactly the subset of relations in a database A used by f , while ∂ 1 ( f ) defines the target relations in a database B for this mapping. Thus, for a complete mapping ∂ 0 ( f ) ⊆ dom ( f ) \= A and ∂ 1 ( f ) ⊆ cod ( f ) \= B . In the case when f is a simple view mapping, ∂ 1 ( f ) is a singleton.

The fact that each atomic arrow f : A → B is a set of functions and has the information flux f ˜ \= B ⊤ ( f ) is important for the composition of the arrows in DB : any two simple arrows f , g : A → B are equal ( f ≡ g ) not only when two sets of functions f and g are equal sets but also when they are different, but the information fluxes f ˜ and g ˜ are equal. More about this for complex arrows will be presented in Definition 44 .  □

From the proof of Theorem 10 , for the composition of any two morphisms in DB ,

f \= α ∗ ( M A B ) : A → B and g \= α ∗ ( M B C ) : B → C , h \= g ∘ f \= α ∗ ( M B C ) ∘ α ∗ ( M A B ) \= α ∗ ( M B C ∘ M A B ) \= { α ( q i B ) ( α ( q i 1 A ) × ⋯ × α ( q i k i A ) ) ∣ 1 ≤ i ≤ n , and 1 ≤ i j ≤ m for 1 ≤ j ≤ k i } ⋃ { α ( 1 r ∅ ) } \= { q B i · ( q A i 1 , … , q A i k i ) ∣ 1 ≤ i ≤ n and 1 ≤ i j ≤ m for 1 ≤ j ≤ k i } ⋃ { q ⊥ } ,

where q B i denotes the function α ( q i B ) , for 1 ≤ i ≤ n and q A j denotes the function α ( q j A ) , for 1 ≤ j ≤ m and · denotes the composition of functions. Graphically, such a composition of morphisms can be represented as a composition of trees (see the examples below where the “graphical-tree” morphisms are denoted by f T , g T , … ).

Generally, a composed morphism h : A → C is not a complete morphism, i. e., it can be graphically represented by a general tree such that not all its leaves are in A . Such an “ incomplete ” morphism is called a (partial) p-arrow. A p-arrow corresponds to a morphism obtained from a schema mapping M A B \= { Φ } : A → B where Φ is a SOtgd such that at least one left-hand side of its implications has the characteristic-functional symbols (for the relations that are not in the source schema A ).

By the graphical tree-composition of two trees in Figure 7.1 , f T (incomplete) and g T (complete), we obtain the tree h T (of the p-arrow h \= g ∘ f : A ⟶ C ):

h T \= ( g ∘ f ) T \= ⋃ q B j ∈ α ∗ ( M B C ) { q B j · ( ⋃ q A i ∈ α ∗ ( M A B ) & ∂ 1 ( q A i ) ∈ ∂ 0 ( q B j ) { q A i ( tree ) } ) } \= { q B j · { q A i ( tree ) ∣ ∂ 1 ( q A i ) ∈ ∂ 0 ( q B j ) } ∣ q B j ∈ α ∗ ( M B C ) } \= { q B j ( tree ) ∣ q B j ∈ α ∗ ( M B C ) }

where q A i ( tree ) is the tree below the branch q A i .

The difference between this graphical tree-representation of morphisms in Figure 7.1 and of a standard operads-based representation is that in the graphical tree representation, for the relations in ∂ 0 ( h ) that are not relations in ∂ 0 ( f ) (called hidden relations ), we do not use the identity functions α ( 1 r ) for these hidden relations (relations that are not in the source database A but in some intermediate database). Let us consider the following example in order to facilitate the understanding of the composition of morphisms.

Figure 7.1 Composed tree.

Example 21.

Let us consider the morphisms f : A ⟶ B and g : B ⟶ C such that A \= { a 1 , … , a 6 } , B \= { b 1 , … , b 7 } , C \= { c 1 , … , c 4 } , where f \= { q A 1 , … , q A 4 , q ⊥ } , with ∂ 0 ( q A 1 ) \= { a 1 , a 2 } , ∂ 0 ( q A 2 ) \= { a 2 , a 3 } , ∂ 0 ( q A 3 ) \= { a 4 } , ∂ 0 ( q A 4 ) \= { a 4 , a 5 } , ∂ 1 ( q A 1 ) \= { b 1 } , ∂ 1 ( q A 2 ) \= { b 2 } , ∂ 1 ( q A 3 ) \= { b 3 } , ∂ 1 ( q A 4 ) \= { b 6 } and g \= { q B 1 , … , q B 3 , q ⊥ } , with ∂ 0 ( q B 1 ) \= { b 1 , b 4 } , ∂ 0 ( q B 2 ) \= { b 2 , b 3 } , ∂ 0 ( q B 3 ) \= { b 4 , b 5 } , ∂ 1 ( q B 1 ) \= { c 1 } , ∂ 1 ( q B 2 ) \= { c 2 } , ∂ 1 ( q B 3 ) \= { c 3 } . These two morphisms are represented by the trees f T and g T and their sequential composition by h T in Figure 7.1 .

From the point of view based on the information fluxes of these morphisms, the composition of morphisms h \= g ∘ f : A ⟶ C can be graphically represented as a part of the tree h T in Figure 7.2 . It only provides the strict information contribution from the object A (i. e., the source) into the object C (target of this composed morphism). Hence, ∂ 0 ( f ) \= { a 1 , a 2 , a 3 , a 4 , a 5 } , ∂ 1 ( f ) \= { b 1 , b 2 , b 3 , b 6 } , ∂ 0 ( g ) \= { b 1 , b 2 , b 3 , b 4 , b 5 } , ∂ 1 ( g ) \= { c 1 , c 2 , c 3 } , while ∂ 0 ( h ) \= ∂ 0 ( g ∘ f ) \= { a 1 , a 2 , a 3 , a 4 } ≠ ∂ 0 ( f ) , ∂ 1 ( h ) \= ∂ 1 ( g ∘ f ) \= { c 1 , c 2 , c 3 } \= ∂ 1 ( g ) .

Figure 7.2 Obtained partial morphism.

Let us consider, e. g., the composition of the c -arrow h : C ⟶ D with the composed arrow g ∘ f in the previous example, where D \= { d 1 , … , d 4 } , h \= { q C 1 , q C 2 , q C 3 , q ⊥ } , ∂ 0 ( q C 1 ) \= { c 2 } , ∂ 1 ( q C 1 ) \= { d 1 } , ∂ 0 ( q C 2 ) \= { c 1 , c 2 , c 3 } , ∂ 1 ( q C 2 ) \= { d 2 } , ∂ 0 ( q C 3 ) \= { c 1 , c 4 } , ∂ 1 ( q C 3 ) \= { d 3 } , with q B 2 ( tree ) \= q B 2 · { q A 2 , q A 3 } a complete and q B 1 ( tree ) \= q B 1 · { q A 1 , − } a partial (incomplete) component of this tree, as represented in Figure 7.2 . A composition of (complete) morphisms generally produces a partial (incomplete) morphism (only a part of the tree h T represents a real contribution from A into C ) with hidden elements (in the diagram of the composed morphism h , the elements b 4 and b 5 are a hidden relations).

In such a representation, for the consideration of the information fluxes, we “forgot” the parts of the tree g T ∘ f T that are not involved in a real information contribution of composed mappings from the source into the target object. In fact, the hidden relations do not appear on the left-hand side of SOtgd’s implications of a given schema mapping, but only as the characteristic functions of these hidden relations. The hidden relations appear always in the operad’s operations and as a part of the domain of the set of functions that compose a given morphism f : A → B . Consequently, operad’s based representation of morphisms are equivalent to the logical representation based on the SOtgds. Based on Definition 67 in Section A.3.5 in the Appendix, the information flux for a composition of simple morphisms is given by the set-intersection of the information fluxes of all its simple morphisms.

Remark.

The information flux f ˜ \= B ⊤ ( f ) of a given morphism (instance-database mapping) f : A ⟶ B is an instance-database as well; thus, an object in DB : the minimal information flux is equal to the bottom object ⊥ 0 so that, given any two database instances A and B in DB , there exists at least an arrow (morphism) between them f : A ⟶ B such that f ˜ \= ⊥ 0 (e. g., ⊥ 1 : A → B ).

Definition 40.

A complex object in DB is expressed by a disjoint union ⨄ of simple instance-databases, and hence, each query over such a complex object can have the relational symbols belonging only to one of these simple databases. Let A \= A 1 ⨄ ⋯ ⨄ A m \= ⨄ 1 ≤ j ≤ m A j \= { { 1 } × A 1 } ⋃ ⋯ ⋃ { { m } × A m } if m ≥ 2 ; A 1 otherwise, and B \= ⨄ 1 ≤ i ≤ k B i \= { { 1 } × B 1 } ⋃ ⋯ ⋃ { { k } × B k } if k ≥ 2 ; B 1 otherwise, where all A j and B i are simple (noncomposed) databases. Consequently, from the fact that all simple databases are separated, T ( ⨄ 1 ≤ j ≤ m A j ) \= ⨄ 1 ≤ j ≤ m T A j .

(1)

We say that A is strictly complex if A j ≠ ⊥ 0 for all 1 ≤ j ≤ m .

(2)

We can define the new composition ⊗ by Υ ⊗ A \= A ⊗ Υ \= T A , and

A ⊗ B ≜ T A ⋂ T B , if m \= k \= 1 ; ⨄ 1 ≤ j ≤ m & 1 ≤ i ≤ k ( T A j ⋂ T B i ) , otherwise.

(3)

We define an “observational” PO relation ⪯ such that Υ ⪯ B iff B \= Υ and for A \= ⨄ 1 ≤ j ≤ m A j ≠ Υ , A ⪯ B \= ⨄ 1 ≤ i ≤ k B i iff there exists a mapping σ : { 1 , … , m } → { 1 , … . k } such that for each 1 ≤ j ≤ m , T A j ⊆ T B σ ( j ) .

The equivalence in this ordering (i. e., A ⪯ B and B ⪯ A ) we denote by A ≈ B .

Notice that ⪯ is a partial order (PO): A ⪯ A (for σ an identity function) and if A ⪯ B (with σ 1 ) and B ⪯ C (with σ 2 ) then A ⪯ C (with σ \= σ 2 · σ 1 ). For a given a tuple of objects (i. e., databases) in DB category ( S 1 , … , S n ) , n ≥ 2 , its disjoint union (from Definition 40 ) is ⨄ 1 ≤ i ≤ n S i \= ⨄ ( S 1 , … , S n ) \= ⋃ 1 ≤ i ≤ n { ( i , a ) ∣ a ∈ S i } (the union indexed by positions of the sets in a given tuple), denoted also by S 1 ⨄ S 2 ⨄ ⋯ ⨄ S n . This indexing of simple databases that compose a complex object has to be maintained in the case when they are equal as well.

For example, a complex object C ⨄ C has to be represented formally as an indexed complex object A 1 ⨄ A 2 with A 1 \= A 2 \= C . This “ indexing by position ” is fundamental for the formalization of complex morphisms between such complex objects. A disjoint union of two objects (databases) is isomorphic to a separation composition of these objects.

For any two simple morphisms f \= α ∗ ( M A C ) \= { α ( q 1 ) , … , α ( q k ) , q ⊥ } : A → C and g \= α ∗ ( M B D ) \= { α ( q 1 ′ ) , … , α ( q m ′ ) , q ⊥ } : B → D , we define a complex morphism ( f ⨄ g ) : A ⨄ B → C ⨄ D by disjunctive union of them, i. e., by the set

{ ( 1 , α ( q i ) ) ∣ q i ∈ M A C } ⋃ { ( 2 , α ( q j ′ ) ) ∣ q j ′ ∈ M B D } ⋃ { q ⊥ } \= α ∗ ( M A C ⨄ M B D ) .

Thus, from Definition 69 , its flux is equal to

f ⨄ g ˜ \= α ∗ ( M A C ⨄ M B D ) ˜ \= Flux ( α , M A C ) ⨄ Flux ( α , M B D ) \= f ˜ ⨄ g ˜ ∈ Ob DB .

Thus, we can consider the following extension of morphisms in DB , due to Theorem 10 , based on Definition 69 in Section A.3.5 in the Appendix.

Definition 41.

Complex arrows in DB presented by Theorem 10 are obtained by the structural operations _ ⨄ _ , [ _ , _ ] , ⟨ _ , _ ⟩ and ⌈ _ , _ ⌋ (all A , B , C and D are simple objects), as follows:

1.

Morphism f ⨄ g : A ⨄ B → C ⨄ D for any f : A → C and g : B → D ;

2.

Morphism [ f , g ] : A ⨄ B → C for any f : A → C and g : B → C ;

3.

Morphism ⟨ f , g ⟩ : A → C ⨄ D for any f : A → C and g : A → D ;

4.

Morphism ⌈ f ∘ k , g ∘ l ⌋ \= [ f , g ] ∘ ⟨ k , l ⟩ : A → B ⨄ D → C with simple arrows f ∘ k : A → B → C and g ∘ l : A → D → C , such that f ∘ k ˜ ≠ ⊥ 0 and g ∘ l ˜ ≠ ⊥ 0 and with reductions: ⌈ k , g ⌋ \= k if k ˜ ≠ ⊥ 0 and g ˜ \= ⊥ 0 ; ⌈ k , g ⌋ \= ⊥ 1 if k ˜ \= g ˜ \= ⊥ 0 .

Hence, a simple arrow (or morphism) is an arrow between two simple (nonseparation-composed) objects. Notice that a complex arrow ⌈ k , l ⌋ : A → C exists only as a composition of two complex arrows defined in point 4. It means that both simple arrows k , l : A → C are composed arrows with different intermediate databases.

We recall that an arrow ⊥ 1 \= { q ⊥ : ⊥ → ⊥ } : A → C , which represents an empty function, means that, in fact, we have no mapping between A and B (the information flux of ⊥ 1 is empty, i. e., ⊥ 1 ˜ \= ⊥ 0 \= { ⊥ } ). This fact explains why we are using only the arrows with nonempty fluxes in point 4 in a representation of a set of arrows between two fixed objects by ⌈,⌋. Based on Definitions 69 in Section A.3.5 in the Appendix, and 41 for binary compositions, we have the following cases for composition of complex morphisms (all A i , B i , C i , i \= 1 , 2 , and A , B , C are simple objects):

1.

for k : A 1 → B 1 , l : A 2 → B 2 , f : B 1 → C 1 and g : B 2 → C 2 ,

( f ⨄ g ) ∘ ( k ⨄ l ) \= ( f ∘ k ) ⨄ ( g ∘ l ) : A 1 ⨄ A 2 → C 1 ⨄ C 2 ,

2.

for k : A → B 1 , l : A → B 2 , f : B 1 → C 1 and g : B 2 → C 2 ,

( f ⨄ g ) ∘ ⟨ k , l ⟩ \= ⟨ f ∘ k , g ∘ l ⟩ : A → C 1 ⨄ C 2 ,

3.

for k : A 1 → B 1 , l : A 2 → B 2 , f : B 1 → C and g : B 2 → C ,

[ f , g ] ∘ ( k ⨄ l ) \= [ f ∘ k , g ∘ l ] : A 1 ⨄ A 2 → C ,

4.

for k : A → B 1 , l : A → B 2 , f : B 1 → C and g : B 2 → C ,

[ f , g ] ∘ ⟨ k , l ⟩ \= ⌈ f ∘ k , g ∘ l ⌋ , ( if f ∘ k ≠ ⊥ 1 , g ∘ l ≠ ⊥ 1 ) ; g ∘ l ( if f ∘ k \= ⊥ 1 , g ∘ l ≠ ⊥ 1 ) ; f ∘ k ( if f ∘ k ≠ ⊥ 1 , g ∘ l \= ⊥ 1 ) ; ⊥ 1 otherwise (an arrow from A to C ),

5.

for k : A 1 → B , f : B → C 1 and g : B → C 2

⟨ f , g ⟩ ∘ k \= ⟨ f ∘ k , g ∘ k ⟩ : A 1 → C 1 ⨄ C 2 ,

6.

for k : A 1 → B , l : A 2 → B and f : B → C ,

f ∘ [ k , l ] \= [ f ∘ k , g ∘ k ] : A 1 ⨄ A 2 → C ,

7.

for k : A → B , l : A → B , f : B → C 1 , and g : B → C 2

⟨ f , g ⟩ ∘ ⌈ k , l ⌋ \= ⟨ ⌈ f ∘ k , f ∘ l ⌋ , ⌈ g ∘ k , g ∘ l ⌋ ⟩ : A → C 1 ⨄ C 1 ,

8.

for k : A 1 → B , l : A 2 → B , f : B → C and g : B → C ,

⌈ f , g ⌋ ∘ [ k , l ] \= [ ⌈ f ∘ k , g ∘ k ⌋ , ⌈ f ∘ l , g ∘ l ⌋ ] : A 1 ⨄ A 2 → C ,

9.

for k : A → B , l : A → B , f : B → C and g : B → C ,

⌈ f , g ⌋ ∘ ⌈ k , l ⌋ \= ⌈ f ∘ k , g ∘ k , f ∘ l , g ∘ l ⌋ : A → C .

Now we can extend these binary structural operators in Definition 41 into n -ary operators.

Definition 42.

We generalize the binary structure operators in Definition 41 into n -ary operators, for any n ≥ 2 , by:

1.

⨄ 1 ≤ i ≤ n f i \= ⨄ ( f 1 , … , f n ) : ⨄ 1 ≤ i ≤ n A i → ⨄ 1 ≤ i ≤ n B i where f i : A i → B i for each 1 ≤ i ≤ n .

2.

[ f 1 , … , f n ] : ⨄ 1 ≤ i ≤ n A i → B , where f i : A i → B for each 1 ≤ i ≤ n .

3.

⟨ f 1 , … , f n ⟩ : A → ⨄ 1 ≤ i ≤ n B i , where f i : A → B i for each 1 ≤ i ≤ n .

4.

⌈ f 1 , … , f n ⌋ : A → B , where f i ˜ ≠ ⊥ 0 for each 1 ≤ i ≤ n .

Remark.

In order to simplify the presentation, we extend the structure operators also to unary cases: for example, ⨄ 1 ≤ i ≤ 1 A i \= ⨄ ( A 1 ) \= A 1 , ⨄ 1 ≤ i ≤ 1 f i \= ⨄ ( f 1 ) \= f 1 .

We extend the application of ⨄ also to (unordered) sets, so that for a given nonempty set (of sets) S , ⨄ S represents an application of ⨄ to any ordered list (tuple) of sets in S . The operator ⨄ is a commutative and associative binary operator (up to isomorphism) so that, given any ordered list (a permutation) ( s 1 , … , s n ) of all elements (which are the sets) in S , the following isomorphism is valid in DB :

⨄ S ≃ ⨄ ( s 1 , … , s n ) \= ( s 1 ⨄ ⋯ ⨄ s n ) \= ⋃ 1 ≤ i ≤ n { ( i , a ) ∣ a ∈ s i } .

Thus, e. g., we have the following cases for a composition of complex morphisms obtained by using n -ary separation compositions:

1.

For ⨄ 1 ≤ i ≤ n f i : ⨄ 1 ≤ i ≤ n A i → ⨄ 1 ≤ i ≤ n B i and ⨄ 1 ≤ i ≤ n g i : ⨄ 1 ≤ i ≤ n B i → ⨄ 1 ≤ i ≤ n C i ,

( ⨄ 1 ≤ i ≤ n g i ) ∘ ( ⨄ 1 ≤ i ≤ n f i ) \= ⨄ 1 ≤ i ≤ n ( g i ∘ f i ) : ⨄ 1 ≤ i ≤ n A i → ⨄ 1 ≤ i ≤ n C i

2.

For ⟨ f 1 , … , f n ⟩ : A → ⨄ 1 ≤ i ≤ n B i and ⨄ 1 ≤ i ≤ n g i : ⨄ 1 ≤ i ≤ n B i → ⨄ 1 ≤ i ≤ n C i ,

( ⨄ 1 ≤ i ≤ n g i ) ∘ ⟨ f 1 , … , f n ⟩ \= ⟨ g 1 ∘ f 1 , … , g n ∘ f n ⟩ : A → ⨄ 1 ≤ i ≤ n C i

3.

For ⨄ 1 ≤ i ≤ n f i : ⨄ 1 ≤ i ≤ n A i → ⨄ 1 ≤ i ≤ n B i and [ g 1 , … , g n ] : ⨄ 1 ≤ i ≤ n B i → C ,

[ g 1 , … , g n ] ∘ ( ⨄ 1 ≤ i ≤ n f i ) \= [ g 1 ∘ f 1 , … , g n ∘ f n ] : ⨄ 1 ≤ i ≤ n A i → C

4.

For ⟨ f 1 , … , f n ⟩ : A → ⨄ 1 ≤ i ≤ n B i and [ g 1 , … , g n ] : ⨄ 1 ≤ i ≤ n B i → C ,

[ g 1 , … , g n ] ∘ ⟨ f 1 , … , f n ⟩ \= ⌈ S ⌋ : A → C , if | S | ≥ 1 ; ⊥ 1 : A → C otherwise

(where S \= { g i ∘ f i ∣ g i ∘ f i ˜ \= g i ˜ ⋂ f i ˜ ≠ ⊥ 0 , 1 ≤ i ≤ n } )

5.

For f : A → B and ⟨ g 1 , … , g n ⟩ : B → ⨄ 1 ≤ i ≤ n C i ,

⟨ g 1 , … , g n ⟩ ∘ f \= ⟨ g 1 ∘ f , … , g n ∘ f ⟩ : A → ⨄ 1 ≤ i ≤ n C i

6.

For [ f 1 , … , f n ] : ⨄ 1 ≤ i ≤ n A i → B and g : B → C ,

g ∘ [ f 1 , … , f n ] \= [ g ∘ f 1 , … , g ∘ f n ] : ⨄ 1 ≤ i ≤ n A i → C

7.

For f i : A → B , 1 ≤ i ≤ n and g : B → C ,

g ∘ ⌈ f 1 , … , f n ⌋ \= ⌈ S ⌋ : A → C , if | S | ≥ 1 ; ⊥ 1 : A → C otherwise

(where, from Definition 41 , S \= { g ∘ f i ∣ g ∘ f i ˜ ≠ ⊥ 0 , 1 ≤ i ≤ n } )

8.

For g i : B → C , 1 ≤ i ≤ n and f : A → B ,

⌈ g 1 , … , g n ⌋ ∘ f \= ⌈ S ⌋ : A → C , if | S | ≥ 1 ; ⊥ 1 : A → C otherwise

(where, from Definition 41 , S \= { g i ∘ f ∣ g i ∘ f ˜ ≠ ⊥ 0 , 1 ≤ i ≤ n } ).

By these rules of composition of complex arrows, we obtain that the resulting arrow is a composition of structural-operators ⨄ ( _ , … , _ ) , [ _ , … , _ ] , ⟨ _ , … , _ ⟩ and ⌈ _ , … , _ ⌋ .

The “point-to-point” (ptp) arrow is nonempty (with flux different from ⊥ 0 ) simple arrow (a path of only simple atomic arrows), between two simple objects that compose the source and target database of this complex arrow: if we have more than one simple arrow between the same source and target simple objects, then we fuse them (by union) into a single ptp arrow, as follows.

Definition 43.

For any complex arrow h : A → B between “indexed by position” complex objects A \= ⨄ 1 ≤ j ≤ m A j and B \= ⨄ 1 ≤ i ≤ k B i , m , k ≥ 1 , we define its set of ptp morphisms by

h ⊎ ≜ { h j i \= ⋃ { f l : A j → B i ∣ f l is a composition of simple arrows in h such that f ˜ l ≠ ⊥ 0 } ≠ ∅ ∣ 1 ≤ j ≤ m , 1 ≤ i ≤ k } .

Then we extend the mapping B ⊤ to complex arrows also: B ⊤ ( h ) \= h ˜ is equal (up to isomorphism) to the object

⨄ h ⊎ ˜ ≜ ⨄ { B ⊤ ( h j i ) ∣ h j i ∈ h ⊎ } \= ⨄ { h j i ˜ ∣ h j i ∈ h ⊎ } , if | h ⊎ | ≥ 2 ; B ⊤ ( h j i ) \= h j i ˜ , if h ⊎ \= { h j i } ; ⊥ 0 , otherwise.

Notice that for a given complex arrow h each of its ptp arrows has a nonempty information flux (different from ⊥ 0 ) so that a ptp arrow is different from ⊥ 1 arrow. In the previous example for the composition of complex arrows, the resulting arrow is composed of point-to-point arrows. For example, in rule 5, we obtained the complex arrow ⟨ f ∘ k , g ∘ k ⟩ : A 1 → C 1 ⨄ C 2 where f ∘ k : A 1 → C 1 and g ∘ k : A 1 → C 2 are two point-to-point simple arrows. In rule 3, we obtained the complex arrow [ f ∘ k , g ∘ l ] : A 1 ⨄ A 2 → C where f ∘ k : A 1 → C and g ∘ l : A 2 → C are two point-to-point simple arrows, etc.

This property extends by induction to any composition of complex arrows. The fact that the source and target complex objects A and B of a complex morphism h : A → B are “indexed by position” is fundamental for definition (indexing) of its ptp arrows. For example, the complex arrow h \= [ id C , id C , id C ] : C ⨄ C ⨄ C → C has to be represented formally by h : A 1 ⨄ A 2 ⨄ A 3 → B 1 , with A 1 \= A 2 \= A 3 \= B 1 \= C , so that h ⨄ \= { h 11 \= id C : A 1 → B 1 , h 21 \= id C : A 2 → B 1 , h 31 \= id C : A 3 → B 1 } is the set of three ptp arrows and not the singleton { id C : C → C } . This requirement is fundamental for the definition of ptp arrows because it takes in consideration the mutually separated databases in the complex source object A and mutually independent morphisms from them into the target database B . Based on Definitions 69 in Section A.3.5 in the Appendix, 41 and 42 , for h ⊎ ≠ ∅ we obtain h ˜ ≃ ⨄ { f i ˜ ∣ f i ∈ h ⊎ } (i. e., h ˜ is not equal to ⨄ h ⨄ ˜ but only isomorphic to it). This isomorphism (instead of an equality) is based on the fact that ⨄ ( A , B ) \= A ⨄ B ≃ B ⨄ A \= ⨄ ( B , A ) (formally demonstrated by point 2 of the following Lemma 3 ) and ptp arrows in h , as explained in Definition 42 , are ordered while set h ⊎ is unordered: when ⨄ is applied to a set, then any ordering can be taken in this set.

Notice that the mapping B ⊤ for complex morphisms continues to generate the closed objects. In fact, we can show it recursively. Let f ˜ \= B ⊤ ( f ) , g ˜ \= B ⊤ ( g ) be closed objects (i. e., from the fact that power-view operator T (Section A.3.2 ) is idempotent, T f ˜ \= f ˜ , T g ˜ \= g ˜ ). Then T ( f ˜ ⨄ g ˜ ) \= T f ˜ ⨄ T g ˜ \= f ˜ ⨄ g ˜ , and hence, closed as well.

Remark.

As we have specified in Definition 43 , the path arrows with the same simple source and target objects are fused (by union) into a single morphism. For example, for given two simple databases A and B , the complex arrows ⌈ f , g ⌋ : A → B , where f \= α ( M A B ( 1 ) ) and g \= α ( M A B ( 2 ) ) (with sketch’s arrows M A B ( n ) \= MakeOperads ( M A B ( n ) ) : A → B , n \= 1 , 2 and M A B ( 1 ) \= { Φ } : A → B , M A B ( 2 ) \= { Ψ } : A → B ), will be fused into a single arrow k : A → B , where k \= f ⋃ g \= α ( M A B ) is obtained by fusing the sketch’s mappings M A B ( 1 ) and M A B ( 1 ) into M A B \= ( M A B ( 1 ) ⋃ M A B ( 1 ) ) : A → B . Thus, based on Definition 67 in Section A.3.5 in the Appendix, the flux of f ⋃ g is equal to (as in point 3 of Definition 69 ):

⌈ f , g ⌋ ˜ \= f ⋃ g ˜ \= T ( Δ ( α , M A B ( 1 ) ) ⋃ Δ ( α , M A B ( 2 ) ) ) \= T ( T ( Δ ( α , M A B ( 1 ) ) ) ⋃ T ( Δ ( α , M A B ( 2 ) ) ) ) \= T ( Flux ( α , M A B ( 1 ) ) ⋃ Flux ( α , M A B ( 2 ) ) ) \= T ( f ˜ ⋃ g ˜ ) ≠ f ˜ ⨄ g ˜ .

 □

Generally, when g \= f , the complex arrow ⌈ f , g ⌋ : A → B may represent the two composed independent mapping paths f and g with different intermediate databases. Thus, ⌈ f , g ⌋ ˜ \= T ( f ˜ ⋃ f ˜ ) \= T f ˜ \= f ˜ (a closed object), i. e., this pair of arrows ⌈ f , g ⌋ transfers the same information flux from the source to target database as a single mapping f : A → B . However, they cannot be considered equal: the redundant transferring of the same information flux represents a more robust database mapping system in which if the first mapping is interrupted by a failure in one of its intermediate databases then the second (alternative) mapping may continue to work and to guarantee the general security mapping requirements.

This database mapping system requirement explains that, in order to establish the equality of two mappings k \= ⌈ f , f ⌋ : A → B and f : A → B , their observational equality (when they have equal information fluxes, which are the set of all transferred views from A into B ) is not a sufficient condition.

In fact, let us consider the mappings ⟨ l 1 , l 2 ⟩ : A → C ⨄ C and [ m 1 , m 2 ] : C ⨄ C → B , so that their composition is ⌈ f 1 , f 1 ⌋ \= [ m 1 , m 2 ] ∘ ⟨ l 1 , l 2 ⟩ \= ⌈ m 1 ∘ l 1 , m 2 ∘ l 2 ⌋ : A → B , also when m 1 \= m 2 \= m and l 1 \= l 2 \= l , is different from a single mapping f \= m ∘ l : A → B , i. e., ⌈ f , f ⌋ ≠ f . However, if m 2 \= ⊥ 1 or l 2 \= ⊥ 1 , then [ m 1 , m 2 ] ∘ ⟨ l 1 , l 2 ⟩ \= ⌈ f 1 , ⊥ 1 ⌋ \= f 1 because the alternative mapping ⊥ 1 : A → B has an empty information flux (it does not transfer anything from A into B ) and can be eliminated from the mappings (as specified by point 2.4 in Definition 41 ).

Lemma 1.

For any complex arrow h : A → B with A \= ⨄ 1 ≤ j ≤ m A j , m ≥ 1 and B \= ⨄ 1 ≤ i ≤ k B i , k ≥ 1 , any its substructure ⌈ h l 1 , … , h l n ⌋ : A j → B i , n ≥ 2 , where each h l i is a simple arrow (with simple source and target objects) is fused into a single ptp arrow ( h j i : A j → B i ) ∈ h ⨄ . Thus, its information flux is h j i ˜ \= T ( ⋃ { h l i ˜ ∣ 1 ≤ i ≤ n } ) . Given any pair of simple source and target databases A j and B i , there is at most one ptp arrow h j i ∈ h ⨄ between them.

Proof.

If each h l i is a simple arrow with simple source and target objects (databases) A j and B i , respectively, then ⌈ h l 1 , … , h l n ⌋ : A j → B i is fused into a single ptp, as it directly follows from definition of h ⨄ . The flux of these fused (by union) arrows into one ptp arrow has then the information flux as explained above and is specified in the previous remark.

The fact that, for any pair of simple source and target databases A j and B i , there is at most one ptp arrow h j i ∈ h ⨄ between them is a direct consequence of the definition of h ⨄ . It means that h cannot have more than k · m ptp arrows.  □

The logical equivalence of the SOtgds of two schema mappings is an insufficient requirement for the equality of the mappings at instance-level, and we need a more appropriate refinement of it based on the information fluxes. For any two logically equivalent schema mappings M A B \= { Φ } : A → B and M A B ′ \= { Φ ′ } : A → B , where the SOtgds Φ and Φ ′ are logically equivalent, for any mapping-interpretation α we will have that the morphism (a set of functions) f \= α ∗ ( MakeOperads ( M A B ) ) is equal to the set of functions g \= α ∗ ( MakeOperads ( M A ′ B ) ) . It holds from the fact that operad’s based representation of the schema mappings is equivalent to the logical representation given by SOtgds. However, this kind of strong equality is not useful in our case, and we are considering a more weak equality based on observational equivalence and information fluxes of instance-database mappings f , g : A → B , where A \= α ∗ ( A ) and B \= α ∗ ( B ) , as follows.

Definition 44 (Equality of arrows in DB).

In the observational-based semantics, the equality ‘≡’ of two morphisms f , g : A → B (used for the commutativity of diagrams) in DB is defined as follows:

1.

If both arrows are simple, then f ≡ g iff f ˜ \= g ˜ ;

2.

If f \= ⌈ f 1 , … , f m ⌋ and g \= ⌈ g 1 , … , g k ⌋ , with m , k ≥ 1 and A and B simple databases, then f ≡ g iff m \= k and there is a bijection σ : ⌈ f 1 , … , f m ⌋ → ⌈ g 1 , … , g k ⌋ such that f j ˜ \= σ ( f j ) ˜ for all j \= 1 , … , m ;

3.

Otherwise, f ≡ g iff f ⨄ \= g ⨄ (have the same set of ptp arrows).

Thus, if the morphisms f and g are equal in DB , they are not necessarily equal set-theoretically. By having in mind this difference between the common set-equality ‘=’ and the DB arrows equality ‘≡’, we will continue to use the same notation f \= g also for the arrows (instead of a more appropriate notation f ≡ g ).

Consequently, the equality of arrows (morphisms) in DB is not the set-theoretical equality (by considering that each morphism is mathematically just a set of functions).

This observational equality of instance-database mappings means that at this level of DB abstraction, two instance-database mappings are equal iff the information transferred from the source instance-database into a target instance-database for both mappings is equivalent (or equal in special cases, because if f ˜ \= g ˜ then the identity morphism id : f ˜ → g ˜ is an isomorphism as well, so that f ˜ ≃ g ˜ ) and in cases 2 above satisfy some additional requirements.

Remark.

In what follows, we will use the common symbol ′ \= ′ for the equality of morphisms in DB category by considering this observational meaning (and not the set-theoretic meaning). For all other cases, the equality symbol ′ \= ′ has the set-theoretical meaning (e. g., for the information fluxes f ˜ \= B ⊤ ( f ) \= g ˜ \= B ⊤ ( g ) or in definitions like of morphisms f \= α ∗ ( MakeOperads ( M ) ) , the meaning for ′ \= ′ is standard set-theoretic). All commutativity diagrams in DB will be based on this abstracted (nonset-based) equality for the morphisms.

Example 22.

It is easy to verify the validity of composition rules for complex arrows (we denote by \= n the equation obtained by application of the n -th rule of compositions of arrows defined previously):

1.

Let us show for the case k : A 1 → B , l : A 2 → B , f : B → C 1 and g : B → C 2 , that h \= ⟨ f , g ⟩ ∘ [ k , l ] \= ⟨ [ f ∘ k , f ∘ l ] , [ g ∘ k , g ∘ l ] ⟩ \= [ ⟨ f ∘ k , g ∘ k ⟩ , ⟨ f ∘ l , g ∘ l ⟩ ] : A 1 ⨄ A 2 → C 1 ⨄ C 2 , with the four obtained point-to-point arrows f ∘ k : A 1 → C 1 , g ∘ k : A 1 → C 2 , f ∘ l : A 2 → C 1 and g ∘ l : A 2 → C 2 . That is, h ⊎ \= { f ∘ k , g ∘ k , f ∘ l , g ∘ l } .

We have ⟨ f , g ⟩ ∘ [ k , l ] \= 5 ⟨ f ∘ [ k , l ] , g ∘ [ k , l ] ⟩ \= 6 ⟨ [ f ∘ k , f ∘ l ] , [ g ∘ k , g ∘ l ] ⟩ and ⟨ f , g ⟩ ∘ [ k , l ] \= 6 [ ⟨ f , g ⟩ ∘ k , ⟨ f , g ⟩ ∘ l ] \= 5 [ ⟨ f ∘ k , g ∘ k ⟩ , ⟨ f ∘ l , g ∘ l ⟩ ] .

We can show that it is true by considering the ptp arrows. In fact,

h ⨄ \= ⟨ [ f ∘ k , f ∘ l ] , [ g ∘ k , g ∘ l ] ⟩ ⨄ \= [ ⟨ f ∘ k , g ∘ k ⟩ , ⟨ f ∘ l , g ∘ l ⟩ ] ⨄ \= { f ∘ k : A 1 → C 1 , g ∘ k : A 1 → C 2 , f ∘ l : A 2 → C 1 , g ∘ l : A 2 → C 2 } .

2.

Let us show that f \= ⟨ id C , id C ⟩ ∘ [ id C , id C ] \= ⟨ [ id C , id C ] , [ id C , id C ] ⟩ : C ⨄ C → C → C ⨄ C is different from g \= id C ⨄ id C : C ⨄ C → C ⨄ C . In fact, in order to define the ptp arrows of these two morphisms, we have to use the “indexing by position” for the source database A \= A 1 ⨄ A 2 and target database B \= B 1 ⨄ B 1 where A 1 \= A 2 \= B 1 \= B 2 \= C . Thus, ⟨ id C , id C ⟩ ∘ [ id C , id C ] ⨄ \= { f 11 \= id C : A 1 → B 1 , f 12 \= id C : A 1 → B 2 , f 21 \= id C : A 2 → B 1 , f 22 \= id C : A 2 → B 2 } ≠ { g 11 \= id C : A 1 → B 1 , g 22 \= id C : A 2 → B 2 } \= id C ⨄ id C ⨄ .

Consequently, by point 3 of Definition 44 , the identity arrow id C ⨄ id C ≠ ⟨ id C , id C ⟩ ∘ [ id C , id C ] .

In fact, id A \= id A 1 ⨄ id A 2 because for any f : A → X we have from Definition 43 that f ∘ ( id A 1 ⨄ id A 2 ) ⨄ \= { f i 2 ∘ id ∣ f i 2 ∈ f ⨄ , id ∈ { id A 1 , id A 2 } \= id A 1 ⨄ id A 2 ⨄ , dom ( f i 2 ) \= cod ( id ) } \= { f i 2 ∣ f i 2 ∈ f ⨄ } \= f ⨄ so that, by point 3 of Definition 44 , f \= f ∘ ( id A 1 ⨄ id A 2 ) , and analogously, f \= ( id A 1 ⨄ id A 2 ) ∘ f , so that ( id A 1 ⨄ id A 2 ) is the identity arrow of A \= A 1 ⨄ A 2 . That is, id A \= id A 1 ⨄ A 2 \= id A 1 ⨄ id A 2 .

Let us consider the associativity of composition of complex morphisms (that DB is well-defined for complex arrows as well):

3.

For k : A 1 → B , l : A 2 → B , f : B → C 1 , g : B → C 2 , j : C 1 → D and m : C 2 → D , we consider the composition [ j , m ] ∘ ⟨ f , g ⟩ ∘ [ k , l ] : A 1 ⨄ A 2 → B → C 1 ⨄ C 2 → D . Let us consider the two different orders of composition:

3.1

h 1 \= [ j , m ] ∘ ( ⟨ f , g ⟩ ∘ [ k , l ] ) \= 5 [ j , m ] ∘ ⟨ [ f ∘ k , f ∘ l ] , [ g ∘ k , g ∘ l ] ⟩ \= 4 ⌈ [ j ∘ f ∘ k , j ∘ f ∘ l ] , [ m ∘ g ∘ k , m ∘ g ∘ l ] ⌋ : A 1 ⨄ A 2 → D ,

3.2

h 2 \= ( [ j , m ] ∘ ⟨ f , g ⟩ ) ∘ [ k , l ] \= 4 ⌈ j ∘ f , m ∘ g ⌋ ∘ [ k , l ] \= 7 ⌈ [ j ∘ f ∘ k , j ∘ f ∘ l ] , [ m ∘ g ∘ k , m ∘ g ∘ l ] ⌋ : A 1 ⨄ A 2 → D ,

both of them with the same set of two fused point-to-point arrows

h 1 ⊎ \= h 2 ⊎ \= { ( j ∘ f ∘ k ) ⋃ ( m ∘ g ∘ k ) : A 1 → D , ( j ∘ f ∘ l ) ⋃ ( m ∘ g ∘ l ) : A 2 → D } ,

so that h 1 \= h 2 , i. e., this composition of complex arrows is associative as well.

4.

For k : A → B 1 , l : A → B 2 , f : B 1 → C , g : B 2 → C , j : C → D 1 and m : C → D 2 , we consider the compositions ⟨ j , m ⟩ ∘ [ f , g ] ∘ ⟨ k , l ⟩ : A → B 1 ⨄ B 2 → C → D 1 ⨄ D 2 . Let us consider the two different orders of composition:

4.1

h 1 \= ⟨ j , m ⟩ ∘ ( [ f , g ] ∘ ⟨ k , l ⟩ ) \= 4 ⟨ j , m ⟩ ∘ ⌈ f ∘ k , g ∘ l ⌋ \= 7 ⌈ ⟨ j ∘ f ∘ k , j ∘ g ∘ l ⟩ , ⟨ m ∘ f ∘ k , m ∘ g ∘ l ⟩ ⌋ : A → D 1 ⨄ D 2 ,

4.2

h 2 \= ( ⟨ j , m ⟩ ∘ [ f , g ] ) ∘ ⟨ k , l ⟩ \= 6 [ ⟨ j ∘ f , m ∘ f ⟩ , ⟨ j ∘ g , m ∘ g ⟩ ] ∘ ⟨ k , l ⟩ \= 4 ⌈ ⟨ j ∘ f ∘ k , m ∘ f ∘ k ⟩ , ⟨ j ∘ g ∘ l , m ∘ g ∘ l ⟩ ⌋ : A → D 1 ⨄ D 2 .

They are equal, h 1 \= h 2 , because

h 1 ⊎ \= h 2 ⊎ \= { ( j ∘ f ∘ k ) ⋃ ( j ∘ g ∘ l ) : A → D 1 , ( m ∘ f ∘ k ) ⋃ ( m ∘ g ∘ l ) : A → D 2 } .

7.1.1   Morphism properties of DB category

From the examples above, we have seen that there are different structural representations for the same arrow between two complex objects. That is, for a given set of ptp arrows between two complex objects, we can have a number of different structural representations that are mutually equal. Thus, it is natural to fix a canonical representation of such equivalent classes of arrows and to use them whenever possible. The fact is that each arrow in DB can be substituted by such canonical arrow, in an analogous way as any object can be substituted by an isomorphic object.

Lemma 2.

Let us define the function ⊛ : Mor DB → Mor DB , such that for any arrow f : A → B where A \= ⨄ 1 ≤ j ≤ m A j and B \= ⨄ 1 ≤ i ≤ k B i , m , k ≥ 1 ,

⊛ ( f ) ≜ [ ⟨ h 11 , … , h 1 k ⟩ , … , ⟨ h m 1 , … , h m k ⟩ ] : A → B ,

where h j i \= f j i if ( f j i : A j → B i ) ∈ f ⨄ ; ⊥ 1 otherwise.

This mapping is an identity for the simple arrows. For any complex arrow, it returns an equal arrow that contains the maximal number of simple arrows in its structural representation. For a given set S \= f ⨄ of ptp arrows between A and B, by ⊛ ˆ ( A , B , S ) ≜ ⊛ ( f ) we denote a canonical arrow obtained from S.

Proof.

There are the following cases:

1.

The case when m \= k \= 1 , so that f : A 1 → B 1 is a simple arrow. Then f ⨄ \= { f } if f ˜ ≠ ⊥ 0 ; ∅ otherwise.

Consequently, ⊛ ( f ) \= f if f ⨄ \= { f } , or ⊛ ( f ) \= ⊥ 1 if f ⨄ \= ∅ , but from the fact that in this case f ˜ \= ⊥ 0 \= ⊥ 1 ˜ , from Definition 44 , we obtain again that ⊛ ( f ) \= f .

2.

The case of m · k ≥ 2 (a complex arrow) and f ⨄ \= ∅ . Let us consider the following cases:

2.1

m \= 1 . Then ⊛ ( f ) \= [ ⟨ h 11 , … , h 1 k ⟩ ] \= (in [ _ ] we have only one element) \= ⟨ h 11 , … , h 1 k ⟩ where h 1 i \= ⊥ 1 for all i \= 1 , … , k , so that ⊛ ( f ) ⨄ \= ∅ \= f ⨄ , and hence, ⊛ ( f ) \= f is maximal with 1 · k \= k ≥ 2 simple arrows.

2.2

k \= 1 . Then ⊛ ( f ) \= [ ⟨ h 11 ⟩ , … , ⟨ h m 1 ⟩ ] \= [ h 11 , … , h m 1 ] where h j 1 \= ⊥ 1 for all j \= 1 , … , m , so that ⊛ ( f ) ⨄ \= ∅ \= f ⨄ , and hence, ⊛ ( f ) \= f is maximal with m · 1 \= m ≥ 2 simple arrows.

2.3

Both m , k ≥ 2 . Then ⊛ ( f ) \= [ ⟨ h 11 , … , h 1 k ⟩ , … , ⟨ h m 1 , … , h m k ⟩ ] where h j i \= ⊥ 1 for all j \= 1 , … , m and i \= 1 , … , k , so that ⊛ ( f ) ⨄ \= ∅ \= f ⨄ , and hence, ⊛ ( f ) \= f is maximal k · m ≥ 2 simple arrows.

3.

The case of m · k ≥ 2 (a complex arrow) and f ⨄ ≠ ∅ . Then, as in case 2, we have three possible cases, and in each of them we obtain that ⊛ ( f ) ⨄ \= f ⨄ , and hence, ⊛ ( f ) \= f is maximal k · m ≥ 2 simple arrows.  □

It is easy to see that for any f , ⊛ inserts only the new empty arrows ⊥ 1 in this canonical structural representation where, for each simple object A j in a A , we have a full cone of simple arrows ⟨ h j 1 , … , h j k ⟩ : A j → B from A j into each simple object in B i for i \= 1 , … , k . For example, consider ⊛ ( k ) for k \= k 11 ⨄ [ k 2 , 2 , k 3 , 2 ] : A 1 ⨄ A 2 ⨄ A 3 → B 1 ⨄ B 2 .

Moreover, we are able to construct a well-defined complex arrow between any two complex objects by specifying the set S of ptp arrows. That is useful also when the set S of ptp arrows is empty. For example, ⊛ ˆ ( A 1 ⨄ A 2 , B 1 , { f 21 } ) \= [ ⊥ 1 , f 21 ] : A 1 ⨄ A 2 → B 1 , or

⊛ ˆ ( A 1 , B 1 ⨄ B 2 , ∅ ) \= ⟨ ⊥ 1 , ⊥ 1 ⟩ : A 1 → B 1 ⨄ B 2 .

We can show the following important isomorphisms for (also complex) instance-databases in DB .

Lemma 3.

For any A , B , C ∈ Ob DB , we have the following isomorphisms:

1.

For any object A, we have the isomorphism is A : A → T A with its inverse is A − 1 : T A → A such that is A ˜ \= is A − 1 ˜ \= id A ˜ \= T A . Thus, A ≃ T A .

2.

(Commutativity) A ⨄ B ≃ B ⨄ A .

3.

(Associativity) A ⨄ ( B ⨄ C ) ≃ A ⨄ B ⨄ C ≃ ( A ⨄ B ) ⨄ C .

4.

(Composition with zero object) C ⨄ ⊥ 0 ≃ C ≃ ⊥ 0 ⨄ C .

Proof.

Claim 1. Let us consider a simple object (instance-database) A . The SOtgd Φ A of the schema mappings, corresponding to the morphisms id A : A → A , is A : A → T A and is A − 1 : T A → A , is equal to the InverseOperads ( { 1 r i ∈ O ( r i , r i ) ∣ r i ∈ S A } ⋃ { 1 r ∅ } ) , i. e., to the logical formula ⋀ { ∀ x i ( r i ( x i ) ⇒ r i ( x i ) ) ∣ r i ∈ S A } where A \= α ∗ ( A ) of a schema A and A ⊆ A ˆ (thus, A \= α ∗ ( A ) ⊆ α ∗ ( A ˆ ) \= T A ). Thus, id A \= α ∗ ( MakeOperads ( { Φ A } ) ) : A → A , is A \= α ∗ ( MakeOperads ( { Φ A } ) ) : A → T A , and is A − 1 \= α ∗ ( MakeOperads ( { Φ } A ) ) : T A → A , are atomic morphisms (Definition 39 ). That is, these three morphisms are based on the same SOtgd Φ A and, consequently, for each object A in DB ( id A ˜ \= T A is demonstrated by Theorem 10 ) that is A ˜ \= is A − 1 ˜ \= id A ˜ \= T A . For a complex object, A \= ⨄ 1 ≤ j ≤ m A j , m ≥ 2 , is A \= ⨄ 1 ≤ j ≤ m is A j , is A − 1 \= ⨄ 1 ≤ j ≤ m is A j − 1 : In fact, is A − 1 ∘ is A \= ⨄ 1 ≤ i ≤ k is A i − 1 ∘ is A i \= ⨄ 1 ≤ i ≤ k id A i \= id A (i. e., id A ⨄ \= ⨄ 1 ≤ i ≤ k id A i ⨄ \= { id A i : A i → A i ∣ 1 ≤ i ≤ k } ). Analogously, is A i ∘ is A i − 1 \= ⨄ 1 ≤ i ≤ k id T A i \= id T A . Hence, is A ˜ \= is A − 1 ˜ \= id A ˜ \= ⨄ 1 ≤ j ≤ m T A j \= T A .

Claim 2 (Commutativity). For any two objects in DB , there is a commutativity isomorphism A ⨄ B ≃ B ⨄ A .

Let us show that this isomorphism is represented by the complex morphism

i 1 \= ⟨ [ ⊥ 1 , id B ] , [ id A , ⊥ 1 ] ⟩ : A ⨄ B → B ⨄ A

(where [ ⊥ 1 , id B ] : A ⨄ B → B and [ id A , ⊥ 1 ] : A ⨄ B → A ) and its inverse by i 2 \= i 1 OP \= [ [ ⊥ 1 , id B ] OP , [ id A , ⊥ 1 ] OP ] \= [ ⟨ ⊥ 1 , id B ⟩ , ⟨ id A , ⊥ 1 ⟩ ] : B ⨄ A → A ⨄ B .

In fact,

i 1 ∘ i 2 \= ⟨ [ ⊥ 1 , id B ] , [ id A , ⊥ 1 ] ⟩ ∘ [ ⟨ ⊥ 1 , id B ⟩ , ⟨ id A , ⊥ 1 ⟩ ] \= ⟨ [ [ ⊥ 1 , id B ] ∘ ⟨ ⊥ 1 , id B ⟩ , [ ⊥ 1 , id B ] ∘ ⟨ id A , ⊥ 1 ⟩ ] , [ [ id A , ⊥ 1 ] ∘ ⟨ ⊥ 1 , id B ⟩ , [ id A , ⊥ 1 ] ∘ ⟨ id A , ⊥ 1 ⟩ ] ⟩ \= ⟨ [ ⌈ id B ⌉ , ⌈ ⊥ 1 ⌋ ] , [ ⌈ ⊥ 1 ⌋ , ⌈ id A ⌋ ] ⟩ \= ⟨ [ id B , ⊥ 1 ] , [ ⊥ 1 , id A ] ⟩ .

Thus, i 1 ∘ i 2 ⨄ \= { id A , id B } \= id B ⨄ id A ⨄ , and hence, by Definition 44 i 1 ∘ i 2 \= id B ⨄ id A \= (point 2 of Example 22 ) \= id B ⨄ A : B ⨄ A → B ⨄ A . Analogously,

i 2 ∘ i 1 \= [ ⟨ ⊥ 1 , id B ⟩ , ⟨ id A , ⊥ 1 ⟩ ] ∘ ⟨ [ ⊥ 1 , id B ] , [ id A , ⊥ 1 ] ⟩ \= ⌈ ⟨ ⊥ 1 , id B ⟩ ∘ [ ⊥ 1 , id B ] , ⟨ id A , ⊥ 1 ⟩ ∘ [ id A , ⊥ 1 ] ⌋ \= ⌈ ⟨ ⊥ 1 ∘ [ ⊥ 1 , id B ] , id B ∘ [ ⊥ 1 , id B ] ⟩ , ⟨ id A , ∘ [ id A , ⊥ 1 ] , ⊥ 1 ∘ [ id A , ⊥ 1 ] ⟩ ⌋ \= ⌈ ⟨ ⊥ 1 , [ ⊥ 1 , id B ] ⟩ , ⟨ [ id A , ⊥ 1 ] , ⊥ 1 ⟩ ⌋ : A ⨄ B → A ⨄ B .

Thus, i 2 ∘ i 1 ⨄ \= { id A , id B } \= id A ⨄ id B ⨄ , and hence, we obtain an identity i 2 ∘ i 1 \= id A ⨄ id B \= id A ⨄ B : A ⨄ B → A ⨄ B . Consequently, i 1 \= ⟨ [ ⊥ 1 , id B ] , [ id A , ⊥ 1 ] ⟩ : A ⨄ B → B ⨄ A is an isomorphism, i. e., A ⨄ B ≃ B ⨄ A .

Claim 3 (Associativity). It holds that id A ⨄ ⟨ [ id B , ⊥ 1 ] , [ ⊥ 1 , id C ] ⟩ : A ⨄ ( B ⨄ C ) → A ⨄ B ⨄ C is an isomorphism. It is enough to show that i 3 \= ⟨ [ id B , ⊥ 1 ] , [ ⊥ 1 , id C ] ⟩ : B ⨄ C → B ⨄ C is an isomorphism, as follows: i 3 ⨄ \= { id B , id C } \= id B ⨄ C ⨄ (from the fact that id B ⨄ C \= id B ⨄ id C ), thus (by point 3 of Definition 44 ) i 3 \= id B ⨄ C : B ⨄ C → B ⨄ C and from the fact that each identity morphism is an isomorphism, it holds that i 3 is an isomorphism.

Claim 4. T ( C ⨄ ⊥ 0 ) \= T C ⨄ T ⊥ 0 \= T C ⨄ ⊥ 0 ≠ T C , and hence, we cannot use Proposition 25 in order to demonstrate the isomorphism C ⨄ ⊥ 0 ≃ C , but the standard categorial method for verification of the isomorphisms. For a given schema C with the interpretation α such that C \= α ∗ ( C ) , we have the identity morphism id C \= α ∗ ( M C C ) : C → C with M C C \= α ∗ ( { 1 r ∣ r ∈ C } ⋃ { 1 r ∅ } ) .

Let us define the morphisms i 1 \= ⟨ α ∗ ( M C C ) , α ∗ ( { 1 r ∅ } ) ⟩ : C → C ⨄ ⊥ 0 and i 2 \= [ α ∗ ( M C C ) , α ∗ ( { 1 r ∅ } ) ] : C ⨄ ⊥ 0 → C . Thus,

i 2 ∘ i 1 \= [ α ∗ ( M C C ) , α ∗ ( { 1 r ∅ } ) ] ∘ ⟨ α ∗ ( M C C ) , α ∗ ( { 1 r ∅ } ) ⟩ \= [ id C , ⊥ 1 ] ∘ ⟨ id C , ⊥ 1 ⟩ \= ⌈ id C ∘ id C , ⊥ 1 ∘ ⊥ 1 ⌋ \= ⌈ id C , ⊥ 1 ⌋ \= (from point 2.4 of Definition 41) \= id C : C → C ,

i. e., the identity morphisms for C . While,

i 1 ∘ i 2 \= ⟨ α ∗ ( M C C ) , α ∗ ( { 1 r ∅ } ) ⟩ ∘ [ α ∗ ( M C C ) , α ∗ ( { 1 r ∅ } ) ] \= ⟨ id C , ⊥ 1 ⟩ ∘ [ id C , ⊥ 1 ] \= ⟨ [ id c , ⊥ 1 ] , [ ⊥ 1 , ⊥ 1 ] ⟩ .

Thus, i 1 ∘ i 2 ⨄ \= id C ⨄ ⊥ 0 ⨄ \= { id C } (from id C ⨄ ⊥ 0 \= id C ⨄ ⊥ 1 ), and hence, from point 3 of Definition 44 , i 1 ∘ i 2 \= id C ⨄ ⊥ 0 . Consequently, this morphism is the identity morphism of the object C ⨄ ⊥ 0 . Therefore, both morphisms i 1 ∘ i 2 and i 2 ∘ i 1 are the identity morphisms and so i 1 \= ⟨ id C , ⊥ 1 ⟩ : C → C ⨄ ⊥ 0 is an isomorphism, and hence,

(a)

C ≃ C ⨄ ⊥ 0 and, analogously, by commutativity, ⊥ 0 ⨄ C ≃ C ⨄ ⊥ 0 ≃ C .

Let us show that i 1 is monic and epic as well. For any two morphisms, g 1 , g 2 : D → C such that i 1 ∘ g 1 \= i 1 ∘ g 2 , i. e., i 1 ∘ g 1 \= ⟨ id C , ⊥ 1 ⟩ ∘ g 1 \= ⟨ g 1 , ⊥ 1 ⟩ \= i 1 ∘ g 2 \= ⟨ g 2 , ⊥ 1 ⟩ , we obtain g 1 \= g 2 (from { g 1 } \= i 1 ∘ g 1 ⨄ \= i 1 ∘ g 2 ⨄ \= { g 2 } and by point 3 of Definition 44 ), and hence, i 1 is a monomorphism. For any two, g 1 \= [ k 1 , ⊥ 1 ] and g 2 \= [ k 2 , ⊥ 1 ] : C + ⊥ 0 → D such that g 1 ∘ i 1 \= g 2 ∘ g 1 , i. e., g 1 ∘ i 1 \= [ k 1 , ⊥ 1 ] ∘ ⟨ id C , ⊥ 1 ⟩ \= ⌈ k 1 , ⊥ 1 ⌋ \= k 1 (component ⊥ 1 is eliminated according to point 4 in Definition 41 ) \= g 2 ∘ i 1 \= [ k 2 , ⊥ 1 ] ∘ ⟨ id C , ⊥ 1 ⟩ \= ⌈ k 2 , ⊥ 1 ⌋ \= k 2 , we obtain k 1 \= k 2 , thus g 1 \= g 2 , and hence, i 1 is an epimorphism.  □

Remark.

From the fact that C ⨄ ⊥ 0 is isomorphic to C and that two isomorphic objects in a category can be substituted, we can eliminate for complex objects all their components, which are equal to the empty database ⊥ 0 , and generally, consider only the strictly-complex objects. Now we obtain the first fundamental property of DB category, which confirms that it is fundamentally different from Set .

Proposition 22.

The morphisms [ id C , id C ] : C ⨄ C → C are epic and monic but not isomorphic. Consequently, DB is not a topos.

Proof.

Let for any two morphisms g 1 \= ⟨ h 1 , k 1 ⟩ : C → C ⨄ C and g 2 \= ⟨ h 2 , k 2 ⟩ : C → C ⨄ C , [ id C , id C ] ∘ g 1 \= [ id C , id C ] ∘ g 2 : C → C . Let us show that g 1 \= g 2 . In fact, [ id C , id C ] ∘ g 1 \= [ id C , id C ] ∘ ⟨ h 1 , k 1 ⟩ \= ⌈ id C ∘ h 1 , id C ∘ k 1 ⌋ \= ⌈ h 1 , k 1 ⌋ : C → C and [ id C , id C ] ∘ g 2 \= ⌈ h 2 , k 2 ⌋ : C → C . Consequently, ⌈ h 1 , k 1 ⌋ \= ⌈ h 2 , k 2 ⌋ and, from Definition 44 , there exists a bijection σ such that σ ( h 1 ) \= h 2 , σ ( k 1 ) \= k 2 with h 1 ˜ \= σ ( h 1 ) ˜ \= h 2 ˜ and k 1 ˜ \= σ ( k 1 ) ˜ \= k 2 ˜ , so that h 1 \= h 2 and k 1 \= k 2 , and hence, g 1 \= ⟨ h 1 , k 1 ⟩ \= ⟨ h 2 , k 2 ⟩ \= g 2 . Consequently, [ id C , id C ] : C ⨄ C → C is a monomorphism.

Let for any two morphisms g 1 : C → C and g 2 : C → C , g 1 ∘ [ id C , id C ] \= g 2 ∘ [ id C , id C ] (the case when g 1 \= g 2 \= ⊥ 1 is trivial, and hence, we consider the cases when g 1 and g 2 are different from ⊥ 1 ). Let us show that g 1 \= g 2 . In fact, g 1 ∘ [ id C , id C ] \= [ g 1 , g 1 ] : C ⨄ C → C and [ g 2 ∘ id C , id C ] \= [ g 2 , g 2 ] : C → C . Consequently, [ g 1 , g 1 ] \= [ g 2 , g 2 ] and, from point 3 of Definition 44 , g 1 \= g 2 . Consequently, [ id C , id C ] : C ⨄ C → C is an epimorphism. Let us show that f \= [ id C , id C ] : C ⨄ C → C is not an isomorphism: If we suppose that it is an isomorphism, then f ∘ f − 1 : C → C has to be the identity arrow id C . From the fact that f − 1 \= [ id C , id C ] OP \= ⟨ id C OP , id C OP ⟩ \= ⟨ id C , id C ⟩ : C → C ⨄ C , so that f ∘ f − 1 \= [ id C , id C ] ∘ ⟨ id C , id C ⟩ \= ⌈ id C ∘ id C , id C ∘ id C ⌋ \= ⌈ id C , id C ⌋ ≠ id C (by point 2 of Definition 44 ), i. e., the properties of an isomorphism are not satisfied.

From the fact that in any topos category if a morphism is both epic and monic, then it must also be an isomorphism, we conclude that DB is not a topos.  □

Thus, DB is not a topos. However, there is a subset of morphisms for which the topological properties hold so that if a morphism is both epic and monic then it must also be an isomorphism: it is the set of all simple arrows, as we will show in next corollary, so that first step is to analyze the topological properties of the simple morphisms in DB and only after that the general properties for (also complex) morphisms.

Corollary 17.

For each simple arrow f : A → B , the following are valid:

1.

f is monic iff f ˜ \= T A .

2.

f is epic iff f ˜ \= T B .

3.

f is an isomorphism iff it is monic and epic (i. e., when f ˜ \= T A \= T B ).

Proof.

Claim 1 (from right to left). Let us show that if f ˜ \= T A then f : A → B is monic. A simple arrow f : A ⟶ B is monic iff for any (possibly complex) two arrows h , g : ⨄ 1 ≤ i ≤ n X i ⟶ A , f ∘ h \= f ∘ g implies h \= g . Let us show that it is satisfied when f ˜ \= T A . We have (from Proposition 23 ) that for each point-to-point simple arrow ( g i : X i → A ) ∈ g ⨄ , g i ˜ ⊆ T A (analogously for each ( h i : X i → A ) ∈ h ⨄ , h i ˜ ⊆ T A ). Thus, if f ∘ h \= f ∘ g then, from Definition 43 , f ∘ g ⨄ \= f ∘ h ⨄ , i. e., they have the same ptp arrows, i. e., f ∘ g i \= f ∘ h i : X i → B , so that they have the same fluxes, i. e., f ∘ g i ˜ \= f ∘ h i ˜ . But we have that f ∘ g i ˜ \= f ˜ ⋂ g ˜ i \= T A ⋂ g ˜ i \= g ˜ i and f ∘ h i ˜ \= f ˜ ⋂ h ˜ i \= T A ⋂ h ˜ i \= h ˜ i , so that h ˜ i \= g ˜ i , i. e., are equal ptp arrows h i \= g i : X i → A . It holds for all ptp arrows in g and h , so that g \= h , and, consequently, f : A ⟶ B is a monomorphism.

(From left to right). If a simple arrow f : A ↪ B is monic, then for any (possibly complex) two arrows h , g : ⨄ 1 ≤ i ≤ n X i ⟶ A , f ∘ h \= [ f ∘ h 1 , … , f ∘ h n ] \= f ∘ g \= [ f ∘ g 1 , … , f ∘ g n ] : ⨄ 1 ≤ i ≤ n X i ⟶ B , implies h \= g , i. e., ∀ 1 ≤ l ≤ n ( f ∘ g l \= f ∘ h l : X l → B implies g l \= h l : X l → A ) . Let us suppose that f ˜ ⊂ T A , so that we can have, e. g., g l ˜ \= f ˜ ≠ T A \= h l ˜ , i. e., g l ≠ h l but with f ∘ g l ˜ \= f ˜ \= f ∘ h l ˜ , i. e., f ∘ g l \= f ∘ h l . What is a contradiction? Thus, it must hold that f ˜ \= T A .

Claim 2. The proof is analog to that of Claim 1.

Claim 3 (from left to right). It holds for every category.

(From right to left). If f : A → B is both monic and epic, then from the first two points, f ˜ \= T A \= T B . Let us show that f \= is B − 1 ∘ is A . In fact, is B − 1 ∘ is A ˜ \= is B − 1 ˜ ⋂ is A ˜ \= (from Lemma 3 ) \= T B ⋂ T A \= T A \= T B , so that from Definition 44 , f \= is B − 1 ∘ is A : A → B , i. e., f is a composition of two isomorphisms, and hence it is an isomorphism as well.  □

Now we will also analyze the properties of complex arrows.

Notice that the complex morphism f \= [ id C , id C ] : C ⨄ C → C has to be formally represented by “indexing by position” formalism, i. e., f \= [ id C , id C ] : A 1 ⨄ A 2 → B 1 where A 1 \= A 2 \= B 1 \= C , so that f ⨄ \= { f 11 \= id C : A 1 → B 1 , f 21 \= id C : A 2 → B 1 } , i. e., by two mutually independent mapping morphisms id C : C → C . Thus, the morphisms g \= [ id C , ⊥ 1 ] : C ⨄ C → C and h \= [ ⊥ 1 , id C ] : C ⨄ C → C have g ⨄ \= { g 11 \= id C : A 1 → B 1 } \= { id C : C → C } ≠ f ⨄ , h ⨄ \= { h 21 \= id C : A 2 → B 1 } \= { id C : C → C } ≠ f ⨄ . But g ⨄ \= { id C : C → C } \= h ⨄ so that, from Definition 44 , g \= h . Thus, [ id C , ⊥ 1 ] \= g \= h \= [ ⊥ 1 , id C ] .

Proposition 23.

We have the following fundamental properties for the morphisms in DB :

1.

if a morphism f : A ⟶ B has a property P ∈ { isomorphic, monic, epic } , then each of its ptp arrow f l ∈ f ⨄ has the same property P;

2.

if f : A ↪ B is monic and A \= ⨄ 1 ≤ j ≤ m A j , m ≥ 1 , is strictly complex then for each A j it must exist with a ptp arrow f n ∈ f ⨄ with dom ( f n ) \= A j ;

3.

if f : A ↠ B is epic and B \= ⨄ 1 ≤ i ≤ k B i , k ≥ 1 , k ≥ 1 , is strictly complex then for each B i there must exist a ptp arrow f n ∈ f ⨄ with cod ( f n ) \= B i ;

4.

if C \= ⨄ 1 ≤ j ≤ m C j and B \= ⨄ 1 ≤ i ≤ k B i are strictly-complex objects and there is an isomorphism is : C ≃ B , then m \= k .

Proof.

1. Its inverted arrow is f OP ⨄ \= { f j i OP : B i → A j ∣ f j i : A j → B i in f ⊎ and f j i OP ˜ \= f j i ˜ } . Let f : ⨄ 1 ≤ j ≤ m A j → ⨄ 1 ≤ i ≤ k B i be an isomorphism, so that f ∘ f − 1 \= id B , thus f ∘ f − 1 ⨄ \= f ∘ f OP ⨄ \= { f j i ∘ f j i OP \= id i : B i → B i ∣ f j i ∈ f ⊎ , f j i OP ∈ f OP ⊎ with cod ( f j i OP ) \= dom ( f j i ) \= A j and cod ( f j i ) \= B i } \= ⨄ 1 ≤ i ≤ k id B i ⨄ \= id B ⨄ . Let us suppose that f j i ∈ f ⨄ is not an isomorphism. Thus, f j i ∘ f j i OP ≠ id i : B i → B i (with cod ( f j i OP ) \= dom ( f j i ) and cod ( f j i ) \= B i ), so that f ∘ f − 1 ≠ id B and f would not be an isomorphism, which is a contradiction. Consequently, each f j i ∈ f ⨄ must be an isomorphism. The converse does not hold: let us consider the morphism f \= [ id C , id C ] : A 1 ⨄ A 2 → B 1 , with A 1 \= A 2 \= B 1 \= C where f ⨄ \= { f 11 \= id C : A 1 → B 1 , f 21 \= id C : A 2 → B 1 } where the point-to-point arrows id C are the identity arrows (thus isomorphisms as well) but f is not an isomorphism (from Proposition 22 ).

Let f : A ↪ B be a monomorphism. Then, for every two arrows g , h : X → A if f ∘ g \= f ∘ h , then we obtain g \= h . Let us suppose that there exists ( f j i : A j → B i ) ∈ f ⨄ , which is not monic, i. e., there exist g l j , h l j such that f j i ∘ g l j \= f j i ∘ h l j with g l j ≠ h l j : X l → A j . However, from the fact that f is a monomorphism it must hold that g \= h and, by Definition 44 , g ⨄ \= h ⨄ with g l j \= h l j : X l → A j , which is a contradiction. Thus, each point-to-point arrow f j i of a monic arrow f must be monic as well.

The proof for an epimorphism f : A ↠ B is similar.

Claim 2. Let A be a strictly-complex object (with all A j ≠ ⊥ 0 , j \= 1 , … , m ) and let us suppose that there exists A j such that A j ∉ { dom ( f n ) ∣ f n ∈ f ⨄ } . Let X \= X 1 be a simple object and g , h : X 1 → A be two arrows such that f ∘ g \= f ∘ h so that from the fact that f is a monomorphism, g \= h with two ptp arrows ( g 1 j : X 1 → A j ) ∈ g ⨄ and ( h 1 j : X 1 → A j ) ∈ h ⨄ with g 1 j \= h 1 j . However, we can now take any ptp arrow g 1 j ′ : X 1 → A j such that g 1 j ′ ≠ h 1 j and change g into g ′ by substituting old g 1 j by g 1 j ′ , so that still f ∘ g ′ \= f ∘ h is valid, i. e., f ∘ g ′ \= f ∘ g but not g ′ \= g , and hence, we obtain that f is not monomorphic, which is a contradiction. Consequently, for each A j there must exist at least one ptp arrow f n ∈ f ⨄ with dom ( f n ) \= A j if f is a monomorphism (note that f n ≠ ⊥ 1 ).

Claim 3. The proof when f is epic is similar.

Claim 4. Let for any two strictly-complex objects C \= ⨄ 1 ≤ j ≤ m C j and B \= ⨄ 1 ≤ i ≤ k B i , is : C → B be an isomorphism. Thus, { dom ( is i ) ∣ is i ∈ is ⨄ } \= { C 1 , … , C m } and { cod ( is i ) ∣ is i ∈ is ⨄ } \= { B 1 , … , B k } (from the fact that is ∘ is 1 \= id B \= ⨄ 1 ≤ i ≤ k id B i and is − 1 ∘ is \= id A \= ⨄ 1 ≤ j ≤ m id A j ). Then, from point 1 of this proposition, each point-to-point arrow is i ∈ is ⨄ is an isomorphism with | is ⨄ | ≥ max ( m , k ) . Let us show that m \= k . Let us suppose that m > k , so that we have two different isomorphisms is i , is j ∈ is ⨄ with dom ( is i ) ≠ dom ( is j ) and cod ( is i ) \= cod ( is j ) \= B l . Thus, ⟨ is i , is j ⟩ ∘ [ is i OP , is j OP ] \= ⌈ is i ∘ is i OP , is j ∘ is j OP ⌋ \= ⌈ id B l , id B l ⌋ ≠ id B l . Hence, is cannot be an isomorphism, which is a contradiction. Analogously, if we suppose that m < k we obtain again a contradiction. Consequently, it must be m \= k .  □

Remark.

Claim 2 of this proposition explains the fact that when C ≠ ⊥ 0 , the morphism k \= [ id c , id c ] : C ⨄ C → C where both point-to-point arrows are identities (thus, the isomorphisms) is not an isomorphism (but only a monic and epic arrow, as established by Proposition 22 ). While, for nonstrictly-complex objects, we have the isomorphisms when m ≠ k as well: let us consider the isomorphism C ⨄ ⊥ 0 ≃ C , when m \= 2 ( A 1 \= C , A 2 \= ⊥ 0 ) and k \= 1 with B 1 \= C .

We obtain the following important results for the monomorphisms in DB .

Proposition 24.

The following monomorphisms in the DB category are derivable from the morphisms and from the inclusions of the objects:

1.

The conceptualized object f ˜ \= B ⊤ ( f ) , obtained from a morphism f : A ⟶ B , is a closed object in DB such that f ˜ \= T f ˜ ⪯ A ⊗ B . This PO relation may be represented internally in DB by the monomorphism in : f ˜ ↪ id A ˜ ⊗ id B ˜ and its derivations in A : f ˜ ↪ id A ˜ and in B : f ˜ ↪ id B ˜ where id A ˜ \= T A \= ⨄ 1 ≤ j ≤ m T A j , m ≥ 1 and id B ˜ \= T B \= ⨄ 1 ≤ i ≤ k T B i , k ≥ 1 , with ptp arrows:

{ in j i \= { id R ∣ R ∈ f j i ˜ } : f j i ˜ ↪ S j i ∣ ( f j i : A j → B i ) ∈ f ⨄ } ,

where S j i \= T A j ⋂ T B i for i n ⨄ , S j i \= T A j for in A ⨄ , and S j i \= T B i for in B ⨄ .

2.

For any two objects T A ⊆ T B , there exists a monomorphism in T A : T A ↪ T B .

Proof.

Claim 1. Each conceptualized object (information flux) of an atomic arrow is a closed object. In fact, from Definition 67 , for a simple atomic morphism f \= α ∗ ( M A B ) : A → B , both databases A and B are simple objects (sets of relations) and so are T A and T B . Thus, if f ˜ \= ⊥ 0 (empty flux), then T ⊥ 0 \= ⊥ 0 . Otherwise, if f ˜ ≠ ⊥ 0 then: T f ˜ \= T ( T { π x i ‖ e [ ( _ ) j / r i , j ] 1 ≤ j ≤ k ‖ A ∣ q i ∈ O ( r i , 1 , … , r i , k , r i ′ ) is equal to ( e ⇒ ( _ ) ( t i ) ) ∈ M A B } ) \= T { π x i ‖ e [ ( _ ) j / r i , j ] 1 ≤ j ≤ k ‖ A ∣ q i ∈ O ( r i , 1 , … , r i , k , r i ′ ) is equal to ( e ⇒ ( _ ) ( t i ) ) ∈ M A B } \= f ˜ ⊆ T A . From the fact that this information flux is transferred into B , f ˜ ⊆ T B , so that f ˜ ⊆ T A ⋂ T B , i. e., by Definition 40 , f ˜ ⪯ A ⊗ B . Each arrow is a composition of a number of atomic arrows and the intersection of closed objects (their information fluxes) is always a closed object.

If f : ⨄ 1 ≤ j ≤ m A j → ⨄ 1 ≤ i ≤ k B i is a complex morphism with a set of more than one point-to-point arrow in f ⨄ then, for each f j i : A j → B i ∈ f ⨄ , f j i ˜ ⊆ T A j ⋂ T B i . Hence, ⨄ f ⨄ ˜ ⪯ A ⊗ B and f ˜ ⪯ ⨄ f ⨄ ˜ (from Definition 43 , f ˜ ≃ ⨄ f ⨄ ˜ ), so that f ˜ ⪯ A ⊗ B . From Lemma 3 , id A ˜ \= T A and, from a Definition 40 and T ( T A ) \= T A , A ⊗ B \= T A ⊗ T B \= id A ˜ ⊗ id B ˜ . Thus, we obtain the PO relation f ˜ ⪯ id A ˜ ⊗ id B ˜ and we will show that it can be internally represented in DB by a monomorphism in : f ˜ ↪ id A ˜ ⊗ id B ˜ . The facts that i n , in A and in B are the morphisms defined by Theorem 10 , and hence, they can be obtained from particular schema mappings and a given R-algebra α , will be shown in Theorem 14 .

Let us consider a morphism f : ⨄ 1 ≤ j ≤ m A j → ⨄ 1 ≤ i ≤ k B i , k , m ≥ 1 , with point-to-point (simple) arrows ( f j i : A j → B i ) ∈ f ⨄ . Let us define the morphism in : f ˜ → T A ⊗ T B with i n ⨄ \= { in j i \= { id R : R → R ∣ R ∈ f j i ˜ } : f j i ˜ ↪ T A j ⋂ T B i ∣ ( f j i : A j → B i ) ∈ f ⨄ } . Thus, there is a bijection σ : f ⨄ → i n ⨄ with in j i \= σ ( f j i ) : f j i ˜ → T A j ⋂ T B i and in j k ˜ \= f j k ˜ for any ptp arrow, and hence, i n ˜ ≃ ⨄ i n ⨄ ˜ ≃ ⨄ f ⨄ ˜ ≃ f ˜ .

For each pair g , h : ⨄ 1 ≤ l ≤ n X l → f ˜ of morphisms (with ( g i , j i : X l → f j i ˜ ) ∈ g ⨄ ≠ ∅ and ( h l , j i : X l → f j i ˜ ) ∈ h ⨄ ≠ ∅ so that, from Proposition 23 , g l , j i ˜ ⊆ T f j i ˜ \= f j i ˜ and h l , j i ˜ ⊆ T f j i ˜ \= f j i ˜ , and hence, σ ( f j i ) ∘ g l , j i ∈ i n ∘ g ⨄ and σ ( f j i ) ∘ h l , j i ∈ i n ∘ h ⨄ ) such that i n ∘ g \= i n ∘ h : X → B , i. e., from point 3 of Definition 44 , i n ∘ g ⨄ \= i n ∘ h ⨄ . Thus, they have the same ptp arrows, i. e., σ ( f j i ) ∘ g l , j i \= σ ( f j i ) ∘ h l , j i : X l → T A j ⋂ T B i so that they have the same fluxes, i. e., σ ( f j i ) ∘ g l , j i ˜ \= σ ( f j i ) ∘ h l , j i ˜ . However, σ ( f j i ) ∘ g l , j i ˜ \= σ ( f j i ) ˜ ⋂ g l , j i ˜ \= f j i ˜ ⋂ g l , j i ˜ \= g l , j i ˜ and, analogously, σ ( f j i ) ˜ ⋂ h l , j i ˜ \= f j i ˜ ⋂ h l , j i ˜ \= h l , j i ˜ so that, h l , j i ˜ \= g l , j i ˜ , i. e., are equal ptp arrows h l , j i \= g l , j i : X l → f j i ˜ . This holds for all ptp arrows in g and h so that g \= h . That is, for each g , h such that i n ∘ g \= i n ∘ h : X → B , we obtained that g \= h , so that:

(1)

in : f ˜ ↪ id A ˜ ⋂ id B ˜ is a monomorphism and, analogously,

(2)

in A : f ˜ ↪ id A ˜ \= T A and in B : f ˜ ↪ id B ˜ \= T B .

Claim 2. Let us show that for any two simple objects A and B , T A ⊆ T B implies the existence of a monomorphism in T A : T A ↪ T B :

If T A ⊆ T B , then we have a morphism f \= { id R : R → R ∣ R ∈ T A } : T A ↪ T B with f ˜ \= T A . Then, from (2), we have a monomorphism in T A : f ˜ ↪ id T B ˜ \= T ( T B ) \= T B so, by substituting f ˜ by T A , we obtain in T A : T A ↪ T B .

Notice that for any two complex objects A and B such that T A ⊆ T B , these complex objects must have the same number k ≥ 2 of simple databases, i. e., it must be A \= ⨄ 1 ≤ i ≤ k A i and B \= ⨄ 1 ≤ i ≤ k B i with A i ⊆ B i , for 1 ≤ i ≤ k , and T A \= ⨄ 1 ≤ i ≤ k T A i ⊆ ⨄ 1 ≤ i ≤ k T B i \= T B , and hence, we obtain the monomorphism in T A \= ⨄ 1 ≤ i ≤ k ( in T A i : T A i ↪ T B i ) .  □

Thus, we are able to define all kinds of morphisms in DB category, as follows.

Proposition 25.

The following properties for morphisms are valid:

1.

Each arrow f : A → B such that f ˜ ≃ T A (and in the special case when f ˜ \= T A ) is a monomorphism (monic arrow).

2.

Each arrow f : A → B such that f ˜ ≃ T B (and in the special case when f ˜ \= T B ) is an epimorphism (epic arrow).

3.

Each arrow f : A → B such that f ˜ ≃ T A ≃ T B (and in the special case when f ˜ \= T A \= T B ) is an isomorphism (iso arrow).

Proof.

1. For a simple arrow, it holds from Corollary 17 , so consider a strictly-complex source object A . For a given complex arrow f : ⨄ 1 ≤ j ≤ m A j → ⨄ 1 ≤ i ≤ k B i , let there be an isomorphism T A ≃ f ˜ . Then, from this isomorphism and the fact that f ˜ is strictly complex, also T A \= ⨄ 1 ≤ j ≤ m A j is strictly complex, so we obtain m \= | f ⨄ | and a bijection σ ′ : f ⨄ → { 1 , … , m } such that for each f j i : A j → B i , f ˜ j i \= T A σ ′ ( f j i ) \= T A j . Thus, from above, this ptp (simple) arrow f j i is monic.

For each pair of morphisms g , h : ⨄ 1 ≤ i ≤ k X i → A (with ( g l j : X l → A j ) ∈ g ⨄ ≠ ∅ and ( h l j : X l → A j ) ∈ h ⨄ ≠ ∅ , it holds from above that g l j ˜ ⊆ T A j and h l j ˜ ⊆ T A j ) if f ∘ g \= f ∘ h : X → B then, from point 3 of Definition 44 , f ∘ g ⨄ \= f ∘ h ⨄ , i. e., they have the same ptp arrows, i. e., f j i ∘ g l j \= f j i ∘ h l j : X l → B i , and hence, they have the same fluxes, i. e., f j i ∘ g l j ˜ \= f j i ∘ h l j ˜ . However, f j i ∘ g l j ˜ \= f ˜ j i ⋂ g ˜ l j \= T A j ⋂ g ˜ l j \= g ˜ l j and f j i ∘ h l j ˜ \= f ˜ j i ⋂ h ˜ l j \= T A j ⋂ h ˜ l j \= h ˜ l j , so that h ˜ l j \= g ˜ l j , i. e., h l j \= g l j : X l → A j . It holds for all ptp arrows in g and h so that g \= h and, consequently, f is an monomorphism. If A is not strictly complex, then we have an isomorphism (which is monic as well) is : A → A ′ (thus, T A ≃ T A ′ ) where A ′ is strictly complex, so that f \= f ′ ∘ is : A → B (where f ′ : A ′ → B is a monomorphism above with f ′ ˜ ≃ T A ′ ≃ T A ) is a composition of two monomorphism, with f ˜ ≃ f ′ ˜ , i. e., f ˜ ≃ T A , and hence, it is monic as well.

Claim 2. For a simple arrow, it holds from Corollary 17 and so consider a strictly complex target object B . For a given complex arrow f : ⨄ 1 ≤ j ≤ m A j → ⨄ 1 ≤ i ≤ k B i , let there be an isomorphism T B ≃ f ˜ . Then, from this isomorphism and the fact that f ˜ and also T B \= ⨄ 1 ≤ j ≤ k B j are strictly complex, we obtain k \= | f ⨄ | and bijection σ ′ : f ⨄ → { 1 , … , k } such that for each f j i : A j → B i , f ˜ j i \= T B σ ′ ( f j i ) \= T B i . Thus, from above, this ptp (simple) arrow f j i is epic. For each pair of morphisms g , h : B → ⨄ 1 ≤ i ≤ k X i (with ( g i l : B i → X l ) ∈ g ⨄ ≠ ∅ and ( h i l : B i → X l ) ∈ h ⨄ ≠ ∅ , it holds from above that g i l ˜ ⊆ T B i and h i l ˜ ⊆ T B i ) if g ∘ f \= h ∘ f : A → X , then, from point 3 of Definition 44 , g ∘ f ⨄ \= h ∘ f ⨄ , i. e., they have the same ptp arrows, i. e., g i l ∘ f j i \= h i l ∘ f j i : A j → X l , and hence, they have the same fluxes, i. e., g i l ∘ f j i ˜ \= h i l ∘ f j i ˜ . However, g i l ∘ f j i ˜ \= g ˜ i l ⋂ f ˜ j i \= g ˜ i l ⋂ T B i \= g ˜ i l and h i l ∘ f j i ˜ \= h ˜ i l ⋂ f ˜ j i \= h ˜ i l ⋂ T B i \= h ˜ i l , so that h ˜ i l \= g ˜ i l , i. e., are equal ptp arrows h i l \= g i l : B i → X l . It holds for all ptp arrows in g and h so that g \= h and, consequently, f is an epimorphism. If B is not strictly complex, then we have an isomorphism (which is epic as well) is : B ′ → B (thus, T B ′ ≃ T B ) where B ′ is strictly complex, so that f \= is ∘ f ′ : A → B (where f ′ : B ′ → B is an epimorphism above with f ′ ˜ ≃ T B ≃ T B ′ ) is a composition of two epimorphism, with f ˜ ≃ f ′ ˜ , i. e., f ˜ ≃ T B , and hence, it is epic as well.

Claim 3. For a simple arrow, it holds from Corollary 17 .

So, let us consider the strictly complex objects A \= ⨄ 1 ≤ j ≤ m A j and B \= ⨄ 1 ≤ i ≤ k B i so that m \= k ≥ 2 , and from the isomorphism T A \= ⨄ 1 ≤ j ≤ m A j ≃ T B \= ⨄ 1 ≤ i ≤ k B i , we have a bijection (permutation) σ : { 1 , … , m } → { 1 , … , k } such that T A j \= T B σ ( j ) , for j \= 1 , … , m . Let us consider the most general case when T A j ≠ T A i for all i ≠ j , i , j ∈ { 1 , … , m } (i. e., all T A j are distinct). From f ˜ ≃ T A , the number of ptp arrows in f has to be equal to m , and hence, f ⨄ \= { f 1 , … , f m } with f ˜ \= ⨄ 1 ≤ i ≤ m f i ˜ ≃ T A ; thus, with a permutation σ 1 : { 1 , … , m } → { 1 , … , k } such that f i ˜ \= T A σ 1 ( i ) \= T B σ ( σ 1 ( i ) ) , for i \= 1 , … , m . Thus, from the fact that all T A j are distinct values, each ptp arrow is

(a)

f i : A σ 1 ( i ) → B σ ( σ 1 ( i ) ) .

Let us define a morphism g : T A → T B such that g ⨄ \= { g j σ ( j ) : T A j → T B σ ( j ) ∣ 1 ≤ j ≤ m } where each ptp arrow g j σ ( j ) is the identity arrow id T A j (from the fact that T A j \= T B σ ( j ) ). From g − 1 ⨄ \= { g j σ ( j ) − 1 : T B σ ( j ) → T A j ∣ 1 ≤ j ≤ m } , we obtain that g ∘ g − 1 \= id T B and g − 1 ∘ g \= id T A , and hence, g is an isomorphism.

It is easy to show that is B − 1 ∘ g ∘ is A ⨄ \= f ⨄ where is A \= ⨄ 1 ≤ j ≤ m is A j : A j → T A j and is B − 1 \= ⨄ 1 ≤ i ≤ m is B i − 1 : T B i → B i , so that for each 1 ≤ j ≤ m ,

(b)

f σ 1 − 1 ( j ) \= is B σ ( j ) − 1 ∘ g j σ ( j ) ∘ is A j : A j → B σ ( j ) (it is equal to (a) for i \= σ 1 − 1 ( j ) , i. e., j \= σ 1 ( i ) ).

Consequently, from point 3 of Definition 44 , f \= is B − 1 ∘ g ∘ is A , i. e., f is a composition of three isomorphisms, and hence, it is an isomorphism f : A ≃ B as well.

Let us show that this is valid also when A and B are not strictly complex: Let A ′ and B ′ be the strictly complex objects obtained from A and B by elimination of all ⊥ 0 . Then, from point 4 of Lemma 3 and commutativity (point 2 of Lemma 3 ), f 1 : A ≃ A ′ is an isomorphism with T A ≃ T A ′ and f 2 : B ′ ≃ B is an isomorphism with T B ≃ T B ′ . Thus, we obtain T A ′ ≃ T A ≃ T B ≃ T B ′ , i. e., T A ′ ≃ T B ′ , so that f ′ : A ′ → B ′ for f ′ ˜ ≃ T A ′ ≃ T B ′ is an isomorphism and f \= f 2 ∘ f ′ ∘ f 1 is a composition of the isomorphisms, and hence, an isomorphism as well.  □

Notice that in this proposition we provided the sufficient conditions for monic, epic and isomorphic arrows in DB and not the necessary conditions: we have seen other cases of monic and epic arrows in the case of complex arrows, e. g., [ id A , id A ] : A ⨄ A → A , which are not isomorphic. We can have the cases when A and B are isomorphic objects also when T A ≠ T B (as in the case when C is isomorphic to the separation-composed object C ⨄ ⊥ 0 in Corollary 3 ). In what follows, we will show that any two isomorphic simple objects (simple databases) in DB are observationally equivalent.

Remark.

For each of the two objects A and B , A ≃ B iff T A ≃ T B .

In fact, if is : A → B is an isomorphism, then is B ∘ is ∘ is A − 1 : T A → T B is a composition of three isomorphisms, and hence, it is an isomorphism as well. Vice versa, if is : T A → T B is an isomorphism, then is B − 1 ∘ is ∘ is A : A → B is a composition of three isomorphisms, and hence, it is an isomorphism as well.

Example 23.

Consider the schema A \= ( S A , Σ A ) with S A \= { StudentRome ( x 1 , x 2 ) , StudentMilan ( x 1 , x 2 ) , StudentFlorence ( x 1 , x 2 ) , StudentRMF ( x 1 , x 2 ) } and with binary relational symbols for students in the cities Rome, Milan and Florence (that associate each student name with a student id) and for all students in these three cities, and the schema B \= ( S B , ∅ ) such that S B \= { Student ( x 1 , x 2 ) } intended to unify all students from these three cities. Σ A is a set of tuple-generating constraints { ∀ x 1 ∀ x 2 ( StudentRome ( x 1 , x 2 ) ∧ ¬ StudentRMF ( x 1 , x 2 ) ⇒ r ⊤ ( 0 ‾ , 1 ‾ ) ) , ∀ x 1 ∀ x 2 ( StudentMilan ( x 1 , x 2 ) ∧ ¬ StudentRMF ( x 1 , x 2 ) ⇒ r ⊤ ( 0 ‾ , 1 ‾ ) ) , ∀ x 1 ∀ x 2 ( StudentFlorence ( x 1 , x 2 ) ∧ ¬ StudentRMF ( x 1 , x 2 ) ⇒ r ⊤ ( 0 ‾ , 1 ‾ ) ) } . Consequently, we will consider only mapping interpretations α such that α ( Student ) \= α ( StudentRMF ) \= α ( StudentRome ) ⋃ α ( StudentMilan ) ⋃ α ( StudentFlorence ) . Then T A \= T ( α ( StudentRome ) ⋃ α ( StudentMilan ) ⋃ α ( StudentFlorence ) ⋃ α ( StudentRFM ) ) \= T ( α ( Student ) ) \= T B and, consequently, the database-instances A and B are isomorphic, i. e., A ≃ B .

Let us consider how to define the isomorphic arrow f : A → B in the category DB .

First of all, while in the construction of T A , we can use the union of conjunctive queries (i. e., the disjunctive logical formula StudentRome ( x 1 , x 2 ) ∨ StudentMilan ( x 1 , x 2 ) ∨ StudentFlorence ( x 1 , x 2 ) ), as explained in Section A.3.2 in the Introduction, we cannot use the schema mapping ∀ x 1 ∀ x 2 ( ( StudentRome ( x 1 , x 2 ) ∨ StudentMilan ( x 1 , x 2 ) ∨ StudentFlorence ( x 1 , x 2 ) ) ⇒ Student ( x 1 , x 2 ) ) because the left-hand sides of implications in tgds (and SOtgds) are only conjunctive formulae.

Consequently, we have to make a decomposition of such a disjunction into the three conjunctive components. Hence, the SOtgd for this schema mapping is a formula Φ equal to ∀ x 1 ∀ x 2 ( StudentRome ( x 1 , x 2 ) ⇒ Student ( x 1 , x 2 ) ) ∧ ∀ x 1 ∀ x 2 ( StudentMilan ( x 1 , x 2 ) ⇒ Student ( x 1 , x 2 ) ) ∧ ∀ x 1 ∀ x 2 ( StudentFlorence ( x 1 , x 2 ) ⇒ Student ( x 1 , x 2 ) ) , and, consequently, we define the mapping M A B \= { Φ } : A → B .

Thus, we obtain the sketch’s mapping M A B \= MakeOperads ( M A B ) \= { q 1 , q 2 , q 3 , 1 r ∅ } : A → B with q 1 ∈ O ( StudentRome , Student ) , q 2 ∈ O ( StudentMilan , Student ) , q 3 ∈ O ( StudentFlorence , Student ) .

Consequently, we obtain the isomorphic arrow f \= α ∗ ( { q 1 , q 2 , q 3 , 1 r ∅ } ) : A → B where f \= { α ( q 1 ) , α ( q 2 ) , α ( q 3 ) , q ⊥ } is the set of injective functions:

in 1 \= α ( q 1 ) : α ( StudentRome ) → α ( Student ) , in 2 \= α ( q 2 ) : α ( StudentMilan ) → α ( Student ) , in 3 \= α ( q 3 ) : α ( StudentFlorence ) → α ( Student ) ,

with the information flux (here x denotes the tuple ( x 1 , x 2 ) ) equal to:

f ˜ \= B ⊤ ( f ) \= T { π x ‖ StudentRome ‖ A , π x ‖ StudentMilan ‖ A , π x ‖ StudentFlorence ‖ A } \= T { α ( StudentRome ) , α ( StudentMilan ) , α ( StudentFlorence ) } \= T A ,

i. e., it is monic and, from the fact that T A \= T B , and hence, f ˜ \= T B , it is also epic. Consequently, from Proposition 25 , f : A → B is an isomorphism.

If we enlarge the schema B with a new relation Takes1 ( x 1 , x 3 ) that associates student names with courses such that α ( Takes1 ) is not the empty relation, then f ˜ \= T A ⊂ T B , and hence, in this case the morphism above f : A → B is a monic arrow only.

Remark.

It is important to take clearly in mind that the equality of arrows in DB , and hence, the commutativity of the diagrams in DB is based on the observational equivalence in Definition 44 and not on the set-theoretic equality. The (observational) equality of morphisms is more general then the set-theoretic equality.

Corollary 18.

For each two set-theoretically equal simple morphisms f , g : A → B , they are equal in category DB (in sense of observational equivalence in Definition 44 ) but not vice versa.

Proof.

If f and g are set theoretically equal, then they have the same operads mapping M A B , and hence, they have the same information flux Flux ( α , M A B ) , i. e., f ˜ is set theoretically equal to g ˜ and, from Definition 44 , f \= g in DB as well. Let us consider the SOtgd for this schema mapping M A B ′ \= { ∀ x 1 ∀ x 2 ( StudentRMF ( x 1 , x 2 ) ⇒ Student ( x 1 , x 2 ) ) } : A → B , in Example 23 above, with M A B ′ \= MakeOperads ( M A B ′ ) \= { q 4 , 1 r ∅ } : A → B and q 4 ∈ O ( StudentRMF , Student ) . Then we obtain the isomorphism f 1 \= α ∗ ( { q 4 , 1 r ∅ } ) : A → B where f 1 \= { α ( q 4 ) , q ⊥ } with the injective function in 4 \= α ( q 1 ) : α ( StudentRMF ) → α ( Student ) , so that f 1 ˜ \= f ˜ , i. e., f 1 \= f in DB , while they are not set theoretically equal.  □

We obtained that only for the complex arrows we have the situation that a given morphism, which is both monic and epic is not also an isomorphism, and hence, DB is not a topos. So, in what follows, we will explain what exactly the particular condition is, when a complex arrow, which is monic and epic, is also an isomorphism in the DB category.

Notice that an empty arrow ⊥ 1 \= { q ⊥ : ⊥ → ⊥ } between two databases, with ⊥ 1 ˜ \= ⊥ 0 \= { ⊥ } , is equivalent to the absence of the schema mapping between these two databases. In fact, because of that, we are always able to introduce the empty arrows between databases, as it was used in Lemma 2 for the construction of canonical complex morphisms in Section 7.1 . In fact, an empty arrow is not a ptp arrow, so that the presence or absence of them in a given complex arrow does not change such an arrow (from Definition 44 two complex arrows are equal iff they have the same set of ptp arrows and the empty arrows are on ptp arrows). Moreover, note that each empty arrow ⊥ 1 : A j → B i is not monic if A j ≠ ⊥ 0 (to be monic it must satisfy T A j \= ⊥ 1 ˜ \= ⊥ 0 ) and is not epic if B i ≠ ⊥ 0 (to be epic it must satisfy T B i \= ⊥ 1 ˜ \= ⊥ 0 ), and is not an isomorphism if A j ≠ ⊥ 0 or B i ≠ ⊥ 0 .

Notice also that, from the fact that A ⨄ ⊥ 0 is isomorphic to A , we can replace any original complex-object B by a strictly complex object B ′ obtained by elimination of the empty objects ⊥ 0 from the disjoint union. Thus, any complex arrow g : A → B can be substituted by an equivalent arrow f : A ′ → B ′ between two strictly complex objects A ′ and B ′ such that f ⨄ \= g ⨄ so that f can always be well-defined from the set g ⨄ by using the canonical representation of g between strictly complex objects A ′ and B ′ (by Lemma 2 ).

Consequently, any proof for the morphisms can be done by using its canonical morphism between the strictly complex objects obtained from the original source and target objects (as we did in the last part of the proof of Proposition 25 ).

Lemma 4.

Each complex arrow f : A → B , between the strictly complex objects A \= ⨄ 1 ≤ j ≤ m A j , B \= ⨄ 1 ≤ i ≤ k B i with m , k ≥ 2 , is an isomorphism iff it is both monic and epic and composed of m \= k point-to-point arrows.

Proof.

From Proposition 23 and the fact that f is monic, for each A j must exist a ptp arrow f j i ∈ f ⨄ with dom ( f j i ) \= A j , | f ⨄ | ≥ m . Moreover, f is epic, and hence, for each B i must exist a ptp arrow f l i ∈ f ⨄ with cod ( f l i ) \= B i , so that | f ⨄ | ≥ k . Thus, the fact that | f ⨄ | \= m \= k is consistent with the facts that f is monic and epic, and for each A j we have only one outgoing ptp arrow from it while for each B i we have only one ingoing arrow into it. Moreover, from the fact that f is both monic and epic, each of its ptp arrows ( f j i : A j → B i ) ∈ f ⨄ must be epic and monic (by Proposition 23 ), and from the fact that it is a simple arrow, it must be an isomorphism with f j i ˜ \= T A j \= T B i (i. e., A j ≃ B i ), with its inverse f j i OP : B i → A j . Consequently, from Definition 43 , f ∘ f OP ⨄ \= { f j i ∘ f j i OP ∣ f j i ∈ f ⨄ } \= { id B i ∣ f j i ∈ f ⨄ } \= (from the fact that f is epic, for each B i it must exist a ptp arrow f j i with cod ( f j i ) \= B i ) \= { id B i ∣ 1 ≤ i ≤ m } \= id B ⨄ . Thus, from Definition 44 , we obtain f ∘ f OP \= id B . Analogously, f OP ∘ f ⨄ \= { f j i OP ∘ f j i ∣ f j i ∈ f ⨄ } \= { id A j ∣ f j i ∈ f ⨄ } \= (from the fact that f is monic, for each A j it must exist a ptp arrow f j i with dom ( f j i ) \= A j ) \= { id A j ∣ 1 ≤ i ≤ m } \= id A ⨄ . Thus, from Definition 44 , we obtain f OP ∘ f \= id A . Consequently, f is an isomorphism.  □

Let us now generalize this result to all complex arrows.

Corollary 19.

Each complex arrow f : A → B is an isomorphism iff it is both monic and epic and the strictly complex objects obtained from A and B are composed by n \= | f ⨄ | of nonempty simple databases.

Proof.

Let A ′ and B ′ be the strictly complex objects obtained from A and B , respectively, with the isomorphisms is 1 : A → A ′ and is 2 : B → B ′ (which are always monic and epic). If f is monic, then f ′ \= is 2 ∘ f ∘ is 1 − 1 : A ′ → B ′ is monic from the fact that the composition of monic arrows is monic. Analogously, if f is epic then f ′ is epic. Consequently, if f is both monic and epic, then f ′ is both monic and epic, so that if A ′ and B ′ are composed by the same number of nonempty objects (equal to | f ′ ⨄ | ), from Lemma 4 we obtain that f ′ is an isomorphism. Thus, from the fact that f \= is 2 − 1 ∘ f ′ ∘ is 1 is a composition of the three isomorphisms, it is an isomorphism as well. This is valid also when we obtain for the strictly complex objects A ′ \= B ′ \= ⊥ 0 of the objects A and B , and in such a case n \= 0 .  □

Let us introduce the additional properties for the arrows in DB as principal morphisms (used for definition of “exponent” objects, Proposition 32 ), retraction pairs (for PO relation ⪯ and subcategory DB I , Theorem 17 ) and the idempotents (for conceptual category symmetry, Theorem 14 ).

Proposition 26.

The following properties for arrows in DB are valid:

1.

For any two objects A and B, the arrow h : A ⟶ B such that h ˜ ≃ A ⊗ B is a principal morphism.

2.

For any monomorphism f : A ↪ B and its inverted arrow (an epimorphism) f OP : B ↠ A , the pair ( f , f OP ) is a retraction pair.

3.

For any simple object A, there is a category of idempotents on A, denoted by Ret A and defined as follows:

3.1.

Objects of Ret A form the set of all simple arrows from A into A, i. e., Ob Ret A \= DB ( A , A ) .

3.2.

For any two objects f , g ∈ Ob Ret A , each arrow between them is a pair ( h ; h ) : f → g where h : A → A with h ˜ ⊆ f ˜ ⋂ g ˜ , and hence, there is the bijection σ : Ret A ( f , g ) ≃ DB ( f ˜ , g ˜ ) such that for any ( h ; h ) ∈ Ret A ( f , g ) , σ ( h ; h ) \= T e ( h ; h ) for the symmetry-closure functor T e in Theorem 14 .

Proof.

Claim 1. For any simple arrow h : A ⟶ B with h ˜ \= A ⊗ B , we have ∀ f : A ⟶ B , ∃ g : A ⟶ A such that f \= h ∘ g . In fact, it is satisfied for g ≈ f , i. e., g \= { id R : R → R ∣ R ∈ f ˜ } ⋃ { q ⊥ } . Let h be a complex arrow with a set of point-to-point arrows h j i : A j → B i in h ⨄ . Hence, from the fact that h ˜ \= A ⊗ B , we obtain h j i ˜ \= A j ⊗ B i \= T A j ⋂ T B i . For any arrow f : A → B , from Proposition 24 we have that f ˜ ⪯ A ⊗ B and, consequently, for each of its point-to-point arrows f l i : A l → B i , f l i ˜ ⊆ A l ⊗ B i \= T A l ⋂ T B i \= h l i ˜ ⊆ T A l . Thus, for this ptp arrow f l i we define a ptp arrow g l l \= { id R : R → R ∣ R ∈ f l i ˜ ⊆ T A l } ⋃ { q ⊥ } : A l → A l , so that g l l ˜ \= f l i ˜ and for composition h l i ∘ g l : A l → B i , h l i ∘ g l l ˜ \= h l i ˜ ⋂ g l l ˜ \= ( T A l ⋂ T B i ) ⋂ g l l ˜ \= ( A l ⊗ B i ) ⋂ f l i ˜ \= f l i ˜ . By this generation of ptp arrows g l l for each ptp arrow in f ⨄ , we define the canonical morphism g : A → A (in Lemma 2 ), such that f ⨄ \= h ∘ g ⨄ , i. e., from Definition 44 , f \= h ∘ g : A → B .

Claim 2. For any simple arrow, which is a monomorphism f : A ↪ B and (by duality, Theorem 12 ) the epimorphism f OP : B ↠ A ( f OP ≈ f ), f OP ∘ f \= id A (in fact, f OP ∘ f ˜ \= f OP ˜ ⋂ f ˜ \= f ˜ \= T A \= id A ˜ ).

For any complex monomorphism between two strictly-complex objects

f : ⨄ 1 ≤ j ≤ m A j ↪ ⨄ 1 ≤ i ≤ k B i ,

from Proposition 23 , f ⨄ \= { f j i j : A j ↪ B i j ∣ 1 ≤ j ≤ m } , so that f OP ⨄ \= { f j i j OP : B i j ↠ A j ∣ 1 ≤ j ≤ m } , and hence, f OP ∘ f ⨄ \= { h j j \= f j i j OP ∘ f j i j \= id A j : A j → A j ∣ 1 ≤ j ≤ m } , i. e., f OP ∘ f \= id A . If A and B are not strictly complex, let A ′ and B ′ be their strictly complex reductions with two isomorphisms is 1 : A → A ′ and is 2 : B → B ′ and the monomorphism f 1 : A ′ ↪ B ′ . Then f \= is 2 ∘ f 1 ∘ is 1 with f OP \= is 1 − 1 ∘ f 1 OP ∘ is 2 − 1 , and hence, f OP ∘ f \= is 1 − 1 ∘ f 1 OP ∘ is 2 − 1 ∘ is 2 ∘ f 1 ∘ is 1 \= is 1 − 1 ∘ f 1 OP ∘ id B ′ ∘ f 1 ∘ is 1 \= is 1 − 1 ∘ f 1 OP ∘ f 1 ∘ is 1 \= (from the strictly complex composition above) \= is 1 − 1 ∘ id A ′ ∘ is 1 \= is 1 − 1 ∘ is 1 \= id A .

Claim 3. For each f : A ↪ A , f ∘ f \= f , and hence, it is idempotent and, consequently, an object in Ret A . The identity arrow of an object f in Ret A is the arrow id f \= ( f ; f ) : f → f . Given two arrows ( h ; h ) : f → g and ( h 1 ; h 1 ) : g → k , and hence, h ˜ ⊆ f ˜ ⋂ g ˜ and h 1 ˜ ⊆ g ˜ ⋂ k ˜ , their composition is an arrow ( h 1 ; h 1 ) ∘ ( h ; h ) \= ( h 1 ∘ h ; h 1 ∘ h ) : f → k because h 1 ∘ h ˜ \= h 1 ˜ ⋂ h ˜ ⊆ ( f ˜ ⋂ g ˜ ) ⋂ ( g ˜ ⋂ k ˜ ) ⊆ f ˜ ⋂ k ˜ .

The mapping σ : Ret A ( f , g ) ≃ DB ( f ˜ , g ˜ ) is well-defined. In fact, for any arrow in Ret A , ( h ; h ) : f → g , from Theorem 14 , T e ( h ; h ) \= in g ˜ OP ∘ T ( h ∘ f ) ∘ in g ˜ : f ˜ → g ˜ , so that T e ( h ; h ) ˜ \= in g ˜ OP ˜ ⋂ T ( h ∘ f ) ˜ ⋂ in g ˜ ˜ \= g ˜ ⋂ ( f ˜ ⋂ h ˜ ) ⋂ f ˜ \= h ˜ ⊆ g ˜ ⋂ f ˜ is appropriate. The inverse of σ is given by σ − 1 ( T e ( h ; h ) ) \= ( k ; k ) where k ≜ τ J ( g ) − 1 ∘ h ∘ τ J ( f ) : A → A such that k ˜ \= τ J ( g ) − 1 ˜ ⋂ h ˜ ⋂ τ J ( f ) ˜ \= g ˜ ⋂ h ˜ ⋂ f ˜ \= h ˜ , i. e., k \= h .  □

7.1.2   Power-view endofunctor and monad T

Let us extend the power-view operator T for objects into an endofunctor of DB category.

Theorem 11. There exists the endofunctor T \= ( T 0 , T 1 ) : DB ⟶ DB such that:

1.

For any object A, the object component T 0 is equal to the type power-view operator T, i. e., T 0 ( A ) ≜ T A .

2.

For any morphism f : A ⟶ B , the arrow component T 1 is defined by

T f \= T 1 ( f ) ≜ is B ∘ f ∘ is A − 1 : T A → T B

with T f ⨄ \= { T f i ∣ f i ∈ f ⨄ } , so that T f ˜ ≃ f ˜ and T ( T f ) \= T f .

3.

Functor T preserves the properties of arrows, i. e., if a morphism f has a property P ∈ { monic, epic, isomorphic } then also T ( f ) has the same property P.

Proof.

From the fact that all arrows are composed of atomic arrows, it is enough to consider only them. We have for composition of morphisms (derived from a composition of schema mappings and their information fluxes in Definition 67 ) that for a simple arrow f , T f ˜ \= is B ∘ f ∘ is A − 1 ˜ \= is B ˜ ⋂ f ˜ ⋂ is A − 1 ˜ \= T B ⋂ f ˜ ⋂ T A \= (from Proposition 24 if f is a simple arrow, then f ˜ ⊆ T A ⋂ T B ) \= f ˜ . If f is a complex arrow with A \= ⨄ 1 ≤ j ≤ m A j and B \= ⨄ 1 ≤ i ≤ k B i , then is A − 1 \= ⨄ 1 ≤ j ≤ m is A j − 1 : T A j → A j with is A j − 1 \= { id R : R → R ∣ R ∈ A j } , so that is A − 1 ⨄ \= id A ⨄ and is B \= ⨄ 1 ≤ i ≤ k is B i : B i → T B i with is B i \= { id R : R → R ∣ R ∈ B i } , and hence, is B ⨄ \= id B ⨄ . Consequently, for each f j i ′ \= T f j i \= is B i ∘ f j i ∘ is A j − 1 ∈ T f ⨄ with f j i : A j → B i ∈ f ⨄ , f j i ′ ˜ \= f j i ˜ so that, from Definition 43 ,

T f ˜ ≃ ⨄ T f ⨄ ˜ ≃ ⨄ f ⨄ ˜ ≃ f ˜ .

For each identity arrow id A : A → A with id A ˜ \= T A , we obtain the identity arrow id T A \= T id A : T A → T A with id T A ˜ \= T id A ˜ \= id A ˜ \= T A . For the composition of any two arrows f : A → B and g : B → C , T ( g ∘ f ) \= is C ∘ ( g ∘ f ) ∘ is A − 1 \= is C ∘ g ∘ id B ∘ f ∘ is A − 1 \= is C ∘ g ∘ ( is B − 1 ∘ is B ) ∘ f ∘ is A − 1 \= T g ∘ T f . Thus, from Definition 44 , T ( g ∘ f ) \= T g ∘ T f . Consequently, the power-view operator T is a DB endofunctor.

Thus, T ( T f ) \= T ( is B ∘ f ∘ is A − 1 ) \= T is B ∘ T f ∘ T is A − 1 \= (from Example 24 below) \= id T B ∘ T f ∘ id T A \= T f .

It is easy to verify that T is a 2-endofunctor and preserves the properties of arrows: if f is an isomorphism, then T f is a composition of three isomorphisms, and hence, an isomorphism as well. If f is monic, then T f \= is B ∘ f ∘ is A − 1 , i. e., a composition of three monic arrows (each isomorphic arrow is monic and epic as well), and hence, is a monomorphism as well. The proof when f is epic is similar.

The functorial properties for different cases of complex arrows are presented with details in point 2 of Corollary 23 in Section 7.3.1 .  □

Let us show that the morphism T f : T A → T B , for a given morphisms f \= α ∗ ( MakeOperads ( M A B ) ) with M A B \= { Ψ } , M A B \= MakeOperads ( M A B ) \= { q 1 , … , q k , 1 r ∅ } and S \= { ∂ 1 ( q i ) ∣ 1 ≤ i ≤ k } ⊆ S B , corresponds to the definition of arrows in DB category, specified by Theorem 10 , i. e., there exists a SOtgd Φ of a schema mapping such that T f \= α ∗ ( MakeOperads ( { Φ } ) ) .

We will show that Φ is just the SOtgd of the schema mapping M A B : A → B , both with a mapping-interpretation α , used in definition of the morphism f . From Theorem 11 above, we obtain

T f \= is B ∘ f ∘ is A − 1 \= α ∗ ( MakeOperads ( { Φ B } ) ) ∘ α ∗ ( M A B ) ∘ α ∗ ( MakeOperads ( Φ A ) ) \= α ∗ ( MakeOperads ( { Φ B } ) ∘ M A B ∘ MakeOperads ( Φ A ) ) \= α ∗ ( ( { 1 r ∣ r ∈ S B } ⋃ { 1 r ∅ } ) ∘ M A B ∘ ( { 1 r ∣ r ∈ S A } ⋃ { 1 r ∅ } ) ) \= α ∗ ( ( { 1 r ∣ r ∈ S B } ⋃ { 1 r ∅ } ) ∘ M A B ) \= α ∗ ( ( { 1 r ∣ r ∈ S B } ⋃ { 1 r ∅ } ) ∘ { q 1 , … , q k , 1 r ∅ } ) \= α ∗ ( ( { 1 r ∣ r ∉ S } ⋃ { 1 r ∣ r ∈ S } ⋃ { 1 r ∅ } ) ∘ { q 1 , … , q k , 1 r ∅ } ) \= α ∗ ( ( { 1 r ∣ r ∈ S B } ⋃ { 1 r ∅ } ) ∘ { q 1 , … , q k , 1 r ∅ } ) \= α ∗ ( { 1 r ∣ r ∉ S } ⋃ { q 1 , … , q k , 1 r ∅ } ) \= α ∗ ( MakeOperads ( { Φ } ) ) ,

where Φ is equal to SOtgd Ψ ⋀ { ∃ f r i ∀ x i ( ( f r i ( x i ) \= 1 ) ⇒ r i ( x i ) ) ∣ r i ∉ S } and f r i is the characteristic function of the relation α ( r i ) . Consequently, from the fact that the information flux of the component ⋀ { ∃ f r i ∀ x i ( ( f r i ( x i ) \= 1 ) ⇒ r i ( x i ) ) ∣ r i ∉ S } is empty, the information fluxes of f and T f are equal, i. e., T f ˜ \= f ˜ . Thus, T f \= f in the observational sense of Definition 44 , while in the set-theoretic sense, we have that f ⊆ T f .

Example 24.

Let us consider the definition of this endofunctor for simple isomorphic arrows is A : A → T A , is A − 1 : T A → A where, from the proof of Proposition 25 ,

is A − 1 \= is A \= S A \= { id R : R → R ∣ R ∈ A } .

Let us show that T 1 ( is A − 1 ) \= T 1 ( is A ) \= is T A \= id T A : T A → T A .

In fact, from the definition of the isomorphic arrow is T A : T A → T ( T A ) and from the idempotence T T A \= T A we obtain is T A \= S T A \= { id R : R → R ∣ R ∈ T A } : T A → T A , i. e., is T A \= id T A : T A → T A . Analogously, is T A − 1 \= S T A \= { id R : R → R ∣ R ∈ T A } : T ( T A ) → T A , i. e.,

(a)

is T A − 1 \= is T A \= id T A : T A → T A .

From Theorem 11 above (here B \= T A ), we have:

(b)

T 1 ( is A ) \= is B ∘ is A ∘ is A − 1 \= ( from is A ∘ is A − 1 \= id T A ) \= is B ∘ id T A \= is T A ∘ id T A \= is T A , and (here we replace A by T A nd B by A ):

(c)

T 1 ( is A − 1 ) \= is A ∘ is A − 1 ∘ is T A − 1 \= ( from is A ∘ is A − 1 \= id T A ) \= id T A ∘ is T A − 1 \= is T A − 1 . Thus, from (a), (b) and (c) we obtain:

(d)

T 1 ( is A − 1 ) \= T 1 ( is A ) \= is T A − 1 \= is T A \= id T A : T A → T A , where id T A \= T 1 ( id A ) .

The endofunctor T is a right and left adjoint to identity functor I DB , i. e., T ≃ I DB . Thus, we have the equivalence adjunction ⟨ T , I DB , η C , η ⟩ where the unit η C : T ≃ I DB (such that for any object A the arrow η A C ≜ η C ( A ) \= is A − 1 : T A ⟶ A ) and the counit η : I DB ≃ T (such that for any A the arrow η A ≜ η ( A ) \= is A : A ⟶ T A ) are isomorphic arrows in DB (by duality Theorem 12 it holds that η C \= η OP ).

We have already explained that the views of a database may be seen as its observable computations : what we need, in order to obtain an expressive power of computations in the category DB , are the categorial computational properties which are, as it is well known [ 94 ], based on monads.

Proposition 27.

Power-view endofunctor T \= ( T 0 , T 1 ) : DB ⟶ DB defines the monad ( T , η , μ ) and the comonad ( T , η C , μ C ) in DB such that η : I DB ≃ T and η C : T ≃ I DB are two natural isomorphisms, while ․ μ : T T ․ T and ․ μ C : T ․ T T are equal to the natural identity transformation ․ id T : T ․ T (from the idempotence, T \= T T ).

Proof.

It is easy to verify that all commutative diagrams of the monad ( μ A ∘ μ T A \= μ A ∘ T μ A , μ A ∘ η T A \= id T A \= μ A ∘ T η A ) and of the comonad are diagrams composed of the identity arrows. Notice that by duality (in Section 7.1.3 ) η T A \= T η A \= μ A OP .  □

The notion of a monad is one of the most general mathematical notions. For instance, every algebraic theory, i. e., every set of operations satisfying equational laws, can be seen as a monad (which is also a monoid in a category of endofunctors of a given category: the “operation” μ being the associative multiplication of this monoid and η its unit). Thus, monoid laws of the monad do subsume all possible algebraic laws.

We use monads [ 12 ], [ 26 ], [ 93 ] to provide denotational semantics to database mappings , and more specifically as a way of modeling computational/collection types [ 94 ], [ 95 ], [ 96 ], [ 97 ]. In order to interpret a database mappings (morphisms) in the category DB , we distinguish the object A (a database instance of type A ) from the object T A of observations (computations of type A without side-effects) and take as a denotation of (view) mappings the elements of T A (which are the views of type A ).

In particular, we identify A with the object of values (of type A ) and we obtain the object of observations by applying the unary type-constructor T (power-view operator) to the object A .

It is well known that each endofunctor defines the algebras and coalgebras, represented by the left and right commutative diagrams:

We will use the following well-known definitions in the category theory (we recall that the set of all arrows in a category C from A to B is denoted by C ( A , B ) ).

Definition 45.

The categories C T alg of T -algebras and C T coalg of T -coalgebras, derived from the endofunctor T , are defined [ 11 ] as follows:

1.

The objects of C T alg are the pairs (A,h) with A ∈ Ob DB and h ∈ DB ( T A , A ) ; the arrows between objects (A,h) and (B,k) are all arrows f ∈ DB ( A , B ) such that k ∘ T f \= f ∘ h : T A ⟶ B .

2.

The objects of C T coalg are the pairs ( A , h 1 ) with A ∈ Ob DB and h 1 ∈ DB ( A , T A ) ; the arrows between objects ( A , h 1 ) and ( B , k 1 ) are all arrows f 1 ∈ DB ( A , B ) such that T f 1 ∘ h 1 \= k 1 ∘ f 1 : A ⟶ T B .

The (co)algebras of an endofunctor such that it is a monad as well satisfy more structural properties and are denominated as monadic (co)algebras (for (co)monads introduced in Section A.2 ).

Definition 46.

The monadic algebras/coalgebras are defined [ 11 ], [ 12 ] as follows:

  • Each T-algebra ( A , h : T A ⟶ A ) derived from a monad ( T , η , μ ) , where h is a “structure map” such that h ∘ μ A \= h ∘ T h and h ∘ η A \= id A , is a monadic T-algebra. The Eilenberg–Moore category of all monadic algebras T alg is a full subcategory of C T alg .

  • Each T-coalgebra ( A , k : A ⟶ T A ) derived from a comonad ( T , η C , μ C ) such that T k ∘ k \= μ A C ∘ k and η A C ∘ k \= id A is a monadic T-coalgebra. The category of all monadic coalgebras T coalg is a full subcategory of C T coalg .

Thus, the monadic algebras satisfy the following commutative diagram:

In the DB category η A ˜ \= μ A ˜ \= id A ˜ \= T A , while for a simple arrow h , T h ˜ \= h ˜ ⊆ T A ⊗ A \= T A (from Proposition 24 ), so that the intersection of the fluxes of the arrows in this diagram commute.

Corollary 20.

For each object A in DB , there is exactly one T-algebra (and its dual T-coalgebra) h \= T A → A , which is equal to the isomorphism is A − 1 .

Proof.

If A \= ⊥ 0 , then T A \= ⊥ 0 , so that all arrows in the diagram above are the identity arrows id ⊥ 0 \= ⊥ 1 (which is isomorphism as well) with h \= ⊥ 1 .

Let A \= ⨄ 1 ≤ j ≤ m A j . Thus, T A \= ⨄ 1 ≤ j ≤ m T A j with

μ A \= T id A \= id T A \= ⨄ 1 ≤ j ≤ m id T A j : T A j → T A j

and the isomorphism

η A \= ⨄ 1 ≤ j ≤ m η A j \= ⨄ 1 ≤ j ≤ m is A j : A j → T A j .

From the commutativity of the triangle above, id A \= h ∘ η A , it must hold, from Definition 44 , that h ∘ η A ⨄ \= id A ⨄ , and hence, for each ptp arrow id A j : A j → A J in id A ⨄ , we must have the ptp arrow h j j : T A j → A J in h ⨄ . Consequently, id A j \= h j j ∘ η A j , i. e., id A j ˜ \= T A j \= h j j ∘ η A j ˜ \= h j j ˜ ⋂ η A j ˜ \= h j j ˜ ⋂ T A j \= h j j ˜ (from the fact that, from Proposition 24 , h j j ˜ ⊆ T ( T A j ) ⋂ T A j \= T A j ). Thus, from Proposition 25 , h j j : T A j → A J is an isomorphism and

h ⨄ ⊇ { h j j : T A j → A j ∣ 1 ≤ j ≤ m } .

However, from the fact that the number if ptp arrows in h cannot be greater that the number of ptp arrows in id A (otherwise, the composed arrow h ∘ η A \= h ∘ is A would have more ptp arrows than is A , i. e., more ptp arrows than in id A , and we would have that id A ⨄ ≠ h ∘ η A ⨄ , i. e., id A ≠ h ∘ η A ), we obtain this unique monadic T-algebra h \= is A − 1 : T A → A .  □

7.1.3   Duality

The following duality theorem shows that for any commutative diagram in DB there is an equal commutative diagram, composed of equal objects and inverted equivalent arrows. This duality property of DB is a consequence of the fact that a composition of simple arrows (i. e., morphisms) is semantically based on the set-intersection commutativity of information fluxes of these arrows, and the information flux of inverted arrow is equal to the information flux of the original arrow.

Thus, any limit diagram in DB has also its equivalent inverted colimit diagram with equal objects and, more generally, any universal property also has its equivalent couniversal property in DB . From the fact that all arrows are composed of simple atomic arrows, it is enough to consider only the atomic arrows. Duality properties for different cases of complex arrows are presented with details also in point 3 of Corollary 23 in Section 7.3.1 .

Theorem 12. There exists the controvariant functor S _ \= ( S _ 0 , S _ 1 ) : DB ⟶ DB such that:

1.

S _ 0 is an identity function on objects.

2.

For any simple arrow f : A ⟶ B with ( T f ) OP ≜ { id R ∣ R ∈ f ˜ } : T B → T A , we define S _ 1 ( f ) ≜ f OP : B → A , where f OP \= is A − 1 ∘ ( T f ) OP ∘ is B is an inverted morphism equivalent to f (i. e., with f OP ˜ \= f ˜ ).

The inverse of an inverted morphism f OP is equal to the original morphism, i. e., ( f OP ) OP \= f . For a complex arrow, we have f OP ⨄ \= { f j i OP ∣ f j i ∈ f ⨄ } .

3.

The category DB is isomorphic to its dual category DB OP .

Proof.

( T f ) OP ˜ \= f ˜ and f OP ˜ \= is A − 1 ∘ ( T f ) OP ∘ is B ˜ \= is A − 1 ˜ ⋂ ( T f ) OP ˜ ⋂ is B ˜ \= T A ⋂ ( T f ) OP ˜ ⋂ T B \= T A ⋂ f ˜ ⋂ T B \= f ˜ .

The inverted arrow of any identity arrow is equal to identity arrow. For the composition of f with g : B → C , we have S 1 ( g ∘ f ) \= is A − 1 ∘ ( T ( g ∘ f ) ) OP ∘ is C \= is A − 1 ∘ ( T g ∘ T f ) OP ∘ is C \= is A − 1 ∘ ( T f ) OP ∘ ( T g ) OP ∘ is C \= is A − 1 ∘ ( T f ) OP ∘ is B ∘ is B − 1 ∘ ( T g ) OP ∘ is C \= S 1 ( f ) ∘ S 1 ( g ) . Thus, this contravariant functor is well-defined.

It is convenient to represent this contravariant functor as a covariant functor S : DB OP ⟶ DB or a covariant functor S OP : DB ⟶ DB OP . It is easy to verify that for compositions of these covariant functors S S OP \= I DB and S OP S \= I D B OP w. r. t. the adjunction ⟨ S , S OP , ϕ ⟩ : DB OP ⟶ DB , where ϕ is a bijection: for each pair of objects A , B in DB , we have the bijection of hom-sets, ϕ A , B : DB ( A , S ( B ) ) ≃ DB OP ( S OP ( A ) , B ) , i. e., ϕ A , B : DB ( A , B ) ≃ DB ( B , A ) , such that for any arrow f ∈ DB ( A , B ) , ϕ A , B ( f ) \= S 1 ( f ) \= f OP .

The unit and counit of this adjunction are the identity natural transformations, η OP : I DB ⟶ S S OP and ϵ OP : S OP S ⟶ I D B OP , respectively, such that for any object A they return by its identity arrow. Thus, from this adjunction, we obtain that DB is isomorphic to DB OP .  □

Let us show that the morphism ( T f ) OP : T B → T A , for a given morphism f \= α ∗ ( M A B ) : A → B with M A B \= MakeOperads ( M A B ) : A → B , is well-defined due to Theorem 10 , i. e., there exists an SOtgd Φ of a schema mapping such that ( T f ) OP \= α ∗ ( MakeOperads ( { Φ } ) ) .

Let us define the set of relational symbols S T B \= { r i ∣ r i ∈ R and α ( r i ) ∈ Δ ( α , M A B ) ⊆ f ˜ } and the α -intersection schemas A ⋂ α A and B ⋂ α B with T A \= α ∗ ( A ⋂ α A ) and T B \= α ∗ ( B ⋂ α B ) (in Definition 70 ). Then we can define the SOtgd Φ by a conjunctive formula ⋀ { ∀ x i ( r i ( x i ) ⇒ r i ( x i ) ) ∣ r i ∈ S T B } .

In fact, MakeOperads ( { Φ } ) \= { 1 r i ∈ O ( r i , r i ) ∣ r i ∈ S T B } ⋃ { 1 r ∅ } is a sketch’s mappings between schemas B ˆ and A ˆ . Note that r ∅ ∈ S T B because ⊥ ∈ f ˜ . Consequently,

( T f ) OP \= α ∗ ( MakeOperads ( { Φ } ) ) \= α ∗ ( { 1 r i ∈ O ( r i , r i ) ∣ r i ∈ S T B } ⋃ { 1 r ∅ } ) \= ( { id R ∣ R ∈ Δ ( α , M A B ) ⊆ f ˜ } ⋃ { q ⊥ } ) : T B → T A .

Thus, both inverted arrows ( T f ) OP and f OP \= is A − 1 ∘ ( T f ) OP ∘ is B (the demonstration is equal to the demonstration for arrow T f after the proof of Theorem 11 ) are morphisms in the DB category as specified in Theorem 10 .

Example 25.

Let us consider the inverted arrows of the isomorphic arrows is A : A → T A and is A − 1 : T A → A .

For is A (here B \= T A ), we have from Theorem 12 the following:

(1)

is A OP \= is A − 1 ∘ ( T is A ) OP ∘ is T A \= (from (d) in Example 24) \= is A − 1 ∘ ( id T A ) OP ∘ id T A \= is A − 1 ∘ ( id T A ) OP \= (inverted arrow of an identity arrow is the same identity arrow) \= is A − 1 ∘ id T A \= is A − 1 .

Analogously (here B is replaced by A and A by T A ),

(2)

( is A − 1 ) OP \= is T A − 1 ∘ ( T is A − 1 ) OP ∘ is A \= ( from (d) in Example 24 ) \= id T A ∘ ( id T A ) OP ∘ is A \= ( id T A ) OP ∘ is A \= (inverted arrow of an identity arrow is the same identity arrow) \= id T A ∘ is A \= is A \= ( is A − 1 ) − 1 .

Thus, from (1) and (2), the label ‘ OP ’ for these isomorphic arrows is equivalent to the inverse-arrow label ‘ −1 ’.

Let us show the validity of definition of the functor S _ and T 1 ( f OP ) \= ( T f ) OP , based on Theorem 11 , for f : A → B :

(3)

( T f ) OP \= ( is B ∘ f ∘ is A − 1 ) OP \= ( is A − 1 ) OP ∘ f OP ∘ is B OP \= (from (1) and (2)) \= is A ∘ f OP ∘ is B − 1 : T B → T A .

Thus, by composing on the left with is A − 1 , we obtain is A − 1 ∘ ( T f ) OP \= is A − 1 ∘ is A ∘ f OP ∘ is B − 1 \= id A ∘ f OP ∘ is B − 1 \= f OP ∘ is B − 1 . By composing on the right with is B , we obtain is A − 1 ∘ ( T f ) OP ∘ is B \= f OP ∘ is B − 1 ∘ is B \= f OP , i. e., the definition S _ 1 ( f ) ≜ f OP : B → A in Theorem 12 is valid.

From Theorem 11 (because of f OP : B → A , A and B are exchanged),

T 1 ( f OP ) \= is A ∘ f OP ∘ is B − 1 \= (from (3)) \= ( T f ) OP : T B → T A .

Remark.

The object ⊥ 0 \= { ⊥ } (i. e., empty database instance) is the zero object (both terminal and initial) in DB . From any real object A in DB , there is a unique arrow (which is an epimorphism) f \= α ∗ ( M A A ∅ ) \= α ∗ ( { 1 r ∅ } ) \= { q ⊥ } \= ⊥ 1 : A ↠ ⊥ 0 and its dual arrow (which is a monomorphism) f OP \= ⊥ 1 : ⊥ 0 ↪ A , both with empty information flux. It is easy to verify that each empty database (with all empty relations) is isomorphic to the zero object ⊥ 0 .

Lemma 5.

The bottom object ⊥ 0 \= { ⊥ } is zero (terminal and initial) closed object in DB .

Each database A \= { R 1 , … , R n , ⊥ } with all empty relations R i \= { ⟨ ⟩ } , i \= 1 , … , n , is isomorphic to the zero object ⊥ 0 . That is, A ≃ ⊥ 0 .

Proof.

For each simple object A and f : A → ⊥ 0 , we have from Proposition 24 that f ˜ ⊆ T A ⋂ T ⊥ 0 \= T A ⋂ ⊥ 0 \= ⊥ 0 (From point 1 of Theorem 10 ), thus f \= ⊥ 1 is a unique arrow from A into ⊥ 0 , so that ⊥ 0 is a terminal object (analogously, ⊥ 1 : ⊥ 0 ↪ A is the unique arrow, so that ⊥ 0 is an initial object as well).

Thus, for a complex object A ⨄ B , the unique arrow into zero object is [ ⊥ 1 , ⊥ 1 ] : A ⨄ B → ⊥ 0 while its opposite is ⟨ ⊥ 1 , ⊥ 1 ⟩ : ⊥ 0 → A ⨄ B .

For each database A \= { R 1 , … , R n , ⊥ } where every R i \= { ⟨ ⟩ } , k \= ar ( R i ) ≥ 1 , is a k -ary empty relation, for i \= 1 , … , n , we have the unique arrow ⊥ 1 : A → ⊥ 0 (into terminal object) with ⊥ 1 \= { q ⊥ : ⊥ → ⊥ } and its unique inverted arrow ( ⊥ 1 ) OP : ⊥ 0 → A (from initial object) with ( ⊥ 1 ) OP \= { q ⊥ : ⊥ → ⊥ } , hence ( ⊥ 1 ) OP ∘ ⊥ 1 \= ⊥ 1 : A → A . The identity arrow for A is id A \= { id R 1 : R i → R i ∣ R i ∈ A } ⋃ { q ⊥ } with id A ˜ \= ⊥ 0 \= ⊥ 1 ˜ so that, from Definition 44 , ( ⊥ 1 ) OP ∘ ⊥ 1 \= id A and, analogously, ⊥ 1 ∘ ( ⊥ 1 ) OP \= id ⊥ 0 . Thus, ⊥ 1 : A → ⊥ 0 is an isomorphism, i. e., A ≃ ⊥ 0 .  □

7.2   Objects of DB : Basic operations and equivalence relations

In this section, we will introduce the basic operations for instance-databases used during the definition of database mappings between two (or more) databases. They are corresponding operators in this base DB category for two schema basic operations, separation † and connection ⨁, used in order to define the schema data mappings (Section A.3.5 , after Definition 68 ). Then we also introduce a number of different equivalence relations for instance-databases:

  • Identity relation – two instance-databases (sets of relations) A and B are identical when the set identity A \= B holds.

  • Isomorphism relation ‘≃’ in DB .

  • Behavioral equivalence relation ‘≈’ in Definition 40 —two instance-databases A and B are behaviorally equivalent when each view obtained from a database A can also be obtained from a database B and vice versa.

  • Weak observational equivalence relation ‘ ≈ w ’—two instance-databases A and B are weakly equivalent when each “certain” view (without Skolem constants) obtained from a database A can be also obtained from a database B , and vice versa.

We will show the following inclusion relationships between them:

‘ \= ’ ⊆ ‘ ≃ ’ ⊆ ‘ ≈ ’ ⊆ ‘ ≈ w ’.

It is also possible to define other kinds of equivalences for databases. In the rest of this chapter, we will consider only the last two equivalences defined above. Consequently, from the fact that the schema separations and schema connections will be present in the sketch’s categories obtained from the schema mapping graphs, we need, in order to satisfy the functorial semantics for database mapping, their corresponding operations at the instance-level (i. e., DB category) as well.

As we will see, these operations correspond to important database integration concepts used in practice.

7.2.1   Data federation operator in DB

The basic database operation is the DBMS’s data federation of two database instances A and B . A federated database system is a type of metadatabase management system (DBMS), which transparently integrates multiple autonomous database systems into a single federated database . The constituent databases are interconnected via a computer network, and may be geographically decentralized. Since the constituent database systems remain autonomous, a federated database system is a contrastable alternative to the (sometimes daunting) task of merging together several disparate databases. A federated database, or virtual database, is the fully-integrated, logical composite of all constituent databases in a federated database system. In this way, we are able to compute the queries with the relations of both databases. In fact, data federation technology is just used for such an integration of two previously separated databases.

Consequently, given any two databases (objects in DB ) A and B , the federation of them (under the common DBMS) corresponds to union , denoted by ⋃ r n (i. e., the union ⋃ with the renaming ( rn ) of the relational symbols in A and B that have originally the same names) of them under the same DBMS, and thus, equals to database A ⋃ r n B .

That is, for any two schemas A and B and an interpretation α , such that A \= α ∗ ( A ) and B \= α ∗ ( B ) , we have that A ⋃ r n B \= α ∗ ( A ⨁ B ) , and we have the following.

Proposition 28.

For any two simple databases A and B, their federation A ⋃ r n B is isomorphic to their simple union A ⋃ B .

Proof.

Notice that for any relation in A ⋃ B we have possibly a set of copies of the same relation, but only with different name: thus, T ( A ⋃ r n B ) \= T ( A ⋃ B ) , and hence, we have the isomorphism is − 1 ∘ is r n : A ⋃ r n B → A ⋃ B obtained from the isomorphisms is r n : A ⋃ r n B → T ( A ⋃ r n B ) and is : A ⋃ B → T ( A ⋃ B ) (from Lemma 3 ).  □

Thus, the data federation of two simple databases is isomorphic to the merging of these two databases. The merging of databases is formally defined in Section 7.4.2 .

7.2.2   Data separation operator in DB

We define the separation composition of schemas A † B \= ( S A † B , Σ A † B ) as a disjunctive union with elements indexed by schema labels ( A ¨ and B ¨ , respectively), i. e., with S A † B \= { ( A ¨ , r i ) ∣ r i ∈ S A } ⋃ { ( B ¨ , r j ) ∣ r j ∈ S B } , Σ A † B \= { ( A ¨ , ϕ i ) ∣ ϕ i ∈ Σ A } ⋃ { ( B ¨ , ψ j ) ∣ ψ j ∈ Σ B } (if B \= A , then A ¨ \= 1 and B ¨ \= 2 ).

In what follows, we will express a finite separation composition by using the binary operator † and the parenthesis (e. g., ( A † ( B † C ) ) † D ), so that in DB we will use such a binary version ‡ of this operator at the instance-database level.

Definition 47.

The separation composition of any two instance-databases A \= α ∗ ( A ) and B \= α ∗ ( B ) , obtained from the schemas A and B , is denoted by A ‡ B :

A ‡ B ≜ α ∗ ( S A † B ) \= { ( A ¨ , α ( r i ) ) ∣ r i ∈ S A } ⋃ { ( B ¨ , α ( r j ) ) ∣ r j ∈ S B } \= { ( A ¨ , R i ) ∣ R i ∈ A } ⋃ { ( B ¨ , R j ) ∣ R j ∈ B } .

It corresponds to the instance-database of two separated schemas, i. e., to two mutually isolated instance-databases with separated database management systems, so that it is impossible to compute the queries with the relations from both schemas.

For any two morphisms f : A → C and g : B → D , we define the morphism ( f ⨄ g ) : A ‡ B → C ‡ D as for coproducts.

The separation property for morphisms in DB is represented by the facts that

∂ 0 ( f ⨄ g ) ≜ ∂ 0 ( f ) ⨄ ∂ 0 ( g ) , ∂ 1 ( f ⨄ g ) ≜ ∂ 1 ( f ) ⨄ ∂ 1 ( g ) .

Remark.

For any database A , the replication of this database (over different DB servers) can be denoted by the separation-composed object A ‡ A in this category DB . From the definition above, for any two databases A and B , A ‡ B \= B ‡ A , i. e., as we intended, the separation composition for the databases is a commutative operation. We are able, analogously to Definition 69 , to define any finite separation composition

‡ n ( A 1 , … , A n ) \= A 1 ‡ ( A 2 ‡ ( … ‡ A n ) … ) ≜ α ∗ ( A 1 † ⋯ † A n ) .

 □

From this definition, we have for any two instance databases A and B , A ‡ B ≠ A ⨄ B (if A ≠ B ) because the disjoint union introduced above is strictly noncommutative, and in the Set category the objects A ⨄ B and B ⨄ A are not equal but only isomorphic. However, it can be shown that they are isomorphic objects in DB so that the definition of DB category in Theorem 10 is still valid after this introduction of the separation composition.

Lemma 6.

For any two simple instance-databases A and B,

A ‡ B \= B ‡ A and A ‡ B ≃ A ⨄ B .

Proof.

If A \= B , the claim is clear because all relationships above are identities. From Definition 47 :

(1)

A ‡ B \= { ( A ¨ , ϕ i ) ∣ ϕ i ∈ Σ A } ⋃ { ( B ¨ , ψ j ) ∣ ψ j ∈ Σ B } \= B ‡ A .

Let us show that id A ⨄ id B (where id A : A → A , id B : B → B are the identity morphisms) is the identity morphism id A ‡ B for A ‡ B . In fact, for any morphisms f ⨄ g : A ‡ B → C ‡ D (with f : A → C , g : B → D ), ( f ⨄ g ) ∘ ( id A ⨄ id B ) \= ( f ∘ id A ) ⨄ ( g ∘ id B ) \= f ⨄ g , and for any morphism h ⨄ k : C ‡ D → A ‡ B (with h : C → A , k : D → B ), ( id A ⨄ id B ) ∘ ( k ⨄ h ) \= ( id A ∘ k ) ⨄ ( id B ∘ k ) \= h ⨄ k . Thus, id \= ( id A ⨄ id B ) : A ‡ B → A ‡ B is equal to the identity arrow of A ‡ B , i. e.,

(2)

id A ⨄ id B \= id A ‡ B .

In point 2 of Example 22 , it was demonstrated that ( id A ⨄ id B ) : A ⨄ B → A ⨄ B is the identity arrow id A ⨄ B of the object A ⨄ B as well. That is,

(3)

id A ⨄ id B \= id A ⨄ B .

Let us show now that the morphism ( id A ⨄ id B ) : A ‡ B → A ⨄ B is an isomorphism, with its inverse morphism ( id A ⨄ id B ) OP \= id A OP ⨄ id B OP \= id A ⨄ id B : A ⨄ B → A ‡ B . In fact, ( id A ⨄ id B ) ∘ ( id A ⨄ id B ) OP \= ( id A ⨄ id B ) ∘ ( id A ⨄ id B ) \= ( id A ∘ id A ) ⨄ ( id B ∘ id B ) \= id A ⨄ id B \= (from (3)) \= id A ⨄ B : A ⨄ B → A ⨄ B (the identity), and analogously, ( id A ⨄ id B ) OP ∘ ( id A ⨄ id B ) \= id A ⨄ id B \= (from (2)) \= id A ‡ B : A ‡ B → A ‡ B (the identity). Consequently, ( id A ⨄ id B ) : A ‡ B → A ⨄ B is an isomorphism, i. e.,

(4)

A ‡ B ≃ A ⨄ B .

Thus, we have from (4) and (1) that A ⨄ B ≃ A ‡ B \= B ‡ A ≃ B ⨄ A , and hence, A ⨄ B ≃ B ⨄ A as it was demonstrated in Lemma 3 .  □

Notice that T ( A ‡ B ) \= { ( A ¨ , v i ) ∣ v i ∈ T A } ⋃ { ( B ¨ , v j ) ∣ v j ∈ T B } \= T A ‡ T B ≠ T ( A ⨄ B ) \= { ( 1 , v i ) ∣ v i ∈ T A } ⋃ { ( 2 , v j ) ∣ v j ∈ T B } \= id A ˜ ⨄ id B ˜ \= id A ⨄ id B ˜ \= id A ⨄ B ˜ . However, from (4), id A ‡ B ˜ \= T ( A ‡ B ) ≃ T ( A ⨄ B ) \= id A ⨄ B ˜ , so that for the identity morphism id : A ‡ B → A ‡ B with id ˜ \= T ( A ‡ B ) ≃ id A ⨄ B ˜ , we obtain that id \= id A ‡ B is a well-defined identity morphism.

Remark.

From the fact that each object A ⨄ B , obtained by disjoint union, is isomorphic to the object A ‡ B , so that A ⨄ B can be equivalently substituted by the separation-composed object A ‡ B , we will use only this second version of separation composition in the DB category (the disjoint union of objects in DB will be explicitly used prevalently for the demonstration purposes).

Corollary 21.

The following three isomorphisms for the separation composition of objects in DB are valid:

  • (Composition with zero (initial and final) object) C ‡ ⊥ 0 ≃ C ≃ ⊥ 0 ‡ C .

  • (Commutativity) A ‡ B ≃ B ‡ A .

  • (Associativity) A ‡ ( B ‡ C ) ≃ A ‡ B ‡ C ≃ ( A ‡ B ) ‡ C .

Proof.

Claim 1. We have

C ‡ ⊥ 0 ≃ C ⨄ ⊥ 0 (from Lemma 6) ≃ C (from Lemma 3) , and ⊥ 0 ‡ C ≃ ⊥ 0 ⨄ C (from Lemma 6) ≃ C (from Lemma 3) .

For a given schema C with the interpretation α such that C \= α ∗ ( C ) , we have the identity morphism id C \= α ∗ ( M C C ) : C → C with M C C \= α ∗ ( { 1 r ∣ r ∈ C } ⋃ { 1 r ∅ } ) .

Let us define, as in the proof of point 4 of Lemma 3 , the morphisms i 1 \= ⟨ α ∗ ( M C C ) , α ∗ ( { 1 r ∅ } ) ⟩ \= ⟨ id C , ⊥ 1 ⟩ : C → C ⨄ ⊥ 0 , and i 2 \= [ α ∗ ( M C C ) , α ∗ ( { 1 r ∅ } ) ] \= [ id C , ⊥ 1 ] : C ⨄ ⊥ 0 → C . Then, by using the isomorphism id C ⨄ ⊥ 1 : C ‡ ⊥ 0 → C ⨄ ⊥ 0 , we obtain the composition i 2 ∘ ( id C ⨄ ⊥ 1 ) \= [ id C , ⊥ 1 ] ∘ ( id C ⨄ ⊥ 1 ) \= [ id C ∘ id C , ⊥ 1 ∘ ⊥ 1 ] \= [ id C , ⊥ 1 ] \= i 2 : C ‡ ⊥ 0 → C , which is an isomorphism (it has been shown in the proof of point 4 of Lemma 3 ) and so is its inverse ( id C ⨄ ⊥ 1 ) ∘ i 1 \= i 1 : C → C ‡ ⊥ 0 .

Claim 2 (Commutativity).

A ‡ B ≃ A ⨄ B (from Lemma 6) ≃ B ⨄ A (from point 4 of Lemma 3) ≃ B ‡ A (from Lemma 6) .

Let us show that this commutativity is represented by the isomorphism

i 1 \= ⟨ [ ⊥ 1 , id B ] , [ id A , ⊥ 1 ] ⟩ : A ‡ B → B ‡ A ,

where [ ⊥ 1 , id B ] : A ‡ B → B , [ id A , ⊥ 1 ] : A ‡ B → A .

In fact, in the proof of Lemma 3 , we have shown that i 1 : A ⨄ B → B ⨄ A is an isomorphism. Let us show that [ ⟨ id A , ⊥ 1 ⟩ , ⟨ ⊥ 1 , id B ⟩ ] : A ‡ B → A ⨄ B is equal to the isomorphism id A ⨄ id B : A ‡ B → A ⨄ B . In fact, [ ⟨ id A , ⊥ 1 ⟩ , ⟨ ⊥ 1 , id B ⟩ ] ⨄ \= { id A , id B } \= id A ⨄ id B ⨄ , and hence, from Definition 44 , [ ⟨ id A , ⊥ 1 ⟩ , ⟨ ⊥ 1 , id B ⟩ ] \= id A ⨄ id B . Consequently, we can define the composition

( id B ⨄ id A ) ∘ i 1 ∘ [ ⟨ id A , ⊥ 1 ⟩ , ⟨ ⊥ 1 , id B ⟩ ] : A ‡ B → A ⨄ B → B ⨄ A → B ‡ A ,

and to show that it is equal to i 1 as follows:

( id B ⨄ id A ) ∘ i 1 ∘ [ ⟨ id A , ⊥ 1 ⟩ , ⟨ ⊥ 1 , id B ⟩ ] \= ( id B ⨄ id A ) ∘ ⟨ [ ⊥ 1 , id B ] , [ id A , ⊥ 1 ] ⟩ ∘ [ ⟨ id A , ⊥ 1 ⟩ , ⟨ ⊥ 1 , id B ⟩ ] \= ⟨ id B ∘ [ ⊥ 1 , id B ] , id A ∘ [ id A , ⊥ 1 ] ⟩ ∘ [ ⟨ id A , ⊥ 1 ⟩ , ⟨ ⊥ 1 , id B ⟩ ] \= ⟨ [ ⊥ 1 , id B ] , [ id A , ⊥ 1 ] ⟩ ∘ [ ⟨ id A , ⊥ 1 ⟩ , ⟨ ⊥ 1 , id B ⟩ ] (from case 1 in Example 22) \= ⟨ [ [ ⊥ 1 , id B ] ∘ ⟨ id A , ⊥ 1 ⟩ , [ ⊥ 1 , id B ] ∘ ⟨ ⊥ 1 , id B ⟩ ] , [ [ id A , ⊥ 1 ] ∘ ⟨ id A , ⊥ 1 ⟩ , [ id A , ⊥ 1 ] ∘ ⟨ ⊥ 1 , id B ⟩ ] ⟩ \= ⟨ [ ⌈ ⊥ 1 ⌋ , ⌈ id B ⌋ ] , [ ⌈ id A ⌋ , ⌈ ⊥ 1 ⌉ ] ⟩ \= ⟨ [ ⊥ 1 , id B ] , [ id A , ⊥ 1 ] ⟩ \= i 1 .

Claim 3 (Associativity).

A ‡ ( B ‡ C ) ≃ A ⨄ ( B ‡ C ) ≃ A ⨄ ( B ⨄ C ) (from Lemma 6) ≃ A ⨄ B ⨄ C \= ⨄ ( A , B , C ) (from Lemma 3) ≃ ‡ ( A , B , C ) \= A ‡ B ‡ C (from Lemma 6) .

Similar to the proof above, id A ⨄ ⟨ [ id B , ⊥ 1 ] , [ ⊥ 1 , id C ] ⟩ : A ‡ ( B ‡ C ) → A ‡ B ‡ C represents this isomorphism.  □

7.2.3   The (strong) behavioral equivalence for databases

Let us consider now the problem of defining the equivalent objects (instance-databases) from a behavioral point of view based on observations : as we have seen, each arrow (morphism) is composed of a number of “queries” (view maps) and each query may be considered as an observation over some database instance (i. e., an object of DB ). Thus, we can characterize each object in DB (i. e., an instance-database) by its behavior according to a given set of observations.

Indeed, if one object A is considered as a black-box, the object T A is the set of all observations on A . Thus, given two objects A and B , we are able to define the relation of equivalence between them based on the notion of the bisimulation relation. If the observations (i. e., resulting views of queries) of the instance-databases A and B are always equal, independently of their particular internal structure, then they look equivalent to an observer. In fact, any database can be seen as an Abstract Object Type (AOT) presented in the Appendix, Section A.3.2 , by Definition 62 , with a number of internal states that can be observed by using query operators (i. e., programs without side-effects). Consequently, two simple databases A and B are equivalent (or bisimilar) if they provide the same set of observations, i. e., when the set of views T A is equal to T B .

For the complex databases with separation operator ‡, represented equivalently (up to isomorphisms) by the nonsymmetric disjoint union ⨄, the behavioral equivalence is more general relation than the isomorphism relation in DB category.

Definition 48.

The relation of (strong) behavioral equivalence ′ ≈ ′ between objects (databases) in DB is defined by the PO relation ‘⪯’ (in Definition 40 ) on the set Ob DB ,

A ≈ B iff A ⪯ B and B ⪯ A .

This equivalence relation for morphisms is defined by f ≈ g iff f ˜ ≈ g ˜ .

Notice that for any arrow f in DB , f ⨄ ⊥ 1 ≈ ⊥ 1 ⨄ f ≈ f , where ⊥ 1 \= α ∗ ( { 1 r ∅ } ) \= { α ∗ ( 1 r ∅ ) } \= { q ⊥ : ⊥ → ⊥ } is an empty morphism between objects (i. e., for any two objects A and B , we have an empty morphism ⊥ 1 : A → B with ⊥ 1 ˜ \= { ⊥ } \= ⊥ 0 , obtained from the empty set of SOtgds between the schemas A and B ).

Moreover, any two simple arrows f , g : A → B are equal ( f ≡ g , in Definition 44 ) iff they are observationally equivalent, i. e., if f ≈ g .

This relation of behavioral equivalence between the objects does not strictly correspond to the notion of isomorphism in the category DB (see Proposition 25 ), in fact, we have the following.

Corollary 22.

Any two isomorphic objects A and B in DB are behaviorally equivalent, i. e., if A ≃ B , then A ≈ B , but not vice versa.

Only for the simple objects (databases) the behavioral equivalence corresponds to the isomorphism in DB .

Proof.

If there is an isomorphism A ≃ B , with an iso-arrow is : A → B then, from the proof of Theorem 17 , we obtain A ⪯ B . Moreover, from duality, the arrow is OP : B → A is an isomorphism, and hence, B ⪯ A . The converse does not hold: for example, A ⨄ A ≈ A , but not A ⨄ A ≃ A . For two simple objects A and B , A ⪯ B means T A ⊆ T B . Thus, A ≈ B means T A \= T B , so that A ≃ T A \= T B ≃ B , i. e., A ≃ B .  □

Notice that a database A ‡ A , which is composed of two copies of a database A , each one separated from another (each one has a different and independent DBMS), is behaviorally equivalent to a database A but not isomorphic to A . The behavioral equivalence is derived from the PO relation ‘⪯’ so that it will have an important role in the generation of the database complete lattice based on this ordering. It is well known that any two isomorphic objects in a given category can be mutually substituted, and from the fact that they are also behaviorally equivalent, it means that in this database lattice two isomorphic objects can be substituted as well by preserving PO ordering in this lattice.

7.2.4   Weak observational equivalence for databases

A database instance can also have some relations with tuples containing Skolem constants . For example, the minimal Herbrand models of a Global (virtual) schema of a data integration system with incomplete information [ 92 ], [ 98 ], [ 99 ] will have the Skolem constants for such a missed information.

We consider (see Definition 55 for FOL and Section A.3.1 in the introduction) a recursively enumerable set of all Skolem constants as marked (labeled) nulls SK \= { ω 0 , ω 1 , … } ⊆ U , disjoint from a database domain set dom ⊆ U of all values for databases. Moreover, we introduce a unary predicate Val ( _ ) , such that Val ( d i ) is true iff d i ∈ dom , and hence, Val ( ω i ) is false for any ω i ∈ SK . Thus, we can define a new weak power-view operator for databases as follows.

Definition 49.

Weak power-view operator T w : Ob DB ⟶ Ob DB is defined as follows: for any simple database A in a DB category,

T w ( A ) ≜ { R ∣ R ∈ T ( A ) and ∀ 1 ≤ k ≤ | R | ∀ ( d i ∈ π k ( R ) ) Val ( d i ) }

where | R | is the number of attributes of the view (relation) R , and π k is a k -th projection operator on relations. For A \= ⨄ 1 ≤ j ≤ m A j , m ≥ 1 , T w ( A ) \= ⨄ 1 ≤ j ≤ m T w ( A j ) .

We define a partial order relation ‘ ⪯ w ’ for databases and a weak observational equivalence relation ‘ ≈ w ’ (by A ≈ w B iff A ⪯ w B and B ⪯ w A ) as in Definition 40 by substituting operator T by T w .

The following properties are valid for the weak partial order ⪯ w , w. r. t. the partial order ⪯ (we denote ′ A ≺ B ′ iff A ⪯ B and not A ≈ B ).

Proposition 29.

Let A \= ⨄ 1 ≤ j ≤ m A j , m ≥ 1 and B \= ⨄ 1 ≤ i ≤ k B i , k ≥ 1 be any two databases (objects in DB category), then:

1.

T w ( A ) ≃ A , if A is a database without Skolem constants;

T w ( A ) ≺ A , otherwise;

2.

A ⪯ B implies A ⪯ w B , (thus, A ≈ B implies A ≈ w B );

3.

T w ( T w ( A ) ) \= T ( T w ( A ) ) \= T w ( T A ) \= T w ( A ) ⊆ T A , thus, each object D \= T w ( A ) is a closed object (i. e., D \= T D ) such that D ≈ w A .

Proof.

Claim 1. From T w ( A ) ⊆ T A ( T w ( A ) \= T A , only if A is without Skolem constants).

Claim 2. If A ≺ B , then T A j ⊂ T B σ ( j ) with T w ( T A j ) ⊆ T w ( T B σ ( j ) ) , for all 1 ≤ j ≤ m , i. e., A ⪯ w B .

Claim 3. It holds from definition of the operator T and T w : T w ( T w ( A ) ) \= T ( T w ( A ) ) because T w ( A ) is the set of views of A without Skolem constants and due to Claim 1. T w ( T A ) \= { R ∣ R ∈ T T ( A ) and ∀ 1 ≤ k ≤ | R | ∀ ( d i ∈ π k ( R ) ) Val ( d i ) } \= { R ∣ R ∈ T A and ∀ 1 ≤ k ≤ | R | ∀ ( d i ∈ π k ( R ) ) Val ( d i ) } \= T w ( A ) , from T \= T T . Let us show that T w ( T w ( A ) ) \= T w ( A ) . For every view v ∈ T w ( T w ( A ) ) , from T w ( T w ( A ) ) \= T ( T w ( A ) ) ⊆ T A , it holds that v ∈ T A , and hence, from the fact that v is without Skolem constants, v ∈ T w ( A ) . The converse is obvious.  □

Notice that from point 2, the partial ordering ‘⪯’ is a stronger discriminator for databases than the weak partial order ‘ ⪯ w ’, i. e., we can have two objects A ≺ B that are weakly equivalent, A ≈ w B (e. g., when A \= T w ( B ) and B is a database with Skolem constants). Let us extend the notion of the type operator T w into the notion of the endofunctor of DB category.

Theorem 13. There exists a weak power-view endofunctor T w \= ( T w 0 , T w 1 ) : DB ⟶ DB such that the object component T w 0 is equal to the type operator T w and:

1.

For any simple morphism f : A ⟶ B , the arrow component T w 1 is defined by

T w ( f ) \= T w 1 ( f ) ≜ { id R : R → R ∣ R ∈ f ˜ and ψ }

where ψ is a statement ∀ 1 ≤ k ≤ | R | ∀ ( d i ∈ π k ( R ) ) Val ( d i ) , | R | is the number of attributes of the relation (view) R, and π k is a k-th projection. We define T w ( f ) for a complex arrow f by the set of ptp arrows T w ( f ) ⨄ \= { T w ( f j i ) ∣ f j i ∈ f ⨄ } .

2.

There exist the natural transformations ․ ξ : T w ․ T (natural monomorphism) and ․ ξ − 1 : T ․ T w (natural epimorphism) such that for any simple object A, ξ ( A ) \= inc A is a monomorphism and ξ − 1 ( A ) \= inc A OP is an epimorphism, which are equivalent, i. e., ξ ( A ) ≈ ξ − 1 ( A ) .

Proof.

Let us show that the morphism T w ( f ) : T w ( A ) → T w ( B ) , for a given morphism f \= α ∗ ( M A B ) : A → B , corresponds to the definition of arrows in DB category, specified by Theorem 10 , that is, there is a SOtgd Φ of a schema mapping such that T w ( f ) \= α ∗ ( MakeOperads ( { Φ } ) ) . Let us define the set of relational symbols in the instance-database T w ( A ) by S T w A \= { r i ∣ r i ∈ R and α ( r i ) ∈ T w ( A ) } , and its schema C \= ( S T w A , ∅ ) , so that T w ( A ) \= α ∗ ( C ) (for the instance-database T w ( B ) , we define analogously the schema D \= ( S T w B , ∅ ) ). Let us define the set of relational symbols S T w f \= { r i ∣ r i ∈ R and R \= α ( r i ) ∈ f ˜ and ∀ 1 ≤ k ≤ | R | ∀ ( d i ∈ π k ( R ) ) Val ( d i ) } . Then we define the SOtgd Φ by a formula ⋀ { ∀ x i ( r i ( x i ) ⇒ r i ( x i ) ) ∣ r i ∈ S T w f } .

In fact, MakeOperads ( { Φ } ) \= { 1 r i ∈ O ( r i , r i ) ∣ r i ∈ S T w f } ⋃ { 1 r ∅ } is a sketch’s mapping from the schema C into D and T w ( f ) \= α ∗ ( MakeOperads ( { Φ } ) ) \= α ∗ ( { 1 r i ∈ O ( r i , r i ) ∣ r i ∈ S T w f } ⋃ { 1 r ∅ } ) \= { id r i : α ( r i ) → α ( r i ) ∈ O ( r i , r i ) ∣ r i ∈ S T w f } ⋃ { q ⊥ } .

For any identity arrow id A : A → A , T w ( id A ) \= { id R : R → R ∣ R ∈ id A ˜ and ∀ 1 ≤ k ≤ | R | ∀ ( d i ∈ π k ( R ) ) Val ( d i ) } \= { id R : R → R ∣ R ∈ T A and ∀ 1 ≤ k ≤ | R | ∀ ( d i ∈ π k ( R ) ) Val ( d i ) } , with T w ( id A ) ˜ \= { R ∣ R ∈ T A and ∀ 1 ≤ k ≤ | R | ∀ ( d i ∈ π k ( R ) ) Val ( d i ) } \= T w ( A ) and hence we obtain the identity arrow T w ( id A ) \= id T w A : T w ( A ) → T w ( A ) . It is extended to identity arrows of complex objects analogously (the disjoint union of simple identity arrows).

It is easy to verify that for any two simple arrows f : A ⟶ B and g : B ⟶ C ,

T w ( g ∘ f ) \= { id R : R → R ∣ R ∈ g ∘ f ˜ and ∀ 1 ≤ k ≤ | R | ∀ ( d i ∈ π k ( R ) ) Val ( d i ) } \= { id R : R → R ∣ R ∈ g ˜ ⋂ f ˜ and ∀ 1 ≤ k ≤ | R | ∀ ( d i ∈ π k ( R ) ) Val ( d i ) } .

Thus,

T w ( g ∘ f ) ˜ \= { R ∣ R ∈ g ˜ ⋂ f ˜ and ∀ 1 ≤ k ≤ | R | ∀ ( d i ∈ π k ( R ) ) Val ( d i ) } \= { R ∣ R ∈ g ˜ and ∀ 1 ≤ k ≤ | R | ∀ ( d i ∈ π k ( R ) ) Val ( d i ) } ⋂ { R ∣ R ∈ f ˜ and ∀ 1 ≤ k ≤ | R | ∀ ( d i ∈ π k ( R ) ) Val ( d i ) } \= T w ( g ) ˜ ⋂ T w ( f ) ˜ .

Consequently, T w ( g ∘ f ) \= T w ( g ) ∘ T w ( f ) . It holds for complex arrows as well (by considering the composition of their ptp arrows in f ⨄ and g ⨄ ).

Let us show that the monomorphism inc A : T w ( A ) ↪ T A , for a given morphism f \= α ∗ ( M A B ) : A → B , corresponds to the definition of arrows in DB category, specified by Theorem 10 , i. e., there is a SOtgd Ψ of a schema mapping such that inc A \= α ∗ ( MakeOperads ( { Ψ } ) ) .

Let us define the set of relational symbols in the instance-database T w ( A ) by S T w A \= { r i ∣ r i ∈ R and α ( r i ) ∈ T w ( A ) } , and its schema C \= ( S T w A , ∅ ) , so that T w ( A ) \= α ∗ ( C ) (we define analogously the schema T A \= ( S T A , ∅ ) for the instance-database T A ). Then we define the SOtgd Φ by a conjunctive formula ⋀ { ∀ x i ( r i ( x i ) ⇒ r i ( x i ) ) ∣ r i ∈ S T w A } .

In fact, MakeOperads ( { Ψ } ) \= { 1 r i ∈ O ( r i , r i ) ∣ r i ∈ S T w A } ⋃ { 1 r ∅ } is a sketch’s mapping from the schema C into T A and inc A \= α ∗ ( MakeOperads ( { Ψ } ) ) \= α ∗ ( { 1 r i ∈ O ( r i , r i ) ∣ r i ∈ S T w A } ⋃ { 1 r ∅ } ) \= { id r i : α ( r i ) → α ( r i ) ∈ O ( r i , r i ) ∣ r i ∈ S T w A } ⋃ { q ⊥ } .

Thus, inc A ˜ \= T { α ( r i ) ∈ O ( r i , r i ) ∣ r i ∈ S T w A } \= T ( T w ( A ) ) \= (from point 4 of Proposition 29 ) \= T w ( A ) , and hence, inc A : T w ( A ) ↪ T A is a monomorphism (for the inclusion T w ( A ) ⊆ T A ) and, by duality, inc A OP : T A ↠ T w ( A ) is an epimorphism. It is easy to verify that the natural transformations ξ and ξ − 1 are well-defined.  □

Analogously to the monad ( T , η , μ ) and comonad ( T , η C , μ C ) of the endofunctor T , we can define such structures for the weak endofunctor T w as well.

Proposition 30.

The weak power-view endofunctor T w \= ( T w 0 , T w 1 ) : DB ⟶ DB defines the monad ( T w , η w , μ w ) and the comonad ( T w , η w C , μ w C ) in DB such that ․ η w \= ξ − 1 ∙ η : I DB ․ T w is a natural epimorphism and ․ η w C \= η C ∙ ξ : T w ․ I DB is a natural monomorphism ( ′ ∙ ′ is a vertical composition for natural transformations), while ․ μ w : T w T w ․ T w and ․ μ w C : T w ․ T w T w are equal to the natural identity transformation ․ id T w : T w ․ T w (because T w \= T w T w ).

Proof.

It is easy to verify that all commutative diagrams of the monad and the comonad are composed of identity arrows.  □

7.3   Internal categorial symmetry of DB category

The mapping B ⊤ : Mor DB ⟶ Ob DB , specified in definition of the DB category in Theorem 10 , is a fundamental concept for the conceptual categorial symmetry [ 4 ] introduced in Section 3.3 . Let us demonstrate the following equality for any morphism in DB , which will be used in the proof of the next theorem.

Lemma 7.

For any morphism f : A → B , f \= f ∘ f OP ∘ f . Let in f ˜ \= in B : f ˜ ↪ T B and in f OP ˜ \= in A : f ˜ ↪ T A be two monomorphisms defined by Proposition 24 .

Then in f OP ˜ ∘ in f ˜ OP \= T f OP : T B → T A .

Proof.

If f is a simple arrow, then f ˜ \= f OP ˜ (by duality), so that f ∘ f OP ∘ f ˜ \= f ˜ ⋂ f OP ˜ ⋂ f ˜ \= f ˜ , and hence, from Definition 44 ,

(1)

f \= f ∘ f OP ∘ f .

For any two given objects A \= ⨄ 1 ≤ j ≤ m A j , m ≥ 1 and B \= ⨄ 1 ≤ i ≤ k B i , k ≥ 1 and a complex arrow f between them, f OP ⨄ \= { f j i OP ∣ f j i ∈ f ⨄ } , so that

f OP ∘ f ⨄ \= { f j i OP ∘ f j i : A j → A j ∣ f j i : A j → B i ∈ f ⨄ } .

Thus,

f ∘ f OP ∘ f ⨄ \= { f j i ∘ h : A j → B i ∣ f j i : A j → B i ∈ f ⨄ , dom ( f j i ) \= A j \= cod ( h ) , h ∈ f OP ∘ f ⨄ } \= { f j i ∘ ( f j i OP ∘ f j i ) : A j → B i ∣ f j i : A j → B i ∈ f ⨄ } \= { f j i : A j → B i ∣ f j i ∈ f ⨄ } (from (1) and fact that f j i are simple arrows ) \= f ⨄ .

So, from Definition 44 , f \= f ∘ f OP ∘ f is valid for complex morphisms as well.

From point 1 of Proposition 24 , we have for any morphism f : A → B the monomorphisms in f ˜ \= in B : f ˜ ↪ T B and in f OP ˜ \= in A : f ˜ ↪ T A with in A ⨄ \= { in j i \= { id R ∣ R ∈ f j i ˜ } : f j i ˜ ↪ T A j ∣ ( f j i : A j → B i ) ∈ f ⨄ } , in B ⨄ \= { in j i \= { id R ∣ R ∈ f j i ˜ } : f j i ˜ ↪ T B i ∣ ( f j i : A j → B i ) ∈ f ⨄ } . Thus,

in f ˜ OP ⨄ \= { in j i OP \= { id R ∣ R ∈ f j i ˜ } : T B i ↠ f j i ˜ ∣ ( f j i : A j → B i ) ∈ f ⨄ } and in f OP ˜ ∘ in f ˜ OP ⨄ \= { in j i OP ∘ in j i \= { id R ∘ id R ∣ R ∈ f j i ˜ } : T B i ↠ f j i ↪ T A j ∣ ( f j i : A j → B i ) ∈ f ⨄ } \= { { id R ∣ R ∈ f j i ˜ } : T B i → T A j ∣ ( f j i : A j → B i ) ∈ f ⨄ } (from Theorem 12) \= { T f j i OP : T B i → T A j ∣ ( f j i : A j → B i ) ∈ f ⨄ } \= T f OP ⨄ .

Consequently, from Definition 44 , we obtain in f OP ˜ ∘ in f ˜ OP \= T f OP : T B → T A .  □

Now we are ready to demonstrate that the DB category is a symmetry-extended category, w. r. t. Definition 14 in Section 3.4 , with introductions of the encapsulation operator J such that for each morphisms f : A → B in DB , J ( f ) \= ⟨ A , B , f ⟩ is an object in the arrow (or comma) category DB ↓ DB with its inverse operator ψ such that ψ ( J ( f ) ) \= f .

Theorem 14. The category DB is a symmetry-extended category, closed by the functor T e \= ( T e 0 , T e 1 ) : ( DB ↓ DB ) ⟶ DB , where T e 0 \= B ⊤ ψ is the object component of this functor such that for any arrow f : A → B in DB , T e 0 ( J ( f ) ) \= f ˜ , while its arrow component T e 1 is defined as follows: For any arrow ( h 1 ; h 2 ) : J ( f ) ⟶ J ( g ) in DB ↓ DB (so that g ∘ h 1 \= h 2 ∘ f in DB ), T e 1 ( h 1 ; h 2 ) ≜ in g ˜ OP ∘ T ( h 2 ∘ f ) ∘ in f OP ˜ , where in f OP ˜ : f ˜ ↪ T A and in g ˜ : g ˜ ↪ T D are two monomorphisms (Proposition 24 ). This is represented by The associative composition operator for objects ∗ , defined for any fitted pair g ∘ f of arrows, satisfies B ⊤ ( g ) ∗ B ⊤ ( f ) ≜ g ∘ f ˜ \= B ⊤ ( g ∘ f ) .

Proof.

Let us consider a simple morphism f \= α ∗ ( M A B ) : A → B . In accordance with Theorem 10 , for M A B \= MakeOperads ( M A B ) , A \= α ∗ ( A ) , B \= α ∗ ( B ) with ( Φ E , Φ M ) \= DeCompose ( M A B ) , and let us define the mapping-operads M E \= MakeOperads ( { Φ E } ) and M M \= MakeOperads ( { Φ M } ) .

Let us show that the monomorphism in f OP ˜ \= in A : f ˜ ↪ T A (from Lemma 7 ), for this morphisms f \= α ∗ ( MakeOperads ( M A B ) ) : A → B , corresponds to the definition of arrows in DB category, specified by Theorem 10 , i. e., there exists an SOtgd Φ of a schema mapping such that in f OP ˜ \= α ∗ ( MakeOperads ( { Φ } ) ) .

Let us define the set of relational symbols S \= { r i ∣ r i ∈ R and α ( r i ) ∈ Δ ( α , M A B ) ⊆ f ˜ } ⊆ S f ˜ \= { r i ∣ r i ∈ R and α ( r i ) ∈ f ˜ } with f ˜ \= T S and its schema C \= ( S f ˜ , ∅ ) , so that f ˜ \= α ∗ ( C ) (analogously, from Definition 70 , for the instance-database T A we define the schema ( S T A , ∅ ) \= A ⋂ α A ). Consequently, we define the SOtgd Φ by a conjunctive formula ⋀ { ∀ x i ( r i ( x i ) ⇒ r i ( x i ) ) ∣ r i ∈ S } .

In fact, MakeOperads ( { Φ } ) \= { 1 r i ∈ O ( r i , r i ) ∣ r i ∈ S } ⋃ { 1 r ∅ } is a sketch’s mapping between schemas C and T A . Consequently,

in f OP ˜ \= α ∗ ( MakeOperads ( { Φ } ) ) \= α ∗ ( { 1 r i ∈ O ( r i , r i ) ∣ r i ∈ S } ⋃ { 1 r ∅ } ) \= ( { id R \= α ( 1 r i ) : R → R ∣ R \= α ( r i ) ∈ S ⊆ f ˜ } ⋃ { q ⊥ } ) : f ˜ ↪ T A ,

with in f OP ˜ ˜ \= f ˜ .

Thus, from the duality theorem, this property holds for the epimorphism in f ˜ OP : T B ↠ f ˜ (which is a dual (inverted arrow) of the monomorphism in f ˜ \= in B : f ˜ ↪ T B in Lemma 7 ) as well.

Thus, the morphism T e 1 ( h 1 ; h 2 ) \= in g ˜ OP ∘ T ( h 2 ∘ f ) ∘ in f OP ˜ is well-defined in DB due to Theorem 10 . It is easy to verify that also T e is a well-defined functor. In fact, for any identity arrow ( id A ; id B ) : J ( f ) ⟶ J ( f ) , T e 1 ( id A ; id B ) \= in f ˜ OP ∘ T ( id B ∘ f ) ∘ in f OP ˜ \= in f ˜ OP ∘ T f ∘ in f OP ˜ . Thus, when f , id A , id B are simple arrows, T e 1 ( id A ; id B ) ˜ \= in f ˜ OP ˜ ⋂ T f ˜ ⋂ in f OP ˜ ˜ \= f ˜ (from in f ˜ OP ˜ \= T f ˜ \= in f OP ˜ ˜ \= f ˜ ) and, consequently, T e 1 ( id A ; id B ) : f ˜ → f ˜ is equal to the identity arrow id f ˜ . It is easy to verify that it holds also when f , id A and id B are complex arrows as well.

For any two arrows ( h 1 ; h 2 ) : J ( f ) ⟶ J ( g ) and ( l 1 ; l 2 ) : J ( g ) ⟶ J ( k ) if all arrows f , g , k , h 1 , h 2 , l 1 and l 2 are simple arrows then

T e 1 ( l 1 ; l 2 ) ∘ T e 1 ( h 1 ; h 2 ) ‾ \= T e 1 ( l 1 ; l 2 ) ˜ ⋂ T e 1 ( h 1 ; h 2 ) ˜ \= ( k ˜ ⋂ l 2 ˜ ⋂ g ˜ ) ⋂ ( g ˜ ⋂ h 2 ˜ ⋂ f ˜ ) \= k ˜ ⋂ l 2 ˜ ⋂ g ˜ ⋂ h 2 ˜ ⋂ f ˜ ( by h 2 ∘ f \= g ∘ h 1 ) \= k ˜ ⋂ l 2 ˜ ⋂ g ˜ ⋂ h 1 ˜ ⋂ h 2 ˜ ⋂ f ˜ ( by h 2 ∘ f \= g ∘ h 1 ) \= k ˜ ⋂ l 2 ˜ ⋂ h 2 ˜ ⋂ f ˜ \= k ˜ ⋂ l 2 ∘ h 2 ˜ ⋂ f ˜ \= in k ˜ OP ∘ T ( ( l 2 ∘ h 2 ) ∘ f ) ∘ in f OP ˜ ‾ \= T e 1 ( l 1 ∘ h 1 ; l 2 ∘ h 2 ) ˜ \= T e 1 ( ( l 1 ; l 2 ) ∘ ( h 1 ; h 2 ) ) ˜ .

Thus, T e 1 ( ( l 1 ; l 2 ) ∘ ( h 1 ; h 2 ) ) \= T e 1 ( l 1 ; l 2 ) ∘ T e 1 ( h 1 ; h 2 ) .

Let us show this functorial composition property also when we have the complex arrows. We have (from Lemma 7 ):

(1)

in g OP ˜ ∘ in g ˜ OP \= T g OP . Thus,

T e 1 ( l 1 ; l 2 ) ∘ T e 1 ( h 1 ; h 2 ) \= in k ˜ OP ∘ T ( l 2 ∘ g ) ∘ in g OP ˜ ∘ in g ˜ OP ∘ T ( h 2 ∘ f ) ∘ in f OP ˜ \= in k ˜ OP ∘ T ( l 2 ∘ g ) ∘ T g OP ∘ T ( h 2 ∘ f ) ∘ in f OP ˜ (from (1)) \= in k ˜ OP ∘ T ( l 2 ∘ g ∘ g OP ∘ h 2 ∘ f ) ∘ in f OP ˜ \= in k ˜ OP ∘ T ( l 2 ∘ ( g ∘ g OP ∘ g ) ∘ h 1 ) ∘ in f OP ˜ (from h 2 ∘ f \= g ∘ h 1 ) \= in k ˜ OP ∘ T ( l 2 ∘ g ∘ h 1 ) ∘ in f OP ˜ (from Lemma 7) \= in k ˜ OP ∘ T ( ( l 2 ∘ h 2 ) ∘ f ) ∘ in f OP ˜ (from h 2 ∘ f \= g ∘ h 1 ) \= T e 1 ( l 1 ∘ h 1 ; l 2 ∘ h 2 ) \= T e 1 ( ( l 1 ; l 2 ) ∘ ( h 1 ; h 2 ) ) .

For any identity arrow id A , T e 0 J ( id A ) \= id A ˜ \= T A ≃ A . Thus, as required by Definition 7 , the natural isomorphism φ : T e ∘ ▲ ≃ I DB is valid.

Let us show that DB is an symmetry-extended category, i. e., ․ τ − 1 ∙ τ \= ψ : F st ․ S nd for vertical composition of natural transformations ․ τ : F st ․ T e and ․ τ − 1 : T e ․ S nd , so that for each object J ( f ) \= ⟨ A , B , f ⟩ in DB ↓ DB , the following diagram commutes (we recall that ψ J ( f ) \= ψ ( J ( f ) ) \= f ): where T e ( J ( f ) ) \= f ˜ ≃ ⨄ f ⨄ ˜ \= ⨄ f j i ∈ f ⨄ f j i ˜ and τ J ( f ) ⨄ \= { τ J ( f j i ) : A j ↠ f j i ˜ ∣ ( f j i : A j → B i ) ∈ f ⨄ } and τ J ( f ) − 1 ⨄ \= { τ J ( f j i ) − 1 : f j i ˜ ↪ B i ∣ ( f j i : A j → B i ) ∈ f ⨄ } .

In fact, for a simple morphism f \= α ∗ ( MakeOperads ( M A B ) ) : A → B , we have two instance-mappings ep ( f ) \= α ∗ ( M E ) : A → T C and i n ( f ) \= α ∗ ( M M ) : T C → B with C \= ( S C , ∅ ) , S C \= ⋃ q i ′ ∈ M E ∂ 1 ( q i ′ ) \= { r q 1 , … , r q m } and C \= α ∗ ( S C ) . From the fact that T C \= T α ∗ ( S C ) ⊆ f ˜ , we can define the equivalent morphisms to these two morphisms, by substituting the instance-database T C by f ˜ , and hence, defining the epimorphism τ J ( f ) ≜ α ∗ ( M E ) : A ↠ f ˜ ( τ J ( f ) ˜ \= ep ( f ) ˜ \= f ˜ ) and the monomorphism τ J ( f ) − 1 ≜ α ∗ ( M M ) : f ˜ ↪ B ( τ J ( f ) − 1 ˜ \= i n ( f ) ˜ \= f ˜ ).

Notice that the existence of this monomorphism is also predicted by Proposition 24 with monic “inclusion” f ˜ ⪯ T B (i. e., in B : f ˜ ↪ T B ) and isomorphism is B − 1 : T B ≃ B , which is monic as well, and hence, their composition is a monomorphism equal to τ J ( f ) − 1 \= is B − 1 ∘ in B : f ˜ ↪ B . In the same way, from the epimorphism in A OP : T A ↠ f ˜ (the dual (inverted) of the monomorphism in A : f ˜ ↪ T A ) and isomorphism is A : A ≃ T A , which is epic as well, we obtain that their composition is epic as well. That is, τ J ( f ) \= in A OP ∘ is A : A ↠ f ˜ is an epimorphism.  □

Remark.

For any given morphism f : A ⟶ B in DB , the arrow f ep \= τ ( J ( f ) ) : A ↠ f ˜ is an epimorphism, and the arrow f i n \= τ − 1 ( J ( f ) ) : f ˜ ↪ B is a monomorphism, so that any morphism f in DB is a composition of an epimorphism and monomorphism f \= f i n ∘ f ep (as in Set , in Example 10 ), with the intermediate object equal to its information flux f ˜ .

7.3.1   (Co)products

We recall that for a tuple of objects (i. e., instance-databases) in DB category ( S 1 , … , S n ) , n ≥ 2 , we define its disjoint union (see Definition 40 ),

⨄ 1 ≤ i ≤ n S i \= ⨄ ( S 1 , … , S n ) \= ⋃ 1 ≤ i ≤ n { ( i , a ) ∣ a ∈ S i }

the union indexed by positions of the sets in a given tuple, denoted also as S 1 ⨄ S 2 ⨄ ⋯ ⨄ S n . It will be demonstrated that the disjoint union of two objects is isomorphic to separation composition of these objects.

Theorem 15. There exists an idempotent coproduct bifunctor + : DB × DB ⟶ DB , which is a disjoint union ⨄ for objects and arrows in DB . The category DB is co-Cartesian with initial (and terminal) object ⊥ 0 and for every pair of objects A and B, the object A + B is a coproduct with monomorphisms (injections) in A \= ⟨ id A , ⊥ 1 ⟩ : A ↪ A + B and in B \= ⟨ ⊥ 1 , id B ⟩ : B ↪ A + B . Based on duality property, DB is also Cartesian category with a terminal object ⊥ 0 . For each pair of objects A and B, there exists a categorial product A × B with epimorphisms (projections) p A \= in A OP : A × B ↠ A and p B \= in B OP : A × B ↠ B . Thus, the product bifunctor is equal to the coproduct bifunctor, i. e., ×≡+ .

Proof.

Note that the coproduct + is just the disjoint union ⨄, so that:

1. For any identity arrow ( id A , id B ) in DB × DB where id A and id B are the identity arrows of A and B , respectively, id A + id B ⨄ \= id A + B ⨄ \= { id A , id B } . Thus, + 1 ( id A , id B ) \= id A + id B \= id A + B is an identity arrow of the object A + B .

2. For any k : A ⟶ A 1 , k 1 : A 1 ⟶ A 2 , l : B ⟶ B 1 , l 1 : B 1 ⟶ B 2 , it holds + 1 ( k 1 , l 1 ) ∘ + 1 ( k , l ) ⨄ \= { k 1 ∘ k : A → A 2 , l 1 ∘ l : B → B 2 } \= + 1 ( k 1 ∘ k , l 1 ∘ l ) ⨄ . Thus, from point 3 of Definition 44 , it is valid functorial property for composition of morphisms + 1 ( k 1 ∘ k , l 1 ∘ l ) \= + 1 ( k 1 , l 1 ) ∘ + 1 ( k , l ) .

3. Let us demonstrate the coproduct property of this bifunctor. For any two simple arrows f : A ⟶ C and g : B ⟶ C there exists a unique arrow k \= [ f , g ] : A + B ⟶ C such that f \= k ∘ in A and g \= k ∘ in B where in A \= ⟨ id A , ⊥ 1 ⟩ : A ↪ A + B and in B \= ⟨ ⊥ 1 , id B ⟩ : B ↪ A + B are the monomorphisms (injections). In fact, for any two arrows h , k : D → A , if in A ∘ h \= in A ∘ k then h \= k ( in A ∘ h \= ⟨ id A , ⊥ 1 ⟩ ∘ h \= ⟨ id A ∘ h , ⊥ 1 ∘ h ⟩ \= ⟨ h , ⊥ 1 ⟩ \= in A ∘ k \= ⟨ h , ⊥ 1 ⟩ , so that h \= k ). Analogously, it holds also for in B . That is, the following coproduct diagram in DB commutes:

Assume that, for a given schema A , B and C , we have the sketch’s maggings M A C : A → C and M B C : B → C and an interpretation α such that A \= α ∗ ( A ) , B \= α ∗ ( B ) , C \= α ∗ ( C ) , f \= α ∗ ( M A C ) and g \= α ∗ ( M B C ) . Then we define the morphisms in A \= α ∗ ( ⟨ M A A , { 1 r ∅ } ⟩ ) \= ⟨ id A , ⊥ 1 ⟩ and in B \= α ∗ ( ⟨ { 1 r ∅ } , M B B ⟩ ) \= ⟨ ⊥ 1 , id B ⟩ where M A A \= { 1 r ∣ r ∈ A } ⋃ { 1 r ∅ } and M B B \= { 1 r ∣ r ∈ B } ⋃ { 1 r ∅ } .

Thus, [ f , g ] ∘ in A \= [ f , g ] ∘ ⟨ id A , ⊥ 1 ⟩ \= ⌈ f ∘ id A , g ∘ ⊥ 1 ⌋ \= ⌈ f , ⊥ 1 ⌋ \= ⌈ f ⌋ \= f (from Definition 41 ), and hence, this triangle is commutative. Analogously, we show that g \= [ f , g ] ∘ in B .

Let us suppose that there is another arrow k ′ \= [ k 1 , k 2 ] : A + B → C such that the diagram above commutes, i. e., k ′ ∘ in A \= f and k ′ ∘ in B \= g . However, k ′ ∘ in A \= ⌈ k 1 , ⊥ 1 ⌋ \= k 1 and k ′ ∘ in B \= ⌈ ⊥ 1 , k 2 ⌋ \= k 2 , so that k 1 \= f and k 2 \= g , i. e., k ′ \= k \= [ f , g ] is a unique arrow that satisfies this commutativity.  □

The product diagram is its dual with k \= [ f , g ] OP \= ⟨ f OP , g OP ⟩ (from Corollary 23 ):

Let us show that the complex morphisms with coproducts satisfy the powerview functor T , the duality and the symmetry property in DB .

Corollary 23.

The complex morphisms satisfy the following DB properties:

1.

(Power-view functorial properties)

T ( f + g ) \= T f + T g , T ( [ f , g ] ) \= [ T f , T g ] , T ( ⟨ f , g ⟩ ) \= ⟨ T f , T g ⟩ and T ( ⌈ f , g ⌋ ) \= ⌈ T f , T g ⌋ .

2.

(The duality properties)

( f + g ) OP \= f OP + g OP , [ f , g ] OP \= ⟨ f OP , g OP ⟩ , ⟨ f , g ⟩ OP \= [ f OP , g OP ] and ⌈ f , g ⌋ OP \= ⌈ f OP , g OP ⌋ .

3.

(The symmetry property of Theorem 14 with τ − 1 ∙ τ \= ψ )

τ ( J ( f + g ) ) \= τ J ( f ) + τ J ( g ) , τ − 1 ( J ( f + g ) ) \= τ J ( f ) − 1 + τ J ( g ) − 1 , τ ( J ( [ f , g ] ) ) \= τ J ( f ) + τ J ( g ) , τ − 1 ( J ( [ f , g ] ) ) \= [ τ J ( f ) − 1 , τ J ( g ) − 1 ] , τ ( J ( ⟨ f , g ⟩ ) ) \= ⟨ τ J ( f ) , τ J ( g ) ⟩ , τ − 1 ( J ( ⟨ f , g ⟩ ) ) \= τ J ( f ) − 1 + τ J ( g ) − 1 , τ ( J ( ⌈ f , g ⌋ ) ) \= τ J ( f ) ⋃ τ J ( g ) , τ − 1 ( J ( ⌈ f , g ⌋ ) ) \= τ J ( f ) − 1 ⋃ τ J ( g ) − 1 .

Proof.

Claim 1 (Power-view properties):

1.1

For f + g : A + B → C + D , from Theorem 11 , T ( f + g ) \= is C + D − 1 ∘ ( f + g ) ∘ is A + B \= ( is C − 1 + is D − 1 ) ∘ ( f + g ) ∘ ( is A + is B ) \= ( is C − 1 ∘ f ∘ is A ) + ( is D − 1 ∘ g ∘ is B ) \= T f + T g .

1.2

For [ f , g ] : A + B → C , from Theorem 11 , T ( [ f , g ] ) \= is C ∘ [ f , g ] ∘ is A + B − 1 \= is C ∘ [ f , g ] ∘ ( is A − 1 + is B − 1 ) \= [ is C ∘ f ∘ is A − 1 , is C ∘ g ∘ is B − 1 ] \= [ T f , T g ] .

The other two cases can be proved analogously.

Claim 2 (Duality). It holds from the fact that f OP ˜ \= f ˜ . Let us show that 12 is applicable. For example, consider [ f , g ] : A + B → C :

[ f , g ] OP \= [ is C − 1 ∘ T f ∘ is A , is C − 1 ∘ T g ∘ is B ] OP from Theorem 11 \= ⟨ ( is C − 1 ∘ T f ∘ is A ) OP , ( is C − 1 ∘ T g ∘ is B ) OP ⟩ \= ⟨ is A − 1 ∘ ( T f ) OP ∘ is C , is B − 1 ∘ ( T g ) OP ∘ is C ⟩ \= ⟨ f OP , g OP ⟩ from Theorem 12 .

Claim 3. The extended symmetry τ − 1 ∙ τ \= ψ can be shown by the following four commutative diagrams:

based on the results in point 1 and the facts of Theorem 14 , i. e., τ J ( f ) ˜ \= τ J ( f ) OP ˜ \= f ˜ .

For example, in the second case we obtain

[ τ J ( f ) − 1 , τ J ( g ) − 1 ] ∘ ( τ J ( f ) + τ J ( g ) ) \= [ τ J ( f ) − 1 , τ J ( g ) − 1 ] ∘ ( τ J ( f ) ⨄ τ J ( g ) ) \= (by rule 3 for composition of complex arrows) \= [ τ J ( f ) − 1 ∘ τ J ( f ) , τ J ( g ) − 1 ∘ τ J ( g ) ] \= [ f , g ] .

 □

Let us show some examples for the symmetry-closure functor T e of Theorem 14 , applied to complex morphisms and (co)products.

Example 26.

Let us consider a number of “conceptualizations” of complex morphisms in Theorem 14 , expressed by the functor T e \= ( T e 0 , T e 1 ) : ( DB ↓ DB ) ⟶ DB :

1.

The case when f \= f 1 + f 2 : A 1 + A 2 → B 1 + B 2 , g \= g 1 + g 2 : C 1 + C 2 → D 1 + D 2 , h \= h 1 + h 2 : A 1 + A 2 → C 1 + C 2 and k \= k 1 + k 2 : B 1 + B 2 → D 1 + D 2 , such that k 1 ∘ f 1 \= g 1 ∘ h 1 and k 2 ∘ f 2 \= g 2 ∘ h 2 , so that we have the arrow ( h 1 + h 2 ; k 1 + k 2 ) : J ( f ) → J ( g ) , and hence, T e ( h 1 + h 2 ; k 1 + k 2 ) \= T e ( h 1 , k 1 ) + T e ( h 2 , k 2 ) : f 1 ˜ + f 2 ˜ → g 1 ˜ + g 2 ˜ .

2.

The case when f \= [ f 1 , f 2 ] : A 1 + A 2 → B , g : C → D , h \= [ h 1 , h 2 ] : A 1 + A 2 → C and k : B → D , such that k ∘ f 1 \= g ∘ h 1 and k ∘ f 2 \= g ∘ h 2 , so that we have the arrow ( [ h 1 , h 2 ] ; k ) : J ( f ) → J ( g ) , and hence, T e ( [ h 1 , h 2 ] ; k ) \= [ T e ( h 1 , k ) , T e ( h 2 , k ) ] : f 1 ˜ + f 2 ˜ → g ˜ .

3.

The case when f : A → B , g \= [ g 1 , g 2 ] : C 1 + C 2 → D , h \= ⟨ h 1 , h 2 ⟩ : A → C 1 + C 2 and k : B → D , such that k ∘ f \= g 1 ∘ h 1 and k ∘ f \= g 2 ∘ h 2 , so that we have the arrow ( ⟨ h 1 , h 2 ⟩ ; k ) : J ( f ) → J ( g ) , and hence, T e ( ⟨ h 1 , h 2 ⟩ ; k ) \= ⟨ T e ( h 1 , k ) , T e ( h 2 , k ) ⟩ : f ˜ → g 1 ˜ + g 2 ˜ .

4.

The case when f \= ⟨ f 1 , f 2 ⟩ : A → B 1 + B 2 , g \= ⟨ g 1 , g 2 ⟩ : C → D 1 + D 2 , h : A → C and k \= k 1 + k 2 : B 1 + B 2 → D 1 + D 2 , such that k 1 ∘ f 1 \= g 1 ∘ h and k 2 ∘ f 2 \= g 2 ∘ h , so that we have the arrow ( h ; k 1 + k 2 ) : J ( f ) → J ( g ) , and hence, T e ( h ; k 1 + k 2 ) \= ⟨ T e ( h , k 1 ) , T e ( h , k 2 ) ⟩ : f ˜ → g 1 ˜ + g 2 ˜ .

5.

The case when f \= ⟨ f 1 , f 2 ⟩ : A → B 1 + B 2 , g : C → D , h \= ⌈ h 1 , h 2 ⌋ : A → C and k \= [ k 1 , k 2 ] : B 1 + B 2 → D , such that k 1 ∘ f 1 \= g ∘ h 1 and k 2 ∘ f 2 \= g ∘ h 2 , so that we have the arrow ( ⌈ h 1 , h 2 ⌋ ; [ k 1 , k 2 ] ) : J ( f ) → J ( g ) , and hence, T e ( ⌈ h 1 , h 2 ⌋ ; [ k 1 , k 2 ] ) \= [ T e ( h 1 , k 1 ) , T e ( h 2 , k 2 ) ] : f 1 ˜ + f 2 ˜ → g ˜ .

But also more complex cases:

6.

The case when f \= [ f 1 , f 2 ] : A 1 + A 2 → B , g \= [ g 1 , g 2 ] : C 1 + C 2 → D , h \= h 1 + h 2 : A 1 + A 2 → C 1 + C 2 and k : B → D , such that k ∘ f 1 \= g 1 ∘ h 1 and k ∘ f 2 \= g 2 ∘ h 2 , so that we have the arrow ( h 1 + h 2 ; k ) : J ( f ) → J ( g ) , and hence, T e ( h 1 + h 2 ; k ) \= ⟨ in g 1 , in g 2 ⟩ ∘ T ( k ∘ [ f 1 , f 2 ] ) ∘ ( in f 1 + in f 2 ) \= [ ⟨ T e ( h 1 , k ) , in g 2 ∘ T ( k ∘ f 1 ) ∘ in f 1 ⟩ , ⟨ in g 1 ∘ T ( k ∘ f 2 ) ∘ in f 2 , T e ( h 2 , k ) ⟩ ] : f 1 ˜ + f 2 ˜ → g 1 ˜ + g 2 ˜ .

7.

The case when f \= ⟨ f 1 , f 2 ⟩ : A 1 + A 2 → B , g \= [ g 1 , g 2 ] : C 1 + C 2 → D , h \= ⟨ h 1 , h 2 ⟩ : A 1 + A 2 → C 1 + C 2 and k \= [ k 1 , k 2 ] : B 1 + B 2 → D 1 + D 2 , we obtain that T e ( h 1 + h 2 ; [ k 1 , k 2 ] ) \= ⌈ ⟨ [ T e ( h 1 , k 1 ) , in g 1 ∘ T ( k 1 ∘ f 1 ) ∘ in f 2 ] , [ in g 2 ∘ T ( k 1 ∘ f 1 ) ∘ in f 1 , in g 2 ∘ T ( k 1 ∘ f 1 ) ∘ in f 2 ] ⟩ , ⟨ [ in g 1 ∘ T ( k 2 ∘ f 2 ) ∘ in f 1 , in g 1 ∘ T ( k 2 ∘ f 2 ) ∘ in f 2 ] , [ in g 2 ∘ T ( k 2 ∘ f 2 ) ∘ in f 1 , T e ( h 2 , k 2 ) ] ⟩ ⌋ : f 1 ˜ + f 2 ˜ → g 1 ˜ + g 2 ˜ .

7.3.2   (Co)Limits and exponentiation

In previous section, we introduced the (co)products in the DB category that are operators used in order to make the separation composition of the databases. Here, instead, we will investigate the rest of the limits and colimits in DB category in order to establish the general properties of this category, used as a base category for the functorial semantics of schema database mapping systems.

In order to explain these concepts in another way, we can see the limits and colimits as a left and a right adjunction for the diagonal functor △ : DB ⟶ DB J for a small index category (i. e., a diagram) J . For any (co)limit functor G , a right adjoint to the diagonal functor (i. e., the adjunction, ( △ , G , ε , η ) : DB ⟶ DB J ) with the (co)limit object G ( D ) and the universal (counit) cone (a natural transformation) ․ ε : △ G ․ Id D B J , and ․ η : Id DB ․ G △ (for colimits, unit and counit are inverted w. r. t. limits).

Let us consider, e. g., the coproducts ( G \= + ≡ ⨄ ) and the products ( G \= × ≡ + ). In this case, the diagram (a functor) D \= ( A , B ) ∈ DB J is just a diagram of two objects in DB without arrows between them ( J is a discrete category with two index objects a 1 and a 2 and with their identity arrows, so that DB J ≃ DB 2 \= DB × DB ).

We obtain for the universal cocone counit ε ( A , B ) : ( A , B ) ⟶ ( A + B , A + B ) , one pair of the coproduct inclusion-monomorphisms ε ( A , B ) \= ( in A , in B ) where in A \= ⟨ id A , ⊥ 1 ⟩ : A ↪ A + B and in B \= ⟨ ⊥ 1 , id B ⟩ : B ↪ A + B . Dually, for the products, the universal cone counit of the product ε ( A , B ) : ( A × B , A × B ) ⟶ ( A , B ) is a pair of the product projection-epimorphisms ε ( A , B ) \= ( p A , p B ) where p A : A × B ↠ A and p B : A × B ↠ B . Moreover, A × B \= A + B , p A \= in A OP \= [ id A , ⊥ 1 ] and p B \= in B OP \= [ ⊥ 1 , id B ] , as represented in the following diagram:

In the case when J is an index category with two objects and two parallel arrows from the first into the second object, each diagram (a functor) D ∈ DB J is of the form B f g A . The limits of such diagrams are the equalizers, while their colimits are the coequalizers, as in the following example.

Example 27.

Let us verify that each object in DB is a limit of some equalizer and a colimit of its dual coequalizer. In fact, for any simple object A , a “structure map” h : T A ⟶ A of a monadic T-algebra ( A , h ) ( h : T A → A is an isomorphism, thus epic and monic as well) derived from a monad ( T , η , μ ) , where from Definition 46 , in Section 7.1.2 , h ∘ η A \= id A , and h ∘ T h \= h ∘ μ A , we obtain the coequalizer (by Back’s theorem, it is preserved by the endofunctor T , i. e., T creates a coequalizer) with a colimit A , and, by duality, we obtain the absolute equalizer with the limit A as well:

That is, whenever m : T A → B (with a simple object B ) has m ∘ T h \= m ∘ μ A in DB , there is exactly one arrow k : A → B such that m \= k ∘ h . In fact, if m ∘ T h \= m ∘ μ A then m ˜ ⋂ T h ˜ \= m ˜ ⋂ μ A ˜ , and from m ˜ ⊆ T A \= μ A ˜ and T h ˜ \= h ˜ we obtain m ˜ ⋂ h ˜ \= m ˜ , i. e., m ˜ ⊆ h ˜ .

Consequently, in order to satisfy the commutativity m \= k ∘ h , i. e., m ˜ \= k ˜ ⋂ h ˜ , we must have that k ˜ \= m ˜ , so that k is uniquely determined by the morphism m .

Analogously, we obtain for the equalizer in the right part of the diagram above.

Lemma 8.

DB has the (co)equalizers for every pair of morphisms.

Proof.

For each pair of simple morphisms f , g : A → B , and hence, f ˜ ⊆ T A and g ˜ ⊆ T A , the LimE \= ( f ˜ ⋂ g ˜ ) ⋃ ( T A \ ( f ˜ ⋃ g ˜ ) ) ⊆ T A is a limit object (up to isomorphism) of the diagram B f g A , so that the following diagram is an equalizer: with

(1)

f ∘ h \= g ∘ h ,

(2)

f ∘ m \= g ∘ m ,

where h is a monomorphism (every equalizer is monic). It is easy to verify that h ˜ \= T ( LimE ) ⊆ T A is the maximal flux such that f ˜ ⋂ h ˜ \= g ˜ ⋂ h ˜ (equal to f ˜ ⋂ g ˜ ). From (2), we have f ˜ ⋂ m ˜ \= g ˜ ⋂ m ˜ , so that it must be m ˜ ⊆ h ˜ , and hence, for each m : C → A such that (2) is true, there is a unique k : C → LimE with k ˜ \= m ˜ for which m \= h ∘ k . By duality, it is valid for coequalizers as well. The equalizers for the complex arrows are given as a particular case of the pullbacks after the proof of next Proposition 31 .  □

In the case when J is an index category with three objects and two arrows with the same codomain, each diagram (a functor) D ∈ DB J is of the form A f C g B . The limits of such diagrams are the pullbacks. In the case when J is an index category with one object only, the limit of such diagram corresponds to a terminal object of such a category. A category is complete if every diagram in it has a limit.

Dually, it is cocomplete when every diagram has a colimit. A finite diagram (a functor in DB J in our case) is one that has a finite number of objects, and a finite number of arrows between them. A category is finitely complete (Cartesian) if it has a limit for every finite diagram. It is well known that any category that has a terminal object and the pullbacks for every pair of morphisms, then it has all finite limits.

Let us show that DB is not finitely complete if we reduce only to simple arrows and objects. For example, for the pullbacks. Let us suppose that the following diagram, where A , B and C are simple databases and LimP is a limit object of the diagram A f C g B , is a pullback (PB): In order to have for every pair of arrows ( m , h ) , the commutativity f ∘ m \= g ∘ h , i. e., f ˜ ⋂ m ˜ \= g ˜ ⋂ h ˜ it must be true that m ˜ ⊆ T ( ( T A ⋂ g ˜ ) ⋃ ( T A \ f ˜ ) ) and h ˜ ⊆ T ( ( T B ⋂ f ˜ ) ⋃ ( T B \ g ˜ ) ) , and from the commutativity m \= p A ∘ k and h \= p B ∘ k , m ˜ ⊆ p A ˜ and h ˜ ⊆ p B ˜ , it must be true that p A ˜ \= T ( ( T A ⋂ g ˜ ) ⋃ ( T A \ f ˜ ) ) and p B ˜ \= T ( ( T B ⋂ f ˜ ) ⋃ ( T B \ g ˜ ) ) . In fact, from f ˜ ⊆ T A we have that ( ( T A ⋂ g ˜ ) ⋃ ( T A \ f ˜ ) ) ⋂ f ˜ \= f ˜ ⋂ g ˜ , and hence, for closed object f ˜ ⋂ g ˜ \= T ( f ˜ ⋂ g ˜ ) \= T ( ( ( T A ⋂ g ˜ ) ⋃ ( T A \ f ˜ ) ) ⋂ f ˜ ) \= T ( ( T A ⋂ g ˜ ) ⋃ ( T A \ f ˜ ) ) ⋂ f ˜ \= p A ˜ ⋂ f ˜ . Similarly, p B ˜ ⋂ g ˜ \= f ˜ ⋂ g ˜ , and hence, p A ˜ ⋂ f ˜ \= p B ˜ ⋂ g ˜ , i. e., f ∘ p A \= g ∘ p B .

However, if m ˜ ≠ h ˜ then there is no simple arrow k : D → LimP because we need k ˜ \= h ˜ (from h \= p A ∘ k and h ˜ ⊆ p A ˜ ), and similarly k ˜ \= m ˜ , and hence, m ˜ \= h ˜ , which is a contradiction (the case when m ˜ \= h ˜ with A \= B is the case when it is a pullback with all simple objects, corresponding to equalizers in Lemma 8 ). Consequently, LimP \= ( ( T A ⋂ g ˜ ) ⋃ ( T A \ f ˜ ) ) × ( ( T B ⋂ f ˜ ) ⋃ ( T B \ g ˜ ) ) and all arrows to and from it have to be complex , i. e., k \= ⟨ m , h ⟩ and p B and p A substituted by [ ⊥ 1 , p B ] and [ p A , ⊥ 1 ] , respectively. Consequently, we obtain the following.

Proposition 31.

DB category is finitely (co)complete , i. e., (co)Cartesian.

Proof.

Let us consider a pullback diagram (PB) above with A \= ⨄ 1 ≤ j ≤ M A j , B \= ⨄ 1 ≤ i ≤ K B i , C \= ⨄ 1 ≤ l ≤ N C l and E \= ⨄ 1 ≤ x ≤ N 1 E x for M , K , N , N 1 ≥ 1 . Then a limit cone of this pullback is composed by limit object (see the ptp arrows in S A and S B in the diagram below) LimP \= S E ⨄ S A ⨄ S B where S E \= { D i l j \= D j l i ′ \= ( f j l ˜ ⋂ g i l ˜ ) ⋃ ( T A j \ ( f j l ˜ ⋃ g i l ˜ ) ∣ f j l ∈ f ⨄ , g i l ∈ g ⨄ , i \= j and T B i \= T A j } , S A \= { D i l j \= ( T A j ⋂ g i l ˜ ) ⋃ ( T A j \ f j l ˜ ) ∣ f j l ∈ f ⨄ , g i l ∈ g ⨄ , T B i ≠ T A j } and S B \= { D j l i ′ \= ( T B i ⋂ f j l ˜ ) ⋃ ( T B i \ g i l ˜ ) ∣ f j l ∈ f ⨄ , g i l ∈ g ⨄ , T B i ≠ T A j } , and with outgoing arrows p A ⨄ \= { p i l j A : D i l j ↪ A j ∣ D i l j ∈ S E ⋃ S A } and p B ⨄ \= { p j l i B : D j l i ′ ↪ B i ∣ D j l i ′ ∈ S E ⋃ S B } . From the fact that f ∘ p A ⨄ \= { f j l ∘ p i j l A : D i l j → C l ∣ f j l ∈ f ⨄ , g i l ∈ g ⨄ } and g ∘ p B ⨄ \= { g i l ∘ p j l i B ∣ f j l ∈ f ⨄ , g i l ∈ g ⨄ } , we obtain the bijection σ : f ∘ p A ⨄ → g ∘ p B ⨄ , such that for each f j i ∘ p i j l A ∈ f ⨄ , σ ( f j i ∘ p i j l A ) \= g i l ∘ p j l i B with σ ( f j i ∘ p i j l A ) ˜ \= g i l ˜ ⋂ p j l i B ˜ \= g i l ˜ ⋂ f j l ˜ \= p i j l A ˜ ⋂ f j l ˜ \= f j i ∘ p i j l A ˜ and, consequently we have the same set of ptp arrows f ∘ p A ⨄ \= g ∘ p B ⨄ , i. e., the commutativity of the square diagram (PB), i. e., f ∘ p A \= g ∘ p B .

Suppose that for another two arrows m : E → A and h : E → B the diagram (PB) commutes, i. e., f ∘ m \= g ∘ h . For m ⨄ \= h ⨄ \= ∅ , it is obvious, so we will consider nontrivial cases when both arrows have a nonempty set of ptp arrows. Let us define the sets (see the commutative diagram below composed by the ptp arrows of this pullback diagram), S 1 \= { k x j i : E x → D i l j ∣ m x j ∈ m ⨄ , p i l j A ∈ p A with k x j i ˜ \= m x j ˜ ⊆ p i l j A ˜ } , and S 2 \= { k x j i ′ : E x → D j l i ′ ∣ h x i ∈ h ⨄ , p j l i B ∈ p B with k x j i ′ ˜ \= h x i ˜ ⊆ p j l i B ˜ } . Then we define the arrow k : E → LimP as the canonical representation (from Lemma 2 ) composed by the set of ptp arrows k ⨄ ≜ S 1 ⋃ S 2 :

Let us show that the pullback diagram (PB) commutes for this arrow k , i. e., p B ∘ k \= h (and p A ∘ k \= m ). First of all, note that each ptp arrow ( s x i : E x → B i ) ∈ p B ∘ k ⨄ is the union of the following set of compositions of the ptp arrows in S 2 ⊂ k ⨄ and in p B ⨄ , s x i \= ⋃ { p j l i B ∘ k x j i ′ : E x → B i ∣ k x j i ′ ∈ S 2 , p j l i B ∈ p B and 1 ≤ j ≤ M } .

From Lemma 1 , the information flux of this ptp arrow is s x i ˜ \= T ( ⋃ { p j l i B ∘ k x j i ′ ˜ ∣ p j l i B ∘ k x j i ′ ∈ s x i ⨄ } ) \= T ( ⋃ { p j l i B ˜ ⋂ k x j i ′ ˜ ∣ p j l i B ∘ k x j i ′ ∈ s x i ⨄ } ) \= T ( ⋃ { p j l i B ˜ ⋂ h x i ˜ ∣ p j l i B ∘ k x j i ′ ∈ s x i ⨄ } ) \= T ( ⋃ { h x i ˜ ∣ p j l i B ∘ k x j i ′ ∈ s x i ⨄ } ) \= T ( h x i ˜ ) \= h x i ˜ , i. e., s x i \= h x i . Consequently, p B ∘ k ⨄ \= h ⨄ , and hence, p B ∘ k \= h . Analogously, p A ∘ k \= m , so that k is this unique arrow, which satisfies the pullback’s requirements.  □

Notice that if this definition of the pullbacks we considered only nonempty arrows f and g . Notice that when f ⨄ \= g ⨄ \= ∅ are empty morphisms, then the pullback diagram corresponds to the standard product diagram. In this case, D i l j \= ( T A j ⋂ ⊥ 0 ) ⋃ ( T A j \ ⊥ 0 ) \= T A j ≃ A j , D j l i ′ \= ( T B i ⋂ ⊥ 0 ) ⋃ ( T B i \ ⊥ 0 ) \= T B i ≃ B i . Thus, LimP \= A × B with the projections p A \= [ id A , ⊥ 1 ] and p B \= [ ⊥ 1 , id B ] .

In fact, when B \= A and S A \= S B \= ∅ , we obtain p A \= p B with limit object LimP \= ⨄ S E corresponding to the equalizer.

From the fact that DB is an symmetry-extended category, for any morphism f : A → B (i. e., each object J ( f ) \= ⟨ A , B , f ⟩ in DB ↓ DB ), the following diagram commutes (see the proof of Theorem 14 in Section 7.3 ):

such that

T e ( J ( f ) ) \= f ˜ ≃ ⨄ f ⨄ ˜ \= ⨄ f j i ∈ f ⨄ f j i ˜ , and τ J ( f ) ⨄ \= { τ J ( f j i ) : A j ↠ f j i ˜ ∣ ( f j i : A j → B i ) ∈ f ⨄ } , and τ J ( f ) − 1 ⨄ \= { τ J ( f j i ) − 1 : f j i ˜ ↪ B i ∣ ( f j i : A j → B i ) ∈ f ⨄ } .

This decomposition of each morphism f into one epic τ J ( f ) : A ↠ f ˜ and one monic τ J ( f ) − 1 : f ˜ ↪ B arrows will be used to demonstrate the existence of a limit in DB for each diagram D composed of a single morphism f : A → B in DB , by the pullback of the diagram B id B B f A (when C \= B and g \= id B ). Here, we will consider the following particular cases for f .

Corollary 24.

For any given morphism f : A → B such that for each its ptp arrow f j i : A j → B i , T A j ⊆ T B i , with A \= ⨄ 1 ≤ j ≤ M A j , M ≥ 1 and B \= ⨄ 1 ≤ j ≤ K B i , K ≥ 1 , and a diagram B id B B f A , the cone with the vertex

Lim ( f ) \= ⨄ ( f j i : A j → B i ) ∈ f ⨄ ( A j × f j i ˜ ) ,

and with outgoing arrows p B ⨄ \= { τ J ( f j i ) − 1 : f j i ˜ ↪ B i ∣ f j i ∈ f ⨄ } \= τ J ( f ) − 1 ⨄ and p A ⨄ \= id A ⨄ , defines a pullback diagram,

This diagram can be simplified by substituting the limit object Lim ( f ) with the object A × f ˜ isomorphic to it.

Proof.

For a morphism f , we have that for each of its ptp arrows f j i : A j → B i , f j i ˜ ⊆ T A j ⊆ T B i . The first part comes directly from the proof of Proposition 31 in the case when C \= B and g \= id B , with l \= i , D i l j \= ( T A j ⋂ g i i ˜ ) ⋃ ( T A j \ f j i ˜ ) \= ( T A j ⋂ T B i ) ⋃ ( T A j \ f j i ˜ ) \= T A j ≃ A j and D j l i ′ \= ( T B i ⋂ f j i ˜ ) ⋃ ( T B i \ g i i ˜ ) \= f j i ˜ ⋃ ( T B i \ T B i ) \= f j i ˜ .

From the fact that f is a complex monomorphism, we have a ptp arrow for every simple object A j , 1 ≤ j ≤ M , so from the commutativity we have that Lim ( f ) ≃ A 1 ⨄ ⋯ ⨄ A M ⨄ f ⨄ ˜ ≃ A × f ˜ (we recall that the product ‘×’ is equal to ⨄). The rest comes directly from it.  □

Remark.

Consequently, for each morphism f : A → B such that for each of its ptp arrows f j i : A j → B i , T A j ⊆ T B i , the following commutative diagram with the arrows p B and p A such that p B ⨄ \= τ J ( f ) − 1 ⨄ and p A ⨄ \= id A ⨄ is a pullback diagram:

If the category is finitely complete and has the exponentiation as well then it is a Cartesian Closed Category (CCC). We say that a category has exponentiation if it has a product for any two objects, and if for any given objects B and C there is an object C B and an arrow eval B , C : C B × B → C , called an evolution arrow, such that for any object A and arrow f : A × B → C , there is a unique arrow Λ ( f ) : A → C B making the following diagram commute:

such that eval B , C ∘ ( Λ ( f ) × id B ) \= f . The assignment of Λ ( f ) to f establishes a bijection Λ from the arrows from A × B to C and the arrows from A to C B .

It is well known that in a CCC with a zero object (i. e., when terminal and initial objects are isomorphic) such a category degenerates, i. e., all objects in such a category are isomorphic. The DB category has a zero object ⊥ 0 but does not degenerate: this means that it cannot be a CCC. In what follows, we will demonstrate this fact by demonstrating that it has no exponentiation.

Proposition 32.

DB is not a CCC.

Proof.

Let C B be the exponent object of the hom-set DB ( C , B ) , which as a set of the morphisms between C and D , cannot be an object of DB (differently from Set category). Hence, we have to construct this object C B ∈ DB (to “internalize” the hom-set DB ( C , B ) ). For any two simple objects B \= α ∗ ( B ) and C \= α ∗ ( C ) , the set of all arrows { f 1 , f 2 , … } : B → C where each simple arrow is f i \= α ∗ ( M B C ( i ) ) , can be represented by a unique arrow g \= ( ⋃ f i ∈ DB ( B , C ) f i ) : B → C (note that g is a unique ptp arrow of the complex arrow ⌈ f 1 , f 2 , … ⌋ : B → C representing the set of all arrows from B into C ), so we define the object C B to be the information flux (from Definition 67 , Section A.3.5 in the Appendix) of this arrow g \= α ∗ ( ⋃ { M B C ( i ) \= MakeOperads ( M B C ( i ) ) ∣ M B C ( i ) : B → C } ) \= ⋃ M B C ( i ) : B → C α ∗ ( M B C ( i ) ) \= ⋃ f i ∈ DB ( B , C ) f i . From point 2 of Definition 67 ,

Δ ( α , ⋃ M B C ( i ) : B → C M B C ( i ) ) \= ⋃ M B C ( i ) : B → C Δ ( α , M B C ( i ) ) .

Consequently,

g ˜ \= Flux ( α ⋃ M B C ( i ) : B → C M B C ( i ) ) \= T ( Δ ( α , ⋃ M B C ( i ) : B → C M B C ( i ) ) ) \= T ( ⋃ M B C ( i ) : B → C Δ ( α , M B C ( i ) ) ) \= T ( ⋃ M B C ( i ) : B → C T ( Δ ( α , M B C ( i ) ) ) ) \= T ( ⋃ M B C ( i ) : B → C Flux ( α , M B C ( i ) ) ) \= T ( ⋃ f i ∈ DB ( B , C ) f i ˜ ) \= ⊕ { f i ˜ ∣ f i ∈ DB ( B , C ) } .

Thus, we define the hom-object C B ≜ ⊕ { f i ˜ ∣ f i ∈ DB ( B , C ) } , which “internalizes” the hom-sets (i. e., the merging of all closed objects obtained from a hom-set of arrows from B to C ), i. e., the merging of all compact elements A such that A ⪯ B ⊗ C .

Hence, we obtain that C B \= T ( ⋃ { f i ˜ ∣ f i ∈ DB ( B , C ) } ) \= (from Proposition 24) \= T ( ⋃ { f i ˜ ∣ f i ˜ ⊆ B ⊗ C } ) \= T ( ⋃ { f i ˜ ∣ f i ˜ ⪯ B ⊗ C } ) \= (from algebraic lattice property, Section 7.4.4 ) \= T ( B ⊗ C ) \= B ⊗ C .

To have a Cartesian closed DB category (from Theorem 15 in Section 7.3.1 , ×≡⨄), for any complex arrow f \= [ f 1 , f 2 ] : A ⨄ B ⟶ C in DB , we must have the exponential diagram commutativity, i. e., f \= eval B , C ∘ ( Λ ( f ) ⨄ id B ) , where Λ ( f ) : A ⟶ C B is a simple derived morphism by “abstraction” Λ and the complex arrow eval B , C \= [ e 1 , e 2 ] : C B × B ⟶ C is a universal “application” morphism. Thus, from the commutativity in DB of such an exponential diagram, we obtain f 2 \= e 2 : B → C and f 1 \= e 1 ∘ Λ ( f ) : A → C , thus f 1 ˜ \= e 1 ˜ ⋂ Λ ( f ) ˜ .

However, f 1 ˜ ⊆ T A ⋂ T C while e 1 ˜ ⋂ Λ ( f ) ˜ ⊆ ( T A ⋂ T C ) ⋂ T B , so that there are the morphisms f 1 for which f 1 ˜ ⊂ e 1 ˜ ⋂ Λ ( f ) ˜ , and hence, the exponential diagram is not commutative. That is, DB has no exponentiation, and hence, is not a CCC.  □

Remark.

From the point 1 of Proposition 26 and the proof of this proposition, the “exponential” object C B , which “internalizes” in DB the hom-set of its morphisms DB ( B , C ) is equal to the information flux of the principal morphism from B into C .  □

Thus, from the fact that DB is not a CCC, we deduce that it is not a standard topos. But it still can be a kind of a weak topos [ 5 ], if we substitute the exponentiation with a kind of weak exponentiation (by replacing a (strong) product with a kind of (weak) tensorial product) and define a proper subobject classifier in DB .

7.3.3   Kleisli semantics for database mappings

We used monads to provide the denotational semantics to database mappings : in order to interpret database mappings (i. e., morphisms) in the category DB , we distinguish the object A (a database instance of type (or schema) A ) from the object T A of observations (i. e., the computations of type A without side-effects), and take as a denotation of (view) mappings the elements of T A (which are the views of (type) A ). In particular, we identify the A with the object of values (of type A ), and hence, we obtain the object of observations by applying the unary type-constructor T (power-view operator introduced in Section 7.1.2 ) to A .

We recall that a monad ( T , η , μ ) (from Proposition 27 in Section 7.1.2 , the endofunctor T : DB → DB is a monad), given by commutative diagrams,

defines an adjunction ( F T , G T , η T , ϵ T ) : DB ⟶ C T alg such that G T ∘ F T \= T : DB ⟶ DB , η T \= η , ϵ T \= η OP and μ \= G T ϵ T F T . The functors F T : DB → C T alg (into the Eilenberg–Moore category of monadic T-algebras, associated to the monad ( T , η , μ ) ) and forgetful functor G T : C T alg → DB are defined as follows: for any object (database) A , F T ( A ) \= ( T A , μ A : T 2 A → T A ) , F T ( f ) \= T f while G T ( A , g : T A → A ) \= A and G T ( f ) \= f .

Let us consider the following properties for monadic algebras/coalgebras in DB (introduced by Definition 45 and 46 in Section 7.1.2 ).

Proposition 33.

The following properties for the monad ( T , η , μ ) and the comonad ( T , η C , μ C ) hold:

  • The Eilenberg–Moore categories C T alg and C T coalg of the monad T : DB ⟶ DB (from Proposition 27 ) are isomorphic ( C T coalg \= C T alg OP ), complete and cocomplete. The object ( ⊥ 0 , id ⊥ 0 : ⊥ 0 ⟶ ⊥ 0 ) is an initial T-algebra in C T alg and a terminal T-coalgebra in C T coalg .

  • For each object A in DB category there exist the unique monadic T-algebra ( A , η A C : T A ⟶ A ) and the unique comonadic T-coalgebra ( A , η A : A ⟶ T A ) with η A C \= η A OP (i. e., η A C \= is A − 1 ≈ η A \= is A ≈ id A ).

  • The free monadic T-algebra ( T A , μ A : T 2 A ⟶ T A ) is dual (and equal) to the cofree monadic T-coalgebra ( T A , μ A C : T A ⟶ T 2 A ) with μ A C \= μ A OP (i. e., μ A C \= μ A \= id T A ).

Proof.

Let us define the functor F : C T alg ⟶ C T coalg , such that for any T-algebra ( A , h : T A ⟶ A ) we obtain the dual T-coalgebra F 0 ( A , h ) \= ( A , h OP : A ⟶ T A ) , where the component F 1 for the arrows is an identity function; and the functor F : C T coalg ⟶ C T alg , such that for any T-coalgebra ( A , k : A ⟶ T A ) we obtain the dual T-algebra G 0 ( A , k ) \= ( A , k OP : T A ⟶ A ) , where the component G 1 for the arrows is an identity function. Hence, F G \= I T coalg and G F \= I T alg . The categories C T alg and C T coalg are complete and cocomplete as DB category ( C T coalg \= C T alg OP ). The rest is easy to verify (by Proposition 27 and Corollary 20 in Section 7.1.2 ): each monadic T-algebra/coalgebra is an isomorphism. The free monadic T-algebra and the cofree monadic T-coalgebra are equal because T A \= T 2 A ; thus, μ A , μ A C are identity arrows (from duality property of DB ).  □

As we can see, each monadic T-coalgebra is an equivalent inverted arrow in DB of some monadic T-algebra and vice versa: the fundamental duality property of DB introduces the equivalence of monadic T-algebras and monadic T-coalgebras, and hence, the equivalence of the dichotomy “ construction versus observation ” or duality between induction and coinduction principles [ 57 ].

The basic idea behind the semantic of programs [ 95 ] is that a program denotes a morphism from A (the object of values of type A ) to T B (the object of computations of type B ), according to the view of “programs as functions from values to computations,” so that the natural category for interpreting programs (in our case, a particular equivalent “computation” database mappings of the form f 1 ≜ η B ∘ f : A ⟶ T B , derived from a database mapping f : A ⟶ B , such that f 1 ≈ f ) is not DB category, but the Kleisli category DB T .

Definition 50.

Given a monad ( T , η , μ ) over a category C , we have [ 12 ]:

  • A Kleisli triple is a triple ( T , η , − ∗ ) , where for f : A ⟶ T B we have f ∗ : T A ⟶ T B such that the following equations hold: η A ∗ \= id T A , f ∗ ∘ η A \= f and g ∗ ∘ f ∗ \= ( g ∗ ∘ f ) ∗ , for f : A ⟶ T B and g : B ⟶ T C .

    A Kleisli triple satisfies the mono requirement provided η A is monic for each object A.

  • A Kleisli category C T has the same objects as C category. For any two objects A and B , there is the bijection between arrows θ : C ( A , T B ) ≅ C T ( A , B ) . For any two arrows f : A ⟶ B and g : B ⟶ C in C T , their composition is defined by g ∘ f ≜ θ ( μ C ∘ T θ − 1 ( g ) ∘ θ − 1 ( f ) ) .

The mono requirement for the monad ( T , η , μ ) [ 94 ] is satisfied because, by Proposition 27 in Section 7.1.2 , for each object A the arrow η A : A ⟶ T A is an isomorphism η A \= is A (we denote its inverse by η A − 1 ), and hence, it is also monic. Consequently, the category DB is a computational model for the view-mappings (which are the programs) based on observations (i. e., views) with the typed operator T , so that

  • T A is a type of computations (i. e., observations of the object of values A (of a type A ), which are the views of the database A ).

  • η A is the inclusion of values into computations (i. e., inclusion of elements of the database A into the set of views of the database A ). It is an isomorphism η A \= is A : A ⟶ T A in the DB category.

  • f ∗ is the equivalent extension of a database mapping f : A ⟶ T B “from values to computations” (programs correspond to call-by-value parameter passing) to a mapping “from computations to computations” (programs correspond to call-by-name) such that f ∗ \= T f \= f ∘ η A − 1 \= f ∘ is A − 1 and, consequently, f ∗ ≈ f . Thus, in the DB category, the call-by-value ( f : A ⟶ T B ) and call-by-name ( f ∗ : T A ⟶ T B ) paradigms of programs are represented by equivalent morphisms, f ≈ f ∗ .

    Notice that in skeletal category DB sk (which is equivalent to DB ) all morphisms correspond to the call-by-name paradigm, because each arrow is a mapping from computations into computations (which are closed objects).

However, in our case, the Kleisli category is a perfect model only for a subset of database mappings in DB : exactly for every view-mapping (i. e., query) q A : A ⟶ T A , which is just an arrow in Kleisli category θ ( q A ) : A ⟶ A . For a general database mapping f : A ⟶ B in DB , only its (equivalent to f ) “computation extension” η B ∘ f : A ⟶ T B is an arrow θ ( η B ∘ f ) : A ⟶ B in the Kleisli category.

Consequently, the Kleisli category is a model for the database mappings up to the equivalence “≈.”

It means that, generally, the database mappings are not simply programs from values into computations. In fact, the semantics of a database mapping, between any two objects A and B , is equal to telling that for some set of computations (i. e., query-mappings) over A we have the same equivalent (in the sense that these programs produce the same computed value, i. e., a view) set of computations (i. e., query-mappings) over B : it is fundamentally an equivalence of computations.

This is a consequence of the fact that each database mapping (which is a set of functions ) from A into B is naturally bidirectional, i. e., a morphism f : A ⟶ B is equivalent to its inverted morphism f OP : B ⟶ A (explained by the duality property DB \= DB OP [ 61 ]).

Let us define this equivalence formally.

Definition 51.

Each simple database mapping h : A ⟶ B defines an equivalence of programs ( DB epimorphisms), h A ≜ τ ( J ( h ) ) : A ↠ T H and h B ≜ τ − 1 ( J ( h ) ) OP : B ↠ T H , where τ and τ − 1 are natural transformations of the categorial symmetry in Theorem 14 , and H is the kernel (in Definition 67 , Section A.3.5 ) of the information flux h ˜ (i. e., T H \= h ˜ ).

Hence, h A ≈ h ≈ h B , such that the computations of these two programs (i. e., arrows of Kleisli category DB T ) are equal, i. e., ∂ 1 ( h A ) \= ∂ 1 ( h B ) . We can also give an alternative model for the equivalent computational extensions of the database mappings in DB category.

Proposition 34.

Denotational semantics of each simple mapping f, between any two database instances A and B, is given by the unique equivalent “computation” arrow f 1 ≜ η B ∘ f in T coalg from the monadic T-coalgebra ( A , η A ) into the cofree monadic T-coalgebra ( T B , μ B C ) , f 1 : ( A , η A ) ⟶ ( T B , μ B C ) or, dually, by the unique equivalent arrow f 1 OP ≜ ( η B ∘ f ) OP \= f OP ∘ η B OP from the free monadic T-algebra ( T B , μ B ) into the monadic T-algebra ( A , η A OP ) .

Proof.

We have to show that for any morphism f : A → B between an object A \= ⨄ 1 ≤ j ≤ m A j , m ≥ 1 and B \= ⨄ 1 ≤ i ≤ k B i , k ≥ 1 , μ B C ∘ η B ∘ f \= T ( η B ∘ f ) ∘ η A is valid. In fact, by Proposition 33 , η B is the isomorphism is B : B → T B , so that T is B \= id T B : T B → T B , due to the fact that

T is B ⨄ \= { T is B i : T B i → T B i ∣ is B i ∈ is B ⨄ } (from T is B i ˜ \= id T B i ˜ \= T B i , T is B i \= id T B i ) \= { id T B i : T B i → T B i ∣ is B i ∈ is B ⨄ } \= { id T B i ∣ 1 ≤ i ≤ k } \= id T B ⨄ ,

and μ B C \= id T B . Consequently, μ B C ∘ η B ∘ f \= id T B ∘ is B ∘ f \= is B ∘ f , so that

μ B C ∘ η B ∘ f ˜ ≃ ⨄ is B ∘ f ⨄ ˜ \= ⨄ f j i ∈ f ⨄ is B i ∘ f j i ˜ \= ⨄ f j i ∈ f ⨄ is B i ˜ ⋂ f j i ˜ \= ⨄ f j i ∈ f ⨄ T B i ⋂ f j i ˜ \= ⨄ f j i ∈ f ⨄ f j i ˜ ≃ f ˜ .

Analogously, T ( η B ∘ f ) ∘ η A \= T η B ∘ T f ∘ is A \= id T B ∘ T f ∘ is A \= T f ∘ is A . Thus,

T ( η B ∘ f ) ∘ η A ˜ ≃ ⨄ T f ∘ is A ⨄ ˜ \= ⨄ f j i ∈ f ⨄ T f j i ∘ is A j ˜ \= ⨄ f j i ∈ f ⨄ T f j i ˜ ⋂ is A j ˜ \= ⨄ f j i ∈ f ⨄ T f j i ˜ ⋂ T A j \= ⨄ f j i ∈ f ⨄ T f j i ˜ ≃ T f ˜ ≃ f ˜ (by Theorem 11) .

Thus, μ B C ∘ η B ∘ f ˜ ≃ T ( η B ∘ f ) ∘ η A ˜ , so that μ B C ∘ η B ∘ f \= T ( η B ∘ f ) ∘ η A : A → T 2 B .  □

Note that each view-map (i. e., a query) q A : A ⟶ T A is equal to its denotational semantics arrow in T coalg , q A : ( A , η A ) ⟶ ( T A , μ A C ) .

It is well known that for a Kleisli category there exists an adjunction ( F T , G T , η T , ε T ) such that we obtain the same monad ( T , η , μ ) , such that T \= G T F T , μ \= G T ε T F T , η \= η T (for any arrow h ∈ DB T ( A , B ) , G T 0 ( A ) \= T A , G T 1 ( h ) \= μ B ∘ T θ − 1 ( h ) , and for any arrow f ∈ DB ( A , B ) , F T 0 ( A ) \= A , F T 1 ( f ) \= η B ∘ f ). Let us see now how the Kleisli category DB T is “internalized” into the DB category.

Theorem 16. The Kleisli category DB T of the monad ( T , η , μ ) is isomorphic to DB category. That is, it may be “internalized” in DB by the faithful forgetful functor K \= ( K 0 , K 1 ) : DB T ⟶ DB such that K 0 is an identity function and K 1 ≜ ϕ θ − 1 , where for any two objects A and B, we have the following bijections of the hom-sets:

  • θ : DB ( A , T B ) ≅ DB T ( A , B ) is a Kleisli bijection and

  • ϕ : DB ( A , T B ) ≅ DB ( A , B ) such that ϕ ( _ ) \= η cod ( _ ) OP ∘ ( _ ) is a DB category bijection, respectively.

We can generalize a “representation” for the DB category (instead of Set category): A “representation” of functor K is a pair ( Υ , φ ) , where Υ is the total object and φ : DB T ( Υ , _ ) ≃ K is a natural isomorphism. The functor DB T ( Υ , _ ) : DB T ⟶ DB defines the “internalized” hom-sets in DB T , i. e., DB T 0 ( Υ , B ) ≜ T B Υ and DB T 1 ( Υ , f T ) ≜ id Υ ⊗ T θ − 1 ( f T ) .

Proof.

Let us show that ϕ is really a bijection in DB . For any program morphism f : A ⟶ T B , we obtain ϕ ( f ) \= η B OP ∘ f : A ⟶ B and, vice versa, for any g : A ⟶ B its inverse ϕ − 1 ( g ) ≜ η B ∘ g ; thus, ϕ ϕ − 1 ( g ) \= ϕ ( η B ∘ g ) \= η B OP ∘ ( η B ∘ g ) \= ( η B OP ∘ η B ) ∘ g \= id B ∘ g \= g (because η B is an isomorphism), and hence, ϕ ϕ − 1 is an identity function. Analogously, ϕ − 1 ϕ ( f ) \= ϕ − 1 ( η B OP ∘ f ) \= η B ∘ ( η B OP ∘ f ) \= ( η B ∘ η B OP ) ∘ f \= id T B ∘ f \= f , i. e., ϕ − 1 ϕ is an identity function, and hence, ϕ is a bijection. Let us demonstrate that K is a functor.

For any identity arrow id T \= θ ( η A ) : A ⟶ A in DB T , we obtain K 1 ( id T ) \= ϕ θ − 1 ( θ ( η A ) ) \= ϕ ( η A ) \= η A OP ∘ η A \= id A (because η A is an isomorphism). For any two arrows g T : B ⟶ C and f T : A ⟶ B in Kleisli category, we obtain

K 1 ( g T ∘ f T ) \= K 1 ( θ ( μ C ∘ T θ − 1 ( g T ) ∘ θ − 1 ( f T ) ) ) (from Definition 50 of the Kleisli category) ;

we introduce

g ≜ θ − 1 ( g T ) : B ⟶ T C and f ≜ θ − 1 ( f T ) : A ⟶ T B \= ϕ θ − 1 ( θ ( μ C ∘ T g ∘ f ) ) \= ϕ θ − 1 ( θ ( id T C ∘ T g ∘ f ) ) \= ϕ θ − 1 ( θ ( T g ∘ f ) ) ( it is easy to verify in DB that T g \= g ∘ η B OP , from T g ˜ ≃ g ˜ ≃ ⨄ g ∘ η B OP ⨄ ˜ ) \= ϕ ( g ∘ η B OP ∘ f ) \= η C OP ∘ g ∘ η B OP ∘ f \= ϕ ( g ) ∘ ϕ ( f ) \= ϕ θ − 1 ( θ ( g ) ) ∘ ϕ θ − 1 ( θ ( f ) ) \= K 1 ( θ θ − 1 ( g T ) ) ∘ K 1 ( θ θ − 1 ( f T ) ) \= K 1 ( g T ) ∘ K 1 ( f T ) .

Thus, each arrow f T : A ⟶ B in DB T is “internalized” in DB by its representation f ≜ K 1 ( f T ) \= ϕ θ − 1 ( f T ) \= η B OP ∘ θ − 1 ( f T ) : A ⟶ B , where θ − 1 ( f T ) : A ⟶ T B is a program equivalent to the database mapping f : A ⟶ B , i. e., θ − 1 ( f T ) ≈ f .

The functor K is faithful. In fact, for any two arrows f T , h T : A ⟶ B in DB T , K 1 ( f T ) \= K 1 ( h T ) implies f T \= h T . Indeed, from K 1 ( f T ) \= K 1 ( h T ) we obtain ϕ θ − 1 ( f T ) \= ϕ θ − 1 ( h T ) , and if we apply a bijection ϕ θ − 1 , we obtain ϕ θ − 1 ϕ θ − 1 ( f T ) \= ϕ θ − 1 ϕ θ − 1 ( h T ) , i. e., θ θ − 1 ( f T ) \= θ θ − 1 ( h T ) , i. e., f T \= h T (the compositions θ θ − 1 and ϕ ϕ − 1 are the identity functions).

Let us show that K is an isomorphism: from the adjunction ( F T , G T , η T , ε T ) : DB ⟶ DB T , where F T 0 is identity, F T 1 ≜ θ ϕ − 1 , we obtain that F T ∘ K \= I D B ⊤ and K ∘ F T \= I DB . Thus, the functor K is an isomorphism of DB and Kleisli category DB T .

Notice that from Theorem 18 in Section 7.4.1 , DB T 0 ( Υ , A ) ≜ T A Υ \= A Υ \= T A and DB T 1 ( Υ , f T ) ≜ id Υ ⊗ T θ − 1 ( f T ) \= T θ − 1 ( f T ) .

Thus, K 0 ( A ) \= A ≃ T A \= DB T 0 ( Υ , A ) , and for f T : A → B , K 1 ( f T ) \= ϕ θ − 1 ( f T ) \= η OP ∘ θ − 1 ( f T ) : A → B , and from the fact that T g ≈ is cod ( g ) − 1 ∘ g \= η cod ( g ) OP ∘ g for any arrow g in DB , we obtain K 1 ( f T ) ≈ DB T 1 ( Υ , f T ) . Consequently, we obtain the natural isomorphism φ : DB T ( Υ , _ ) ≃ K .  □

Remark.

It is easy to verify that a natural isomorphism ․ η : I DB ․ T of the monad ( T , η , μ ) is equal to the natural transformation ․ η : K ․ G T (by considering that G T : DB T ⟶ DB is defined by G T 0 \= T 0 and for any f T : A ⟶ B in DB T , G T 1 ( f T ) ≜ μ B ∘ T θ − 1 ( f T ) : T A ⟶ T B ).

Hence, the functor F T has two different adjunctions: the universal adjunction ( F T , G T , η T , μ T ) , which defines the same monad ( T , η , μ ) , and this particular (for the DB category only) isomorphism’s adjunction ( F T , K , η I , μ I ) , which defines the trivial identity monad.  □

We are now ready to define the semantics of queries in DB category and the categorial definition of query equivalence . This is important in the context of the database integration/exchange and for the theory of query-rewriting [ 100 ].

When we define a mapping (i. e., an arrow or morphism) f : A ⟶ B between two simple databases A and B , we define implicitly the information flux f ˜ , i. e., the set of views of A transferred by this mapping into B . Thus, in the context of the query rewriting, we consider only the queries (i. e., view maps) whose resulting view (i. e., an observation) belongs to the information flux of this mapping. Consequently, given any two queries, q A i : A ⟶ T A and q B j : B ⟶ T B , they have to satisfy (w. r. t. query rewriting constraints) the condition ∂ 1 ( q A i ) ∈ f ˜ (the ∂ 1 ( q A i ) is a singleton containing the resulting view of this query) and ∂ 1 ( q B j ) ∈ f ˜ . So, a well-rewritten query over B , q B j : B ⟶ T B , such that it is equivalent to the original query, i. e., q B j ≈ q A i , has to satisfy the condition ∂ 1 ( q B j ) \= ∂ 1 ( q A i ) ∈ f ˜ . Now we can provide the denotational semantics for a query-rewriting in a data integration/exchange environment.

Proposition 35.

Each database query is a (nonmonadic) T-coalgebra. Any homomorphism between two T-coalgebras f : ( A , q A i ) ⟶ ( B , q B j ) , where A and B are two simple objects (databases) in DB , defines the semantics for the relevant query rewriting, when ∂ 1 ( q A i ) ∈ f ˜ .

Proof.

Let us consider the following commutative diagram, where vertical arrows are the T-coalgebras:

The homomorphism between two (nonmonadic) T-coalgebras f : ( A , q A i ) ⟶ ( B , q B j ) means that the commutativity q B j ∘ f \= T f ∘ q A i : A ⟶ T B is valid and, from the duality property, we obtain q B i \= T f ∘ q A i ∘ f OP . Consequently, for a given mapping f : A → B between databases A and B , every query q A i such that ∂ 1 ( q A i ) ∈ f ˜ (i. e., q A i ˜ ⊆ f ˜ ), we have an equivalent rewritten query q B i over a database B . In fact, q B i ˜ \= T f ˜ ⋂ q A i ˜ ⋂ f OP ˜ \= q A i ˜ because of the fact that q A i ˜ ⊆ f ˜ and f OP ˜ \= T f ˜ \= f ˜ . Consequently, we obtain the equivalence of these two queries q B j ≈ q A i .  □

7.4   Partial ordering for databases

Let us consider the “observational” Partial Order (PO) relation introduced in point 3 of Definition 40 in Section 7.1 , its extension to morphisms and a 2-category property of DB .

Theorem 17. PO subcategory DB I ⊆ DB is defined by Ob D B I \= Ob DB and Mor D B I is a union of all isomorphisms and initial arrows ⟨ ⊥ 1 , … , ⊥ 1 ︷ m ⟩ : ⊥ 0 ↪ ⨄ 1 ≤ j ≤ m A j and S I \= { in : A ↪ B ∣ for two strictly-complex objects A \= ⨄ 1 ≤ j ≤ m A j ⪯ B \= ⨄ 1 ≤ i ≤ k B i with a mapping (from Definition 40 ) σ : { 1 , … , m } → { 1 , … , k } and i n ⨄ \= { in j σ ( j ) : A j ↪ B σ ( j ) ∣ j \= 1 , … , m } } . This ordering can be extended by categorial symmetry property to morphisms as well:

f ⪯ g iff f ˜ ⪯ g ˜

The power-view endofunctor T : DB ⟶ DB is a 2-endofunctor and a closure operator. DB is a 2-category and 1-cells are its ordinary morphisms, while 2-cells (denoted by _ ) are the arrows between ordinary morphisms: for any two morphisms f , g : A ⟶ B such that f ⪯ g , a 2-cell arrow is the ‘inclusion” β : f ⪯ g . Such a 2-cell arrow is represented by an ordinary monomorphism in DB , β : f ˜ ↪ g ˜ , with β \= T e 1 ( f ep OP ∘ f ep ; f i n ∘ f i n OP ) , where f ep \= τ ( J ( f ) ) : A ↠ f ˜ is an epimorphism, and the arrow f i n \= τ − 1 ( J ( f ) ) : f ˜ ↪ B is a monomorphism.

Proof.

DB I is well-defined: for any object A we have that its identity arrow id A : A → A is a monomorphism (we have A ⪯ A with σ identity function, and i n \= id A ), thus an arrow in DB I . Each isomorphism is a monomorphism as well, and any initial arrow is monic as well, so that all arrows and their compositions in DB I are monic arrows. For each isomorphism A ≃ B represented by arrow is : A → B in DB I , we define σ : { 1 , … , m } → { 1 , … , k } such that σ ( j ) \= i if ( is j i : A j → B i ) ∈ is ⨄ \= ⊥ 0 ; 1 otherwise (when A j \= ⊥ 0 ). Thus for each j \= 1 , … , m , T A j ⊆ T B σ ( j ) , hence A ⪯ B .

For each initial arrow ⟨ ⊥ 1 , … , ⊥ 1 ︷ m ⟩ : ⊥ 0 ↪ ⨄ 1 ≤ j ≤ m A j and any σ : { 1 } → { 1 , … , m } , T ⊥ 0 \= ⊥ 0 ⊆ T A σ ( 1 ) ; thus; it represents the PO relation ⊥ 0 ⪯ A . Any monomorphism in S I represents a PO relation A ⪯ B between two strictly-complex objects. Each composed arrow by the monic arrows above is composition of PO relations of each of its components, and hence, a PO relation as well. Consequently, each arrow f in DB I represents the PO relation dom ( f ) ⪯ cod ( f ) .

Let us show that each PO relation A ⪯ B is represented by a monomorphism in DB I as well: if A ≃ ⊥ 0 , then it is represented by a composition of the isomorphism (monic as well) is : A → ⊥ 0 and initial arrow from ⊥ 0 into B , which is monic as well. Otherwise A ⪯ B is generally representable as A ≃ A S ⪯ B S ≃ B where A S is a strictly-complex object obtained by eliminating all objects ⊥ 0 from A (analogously for B S ). Thus, A ⪯ B is represented in DB I as composition of these two isomorphisms (that are also monic) and a monomorphism in S I between two strictly-complex objects (the composition of monic arrows is monic as well).

Consequently, between any two given objects in DB I there can exist at most one arrow, so this is a PO category. Power-view operator T satisfies the following:

(1)

T A \= T ( T A ) , as explained in the introduction, Section A.3.2 .

(2)

A ⊆ B implies T A ⊆ T B : T is a monotonic operator w. r. t. ⊆ (the free SPRJU algebra of terms L A is monotonic with respect to its carrier set A ; see Section A.3.2 ).

(3)

A ⊆ T A , each element of A is also a view of A .

Thus, T is a closure operator and an object A such that A \= T A is a closed object.

For any two simple morphisms f , g : A → B such that f ˜ ⊆ g ˜ , it is easy to show that there is the monomorphism β \= T e 1 ( f ep OP ∘ f ep ; f i n ∘ f i n OP ) : f ˜ ↪ g ˜ . In fact, for h 1 \= f ep OP ∘ f ep : A → A with h 1 ˜ \= f ep OP ˜ ⋂ f ep ˜ \= f ˜ ⋂ f ˜ \= f ˜ and h 2 \= f i n ∘ f i n OP : B → B with h 2 ˜ \= f i n ˜ ⋂ f i n OP ˜ f ˜ ⋂ f ˜ \= f ˜ , we obtain that h 2 ∘ f ˜ \= f ˜ ⋂ f ˜ \= f ˜ and g ∘ h 1 ˜ \= g ˜ ⋂ f ˜ \= f ˜ (for f ˜ ⊆ g ˜ ), so that h 2 ∘ f \= g ∘ h 1 and, consequently, the morphism T e 1 ( h 1 ; h 2 ) \= T e 1 ( f ep OP ∘ f ep ; f i n ∘ f i n OP ) : f ˜ → g ˜ is well-defined. Thus, β \= T e 1 ( f ep OP ∘ f ep ; f i n ∘ f i n OP ) \= in g ˜ OP ∘ T ( f i n ∘ f i n OP ∘ f ) ∘ in f ˜ , so that (from T f i n OP ˜ \= T f i n ˜ \= T f ˜ \= f ˜ ), β ˜ \= in g ˜ OP ˜ ⋂ T f i n ˜ ⋂ T f i n OP ˜ ⋂ T f ˜ ⋂ in f ˜ ˜ \= g ˜ ⋂ f ˜ \= f ˜ , so that β \= T e 1 ( f ep OP ∘ f ep ; f i n ∘ f i n OP ) is a monomorphism (from Corollary 17 ).

It is easy to verify that DB is a 2-category with 0-cells (its objects), 1-cells (its ordinary morphisms) and 2-cells (“inclusions” arrows between mappings). The horizontal and vertical composition of 2-cells is just the composition of PO relations. Given f , g , h : A ⟶ B with 2-cells β : f ⪯ g , δ : g ⪯ h , their vertical composition is γ \= δ ∘ β : f ⪯ h . Given f , g : A ⟶ B and h , l : B ⟶ C with 2-cells β : f ⪯ g , δ : h ⪯ l , for a given composition functor ∙ : DB ( A , B ) × DB ( B , C ) ⟶ DB ( A , C ) , their horizontal composition is γ \= δ ∙ β : h ∘ f ⪯ l ∘ g .  □

For example, the equivalence q A i ≈ q B j (i. e., q A i ⪯ q B j and q B j ⪯ q A i ) of two view mappings q A i : A ⟶ T A and q B j : B ⟶ T B , for the simple databases A and B , is obtained when they produce the same view.

Remark.

Note the analogy of the 2-category DB and the much more simple 2-category Z of finite labeled trees, specified by Definition 31 and Proposition 15 in Section 6.3 . A morphism in DB is generally a set of trees (see Figure 7.2 in Section 7.1 ) while in Z a morphism is a single tree: so, from this point of view, the DB category generalizes (the arcs of trees of a morphism in DB are functions and not simple labels as in Z ) the more simple category Z .  □

The categorial symmetry operator T e 0 J : Mor DB ⟶ Ob DB for any morphism f in DB produces its information flux f ˜ (i. e., the “conceptualized” database of this mapping). Consequently, we can define a “mapping between mappings” (which are 2-cells “inclusions”) and also all higher n -cells [ 101 ], with their direct representation by a 1-cell morphisms.

Example 28.

Let us consider the two ordinary simple morphisms (1-cells) in DB , f : A ⟶ B and g : C ⟶ D such that f ˜ ⊆ g ˜ (thus, f ⪯ g ) and g ˜ ⊆ T C ⋂ T D . We want to show that the 1-cells corresponding monomorphism β : f ˜ ↪ g ˜ is a result of the symmetric closure functor T e . We define two arrows h 1 \= is C − 1 ∘ in C ∘ τ ( J ( f ) ) and h 2 \= is D − 1 ∘ in D ∘ ( τ J ( f ) − 1 ) OP (where in C : f ˜ ↪ T C is a monomorphism, well-defined in Proposition 24 because f ˜ ⊆ g ˜ ⊆ T C , is C − 1 : T C ⟶ C is an isomorphism and in D : f ˜ ↪ T D is a monomorphism from Proposition 24 and f ˜ ⊆ g ˜ ⊆ T D , and is D − 1 : T D ⟶ D is an isomorphism). Hence, h 1 ˜ \= is C − 1 ˜ ⋂ in C ˜ ⋂ τ ( J ( f ) ) ˜ \= T C ⋂ T f ˜ ⋂ f ˜ \= f ˜ (because T C ⊇ g ˜ ⊇ f ˜ and T f ˜ \= f ˜ ) and, analogously, h 2 ˜ \= is D − 1 ˜ ⋂ in D ˜ ⋂ ( τ J ( f ) − 1 ) OP ˜ \= T D ⋂ T f ˜ ⋂ f ˜ \= f ˜ (because T D ⊇ g ˜ ⊇ f ˜ and T f ˜ \= f ˜ ). Thus, g ∘ h 1 ˜ \= h 2 ∘ f ˜ \= f ˜ , and hence, g ∘ h 1 \= h 2 ∘ f .

Thus, there exists the arrow β \= T e ( h 1 ; h 2 ) : J ( f ) ⟶ J ( g ) in DB ↓ DB , and the following commutative diagram in DB :

Let us show that also T e ( h 1 ; h 2 ) is a monomorphism with β \= T e ( h 1 ; h 2 ) : f ˜ ↪ g ˜ . In fact, h 2 ˜ \= f ˜ and, by definition in Theorem 14 , T e ( h 1 ; h 2 ) ≜ in g ˜ OP ∘ T ( h 2 ∘ f ) ∘ in f ˜ . Thus, T e ( h 1 ; h 2 ) ˜ \= in g ˜ OP ˜ ⋂ T h 2 ˜ ⋂ T f ˜ ⋂ in f ˜ \= g ˜ ⋂ f ˜ \= f ˜ and, consequently, T e ( h 1 ; h 2 ) is a monomorphism (from Corollary 17 ). In the particular case of Theorem 17 when A \= C and B \= D and is C − 1 ∘ in C \= ( τ J ( f ) ) OP \= f ep OP and is D − 1 ∘ in D \= τ J ( f ) − 1 \= f i n , we obtain that the 2-cell’s arrow β : f ⪯ g is represented by the 1-cell monomorphism β \= T e 1 ( f ep OP ∘ f ep ; f i n ∘ f i n OP ) : f ˜ ↪ g ˜ .

Let us define the full subcategory of DB composed of only simple objects.

Definition 52.

The full subcategory of DB composed of only simple objects will be denoted as DB _ , with the power-view endofunctor equal to the restriction of T to simple objects and arrows only.

The bottom object in DB _ is that of DB , equal to ⊥ 0 (zero object), while the top object is equal to Υ _ \= ⋃ A ∈ Ob DB _ A ⊂ Υ \= ⋃ A ∈ Ob DB A .

The exact relationship between Υ _ and the top complex object Υ is given by

Υ \= Υ _ ⋃ ( ⨄ ω Υ _ ) \= Υ _ ⋃ ( Υ _ ⨄ Υ _ ⨄ ⋯ ︷ ω ) .

Let us show that the objects Υ and ⊥ 0 are the top and bottom objects in DB w. r. t. the PO relation ⪯.

Proposition 36.

For any object A ∈ Ob DB (for A \= Υ as well), the following is valid:

1.

A ⊗ Υ ⪯ Υ and A ⨄ Υ ⪯ Υ .

2.

Υ and ⊥ 0 are the top and bottom objects, respectively, (up to isomorphism) in DB .

Proof.

1. From Definition 40 , we have

A ⊗ Υ \= ⨄ 1 ≤ j ≤ m & i \= 1 , 2 , … T A j ⋂ Υ i \= ⨄ 1 ≤ j ≤ m & i \= 1 , 2 , … T A j ⋂ Υ _ \= ⨄ 1 ≤ j ≤ m & i \= 1 , 2 , … T A j \= ( T A 1 ⨄ ⋯ ⨄ T A m ) ⨄ ( T A 1 ⨄ ⋯ ⨄ T A m ) ⨄ ⋯

Thus, we have an identity mapping σ : { 1 , 2 , … } → { 1 , 2 , … } such that T ( A ⊗ Υ ) j ∈ { A 1 , … , A m } and T Υ σ ( j ) \= T Υ _ so that T ( A ⊗ Υ ) j ⊆ T Υ σ ( j ) for all j ≥ 1 , and hence, A ⊗ Υ ⪯ Υ .

Hence, A ⨄ Υ \= A 1 ⨄ ⋯ ⨄ A m ⨄ Υ and for the identity mapping σ : { 1 , 2 , … } → { 1 , 2 , … } , for 1 ≤ j ≤ m , T ( A ⨄ Υ ) j \= T A j ⊆ T Υ σ ( j ) \= T Υ _ , and for j > m , T ( A ⨄ Υ ) j \= T Υ _ ⊆ T Υ σ ( j ) \= T Υ _ . Thus, A ⨄ Υ ⪯ Υ .

2. For any object A in DB , T A ⊆ ⋃ B ∈ Ob DB B \= Υ \= T Υ . Thus, A ⪯ Υ and T A ⪯ Υ , i. e., the closed object Υ is a top object. Notice that from point 2 of Proposition 24 there exist a monomorphism in T A : T A ↪ Υ , and in T A ∘ is A : A ↪ Υ is a composition of two monomorphisms ( is A : A → T A is an isomorphism, thus the monic arrow as well), and hence, a monomorphism as well.

From the fact that ⊥ ∈ A for any object A in DB and the fact that ⊥ 0 \= { ⊥ } , ⊥ 0 ⊆ A , so that ⊥ 0 ⪯ A , we obtain that ⊥ 0 is a bottom object.  □

7.4.1   Matching tensor product

Since the data residing in different databases may have interdependencies (they are based on the partial overlapping between databases, which is information about a common part of the world), we can define such an (partial) overlapping by morphisms of the category DB : information flux of each mapping between two objects A and B in DB is just a subset of this overlapping between these two databases, denoted by A ⊗ B . It is “bidirectional,” i. e., (by duality) for any mapping f from A into B there exists an equivalent mapping f OP from B into A .

This overlapping represents the common matching between these two databases, and is equal to the maximal information flux, which can be defined between these two databases. Consequently, we can formally introduce a denotational semantics for the database matching operation ⊗ as follows.

Theorem 18. DB is a strictly symmetric idempotent monoidal category ( DB , ⊗ , Υ , α , β , γ ) , where Υ is the total object for a given universe of databases, with the “matching” tensor product ⊗ : DB × DB ⟶ DB defined as follows:

1.

Υ ⊗ A \= A ⊗ Υ ≜ T A ;

Otherwise, for any two database instances (objects) A \= ⨄ 1 ≤ j ≤ m A j and B \= ⨄ 1 ≤ i ≤ k B i , where all A j and B i are simple objects, with k , m ≥ 1 , the object A ⊗ B ≡ ⊗ ( A , B ) is the overlapping (matching) between A and B, introduced by Definition 40 :

A ⊗ B ≜ T A ⋂ T B , if m \= k \= 1 , A \= A 1 , B \= B 1 ; ⨄ 1 ≤ i ≤ k & 1 ≤ j ≤ m ( A j ⊗ B i ) , otherwise.

2.

id Υ ⊗ f \= f ⊗ id Υ ≜ T f ;

Otherwise, for any two arrows f : A → C and g : B → D , the f ⊗ g ≡ ⊗ ( f , g ) : A ⊗ B → C ⊗ D is defined by canonical representation (Lemma 2 ) of the set of ptp arrows

f ⊗ g ⨄ ≜ { { id R : R → R ∣ R ∈ ( f ˜ ⋂ g ˜ ) ≠ ⊥ 0 } } , if f ⨄ \= { f } , g ⨄ \= { g } ; { h i j \= { id R ∣ R ∈ f i ˜ ⋂ g j ˜ } ≠ ⊥ 1 ∣ f i ∈ f ⨄ , g j ∈ g ⨄ } , otherwise,

such that for each point-to-point arrow h i j : T ( dom ( f i ) ) ⋂ T ( dom ( g j ) ) → T ( cod ( f i ) ) ⋂ T ( cod ( g j ) ) in f ⊗ g ⨄ , one has h i j ˜ \= f i ˜ ⋂ g j ˜ ≠ ⊥ 0 .

Proof.

Let us show that for any two simple arrows f : A → C and g : B → D in DB category, also the arrow f ⊗ g is a DB category arrow (i. e., it satisfies Theorem 10 ).

From the fact that f and g are the arrows in DB , it holds from Theorem 10 that there exist the schema mappings M A C : A → C , M B D : B → D , and an R-algebra α , such that f \= α ∗ ( MakeOperads ( M A C ) ) and g \= α ∗ ( MakeOperads ( M B D ) ) with A \= α ∗ ( A ) , B \= α ∗ ( B ) , C \= α ∗ ( C ) and D \= α ∗ ( D ) .

Hence, we can specify the α -intersection schema mapping (from Definition 70 ),

M A C ⋂ α M B D \= { Φ } : A ⋂ α B → C ⋂ α D , where Φ is a tgd ⋀ { ∀ x ( r ( x ) ⇒ r ( x ) ) ∣ r ∈ A ⋂ α B , α ( r ) ∈ Flux ( α , MakeOperads ( M A C ) ) ⋂ Flux ( α , MakeOperads ( M B D ) ) } .

Consequently, M \= MakeOperads ( M A C ⋂ α M B D ) \= { 1 r ∣ r ∈ A ⋂ α B , α ( r ) ∈ Flux ( α , MakeOperads ( M A C ) ) ⋂ Flux ( α , MakeOperads ( M B D ) ) } ⋃ { 1 r ∅ } \= { 1 r ∣ r ∈ A ⋂ α B , α ( r ) ∈ f ˜ ⋂ g ˜ } ⋃ { 1 r ∅ } is a sketch category arrow from the schema A ⋂ α B into the schema B ⋂ α D , with α ∗ ( A ⋂ α B ) \= T A ⋂ T B \= A ⊗ B , α ∗ ( C ⋂ α D ) \= T C ⋂ T D \= C ⊗ D , so that

α ∗ ( M ) \= { α ( 1 r ) \= id R : R → R ∣ r ∈ A ⋂ α B , R \= α ( r ) ∈ f ˜ ⋂ g ˜ } ⋃ { q ⊥ } \= f ⊗ g : A ⊗ B → C ⊗ D .

Let us show that for any four simple arrows f : A → C , f ′ : C → E , g : B → D and g ′ : B → F (from Definition 43 in Section 7.1 , f ⨄ \= { f } , and analogously for all other arrows), where all A , B , C , D , E and F are simple objects, ( f ′ ∘ f ) ⊗ ( g ′ ∘ g ) \= ( f ′ ⊗ g ′ ) ∘ ( f ⊗ g ) : A ⊗ B → E ⊗ F . Thus, ( f ′ ∘ f ) ⊗ ( g ′ ∘ g ) ˜ \= T ( f ′ ∘ f ˜ ) ⋂ T ( g ′ ∘ g ˜ ) \= T ( f ′ ˜ ⋂ f ˜ ) ⋂ T ( g ′ ˜ ⋂ g ˜ ) \= ( f ′ ˜ ⋂ f ˜ ) ⋂ ( g ′ ˜ ⋂ g ˜ ) \= ( f ′ ˜ ⋂ g ′ ˜ ) ⋂ ( f ˜ ⋂ g ˜ ) \= T ( f ′ ˜ ⋂ g ′ ˜ ) ⋂ T ( f ˜ ⋂ g ˜ ) \= f ′ ⊗ g ′ ˜ ⋂ f ⊗ g ˜ \= ( f ′ ⊗ g ′ ) ∘ ( f ⊗ g ) ˜ , so that from Definition 44 ,

(1)

( f ′ ∘ f ) ⊗ ( g ′ ∘ g ) \= ( f ′ ⊗ g ′ ) ∘ ( f ⊗ g ) .

Let us show that this property of composition is valid for complex morphisms f : A → C , f ′ : C → E , g : B → D and g ′ : B → F as well. Then

( f ′ ⊗ g ′ ) ∘ ( f ⊗ g ) ⨄ \= { ( f i ′ ⊗ g j ′ ) ∘ ( f i ⊗ g j ) ∣ f i ′ ⊗ g j ′ ∈ f ′ ⊗ g ′ ⨄ , f i ⊗ g j ∈ f ⊗ g ⨄ , cod ( f i ⊗ g j ) \= dom ( f i ′ ⊗ g j ′ ) } \= { ( f i ′ ⊗ g j ′ ) ∘ ( f i ⊗ g j ) ∣ f i ′ ⊗ g j ′ ∈ f ′ ⊗ g ′ ⨄ , f i ⊗ g j ∈ f ⊗ g ⨄ , cod ( f i ) \= dom ( f i ′ ) , cod ( g j ) \= dom ( g j ′ ) } \= { ( f i ′ ⊗ g j ′ ) ∘ ( f i ⊗ g j ) ∣ f i ′ ∘ f i ∈ f ′ ∘ f ⨄ , g j ′ ∘ g j ∈ g ′ ∘ g j ⨄ } \= ( from the fact that all f i ′ , f i , g j ′ , g j are simple arrows and (1) ) \= { ( f i ′ ∘ f i ) ⊗ ( g j ′ ∘ g j ) ∣ f i ′ ∘ f i ∈ f ′ ∘ f ⨄ , g j ′ ∘ g j ∈ g ′ ∘ g j ⨄ } \= { { id R ∣ R ∈ f i ′ ∘ f i ˜ ⋂ g j ′ ∘ g j ˜ } ∣ f i ′ ∘ f i ∈ f ′ ∘ f ⨄ , g j ′ ∘ g j ∈ g ′ ∘ g j ⨄ } \= (by Definition 43) \= ( f ′ ∘ f ) ⊗ ( g ′ ∘ g ) ⨄ .

Consequently, ( f ′ ∘ f ) ⊗ ( g ′ ∘ g ) \= ( f ′ ⊗ g ′ ) ∘ ( f ⊗ g ) , and hence, the compositional property for functor ⊗ is satisfied.

Let us show the functorial property for the identity arrows, and consider two objects A \= ⨄ 1 ≤ j ≤ m A j and B \= ⨄ 1 ≤ i ≤ k B i , with their identity arrows id A \= ⨄ 1 ≤ j ≤ m id A j and id B \= ⨄ 1 ≤ i ≤ k id B i , such that id A ˜ \= ⨄ 1 ≤ j ≤ m id A j ˜ \= ⨄ 1 ≤ j ≤ m T A j \= T A , id B ˜ \= ⨄ 1 ≤ i ≤ k id B i ˜ \= ⨄ 1 ≤ i ≤ k T B i \= T B , with id A ⨄ \= { id A 1 , … , id A m } and id B ⨄ \= { id B 1 , … , id B k } . Then

id A ⊗ id B ⨄ \= { { q ⊥ } ⋃ { id R ∣ R ∈ id A j ˜ ⋂ id B i ˜ } ≠ ⊥ 1 ∣ id A j ∈ id A ⨄ , id B i ∈ id B ⨄ } \= { { q ⊥ } ⋃ { id R ∣ R ∈ T A j ⋂ T B i } ≠ ⊥ 1 ∣ 1 ≤ j ≤ m , 1 ≤ i ≤ k } \= { id T A j ⋂ T B i ∣ T A j ⋂ T B i ≠ ⊥ 0 , 1 ≤ j ≤ m , 1 ≤ i ≤ k } \= { id A j ⊗ B i ∣ A j ⊗ B i ≠ ⊥ 0 , 1 ≤ j ≤ m , 1 ≤ i ≤ k } \= id A ⊗ B ⨄ .

Hence, from Definition 44 , id A ⊗ id B \= id A ⊗ B : A ⊗ B → A ⊗ B .

It is easy to verify that ⊗ is a monoidal bifunctor with natural isomorphic transformations (which generate an isomorphic arrow for each object in DB ):

α : ( _ ⊗ _ ) ⊗ _ ⟶ _ ⊗ ( _ ⊗ _ ) , (associativity) β : Υ ⊗ _ ⟶ I DB , (left identity) γ : _ ⊗ Υ ⟶ I DB , (right identity)

such that A ⊗ B ≃ B ⊗ A , A ⊗ Υ \= Υ ⊗ A ≃ A and A ⊗ ⊥ 0 ≃ ⊥ 0 . For any morphism f : A ⟶ B , from Proposition 23 we obtain f ˜ ⪯ A ⊗ B .  □

A tensor product ⊗ of the monoidal category DB is not unique in contrast with the Cartesian product (we can have for simple databases, A ⊗ B \= C ⊗ B such that C \= A ⋃ A 1 ⊃ A with T A 1 ⋂ T B \= ⊥ 0 ).

Notice that each A ⊗ B is a closed object (intersection of two closed objects T A and T B ), and that the information flux of any morphism from A to B is a closed object included in this maximal information flux (i. e., overlapping) between A and B . A matching of two completely disjoint simple databases is equal to the empty zero object ⊥ 0 .

Proposition 37.

Each object A with the monomorphism μ A : A ⊗ A ⟶ A and the epimorphism η A : Υ ↠ A compose a monoid in the monoidal category ( DB , ⊗ , Υ , α , β , γ ) .

Proof.

We have A ⊗ A ⪯ A , and hence, μ A \= in : A ⊗ A ⟶ A is a monomorphism (from Theorem 17 in Section 7.4 ). From the fact that T A ⊆ T Υ \= Υ and point 2 of Proposition 24 , we obtain a monomorphism in T A : T A ↪ Υ , and hence, a monomorphism (composition of two monic arrows) i n \= in T A ∘ is A : A ↪ Υ with i n ⨄ \= id A ⨄ . Consequently, by duality, its opposite arrow η A \= in OP : Υ ↠ A is an epimorphism such that η A ˜ \= in OP ˜ \= i n ˜ ≃ ⨄ i n ⨄ ˜ \= ⨄ id A ⨄ ˜ \= id A ˜ \= T A . It is easy to verify that μ A ∘ ( μ A ⊗ id A ) ∘ α A , A , A \= μ A ∘ ( id A ⊗ μ A ) is valid, and β A \= μ A ∘ ( η A ⊗ id A ) , γ A \= μ A ∘ ( id A ⊗ η A ) .  □

We generalize the merging operator for objects for the set S \= { A 1 , … , A n } of more than two databases by ⊗ S \= A 1 ⊗ ⋯ ⊗ A n .

7.4.2   Merging operator

Merging of an instance-database A with another instance-database is a unary algebraic operation, similar to the binary operation Data Federation of two database instances (denoted by ⋃ r n in Section 7.2.1 , i. e., the union ⋃ with the renaming ( rn ) of the relational symbols in A and B that have originally the same names, by unifying these two databases, that are in two different DB machines, for example, under the common DBMS. Consequently, given a connection A ⨁ B of two schemas and an R-algebra α (which is their model), A ⋃ r n B \= α ∗ ( A ⨁ B ) ).

In fact, the merging of two databases is defined as the database obtained by applying the power-view operator T to data federation of these two databases. That is, the data federation of two databases is isomorphic to the database obtained by their merging, from the behavioral point of view. Any view which can be obtained from the data federation (union with renaming) of two databases can also be obtained from the merging of these two databases, and vice versa.

In what follows, similar to the matching tensor products which, for any two given databases, return a closed object, also the merging operator will return a closed object. As we will see, these two operators will provide the meet and joint operators of the complete algebraic database lattice, where ⊥ 0 and Υ are the bottom and top elements (i. e., the instance-databases), respectively.

Theorem 19. For any fixed simple database A ∈ Ob DB , we define the parameterized “merging with A” operator as an endofunctor A ⊕ _ : DB ⟶ DB , as follows:

1.

For any object B \= ⨄ 1 ≤ i ≤ k B i , k ≥ 1 , the object A ⊕ B is a merging of A, defined by:

A ⊕ B ≡ ⊕ ( A , B ) ≜ T ( A ⋃ r n B ) \= T ( A ⋃ B ) , if k \= 1 , B \= B 1 ; ⨄ 1 ≤ i ≤ k ( A ⊕ B i ) , otherwise.

2.

For any f : B → ⨄ 1 ≤ j ≤ m C j , m ≥ 1 , the arrow A ⊕ ( f ) : A ⊕ B → A ⊕ C is defined by the canonical representation (Lemma 2 ) of

A ⊕ ( f ) ⨄ ≜ { ( id A ⋃ r n f i j ) : A ⊕ B i → A ⊕ C j ∣ f i j : B i → C j ∈ f ⨄ , ( id A ⋃ r n f i j ) ≠ ⊥ 1 } .

Proof.

Let us show that for a given DB simple arrow f : B → C , and hence, from Theorem 10 , obtained from a schema mapping M B C : B → C and an R-algebra α , such that f \= α ∗ ( MakeOperads ( M B C ) ) with the simple databases B \= α ∗ ( B ) and C \= α ∗ ( C ) , there is also an arrow id A ⋃ r n f in DB . In fact, let us consider the identity schema mapping M A A : A → A and the sketch’s mapping M \= ( MakeOperads ( M A A ) ⋃ r n MakeOperads ( M B C ) ) : A ⨁ B → A ⨁ C . Then

α ∗ ( MakeOperads ( M A A ) ⋃ r n MakeOperads ( M B C ) ) \= α ∗ ( MakeOperads ( M A A ) ) ⋃ r n α ( MakeOperads ( M B C ) ) \= id A ⋃ r n f : A ⋃ r n B → A ⋃ r n B \= A ⊕ ( f ) : A ⋃ r n B → A ⋃ r n B .

From the fact that A ⊕ B ≃ A ⋃ r n B and A ⊕ C ≃ A ⋃ r n C , we obtain the DB arrow id A ⋃ r n f : A ⊕ B → A ⊕ C .

It is easy to verify that for any two simple databases A and B the database A ⋃ r n B is different from A ⋃ B only in the fact that by renaming we can have the copies of the same relations. Thus, the set of views (obtained by SPRJU queries) of both databases are equal. Consequently, T ( A ⋃ r n B ) \= T ( A ⋃ B ) \= T ( T A ⋃ T B ) \= T ( T A ⋃ r n T B ) , i. e., A ⊕ B \= T A ⊕ T B , and A ⋃ r n B ≃ A ⊕ B .

Now we can verify that A ⊕ _ is an endofunctor. In fact, for any object B \= ⨄ 1 ≤ i ≤ k B i , k ≥ 1 and its identity arrow id B \= ⨄ 1 ≤ i ≤ k ( id B i : B i → B i ) ,

A ⊕ ( id B ) ⨄ \= { ( id A ⋃ r n id B i ) : A ⊕ B i → A ⊕ B i ∣ id B i : B i → B i ∈ id B ⨄ } \= { A ⊕ ( id B i ) : A ⊕ B i → A ⊕ B i ∣ id B i : B i → B i ∈ id B ⨄ } .

Thus, for each simple point-to-point arrow A ⊕ ( id B i ) : A ⊕ B i → A ⊕ B i , its flux is A ⊕ ( id B i ) ˜ \= ( id A ⋃ r n id B i ) ˜ \= id A ⋃ r n B i ˜ \= T ( A ⋃ r n B i ) \= A ⊕ B i . Consequently, for the identity arrows is valid the functorial property, A ⊕ ( id B i ) \= id A ⊕ B i : A ⊕ B i → A ⊕ B i .

From the fact that for any simple object (i. e., a database) B , A ⊆ A ⊕ B , each point-to-point arrow, resulting by application of this endofunctor, contains a subarrow id A . Thus, based on composition of operads in point 4 of Definition 63 (Section A.3.3 ), given two arrows f : B → C and g : C → D , we have the compositional endofunctors property:

A ⊕ ( g ) ∘ A ⊕ ( f ) ⨄ \= { ( id A ⋃ r n g j l ) ∘ ( id A ⋃ r n f i j ) ∣ g j l ∘ f i j ∈ g ∘ f ⨄ } \= { id A ⋃ r n ( g j l ∘ f i j ) ∣ g j l ∘ f i j ∈ g ∘ f ⨄ } \= A ⊕ ( g ∘ f ) ⨄ .

Consequently, A ⊕ ( g ) ∘ A ⊕ ( f ) \= A ⊕ ( g ∘ f ) .

Moreover, A ⊕ B \= B ⊕ A (if B is a simple database as well), A ⊕ Υ \= Υ , A ⊕ ⊥ 0 ≃ A , A ⊕ T A \= T A and A ⊕ A ≃ A .  □

“The merging with a complex-object A ,” when A \= ⨄ 1 ≤ j ≤ m A j , m ≥ 2 , can be obtained from the object-component of the functor defined in the theorem above, will be considered in more details in Section 7.4.4 , by obtaining the symmetric operator ‘ ⊕ ˆ ’, such that for any two complex objects A and B the isomorphism A ⊕ ˆ B ≃ B ⊕ ˆ A is valid.

Matching ‘⊗’ and (generalized) merging ‘ ⊕ ˆ ’ operators are dual operators in the category DB : in fact, they are also two dual lattice operators (meet and join, respectively) w. r. t. the database ordering ⪯, as we will show in Section 7.4.4 .

Remark.

Notice that A ⋃ r n B ≃ A ⊕ B , i. e., from the behavioral point of view, the data federation is equivalent (isomorphic) to the data merging. That is, for any query over the data federation A ⋃ r n B , which returns a view R , there exists a query over the data merging A ⊕ B , which returns with the same view R and vice versa.

We generalize the merging operator for objects for the set S \= { A 1 , … , A n } of more than two simple databases by ⊕ S \= T ( ⋃ S ) \= T ( A 1 ⋃ ⋯ ⋃ A n ) .

7.4.3   Universal algebra considerations

In what follows, we will consider the signature Σ R of the SPRJU Codd’s relational algebra, which is used to define the views in the SOtgd implications for the schema database mappings. In order to explore the universal algebra properties of the category DB [ 64 ], where a morphism is not a function but a nonempty set of functions (this fact significatively complicates a definition of the mappings from DB -morphisms into the homomorphisms of the category of Σ R -algebras), we will use an, equivalent to DB , a “sets-like” category DB sk , such that its arrows can be seen as total functions.

Proposition 38.

Let us denote the full skeletal subcategory of DB composed of closed objects only by DB sk .

Such a category is equivalent to the category DB , i. e., there exist an adjunction of a surjective functor T sk : DB ⟶ DB sk and an inclusion functor In sk : DB sk ⟶ DB such that T sk In sk \= Id D B sk and In sk T sk ≃ Id DB .

Proof.

Let us define T sk 0 \= T 0 and T sk 1 \= T 1 , while In sk 0 and In sk 1 are two identity functions. It is easy to verify that these two categories are equivalent. In fact, there exists an adjunction ( T sk , In sk , η sk , ε sk ) : DB ⟶ DB sk based on the bijection σ : DB sk ( T sk A , B ) → DB ( A , In sk B ) , which is natural in simple objects A ∈ DB and B ∈ DB sk (thus, B is closed, i. e., B \= T B ). In fact, for each f ∈ DB sk ( T sk A , B ) , which is an arrow f : T A → B (from T sk A \= T A ), we define σ ( f ) \= f ∘ is A : A → B ; conversely, for any g ∈ DB ( A , In sk B ) , which is an arrow g : A → B (from In sk B \= B ), we define σ − 1 ( g ) \= g ∘ is A − 1 . Thus, σ − 1 ( σ ( f ) ) \= σ ( f ) ∘ is A − 1 \= f ∘ is A ∘ is A − 1 \= f ∘ id T A \= f , and σ ( σ − 1 ( g ) ) \= σ ( g ∘ is A − 1 ) \= g ∘ is A − 1 ∘ is A \= g ∘ id A \= g .  □

In a given inductive definition, one defines a value of a function on all (algebraic) constructors (i. e., relational operators), in our example the endofunctor T , by the initial relational ( X ⨄ Σ R ) -algebra semantics with the syntax monad ( T P , η , μ ) . It is provided for a given assignment (R-algebra) α : X → T A , where X is a set of relational variables (symbols) in a database schema A , such that A \= α ∗ ( A ) . This inductive definition is expressed by the following commutative diagram in Set :

As we see, the induction for each schema A and R-algebra α , which is an interpretation of A , defines the closed objects in DB .

The following is based on the fundamental results of the universal algebra [ 102 ].

Based on the Cod’s SPRJU relational algebra, Σ R is a finitary signature (in the usual algebraic sense: a collection Σ R of function symbols with a function ar : Σ R ⟶ N giving the finite arity of each function symbol) for a single-sorted (sort of relations) relational algebra. Here, we will recall some universal algebra concepts from Section A.1 :

We can speak of Σ R -equations E and their satisfaction in a Σ R -algebra, obtaining the notion of a ( Σ R , E ) -algebra theory. In a special case when E is empty, we obtain a pure syntax version of Universal algebra, where K is a category of all Σ R -algebras and the quotient-term algebras are simply term algebras T P X for a given set of relational variables X .

An algebra for the algebraic theory (or type) ( Σ R , E ) is given by a set X , called the carrier of the algebra, together with interpretations for each of the function symbols in Σ R . A function symbol o i ∈ Σ R of arity k must be interpreted by a function o ˆ i : X k ⟶ X . Given this, a term containing n distinct variables gives rise to a function X n ⟶ X defined by induction on the structure of the term. An algebra must also satisfy the equations given in E in the sense that equal terms give rise to identical functions (with obvious adjustments where the equated terms do not contain exactly the same variables). A homomorphism of algebras from an algebra X to an algebra Y is given by a function g : X ⟶ Y , which commutes with operations of the algebra g ( o ˆ i ( x 1 , … , x k ) ) \= o ˆ i ( g ( x 1 ) , … , g ( x k ) ) .

This generates a variety category K of all relational algebras. Consequently, there is a bifunctor E : DB sk OP × K ⟶ Set such that for any simple database instance A in DB sk there exists the functor E ( A , _ ) : K ⟶ Set with an universal element ( U ( A ) , ϱ ) , where ϱ ∈ E ( A , U ( A ) ) , i. e., ϱ : A ⟶ U ( A ) , is an inclusion function. U ( A ) is a free algebra over A (i. e., the quotient-term algebra generated by a carrier database instance A ) such that for any function f ∈ E ( A , Z ) , f : A → Z , there is a unique homomorphism k (in K ) from the free algebra U ( A ) into an algebra Z , with f \= E ( A , k ) ∘ ϱ , represented by the following initial algebra semantics diagram in Set :

where k : ( U ( A ) , inr A ) → ( Z , h ) is this unique Σ R -algebra homomorphism corresponding to the unique homomorphism k from the initial ( A ⨄ Σ R ) -algebra ( U ( A ) , [ inl A , inr A ] ) into the algebra ( Z , [ f , k ] ) , and E ( A , k ) \= f # is a function equal to k but without the structural properties of this homomorphism (to commute with operations of the algebra).

Consequently, U ( A ) is a quotient-term algebra, where carrier is a set of equivalence classes of closed terms of a well-defined formulae of a relational algebra, “constructed” by Σ R -constructors (relational operators in SPJRU algebra: select, project, join and union) and elements (relations) of a database instance A .

From the so-called “parameter-theorem,” we obtain that there exist:

  • A unique universal functor U : DB sk ⟶ K such that for any simple database instance A in DB sk it returns the free Σ R -algebra U ( A ) . It is a quotient-term algebra where a carrier is a set U ( A ) of the equivalence classes [ t i ] of closed terms t i ∈ T P A of well-defined formulae of a relational algebra, “constructed” by Σ R -constructors (i. e., the relational operators o i ∈ Σ R in SPJRU algebra: select, project, join and union) and relational symbols of a database instance A . That is, U ( A ) \= { [ t i ] ∣ t i ∈ T P A } . An alternative for U ( A ) is given by considering A as a set of variables rather than a set of constants. In either case, each k -ary operation o i ∈ Σ R , with the function o i ˆ : U ( A ) k → U ( A ) (i. e., a component of inr A : Σ R ( U ( A ) ) → U ( A ) where Σ R ( U ( A ) ) \= ⨄ o i ∈ Σ R U ( A ) ar ( o i ) , so that inr A \= ⨄ o i ∈ Σ R o i ˆ is the interpretation of all operations in the signature Σ R ), and hence, is interpreted syntactically o i ˆ ( [ t 1 ] , … , [ t k ] ) \= [ o i ( t 1 , … , t k ) ] , where as usual, the square brackets denote the equivalence classes for terms t i .

    This universal functor U , for any simple morphism f : A ⟶ B in DB sk returns the homomorphism f H \= U 1 ( f ) from the Σ R -algebra U ( A ) into the Σ R -algebra U ( B ) such that for any term o i ( [ t 1 ] , … , [ t n ] ) ∈ U ( A ) , o i ∈ Σ R , we obtain f H ( o i ( [ t 1 ] , … , [ t n ] ) ) \= o i ( f H ( [ t 1 ] ) , … , f H ( [ t n ] ) ) ∈ U ( B ) .

  • Its adjoint forgetful functor F : K ⟶ DB sk such that, for any free algebra U ( A ) in K , the object F ( U ( A ) ) in DB sk is equal to its carrier-set A (each term o i ( [ t 1 ] , … , [ t ] n ) ∈ U ( A ) is evaluated into a relation that is an element of this closed object A ) and for each arrow U 1 ( f ) , F 1 ( U 1 ( f ) ) \= f , i. e., F U \= Id D B sk and U F \= Id K .

In this universal algebra framework, we preferred to use the skeletal category DB sk (which will be used for the algebraic considerations in what follows), instead of the complete category DB , equivalent to it.

It is immediate from the universal property that the mapping A ↦ U ( A ) extends to the endofunctor F ∘ U : DB sk ⟶ DB sk . This functor carries a monad structure ( F ∘ U , η , μ ) with F ∘ U an equivalent version of T but for this skeletal database category DB sk (while for the equivalent version for DB we obtain the monad T ). The natural transformation η is given by the obvious “inclusion” of A into ( F ∘ U ) ( A ) \= F ( U ( A ) ) : R ⟶ [ R ] (each view (relation) R in a closed object A is an equivalence class of all algebra terms, which produce this view). The natural transformation η is the unit of this adjunction of U and F , and hence, it corresponds to an injective function ϱ : A ⟶ U ( A ) in Set , given previously. The interpretation of μ is almost equally simple. An element of ( F ∘ U ) 2 ( A ) is an equivalence class of terms built up from elements of ( F ∘ U ) ( A ) , so that instead of t ( x 1 , … , x k ) , a typical element of ( F ∘ U ) 2 ( A ) is given by the equivalence class of a term t ( [ t 1 ] , … , [ t k ] ) . The transformation μ is defined by “flattening-terms” map [ t ( [ t 1 ] , … , [ t k ] ) ] ↦ [ t ( t 1 , … , t k ) ] . This make sense because a substitution of provably equal expressions into the same term results in provably equal terms.

Remark.

Consider a generalization to complex objects A \= ⨄ 1 ≤ j ≤ m A j , m ≥ 2 :

A bifunctor E : DB sk OP × K ⟶ Set for any complex database instance A in DB sk generates a functor E ( A , _ ) : K ⟶ Set with a universal element ( U ( A ) , ϱ ) , where U ( A ) \= ⨄ 1 ≤ j ≤ m U ( A j ) and ϱ \= ( ⨄ 1 ≤ j ≤ m ϱ j ) ∈ E ( A , U ( A ) ) , i. e., ϱ : ⨄ 1 ≤ j ≤ m A j ⟶ ⨄ 1 ≤ j ≤ m U ( A j ) is an inclusion function and U ( A ) is a free algebra over A (i. e., a quotient-term algebra generated by a carrier database instance A ). It is a disjoint union of the free algebras U ( A j ) over A j , j \= 1 , … , m , such that for any function f ∈ E ( A , Z ) , f : A → Z , with a set of point-to-point functions f j i : A j → Z i ∈ f ⨄ for a complex object Z \= ⨄ 1 ≤ j ≤ k Z i , k ≥ 1 , for each f j i there is a unique homomorphism k j i from the free algebra U ( A j ) into an algebra Z i , with f j i \= E ( A j , k ) ∘ ϱ j , represented by the following initial algebra semantics diagram in Set :

The set of such unique point-to point homomorphisms k j i : ( U ( A j ) , inr A j ) → ( Z i , h i ) , for each f j i ∈ f ⨄ define k ⨄ \= { k j i ∣ f j i ∈ f ⨄ } , i. e., a unique Σ R -algebra homomorphism k : ( U ( A ) , inr A ) → ( Z , h ) , which corresponds to the unique homomorphism k from the initial ( A ⨄ Σ R ) -algebra ( U ( A ) , [ inl A , inr A ] ) into the algebra ( Z , [ f , k ] ) .

Thus, E ( A , k ) \= f # is a function equal to k but without the structural properties of the homomorphism (to commute with operations of the algebra).  □

Let us define now the faithful forgetful functor from DB into Set category.

Theorem 20 ([ 5 ]). There exists a faithful forgetful functor F sk \= ( F sk 0 , F sk 1 ) : DB sk ⟶ Set , such that its object-component F sk 0 is equal to powerset operator P , while the arrow-component F sk 1 , for a given morphism f : A → B , where A \= ⨄ 1 ≤ j ≤ m A j , m ≥ 1 , and B \= ⨄ 1 ≤ i ≤ k B i , k ≥ 1 , is defined as follows: for any set S ∈ F sk 0 ( A ) \= P ( ⨄ 1 ≤ j ≤ m A j ) ,

F sk 1 ( f ) ( S ) ≜ { R ∣ R ∈ S ⋂ f l ˜ , ( f l : A → B ) ∈ f ⨄ } , if m \= k \= 1 ; { R ∣ ( j , R ) ∈ S and R ∈ f j 1 ˜ , ( f j 1 : A j → B 1 ) ∈ f ⨄ } , if m ≥ 2 , k \= 1 ; { ( i , R ) ∣ R ∈ S ⋂ f 1 i ˜ , ( f 1 i : A 1 → B i ) ∈ f ⨄ } , if m \= 1 , k ≥ 2 ; { ( i , R ) ∣ ( j , R ) ∈ S , R ∈ f j i ˜ , ( f j i : A j → B i ) ∈ f ⨄ } , otherwise.

We define the faithful forgetful functor F DB \= F sk ∘ T : DB ⟶ Set as well. Consequently, DB sk and DB are concrete categories.

7.4.4   Algebraic database lattice

This section is an extension of the Section 7.4 dedicated to the partial ordering ‘⪯’ for databases with an introduction of the PO subcategory DB I .

We recall that the symbol ‘=’ is used to express the fact that both sides name the same objects, whereas ‘≈’ is used to build equations, which may or may not be true for particular elements. Note that in the case of equations between arrows in DB category (i. e., the commutative diagrams) we use the symbol ‘=’ instead of ‘≈’, and ‘=’ is used for set equality relation as well.

We recall (see [ 102 ]) the fact that a complete lattice C is a poset P such that for any subset S both inf ( S ) (greatest lower bound) and sup ( S ) (least upper bound) exist in P (with 0 \= inf ( P ) , 1 \= sup ( P ) ): for any A , B , C ∈ C , and binary operations “join” ⋁ and “meet” ⋀ (in the case of the Set category, these operators are the set-union and set-intersection, respectively, while for the DB category we will show that they are merging and matching operators, respectively), the following identities are satisfied (see the first 5 equations for complete lattices in Section A.1 in the Appendix)

1)

A ⋁ A ≈ A , A ⋀ A ≈ A ; (idempotency)

2)

A ⋁ B ≈ B ⋁ A , A ⋀ B ≈ B ⋀ A ; (commutativity)

3)

A ⋁ ( B ⋁ C ) ≈ ( A ⋁ B ) ⋁ A , A ⋀ ( B ⋀ C ) ≈ ( A ⋀ B ) ⋀ C ; (associativity)

4)

A ∨ 0 ≈ A , A ∧ 1 ≈ A

5)

A ≈ A ⋁ ( A ⋀ B ) , A ≈ A ⋀ ( A ⋁ B ) ; (absorption).

Let us denote the restriction of the closure endofunctor T : DB ⟶ DB to PO category DB I by T I : DB I ⟶ DB I . We have seen in Section 7.4 that DB I is a PO category where each arrow in : A ↪ B is a monomorphism with A ⪯ B (as defined by Theorem 17 in Section 7.4 ). We recall that, by Definition 48 and Corollary 22 in Section 7.2.3 , for the behavioral equivalence ‘≈’,

A ≈ B iff ( A ⪯ B and B ⪯ A ) , and A ≃ B implies A ≈ B .

Thus, we obtained a partial order ( Ob DB , ⪯ ) . Let us show that it is a lattice ordered set, i. e., that every pair of objects A , B ∈ Ob DB has the least-upper-bound (sup) and the greatest-lower-bound (inf).

First of all, if we consider the subset of only simple objects then A ⪯ B is equal to T A ⊆ T B , A ⊗ B \= T A ⋂ T B and A ⊕ B \= T ( A ⋃ B ) \= T ( T A ⋃ T B ) . Hence, the matching and merging operators correspond to the meet and join lattice operators. For the complex objects, we can continue to use the matching operator as meet operation, but we have to generalize the “merging with A ” to complex objects as well, in the way that it can be used as a join operation.

Definition 53.

Let A \= ⨄ 1 ≤ j ≤ m A j , m ≥ 1 , and B \= ⨄ 1 ≤ i ≤ k B i , k ≥ 1 , be two complex objects, then we define the following sets:

S A \= { A j ∣ ∃ B i . A j ⪰ B i , 1 ≤ j ≤ m ≠ 1 , 1 ≤ i ≤ k ≠ 1 } . S B \= { B i ∣ ∃ A j . A j ⪯ B i , 1 ≤ j ≤ m ≠ 1 , 1 ≤ i ≤ k ≠ 1 } . S A B \= { A j ⊕ B i ∣ A j ∉ S A , B i ∉ S B , 1 ≤ j ≤ m , 1 ≤ i ≤ k } .

We define the generalized merging operator ‘ ⊕ ˆ ’ as follows:

A ⊕ ˆ B ≡ ⊕ ˆ ( A , B ) ≜ A 1 ⊕ B 1 \= T ( A 1 ⋃ B 1 ) ∈ S A B , if m \= k \= 1 ; ⨄ ( S A ⋃ S B ⋃ S A B ) , otherwise.

We recall (see the remark after Definition 42 ) that for a given set of sets S \= { S 1 , … , S n } , ⨄ S represents the disjoint union of sets in S by taking any ordering of them (because they are equal up to isomorphism, i. e., ⨄ S ≃ ( S 1 ⨄ S 2 ⨄ ⋯ ⨄ S n ) ). We have the following interesting cases:

1.

If S A \= A then S A B \= ∅ (empty set), and hence, A ⪯ B ;

2.

If S B \= B then S A B \= ∅ , and hence, A ⪰ B ;

3.

If S A \= A and S B \= B then S A B \= ∅ , and hence, A ≈ B ;

4.

If S A \= S B \= ∅ , then S A B is the disjoint union of all possible mergings of the simple objects (i. e., databases) in A and B , with A ≰ B and B ≰ A .

We have the following important properties for this generalization of the “merging with A ” operator ‘ ⊕ ˆ ’.

Lemma 9.

The following properties for any two objects A and B in DB are valid:

1.

(Commutativity) A ⊕ ˆ B ≃ B ⊕ ˆ A ; thus, A ⊕ ˆ B ≈ B ⊕ ˆ A ;

2.

(Generalized merging) If A is a simple object, then A ⊕ ˆ B ≃ A ⊕ B . Thus, A ⊕ ˆ B ≈ A ⊕ B ;

3.

A ⊕ ˆ B ⪰ A and A ⊕ ˆ B ⪰ B ;

4.

If A ⪯ B , then A ⊕ ˆ B ≈ B .

Proof.

Claim 1. From A ⊕ ˆ B \= ⨄ ( S A ⋃ S B ⋃ S A B ) , we obtain the isomorphism (from the commutativity of ⨄), A ⊕ ˆ B ≃ B ⊕ ˆ A , and hence, A ⊕ ˆ B ≈ B ⊕ ˆ A (from Corollary 22 any two isomorphic objects are behaviorally equivalent), which represents the commutativity property of the generalized merging operator.

Claim 2. It is a generalization of the “merging with A ” operator in Theorem 19 , from the fact that when m \= 1 (i. e., A is a simple object), we obtain S A \= S B \= ∅ , and hence, A ⊕ ˆ B \= ⨄ S A B \= ⨄ { A 1 ⊕ B i ∣ 1 ≤ i ≤ k } ≃ ⨄ 1 ≤ i ≤ k A 1 ⊕ B i \= (from Theorem 19 ) \= A ⊕ B . Thus, A ⊕ ˆ B ≈ A ⊕ B .

Claim 3. For each 1 ≤ j ≤ m , the simple object A j is in S A or in S A B in the form A j ⊗ B i ⊇ T A j , and hence, A ⊕ ˆ B ⪰ A . Analogously, for each 1 ≤ i ≤ k , the simple object B i is in S B or in S A B in form A j ⊗ B i ⊇ T B i , so that A ⊕ ˆ B ⪰ B .

Claim 4. From the fact that A ⊕ ˆ B ⪰ B , let us show that if A ⪯ B (with a mapping σ : { 1 , … , m } → { 1 , … , k } such that ∀ 1 ≤ j ≤ m . T A j ⊆ T B σ ( j ) ) then A ⊕ ˆ B ⪯ B as well. In fact, if A ⪯ B then S B \= B and S A B \= ∅ . Thus, the elements in the disjoint union of A ⊕ ˆ B are all B i , with T B i ⊆ T B i , 1 ≤ i ≤ k , or some A j , so that T A j ⊆ T B σ ( j ) , and hence, A ⊕ ˆ B ⪯ B .  □

We are now ready to introduce the following database lattice L DB .

Proposition 39.

The set Ob DB of all database instances (objects) of DB , both with the generalized merging and matching tensor products ⊕ ˆ and ⊗ (read “join” and “meet,” respectively) is a lattice with partial ordering ‘ ⪯ ’ (introduced by point 3 in Definition 40 , Section 7.1 ).

This lattice L DB \= ( Ob DB , ⪯ , ⊗ , ⊕ ˆ ) is a complete lattice with the top and bottom objects Υ and ⊥ 0 , respectively.

Proof.

First of all, if A ⪯ B with a mapping σ : { 1 , … , m } → { 1 , … , k } such that ∀ 1 ≤ j ≤ m . T A j ⊆ T B σ ( j ) , we obtain, from points 3 and 4 of Lemma 9 , that the generalized merging ‘ ⊕ ˆ ’ is equal to the join operator of this lattice w. r. t. the ordering ‘⪯’. Let us show that the matching operator ⊗ is the meet operator of this lattice. In fact, from Theorem 18 , A ⊗ B ⪯ A and A ⊗ B ⪯ B (for each disjoint component A j ⊗ B i in A ⊗ B , A j ⊗ B i \= T A j ⋂ T B i ⊆ T A j and A j ⊗ B i \= T A j ⋂ T B i ⊆ T B i ). If A ⪯ B with a mapping σ : { 1 , … , m } → { 1 , … , k } such that ∀ 1 ≤ j ≤ m . T A j ⊆ T B σ ( j ) , then A ⪯ A ⊗ B as well (we define a mapping σ ′ : { 1 , … , m } → { ( 1 , 1 ) , … , ( 1 , k ) , … , ( m , 1 ) , … ( m , k ) } such that σ ′ ( j ) \= ( j , σ ( j ) ) , 1 ≤ j ≤ m , with T A j ⊆ T A j ⊗ T B σ ( j ) \= T A j ⋂ T B σ ( j ) \= T A j ). Thus, if A ⪯ B then A ⊗ B ≈ A .

Hence, inf ( A , B ) \= A ⊗ B and sup ( A , B ) \= A ⊕ ˆ B .

Consequently, the equivalence in this lattice is equal to the strong behavioral equivalence of DB category (from Corollary 22 in Section 7.2.3 ). We have to show that the following laws hold:

1)

A ⊕ ˆ A ≈ A , A ⊗ A ≈ A ; (idempotency) laws

2)

A ⊕ ˆ B ≈ B ⊕ A , A ⊗ B ≈ B ⊗ A ; (commutativity)

3)

A ⊕ ˆ ( B ⊕ ˆ C ) ≈ ( A ⊕ ˆ B ) ⊕ ˆ A , A ⊗ ( B ⊗ C ) ≈ ( A ⊗ B ) ⊗ C ; (associativity)

4)

A ⊕ ˆ ⊥ 0 ≈ A , A ⊗ Υ ≈ A ; (bottom-top laws, see Proposition 36 )

5)

A ≈ A ⊕ ˆ ( A ⊗ B ) , A ≈ A ⊗ ( A ⊕ ˆ B ) ; (absorption).

The commutative and idempotency laws hold directly from the definitions of ⊕ ˆ (with Lemma 9 ) and ⊗, and from the results obtained previously. The associative law for ‘ ⊕ ˆ ’ holds from the transitive property of the PO relation ‘⪯’ used in definitions for the sets of simple objects S A , S B in Definition 53 . The isomorphism (a) A ⊗ ( B ⊗ C ) ≈ ( A ⊗ B ) ⊗ C comes from definition of matching in Theorems 18 , and the fact that disjoint union is commutative up to an isomorphism.

Hence, from the fact that isomorphic objects are behaviorally equivalent, we obtain the associativity A ⊗ ( B ⊗ C ) ≈ ( A ⊗ B ) ⊗ C for the matching operator.

Let us show absorption: We have ( A ⊗ B ) ⪯ A , and hence, from point 4 of Lemma 9 , A ⊕ ˆ ( A ⊗ B ) ≈ A .

Analogously, from point 3 of Lemma 9 , A ⪯ ( A ⊕ ˆ B ) and from above, A ⊗ ( A ⊕ ˆ B ) ≈ A .

For any subset K ⊆ Ob DB , ⊥ 0 ⪯ inf ( K ) \= ⊗ A i ∈ K A i ∈ Ob DB and Υ ⪰ sup ( K ) \= ⊕ ˆ A i ∈ K A i ∈ Ob DB (it holds also for the limit case when K \= Ob DB , with A i ⊆ Υ , i. e., A i ⪯ Υ , so that sup ( Ob DB ) \= ⊕ A i ∈ Ob DB A i \= Υ ∈ Ob DB ).

Consequently, the lattice ( Ob DB , ⪯ ) for every subset K has the greatest lower-bound and the least upper-bound, and hence, it is a complete lattice.  □

An element B in a lattice C , B ∈ C , is compact iff, for every X ⊆ C such that sup ( X ) exists and B ⪯ sup ( X ) , then there exists a finite X ′ ⊆ ω X such that B ⪯ sup ( X ′ ) : the set of compact elements in C is denoted by Comp C . For example, the lattice of subsets of a set is an algebraic lattice where the compact elements are finite sets.

A lattice is algebraic if it is complete and compactly generated : a lattice ( C , ⪯ ) is compactly generated if every element of C is a sup of compact elements less then or equal to it, i. e., for every A ∈ C , A ≈ sup { B ∈ Comp C ∣ B ⪯ A } . The closed elements, obtained by a closure operator J from finite subsets, are compact elements. Clearly, the finite lattices are algebraic.

But in our case, the complete database lattice L DB in Proposition 39 is infinite, thus we need to investigate if it is algebraic or not. For example, the subset [0,1] of the real numbers is a complete lattice, but is not algebraic.

The finite objects in DB are the databases with a finite number of n -ary relations ( n is a finite number n ∈ ω and the nullary relation ⊥ is an element of each object in DB category); the extension of relations is not necessarily finite—in such a case, for a finite object A in DB , the object T A is composed of infinite number of relations, i. e., T A is an infinite object.

We will demonstrate that the database lattice is an algebraic lattice . One way of producing, and recognizing, complete algebraic lattices is through closure operators. We can use this approach because the power-view operator T : Ob DB → Ob DB is a closure operator (by Theorem 17 in Section 7.4 ).

However, the complete lattice derived from a given closure operator must have the meet operator ‘⋀’ equal to the set-intersection operator, and, in our case of a complete database lattice L DB \= ( Ob DB , ⪯ , ⊗ , ⊕ ˆ ) , the meet operator is the matching operator: only for the simple objects in DB it is equal to set-intersection ‘⋂’. Consequently, we are able to use the closure operator T in order to demonstrate that the sublattice of L DB composed of only simple database is algebraic.

It is easy to show that the principal properties of the objects and morphisms in the DB category are derivable using the properties of the simple objects and simple morphisms between them. For example, a complex object A ⨄ B represents the separation composition of the simple objects (databases) A and B , and hence, the algebraic properties of the complex objects are derivable from the algebraic properties of the simple objects that compose them. The same holds for complex arrows.

The complex arrow h \= [ f , g ] : A ⨄ B → C , h \= f ⨄ g : A ⨄ B → C ⨄ D , h \= ⟨ f , g ⟩ : A → C ⨄ D and h \= ⌈ f , g ⌋ : A → C are representable in DB by the set of their simple ptp arrows f and g .

Consequently, in order to investigate the algebraic database lattice, we can begin from the full subcategory DB _ of DB composed of only simple objects, introduced by Definition 52 in Section 7.4 with the object Υ _ equal to the union of all simple objects (databases).

By definition, a closed-set system is algebraic if C is closed under unions of upward directed subsets, i. e., for every S ⊆ C , ⋁ S ∈ C . Equivalently, the closure operator J on a set Υ is algebraic if it satisfies the following “finitary” property: for any subset X ⊆ Υ ,

J ( X ) \= ⋃ { J ( X ′ ) ∣ X ′ ⊆ ω X } ,

where X ′ ⊆ ω X means that X ′ is a finite subset of X .

Proposition 40.

Let C \= Ob D B _ sk ⊂ Ob D B _ be the set of all closed objects (w. r. t. the power-view closure operator T) of the DB _ category. The following properties for a database closure are valid:

  • A closed-set system ( Υ _ , C ) consists of the “total” closed object (i. e., the top database instance) Υ _ ∈ C and the set C , which is closed under intersections of arbitrary subsets. That is, for any K ⊆ C , ⋂ K ∈ C .

  • The closure operator T is algebraic on the set Υ _ .

  • The complete lattice ( C , ⊆ ) obtained by this closure operator T is an algebraic lattice with meet ⊗ and join ⊕ operators. The compact elements of ( C , ⊆ ) are closed objects of DB _ category generated by finite simple objects A ⊆ ω Υ _ .

  • The lattice ( Ob D B _ , ⪯ , ⊗ , ⊕ ) is an algebraic lattice such that the algebraic closure operator T is a surjective homomorphism from this lattice into the “skeletal” algebraic lattice of closed databases ( C , ⊆ ) .

Proof.

From Theorem 17 in Section 7.4 , T : Ob DB ⟶ Ob DB is a closure operator over the subset Ob DB _ , and hence, the set of closed (and simple) objects C is closed under intersection. From Definition 52 in Section 7.4 , the total object Υ _ is the top object such that for any A ∈ C (thus, A \= T A ), A ⊆ Υ _ . In fact, each object A ∈ Ob DB _ is a subset of Υ _ and vice versa, each subset of Υ _ (that contains ⊥) is a database instance, and hence, an object in DB _ category.

From the Universal algebra theory, it holds that each closure operator and its equivalent closure-set system ( Υ _ , C ) generate a complete lattice ( C , ⊆ ) , such that for any subset K ⊆ C of simple closed objects K \= { A i \= T A i ∣ i ∈ I , A i is closed set of DB _ } we obtain:

  • The greatest lower bound ⋀ K \= ⋀ i ∈ I A i \= ⋂ i ∈ I A i \= ⋂ K \= ⊗ i ∈ I A i (from Theorem 18 for the simple databases and from A i \= T A i ), i. e., meet lattice operator ⋀ corresponds to the matching operation ⊗.

  • The least east upper bound ⋁ K \= ⋁ i ∈ I A i \= T ( ⋃ i ∈ I A i ) \= T ( ⋃ i ∈ I T A i ) \= ⊕ i ∈ I A i (from Theorem 19 for the simple databases), i. e., the join lattice operator ⋁ corresponds to the merging operation ⊕, and hence, for K \= C we obtain ⋁ C \= T ( ⋃ A i ∈ Ob DB _ A i ) \= (by Definition 52 ) \= T Υ _ \= Υ _ .

Let us demonstrate that T is algebraic, i. e., T ( A ) \= ⋃ { T ( A ′ ) ∣ A ′ ⊆ ω A } also for the infinite simple objects A ⊆ Υ _ . Let U : DB _ ⟶ K be the unique universal functor (which is a restriction of the functor U to the subcategory DB _ of only simple objects, described previously in Section 7.4.3 ). Then, for this infinite simple database A , U ( A ) \= { [ t i ] ∣ t i ∈ T P A } is an infinite set of the equivalence classes [ t i ] of SPJRU algebra terms with an infinite carrier set A of relational tables. From the fact that for all Σ R -algebra operators o i ∈ Σ R with finite n \= ar ( o i ) ≤ 2 and R 1 , … , R n ∈ A , t i \= o i ˆ ( R 1 , … , R n ) ∈ T P A , we can define a finite database A ′ \= { R 1 , … , R n } ⊆ ω A such that t i \= o i ˆ ( R 1 , … , R n ) ∈ T P A ′ , U ( A ) \= { [ t i ] ∣ t i ∈ T P A } \= ⋃ { [ t i ] ∣ t i ∈ T P A ′ , A ′ ⊆ ω A } .

Thus, T A \= { R \= ‖ [ t i ] ‖ # ∣ t i ∈ T P A } \= ⋃ { R \= ‖ [ t i ] ‖ # ∣ t i ∈ T P A ′ , A ′ ⊆ ω A } \= ⋃ { { R \= ‖ [ t i ] ‖ # ∣ t i ∈ T P A ′ } ∣ A ′ ⊆ ω A } \= ⋃ { T A ′ ∣ A ′ ⊆ ω A } . Hence, T is an algebraic closure operator and, consequently, the lattice ( C , ⊆ ) obtained from this closure operator and the closed-set system ( Υ _ , C ) is algebraic. It is well known that the compact elements of such a lattice ( C , ⊆ ) , obtained from the algebraic closure operator T , are precisely the closed sets T ( A ) , where A is a finite subset of Υ _ .

The ordering in the lattice ( Ob D B _ , ⪯ , ⊗ , ⊕ ) is defined for any two simple databases A , B ∈ Ob D B _ by A ⪯ B iff T A ⊆ T B . Thus, A ≈ B iff T A \= T B , so that A ≈ T A with A ⊗ B \= T A ⋂ T B and A ⊕ B \= T ( A ⋃ B ) \= T ( T A ⋃ T B ) . From the fact that each nonclosed element A in this lattice is equivalent to the closed element obtained from it ( A ≈ T A ), this lattice has the same structure of the algebraic lattice of closed databases ( C , ⊆ ) . Let us show now that it is also algebraic: in fact, for each A ∈ Ob D B _ we have

A ≈ T A \= (from the algebraic property of T ) \= ⋃ { T B ∣ B ⊆ ω T A } ≈ T ( ⋃ { T B ∣ B ⊆ ω T A } ) ( B is finite, and hence, B ′ \= T B ∈ CompC is compact element ) \= T ( ⋃ { B ′ ∈ CompC ∣ B ′ ⪯ A } ) \= sup { B ′ ∈ CompC ∣ B ′ ⪯ A }

so that this lattice is compactly generated, and hence, algebraic as well. Consequently, we obtain the surjective homomorphism T : ( Ob D B _ , ⪯ , ⊗ , ⊕ ) → ( C , ⊆ , ⋂ , T ⋃ ) .  □

Now we can extend the lattice ( C , ⊆ ) of only closed objects of DB _ into a lattice of all objects of DB category.

Corollary 25.

PO subcategory DB I ⊆ DB , with DB I \= L DB \= ( Ob DB , ⪯ , ⊗ , ⊕ ˆ ) , is an algebraic lattice.

Proof.

In Proposition 40 , it was shown that T is an algebraic closure operator for all simple objects in DB . Let us show that this closure operator (for all objects in DB ) is algebraic for the complex objects A \= ⨄ 1 ≤ j ≤ m A j , j ≥ 2 as well. In fact,

T ( A ) \= T ( ⨄ 1 ≤ j ≤ m A j ) \= ⨄ 1 ≤ j ≤ m T ( A j ) (from the fact that each A j is a simple object) \= ⨄ 1 ≤ j ≤ m ( ⋃ { T ( A j ′ ) ∣ A j ′ ⊆ ω A j } ) \= ⋃ { ( j , T ( A j ′ ) ) ∣ A j ′ ⊆ ω A j , 1 ≤ j ≤ m } \= ⋃ ( ⨄ 1 ≤ j ≤ m { T ( A j ′ ) ∣ A j ′ ⊆ ω A j } ) \= ⋃ { ⨄ 1 ≤ j ≤ m T ( A j ′ ) ∣ ⨄ 1 ≤ j ≤ m A j ′ ⊆ ω ⨄ 1 ≤ j ≤ m A j } \= ⋃ { T ( A ′ ) ∣ A ′ ⊆ ω A } .

Thus, the closure operator T is algebraic for all objects in DB and, consequently, the complete lattice L DB \= ( Ob DB , ⪯ , ⊗ , ⊕ ˆ ) is algebraic. Thus, the PO subcategory DB I \= L DB (from Theorem 17 in Section 7.4 ) is algebraic as well.  □

The algebraic property is very useful in order to demonstrate the properties of DB category: in order to demonstrate the theorems in general, we need to extend the inductive process of a proof beyond ω steps to the transfinite.

Zorn’s lemma (equivalent to the axiom of choice of set theory) allows us to do this. The database lattice L DB \= ( Ob DB , ⪯ , ⊗ , ⊕ ˆ ) is a (nonempty) poset with the property that every chain K ⊆ Ob DB (i. e., linearly ordered subset) has an upper bound ⋁ K \= ⋃ K (because this poset is algebraic ) in Ob DB . Hence, we can apply Zorn’s lemma, which asserts that L DB has a maximal element.

Remark.

From the fact that DB I \= L DB \= ( Ob DB , ⪯ , ⊗ , ⊕ ˆ ) is an algebraic lattice, we obtain for the total object Υ \= T Υ \= ⋃ { T A ∣ A ⊆ ω Υ } , i. e., it is the union of all closed objects generated by only finite objects of DB , and hence, the union of all compact elements of ( C , ⊆ ) .  □

Let ω be the category of natural numbers with the arrows ≤ : j ⟶ k corresponding to the total order relation j ≤ k , i. e., ω \= { 0 → 1 → 2 → ⋯ . } . An endofunctor H : C ⟶ D is ω-cocontinuous if it preserves the colimits of functors J : ω ⟶ C , i. e., when H ColimJ ≃ ColimHJ (the categories C and D are thus supposed to have these colimits).

Notice that a functor J : ω ⟶ C is a diagram in C of the form { C 0 → C 1 → C 2 → ⋯ . } . For ω - cocontinuous endofunctors, the construction of the initial algebra is inductive [ 103 ].

Proposition 41.

For each simple object A in the category DB , the “merging with A” endofunctor ∑ A \= A ⊕ _ : DB ⟶ DB is ω- cocontinuous .

Proof.

Let us consider any chain in DB (all arrows are monomorphisms (i. e., “⪯”) in a corresponding chain of the ⟨ Ob DB , ⪯ ⟩ algebraic lattice), that is a diagram D ,

⊥ 0 ⪯ 0 ( ∑ A ⊥ 0 ) ⪯ 1 ( ∑ A 2 ⊥ 0 ) ⪯ 2 ⋯ ∑ A ω ,

where ⊥ 0 \= { ⊥ } (with the empty relation ⊥ ∈ A , so that ∑ A ⊥ 0 \= A ⊕ ⊥ 0 \= T ( A ⋃ ⊥ 0 ) \= T A ) is the initial object in DB , with a unique monic arrow ⊥ 1 \= ⪯ 0 : ⊥ 0 ↪ ( ∑ A ⊥ 0 ) with ⊥ 1 ˜ \= ⊥ 0 and the consecutive arrows ⪯ n \= ∑ A n ⊥ 1 : ( ∑ A n ⊥ 0 ) ↪ ( ∑ A n + 1 ⊥ 0 ) with ∑ A n ⊥ 1 ˜ \= T A , for all n ≥ 1 , as representation of a functor J : ω ⟶ DB . The endofunctor ∑ A preserves colimits because it is monotone and ∑ A ω \= T A is its fixed point, i. e., ∑ A ω \= T A \= T ( A ⋃ T A ) \= T ( A ⋃ ∑ A ω ) \= ∑ A ( ∑ A ω ) . Thus, the colimit ColimJ \= ∑ A ω of the base diagram D , given by the functor J : ω ⟶ DB , is equal to ColimJ \= ( A ⊕ _ ) ω ⊥ 0 \= T A . Thus, ∑ A ColimJ \= T ( A ⋃ ColimJ ) \= T ( A ⋃ T A ) \= T ( T A ) \= T A \= Colim ∑ A J (where Colim ∑ A J is a colimit of the diagram ∑ A D ).

The ω - cocompleteness amounts to chain-completeness, i. e., to the existence of least upper bound of ω - chains . Consequently, ∑ A is ω - cocontinuous endofunctor, i. e., a monotone function, which preserves l. u. b. s of ω - chains .  □

In what follows, we will pass from lattice based concepts, as l. u. bs of directed subsets, compact subsets and algebraic lattices, to the categorially generalized concepts as directed colimits, finitely presentable (fp) objects, and locally finitely presentable (lfp) categories, respectively:

  • A directed colimit in DB is a colimit of the functor F : ( J , ⪯ ) ⟶ DB , where ( J , ⪯ ) is a directed partially ordered set, such that for any two objects j , k ∈ J there is an object l ∈ J such that j ⪯ l , k ⪯ l , considered as a category. For example, when J \= Ob DB we obtain the algebraic (complete and compact) lattice, which is an directed PO-set, such that for any two objects A , B ∈ J there is an object C ∈ J with A ⪯ C and B ⪯ C (when C \= sup ( A , B ) ∈ J ).

  • An object A is said to be finitely presentable (fp), or finitary, if the functor DB ( A , _ ) : DB → Set preserves directed colimits (or, equivalently, if it preserves filtered colimits). We write DB f p for the full subcategory of DB on the finitely presentable objects: it is essentially small. Intuitively, fp objects are “finite objects,” and a category is lfp if it can be generated from its finite objects: a strong generator M of a category is its small full subcategory such that f : A ⟶ B is an isomorphism iff for all objects C of this subcategory, given a hom-functor M ( C , _ ) : M ⟶ Set , the following isomorphism of hom-setts M ( C , f ) : M ( C , A ) ⟶ M ( C , B ) in Set is valid.

From Theorem 1.11 [ 104 ], a category is locally finitely presentable (lfp) iff it is cocomplete and has a strong generator.

Corollary 26.

DB and DB sk are concrete, locally small and locally finitely presentable categories (lfp).

Proof.

Given any two objects A and B in DB , the hom-set DB ( A , B ) of all arrows f : A ⟶ B corresponds to the directed subset (see Proposition 23 ) K \= { f ˜ ∣ ⊥ 0 ⪯ f ˜ ⪯ A ⊗ B } ⊆ Ob DB sk , which is bounded algebraic (complete and compact) sublattice of C . Thus, the set of all arrows f : Υ ⟶ Υ corresponds to the directed set K \= { f ˜ ∣ ⊥ 0 ⪯ f ˜ ⪯ Υ ⊗ Υ \= Υ } , which is equal to the lattice ( Ob DB sk , ⪯ ) (which is a sublattice of the algebraic lattice L DB in Proposition 39 , composed of only closed objects in DB ). Thus, DB is locally small (has small hom-sets), and, by DB ⊇ DB sk , also DB sk is locally small.

Let us show that the full subcategory DB fin , composed of closed objects obtained from finite database objects, is a strong generator of DB : in fact, if A ≃ B , where A \= ⨄ 1 ≤ j ≤ m A j , m ≥ 1 and B \= ⨄ 1 ≤ i ≤ k B i , k ≥ 1 are two finite databases (so that from Lemma 4 and Corollary 19 in Section 7.1.1 , k \= m with a bijection σ : { 1 , … , m } → { 1 , … , k } of simple databases A j ≃ B σ ( j ) , 1 ≤ j ≤ m ) then for all C \= ⨄ 1 ≤ l ≤ n C l , m ≥ 1 in DB fin , | DB fin ( C , A ) | is the rank of the complete sublattice of ⟨ Ob DB sk , ⪯ ⟩ bounded by ⊥ 0 ⪯ D ⪯ C ⊗ A , while | DB fin ( C , B ) | is the rank of the complete sublattice of ⟨ Ob DB sk , ⪯ ⟩ bounded by ⊥ 0 ⪯ D 1 ⪯ C ⊗ B . From A ≃ B , we deduce C ⊗ A ≃ C ⊗ B , thus | DB fin ( C , A ) | \= | DB fin ( C , B ) | , i. e., there is a bijection υ : DB fin ( C , A ) → DB fin ( C , B ) , which is an isomorphism in Set . Thus, DB , which is cocomplete and has this strong generator DB fin , is an lfp.  □

We define a representable functor DB ( A , _ ) : DB ⟶ Set , such that DB ( A , B ) is the hom-set of all morphisms in DB from A into B , and for any arrow g : B ⟶ C , DB ( A , g ) is the function such that for any morphism f ∈ DB ( A , B ) we obtain the morphism h \= DB ( A , g ) ( f ) ≜ g ∘ f ∈ DB ( A , C ) .

We say that a functor H : DB ⟶ Set preserves colimits if the image H ν : H F ⟶ H ColimF for the colimit ( ν , ColimF ) of a functor F ∈ DB J is a colimiting cone (or cocone) for H F . In this case, we are interested in H \= DB ( Υ , _ ) .

Let us show, e. g., that the object Υ is a finitely presentable (fp) (it was demonstrated previously by remark that Υ \= T Υ \= ⋃ { T A ∣ A ⊆ ω Υ } ), i. e., the fact that its hom-functor DB ( Υ , _ ) : DB ⟶ Set preserves directed colimits.

Proposition 42.

The total object, i. e., the matching monoidal unit Υ is a finitely presentable (fp).

Proof.

Let us consider the object ColimF in DB (a colimit of the functor F ∈ DB J , where F can be seen as a base diagram for this directed colimit, composed of a finite number of (possibly complex) objects B 1 , … . , B n with PO-arrows “⪯” between them), such that the arrows h i : B i ↪ ColimF are the monomorphisms corresponding to partial ordering B i ⪯ ColimF for directed colimits, as specified by Theorem 17 in Section 7.4 . These monomorphisms are the components of the cocone ( ν , ColimF ) where ․ ν : F ․ △ ColimF is a natural transformation (and △ is a diagonal constant functor) such that its components are ν ( B i ) \= ν B i \= h i , 1 ≤ i ≤ n . The translation of this directed colimit diagram from DB into Set by using the functor DB ( Υ , _ ) , for any cocone monomorphism h i , can be represented by the following diagram: Thus, for this directed colimit and a set of all objects in the diagram (i. e., the functor) F , S \= { B i ∣ B i ∈ F } ⊆ Ob DB , ColimF \= sup ( S ) \= sup { B i ∣ B i ∈ F } \= ∑ B i ∈ F B i \= ⊕ B i ∈ F B i . Then for each monomorphism h i : B i ⪯ ColimF , from Proposition 23 , any of its simple ptp arrows h i j ∈ h i ⨄ is monic, and hence, with h i j ˜ \= T B i .

In fact, for any other cocone diagram ( ν ′ , D ) with a vertex D and with natural transformation ․ ν ′ : F ․ △ D that provides the components (ptp arrows) h i ′ \= ν ′ ( B i ) \= ν B i ′ , there is a unique arrow k : ColimF → D such that h i ′ \= k ∘ h i , 1 ≤ i ≤ n .

This colimit diagram is then translated by the functor H \= DB ( Υ , _ ) in an analogous colimit diagram in Set with the cocone-base H F , as presented by the right-hand side of diagram above for any fixed cocone monic arrow h i : B i ↪ ColimF . Let us show that for any other cocone E in Set , for the same cocone-base H F (where H \= DB ( Υ , _ ) : DB → Set ) there is a unique arrow (a function) k from DB ( Υ , ColimF ) to the set E (vertex of a cocone E ) such that the diagram composed of these two cocones commutes. That is, for each object DB ( Υ , B i ) in the cocone-base H F , we obtain a function l i , which is a component of cocone E in Set :

(7.1) l i \= k ∘ DB ( Υ , h i ) : DB ( Υ , B i ) → E

for each 1 ≤ i ≤ n .

From the functorial property of H \= DB ( Υ , _ ) : DB → Set , we have that for the function DB ( Υ , h i ) : DB ( Υ , B i ) → DB ( Υ , ColimF ) it holds that for each DB-morphism ( g : Υ → B i ) ∈ DB ( Υ , B i ) , DB ( Υ , h i ) ( g ) \= h i ∘ g is a DB-morphism with the set of ptp (simple) arrows

h i ∘ g ⨄ \= { h i j ∘ g l ∣ cod ( g l ) \= dom ( h i j ) , g l ∈ g ⨄ , h i j ∈ h i ⨄ }

where for each monic simple arrow h i j , h i j ˜ \= T ( dom ( h i j ) ) and

g l ˜ ⊆ T ( dom ( g l ) ) ⋂ T ( cod ( g l ) ) ⊆ T ( cod ( g l ) ) \= T ( dom ( h i j ) ) \= h i j ˜ .

That is, h i j ∘ g l ˜ \= h i j ˜ ⋂ g l ˜ \= g l ˜ , and hence, by Definition 48 in Section 7.2.3 , these two simple morphisms are equivalent arrows in DB (up to isomorphism), h i j ∘ g l ≈ g l . Consequently, h i ∘ g ⨄ ≈ g ⨄ , i. e., DB ( Υ , h i ) ( g ) \= h i ∘ g ≈ g , and from ( 7.1 ) l i ( g ) \= k ( DB ( Υ , B i ) ( g ) ) \= k ( g ) .

Thus, from ( 7.1 ), ∀ g ∈ DB ( Υ , B i ) . k ( g ) \= l i ( g ) , for each 1 ≤ i ≤ n , i. e., the function k is uniquely defined by the set of cocone functions l i , 1 ≤ i ≤ n .

Let us consider this problem alternatively by category symmetry, where each DB-morphism f is substituted by its dual object, equal to the information flux f ˜ : Each hom-set DB ( Υ , B i ) in Set is isomorphic in Set to the complete sublattice ( { f ˜ ∣ f ˜ ⪯ Υ ⊗ B i } , ⪯ ) \= ( { f ˜ ∣ f ˜ ⪯ T B i } , ⪯ ) (because each arrow f : Υ ⟶ B i corresponds to the closed object f ˜ ⪯ Υ ⊗ B i \= T B i ). On the other hand, HColimF \= DB ( Υ , ColimF ) is isomorphic to the complete sublattice ( S , ⪯ ) , where S \= { f ˜ ∣ f ˜ ⪯ ∑ B i ∈ F T B i \= ⊕ B i ∈ F T B i } . Hence, all arrows of the cocone H ν , DB ( Υ , h i ) : DB ( Υ , B i ) ↪ DB ( Υ , ColimF ) are injective functions ( { f ˜ ∣ f ˜ ⪯ T B i } , ⪯ ) ⊆ ( S , ⪯ ) (also all arrows in the base diagram H F in Set are injective functions of the form ( { f ˜ ∣ f ˜ ⪯ T B j } , ⪯ ) ⊆ ( { f ˜ ∣ f ˜ ⪯ T B k } , ⪯ ) ).

Thus, the PO arrows (the monomorphisms) ‘⪯’ in DB are translated into injective functions (i. e., the monomorphisms in Set ), and hence, the directed-colimit diagram in DB with ColimF equal to the l. u. b. of all objects in its cocone-base F is translated by the functor H \= DB ( Υ , _ ) into the direct-colimit diagram (with respect to inclusion-PO ‘⊆’) in Set where the H ( ColimF ) is the l. u. b. with respect to partial ordering ⊆. Consequently, any other E that makes this diagram commutative with the same cocone base H F (composed of all injective functions) from H ( B i ) into E for all 1 ≤ i ≤ n must be a bigger set then l. u. b. H ( ColimF ) and with unique injective function k : H ( ColimF ) ↪ E . All arrows of the cocone E , l i : ( { f ˜ ∣ f ˜ ⪯ T B i } , ⪯ ) ⟶ E , must be injective functions (however, with different domains) in order to preserve the commutativity of this colimiting cocone E . Thus, the function k : ( S , ⪯ ) ⟶ E is a unique function such that, for any v ∈ ⟨ S , ⪯ ⟩ , k ( v ) \= l i ( v ) for some l i : ( { f ˜ ∣ f ˜ ⪯ T B i } , ⪯ ) ⟶ E and v ∈ ( { f ˜ ∣ f ˜ ⪯ T B i } , ⪯ ) . From HColim \= DB ( Υ , ColimF ) ≃ S , we can conclude that there is a unique arrow in Set from HColimF into E . Consequently, HColim is a colimit in Set , i. e., H \= DB ( Υ , _ ) preserves directed colimits, and hence, Υ is finitely presentable.  □

Remark.

We emphasize the fact that Υ is an fp object for more general considerations of the theory of enriched categories, which will be elaborated in Section 7.5 as, i. e., the demonstration that the monad based on the power-view endofunctor T : DB → DB is an enriched monad. The Kelly–Power theory applies in the case of a symmetric monoidal closed category, which is an lfp and closed category: it is equivalent to demanding that the underlying ordinary category is lfp and that the monoidal structure on this ordinary category restricts to one on its fp objects. For details, see [ 93 ], [ 105 ], and consider particularly that the unit Υ must be finitely presentable.  □

A locally finitely presentable category [ 106 ] is the category of models for an essentially algebraic theory, which allows operations whose domain is an equationally defined subset of some product of the previously defined domains (the canonical example is a composition in a category, which is defined only on composable, not arbitrary pairs of arrows).

In fact, we deduce from the algebraic (complete and compact) lattice ( Ob DB , ⪯ ) that for any simple object A , A ≃ T A \= ⊕ { T B ∣ B ⊆ ω A } \= ⊕ S (we recall that ⊕ is a generalization in DB of the union operation ⋃ for sets and X ⊕ Y \= T X ⊕ T Y ), where the set S \= { B ∣ B ⊆ ω A } is upward directed, i. e., for any two finite B 1 , B 2 ⊆ ω A there is C \= B 1 ⋃ B 2 ∈ S such that B 1 ⪯ C and B 2 ⪯ C , with T C \= B 1 ⊕ B 2 . That is, any object in DB is generated from finite objects and this generated object is just a directed colimit of these fp objects.

An important consequence of this freedom is that we can express conditional equations in the logic for databases.

Another important result, from the fact that DB is a complete and cocomplete lfp category, is that it can be used as the category of models for essentially algebraic theory [ 16 ], [ 107 ] as a relational database theory. Thus, it is a category of models for a finite limit sketch, where sketches are called graph-based logic [ 108 ], [ 109 ], and it is well known that a relational database scheme can readily be viewed, with some inessential abstraction involved, as a sketch. By Liar’s theorem, a category DB is accessible [ 110 ], [ 111 ] because it is sketchable.

Remark.

A standard application of sketches is used to define a theory of a single database scheme, so that objects of this graph-based logic theory are single relations of such a database and arrows between them are used to define the common database functional dependencies, inclusion dependencies and other database constraints. Here, in the case of interdatabase schema mappings, we need to use the whole databases as objects in this lfp DB category: the price for this higher level of abstraction is that arrows in DB are much more complex than in a standard setting, and hence, are not (simple) functions but the sets of functions .  □

7.5   Enrichment

It is not misleading, at least initially, to think of an enriched category as being a category in which the hom-sets carry some extra structure (partial order ⪯ of algebraic sublattice ( Ob DB , ⪯ ) in our case) and in which that structure is preserved by composition. The notion of enriched category [ 105 ] is more general and allows for the hom-objects (“hom-sets”) of the enriched category to be objects of some monoidal category, traditional called V .

Let us demonstrate that DB is a monoidal closed category.

Definition 54.

For any two objects B \= ⨄ 1 ≤ i ≤ k B i , k ≥ 1 and C \= ⨄ 1 ≤ l ≤ n C l , n ≥ 1 , the set of all arrows DB ( B , C ) from B into C can be represented by unique principal arrow h : B → C (Proposition 26 ), such that its set of ptp arrows is

h ⨄ ≜ { h i l \= ⋃ { f i l : B i → C l ∣ f i l ∈ f ⨄ , f ∈ DB ( B , C ) } ≠ ∅ ∣ 1 ≤ i ≤ k , 1 ≤ l ≤ n } .

The object C B is equal to the information flux of this principal arrow. Thus, we define the hom-object

C B ≜ h ˜ ≃ ⨄ h ⨄ ˜ .

Remark.

For any two simple objects B and C (when n \= k \= 1 ), the set of all arrows S \= { f 1 , f 2 , … } : B → C , from B into C , can be represented by a unique complex arrow. ⌈ S ⌋ : B → C . Thus, from Definition 43 and Lemma 1 in Section 7.1 , we obtain the hom-object C B ≜ ⌈ S ⌋ ˜ \= ⊕ { f j ˜ ∣ f j ∈ DB ( B , C ) } . From Proposition 24 , for each simple arrow f j ∈ DB ( B , C ) , f j ˜ ⊆ B ⊗ C . Thus, based on the complete lattice L DB \= ( Ob DB , ⪯ , ⊗ , ⊕ ˆ ) in Proposition 39 , the set { f j ˜ ∣ f j ∈ DB ( B , C ) } is a sublattice with the l. u. b. equal to B ⊗ C , so that the merging (join operator of this lattice) of all elements in this set is equal to its l. u. b. That is, we obtain that C B \= ⊕ { f j ˜ ∣ f j ∈ DB ( B , C ) } \= T ( ⋃ { f j ˜ ∣ f j ∈ DB ( B , C ) } ) \= T ( ⋃ { f j ˜ ∣ f j ˜ ⊆ B ⊗ C \= T B ⋂ T C } ) \= T ( T B ⋂ T C ) \= T ( T B ) ⋂ T ( T C ) \= T B ⋂ T C \= B ⊗ C .  □

Consequently, the hom-set DB ( B , C ) in Set of all morphisms B → C , can be “internalized” into the hom-object C B in D B category by merging of compact elements A ⪯ B ⊗ C (where B ⊗ C is the “distance” between B and C , following Lawvere’s idea, for the definition of metric space for the DB category [ 5 ]).

The aim to “internalize” the hom-sets is justified by necessity to substitute the base category Set by the base database category DB in the cases as Yoneda embeddings for categories by the contravariant functor H : C OP → Set C introduced in technical preliminaries (Section A.2 ).

Lemma 10.

For any two objects B and C, C B ≃ B C ≃ B ⊗ C .

Proof.

From Definition 54 ,

C B \= ⨄ h ⨄ ˜ ≃ ⨄ 1 ≤ i ≤ k , 1 ≤ l ≤ n ( ⊕ { f i l ˜ ∣ f i l ∈ DB ( B i , C l ) } ) (see the remark above for simple objects) \= ⨄ 1 ≤ i ≤ k , 1 ≤ l ≤ n B i ⊗ C l \= B ⊗ C (from Definition 40) .

 □

Remark.

From duality, for any two objects A \= ⨄ 1 ≤ j ≤ m A j , m ≥ 1 and B \= ⨄ 1 ≤ i ≤ k B i , k ≥ 1 there is the bijection _ OP : DB ( A , B ) → DB ( B , A ) , such that for any morphism f : A → B , f OP \= _ OP ( f ) : B → A , where

f OP ⨄ \= { f j i OP ∣ f j i : A j → B i ∈ f ⨄ } ,

with equal information fluxes f j i OP ˜ \= f j i ˜ (the flux transmitted from simple objects A j into B i can be reflexed from B i to A j as well). Consequently, by Lemma 10 , A B ≃ ⨄ 1 ≤ j ≤ m , 1 ≤ i ≤ k ( ⊕ { f j i ˜ ∣ f j i ∈ DB ( A j , B i ) } ) ≃ ⨄ 1 ≤ i ≤ k , 1 ≤ j ≤ m ( ⊕ { f i j ′ ˜ ∣ f i j ′ \= f j i OP ∈ DB ( B i , A j ) } ) ≃ B A ≃ A ⊗ B , i. e., B ⊗ A ≃ A B ≃ B A ≃ A ⊗ B .

That is, the cotensor B A (i. e., hom-object) of any two objects A and B , which is a particular limit in DB , is equal to the corresponding colimit, that is, tensor product A ⊗ B , of these two objects; this fact is based on the duality property of DB category.

7.5.1   DB is a V-category enriched over itself

Generally, a monoid M acting on the set Ob DB may be seen as general metric space where for any B ∈ Ob DB the distance C B is a set of R ∈ S (relations, or views, in our case) whose action sends B to C (this action provides a possibility to pass from the “state” B to “state C of the database “system” of objects in DB ), as we investigated in the chapter dedicated to operational semantics for the database mapping systems.

A monoidal category is closed if the functor _ ⊗ B : DB ⟶ DB has a right adjoint ( _ ) B : DB ⟶ DB for every object B , ( ( _ ) B , _ ⊗ B , η ⊗ , ε ⊗ ) : DB ⟶ DB , with the counit ε C : C B ⊗ B ⟶ C called the evaluation at C (denoted by eval B , C ).

Theorem 21. Strictly symmetric idempotent monoidal category ( DB , ⊗ , Υ ) is a monoidal biclosed: for every object B, there exists in Set an isomorphism (a bijection) Λ : DB ( A ⊗ B , C ) ≅ DB ( A , C B ) such that for any f ∈ DB ( A ⊗ B , C ) , Λ ( f ) ≈ f , the hom-object C B together with a monomorphism eval B , C : C B ⊗ B ↪ C the following “exponent” diagram commutes, with f \= eval B , C ∘ ( Λ ( f ) ⊗ id B ) .

Proof.

Let us consider the simple objects A , B , C and a morphism

f \= α ∗ ( MakeOperads ( M ) ) : A ⊗ B → C ,

obtained from a sketch’s mapping M : A ⋂ α B → C with A \= α ∗ ( A ) , B \= α ∗ ( B ) and C \= α ∗ ( C ) obtained from the schemas A , B and C . Thus, f ˜ ⊆ T ( A ⊗ B ) ⋂ T C \= T A ⋂ T B ⋂ T C .

Then we define the schema mapping M 1 \= { Φ } : A ⋂ α A → B ⋂ α C with SOtgd Φ equal to conjunction ⋀ { ∀ x ( r ( x ) ⇒ r ( x ) ) ∣ r ∈ A ⋂ α A and α ( r ) ∈ f ˜ ⊆ α ∗ ( A ˆ ) \= T A } with the sketch’s mapping M 1 \= { 1 r ∈ O ( r , r ) ∣ α ( r ) ∈ f ˜ ⊆ T A } , where A ⋂ α B is the α -intersection schema (defined in Definition 70 in Section A.3.5 ) with α ∗ ( A ⋂ α A ) \= T A , and hence, its flux is α ∗ ( M 1 ) ˜ \= Flux ( α , M 1 ) \= f ˜ .

Then we define the DB morphism

Λ ( f ) \= α ∗ ( M 1 ) ∘ is A : A → α ( B ⋂ α C ) \= B ⊗ C \= C B .

This morphism from A into C B is uniquely defined by the morphism f : A ⊗ B → C : in fact, its flux is uniquely determined by

Λ ( f ) ˜ \= α ∗ ( M 1 ) ∘ is A ˜ \= α ∗ ( M 1 ) ˜ ⋂ is A ˜ \= f ˜ ⋂ T A \= f ˜ .

Analogously, we define the schema mapping M 2 \= { Ψ } : B ⋂ α C → C with SOtgd Ψ equal to the conjunction ⋀ { ∀ x ( r ( x ) ⇒ r ( x ) ) ∣ r ∈ B ⋂ α C and α ( r ) ∈ α ∗ ( B ⋂ α C ) \= T B ⋂ T C } with the sketch’s mapping

M 2 \= MakeOperads { 1 r ∈ O ( r , r ) ∣ α ( r ) ∈ T B ⋂ T C } .

Hence, we define the DB morphism eval B , C \= α ∗ ( M 2 ) : C B ⊗ B \= α ∗ ( B ⋂ α C ) → C , which is a monomorphism from the fact that eval B , C ˜ \= T B ⋂ T C \= C B ⊗ B .

Consequently, we obtain for the commutativity of this exponential diagram, i. e., f ˜ \= eval B , C ∘ ( Λ ( f ) ⊗ id B ) ˜ \= eval B , C ˜ ⋂ ( Λ ( f ) ⊗ id B ) ˜ \= eval B , C ˜ ⋂ ( Λ ( f ) ˜ ⊗ id B ˜ ) \= B ⊗ C ⋂ Λ ( f ) ˜ ⋂ T B \= T B ⋂ T C ⋂ Λ ( f ) ˜ \= Λ ( f ) ˜ (from the fact that Λ ( f ) ˜ ⊆ C B \= T B ⋂ T C ). Thus, f \= eval B , C ∘ ( Λ ( f ) × id B ) iff Λ ( f ) ≈ f .

Λ is a bijection because DB ( A ⊗ B , C ) \= { g ∣ ⊥ 0 ⊆ g ˜ ⊆ A ⊗ B ⊗ C } ≅ { g ˜ ∣ g ˜ ∈ K } , where K is a bounded algebraic sublattice (of closed objects) of the lattice ( C , ⊆ ) in Proposition 40 and ≅ denotes a bijection, i. e., K \= { a ∣ a ∈ C and a ⊆ T A ⋂ T B ⋂ T C } . Also, DB ( A , C B ) \= DB ( A , B ⊗ C ) ≅ K , thus | DB ( A ⊗ B , C ) | \= | DB ( A , C B ) | \= | K | . Consequently, Λ is a bijection such that for any f ∈ DB ( A ⊗ B , C ) , Λ ( f ) ˜ \= f ˜ ∈ K , i. e., Λ ( f ) ≈ f .

Let us consider now the complex objects A \= ⨄ 1 ≤ j ≤ m A j , m ≥ 1 , B \= ⨄ 1 ≤ i ≤ k B i , k ≥ 1 and C \= ⨄ 1 ≤ l ≤ n C l , n ≥ 1 . Then eval B , C is the monomorphism in : C ⊗ B ↪ C , obtained by Theorem 17 in Section 7.4 from the PO relation (from the isomorphism C B ⊗ B ≃ C ⊗ B ⊗ B ), C B ⊗ B ≈ C ⊗ B ⊗ B (from C ⊗ B ⪯ B ) ≈ C ⊗ B ⪯ C in the complete lattice L DB \= ( Ob DB , ⪯ , ⊗ , ⊕ ˆ ) (in Proposition 39 ), with i n ⨄ \= { in l i : C l ⊗ B i ↪ C l ∣ 1 ≤ l ≤ n , 1 ≤ i ≤ k } .

For a given complex arrow f : A ⊗ B → C , we define the mapping Λ such that

f ⨄ ↦ { f j l i ′ : A j → C l ⊗ B i ∣ ( f j i l : A j ⊗ B i → C l ) ∈ f ⨄ and f j l i ′ ˜ \= f j i l ˜ } ,

and its inverse Λ − 1 such that

Λ ( f ) ⨄ ↦ { f j i l : A j ⊗ B i → C l ∣ ( f j l i ′ : A j → C l ⊗ B i ) ∈ Λ ( f ) ⨄ and f j i l ˜ \= f j l i ′ ˜ } ,

and hence Λ is a bijection.

Let us show the commutativity f \= i n ∘ ( Λ ( f ) ⊗ id B ) of the diagram, i. e., that f ⨄ \= i n ∘ ( Λ ( f ) ⊗ id B ) ⨄ . In fact, for each ( in l i ∘ ( f j l i ′ ⊗ id B i ) : A j ⊗ B i → C l ) ∈ i n ∘ ( Λ ( f ) ⊗ id B ) ⨄ , in l i ∘ ( f j l i ′ ⊗ id B i ) ˜ \= ( T C l ⋂ T B i ) ⋂ ( f j l i ′ ˜ ⋂ T B i ) \= (from f j l i ′ ˜ ⊆ T A j ⋂ T B i ⋂ T C l ) \= f j l i ′ ˜ \= f j i l ˜ , for the corresponding ( f j i l : A j ⊗ B i → C l ) ∈ f ⨄ . Consequently, in l i ∘ ( f j l i ′ ⊗ id B i ) \= f j i l for each ptp arrow in i n ∘ ( Λ ( f ) ⊗ id B ) and vice versa. Hence, f \= i n ∘ ( Λ ( f ) ⊗ id B ) \= eval B , C ∘ ( Λ ( f ) ⊗ id B ) .

Consequently, DB is closed and symmetric, i. e., a biclosed category.  □

We have seen that all objects in DB are finitely representable (from Corollary 26 and Proposition 42 ). Let us denote the representable functor DB ( Υ , _ ) by V \= DB ( Υ , _ ) : DB ⟶ Set . By putting A \= Υ in Λ ( f ) : A → C B of the “exponent” diagram in Theorem 21 , and by using the isomorphism β : Υ ⊗ B ≃ B , we get a natural isomorphism in Set (a bijection Λ), DB ( B , C ) ≃ V ( C B ) \= DB ( Υ , C B ) .

Then C B is exhibited as a lifting through V of the hom-set DB ( B , C ) (i. e., in the case when B and C are the simple objects, the hom-object C B is a set of all views, which gives a possibility to pass from a “state” B to a “state” C ). It is called the internal hom of B and C .

By putting B \= Υ in Λ ( f ) : A → C B of the “exponent” diagram in Theorem 21 , and by using the isomorphism γ : A ⊗ Υ ≃ A we deduce a natural isomorphism i : C ≃ C Υ (it is obvious, from the fact that C Υ ≃ C ⊗ Υ ≃ C ).

The fact that a monoidal structure is closed means that we have an internal Hom functor, ( _ ) ( _ ) : DB OP × DB → DB , which “internalizes” the external Hom functor, Hom : DB OP × DB → Set , such that for any two objects A and B , the hom-object B A \= ( _ ) ( _ ) ( A , B ) , represents the hom-set Hom ( A , B ) (i. e., the set of all morphisms from A to B ).

Monoidal closed categories generalize the Cartesian closed ones in that they also posses exponent objects B A , which “internalize” the hom-sets. One may then ask if there is a way to “internally” describe the behavior of functors on morphisms. That is, given a monoidal closed category C and a functor F : C ⟶ C , consider, say, f ∈ C ( A , B ) then F ( f ) ∈ C ( F ( A ) , F ( B ) ) . Since the hom-object B A and F ( B ) F ( A ) represent hom-sets C ( A , B ) and C ( F ( A ) , F ( B ) ) in C , one may study the conditions under which F is “represented” by morphism in C ( B A , F ( B ) F ( A ) ) , for each A and B .

Theorem 22. The endofunctor T : DB ⟶ DB is closed. DB is a V-category enriched over itself, with the composition law monomorphism m A , B , C : C B ⊗ B A ↪ C A and identity element (epimorphism) j A : Υ ↠ A A , which “picks up” the identity in A A . The monad ( T , η , μ ) is an enriched monad, and hence, DB is an object of V-cat and endofunctor T : DB → DB is an arrow of V-cat.

Proof.

Let us show that the arrows introduced by this proposition satisfy the morphisms in the definition of the DB category; see Theorem 10 in Section 7.1 . For a given database schemas A , B and C and am R-algebra α such that A \= α ∗ ( A ) , B \= α ∗ ( B ) , C \= α ∗ ( C ) , we have that there exist the α -intersection schemas A ⋂ α C and ( A ⋂ α C ) ⋂ α B so that α ∗ ( A ⋂ α C ) \= A ⊗ C \= C A and

α ∗ ( ( A ⋂ α C ) ⋂ α B ) \= T A ⋂ T C ⋂ T B \= A ⊗ C ⊗ B \= C B ⊗ B A .

Thus, we may define a schema mapping M \= { Φ } : ( A ⋂ α C ) ⋂ α B → A ⋂ α C , where Ψ is a SOtgd conjunction ⋀ { ∀ x ( r ( x ) ⇒ r ( x ) ) ∣ r ∈ ( A ⋂ α C ) ⋂ α B } , and M \= MakeOperads ( M ) \= { 1 r ∣ r ∈ ( A ⋂ α C ) ⋂ α B } ⋃ { 1 r ∅ } , so we obtain a monomorphism

m A , B , C \= α ∗ ( M ) \= { 1 R : R → R ∣ R ∈ T A ⋂ T C ⋂ T B } ⋃ { q ⊥ } : C B ⊗ B A ↪ C A .

In the case of complex objects A , B and C , the m A , B , C is uniquely determined by the PO relation C B ⊗ B A ⪯ C A as specified by Theorem 17 in Section 7.4 . In fact, from C B ⊗ B A ≃ ( B ⊗ C ) ⊗ ( A ⊗ B ) , C B ⊗ B A ≈ ( B ⊗ C ) ⊗ ( A ⊗ B ) ≈ ( C ⊗ B ) ⊗ ( B ⊗ A ) ≈ (from B ⊗ B ≈ B ) ≈ C ⊗ B ⊗ A ≈ B ⊗ ( A ⊗ C ) ⪯ (from the complete lattice L DB \= ( Ob DB , ⪯ , ⊗ , ⊕ ˆ ) in Proposition 39 ) ⪯ A ⊗ C (from A ⊗ C ≃ C A ) ≈ C A .

The identity element j A is defined by a schema mapping M 1 \= { Ψ } : Υ ˆ → A ⋂ α A , where Ψ is a SOtgd ⋀ { ∀ x ( r ( x ) ⇒ r ( x ) ) ∣ r ∈ A ⋂ α A } , and hence,

j A \= α ∗ ( MakeOperads ( M 1 ) ) \= { 1 R : R → R ∣ R ∈ T A } ⋃ { q ⊥ } : Υ ↠ A A .

In the case when A \= ⨄ 1 ≤ j ≤ m A j , m ≥ 2 is a complex object, with A A \= A ⊗ A so that j A is defined by the set of ptp arrows j A ⨄ \= id A ⊗ id A ⨄ with j A ˜ ≃ ⨄ j A ⨄ ˜ \= ⨄ id A ⊗ id A ⨄ ˜ \= A ⊗ A , and consequently, by Proposition 25 in Section 7.1 , j A is an epimorphism.

Analogously, for all other morphisms used in this proof a schema mapping can be provided from which they are derived by an R-algebra α .

It is easy to verify that for each pair of objects (i. e., databases) A and B in DB there exists f A B ∈ DB ( B A , ( T B ) T A ) , called “an action of T on B A ,” such that for all g ∈ DB ( A , B ) the following is valid:

f A B ∘ Λ ( g ∘ β ( A ) ) \= Λ ( T ( g ) ∘ β ( T A ) ) : Υ ⟶ ( T B ) T A ,

where β : Υ ⊗ _ ⟶ I DB is a left identity natural transformation of a monoid ( DB , ⊗ , Υ , α , β , γ ) , thus β ( A ) \= is A − 1 : Υ ⊗ A → A (where Υ ⊗ A \= T A from Theorem 18 ) and β ( T A ) \= id T A . In fact, we take f A B \= id B A (the action of T on f : A → B is equal to T f : T A → T B with T f ˜ \= f ˜ ), which is an identity action: moreover, B A ≃ A ⊗ B \= T A ⊗ T B ≃ T B T A . Hence, by considering that for A \= ⨄ 1 ≤ j ≤ m , m ≥ 1 , B \= ⨄ 1 ≤ i ≤ k , k ≥ 1 and is A − 1 : T A → A with is A − 1 ⨄ \= { is A j − 1 : T A j → A j ∣ 1 ≤ j ≤ m } , we obtain (see the proof of Theorem 21 ):

Λ ( T ( g ) ) ⨄ \= { T ( g j i ) ∣ ( g j i : A j → B i ) ∈ g ⨄ }

and

Λ ( g ∘ is A − 1 ) ⨄ \= { g j i ′ ∣ ( g j i ∘ is A j − 1 : T A j → B i ) ∈ g ∘ is A − 1 ⨄ , g j i ′ ˜ \= g j i ∘ is A j − 1 ˜ } \= { g j i ′ ∣ g j i ∈ g ⨄ , g j i ′ ˜ \= g j i ˜ ⋂ is A j − 1 ˜ } \= { g j i ′ ∣ g j i ∈ g ⨄ , g j i ′ ˜ \= g j i ˜ ⋂ T A j } ( from g j i ˜ ⊆ A j ⊗ B i \= T A j ⋂ T B i ⊆ T A j ) \= { g j i ′ ∣ g j i ∈ g ⨄ , g j i ′ ˜ \= g j i ˜ } .

Thus, for each g j i ∈ g ⨄ , g j i ′ ˜ \= g j i ˜ \= T ( g j i ) , i. e., g j i ′ \= T ( g j i ) and, consequently,

(7.2) Λ ( g ∘ is A − 1 ) \= Λ ( T ( g ) ) .

Hence, f A B ∘ Λ ( g ∘ β ( A ) ) \= id B A ∘ Λ ( g ∘ is A − 1 ) \= Λ ( g ∘ is A − 1 ) \= (from ( 7.2 )) \= Λ ( T ( g ) ) \= Λ ( T ( g ) ∘ id T A ) \= Λ ( T ( g ) ∘ β ( T A ) ) . Consequently, T is a closed endofunctor.

The composition law m A , B , C may be equivalently represented by a natural transformation ․ m : ( B ⊗ _ ) ⊗ ( _ ⊗ B ) ․ ⊗ and an identity element j A by natural transformation ․ j : Y ․ ⊗ ∘ △ , where △ : DB ⟶ DB × DB is a diagonal functor, while Y : DB ⟶ DB is a constant endofunctor, Y ( A ) ≜ Υ for any A and Y ( f ) ≜ id Υ for any arrow f in DB . It is easy to verify that two coherent diagrams (associativity and unit axioms) commute, and hence, DB is enriched over itself V-category (as, i. e., Set category). Functor T is a V-functor: for each pair of objects A and B there exists an identity map (see above) f A B : B A ⟶ ( T B ) T A , subject to the compatibility with composition m and with the identities expressed by the commutativity of the diagram i. e., f A C ∘ m A , B , C \= m T A , T B , T C ∘ ( f B C ⊗ f A B ) and j T A \= f A B ∘ j A . From the fact that f B C and f A B are the identity arrows, ( f B C ⊗ f A B ) is identity as well, so it is enough to show that m T A , T B , T C \= m A , B , C . In fact, for any A \= ⨄ 1 ≤ j ≤ m , m ≥ 1 , B \= ⨄ 1 ≤ i ≤ k , k ≥ 1 and C \= ⨄ 1 ≤ l ≤ n , n ≥ 1 , and from C B ≃ B ⊗ C , B A ≃ A ⊗ B , we obtain m A , B , C ⨄ \= { in i l j i 1 : ( B i ⊗ C l ) ⊗ ( A j ⊗ B i 1 ) ↪ A j ⊗ C l ∣ 1 ≤ j ≤ m , 1 ≤ i , i 1 ≤ k , 1 ≤ l ≤ n } \= { in i l j i 1 : ( T B i ⋂ T C l ) ⋂ ( T A j ⋂ T B i 1 ) ↪ T A j ⋂ T C l ∣ 1 ≤ j ≤ m , 1 ≤ i , i 1 ≤ k , 1 ≤ l ≤ n } { in i l j i 1 : ( T ( T B i ) ⋂ T ( T C l ) ) ⋂ ( T ( T A j ) ⋂ T ( T B i 1 ) ) ↪ T ( T A j ) ⋂ T ( T C l ) ∣ 1 ≤ j ≤ m , 1 ≤ i , i 1 ≤ k , 1 ≤ l ≤ n } \= { in i l j i 1 : ( T B i ⊗ T C l ) ⊗ ( T A j ⊗ T B i 1 ) ↪ T A j ⊗ T C l ∣ 1 ≤ j ≤ m , 1 ≤ i , i 1 ≤ k , 1 ≤ l ≤ n } \= m T A , T B , T C ⨄ , i. e., m T A , T B , T C \= m A , B , C .

It is easy to verify that also natural transformations ․ η : I DB ․ T and ․ μ : T 2 ․ T satisfy the V-naturality condition (V-natural transformation η and μ are an Ob DB -indexed family of components δ A : Υ ↠ T A in DB ; for η , δ A : Υ ↠ ( T A ) A , ( T A ) A ≈ T A while for μ , δ A : Υ ↠ T A T 2 A , ( T A ) T 2 A ≈ T A ). This map f A B is equal also for the endofunctor identity I DB , and for the endofunctor T 2 , because B A ≃ A ⊗ B ≃ ( T B ) T A \= ( T 2 B ) T 2 A .  □

In fact, each monoidal closed category is itself a V-category: hom-sets from A to B are defined as “internalized” hom-objects (cotensors) B A . The composition is given by the image of the bijection Λ : DB ( D ⊗ A , C ) ≃ DB ( D , C A ) , where D \= C B ⊗ B A , of the arrow ε B ∘ ( id C B ⊗ ε A ) ∘ α C B , B A , A , and hence, m A , B , C \= Λ ( ε B ∘ ( id C B ⊗ ε A ) ∘ α C B , B A , A ) \= Λ ( eval B , C ∘ ( id C B ⊗ eval A , B ) ∘ α C B , B A , A ) , i. e., a monomorphism. The identities are given by the image of the isomorphism β A : Υ ⊗ A ⟶ A , under the bijection Λ : DB ( Υ ⊗ A , A ) ≃ DB ( Υ , A A ) , and hence, j A \= Λ ( β A ) : Υ ↠ A A ( j A that is an epimorphism).

Moreover, for a V-category DB , the following isomorphism (which extends the tensor-cotensor isomorphism Λ of exponential diagram in Theorem 21 ) is valid in all enriched Lawvere theories [ 107 ], DB ( D ⊗ A , C ) ≃ DB ( D , C A ) ≃ DB ( A , DB ( D , C ) ) .

Finally, from the fact that DB is an lfp category enriched over the lfp symmetric monoidal closed category with a tensor product ⊗ (i. e., the matching operator for databases), and the fact that T is a finitary enriched monad on DB , from the Kelly–Power theorem we have that DB admits a presentation by operations and equations, which what was implicitly assumed in the definition of this power-view operator (see also [ 61 ], [ 112 ]).

7.5.2   Internalized Yoneda embedding

As we have seen in Section 7.5.1 , the fact that a monoidal structure is closed means that we have an internal hom-functor ( _ ) ( _ ) : DB OP × DB → DB , which “internalizes” the external hom-functor, hom : DB OP × DB → Set , such that for any two objects A and B , the hom-object B A \= ( _ ) ( _ ) ( A , B ) represents the hom-set hom ( A , B ) \= DB ( A , B ) (the set of all morphisms from A to B ). We may apply the Yoneda embedding to the DB category by the contravariant functor H : DB OP → Set DB , such that for any object A we obtain a functor H A \= DB ( A , _ ) : DB → Set , and hence, for any object B in DB , H A ( B ) \= hom ( A , B ) \= DB ( A , B ) is a hom-set of all morphisms in DB between A and B , and for any morphism f : B → C in DB the function H A ( f ) \= DB ( A , f ) : DB ( A , B ) → DB ( A , C ) is a composition H A ( f ) \= f ∘ _ .

The internalized Yoneda embedding can be obtained by replacing the base Set category with the base database category DB , and hence, this embedding is provided by the contravariant functor H ‾ : DB OP → DB DB . So, we internalize a hom-set H A ( B ) \= hom ( A , B ) \= DB ( A , B ) in Set by the (co)tensor H ‾ A ( B ) \= A ⊗ B in DB , and we internalize a composition function H A ( f ) \= f ∘ _ in Set by the (co)tensor composition of morphisms in DB , H ‾ A ( f ) \= id A ⊗ f : A ⊗ B → A ⊗ C .

Proposition 43.

For any object A in DB with a monomorphisms in A : A ↪ Υ , the natural transformation ϕ : H ‾ A → T is monomorphic and such that ϕ \= in A ⊗ id { _ } .

Proof.

For any object A , from the internalized Yoneda embedding H ‾ : DB OP → DB DB , we obtain the covariant functor H ‾ A \= H ‾ ( A ) such that H ‾ A \= A ⊗ _ : DB → DB . Consequently, for the covariant power-view functor T : DB → DB , the natural transformation ․ ϕ : H ‾ A ․ T is well-defined and monomorphic if, for every arrow f : B → C in DB , the following diagram commutes: Notice that, from the fact that for each A ∈ OB DB , A ⪯ Υ and H ‾ Υ \= Υ ⊗ _ \= T . Thus, ϕ : H ‾ A → H ‾ Υ , i. e., for any object B , ϕ B \= in A ⊗ id B : A ⊗ B ↪ Υ ⊗ B and ϕ C \= in A ⊗ id c , where in A : A ↪ Υ is the unique monomorphism (in this case the inclusion) of A into the total object Υ, so that the diagram above can be reduced to the following commutative diagram in DB for any f ∈ DB ( B , C ) :

so that T f ∘ Φ B \= ( id Υ ⊗ f ) ∘ ( in A ⊗ id B ) \= (from functorial property of ⊗) \= ( id Υ ∘ in A ) ⊗ ( f ∘ id B ) \= in A ⊗ f \= ( in A ∘ id A ) ⊗ ( id C ∘ f ) \= ( in A ⊗ id C ) ∘ ( id A ⊗ f ) \= ϕ C ∘ H ‾ A ( f ) . Consequently, ϕ \= id { _ } ⊗ in A .  □

This proposition provides the idea in which way we are able, by using the contravariant functor H ‾ : DB OP → DB DB , to define the internalized Yoneda representation of the arrows in DB OP by the natural transformations in the category of functors DB DB : by assuming that in Proposition 43 , the natural transformation ϕ \= H ‾ ( in A OP ) is just the Yoneda representation of the epimorphism in A OP : Υ ↠ A in DB OP (i. e., of the monomorphism in A : A ↪ Υ in DB ).

Corollary 27.

The internalized Yoneda representation is provided by the contravariant functor H ‾ : DB OP → DB DB , defined as follows:

  • For each object A, we define the endofunctor H ‾ A \= H ‾ ( A ) : DB → DB such that for any f : B → C , H ‾ A ( f ) \= H ‾ ( A ) ( f ) \= id A ⊗ f : H ‾ A ( B ) → H ‾ A ( C ) , where H ‾ A ( B ) \= B ⊗ A ≃ A B .

  • For each arrow g OP : D → A in DB OP , we define the natural transformation ϕ \= H ‾ ( g OP ) \= g ⊗ id { _ } : H ‾ ( A ) → H ‾ ( D ) .

In fact, this corollary can be represented by the following commutative diagram in DB :

A   Appendix

A.1   Introduction to lattices, algebras and logics

Lattices are the posets (partially ordered sets) such that for all their elements a and b , the set { a , b } has both a join (lub – least upper bound) and a meet (glb – greatest lower bound) with a partial order ≤ (reflexive, transitive and antisymmetric). A bounded lattice has the greatest (top) and least (bottom) element, denoted by convention as 1 and 0. Finite meets in a poset will be written as 1,∧ and finite joins as 0,∨. By ( W , ≤ , ∧ , ∨ , 0 , 1 ) , we denote a bounded lattice iff for every a , b , c ∈ W the following equations are valid:

1.

a ∨ a \= a , a ∧ a \= a (idempotency laws)

2.

a ∨ b \= b ∨ a , a ∧ b \= b ∧ a (commutativity laws)

3.

a ∨ ( b ∨ c ) \= ( a ∨ b ) ∨ c , a ∧ ( b ∧ c ) \= ( a ∨ b ) ∧ c (associativity laws)

4.

a ∨ 0 \= a , a ∧ 1 \= a

5.

a ∨ ( b ∧ a ) \= a , a ∧ ( b ∨ a ) \= a (absorption laws)

It is distributive if it satisfies the distributivity laws.

6.

a ∨ ( b ∧ c ) \= ( a ∨ b ) ∧ ( a ∨ c ) , a ∧ ( b ∨ c ) \= ( a ∧ b ) ∨ ( a ∧ c ) .

A lattice W is complete if each (also infinite) subset S ⊆ W (or, S ∈ P ( W ) where P is the powerset symbol, with empty set ∅ ∈ P ( W ) ) has the least upper bound (lub, supremum) denoted by ⋁ S ∈ W . When S has only two elements, the supremum corresponds to the join operator “∨.” Each finite bounded lattice is a complete lattice. Each subset S has the greatest lower bound (glb, infimum) denoted by ⋀ S ∈ W , given as ⋁ { a ∈ W ∣ ∀ b ∈ S . a ≤ b } . A complete lattice is bounded and has the bottom element 0 \= ⋁ ∅ \= ⋀ W ∈ W and the top element 1 \= ⋀ ∅ \= ⋁ W ∈ W . An element a ∈ W is compact iff whenever ⋀ S exists and a ≤ ⋀ S for S ⊆ W ; then a ≤ ⋀ S ′ for some finite S ′ ⊆ W . W is compactly generated iff every element in W is a supremum of compact elements. A lattice W is algebraic if it is complete and compactly generated.

A function l : W → Y between the posets W , Y is monotone if a ≤ a ′ implies l ( a ) ≤ l ( a ′ ) for all a , a ′ ∈ W . Such a function l : W → Y is said to have a right (or upper) adjoint if there is a function r : Y → W in the reverse direction such that l ( a ) ≤ b iff a ≤ r ( b ) for all a ∈ W , b ∈ Y . Such a situation forms a Galois connection and will often be denoted by l ⊣ r . Then l is called a left (or lover) adjoint of r . If W , Y are complete lattices (posets), then l : W → Y has a right adjoint iff l preserves all joins (it is additive , i. e., l ( a ∨ b ) \= l ( a ) ∨ l ( b ) and l ( 0 W ) \= 0 Y where 0 W , 0 Y are bottom elements in complete lattices W and Y , respectively). The right adjoint is then r ( b ) \= ⋁ { c ∈ W ∣ l ( c ) ≤ b } . Similarly, a monotone function r : Y → W is a right adjoint (it is multiplicative , i. e., has a left adjoint) iff r preserves all meets; the left adjoint is then l ( a ) \= ⋀ { c ∈ Y ∣ a ≤ r ( c ) } .

Each monotone function l : W → Y on a complete lattice (poset) W has both a least fixed point (Knaster–Tarski) μ l ∈ W and greatest fixed point ν l ∈ W . These can be described explicitly as μ l \= ⋀ { a ∈ W ∣ l ( a ) ≤ a } and ν l \= ⋁ { a ∈ W ∣ a ≤ l ( a ) } .

In what follows, we write b < a iff ( b ≤ a and not a ≤ b ) and we denote by a ⋈ b two unrelated elements in W (so that not ( a ≤ b or b ≤ a )). An element in a lattice c ≠ 0 is a join-irreducible element iff c \= a ∨ b implies c \= a or c \= b for any a , b ∈ W . An element in a lattice a ∈ W is an atom iff a > 0 and ∄ b . ( a > b > 0 ) .

A lower set (down closed) is any subset Y of a given poset ( W , ≤ ) such that, for all elements a and b , if a ≤ b and b ∈ Y then a ∈ Y .

A Heyting algebra is a distributive bounded lattice W with finite meets and joins such that for each element a ∈ W , the function ( _ ) ∧ a : W → W has a right adjoint a ⇀ ( _ ) that is also called an algebraic implication. An equivalent definition can be given by considering a bonded distributive lattice such that for all a and b in W there is a greatest element c in W , denoted by a ⇀ b , such that c ∧ a ≤ b , i. e., a ⇀ b \= ⋁ { c ∈ W ∣ c ∧ a ≤ b } (relative pseudo-complement). We say that a lattice is relatively pseudo-complemented (r. p. c.) lattice if a ⇀ b exists for every a and b in W . Thus, a Heyting algebra is, by definition, an r. p. c. lattice that has 0.

Formally, a distributive bounded lattice ( W , ≤ , ∧ , ∨ , 0 , 1 ) is a Heyting algebra iff there is a binary operation ⇀ on W such that for every a , b , c ∈ W :

7.

a ⇀ a \= 1 ,

8.

a ∧ ( a ⇀ b ) \= a ∧ b , b ∧ ( a ⇀ b ) \= b ,

9.

a ⇀ ( b ∧ c ) \= ( a ⇀ b ) ∧ ( a ⇀ c ) .

In a Heyting algebra, we can define the negation ¬ a as a pseudo-complement a ⇀ 0 . Then a ≤ ¬ ¬ a . Each finite distributive lattice is a Heyting algebra. A complete Heyting algebra is a Heyting algebra H \= ( W , ≤ , ∧ , ∨ , ⇀ , ¬ , 0 , 1 ) , which is complete as a poset. A complete distributive lattice is thus a complete Heyting algebra iff the following infinite distributivity holds [ 113 ]:

10.

a ∧ ⋁ i ∈ I b i \= ⋁ i ∈ I ( a ∧ b i ) , for every a , b i ∈ W , i ∈ I .

The negation and implication operators can be represented as the following monotone functions: ¬ : W → W OP and ⇀ : W × W OP → W OP , where W OP is the lattice with inverse partial ordering and ∧ OP \= ∨ , ∨ OP \= ∧ .

The following facts are valid in any H :

(H1)

a ≤ b iff a ⇀ b \= 1 , ( a ⇀ b ) ∧ ( a ⇀ ¬ b ) \= ¬ a

(H2)

¬ 0 \= 0 OP \= 1 , ¬ ( a ∨ b ) \= ¬ a ∨ OP ¬ b \= ¬ a ∧ ¬ b (additive negation), with the following weakening of classical propositional logic:

(H3)

¬ a ∨ b ≤ a ⇀ b , a ≤ ¬ ¬ a , ¬ a \= ¬ ¬ ¬ a

(H4)

a ∧ ¬ a \= 0 , a ∨ ¬ a ≤ ¬ ¬ ( a ∨ ¬ a ) \= 1 (weakening excluded-middle)

(H5)

¬ a ∨ ¬ b ≤ ¬ ( a ∧ b ) (weakening of De Morgan laws).

Notice that since negation ¬ : W → W OP is a monotonic and additive operator, it is also a modal algebraic negation operator. The smallest complete distributive lattice is denoted by 2 ={0,1} with twp classic values, false and true, respectively. It is also a complemented Heyting algebra, and hence it is Boolean.

From the point of view of Universal algebra, given a signature Σ with a set of functional symbols o i ∈ Σ with arity ar : Σ → N , an algebra (or algebraic structure) A \= ( W , Σ A ) is a carrier set W together with a collection Σ A of operations on W with an arity n ≥ 0 . An n -ary operator (functional symbol) o i ∈ Σ , ar ( o i ) \= n on W will be named an n -ary operation (a function) o i ˆ : W n → W in Σ A that takes n elements of W and returns a single element of W . Thus, a 0-ary operator (or nullary operation) can be simply represented as an element of W , or a constant, often denoted by a letter like a (thus, all 0-ary operations are included as constants into the carrier set of algebra). An algebra A is finite if the carrier set W is finite; it is finitary if each operator in Σ A has a finite arity. For example, a lattice is an algebra with signature Σ L \= { ∧ , ∨ , 0 , 1 } , where ∧ and ∨ are binary operations (meet and join operations, respectively), while 0,1 are two nullary operators (the constants). The equational semantics of a given algebra is a set of equations E between the terms (or expressions) of this algebra (e. g., a distributive lattice is defined by the first six equations above).

Given two algebras A \= ( W , Σ A ) , A ′ \= ( W ′ , Σ A ) of the same type (with the same signature Σ and set of equations), a map h : W → W ′ is called a homomorphism if for each n -ary operation o i ˆ ∈ Σ A and a 1 , … , a n ∈ W , h ( o i ˆ ( a 1 , … , a n ) ) \= o i ′ ˆ ( h ( a 1 ) , … , h ( a n ) ) . A homomorphism h is called an isomorphism if h is a bijection between respective carrier sets; it is called a monomorphism (or embedding) if h is injective function from W into W ′ . An algebra A ′ is called a homomorphic image of A if there exists a homomorphism from A onto A ′ . An algebra A ′ is a subalgebra of A if W ′ ⊆ W , the nullary operators are equal and the other operators of A ′ are the restrictions of operators of A to W ′ .

A subuniverse of A is a subset W ′ of W , which is closed under operators of A , i. e., for any n -ary operation o ˆ i ∈ Σ A and a 1 , … , a n ∈ W ′ , o ˆ i ( a 1 , … , a n ) ∈ W ′ . Thus, if A ’ is a subalgebra of A , then W ′ is a subuniverse of A . The empty set may be subuniverse, but it is not the underlying carrier set of any subalgebra. If A has nullary operators (constants), then every subuniverse contains them as well.

Given an algebra A , Sub ( A ) denotes the set of subuniverses of A , which is an algebraic lattice. For Y ⊆ W , we say that Y generates A (or Y is a set of generators of A ) if W \= Sg ( Y ) ≜ ⋂ { Z ∣ Y ⊆ Z and Z is a subuniverse of A } . Sg is an algebraic closure operator on W : for any Y ⊆ W , let F ( Y ) \= Y ⋃ { o ˆ i ( b 1 , … , b k ) | o i ∈ Σ A and b 1 , … , b k ∈ Y } , with F 0 ( Y ) \= Y , F n + 1 ( Y ) \= F ( F n ( Y ) ) , n ≥ 0 , so that for finitary A , Y ⊆ F ( Y ) ⊆ F 2 ( Y ) ⊆ … , and consequently, Sg ( Y ) \= Y ⋃ F ( Y ) ⋃ F 2 ( Y ) ⋃ … , and from this it follows that if a ∈ Sg ( Y ) then a ∈ F n ( Y ) for some n < ω ; hence, for some finite Z ⊆ Y , a ∈ F n ( Z ) , thus a ∈ Sg ( Z ) , i. e., Sg is an algebraic closure operator.

The algebra A is finitely generated if it has a finite set of generators.

Let X be a set of variables. We denote by T X the set of terms with variables x 1 , x 2 , … in X of a type Σ of algebras, defined recursively by

  • all variables and constants (nullary functional symbols) are in T X ;

  • if o i ∈ Σ , n \= ar ( o i ) ≥ 1 , and t 1 , … , t n ∈ T X then o i ( t 1 , … , t n ) ∈ T X .

If X \= ∅ , then T ∅ denotes the set of ground terms. Given a class K of algebras of the same type (signature Σ), the term algebra ( T X , Σ ) is a free algebra with universal (initial algebra) property: for every algebra A \= ( W , Σ ) ∈ K and map f : X → W , there is a unique homomorphism f # : T X → W that extends f to all terms. Given a term t ( x 1 , … , x n ) over X and given an algebra A \= ( W , Σ A ) of type Σ, we define a mapping t ˆ : W n → W by: (1) if t is a variable x i , then t ˆ ( a 1 , … , a n ) \= a i is the i -th projection map; (2) if t is of the form o i ( t 1 ( x 1 , … , x n ) , … , t k ( x 1 , … , x n ) ) , where o i ∈ Σ , then t ˆ ( a 1 , … , a n ) \= o ˆ i ( t ˆ 1 ( a 1 , … , a n ) , … , t ˆ k ( a 1 , … , a n ) ) . Thus, t ˆ is the term function on A corresponding to term t . For any subset Y ⊆ W ,

Sg ( Y ) \= { t ˆ ( a 1 , … , a n ) ∣ t is n -ary term of type Σ , n < ω and a 1 , … , a n ∈ Y } .

The product of two algebras of the same type A and A ′ is the algebra A × A ′ \= ( W × W ′ , Σ × ) such that for any n -ary operator o i , 2 ˆ ∈ Σ × and ( a 1 , b 1 ) , … , ( a n , b n ) ∈ W × W ′ , n ≥ 1 , o i , 2 ˆ ( ( a 1 , b 1 ) , … , ( a n , b n ) ) \= ( o i ˆ ( a 1 , … , a n ) , o i ′ ˆ ( b 1 , … , b n ) ) . In what follows, where there is no ambiguity, we will write o i ( a 1 , … , a n ) for o i ˆ ( a 1 , … , a n ) as well and Σ for Σ A of any algebra A of this type Σ.

Given a Σ-algebra A with the carrier W , we say that an equivalence relation Q on W agrees with the n -ary operation o i ∈ Σ when for n -tuples ( a 1 , … , a n ) , ( b 1 , … , b n ) ∈ W n we have ( o i ( a 1 , … , a n ) , o i ( b 1 , … , b n ) ) ∈ Q if ( a i , b i ) ∈ Q for i \= 1 , … , n . We say that equivalence relation Q on a Σ-algebra A is a congruence on A if it agrees with every operation in Σ. If A is a Σ-algebra and Q a congruence on A , then there exists a unique Σ-algebra on the quotient set W / Q of the carrier W of A such that the natural mapping W → W / Q (which maps each element a ∈ W into its equivalence class [ a ] ∈ W / Q ) is a homomorphism. We will denote such an algebra as A / Q \= ( W / Q , Σ ) and will call it a quotient algebra of an algebra A by the congruence Q , such that for each its k -ary operation o ˆ i ′ , we have o ˆ i ′ ( [ a 1 ] , … , [ a k ] ) \= [ o ˆ i ( a 1 , … , a k ) ] .

Let K be a class of algebras of the same type. We say that K is a variety if K is closed under homomorphic images, subalgebras and products. Each variety can be seen as a category with objects being the algebras and arrows the homomorphisms between them.

The fundamental Birkhoff’s theorem in Universal algebra demonstrates that a class of algebras forms a variety iff it is equationally definable. For example, the class of all Heyting algebras (which are definable by the set E of nine equations above), denoted by HA \= ( Σ H , E ) , is a variety. Arend Heyting produced an axiomatic system of propositional logic, which was claimed to generate as theorems precisely those sentences that are valid according to the intuitionistic conception of truth. Its axioms are all axioms of the Classic Propositional Logic (CPL) having a set of propositional symbols p , q , … ∈ PR and the following axioms ( ϕ , ψ , φ denotes arbitrary propositional formulae):

(1)

ϕ ⇒ ( ϕ ∧ ϕ )

(2)

( ϕ ∧ ψ ) ⇒ ( ψ ∧ ϕ )

(3)

( ϕ ⇒ ψ ) ⇒ ( ( ϕ ∧ φ ) ⇒ ( ψ ∧ φ ) )

(4)

( ( ϕ ⇒ ψ ) ∧ ( ψ ⇒ φ ) ) ⇒ ( ϕ ⇒ φ )

(5)

ψ ⇒ ( ϕ ⇒ ψ )

(6)

( ϕ ∧ ( ϕ ⇒ ψ ) ) ⇒ ψ

(7)

ϕ ⇒ ( ϕ ∨ ψ )

(8)

( ϕ ∨ ψ ) ⇒ ( ψ ∨ ϕ )

(9)

( ( ϕ ⇒ φ ) ∧ ( ψ ⇒ φ ) ) ⇒ ( ( ϕ ∨ ψ ) ⇒ φ )

and for negation in CPL:

(10)

ϕ ⇒ ( ¬ ϕ ⇒ ψ )

(11)

( ( ϕ ⇒ ψ ) ∧ ( ϕ ⇒ ¬ ψ ) ) ⇒ ¬ ϕ

(12)

ϕ ∨ ¬ ϕ

except for the 12th axiom of “excluded middle,” which according to a constructivist attitude (L. E. J. Brouwer) has to be replaced by “ either I have constructively demonstrated ϕ , or I have constructively demonstrated that ϕ is false, ” equivalent to modal formula □ ϕ ∨ □ ¬ ϕ , where □ is a “necessity” universal modal operator in S4 modal logic (with transitive and symmetric accessibility relations between the possible worlds in Kripke semantics, i. e., where this relation is partial ordering ≤). In the same constructivist attitude, ¬ ¬ ϕ ⇒ ϕ is not valid (different from CLP). According to Brouwer, to say that ϕ is not true means only that I have not at this time constructed ϕ , which is not the same as saying ϕ is false.

In fact, in Intuitionistic Logic (IL) , ϕ ⇒ ψ is equivalent to □ ( ϕ ⇒ c ψ ) , i. e., to □ ( ¬ c ϕ ∨ ψ ) where “ ⇒ c ” is a classical logical implication and “ ¬ c ” is a classical negation and ¬ ϕ is equivalent to □ ¬ c ϕ . Thus, in IL, the conjunction and disjunction are that of CPL and only the implication and negation are modal versions of classical versions of the implication and negation, respectively.

A.1.1   Introduction to deductive logic and binary sequent calculus

The concepts introduced here, based on the work of Tarski, are basic to the development of nonmonotonic logic in the rest of the paper.

We assume that a fixed 2-valued (f,false and t,true) object language L is given. The details of L are left open, except that it contains the standard connectives, ⇒,∧,∨ (material implication, conjunction and disjunction, respectively). Hence, the set L 0 of sentences of L is closed under the rules: f ∈ L 0 ; if ϕ , ψ ∈ L 0 then ϕ ⇒ ψ , ϕ ∧ ψ , ϕ ∨ ψ ∈ L 0 . ¬ ϕ is taken as a abbreviation of ϕ ⇒ f . We use ∀ symbol for “for all” quantifier, and ∃ for existential quantifier.

A consequence relation is a binary relation ⊢, which takes a set of sentences Γ ⊆ L 0 as its first argument and a single sentences ϕ ∈ L 0 as its second, denoted by Γ ⊢ ϕ . Equivalently, we can define a consequence operation (infinitary) mapping C : P ( L 0 ) → P ( L 0 ) (here P ( L 0 ) denotes the set of all subsets of L 0 ), such that C ( Γ ) \= { ϕ ∣ Γ ⊢ ϕ } , and vice versa, Γ ⊢ ϕ iff ϕ ∈ C ( Γ ) . The finitary version of this operator is a mapping C fin : P fin ( L 0 ) → P ( L 0 ) , where P fin is a finitary powerset operator. We write C ( Γ , Δ ) instead of C ( Γ ⋃ Δ ) , and C ( ϕ ) instead of C ( { ϕ } ) . The following table defines properties of the deductive monotonic consequence relation (reflexivity, cut, monotonicity and compactness):

The finitistic or “Gentzen-style” ( Table A.1 ):

Table A.1 The finitistic or “Gentzen-style”

ϕ ∈ Γ implies Γ ⊢ ϕ
Γ ⋃ Δ ⊢ ϕ , ∀ ψ ∈ Δ . ( Γ ⊢ ψ ) implies Γ ⊢ ϕ
Γ ⊢ ϕ , Γ ⊆ Δ implies Δ ⊢ ϕ
if Γ ⊢ ϕ then for some finite Δ ⊆ Γ , Δ ⊢ ϕ

The infinitistic or “Tarski-style” ( Table A.2 ):

Table A.2 The infinitistic or “Tarski-style”

Γ ⊆ C ( Γ )
Δ ⊆ C ( Γ ) implies C ( Γ ⋃ Δ ) ⊆ C ( Γ )
Γ ⊆ Δ implies C ( Γ ) ⊆ C ( Δ )
C ( Γ ) ⊆ ⋃ { C ( Δ ) ∣ Δ ⊆ Γ and Δ is finite }

For example, the classical propositional logic is a deductive logic.

It is easy to verify that C is a closure idempotent operator: for any Γ, we obtain the closet set, called theory T \= C ( Γ ) \= C ( C ( Γ ) ) .

For Γ , Δ ⊆ L 0 , we shall say that Γ is consistent iff C ( Γ ) ≠ L 0 and that Γ is consistent with Δ iff C ( Γ , Δ ) ≠ L 0 . A set is inconsistent iff it is not consistent.

A set Γ is L -maximal iff is consistent and for every Δ, if Γ ⊆ Δ and Δ consistent, then Γ \= Δ .

We denote by M L the set of all L -maximal sets, and by T L the set of all theories in P ( L 0 ) , and by | Γ | \= { M ∈ M L ∣ Γ ⊆ M } the set of all maximal extensions of Γ.

For any deductive logic, the following properties hold:

1.

Every L -maximal set Γ is a theory (i. e., Γ \= C ( Γ ) ).

2.

(Lindenbaum) Every consistent set is included in some L -maximal theory.

3.

If ϕ ∉ C ( Γ ) , then there exists a L -maximal theory M such that C ( Γ ) ⊆ M and ϕ ∉ M .

4.

C ( Γ ) \= ⋂ | Γ | , i. e., ϕ is a consequence of Γ iff ϕ belongs to every maximal extension of Γ.

So far, our discussion has been purely syntactical and proof-theoretic. We shall also suppose that, with the language L and the consequence operator C comes a suitable semantics in the form of a set W (the universe), the elements of which we shall call worlds, and the relation ⊨ ⊆ W × P ( L 0 ) of satisfaction between worlds and formulae: ϕ ∈ C ( Γ ) iff ∀ w ∈ W . ( w ⊨ Γ implies w ⊨ ϕ ).

We use a deductive logics as underlying logic in order to define the inference operator for (generally nonmonotonic) query-answering in general data integration framework.

Binary sequent calculus

It has been developed by Gentzen [ 114 ], inspired on ideas of Paul Hertz [ 115 ]. Given a propositional logic language L A (a set of logic formulae), a binary sequent is a consequence pair of formulae, s \= ( ϕ ; ψ ) ∈ L A × L A , denoted also by ϕ ⊢ ψ .

A Gentzen system, denoted by a pair G \= ⟨ L , ⊩ ⟩ , where ⊩ is a consequence relation on a set of sequents in L ⊆ L A × L A , is said to be normal if it satisfies the following conditions: for any sequent s \= ϕ ⊢ ψ ∈ L and a set of sequents Γ \= { s i \= ϕ i ⊢ ψ i ∈ L ∣ i ∈ I } ,

1.

reflexivity: if s ∈ Γ , then Γ ⊩ s

2.

transitivity: if Γ ⊩ s and for every s ′ ∈ Γ , Θ ⊩ s ′ , then Θ ⊩ s

3.

finiteness: if Γ ⊩ s , then there is finite Θ ⊆ Γ such that Θ ⊩ s

4.

for any homomorphism σ from L into itself (i. e., a substitution), if Γ ⊩ s , then

σ [ Γ ] ⊩ σ ( s ) , i. e., { σ ( ϕ i ) ⊢ σ ( ψ i ) ∣ i ∈ I } ⊩ ( σ ( ϕ ) ⊢ σ ( ψ ) ) .

Notice that from (1) and (2) we obtain this monotonic property:

5.

if Γ ⊩ s and Γ ⊆ Θ , then Θ ⊩ s .

We denote the Tarskian closure operator by C : P ( L ) → P ( L ) , such that C ( Γ ) \= def { s ∈ L ∣ Γ ⊩ s } , with the properties: Γ ⊆ C ( Γ ) (from reflexivity (1)); it is monotonic, i. e., Γ ⊆ Γ 1 implies C ( Γ ) ⊆ C ( Γ 1 ) (from (5)), and an involution C ( C ( Γ ) ) \= C ( Γ ) as well. Thus, we obtain:

6.

Γ ⊩ s iff s ∈ C ( Γ ) .

Any sequent theory Γ ⊆ L is said to be a closed theory iff Γ \= C ( Γ ) . This closure property corresponds to the fact that Γ ⊩ s iff s ∈ Γ .

Each sequent theory Γ can be considered as a bivaluation (a characteristic function) β : L → 2 such that for any sequent s ∈ L , β ( s ) \= 1 iff s ∈ Γ .

A.1.2   Introduction to first-order logic and Tarski’s interpretations

We will shortly introduce the syntax of the first-order logic (FOL) language L , and its extensional semantics based on Tarski’s interpretations, is as follows.

Definition 55.

The syntax of the first-order logic language L is as follows:

Logic operators (∧,¬,∃) over bounded lattice of truth values 2 \= { f , t } , f for falsity and t for truth; Predicate letters p 1 k 1 , p 2 k 2 , … with a given arity k i ≥ 1 , i \= 1 , 2 , … , and special built-in identity binary predicate “≐,” in P ; Functional letters f 1 k 1 , f 2 k 2 , … with a given arity k i ≥ 1 in F (language constants c , d , … are considered as particular case of nullary functional letters); Variables x , y , z , … in V , and punctuation symbols (comma, parenthesis).

With the following simultaneous inductive definition of term and formula :

1.

All variables and constants are terms.

2.

If t 1 , … , t k are terms and f i k ∈ F is a k -ary functional symbol, then f i k ( t 1 , … , t k ) is a term, while p i k ( t 1 , … , t k ) is a formula for a k -ary predicate letter p i k ∈ P .

3.

If ϕ and ψ are formulae, then ( ϕ ∧ ψ ) , ¬ ϕ , and ( ∃ x i ) ϕ for x i ∈ V are formulae.

An interpretation (Tarski) I T consists in a nonempty domain D and a mapping that assigns to any predicate letter p i k ∈ P a relation R \= I T ( p i k ) ⊆ D k , to any functional letter f i k ∈ F a function I T ( f i k ) : D k → D , or equivalently, its graph relation R \= I T ( f i k ) ⊆ D k + 1 where the k + 1 -th column is the resulting function’s value, and to each individual constant c ∈ F one given element I T ( c ) ∈ D .

A predicate logic L P is a subset of the FOL without the quantifier ∃.

Remark.

The propositional logic can be considered as a particular case of predicate logic when all symbols in P are nullary, i. e., a set of propositional symbols, while F , D and V are empty sets. By considering that D 0 \= { ⟨ ⟩ } is a singleton set composed by empty tuple ⟨⟩, then for any p i ∈ P , I T ( p i ) ⊆ D 0 , i. e., I T ( p i ) \= f (empty set) or I T ( p i ) \= t (singleton set {⟨⟩}). That is, I T becomes an interpretation I T : P → 2 of this logic, which can be homomorphically extended to all formulae in the unique standard way.  □

In a formula ( ∃ x ) ϕ , the formula ϕ is called an “action field” for the quantifier ( ∃ x ) . A variable y in a formula ψ is called a bounded variable iff it is the variable of a quantifier ( ∃ y ) in ψ , or it is in the action field of a quantifier ( ∃ y ) in the formula ψ . A variable x is free in ψ if it is not bounded.

The universal quantifier is defined by ∀=¬∃¬. Disjunction and implication are expressed by ϕ ∨ ψ \= ¬ ( ¬ ϕ ∧ ¬ ψ ) , and ϕ ⇒ ψ \= ¬ ϕ ∨ ψ . In the FOL with the identity ≐, the formula ( ∃ 1 x ) ϕ ( x ) denotes the formula ( ∃ x ) ϕ ( x ) ∧ ( ∀ x ) ( ∀ y ) ( ϕ ( x ) ∧ ϕ ( y ) ⇒ ( x ≐ y ) ) .

We can introduce the sorts in order to be able to assign each variable x i to a sort S i ⊆ D where D is a given domain for the FOL (e. g., for natural numbers, for reals, for dates, etc. as used for some attributes in database relations). An assignment g : V → D for variables in V is applied only to free variables in terms and formulae. If we use sorts for variables, then for each sorted variable x i ∈ V an assignment g must satisfy the auxiliary condition g ( x i ) ∈ S i .

Such an assignment g ∈ D V can be recursively and uniquely extended into the assignment g ∗ : T → D , where T denotes the set of all terms, by:

1.

g ∗ ( t i ) \= g ( x ) ∈ D if the term t i is a variable x ∈ V .

2.

g ∗ ( t i ) \= I T ( c ) ∈ D if the term t i is a constant c ∈ F .

3.

If a term t i is f i k ( t 1 , … , t k ) , where f i k ∈ F is a k -ary functional symbol and t 1 , … , t k are terms, then g ∗ ( f i k ( t 1 , … , t k ) ) \= I T ( f i k ) ( g ∗ ( t 1 ) , … , g ∗ ( t k ) ) or, equivalently, in the graph-interpretation of the function, g ∗ ( f i k ( t 1 , … , t k ) ) \= u such that ( g ∗ ( t 1 ) , … , g ∗ ( t k ) , u ) ∈ I T ( f i k ) ⊆ D k + 1 .

In what follows, we will use the graph interpretation for functions in FOL. We denote by t i / g (or ϕ / g ) the ground term (or formula) without free variables, obtained by assignment g from a term t i (or a formula ϕ ), and by ϕ [ x / t i ] the formula obtained by uniformly replacing x by a term t i in ϕ . A sentence is a formula having no free variables.

A Herbrand base of a logic L is defined by

H \= { p i k ( t 1 , … , t k ) ∣ p i k ∈ P and t 1 , … , t k are ground terms } .

A FOL interpretation I is a triple ( D , g , I T ) , where D is domain of interpretation, g ∈ D V an assignment and I T is a function (called valuation v as well) that maps constants of FOL (nullary functions) into domain D , the k -ary predicate into relation D k and k -ary function into relation D k + 1 as explained above.

Tarski defined the satisfaction for the logic formulae in L and a given assignment g : V → D inductively (recursively), as follows:

If a formula ϕ is an atomic formula p i k ( t 1 , … , t k ) , then this assignment g satisfies ϕ iff ( g ∗ ( t 1 ) , … , g ∗ ( t k ) ) ∈ I T ( p i k ) ; g satisfies ¬ ϕ iff it does not satisfy ϕ ; g satisfies ϕ ∧ ψ iff g satisfies ϕ and g satisfies ψ ; g satisfies ( ∃ x i ) ϕ iff exists an assignment g ′ ∈ D V that may differ from g only for the variable x i ∈ V , and g ′ satisfies ϕ .

A model is M \= ( D , I T ) , so that for g ∈ D V and a formula ϕ we use the notation

(A.1) ⊧ M ⊧ g ϕ or I T ∗ ( ϕ / g ) \= t ∈ 2

which means “ the formula ϕ is true in the model M \= ( D , I T ) , for assignment g .”

Remark.

In what follows, instead of notation ⊧ M ⊧ g ϕ we prefer to use the nonstandard functional notation I T ∗ ( ϕ / g ) , because the new symbol I T ∗ denotes a homomorphism , introduced in [ 7 ], between syntax algebra of FOL and extensional algebra of relations (of extensional logic), which allows evaluation of the truth value of a sentence. So, for ground atoms I T ∗ is equal to Herbrand interpretation, instead, for atoms with variables only it is equal to original Tarski’s mapping I T . That is, for any atom p j k ( x ) with variables x \= ( x 1 , … , x k ) ,

(A.2) I T ( p j k ) \= I T ∗ ( p j k ( x ) ) \= { ( g ( x 1 ) , … , g ( x k ) ) ∣ g ∈ D V , and I T ∗ ( p j k ( x ) / g ) \= t } .

 □

A formula ϕ is true for a given interpretation I T iff ϕ is satisfied by every assignment g ∈ D V . A formula ϕ is valid (i. e., tautology) iff ϕ is true for every Tarski’s interpretation I T ∈ I T . An interpretation I T is a model of a set of formulae Γ iff every formula ϕ ∈ Γ is true in this interpretation. By FOL ( Γ ) , we denote the FOL with a set of assumptions Γ, and by I T ( Γ ) the subset of Tarski’s interpretations that are models of Γ, with I T ( ∅ ) \= I T . A formula ϕ is said to be a logical consequence of Γ, denoted by Γ ⊩ ϕ , iff ϕ is true in all interpretations in I T ( Γ ) .

Thus, ⊩ ϕ iff ϕ is a tautology.

The basic set of axioms of the FOL are that of the propositional logic with two additional axioms:

(A1)

( ∀ x ) ( ϕ ⇒ ψ ) ⇒ ( ϕ ⇒ ( ∀ x ) ψ ) , ( x does not occur in ϕ and it is not bound in ψ ).

(A2)

( ∀ x ) ϕ ⇒ ϕ [ x / t i ] , (neither x nor any variable in t i occurs bound in ϕ ).

(A3)

For the FOL with identity (the binary predicate ≐), we need the proper axiom x 1 ≐ x 2 ⇒ ( x 1 ≐ x 3 ⇒ x 2 ≐ x 3 ) .

We denote by R \= the Tarski’s interpretation of ≐.

The inference rules are Modus Ponens and generalization (G) “ if ϕ is a theorem and x is not bound in ϕ, then ( ∀ x ) ϕ is a theorem. ”

Here, the FOL denotes this minimal first-order logic (consistent and complete), while FOL ( Γ ) denotes a logic extended by a new set of proper axioms in Γ, and generally (by Gödel theorem), it is not complete.

In what follows any open sentence, a formula ϕ ( x ) with a nonempty tuple of free variables x \= ( x 1 , … , x m ) , will be called a m -ary virtual predicate , denoted also by ϕ ( x 1 , … , x m ) . This definition contains the precise method of establishing the ordering of variables in this tuple: such a method that will be adopted here is the ordering of appearance, from left to right, of free variables in ϕ .

The FOL is considered as an extensional logic because two open sentences with the same tuple of variables ϕ ( x 1 , … , x m ) and ψ ( x 1 , … , x m ) are equal iff they have the same extension in a given interpretation I T , i. e., iff I T ∗ ( ϕ ( x 1 , … , x m ) ) \= I T ∗ ( ψ ( x 1 , … , x m ) ) , where I T ∗ is the unique extension of I T to all formulae, as follows:

1.

For a (closed) sentence ϕ / g , we have that I T ∗ ( ϕ / g ) \= t iff g satisfies ϕ , as recursively defined above.

2.

For an open sentence ϕ with the tuple of free variables ( x 1 , … , x m ) , we have that I T ∗ ( ϕ ( x 1 , … , x m ) ) ≜ { ( g ( x 1 ) , … , g ( x m ) ) ∣ g ∈ D V and I T ∗ ( ϕ / g ) \= t } .

It is easy to verify that for a formula ϕ with the tuple of free variables ( x 1 , … , x m ) ,

I T ∗ ( ϕ ( x 1 , … , x m ) / g ) \= t iff ( g ( x 1 ) , … , g ( x m ) ) ∈ I T ∗ ( ϕ ( x 1 , … , x m ) ) .

This extensional equality of virtual predicates can be generalized to the extensional equivalence when both predicates ϕ , ψ has the same set of free variables but their ordering in the tuples of free variables are not identical: such two virtual predicates are equivalent if the extension of the first is equal to the proper permutation of columns of the extension of the second virtual predicate. It is easy to verify that such an extensional equivalence corresponds to the logical equivalence denoted by ϕ ≡ ψ .

Let R \= ⋃ k ∈ N P ( D k ) \= ∑ k ∈ N P ( D k ) be the set of all k -ary relations over a domain D , where k ∈ N \= { 0 , 1 , 2 , … } . Then this extensional equivalence between two relations R 1 , R 2 ∈ R with the same arity will be denoted by R 1 ≈ R 2 , while the extensional identity will be denoted in the standard way by R 1 \= R 2 .

A.1.3   Introduction to multimodal logics and Kripke semantics

A multimodal logic is a standard predicate/propositional logic (see Definition 55 ) extended by a number of existential modal operators ♢ i , i ≥ 1 . In the standard Kripke semantics, each existential modal operator ♢ i is defined by an accessibility binary relation R i ⊆ W × W , for a given set of possible worlds W . A more exhaustive and formal introduction to modal logics and their Kripke’s interpretations can easily be found in the literature, e. g., in [ 116 ].

Here, only a short version will be given, in order to clarify the definitions used in the next paragraphs. We define N \= { 0 , 1 , 2 , … , n } ⊂ N where n is a maximal arity of symbols in the finite set P ⋃ F of predicate and functional symbols respectively.

In the case of the propositional logics, we have that n \= 0 , so that P is a set of propositional symbols (that are the nullary predicate symbols) and F \= ∅ is the empty set. Here, we will present two definitions for modal logics, one for the propositional and other for predicate logics, as is used in current literature.

Definition 56 (Propositional multimodal logic).

By M \= ( W , { R i } , I K ) , we denote a multimodal Kripke’s interpretation with a set of possible worlds W , the accessibility relations R i ⊆ W × W , i \= 1 , 2 , … and a mapping I K : P → 2 W , such that for any propositional letter p i ∈ P , the function I K ( p i ) : W → 2 defines the truth of p i in a world w ∈ W .

For any formula φ , we define ⊧ M ⊧ w φ iff φ is satisfied in a world w ∈ W . For example, a given propositional letter p i is true in w , i. e., ⊧ M ⊧ w p i , iff I K ( p i ) ( w ) \= t .

The Kripke semantics is extended to all formulae as follows:

⊧ ⊧ ⊧ ⊧ ⊧ ⊧ ⊧ M ⊧ w φ ∧ ϕ iff M ⊧ w φ and M ⊧ w ϕ , M ⊧ w ¬ φ iff not M ⊧ w φ , M ⊧ w ♢ i φ iff exists w ′ ∈ W such that ( w , w ′ ) ∈ R i and M ⊧ w ′ φ .

The universal modal operator □ i is equal to ¬ ♢ i ¬ . A formula φ is said to be true in a Kripke’s interpretation M if for each possible world w , ⊧ M ⊧ w φ . A formula is said to be valid if it is true in each interpretation.

In a more general case, when n ≥ 1 we have the multimodal predicate logics defined as follows.

Definition 57 (Predicate multimodal logic).

By M \= ( W , { R i ∣ 1 ≤ i ≤ k } , D , I K ) , we denote a multimodal Kripke model with finite k ≥ 1 modal operators with a set of possible worlds W , the accessibility relations R i ⊆ W × W , nonempty domain D and a mapping I K : W × ( P ⋃ F ) → ⋃ n ∈ N ( 2 ⋃ D ) D n , such that for any world w ∈ W ,

1.

For any functional letter f i k ∈ F , I K ( w , f i k ) : D k → D is a function (interpretation of f i k in w ).

2.

For any predicate letter p i k ∈ P , the function I K ( w , p i k ) : D k → 2 defines the extension of p i k in a world w ,

‖ p i k ( x 1 , … , x k ) ‖ M , w ≜ { ( d 1 , … , d k ) ∈ D k ∣ I K ( w , p i k ) ( d 1 , … , d k ) \= t } .

For any formula φ , we define ⊧ M ⊧ w , g φ iff φ is satisfied in a world w ∈ W for a given assignment g : V → D . For example, a given atom p i k ( x 1 , … , x k ) is satisfied in w by assignment g , i. e., ⊧ M ⊧ w , g p i k ( x 1 , … , x k ) , iff I K ( w , p i k ) ( g ( x 1 ) , … , g ( x k ) ) \= t .

The Kripke semantics is extended to all formulae as follows:

⊧ ⊧ ⊧ ⊧ ⊧ ⊧ ⊧ M ⊧ w , g φ ∧ ϕ iff M ⊧ w , g φ and M ⊧ w , g ϕ , M ⊧ w , g ¬ φ iff not M ⊧ w , g φ , M ⊧ w , g ♢ i φ iff exists w ′ ∈ W such that ( w , w ′ ) ∈ R i and M ⊧ w ′ , g φ .

A formula φ is said to be true in a Kripke’s interpretation M if for each assignment function g and possible world w , ⊧ M ⊧ w , g φ . A formula is said to be valid if it is true in each interpretation.

Any virtual predicate ϕ ( x 1 , … , x k ) has different extensions ⊧ ‖ ϕ ( x 1 , … , x k ) ‖ M , w ≜ { ( g ( x 1 ) , … , g ( x k ) ) ∣ g ∈ D V and M ⊧ w , g ϕ } for different possible worlds w ∈ W . Thus, we cannot establish the simple extensional identity for two concepts as in FOL.

Remark.

We can consider the following reductions of the modal predicate logics.

The propositional modal logic can be considered as a particular case of a predicate modal logic when all symbols in P are nullary, i. e., a set of propositional symbols, while F , D and V are empty sets. So that I K is reduced to a mapping I K : P → 2 W , such that we do not use the assignments g , and for any propositional letter p i ∈ P , the function I K ( p i ) : W → 2 defines the truth of p i in a world w ∈ W .

A.2   Basic category theory

Category theory is an area of mathematics that examines in an abstract way the properties of particular mathematical concepts. Many significant areas of mathematics can be formalized as categories, and the use of category theory allows many intricate and subtle mathematical results in these fields to be stated, and proved, in a much simpler way than without the use of categories.

The most accessible example of a category is the category Set of (small) sets, where the objects are sets and the arrows are functions between them. However, it is important to note that the objects of a category need not be sets or the arrows functions; any way of formalizing a mathematical concept such that it meets the basic conditions on the behavior of objects and arrows is a valid category, and all the results of category theory will apply to it.

Category theory introduces a new, original linguistic component in mathematics: the language of arrows, commutative diagrams and, in the case of monoidal categories and in the higher-dimensional case, of geometric transformations of diagrams. Although these were for a long time considered to be merely linguistic devices, they should be seen as genuine conceptual ingredients of mathematical knowledge, which capture conceptual dependencies.

Categories were first introduced by Samuel Eilenberg and Saunders Mac Lane in 1942–1945 [ 12 ], in connection with algebraic topology. The study of categories is an attempt to axiomatically capture what is commonly found in various classes of related mathematical structures by relating them to the structure-preserving functions between them. A systematic study of category theory then allows us to prove general results about any of these types of mathematical structures from the axioms of a category.

In 1930s, the development and status of (First-order Logic) FOL is intimately linked to the formalization of set theory and the crystallization of foundational studies in the framework of ZF set theory. It is not entirely absurd to affirm that FOL and ZF were two sides of the same constitutive movement. FOL was enough to formalize set theories like ZF and the latter was enough to express and prove basic properties of FOL.The logicians of that period assimilated the axiomatization of set theory with the foundations of abstract mathematics. This assimilation probably made perfect sense in the 1930s and that many mathematicians identified abstract or modern mathematics with the set-based mathematics developed at that time. There was, however, a hiatus introduced between the practice of abstract mathematics and the foundational research. In some sense, the latter still had deep roots in nineteenth century mathematics via the works of Frege, Peano, Russell and Whitehead. This divergence increased considerably with the introduction of categorical methods in algebraic geometry, homological algebra, algebraic topology and homotopy theory in the 1960s, allowing various mathematicians to realize, with hindsight, that set theoretical foundations were not faithful to the abstract character of modern mathematics [ 117 ]:

“ In modern times it has been recognized that is possible to elaborate full mathematical theories dealing with elements of which the nature is not specified, that is, with abstract elements. A collection of these elements will be called an abstract set. ”

(Fréchet, 1951, p. 147)

The Elementary Theory of the Category of Sets (ETCS) [ 118 ] was introduced by Lawvere as early as 1964. In this paper, Lawvere proposed an axiomatization of set theory in a categorical framework. The axiomatization was later subsumed under the notion of an elementary topos where it became a special type of topos. It is developed in the standard FOL without dependent sorts. 1 Another framework in contrast with the previous approach, Makkai’s approach [ 119 ] is based on a general purpose formal system, namely First-Order Logic with Dependent Sorts (FOLDS). Homotopy type theory is a recent proposal undergoing a rapid and vigorous development. It is based on Martin-Löf type theory, introduced in the early 1970s to provide a formal framework for constructive mathematics. Homotopy type theory is a genuine type theory, not a first-order logic. Originally, all the variations on Martin-Löf type theory were motivated by the well-known Curry–Howard correspondence, i. e., the propositions-as-types interpretation. The correspondence is given by the following simple rule: a term x of a type X can be thought of as a proof of the corresponding proposition.

Thus, an abstract set , different from extensionally defined ZF theory of sets, is a set in which the elements are abstract. This is taken to mean that the nature of the elements is not specified. In other words, the elements have no other properties than those that they have in virtue of being elements of that specific set. The sets of ZF are not abstract in that sense. The abstract notion of set was explicitly endorsed by Lawvere in the 1970s [ 120 ]:

“ These considerations lead one to formulate the following “purified” concept of (constant) abstract set as the one actually used in naive set theoretic practice of modern mathematics: An abstract set X has elements each of which has no internal structure whatsoever; X has no internal structure except for equality and inequality of pairs of elements, and has no external properties save its cardinality: still an abstract set is more refined (less abstract) than a cardinal number in that it does have elements while a cardinal number does not. ”

(Lawvere, 1976, p. 119)

That is, nothing is known about the elements of a set X except that there is an internal identity relation between the elements. On the standard, extensional, conception of a set, one looks at the elements of the sets. Since the latter are fully identifiable individuals, they can be known, and knowing a set amounts to knowing these elements. Here, we take a different route: to know a set and its components, including its elements since these become a special case of the more general notion of component, one looks at it “geometrically,” i. e., by considering morphisms going in the set and morphisms going out of the set. How do we express identity of abstract sets? It is not a relation, but rather a structure. What can be declared in the given language is that abstract sets can be isomorphic . But we do not identify isomorphic sets, unless it is useful for some specific mathematical purpose. Notice that the universe of abstract sets is not a set nor a class: it is a category.

A category C consists of the following three mathematical entities: All we had to start with were the notions of (abstract) collection and operation.

  • A collection Ob C whose elements are called objects.

  • A collection Mor C whose elements are called morphisms or maps or arrows. Each morphism f has a unique source object A and target object B . The expression (arrow) f : A → B would be verbally stated as “ f is a morphism from A to B .” The expression hom ( A , B ) — alternatively expressed as hom C ( A , B ) , or mor ( A , B ) , or C ( A , B ) — denotes the hom-class of all morphisms from A to B . If for all A , B this hom-class is a set, this category C is called locally small .

  • A binary operation ∘, called composition of morphisms, such that for any three objects A , B and C , we have a function ∘ : hom ( A , B ) × hom ( B , C ) → hom ( A , C ) . Each morphism f ∈ hom ( A , B ) has a domain A \= dom ( f ) and codomain B \= cod ( f ) which are objects.

    The composition of f : A → B and g : B → C is written as g ∘ f , with two axioms:

    Associativity : If f : A → B , g : B → C and h : C → D , then h ∘ ( g ∘ f ) \= ( h ∘ g ) ∘ f ,

    Identity : For every object A , there exists a morphism id A : A → A called the identity morphism for A , such that for every morphism f : A → B , we have id B ∘ f \= f ∘ id A \= f .

From these axioms, it can be proved that there is exactly one identity morphism for every object. Because of that we can identify each object with its identity morphism. Relations among morphisms are often depicted using commutative diagrams, with nodes representing objects and arrows representing morphisms, e. g., g ∘ f \= h is graphically represented by the following commutative diagram:

Examples:

1.

Category Set , where the objects are small sets and the arrows are functions from one set to another.

2.

A preorder is a set X together with a binary relation ≤ which is reflexive (i. e., x ≤ x for all x ∈ X ), and transitive (i. e., x ≤ y and y ≤ z imply x ≤ z for all x , y , z ∈ X ). This can be seen as a category, with set of objects X and for every pair of objects ( x , y ) such that x ≤ y , exactly one arrow x → y .

3.

Any set X can be seen as a discrete category, with a set of objects X and only with the identity morphisms.

A morphisms f : A → B can have any of the following properties:

1.

Monomorphism (or monic) if f ∘ g 1 \= f ∘ g 2 implies g 1 \= g 2 for all morphisms g 1 , g 2 : X → A . It is denoted by f : A ↪ B . This monic is split if there exists g : B → A such that g ∘ f \= id A .

2.

Epimorphism (or epic) if g 1 ∘ f \= g 2 ∘ f implies g 1 \= g 2 for all morphisms g 1 , g 2 : B → X . It is denoted by f : A ↠ B . This epic is called split if there exists g : B → A such that f ∘ g \= id B (then f is a retraction of g ).

3.

Isomorphism if there exists a morphism g : B → A such that f ∘ g \= id B and g ∘ f \= id A . Any isomorphism is monic and epic. It is denoted by f : A ≃ B . Often we denote simply by A ≃ B the isomorphism of two objects. If f is split epic and monic, f is isomorphism.

For example, in Set the epimorphisms are surjective functions, the monomorphisms are injective functions, the isomorphisms are bijective functions.

Duality principle

The definition of epic is dual to the definition of monic. Given a category C \= ( Ob C , Mor C , id , ∘ ) , by C OP \= ( Ob C , Mor C OP , id , ∘ C OP ) , we denote the opposite category that have the same objects and where all arrows are reversed: f C OP ∘ C OP g C OP \= ( g ∘ f ) C OP (see diagram (A.13)), with bijection C ( A , B ) ≃ C OP ( B , A ) . Thus, f is monic in the category C iff f OP is epic in C OP , and vice versa. In general, given a property P of an object, arrow, diagram, etc., we can associate with P the dual property P OP . The object or arrow has a property P in C iff it has P OP in C OP . For example, if g ∘ f is monic, then f is monic. From this, by duality, if f OP ∘ g OP is epic then f OP is epic.

An object X is called terminal if for any object Y there is exactly one morphism from it into X in the category. Dually, one object X is called initial if for any object Y there is exactly one morphism from X to Y in the category. An object X is called zero object if it is both terminal and initial. For example, in Set the empty set is initial, while any singleton set is (up to isomorphism) terminal object.

Products of categories

For a given two categories A and B , we can construct a new category A × B , called a product of A and B , as follows: its object ( a , b ) is a pair of an object a ∈ Ob A and an object b ∈ Ob B , while its arrow ( f , g ) : ( a , b ) → ( c , d ) is a pair of an arrow f : a → c in Mor A and an arrow g : b → d in Mor B . So, the composition of arrows in A × B A × B follows the composition of arrows in A and in B , relatively. The identity arrows in A × B are pairs of the identity arrows in A and in B , relatively, i. e., for a given object ( a , b ) its identity arrow is id ( a , b ) \= ( id a , id b ) . We can construct analogously any finite product of a given category C , for n ≥ 1 , denoted by

C n ≜ C × ⋯ × C ︷ n

such that C 1 \= C , with its n -ary objects and arrows

(A.3) ( c 1 , … , c n ) ∈ Ob C n and ( f 1 , … , f n ) ∈ Mor C n

where for each 1 ≤ i ≤ n , c i ∈ Ob C and f i ∈ Mor C .

Functors are structure-preserving maps between categories. They can be thought of as morphisms in the category Cat of all (small) categories as objects, and all functors as morphisms. A (covariant) functor F from a category C to a category D , written F : C → D , consists of a pair of functions F \= ( F 0 , F 1 ) , F 0 : Ob C → Ob D and F 1 : Mor C → Mor D (in what follows, we will simply use F for both functions as well):

1.

For each object X in C , an object F 0 ( X ) in D ; and

2.

For each morphism f : X → Y in C , a morphism F 1 ( f ) : F 0 ( X ) → F 0 ( Y ) ,

such that the following two properties hold:

3.

For every object X in C , F 1 ( id X ) \= id F ( X ) ;

4.

For all morphisms f : X → Y and g : Y → Z , F 1 ( g ∘ f ) \= F 1 ( g ) ∘ F 1 ( f ) .

A contravariant functor F : C → D , is like a covariant functor, except that it “turns morphisms around” (“reverses all the arrows”). More specifically, every morphism f : X → Y in C must be assigned to a morphism F 1 ( f ) : F 0 ( Y ) → F 0 ( X ) in D . In other words, a contravariant functor is a covariant functor from the opposite category C op to D . Opposite category C op has the same objects as the category C . Given a composition of arrows f ∘ g in C its opposite arrow in C op is ( f ∘ g ) OP \= g OP ∘ f OP .

Every functor preserves epi, mono and isomorphisms.

A locally small category C , for any object X , has a representable functor F X \= C ( X , _ ) : C → Set , such that for any object Y , F X ( Y ) \= C ( X , Y ) , and any arrow f : Y → Y ′ gives by composition a function F X ( f ) : C ( X , Y ) → C ( X , Y ′ ) .

A functor F : C → D is called full if for every two objects A and B of C , F : C ( A , B ) → D ( F ( A ) , F ( B ) ) is a surjection. A functor F is called faithful if this map is always injective. A functor F is called endofunctor if D \= C .

A functor F reflects a property P if whenever the F -image of something (object, arrow, etc.) has P , then that that something has P . For example, the faithful functor reflects epimorphisms and monomorphisms. Each endofunctor F : C → C defines the algebras and coalgebras (the left and right commutative diagrams):

so that the morphism f : ( A , h ) → ( B , k ) , which represents the commutative diagram on the left, is a morphism between F-algebras ( A , h ) and ( B , k ) . For example, let F : Set → Set be the polynomial endofunctor, such that for the set A of all reals, F ( A ) \= A + A + A 2 + A 2 (where + is a disjoint union) we can represent the algebra for operators { exp : A → A , log : A → A , max : A 2 → A , min : A 2 → A } , where A 2 is the Cartesian product A × A , by the morphism h \= [ exp , log , max , min ] : ( A + A + A 2 + A 2 ) → A in Set , i. e., by the F-algebra ( A , h ) . Analogously, the morphism f 1 : ( A , h 1 ) → ( B , k 1 ) , which represents the commutative diagram on the right, is a morphism between F-coalgebras ( A , h 1 ) and ( B , k 1 ) .

Let G : D → C be a functor, and C an object of C . A universal arrow from C to G is a pair ( D , g ) where D is an object of D and g : C → G ( D ) an morphism in C such that, for any object D ′ of D and morphism f : C → G ( D ′ ) , there exists a unique morphism f _ : D → D ′ in D such that f \= G ( f _ ) ∘ g . Diagrammatically,

The dual concept of the universal arrow (called couniversal arrow as well) from functor G to object C (opposite to previous) is a pair ( D , g ) with opposite direction of arrows

As an example for the couniversal arrows, let us consider for the functor G : D → C to be the standard diagonal functor when C \= D × D , that is equal to

△ : D → D × D ,

such that for each arrow h : A → B in D , we have that

(A.7) △ ( A ) ≜ ( A , A ) and △ ( h ) ≜ ( h , h ) .

So, in the scheme (A.5) the pair ( D , g ) is a couniversal arrow from △ to C .

A natural transformation is a relation between two functors. Functors often describe “natural constructions” and natural transformations then describe “natural homomorphisms” between two such constructions. Sometimes two quite different constructions yield “the same” result; this is expressed by a natural isomorphism between the two functors.

If F and G are (covariant) functors between the categories B and D , then a natural transformation η from F to G associates to every object X in B a morphism η X : F ( X ) → G ( X ) in D such that for every morphism f : X → Y in B , we have η Y ∘ F ( f ) \= G ( f ) ∘ η X .

This means that the following diagram is commutative:

and from this natural transformation we can obtain also the following two:

1.

For each functor ․ L : A ․ B , the natural transformation ․ η L : F ∘ L ․ G ∘ L is defined, for each object X in A by

(A.9) ( η L ) X ≜ η LX \= ( η L 0 ) ( X ) .

2.

For each functor ․ L : D ․ C , the natural transformation ․ L η : L ∘ F ․ L ∘ G is defined, for each object Y in B by

(A.10) ( L η ) Y ≜ L η Y \= ( L 1 η ) ( Y ) .

Example.

Let P and Q be two preorders, regarded as categories. A functor F from P to Q is a monotone function, and there exists a unique natural transformation between two such, ․ η : F ․ G , exactly if F ( X ) ≤ G ( X ) for all X in P .  □

If ․ η : F ․ G and ․ ε : G ․ H are natural transformations between functors F , G , H : C → D , then we can compose them to get a natural transformation ․ ε ∙ η : F ․ H .

This is done componentwise: ( ε ∙ η ) X \= ε X ∘ η X : F ( X ) → H ( X ) .

This vertical composition of natural transformation is associative and has an identity, and allows one to consider the collection of all functors C → D itself as a category D C of all functors from C to D .

There is also a horizontal composition (or star product) of natural transformations, given the functors F , G : B → C , F ′ , G ′ : C → D , and two natural transformations ․ η : F ․ G and ․ ε : F ′ ․ G ′ , shown by following scheme: defined by ․ ε ∘ η : F ′ ∘ F ․ G ′ ∘ G , between the composed functors F ′ ∘ F , G ′ ∘ G : B → D . It holds that ε F \= ε ∘ id F and F ′ η \= id F ′ ∘ η . The arrow components of horizontal composition ε ∘ η , for any object X of B is the diagonal arrow of the following commutative diagram: i. e.,

(A.12) ( ε ∘ η ) X \= G ′ η X ∘ ε F ( X ) \= ε G ( X ) ∘ F ′ η X

The two functors F and G are called naturally isomorphic if there exists a natural transformation η from F to G such that η X is an isomorphism for every object X in C .

The Yoneda lemma is one of the most famous basic results of category theory. It describes representable functors in functor categories. The Yoneda embedding for any given category C is given by the covariant functor H : C → Set C OP such that, for any object X in C , we obtain the contravariant hom-functor h X \= C OP ( X , _ ) : C OP → Set .

Consequently, for any object Y ′ in C OP , h X ( Y 1 ) \= C OP ( X , Y 1 ) , while for any arrow f OP : Y 1 → Y 2 in C OP , we obtain the arrow (function) in Set , h X ( f OP ) : C OP ( X , Y 1 ) → C OP ( X , Y 2 ) is a composition with f OP , i. e., for any g OP : X → Y 1 in C OP ( X , Y 1 ) we obtain the arrow h X ( f OP ) ( g OP ) \= f OP ∘ g OP \= ( g ∘ f ) OP : X → Y 2 , such that the following diagram commutes in C OP (or, dually in C ):

In the case when f OP : Y 1 → Y 2 in C OP is a universal arrow , the function h X ( f OP ) : C OP ( X , Y 1 ) → C OP ( X , Y 2 ) (an arrow in Set ) is a bijection.

Let us consider two significant cases of Yoneda embedding for categorial products and coproducts :

1. The universal arrows for the products f OP \= ( π 1 , π 2 ) : ( A × B , A × B ) ↠ ( A , B ) in C OP \= D × D , and a given object X \= ( C , C ) ∈ C OP , where π 1 : A × B ↠ A , π 2 : A × B ↠ B are two epimorphisms in D corresponding to the first and second projections, respectively. Thus, we obtain the following case for the commutative diagram above in C OP \= D × D (and its corresponding commutative diagram in D on the right), where Y 2 \= ( A , B ) and Y 1 \= ( A × B , A × B ) , g OP \= ( ⟨ k , l ⟩ , ⟨ k , l ⟩ ) : ( C , C ) → ( A × B , A × B ) , with k : C → A , l : C → B two arrows in D :

The bijective function h X ( f OP ) : C OP ( X , Y 1 ) → C OP ( X , Y 2 ) in this case means that for any arrow ( k , l ) : ( C , C ) → ( A , B ) in C OP ( X , Y 2 ) (i. e., the couple of arrows k : C → A , l : C → B in D ) there is the unique arrow ( ⟨ k , l ⟩ , ⟨ k , l ⟩ ) : ( C , C ) → ( A × B , A × B ) in C OP ( X , Y 1 ) (i. e., the unique arrow ⟨ k , l ⟩ : C → A × B in D ). 2

2. Universal arrows for the coproducts f \= ( in 1 , in 2 ) : ( A , B ) ↪ ( A + B , A + B ) in C \= D × D , and a given object X \= ( C , C ) ∈ C , where in 1 : A ↪ A + B , in 2 : B ↪ A + B are two monomorphisms in D corresponding to the first and second injections, respectively. Thus, we obtain the following case for the commutative diagram above in C \= D × D (and its corresponding commutative diagram in D on the right), where Y 2 \= ( A , B ) and Y 1 \= ( A + B , A + B ) , g \= ( [ k , l ] , [ k , l ] ) : ( A + B , A + B ) → ( C , C ) , with k : A → C , l : B → C two arrows in D :

The bijective function h X ( f OP ) : C ( Y 1 , X ) → C ( Y 2 , X ) in this case means that for any arrow ( k , l ) : ( A , B ) → ( C , C ) in C ( Y 2 , X ) (i. e., the couple of arrows k : A → C , l : B → C in D ) there is the unique arrow ( [ k , l ] , [ k , l ] ) : ( A + B , A + B ) → ( C , C ) in C ( Y 1 , X ) (i. e., the unique arrow [ k , l ] : A + B → C in D ).

For example, in Set the object A × B is the Cartesian product of the set A and set B , while A + B is the disjoint union of the set A and set B .

Products and coproducts are the particular cases of adjunctions. Given two functors F : C → D , G : D → C , we say that F is left adjoint to G , or G is right adjoint to F , if there are the natural isomorphism: ․ θ : C ( _ , G ( _ ) ) ․ D ( F ( _ ) , _ ) , where C ( _ , G ( _ ) ) : C OP × D → Set is the result of composing the bivariant hom-functor C ( _ , _ ) with Id C OP × G , and D ( F ( _ ) , _ ) is similar.

Equivalently, they are adjoint if there are two natural transformations, counit ․ ε : F G ․ Id D and unit ․ η : Id C ․ G F , such that the following diagrams of natural transformations commute: where η ⋆ G denotes the natural transformation with components (functions) η G ( X ) : G ( X ) → G F G ( X ) and G ∘ ε denotes the natural transformation with components G ( ε X ) : G F G ( X ) → G ( X ) , for each object X in D . Thus, we have the following.

Definition 58 (Adjunction).

This adjunction is denoted by tuple ( F , G , ε , η ) , with η C : C → G ( F ( C ) ) a universal arrow for each object C . In fact, for any object D ′ in D and morphism f : C → G ( D ′ ) there exists a unique morphism f _ : D → D ′ , where D \= F ( C ) , such that the following two adjoint diagrams commute:

so that η C is a universal arrow from C into G and, dually, ε D ′ is a couniversal arrow from F into D ′ .

Consequently, in a given adjunction, the unit η generates a universal arrow for each object in C and counit ε generates a couniversal arrow for each object in D . In the case when C and D are poset categories, f and f ˆ define this adjunction as a Galois connection, denoted by F ⊣ G .

In category theory, the abstract notion of a limit captures the essential properties of universal constructions such as products, pullbacks and inverse limits. The dual notion of a colimit generalizes constructions such as disjoint unions, direct sums, coproducts, pushouts and direct limits. As for a computer science, limits have been brought to the limelight mainly by the semantic investigation of recursive definition of data types: one of the early application of category theory to computer science was the solution of the recursive domain equations. This kind of equation is typical of every programming language that allows an explicit or implicit form of self-application of its data types (such as a recursive procedure call, for example).

The concept of limits embodies the general idea of universal constructions, i. e., of an entity, which has a privileged behavior among a class of objects that satisfy a certain property. The only way to define a property in the categorial language is by specifying the existence and equality of certain arrows, i. e., essentially by imposing the existence of particular commutative diagrams among objects inside the category.

Thus, the diagrams have a primary role for definition of limits. Limits and colimits in a category C are defined by means of diagrams in C . Formally, a diagram in a category C should be defined as a graph homomorphism from an index graph D I to the (graph D underlying the) category C . If we define the sketch category J \= Sch ( D I ) (derived from the index graph D I ) with the indexed objects a i ∈ Ob J and morphisms l j m : a j → a m , then a commutative homomorphic diagram in C is represented by a functor D \= ( D 0 , D 1 ) : J → C , that is by objects in functor category C J , so that the objects and arrows of the homomorphic diagram in C are derived by D 0 ( a j ) and D 1 ( l j m ) , relatively.

Limits and colimits, like the strongly related notions of universal properties and adjoint functors, exist at a high level of abstraction. From this more abstract point of view, the limits and colimits are important cases of universal arrows, where the involved functor is “diagonal” (constant), as is in the details shown in Sections 2.3 and 2.4 .

For example, the equalizers are a particular case of limits (of pullbacks). For each pair of simple morphisms f , g : A → B , the LimE is a limit object (up to isomorphism) of the diagram B f g A , so that the following diagram is an equalizer: with f ∘ h 1 \= g ∘ h 1 where h 1 is a monomorphism (every equalizer is monic), and for any arrow m 1 such that f ∘ m 1 \= g ∘ m 1 , there is a unique arrow k such that m \= h 1 ∘ k .

Each limit object is a vertex of a limit cone of arrows toward the diagram for which this object is the limit. In the example of equalizer above, object LimE is the vertex of the cone toward the diagram B f g A , composed by the arrows toward each object of diagram, h 1 : LimE → → A and h 2 : LimE → → B such that h 2 \= f ∘ h 1 \= g ∘ h 1 . So, generally, if the diagram is represented by a functor D ( D 0 , D 1 ) : J → C , then the cone is composed by the arrows h i : Lim → D 0 ( a i ) from limit object Lim into the diagram’s objects D 0 ( a i ) for each indexed object a i in small index category J . In this case of the equalizer, we have that A \= D 0 ( a 1 ) , B \= D 0 ( a 2 ) and f \= D 1 ( l 12 ) , f \= D 1 ( l 12 ′ ) , relatively.

In the case of limits, for another cones from an object C into the same diagram, we have a unique arrow k : C → Lim , and this property defines the concept of limits. In the case above in commutative diagram (A.17), we have the cone from an object C into the diagram, composed by the arrows from C into objects of the diagram, m 1 : C → A and m 2 \= f ∘ m 1 \= g ∘ m 1 : C → B . So, we have the unique arrow between the vertex C of this cone into the vertex (limit) of the limit cone, k : C → LimE .

For the dual case of colimits, the arrows of cones are inverted, and are called cocones, and also the unique arrow between cocones is oriented from the colimit cocone into each other cocone over the same diagram.

Two categories C and D are equivalent if they are adjoint with the unit and counit whose components are all isomorphisms.

Given an adjunction ( F , G , ε , η ) , let us look at the endofunctor T \= G F : C → C . We have a natural transformation ․ η : id C ․ T and a natural transformation ․ μ : T 2 ․ T with components for each object C , μ C \= G ( ε F ( C ) ) : T 2 C → T C (Here, T 2 denotes the composition T T and T 3 the composition T T T ). Furthermore, the equalities (commutative diagrams of natural transformations) hold. Here, ( T μ ) C \= T ( μ C ) : T 3 C → T C and ( μ T ) C \= μ T C : T 3 C → T C (similarly for η T and T η ).

A triple ( T , η , μ ) satisfying these equalities is called a monad .

The notion of a monad is one of the most general mathematical notions. For instance, every algebraic theory, i. e., every set of operations satisfying equational laws, can be seen as a monad (which is also a monoid in a category of endofunctors of a given category: the “operation” μ being the associative multiplication of this monoid and η its unit).

Thus, monoid laws of the monad do subsume all possible algebraic laws.

We will use monads [ 12 ], [ 26 ], [ 93 ] for giving denotational semantics to database mappings , and more specifically as a way of modeling computational/collection types [ 94 ], [ 95 ], [ 96 ], [ 97 ].

A dual structure to a monad is a comonad ( T , η C , μ C ) such that all arrows in the commutative monad’s diagrams above are inverted, so that we obtain:

A monoidal category is a structure ( C , ⊗ , I , α , β , γ ) where C is a category, ⊗ : C × C → C is a functor ( tensor ), I is a distinguished object of C (unit), α , β , γ are natural transformations ( structural isos for associativity, left and right identity) with components: α A , B , C : ( A ⊗ B ) ⊗ C ≃ A ⊗ ( B ⊗ C ) , β A : I ⊗ A ≃ A , γ A : A ⊗ I ≃ A , such that the following diagrams commute (coherence conditions):

A strict monoidal category is one for which all these natural transformations are identities.

If the category is finitely complete and has the exponentiation as well, then it is a Cartesian Closed Category (CCC). We say that a category has exponentiation if it has a product for any two objects, and if for any given objects B and C there is an object C B and an arrow eval B , C : C B × B → C , called an evolution arrow, such that for any object A and arrow f : A × B → C , there is a unique arrow Λ ( f ) : A → C B making the following diagram commute:

such that eval B , C ∘ ( Λ ( f ) × id B ) \= f . The assignment of the curried 3 function Λ ( f ) to f establishes a bijection Λ from the arrows from A × B to C and the arrows from A to C B . The most known CCC is the category Set , and the meaning of the diagram above is simple:

For each pair of elements a ∈ A and b ∈ B , we obtain a function h ≜ Λ ( f ) ( a ) : B → C , such that by applying the function eval B , C we obtain that it applies the function h to the element b , so that eval B , C ( h , b ) ≜ h ( b ) \= f ( a , b ) .

This very short introduction to category theory is dedicated to people, which did not work previously with the concepts of the category theory.

A.3   Introduction to RDB, database mappings and DB category

Database schema mappings are so important in information integration that many mapping formalisms have been proposed for different tasks. A schema mapping is a high-level declarative specification of the relationship between two schemas; it specifies how data structured under one schema, called source schema, is to be converted into data structured under possibly different schema, called the target schema. It the last decade, schema mappings have been fundamental components for both data exchange and data integration. In this work, we will consider the declarative schema mappings between relational databases. A widely used formalism for specifying relational-to-relational schema mappings is that of tuple generating dependencies (tgds) . In the terminology of data integration, tgds are equivalent to global-and-local-as-view (GLAV) assertions. Using a language that is based on tgds for specifying (or “programming”) database schema mappings has several advantages over lower-level languages, such as XSLT scripts of Java programs in that it is declarative and it has been widely used in the formal study of the semantics of data exchange and data integration. Declarative schema mapping formalisms have been used to provide formal semantics for data exchange [ 99 ], data integration [ 92 ], peer data management [ 121 ], [ 122 ], pay-as-you-go integration systems [ 123 ] and model management operators [ 124 ].

Most of the work in the data integration/exchange and peer-to-peer (P2P) framework is based on a logical point of view (particularly for the integrity constraints, in order to define the right models for certain answers) in a “local” mode (source-to-target database) where proper attention to the general “global” problem of the compositions of complex partial mappings, which possibly involve a high number of databases has not been given. Today, this “global” approach cannot be avoided because of the necessity of P2P open-ended networks of heterogenous databases. Recently [ 5 ], we provided a definition of a DB category for the database mappings, which has to be more suitable than a generic Set domain category since the databases are more complex structures w. r. t. the sets and the mappings between them are so complex that they cannot be represented by a single function (which is one arrow in Set ). In such an enriched categorical semantic domain, it is possible:

  • To give a proper solution for a general problem of complex database-mappings and for the high-level algebra operators of the databases (merging, matching, etc.), by preserving the traditional common practice logical language for schema database mapping definitions.

  • The schema mappings are not the integral parts of the standard relational-DB theory (used to define a database schema with its integrity constraints); they are the programs and we need an enriched denotational semantics context that is able to formally express these programs (derived by the mappings between the databases).

  • Let us consider, e. g., the P2P systems or the mappings in a complex data warehouse. We would like to have a synthetic graphical representations of the database mappings and queries and to be able to develop a graphical tool for the meta-mapping descriptions of complex (and partial) mappings in various contexts, with a formal mathematical background.

Hence, we need a framework of interdatabase mappings. The main difference between the previous categorial approaches to databases and that presented in [ 5 ] is the level of abstraction used for the prime objects of the theory.

Another difference is methodological. In fact, the logics for relational databases are based on different kinds of First-Order Logic (FOL) sublanguages as, e. g., Description Logic, Relational Database logic, DATALOG, etc. So, the previous work on categorical semantics for the DB theory strictly follows an earlier research for categorial many-sorted FOL on the predicates with types where each attribute of a predicate has a particular sort with a given set of values. Thus, the fibered semantics for predicates is assumed for such a typed logic, where other basic operations as negation, conjunction and FOL quantifiers (that are algebraically connected with the Galois connection of their types, traduced by left and right adjunction of their functors in categorical translation) are defined algebraically in such a fibrational formulation. This algebraic method, of translation the FOL in a categorical language, is successively and directly applied to the DB theory seen as a sublanguage of the FOL. So, there are no the new results from the previous developed for the FOL in this translation of DB-theory into a categorical framework. No new particular base category is defined for databases (different from Set ), as it happened in the cases, e. g., of the Cartesian Closed Categories (CCC) for typed λ -calculus, Bicartesian Closed Poset Categories for Heyting algebras, or the elementary topos (with the subobject classifier diagrams) for the intuitionistic logic [ 19 ], [ 125 ]. Basically, all previously works use the Set category as the base denotational semantics category, without considering the question if such a topos is also necessary requirement for the database-mapping theory.

In our case, we are working with Relational Databases (RDB), and consequently with Structured Query Language (SQL), which is an extension of Codd’s “Select-Project-Join + Union” (SPJRU) relational algebra [ 126 ], [ 127 ]. We assume a view of a database A as an observation on this database, presented as a relation (a set of tuples) obtained by a query q ( x ) (SPJRU term with a list of free variables in x ), where x is a list of attributes of this view. Let L A be the set of all such queries over A and L A / ≈ be the quotient term algebra obtained by introducing the equivalence relation ≈, such that q ( x ) ≈ q ′ ( x ) if both queries return with the same relation (view). Thus, a view can be equivalently considered as a term of this quotient-term algebra L A / ≈ with carrier set of relations in A and a finite arity of their SPRJU operators whose computation returns a set of tuples of this view. If this query is a finite term of this algebra, then it is called a “finitary view” (a finitary view can have an infinite number of tuples as well).

In this coalgebraic methodological approach to databases, we consider a database instance A of a given database schema A (i. e., the set of relations that satisfy all integrity constraints of a given database schema) as a black box and any view (the response to a given query) is considered as an observation . Thus, in this framework we do not consider a categorical semantic for the free syntax algebra of a given query language, but only the resulting observations and the query-answering system of this database (an Abstract Object Type (AOT)) , i. e., the coalgebra . Consequently, all algebraic aspects of the query language are encapsulated in the single power-view operator T , such that for a given database instance A (first object in our base database category) the object T A is the set of all possible views of this database A that can be obtained from a given query language L A / ≈ .

A functorial translation of database schema intermappings (a small graph category) into the database category DB is fundamentally based on a functor that represents a given model of this database schema intermappings theory. This functor maps a data schema of a given database into an single object of the DB category, i. e., a database instance A of this database schema A (a model of this database schema, composed of a set of relations that satisfy the schema’s integrity constraints). The morphisms in the DB category are not simple functions as in the Set category. Thus, the category DB is not an elementary (standard) topos. In fact, it was shown in [ 128 ] that if we want to progress to more expressive sketches w. r. t. the original Ehresmann’s sketches for diagrams with limits and coproducts, by eliminating nondatabase objects as, for example, Cartesian products of attributes or powerset objects, we need more expressive arrows for sketch categories (diagram predicates in [ 128 ] that are analog to the approach of Makkai in [ 129 ]). As we progress to a more abstract vision in which objects are the whole databases, following the approach of Makkai, in [ 5 ] we obtained more complex arrows in this new basic DB category for databases in which objects are just the database instances (each object is a set of relations that compose this database instance). Such arrows are not just simple functions as in the case of the Set category but complex trees (i. e., operads) of view-based mappings: each arrow is equivalent to the sets of functions . In this way, while Ehresmann’s approach prefers to deal with a few fixed diagram properties (commutativity, (co)limitness), we enjoy the possibility of setting a full relational-algebra signature of diagram properties.

Different properties of this DB category were presented in a number of previously published papers, in initial versions, [ 64 ], [ 67 ], [ 112 ], [ 130 ], [ 131 ] as well, and it has been demonstrated that this category is a weak monoidal topos . The fundamental power view-operator T has been defined in [ 61 ]. For the database applications, the powerview-monad T : DB → DB is used to provide denotational semantics to database mappings [ 5 ], [ 67 ]: in order to interpret a database mappings (morphisms) in the category DB , we distinguish the object A ∈ Ob DB (a database instance of type A ) from the object T A of observations (computations of type A without side-effects) and take as a denotation of (view) mappings the elements of T A (which are the views of type A ). In particular, we identify A with the object of values (of type A ) and we obtain the object of observations by applying the unary type-constructor T (power-view operator) to A , and hence in DB we have the isomorphism A ≃ T A (for this monad η is a natural isomorphism, i. e., for each object A , η A : A ≃ T A , and μ generates the identity morphisms, i. e., μ A : T 2 A → T A is the identity morphism id T A with T 2 A \= T A ). In fact, each query (the union of conjunctive queries), expressed by FOL formulae, has an equivalent finite-length algebraic term of the SPJRU algebra, and hence the power view-operator T can be defined by the initial SPRJU algebra of ground terms. We define this fundamental idempotent power-view operator T , in Section A.3.2 , with the domain and codomain equal to the set of all instance databases such that for any instance-database A , the object T A \= T ( A ) denotes a database composed of the set of all views of A . For every object A , A ⊆ T A and T A \= T ( T A ) , i. e., each (element) view of database instance T A is also an element (view) of a database instance A .

The Kleisli category and the semantics of morphisms in the DB category, based on the monad (endofunctor T ) have been presented in [ 66 ]. The semantics for merging and matching database operators based on complete database lattice, as in [ 132 ], were defined as well and presented in a number of papers cited above.

A.3.1   Basic database concepts

The database mappings, for a logic language (we assume the FOL language in Definition 55 ) with a set of predicate letters P , are usually defined at a schema level by:

1.

A database schema is a pair A \= ( S A , Σ A ) where S A is a countable set of relational symbols (predicates in FOL) r ∈ P with finite arity n \= ar ( r ) ≥ 1 ( ar : P → N ), disjoint from a countable infinite set att of attributes (a domain of a ∈ att is a nonempty finite subset dom ( a ) of a countable set of individual symbols dom , with D \= dom ⋃ SK ). For any r ∈ P , the sort of r , denoted by tuple a \= atr ( r ) \= ⟨ atr r ( 1 ) , … , atr r ( n ) ⟩ where all a i \= atr r ( m ) ∈ att , 1 ≤ m ≤ n , must be distinct: if we use two equal domains for different attributes, then we denote them by a i ( 1 ) , … , a i ( k ) ( a i equals to a i ( 0 ) ). Each index (“column”) i , 1 ≤ i ≤ ar ( r ) , has a distinct column name n r r ( i ) ∈ SN where SN is the set of names with n r ( r ) \= ⟨ n r r ( 1 ) , … , n r r ( n ) ⟩ . A relation r ∈ P can be used as an atom r ( x ) of FOL with variables in x assigned to its columns, so that Σ A denotes a set of sentences (FOL formulae without free variables) called integrity constraints of the sorted FOL with sorts in att . We denote the empty schema by A ∅ \= ( { r ∅ } , ∅ ) , where r ∅ is the relation with empty set of attributes ( truth propositional letter in FOL, Definition 55 ), and we denote the set of all database schemas for a given (also infinite) set P by S .

2.

An instance database of a nonempty schema A is given by A \= ( A , I T ) \= { R \= ‖ r ‖ \= I T ( r ) ∣ r ∈ S A } where I T is a Tarski’s FOL interpretation in Definition 55 , which satisfies all integrity constraints in Σ A and maps a relational symbol r ∈ S A into an n -ary relation R \= ‖ r ‖ ∈ A . Thus, an instance-database A is a set of n -ary relations, managed by relational database systems (DBMSs). Let A and A ′ \= ( A , I T ′ ) be two instances of A , then a function h : A → A ′ is a homomorphism from A into A ′ if for every k -ary relational symbol r ∈ S A and every tuple ⟨ v 1 , … , v k ⟩ of this k -ary relation in A , ⟨ h ( v 1 ) , … , h ( v k ) ⟩ is a tuple of the same symbol r in A ′ . If A is an instance database and ϕ is a sentence, then we write ⊧ A ⊧ ϕ to mean that A satisfies ϕ . If Σ is a set of sentences, then we write ⊧ A ⊧ Σ to mean that ⊧ A ⊧ ϕ for every sentence ϕ ∈ Σ . Thus, the set of all instances of A is defined by ⊧ Inst ( A ) \= { A ∣ A ⊧ Σ A } . We denote the set of all values in A by val ( A ) ⊆ D . Then “atomic database” J A \= { { ⟨ v i ⟩ } ∣ v i ∈ val ( A ) } is infinite iff SK ⊆ val ( A ) . Note that for each a ∈ atr ( r ) , a subset dom ( a ) ⊆ dom is finite, and any introduction of Skolem constants is ordered ω 0 , ω 1 , …

3.

We consider a rule-based conjunctive query over a database schema A as an expression q ( x ) ⟵ r 1 ( u 1 ) , … , r n ( u n ) , with finite n ≥ 0 , r i are the relational symbols (at least one) in A or the built-in predicates (e. g., ≤,=, etc.), q is a relational symbol not in A and u i are free tuples (i. e., one may use either variables or constants). Recall that if v \= ( v 1 , … , v m ) then r ( v ) is a shorthand for r ( v 1 , … , v m ) . Finally, each variable occurring in x is a distinguished variable that must also occur at least once in u 1 , … , u n . Rule-based conjunctive queries (called rules) are composed of a subexpression r 1 ( u 1 ) , … , r n ( u n ) that is the body , and the head of this rule q ( x ) . The Yes / No conjunctive queries are the rules with an empty head. If we can find values for the variables of the rule, such that the body is logically satisfied, then we can deduce the head-fact. This concept is captured by a notion of “valuation.” The deduced head-facts of a conjunctive query q ( x ) defined over an instance A (for a given Tarski’s interpretation I T of schema A ) are equal to ⊧ ‖ q ( x 1 , … , x k ) ‖ A \= { ⟨ v 1 , … , v k ⟩ ∈ D k ∣ A ⊧ ∃ y ( r 1 ( u 1 ) ∧ ⋯ ∧ r n ( u n ) ) [ x i / v i ] 1 ≤ i ≤ k } \= I T ∗ ( ∃ y ( r 1 ( u 1 ) ∧ ⋯ ∧ r n ( u n ) ) ) , where the y is a set of variables, which are not in the head of query. We recall that the conjunctive queries are monotonic and satisfiable, and that a (Boolean) query is a class of instances that is closed under isomorphism [ 133 ]. Each conjunctive query corresponds to a “select-project-join” term t ( x ) of SPRJU algebra obtained from the formula ∃ y ( r 1 ( u 1 ) ∧ ⋯ ∧ r n ( u n ) ) .

4.

We consider a finitary view as a union of a finite set S of conjunctive queries with the same head q ( x ) over a schema A , and from the equivalent algebraic point of view, it is a “select-project-join + union” (SPJRU) finite-length term t ( x ) , which corresponds to union of the terms of conjunctive queries in S . In what follows, we will use the same notation for a FOL formula q ( x ) and its equivalent algebraic SPJRU expression t ( x ) . A materialized view of an instance-database A is an n -ary relation R \= ⋃ q ( x ) ∈ S ‖ q ( x ) ‖ A . Notice that a finitary view can also have an infinite number of tuples. We denote the set of all finitary materialized views that can be obtained from an instance A by T A .

We consider the views as a universal property for databases: they are the possible observations of the information contained in an instance database. We assume that a view of a database A as the relation (set of tuples) obtained by a “Select-Project-Join + Union” (SPJRU) query q ( x ) where x is a list of attributes of this view. We denote by L A the set of all such queries over a database A and by L A / ≈ the quotient algebra obtained by introducing the equivalence relation ≈, such that q ( x ) ≈ q ′ ( x ) if both queries result in the same relation (view). Thus, a view can be equivalently considered as a term of this quotient algebra L A / ≈ with carrier set of relations in A and a finite arity of their operators, whose computation returns a set of tuples of this view. We can use them in order to establish an equivalence relation between databases.

Database category DB , defined in [ 5 ], is at the instance level , i. e., any object in DB is an instance database.

The problem of sharing data from multiple sources has recently received significant attention, and a succession of different architectures has been proposed, beginning with federated databases [ 134 ], [ 135 ], followed by data integration systems [ 92 ], [ 98 ], [ 136 ], data exchange systems [ 99 ], [ 122 ], [ 137 ] and Peer-to-Peer (P2P) data management systems [ 121 ], [ 138 ], [ 139 ], [ 140 ], [ 141 ], [ 142 ]. A lot of research has been focused on the development of logic languages for semantic mapping between data sources and mediated schemas [ 58 ], [ 92 ], [ 132 ], [ 143 ], [ 144 ], [ 145 ], and algorithms that use mappings to answer queries in data sharing systems [ 59 ], [ 136 ], [ 146 ], [ 147 ], [ 148 ], [ 149 ], [ 150 ], [ 151 ], [ 152 ].

We consider that a mapping between two database schemas A \= ( S A , Σ A ) and B \= ( S B , Σ B ) is expressed by an union of “conjunctive queries with the same head.” Such mappings are called “view-based mappings,” defined by a set of FOL sentences { ∀ x i ( q A i ( x i ) ⇒ q B i ( y i ) ) | with y i ⊆ x i , 1 ≤ i ≤ n } , where ⇒ is the logical implication between these conjunctive queries q A i ( x i ) and q B i ( x i ) , over the databases A and B , respectively.

Schema mappings are often specified by the source-to-target tuple-generating dependencies (tgds), used to formalize a data exchange [ 99 ], and in the data integration scenarios under a name “GLAV assertions” [ 92 ], [ 98 ]. A tgd is a logical sentence (FOL formula without free variables), which says that if some tuples satisfying certain equalities exist in the relation, then some other tuples (possibly with some unknown values) must also exist in another specified relation.

An equality-generating dependency (egd) is a logical sentence, which says that if some tuples satisfying certain equalities exist in the relation, then some values in these tuples must be equal. Functional dependencies are egds of a special form, e. g., primary-key integrity constraints. Thus, egds are only used for the specification of integrity constraints of a single database schema, which define the set of possible models of this database. They are not used for interschema database mappings.

These two classes of dependencies together comprise the embedded implication dependencies (EID) [ 153 ], which seem to include essentially all of the naturally occurring constraints on relational databases (we recall that the bold symbols x , y , … denote a nonempty list of variables).

Definition 59.

We introduce the following two kinds of EIDs [ 153 ]:

1.

A tuple-generating dependency (tgd)

∀ x ( q A ( x ) ⇒ q B ( x ) ) ,

where q A ( x ) is an existentially quantified formula ∃ y ϕ A ( x , y ) and q B ( x ) is an existentially quantified formula ∃ z ψ A ( x , z ) , and where the formulae ϕ A ( x , y ) and ψ A ( x , z ) are conjunctions of atomic formulae (conjunctive queries) over the given database schemas. We assume the safety condition, i. e., that every distinguished variable in x appears in q A .

We will consider also the class of weakly-full tgds for which query answering is decidable, i. e., when q B ( x ) has no existentially quantified variables, and if each y i ∈ y appears at most once in ϕ A ( x , y ) .

2.

An equality-generating dependency (egd)

∀ x ( q A ( x ) ⇒ ( y ≐ z ) ) ,

where q A ( x ) is a conjunction of atomic formulae over a given database schema, and y \= ⟨ y 1 , … , y k ⟩ , z \= ⟨ z 1 , … , z k ⟩ are among the variables in x , and y ≐ z is a shorthand for the formula ( y 1 ≐ z 1 ) ∧ ⋯ ∧ ( y k ≐ z k ) with the built-in binary identity predicate ≐ of the FOL.

Note that a tgd ∀ x ( ∃ y ϕ A ( x , y ) ⇒ ∃ z ψ A ( x , z ) ) is logically equivalent to the formula ∀ x ∀ y ( ϕ A ( x , y ) ⇒ ∃ z ψ A ( x , z ) ) , i. e., to ∀ x 1 ( ϕ A ( x 1 ) ⇒ ∃ z ψ A ( x , z ) ) with the set of distinguished variables x ⊆ x 1 . We will use for the integrity constraints Σ A of a database schema A both tgds and egds, while for the interschema mappings, between a schema A \= ( S A , Σ A ) and a schema B \= ( S B , Σ B ) , only the tgds ∀ x ( q A ( x ) ⇒ q B ( x ) ) , as follows.

Definition 60.

An elementary schema mapping is a triple ( A , B , M ) where A and B are schemas with no relational symbol in common and M is a set of tgds ∀ x ( q A ( x ) ⇒ q B ( x ) ) , such that q A ( x ) is a conjunctive query with conjuncts equal to relational symbols in S A or to a formula with built-in relational symbols, ≐,<,>,… , while q B ( x ) is a conjunctive query with relational symbols in S B .

An instance of M is an instance pair ( A , B ) (where A is an instance of A and B is an instance of B ) that satisfies every tgds in M , denoted by ⊧ ( A , B ) ⊧ M A B . We write Inst ( M ) to denote all instances ( A , B ) of M .

Notice that the formula with built-in predicates, in the left side of implication of a tgd, can be expressed by only two logical connectives, conjunction and negation, from the fact that implication and disjunction can be reduced to equivalent formulae with these two logical connectives. Recall that in data exchange terminology, B is a solution for A under M if ( A , B ) ∈ Inst ( M ) , and that an instance of M satisfies all FOL formulae in Σ A ⋃ Σ B ⋃ M . For a given set of FOL formulas S , we denote by ⋀ S the conjunction of all formulae in the set S .

Lemma 11.

For any given Tarski’s interpretation I T (and its extension I T ∗ in ( A.1 ) ), i. e., a model of the schemas A \= ( S A , Σ A ) and B \= ( S B , Σ B ) and of the set of tgds in the mapping M , i. e., when I T ∗ ( ⋀ Σ A ) \= I T ∗ ( ⋀ Σ B ) \= I T ∗ ( ⋀ M ) \= t , one has ( { I T ( r ) ∣ r ∈ S A } , { I T ( r ) ∣ r ∈ S B } ) ∈ Inst ( M ) .

Proof.

Due to the fact that I T ∗ ( ⋀ Σ A ) \= t means that all integrity constraints of A are satisfied, one has that A \= { I T ( r ) ∣ r ∈ S A } is an instance (model) of A . The same holds for the schema B , so that B \= { I T ( r ) ∣ r ∈ S B } is an instance of B .

From the fact that I T ∗ ( ⋀ M ) \= t , each tgd ϕ ∈ M A B is satisfied, i. e., I T ∗ ( ϕ ) \= t , and hence ⊧ ( A , B ) ⊧ M , i. e., ( A , B ) ∈ Inst ( M ) .  □

The formulae (tgds) in the set M express the constraints that an instance ( A , B ) over the schemas A and B must satisfy. We assume that the satisfaction relation between formulae and instances is preserved under isomorphism, which means that if an instance satisfies a formula then every isomorphic instance also satisfies that formula.

This is a mild condition that is true for all standard logical formalisms, such as first-order logic, second-order logic, fixed-point logics and infinitary logics.

Thus, such formulae represent the queries in the sense of Chandra and Harel [ 133 ]. An immediate consequence of this property is that Inst ( M ) is closed under isomorphism.

Remark.

Differently from [ 144 ], [ 154 ], [ 155 ], each formula in M contains the relational symbols of both source and target schema (the integrity constraints are contained in their schemas), in order to represent an interschema mapping graphically as a graph edge M A B : A → B as in standard mathematical denotation of a mapping.  □

The problem of computing semantic mappings [ 124 ], [ 154 ], [ 155 ], [ 156 ], [ 157 ], [ 158 ], given a semantic mapping M A B between data schemas A and B , and M B C between B and C , generally was to answer if it is possible to generate a direct semantic mapping M A C (possibly in the same logic language formalism) between A and C that is “equivalent” to the original mappings. Here, “equivalent” means that for any query in a given class of queries Q and for any instance of data sources, using the direct mapping yields exactly the same answer that would be obtained by the two original mappings [ 154 ].

The semantics of the composition of the schema mappings proposed by Madhavan and Halevy [ 154 ] was a significant first step. However, it suffers from certain drawbacks that are caused by the fact that this semantics is given relative to a class of queries. In this setting, the set of formulae specifying a composition M A C of M A B and M B C relative to a class Q of queries need not be unique up to logical equivalence, even when the class Q of queries is held fixed. It was shown [ 155 ] that this semantics is rather fragile, because a schema mapping M A C may be a composition of M A B and M B C when Q is the class of conjunctive queries, but may fail to be composition of these two (inter)schema mappings when Q is the class of conjunctive queries with inequalities.

We use for the integrity constraints Σ A of a database schema A both tgds and egds, while for the interschema mappings, between a schema A \= ( S A , Σ A ) and a schema B \= ( S B , Σ B ) , only the tgds ∀ x ( q A ( x ) ⇒ q B ( x ) ) . The so-called second-order tgds (SO tgds) has been introduced in [ 155 ] as follows.

Definition 61 ([ 155 ]).

Let A be a source schema and B a target schema. A second-order tuple-generating dependency (SO tgd) is a formula of the form:

∃ f ( ( ∀ x 1 ( ϕ 1 ⇒ ψ 1 ) ) ∧ ⋯ ∧ ( ∀ x n ( ϕ n ⇒ ψ n ) ) ) ,

where

1.

Each member of the tuple f is a functional symbol. Each variable in x i appears in some atomic formula of ϕ i .

2.

Each ϕ i is a conjunction of:

  • atomic formulae of the form r A ( y 1 , … , y k ) , where r A ∈ S A is a k -ary relational symbol of schema A and y 1 , … , y k are variables in x i , not necessarily distinct;

  • the formulae with conjunction and negation connectives and with built-in predicate’s atoms of the form t ⊙ t ′ , ⊙∈{≐,<,>,…}, where t and t ′ are the terms based on x i , f and constants.

3.

Each ψ i is a conjunction of atomic formulae r B ( t 1 , … , t m ) where r B ∈ S B is an m -ary relational symbol of schema B and t 1 , … , t m are terms based on x i , f and constants.

Notice that each constant a in an atom on the left-hand side of implications must be substituted by new fresh variable y i and by adding a conjunct ( y i \= a ) in the left-hand side of this implication, so that such atoms will have only the variables (condition 2 above). For the empty set of tgds, we will use the SOtgd tautology r ∅ ⇒ r ∅ where r ∅ is the relation with empty set of attributes ( truth propositional letter in FOL, Definition 55 in Section A.1.2 in the Appendix). The fourth condition is a “safety” condition, analogous to that made for (first-order) tgds. It is easy to see that every tgd is equivalent to one SOtgd without equalities. For example, let σ be the tgd,

∀ x 1 … ∀ x m ( ϕ A ( x 1 , … , x m ) ⇒ ∃ y 1 … ∃ y n ψ B ( x 1 , … , x m , y 1 , … , y n ) ) .

It is logically equivalent to the following SOtgd without equalities, which is obtained by Skolemizing existential quantifiers in σ :

∃ f 1 … ∃ f n ( ∀ x 1 … ∀ x m ( ϕ A ( x 1 , … , x m ) ⇒ ψ B ( x 1 , … , x m , f 1 ( x 1 , … , x m ) , … , f n ( x 1 , … , x m ) ) ) ) .

Given a finite set S of tgds of an interschema mapping M , we can find a single SOtgd that is equivalent to S by taking, for each tgd σ in S , a conjunct of the SOtgd to capture σ as described above (we use disjoint sets of function symbols in each conjunct, as before).

The integrity constraints of a schema A are transformed into schema mappings from A into the particular “FOL-identity” schema A ⊤ \= ( { r ⊤ } , ∅ ) with empty set of integrity constraints (introduced in [ 5 ], Section 4.1.1 for categorial semantics of database schemas) where its binary built-in relation r ⊤ corresponds to FOL identity (so that the ground atom r ⊤ ( a , a ) is true for each a ∈ D while, e. g., the ground atom r ⊤ ( 0 , 1 ) is false ), based on the two following lemmas [ 5 ].

Lemma 12.

Any normalized tgd constraint of a schema A \= ( S A , Σ A ) , ∀ x ( ϕ A ( x ) ⇒ r ( t ) ) ∈ Σ A egd ⊆ Σ A , where t is a tuple of terms with variables in x and r ∈ S A , is logically equivalent to the FOL sentence ∀ x ( ( ϕ A ( x ) ∧ ¬ r ( t ) ) ⇒ r ⊤ ( 0 , 1 ) ) .

Lemma 13.

Any egd ∀ x ( ϕ A ( x ) ⇒ ( y ≐ z ) ) ∈ Σ A egd ⊆ Σ A of a given schema database A \= ( S A , Σ A ) where y \= ⟨ x j 1 , … , x j k ⟩ ⊆ x and z \= ⟨ x l 1 , … , x l k ⟩ ⊆ x such that j i ≠ l i for 1 ≤ i ≤ k , is logically equivalent to the FOL formula:

∀ x ( ( ϕ A ( x ) ∧ ( y ≠ z ) ) ⇒ r ⊤ ( 0 , 1 ) ) ,

where y ≠ z is an abbreviation for the formula ( x j 1 ≠ x l 1 ) ∨ ⋯ ∨ ( x j k ≠ x l k ) .

Consequently, for the set of integrity constraints Σ A \= Σ A tgd ⋃ Σ A egd , of a RDB schema A \= ( S A , Σ A ) , we construct, by conjunction the SOtgd in Σ A denoted by a formula Φ, and the schema “truth-mapping” ⊤ A A ⊤ \= { Φ } : A → A ⊤ , as explained in [ 5 ], Section 4.1.1, Proposition 15. We recall that the “truth-mapping” does not transfer any tuple of data from the source to the target object.

A.3.2   Database observations: Idempotent power-view operator

We consider the views as a universal property for the databases: they are the possible observations of the information contained in an instance database and we can use them in order to establish an equivalence relation between databases.

In the theory of algebraic specifications, an Abstract Data Type (ADT) is specified by a set of operations (constructors) that determine how the values of the carrier set are built up and by a set of formulae (in the simplest case, the equations) stating which values should be identified. In the standard initial algebra semantics, the defining equations impose a congruence on the initial algebra. Dually, a coalgebraic specification of a class of systems, i. e., Abstract Object Types (AOT), is characterized by a set of operations (destructors) that specify what can be observed out of a system-state (i. e., an element of the carrier) and how a state can be transformed to a successor state.

We will introduce a class of coalgebras for database query-answering systems for a given instance-database A of a schema A by Definition 62 . They will be presented in an algebraic style by providing a cosignature. In particular, the sorts include a single “hidden sort,” corresponding to the carrier of a coalgebra, and other “visible” sorts for the inputs and outputs with a given fixed interpretation. Visible sorts will be interpreted as the sets without any algebraic structure defined on them. For us, the coalgebraic terms, built by operations (destructors), are interpreted by the basic observations, which one can make on the states of a coalgebra.

Input sorts for a given instance-database A is a countable set L A of the union of a finite set S of conjunctive finite-length queries q ( x ) (with the same head with a finite tuple of variables x ) so that R \= ev A ( q ( x ) ) \= ⋃ q ( x ) ∈ S ‖ q ( x ) ‖ A is the relation (a materialized view) obtained by applying this query to A .

Each query (FOL formula introduced in Definition 55 ) has an equivalent finite-length algebraic term of the SPJRU algebra (or equivalent to it, SPCU algebra, Chapter 4.5, 5.4 in [ 127 ]) as shortly introduced in the previous section, and hence the power view-operator T can be defined by the initial SPRJU algebra of ground terms. We define this fundamental idempotent power-view operator T , with the domain and codomain equal to the set of all instance databases such that for any instance-database A , the object T A \= T ( A ) denotes a database composed of the set of all views of A . The object T A , for a given instance-database A , corresponds to the carrier of the quotient-term Lindenbaum algebra L A / ≈ , i. e., the set of the equivalence classes of queries (such a query is equivalent to a term in T P X of an SRRJU relational algebra Σ R , with the select, project, join and union operators, with relational symbols of a database schema A ). More precisely, T A is “generated” from A by this quotient-term algebra L A / ≈ and a given evaluation of queries in L A , ev A : L A T A , which is surjective function. From the factorization theorem, there is a unique bijection is A : L A / ≈ → T A such that commutes, where the surjective function nat ≈ : L A → L A / ≈ is a natural representation for the equivalence of the queries ≈. For every object A , A ⊆ T A and T A \= T ( T A ) , i. e., each (element) view of database instance T A is also an element (view) of a database-instance A . It is easy to verify that T corresponds to the closure operator Sg on A (introduced in Section A.1 ) for the Σ R relational (SPJRU) algebra, but with relations instead of variables (i. e., relational symbols). Notice that when A has a finite number of relations, but at least one relation with an infinite number of tuples, then T A has an infinite number of relations (i. e., views of A ), and hence can be an infinite object.

Based on the theory of database observations and its power-view operator T , defined in Section A.3.2 , the output sort of this database AOT is the set T A of all resulting views (i. e., resulting n -ary relations) obtained by computation of queries q ( x ) ∈ L A . It is considered as the carrier of a coalgebra as well.

Definition 62.

AOT for a Database query-answering system, for a given instance-database A , is a pair ( S , Σ AOT ) such that:

1.

The carrier set S \= ( X A , L A , Υ _ ) of the sorts where X A is a hidden sort (a set of states of this database system), L A is an input sort (a set of the unions of conjunctive queries over A ), and Υ _ is the set of all finitary relations for a given universe D .

2.

The following mappings:

2.1

A method Next : X A × L A → X A that corresponds to an execution of a next query q ( x ) ∈ L A in a current state s ∈ X A of a database A , such that a database A passes to the next state; so, we introduce the destructor Λ ( Next ) : X A → X A L A , where Λ is the currying operator from lambda calculus used in diagram A.19 in Section A.2 .

2.2

An attribute Out : X A × L A → Υ _ such that for each s ∈ X A , q ( x ) ∈ L A , Out ( s , q ( x ) ) is a relation computed by a query q ( x ) ; analogously, we introduce the second destructor Λ ( Out ) : X A → Υ _ L A .

Then the abstract object type for a query-answering system is given by a coalgebra with the signature Σ AOT \= { Λ ( Next ) , Λ ( Out ) } :

⟨ Λ ( Next ) , Λ ( Out ) ⟩ : X A → F X A

of the polynomial endofunctor F ≜ ( _ ) L A × Υ _ L A : Set → Set .

In an object-oriented terminology, the coalgebras are expressive enough in order to specify the parametric methods and the attributes for a database (conjunctive) query answering systems. In a transition system terminology, such coalgebras can model a deterministic, nonterminating, transition system with inputs and outputs. In [ 159 ], a complete equational calculus for such coalgebras of restricted class of polynomial functors has been defined.

Here, we will consider only the database query-answering systems without the side effects. That is, the obtained results (views) will not be materialized as a new relation of this database A but only visualized. Thus, when a database answers to a query, it remains in the same initial state. Thus, the set X A is a singleton { A } for a given database A and, consequently, it is isomorphic to the terminal object 1 in the Set category. As a consequence, from 1 L A ≃ 1 , we obtain that a method Next is just an identity function id : 1 → 1 . Thus, the only interesting part of this AOT is the attribute part Out : X A × L A → Υ _ , with the fact that X A × L A \= { A } × L A ≃ L A .

Consequently, we obtain an attribute mapping Out : L A → Υ _ , whose graph is equal to the query-evaluation surjective mapping ev A : L A T A , introduced in the previous diagram.

Corollary 28.

A canonical method for the construction of the power-view database T A can be obtained by an abstract data-object type ( S , Σ AOT ) for a query-answering system without side-effects as follows:

T A ≜ { Out ( q i ( x ) ) ∣ q i ( x ) ∈ L A } .

This corollary is a direct proof that the power-view database operator T, introduced previously, represents the observational point of view for the instance databases. This mapping ev A : L A T A can be used as a semantic foundation for the database mappings.

A.3.3   Logic versus algebras: Categorification by operads

In what follows, we will work with the typed operads, first developed for a purpose of homotopy theory [ 160 ], [ 161 ], [ 162 ], having a set R of types (each relation symbol is a type), or “R-operads” for short.

The basic idea of an R-operad O is that, given types r 1 , … , r k , r ∈ R , there is a set O ( r 1 , … , r k , r ) of abstract k -ary “operations” with inputs of type r 1 , … , r k and output of type r . In short, an operad describes a family of composable operations with multiple inputs and one output, satisfying several intuitive properties like associativity of composition and permutability of the inputs.

Categorification is the process of finding category-theoretic analog of set-theoretic concepts, by introducing “ n -categories,” algebraic structures having objects, morphisms between objects, 2-morphisms between morphisms and so on up to n -morphisms. In [ 163 ], it is demonstrated the existence of close relation between n -categories and the homotopy theory, based on theory of operads. As we will see in our case of base DB category used for denotational semantics of database mappings, this DB category is a n -category as well, but with a particular property that each arrow can be equivalently represented by an object (categorial symmetry); thus, higher-order arrows are represented just by ordinary 1-arrows in DB . Basically, the work presented in this book is the categorification of the logic theory of the database mappings.

Remark.

In our case, the input types are the relational symbols of the source database of a given schema mapping (represented by a SOtgd) while the output type is a relation symbol of the target database. Each single abstract “operation” is derived from an logic implication from a conjunctive query over the source database schema into a particular relation of the target database schema, and represents the SPJRU term of the relational algebra correspondent to the left-side (conjunctive query over source schema) of this implication, labeled by a node q in the left tree (an operation).

In what follows, we will present an algorithm MakeOperads that transform a given SOtgd (of a given mapping from a source to a target schema database) into the set of such abstract operations with input types in the source schema and output types.

We can visualize such an operation as a tree with only one node. In an operad, we can obtain new operations from old ones by composing them: it can be visualized in terms of trees ( Figure A.1 ). We can obtain the new operators from old ones by permuting arguments, and there is a unary “identity” operation of each type. Finally, we insist on a few plausible axioms: the identity operations act as identities for composition, permuting arguments is compatible with composition, and composition is associative . Thus, formally, we have the following.

Figure A.1 Operations of an R-operad.

Definition 63.

For any set R of relation symbols with finite arity (the predicate letters in Definition 55 ), an R-operad O consists of:

1.

for any r 1 , … , r k , r ∈ R , a set O ( r 1 , … , r k , r ) . For any r ∈ R , an element 1 r ∈ O ( r , r ) . We denote the empty type by r ∅ , with ar ( r ∅ ) \= 0 and 1 r ∅ ∈ O ( r ∅ , r ∅ )

2.

for any f ∈ O ( r 1 , … , r k , r ) and any g 1 ∈ O ( r 11 , … , r 1 i 1 , r 1 ) , … , g k ∈ O ( r k 1 , … , r k i k , r k ) , an element f · ( g 1 , … , g k ) ∈ O ( r 11 , … , r 1 i 1 , … , r k 1 , … , r k i k , r )

3.

for any permutation σ ∈ R k , a map σ : O ( r 1 , … , r k , r ) → O ( r σ ( 1 ) , … , r σ ( k ) , r ) , f ⟼ f σ , such that:

(a)

whenever both sides make sense, f · ( g 1 · ( h 11 , … , h 1 i 1 ) , … , g k · ( h k 1 , … , h k i k ) ) \= ( f · ( g 1 , … , g k ) ) · ( h 11 , … , h 1 i 1 , … , h k 1 , … , h k i k )

(b)

for any f ∈ O ( r 1 , … , r k , r ) , f \= 1 r · f \= f · ( 1 r 1 , … , 1 r k )

(c)

for any f ∈ O ( r 1 , … , r k , r ) , and σ , σ 1 ∈ R k , f ( σ σ 1 ) \= ( f σ ) σ 1

(d)

for any f ∈ O ( r 1 , … , r k , r ) , σ ∈ R k and g 1 ∈ O ( r 11 , … , r 1 i 1 , r 1 ) , … , g k ∈ O ( r k 1 , … , r k i k , r k ) , ( f σ ) · ( g σ ( 1 ) , … , g σ ( k ) ) \= ( f · ( g 1 , … , g k ) ) ρ ( σ ) where ρ : R k ⟶ R i 1 + ⋯ + i k is the obvious homomorphism

(e)

for any f ∈ O ( r 1 , … , r k , r ) , g 1 ∈ O ( r 11 , … , r 1 i 1 , r 1 ) , … , g k ∈ O ( r k 1 , … , r k i k , r k ) , and σ 1 ∈ R i 1 , … , σ k ∈ R i k , ( f · ( g 1 σ 1 , … , g k σ k ) ) \= ( f · ( g 1 , … , g k ) ) ϱ 1 ( σ 1 , … , σ k ) , where ϱ 1 : R i 1 × ⋯ × R i k ⟶ R i 1 + ⋯ + i k is the obvious homomorphism.

Thus, an R-operad O can be considered as an algebra where the variables (carrier set) are the typed operators f ∈ O ( r 1 , … , r k , r ) , and the signature is composed by the set of basic operations used for composition of the elements of this carrier set:

1.

the binary associative composition operation (a partial function) “·,” such that · ( f , ( g 1 , … , g k ) ) \= f · ( g 1 , … , g k ) , if f is k -ary typed operator,

2.

the left and right identity (partial) operations 1 r · _ , _ · ( 1 r 1 , … , 1 r 1 ) such that for a k -ary typed operator f , 1 r · _ ( f ) \= 1 r · f \= f , _ · ( 1 r 1 , … , 1 r 1 ) ( f ) \= f · ( 1 r 1 , … , 1 r 1 ) \= f ,

3.

the permutation (partial) operations, σ : O ( r 1 , … , r k , r ) → O ( r σ ( 1 ) , … , r σ ( k ) , r ) , such that for each f ∈ O ( r 1 , … , r k , r ) , σ ( f ) \= f σ .

Thus, all operations in the signature of this algebra are the partial functions (defined only for the subsets of elements of the carrier set of this algebra).

It is clear, that in this formal syntax of R-operads algebra, the relation symbols are left out of its syntax; thus, the terms of this algebra do not contain the relational symbols. Consequently, it appears fundamentally different from the relational algebras as, e. g., the basic SPRJU Codd’s algebra and its extensions.

The theory of typed operads represents the syntax of the database mapping, translated from the schema-database logic into the algebraic framework. The semantic part of the operad’s theory, correspondent to the semantics of FOL based on Tarski’s interpretations, is represented the R-algebras, which are particular interpretations of the operads.

Let us define now the “R-algebra” of an database mapping-operad, based on homotopy theory [ 160 ], [ 161 ], [ 162 ], where its abstract operations are represented by actual functions (query-functions).

Definition 64.

For a given universe of values U and R-operad O, a R-algebra α consists of:

1.

for any r ∈ R , a set α ( r ) is a set of tuples (relation), with empty relation α ( r ∅ ) \= ⊥ \= { ⟨ ⟩ } (with empty tuple ⟨⟩), unary universe-relation α ( r ∞ ) \= { ⟨ d ⟩ ∣ d ∈ U } , and binary relation α ( r ⊤ ) \= R \= for the “truth” type r ⊤ . The α ∗ is the extension of α to a list of symbols α ∗ ( { r 1 , … , r k } ) ≜ { α ( r 1 ) , … , α ( r k ) , α ( r ∅ ) } ,

2.

for any q i ∈ O ( r 1 , … , r k , r ) a mapping function α ( q i ) : R 1 × ⋯ × R k ⟶ α ( r ) , where for each 1 ≤ i ≤ k , R i \= U ar ( r i ) \ α ( r i ) , (here, “﹨” is a set-difference), if the place symbol ( _ ) i ∈ q i is preceded by negation operator ¬; α ( r i ) otherwise. Consequently, α ∗ ( { q 1 , … , q k } ) ≜ { α ( q 1 ) , … , α ( q k ) } , and

(a)

for any r ∈ R , α ( 1 r ) acts as an identity function on relation α ( r ) .

The q ⊥ \= α ( 1 r ∅ ) : ⊥ → ⊥ is the empty function (the function with the empty graph)

(b)

for the associative composition “·” we have that α ( q · ( q 1 , … , q k ) ) \= α ( q ) ( α ( q 1 ) × ⋯ × α ( q k ) )

(c)

for any q ∈ O ( r 1 , … , r k , r ) and a permutation σ ∈ R k , α ( q σ ) \= α ( q ) σ , where σ acts on the function α ( q ) on the right by permuting its arguments

3.

we introduce the two functions, ∂ 0 and ∂ 1 , such that for any α ( q ) , q ∈ O ( r 1 , … , r k , r ) , we have that ∂ 0 ( q ) \= { r 1 , … , r k } , ∂ 0 ( α ( q ) ) \= α ∗ ( ∂ 0 ( q ) ) \= { α ( r 1 ) , … , α ( r k ) } , ∂ 1 ( q ) \= { r } and ∂ 1 ( α ( q ) ) \= α ∗ ( ∂ 1 ( q ) ) \= { α ( r ) } .

We consider an R-algebra in the next Definition 63 in the way where not the relations but the operads f ∈ O ( r 1 , … , r k , r ) constitute its carrier set, and is similar to the consideration of a category as a kind of algebra where the carrier set is composed by objects and arrows, with basic operation just like the associative composition “ ∘ ′ ” of the arrows, which is a partial function, as is the associative operation “·” for the operads. This analogy (both with the composition with identity elements) is the natural justification why we are using the interpretation of R-operads algebra in Definition 63 as the basis for the definition of the DB category for database mappings.

A.3.4   Sketches and functors into the DB category

We use the algorithm MakeOperads [ 5 ] in order to transform logical schema mappings M A B \= { Φ } : A → B given by the SOtgds Φ in Definition 61 into the algebraic operads M A B \= MakeOperad ( M A B ) \= { v 1 · q A , 1 , … , v n · q A , 1 , 1 r ∅ } : A → B . The basic idea of the operad’s operations v i ∈ O ( r ′ , r B ) and q A , i ∈ O ( r 1 , … , r k , r ′ ) , where r i , 1 ≤ i ≤ k are relational symbols of the source schema A \= ( S A , Σ A ) and r B is a relational symbol of the target schema B , and r ′ has the same type as r B , is to formalize algebraically a mapping from the set of source relations r i into a target relation r B .

Let us define the algorithm that transform a SOtgd into the set of abstract operads:

Operads algorithm MakeOperads(ℳ A B )

Input : A schema mapping M A B : A → B given by a SOtgd.

∃ f ( ( ∀ x 1 ( ϕ A , 1 ⇒ ψ B , 1 ) ) ∧ ⋯ ∧ ( ∀ x n ( ϕ A , n ⇒ ψ B , n ) ) ) .

Output : Set of abstract operad’s operations from A into B

1.

( Normalize the SOtgd ).

Initialize S to be the empty set ∅ . Let M A B be the singleton set { ∃ f ( ( ∀ x 1 ( ϕ A , 1 ⇒ ψ B , 1 ) ) ∧ ⋯ ∧ ( ∀ x n ( ϕ A , n ⇒ ψ B , n ) ) ) } .

Put each of n implications ϕ A , i ⇒ ψ B , i , for 1 ≤ i ≤ n , into S .

Each implication χ in S has the form ϕ A , i ( x i ) ⇒ ∧ 1 k r j ( t j ) where every member of x i is a universally quantified variable, and each t j , for 1 ≤ j ≤ k , is a sequence (tuple) of terms over x i . We then replace each such implication χ in S with k implications: ϕ A , i ( x i ) ⇒ r 1 ( t 1 ) , … , ϕ A , i ( x i ) ⇒ r k ( t k ) .

2.

( Reinsert the hidden relations ).

In each implication, ϕ A , i ( x i ) ⇒ r k ( t k ) in S (obtained in the previous step) in the left-side of this implications replace each equation ( f r ( y i ) ≐ 1 ‾ ) , where y i ⊆ x i and f r is the characteristic function of a hidden relation r ∉ A (introduced by the algorithm Compose ), by the atom r ( y i ) .

3.

( Transformation into operad’s operations ).

Let S \= { χ 1 , … , χ m } with χ i a view-based query mapping (implication from conjunctive query over A into an relation of B ), q A i ( x i ) ⇒ r ′ ( t i ) , where S q \= ( r i 1 , 1 , … , r i k , k ) is the ordered list of relational symbols as they appear (from left to right) in the conjunctive query q A i ( x i ) . We then replace each such implication χ i in S with the operad’s operations q i ∈ O ( r i 1 , 1 , … , r i k , k , r ′ ) where ( r i 1 , 1 , … , r i k , k ) \= S q and q i is the expression obtained from q A i ( x i ) by replacing each relational symbol r i j , j by the place symbol ( _ ) j and by replacing r ′ by unlabeled ( _ ) .

We will represent each operation q i by a composition of two operations v i · q A , i , where q A , i ∈ O ( r i 1 , 1 , … , r i k , k , r q ) is the same expression as q i above where r q is a relation symbol of the same type as r ′ , and v i ∈ O ( r q , r ′ ) is the expression ( _ ) 1 ( y i ) ⇒ ( _ ) ( y i ) where y i is the tuple of variables of the atoms r ′ ( y i ) and r q ( y i ) .

In the simplest case when χ i is a tautology r ( x i ) ⇒ r ( x i ) , then χ i is replaced in S by q i \= q A , i \= v i \= 1 r ∈ O ( r , r ) (i. e., by identity mapping expression ( _ ) 1 ( x i ) ⇒ ( _ ) ( x i ) if x i is not empty; the expression ( _ ) 1 ⇒ ( _ ) for identity operation 1 r ∅ ∈ O ( r ∅ , r ∅ ) , otherwise).

4.

( Construct operad’s operations ).

Add the “empty operation” operad 1 r ∅ ∈ O ( r ∅ , r ∅ ) in S , represented by the mapping expression ( _ ) 1 ⇒ ( _ ) .

Return The set of abstract operad’s operations denoted by an (mapping) arrow M A B \= S : A → B .

In what follows, we will use the term “mapping operad” from such a set of abstract operad’s operations. The reason that we insert the identity “empty operad’s operation” 1 r ∅ ∈ O ( r ∅ , r ∅ ) in M A B \= S is that, as we will see, we can have the Tarski’s interpretations of database mappings such that we do not transfer any information from source to target database (with the empty information flux), and this empty operad’s operation has empty information flux. Consequently, the 1 r ∅ is always an element of the set of operad’s operations obtained from a given SOtgd. As we will see in the algorithm of decomposition of SOtgds, we will have the cases when there are generated mappings with SOtgd equal to the tautology r ∅ ⇒ r ∅ .

Example 29.

In the most trivial case when M A B \= { r ∅ ⇒ r ∅ } (i. e., when there is not an effective mapping between the schemas A and B ), where r ∅ is a nullary predicate symbol (i. e., an propositional letter), so that SOtgd is a banal tautology r ∅ ⇒ r ∅ and, consequently, M A B is always satisfied; we obtain that MakeOperads ( M A B ) \= { 1 r ∅ } . The particular cases for such trivial mappings are the following:

M A A ∅ \= { r ∅ ⇒ r ∅ } : A → A ∅ ; M A ∅ A \= { r ∅ ⇒ r ∅ } : A ∅ → A ; and Id A ∅ \= { r ∅ ⇒ r ∅ } : A ∅ → A ∅ ,

the identity mapping, where A ∅ \= ( ∅ , ∅ ) is the empty database schema. It is easy to verify that MakeOperads ( { r ∅ ⇒ r ∅ } ) \= { 1 r ∅ } .

Obviously, we cannot have the Tarski’s interpretations for empty schema A ∅ , and we will need to define their interpretation in an ad hoc way in Section A.3.5 dedicated to R-algebras for the operads.

There is an obvious inverse transformation of a given mapping-operad (a set of k -ary operations) M A B \= { q 1 , … , q n , 1 r ∅ } : A → B , into the SOtgd of this mapping. Let us define the algorithm that transform a set of mapping operads into the SOtgd:

Inverse operads algorithm InverseOperads( M A B )

Input : A mapping-operad M A B \= { q 1 , … , q n , 1 r ∅ } : A → B .

Output : Mapping M A B from A into B represented by the SOtgd.

1.

( Transform operads into logic formulae ).

Initialize S to be the empty set ∅ .

For each k -ary mapping operad’s operation q i ∈ O ( r i , 1 , … , r i , k , r ′ ) , for 1 ≤ i ≤ n , such that q i ≠ 1 r ∅ , add in S the logic sentence ∀ x i ϕ i where x i is the tuple of all variables in the expression of the operad’s operation q i and ϕ i is the logic formula where each labeled place symbol ( _ ) m , for 1 ≤ m ≤ k , is replaced by the relation r i , k and unlabeled place symbol ( _ ) is replaced by r ′ ∈ B .

2.

( Elimination of relation symbols not in A ).

In each formula ∀ x i ϕ i ∈ S where ϕ is an implication ϕ A , i ( x i ) ⇒ r ′ ( t i ) , in the left-side of these implications replace each atom r ( y i ) with r ∉ A , where y i ⊆ x i , by the equation ( f r ( y i ) ≐ 1 ‾ ) , where f r is the characteristic function of a hidden relation r ∉ A .

3.

( Construct SOtgd).

The SOtgd is a formula Φ equal to ∃ f ( ∀ x 1 ϕ 1 ∧ ⋯ ∧ ∀ x n ϕ n ) , where f is the tuple of all functional symbols in the formulae in S .

Return the logic mapping M A B \= { Φ } : A → B .

Consequently, the algebraic formalism based on the mapping operads is equivalent to the logic formalism based on SOtgds.

Example 30.

Schema A \= ( S A , ∅ ) consists of a unary relation EmpAcme that represents the employees of Acme, a unary relation EmpAjax that represents the employees of Ajax, and unary relation Local that represents employees that work in the local office of their company. Schema B \= ( S B , ∅ ) consists of a unary relation Emp that represents all employees, a unary relation Local1 that is intended to be a copy of Local and unary relation Over65 that is intended to represent people over age 65. Schema C \= ( S C , ∅ ) consists of a binary relation Office that associates employees with office numbers and unary relation CanRetire that represents employees eligible for retirement. Consider now the following schema mappings:

M A B \= { ∀ x e ( EmpAcme ( x e ) ⇒ Emp ( x e ) ) ∧ ∀ x e ( EmpAjax ( x e ) ⇒ Emp ( x e ) ) ∧ ∀ x p ( Local ( x p ) ⇒ Local1 ( x p ) ) } , and M B C \= { ∃ f 1 ( ∀ x e ( ( Emp ( x e ) ∧ Local1 ( x e ) ) ⇒ Office ( x e , f 1 ( x e ) ) ) ∧ ∀ x e ( ( Emp ( x e ) ∧ Over65 ( x e ) ) ⇒ CanRetire ( x e ) ) ) } .

Then, by their composition, we obtain the composed mapping M A C : A → C equal to

M A C \= { ∃ f 1 ∃ f 2 ∃ f Over 65 ( ∀ x e ( ( EmpAcme ( x e ) ∧ Local ( x e ) ) ⇒ Office ( x e , f 1 ( x e ) ) ) ∧ ∀ x e ( ( EmpAjax ( x e ) ∧ Local ( x e ) ) ⇒ Office ( x e , f 2 ( x e ) ) ) ∧ ∀ x e ( ( EmpAcme ( x e ) ∧ ( f Over 65 ( x e ) ≐ 1 ‾ ) ) ⇒ CanRetire ( x e ) ) ∧ ∀ x e ( ( EmpAjax ( x e ) ∧ ( f Over 65 ( x e ) ≐ 1 ‾ ) ) ⇒ CanRetire ( x e ) ) ) } ,

where f Over 65 is the characteristic function of the relation (predicate) Over65 which is not part of schema A . Then, by transformation into abstract operad’s operations, we obtain M A C \= MakeOperads ( M A C ) \= { q 1 A , q 2 A , q 3 A , q 4 A , 1 r ∅ } , q i A \= v i · q A , i , where:

1.

The operations q 1 A ∈ O ( EmpAcme , Local , Office ) and q A , 1 ∈ O ( EmpAcme , Local , r 1 ′ ) correspond to the expression ( ( _ ) 1 ( x e ) ∧ ( _ ) 2 ( x e ) ) ⇒ ( _ ) ( x e , f 1 ( x e ) ) and v 1 ∈ O ( r 1 ′ , Office ) to ( _ ) 1 ( x e , x p ) ⇒ ( _ ) ( x e , x p ) ;

2.

The operations q 2 A ∈ O ( EmpAjax , Local , Office ) and q A , 2 ∈ O ( EmpAjax , Local , r 2 ′ ) correspond to the expression ( ( _ ) 1 ( x e ) ∧ ( _ ) 2 ( x e ) ) ⇒ ( _ ) ( x e , f 2 ( x e ) ) and v 2 ∈ O ( r 2 ′ , Office ) to ( _ ) 1 ( x e , x p ) ⇒ ( _ ) ( x e , x p ) ;

3.

The operations q 3 A ∈ O ( EmpAcme , Over65 , CanRetire ) and q A , 3 ∈ O ( EmpAcme , Over65 , r 3 ′ ) correspond to the expression ( ( _ ) 1 ( x e ) ∧ ( _ ) 2 ( x e ) ) ⇒ ( _ ) ( x e ) and v 3 ∈ O ( r 3 ′ , CanRetire ) to ( _ ) 1 ( x e ) ⇒ ( _ ) ( x e ) ;

4.

The operations q 4 A ∈ O ( EmpAjax , Over65 , CanRetire ) and q A , 4 ∈ O ( EmpAjax , Over65 , r 4 ′ ) correspond to the expression ( ( _ ) 1 ( x e ) ∧ ( _ ) 2 ( x e ) ) ⇒ ( _ ) ( x e ) and v 4 ∈ O ( r 4 ′ , CanRetire ) to ( _ ) 1 ( x e ) ⇒ ( _ ) ( x e ) .

Based on the equivalence of representation of schema mappings by SOtgd and by mapping-operads, we can introduce the composition of mapping operads analogously to the composition of schema mappings.

Definition 65.

For any given schema mappings M A B : A → B and an atomic schema mapping M B C : B → C , we can define the correspondent mapping-operads M A B \= MakeOperads ( M A B ) \= { q 1 A , … , q n A , 1 r ∅ } : A → B and M B C \= MakeOperads ( M B C ) \= { q 1 B , … , q m B , 1 r ∅ } : B → C , and their composition M B C ∘ M A B ≜ { 1 r ∅ } ⋃ 1 ≤ i ≤ m { q i \= q i B · ( q i 1 A , … , q i j A ) | where q i B ∈ O ( r B , i 1 , … , r B , i j , r C , i ) ∈ M B C , and ( q i k A ∈ O ( r k 1 , … , r k l , r B , i k ) if q i k A ∈ M A B ; q i k A \= 1 r B , i k otherwise ) 1 ≤ k ≤ j } .

So, these three arrows M A B : A → B , M B C : B → C and M A C : A → C , in the example above, compose a graph G of this database mapping system.

From the fact that the operads can be composed, the composition of two schema mappings M A B and M B C can be translated into composition of operads, which is associative, so that they can be represented by the sketch category Sch ( G ) derived from the graph G of the schema mappings. It was demonstrated [ 5 ] that the transformation of SOtgds of the schema mappings into mapping operads by the algorithm MakeOperads is well-defined and satisfy the general properties of operads in Definition 63 .

Sketches are developed by Ehresmann’s school, especially by R. Guitartand and C. Lair [ 110 ], [ 164 ], [ 165 ]. Sketches are called graph-based logic and provide very clear and intuitive specification of computational data and activities. For any small sketch E , the category of models Mod ( E ) is an accessible category by Lair’s theorem and reflexive subcategory of Set E by the Ehresmann–Kennison theorem. A generalization to base categories other than Set was proved by Freyd and Kelly (1972) [ 166 ]. The generalization to DB category (see Theorem 10 in Section 7.1 ) is exhaustively provided in [ 5 ], so that the functorial semantics of a database mapping system expressed by a graph G is defined by a functor (R-algebra) α ∗ : Sch ( G ) → DB .

Sketch is a category together with a distinguished class of cones and cocones. A model of the sketch is a set-valued functor turning all distinguished cones into limit cones, and all distinguished cocones into colimit cocones, in the category Set of sets.

The category of models of a given sketch has models as objects and the arrows that represent all natural transformations between the models as functors. A category is sketchable (esquissable) or accessible iff it is equivalent to the category of set-valued models of a small sketch.

Recall that a graph G \= ( V G , E G ) consists of a set of vertices denoted by V G and a set of arrows (edges) denoted by E G together with the operators dom , cod : E G → V G , which assigns to each arrow its source and target. (Co)cones and diagrams are defined for graphs in exactly the same way as they are for categories, but commutative co(cones) and diagrams, of course, make no sense for graphs.

By a sketch we mean 4-tuple ( G , u , D , C ) where G is a graph, u : V G → E G is a function, which takes each vertex (node) A in V G to an arrow from A to A , D is a class of diagrams in G and C is a class of (co)cones in G . Each (c)cone in G goes (to)from some vertex (from)to some diagram; that diagram need not be in D and, in fact, it is necessary to allow diagrams, which are not in D as bases of (co)cones.

The R-algebra α is derived from a given Tarski’s interpretation I T of the given database schema mapping graph G and represented by a sketch category Sch ( G ) (with arrows M A B : A → B , as in Example 30 ). R-algebra α is equal to I T for the relations of the data schemas, α ( r i ) \= I T ( r i ) is a relational table of the instance database A \= α ∗ ( A ) \= { α ( r i ) ∣ r i ∈ S A } ( α ∗ denotes the extension of α to sets), and α ( q A , i ) : α ( r 1 ) × ⋯ × α ( r k ) → α ( r ′ ) is a surjective function from the relations in the instance database A into its image (relation) α ( r ′ ) , with a function α ( v i ) : α ( r ′ ) → α ( r B ) into the relation of the instance database B \= α ∗ ( B ) . Formal definition of an R-algebra α as a mapping interpretation of a schema mapping M A B : A → B is given by Definition 66 also when we have the negation in the left sides of the implications in a SOtgd of such a mapping.

We have that for any R-algebra α , α ( r ∅ ) \= ⊥ \= { ⟨ ⟩ } is the empty relation composed by only empty tuple ⟨ ⟩ ∈ D − 1 , and 1 r ∅ is the identity operads operation of the empty relation r ∅ , so that q ⊥ \= α ( 1 r ∅ ) \= id ⊥ : ⊥ → ⊥ is the identity function.

Example 31.

For the operads defined in Example 30 , let a mapping interpretation (an R-algebra) α be an extension of Tarski’s interpretation I T of the source schema A \= ( S A , Σ A ) that satisfies all constraints in Σ A and defines its database instance A \= α ∗ ( S A ) \= { α ( r i ) ∣ r i ∈ S A } and, analogously, an interpretation of C .

Let α satisfy the SOtgd of the mapping M A C by the Tarski’s interpretation for the functional symbols f i , for 1 ≤ i ≤ 2 , in this SOtgd (denoted by I T ( f i ) ).

Then we obtain the relations α ( EmpAcme ), α ( EmpAjax ), α ( Local ), α ( Office ) and α ( CanRetire ). The interpretation of f Over 65 is the characteristic function of the relation α ( Over65 in the instance B \= α ∗ ( S B ) of the database B \= ( S B , Σ B ) , so that f ‾ Over 65 ( a ) \= 1 if ⟨ a ⟩ ∈ α ( Over65 ) ).

Then this mapping interpretation α defines the following functions:

1.

The function α ( q A , 1 ) : α ( EmpAcme ) × α ( Local ) → α ( r 1 ′ ) , such that for any tuple ⟨ a ⟩ ∈ α ( EmpAcme ) and ⟨ b ⟩ ∈ α ( Local ) ,

α ( q A , 1 ) ( ⟨ a ⟩ , ⟨ b ⟩ ) \= ⟨ a , I T ( f 1 ( a ) ) ⟩ if a \= b ; ⟨ ⟩ otherwise .

And for any ⟨ a , b ⟩ ∈ α ( r 1 ′ ) , α ( v 1 ) ( ⟨ a , b ⟩ ) \= ⟨ a , b ⟩ if ⟨ a , b ⟩ ∈ α ( Office ) ; ⟨⟩ otherwise.

2.

The function α ( q A , 2 ) : α ( EmpAjax ) × α ( Local ) → α ( r 2 ′ ) , such that for any tuple ⟨ a ⟩ ∈ α ( EmpAjax ) and ⟨ b ⟩ ∈ α ( Local ) ,

α ( q A , 2 ) ( ⟨ a ⟩ , ⟨ b ⟩ ) \= ⟨ a , I T ( f 2 ( a ) ) ⟩ if a \= b ; ⟨ ⟩ otherwise .

And for any ⟨ a , b ⟩ ∈ α ( r 2 ′ ) , α ( v 2 ) ( ⟨ a , b ⟩ ) \= ⟨ a , b ⟩ if ⟨ a , b ⟩ ∈ α ( Office ) ; ⟨⟩ otherwise.

3.

The function α ( q A , 3 ) : α ( EmpAcme ) × α ( Over65 ) → α ( r 3 ′ ) , such that for any tuple ⟨ a ⟩ ∈ α ( EmpAcme ) and ⟨ b ⟩ ∈ α ( Over65 ) ,

α ( q A , 3 ) ( ⟨ a ⟩ , ⟨ b ⟩ ) \= ⟨ a ⟩ , if a \= b ; ⟨ ⟩ otherwise .

And for any ⟨ a ⟩ ∈ α ( r 3 ′ ) , α ( v 3 ) ( ⟨ a ⟩ ) \= ⟨ a ⟩ if ⟨ a ⟩ ∈ α ( CanRetire ) ; ⟨⟩ otherwise.

4.

The function α ( q A , 4 ) : α ( EmpAjax ) × α ( Over65 ) → α ( r 4 ′ ) , such that for any tuple ⟨ a ⟩ ∈ α ( EmpAjax ) and ⟨ b ⟩ ∈ α ( Over65 )

α ( q A , 4 ) ( ⟨ a ⟩ , ⟨ b ⟩ ) \= ⟨ a ⟩ , if a \= b ; ⟨ ⟩ otherwise .

And for any ⟨ a ⟩ ∈ α ( r 4 ′ ) , α ( v 4 ) ( ⟨ a ⟩ ) \= ⟨ a ⟩ if ⟨ a ⟩ ∈ α ( CanRetire ) ; ⟨⟩ otherwise.

From the fact that the mapping interpretation satisfies the schema mappings, based on Corollary 4 in Section 2.4.1 [ 5 ], all functions α ( v i ) , for 1 ≤ i ≤ 4 , are the injections.

The categorial logic used for the denotational semantics in data integration theory [ 5 ] is based on the category DB (see Theorem 10 in Section 7.1 ) where the objects are the instances of RDBs and the morphisms are the set of functions, which express the schema mappings between RDBs. It was demonstrated that the denotational semantics of database mappings is given by morphisms of the Kleisly category given by a power-view monad over the category DB .

The notion of a monad is one of the most general mathematical notions. For instance, every algebraic theory, i. e., every set of operations satisfying equational laws, can be seen as a monad. Moggi [ 94 ], [ 95 ] stressed the computational significance of monads and explained how they may help understand programs “ as functions from values to computations. ” The idea of Moggi, roughly, is to give denotational semantics to computations and it presents an alternative to the conceptual gap between the intensional (operational) and the extensional (denotational) approaches to the semantics of programming languages.

The idea of monad as a model for computations, based on an endofunctor T for a given category, is that for each set of values of type A , T A is the object of computations of “type A ,” introduced in Section A.3.2 . Let us explain the way we can use such denotational semantics, based on monads, in the case of relational databases. It is well known that the relational databases are complex structures, defined by some sets of n -ary relations. In addition, the mappings between the relational databases are based on some sets of view mappings between a source database A and a target database B , as specified in Section A.3.4 . We consider the views as an universal property for databases (i. e., possible observations of the information contained in some database).

A categorical logic (denotational semantics) for database schema mapping based on views , presented in [ 5 ], is a very general framework for database-integration/exchange and peer-to-peer. The base database category DB (instead of traditional Set category of sets and functions between them), with objects instance databases and with morphisms (mappings which are not simple functions) between them, is used at an instance level as a proper semantic domain for a database mappings based on a set of complex query computations.

The higher logical schema level of mappings between databases, usually written in some high expressive logical language (e. g., [ 92 ], [ 99 ], GLAV (LAV and GAV), tuple generating dependency) can then be translated functorially into this base “computation” category. We will use such a framework also because a Relational DB (RDB) is formally defined as a GAV Data Integration system, so we are able to use all mathematical tools developed in [ 5 ] in order to present a formal denotational semantics for the RDBs.

A similar approach in using Kleisli semantics to relax the atomicity requirement for data in standard RDBs has been recently presented in [ 167 ], but in that case the level of presentation of a database schema is given by the graphs (sketch categories) composed by binary relations only and the functional dependencies between them. Consequently, in such a low level schema representation we can use the topos Set category as a base category and simple powerset functor as a monad, while in our higher-level abstraction we present the whole RDB schema as a node of the sketch and we represent also complex integrity constraints over schemas by schema mappings. Consequently, in our higher level presentation framework the monads have to be developed for the weak monoidal topos DB , which is a somewhat mathematically more complicated task.

A.3.5   Semantics of DB schema mappings: Information fluxes

Formal definition of an R-algebra α given by Definition 64 as a mapping interpretation of a schema mapping M A B : A → B can be reformulated as follows.

Definition 66.

Let ϕ A i ( x ) ⇒ r B ( t ) be an implication χ in a normalized SOtgd ∃ f ( Ψ ) (where Ψ is a FOL formula) of the mapping M A B , t be a tuple of terms with variables in x \= ( x 1 , … , x m ) , and q i ∈ MakeOperads ( M A B ) be the operad’s operation of this implication obtained by MakeOperads algorithm, equal to the expression ( e ⇒ ( _ ) ( t ) ) ∈ O ( r 1 , … , r k , r B ) , where q i \= v i · q A , i with q A , i ∈ O ( r 1 , … , r k , r q ) and v i ∈ O ( r q , r B ) such that for a new relational symbol r q , ar ( r q ) \= ar ( r B ) ≥ 1 .

Let S be an empty set and e [ ( _ ) n / r n ] 1 ≤ n ≤ k be the formula obtained from expression e where each place-symbol ( _ ) n is substituted by relational symbol r n for 1 ≤ n ≤ k . Then do the following as far as it is possible: For each two relational symbols r j , r n in the formula e [ ( _ ) n / r n ] 1 ≤ n ≤ k such that j h -th free variable (which is not an argument of a functional symbol) in the atom r j ( t j ) is equal to n h -th free variable in the atom r n ( t n ) (both atoms in e [ ( _ ) n / r n ] 1 ≤ n ≤ k ), we insert the set { ( j h , j ) , ( n h , n ) } as one element of S . At the end, S is the set of sets that contain the pairs of mutually equal free variables.

An R-algebra α is a mapping interpretation of M A B : A → B if it is an extension of a Tarski’s interpretation I T , of all predicate and functional symbols in FOL formula Ψ, with I T ∗ being its extension ( A.1 ) to all formulae, and if for each q i ∈ MakeOperads ( M A B ) it satisfies the following:

1.

For each relational symbol r i ≠ r ∅ in A or B , α ( r i ) \= I T ( r i ) .

2.

We obtain a function f \= α ( q A , i ) : R 1 × ⋯ × R k → α ( r q ) ,

where for each 1 ≤ i ≤ k , R i \= D ar ( r i ) \ α ( r i ) if the place symbol ( _ ) i ∈ q i is preceded by negation operator ¬; α ( r i ) otherwise, such that for every d i ∈ R i :

f ( d 1 , … , d k ) \= g ∗ ( t ) \= ( g ∗ ( t 1 ) , … , g ∗ ( t ar ( r B ) ) )

if ⋀ { π j h ( d j ) \= π n h ( d n ) ∣ { ( j h , j ) , ( n h , n ) } ∈ S } is true and the assignment g satisfies the formula e [ ( _ ) n / r n ] 1 ≤ n ≤ k ; ⟨⟩ (empty tuple) otherwise, where the assignment g : { x 1 , … , x m } → D is defined by the tuple of values ( g ( x 1 ) , … , g ( x m ) ) \= Cmp ( S , ( d 1 , … , d k ) ) , and its extension g ∗ to all terms such that for any term f i ( t 1 , … , t n ) :

g ∗ ( f i ( t 1 , … , t n ) ) \= I T ( f i ) ( g ∗ ( t 1 ) , … , g ∗ ( t n ) ) if n ≥ 1 ; I T ( f i ) otherwise .

The algorithm Cmp (compacting the list of tuples by eliminating the duplicates defined in S ) is defined as follows:

Input : a set S of joined (equal) variables defined above, and a list of tuples ( d 1 , … , d k ) .

Initialize d to d 1 . Repeat consecutively the following, for j \= 2 , … , k :

Let d j by a tuple of values ( v 1 , … , v j n ) , then for i \= 1 , … , j n repeat consecutively the following:

d \= d & v i if there does not exist and element { ( j h , j ) , ( n h , n ) } in S such that j ≤ n ; d , otherwise.

(The operation of concatenation ′ & ′ appends the value v i at the end of tuple d )

Output : The tuple Cmp ( S , ( d 1 , … , d k ) ) \= d .

3.

α ( r q ) is equal to the image of the function f in point 2 above.

4.

The function h \= α ( v i ) : α ( r q ) → α ( r B ) such that for each b ∈ α ( r q ) ,

h ( b ) \= b if b ∈ α ( r B ) ; empty tuple ⟨ ⟩ otherwise .

Note that the formulae ϕ A i ( x ) and expression e [ ( _ ) n / r n ] 1 ≤ n ≤ k are logically equivalent, with the only difference that the atoms with characteristic functions f r ( t ) \= 1 in the first formula are substituted by the atoms r ( t ) , based on the fact that the assignment g satisfies r ( t ) iff g ∗ ( f r ( t ) ) \= f r ( g ∗ ( t ) ) \= 1 , where f r : D ar ( r ) → { 0 , 1 } is the characteristic function of relation α ( r ) such that for each tuple c ∈ D ar ( r ) , f r ( c ) \= 1 if c ∈ α ( r ) ; 0 otherwise.

Example 32.

Let us show how we construct the set S and the compacting of tuples given by Definition 66 above.

Let us consider an operad q i ∈ MakeOperads ( M A B ) , obtained from a normalized implication ϕ A i ( x ) ⇒ r B ( t ) in M A B , ( ( y \= f 1 ( x , z ) ) ∧ r 1 ( x , y , z ) ∧ r 2 ( v , x , w ) ∧ ( f r 3 ( y , z , w ′ , w ) \= 1 ) ) ⇒ r B ( x , z , w , f 2 ( v , z ) ) , so that q i is equal to the expression ( e ⇒ ( _ ) ( t ) ) ∈ O ( r 1 , r 2 , r 3 , r B ) , where x \= ( x , y , z , v , w , w ′ ) (the ordering of variables in the atoms (with database relational symbols) from left to right), t \= ( x , z , w , f 2 ( v , z ) ) and the expression e equal to ( y ≐ f 1 ( x , z ) ) ∧ ( _ ) 1 ( t 1 ) ∧ ( _ ) 2 ( t 2 ) ∧ ( _ ) 3 ( t 3 ) , with t 1 \= ( x , y , z ) , t 2 \= ( v , x , w ) and t 3 \= ( y , z , w ′ , w ) . Consequently, we obtain

S \= { { ( 1 , 1 ) , ( 2 , 2 ) } , { ( 2 , 1 ) , ( 1 , 3 ) } , { ( 3 , 1 ) , ( 2 , 3 ) } , { ( 3 , 2 ) , ( 4 , 3 ) } } ,

that are the positions of duplicates (or joined variables) of x , y , z and w , respectively.

Thus, for given tuples d 1 \= ( a 1 , a 2 , a 3 ) ∈ α ( r 1 ) , d 2 \= ( b 1 , b 2 , b 3 ) ∈ α ( r 2 ) and d 3 \= ( c 1 , c 2 , c 3 , c 4 ) ∈ α ( r 3 ) , the statement ⋀ { π j h ( d j ) \= π n h ( d n ) ∣ { ( j h , j ) , ( n h , n ) } ∈ S } is equal to ( π 1 ( d 1 ) \= π 2 ( d 2 ) ) ∧ ( π 2 ( d 1 ) \= π 1 ( d 3 ) ) ∧ ( π 3 ( d 1 ) \= π 2 ( d 3 ) ) ∧ ( π 3 ( d 2 ) \= π 4 ( d 3 ) ) , which is true when a 1 \= b 2 , a 2 \= c 1 , a 3 \= c 2 and b 3 \= c 4 .

The compacting of these tuples is equal to

d \= Cmp ( S , ( d 1 , d 2 , d 3 ) ) \= ( a 1 , a 2 , a 3 , b 1 , b 3 , c 3 ) ,

with the assignment to variables [ x / a 1 ] , [ y / a 2 ] , [ z / a 3 ] , [ v , b 1 ] , [ w / b 3 ] and [ w ′ / c 3 ] .

That is, d \= x [ x / a 1 , y / a 2 , z / a 3 , v / b 1 , w / b 3 , w ′ / c 3 ] is obtained by this assignment g to the tuple of variables x , so that the sentence e [ ( _ ) n / r n ] 1 ≤ n ≤ k / g is well-defined and equal to

( a 2 \= I T ( f 1 ) ( a 1 , a 3 ) ) ∧ r 1 ( a 1 , a 2 , a 3 ) ∧ r 2 ( b 1 , a 1 , b 3 ) ∧ r 3 ( a 2 , a 3 , c 3 , b 3 ) , i. e., to ( a 2 \= I T ( f 1 ) ( a 1 , a 3 ) ) ∧ r 1 ( d 1 ) ∧ r 2 ( d 2 ) ∧ r 3 ( d 3 ) ,

and if this formula is satisfied by such an assignment g , i. e., I T ∗ ( e [ ( _ ) n / r n ] 1 ≤ n ≤ k / g ) \= 1 , then

f ( ( d 1 , d 2 , d 3 ) ) \= g ∗ ( t ) \= ( g ( x ) , g ( z ) , g ( w ) , g ∗ ( f 2 ( v , z ) ) ) \= ( a 1 , a 3 , b 3 , I T ( f 2 ) ( b 1 , a 3 ) ) ,

for a given Tarski’s interpretation I T , where I T ∗ is the extension of I T to all FOL formulae.

If M A B is satisfied by the mapping interpretation α , this value of f ( ( d 1 , d 2 , d 3 ) ) corresponds to the truth of the normalized implication in the SOtgd of M A B , ϕ A i ( x ) ⇒ r B ( t ) for the assignment g derived by substitution [ x / d ] , when ϕ A i ( x ) / g is true. Hence, r B ( t ) / g is equal to r B ( a 1 , a 3 , b 3 , I T ( f 2 ) ( b 1 , a 3 ) ) , i. e., to r B ( f ( ( d 1 , d 2 , d 3 ) ) ) and has to be true as well (i. e., I T ∗ ( r B ( f ( ( d 1 , d 2 , d 3 ) ) ) ) \= 1 or, equivalently, f ( ( d 1 , d 2 , d 3 ) ) ∈ α ( r B ) \= I T ( r B ) ).

Consequently, if M A B is satisfied by a mapping interpretation α (and hence α ( v i ) is an injection function with α ( r q ) ⊆ α ( r B ) ), then f ( ( d 1 , d 2 , d 3 ) ) ∈ ‖ r B ‖ , so that the function f \= α ( q A , i ) represents the transferring of the tuples in relations of the source instance databases into the target instance database B \= α ∗ ( B ) , according to the SOtgd Φ of the mapping M A B \= { Φ } : A → B (see the Examples 30 and 31 in Section A.3.4 for more details).

In this way, for a given R-algebra α which satisfies the conditions for the mapping interpretations in Definition 66 , we translate a logical representation of database mappings, based on SOtgds, into an algebraic representation based on relations of the instance databases and the functions obtained from mapping operads.

It is easy to verify that for a query mapping ϕ A i ( x ) ⇒ r B ( t ) , a mapping interpretation α is an R-algebra such that the relation α ( r q ) is just equal to the image of the function α ( q A , i ) . The mapping interpretation of v i is the transfer of information of this computed query into the relation α ( r B ) of the database B .

When α satisfies this query mapping ϕ A i ( x ) ⇒ r B ( t ) , then α ( r q ) ⊆ α ( r B ) and, consequently, the function α ( v i ) is an injection, i. e., the inclusion of α ( r q ) into α ( r B ) . Moreover, each R-algebra α of a given set of mapping operads between a source schema A and target schema B determines a particular information flux from the source into the target schema.

Definition 67 (Information flux).

Let α be a mapping interpretation (an R-algebra in Definition 66 ) of a given set M A B \= { q 1 , … , q n , 1 r ∅ } \= MakeOperads ( M A B ) of mapping operads, obtained from an atomic mapping M A B : A → B , and A \= α ∗ ( S A ) be an instance of the schema A \= ( S A , Σ A ) that satisfies all constraints in Σ A .

For each operation q i ∈ M A B , q i \= ( e ⇒ ( _ ) ( t i ) ) ∈ O ( r i , 1 , … , r i , k , r i ′ ) , let x i be its tuple of variables, which appear at least one time free (not as an argument of a function) in t i and appear as variables in the atoms of relational symbol of the schema A in the formula e [ ( _ ) j / r i , j ] 1 ≤ j ≤ k . Then we define:

(1)

Var ( M A B ) \= ⋃ 1 ≤ i ≤ n { { x } ∣ x ∈ x i } .

We define the kernel of the information flux of M A B , for a given mapping-interpretation α , by (we denote the image of a function f by “ im ( f ) ”)

(2)

Δ ( α , M A B ) \= { π x i ( im ( α ( q i ) ) ) ∣ q i ∈ M A B , and x i is not empty } ⋃ ⊥ 0 , if Var ( M A B ) ≠ ∅ ; ⊥ 0 otherwise.

We define the information flux from its kernel by

(A.20) Flux ( α , M A B ) \= T ( Δ ( α , M A B ) ) .

The flux of composition of M A B and M B C is defined by

(A.21) Flux ( α , M B C ∘ M A B ) \= Flux ( α , M A B ) ⋂ Flux ( α , M B C ) .

We say that an information flux is empty if it is equal to ⊥ 0 \= { ⊥ } (and hence it is not the empty set), analogously as for an empty instance database.

The information flux of the SOtgd of the mapping M A B for the instance-level mapping f \= α ∗ ( M A B ) : A → α ∗ ( B ) composed of the set of functions f \= α ∗ ( M A B ) \= { α ( q 1 ) , … , α ( q n ) , q ⊥ } , is denoted by f ˜ . Notice that ⊥ ∈ f ˜ , and hence the information flux f ˜ is a instance database as well.

From this definition, each instance mapping is a set of functions whose information flux is the intersection of the information fluxes of all atomic instance mappings that compose this composed instance mapping. These basic properties of the instance mappings is used in order to define the database DB category where the instance mappings are the morphisms (i. e., the arrows) of this category, while the instance databases (each instance database is a set of relations of a schema also with the empty relation ⊥) are its objects.

In the case of an atomic mapping, obtained from a set of egds of a given schema A , we have the following particular property.

Corollary 29 ([ 5 ]).

Let Φ be the SOtgd equal to EgdsToSOtgd ( Σ A egd ) and Ψ be the SOtgd equal to TgdsToConSOtgd ( Σ A tgd ) for a given schema A \= ( S A , Σ A egd ⋃ Σ A tgd ) .

Then, for every R-algebra α, the information flux Flux ( α , MakeOperads ( { Φ ∧ Ψ } ) ) \= ⊥ 0 is empty.

Note that this corollary confirms that, for any database schema A \= ( S A , Σ A ) where Σ A \= Σ A egd ⋃ Σ A tgd , we can define the integrity-constraints mapping by a schema mapping ⊤ A A ⊤ \= { Φ ∧ Ψ } : A → A ⊤ (where Φ is the SOtgd equal to EgdsToSOtgd ( Σ A egd ) and Ψ is the SOtgd equal to TgdsToConSOtgd ( Σ A tgd ) and A ⊤ \= ( { r ⊤ } , ∅ ) ) and, consequently, by equivalent operads-mapping T A A ⊤ \= MakeOperads ( { Φ } ) ⋃ MakeOperads ( { Ψ } ) : A → A ⊤ with the empty information flux.

We have no mapping from A ⊤ into other schema mappings, so that this integrity-constraint mapping does not participate in any significant composition with other mappings in a given database mapping system. Moreover, from the fact that the information flux of composed mappings is equal to the intersection of the information fluxes of all atomic arrows which compose this mapping, such composed mapping which contains an atomic integrity-constraint mapping will always have an empty flux. Consequently, the role of the integrity-constraint mappings is only “logical,” used to express the integrity constraints for schemas, and to verify if for a given mapping-interpretation α in Definition 66 they are satisfied. The extension of the database mapping systems with the integrity-constraints mappings will not modify its original semantic structure, but in this extended framework not only the interschema mappings but the schema integrity constraints will be the “first objects” of big data integration theory and presented in a uniform elegant manner.

Example 33.

Schema A consists of a single binary relational symbol Takes , that associates student names with courses they take, i. e., S A \= { Takes ( x n , x c ) } , Σ A \= ∅ . Schema B consists of one binary relational symbol Takes1 , that is intended to provide a copy of Takes , and of an additional binary relational symbol Student that associates each student name with a student id, i. e., S B \= { Takes1 ( x n , x c ) , Student ( x n , y ) } , Σ B \= ∅ . Schema D consists of one binary relational symbol Enrolment that associates student ids with courses the student takes, and of an additional binary relational symbol Teaching that associates professor names with the courses, i. e., S D \= { Enrolment ( y , x c ) , Teaching ( x p , x c ) } , Σ D \= ∅ . Schema C consists of a one ternary relational symbol Learning that associates student name with courses he/she takes and professor names, and of an additional unary relational symbol Professor with professor names, i. e., S C \= { Learning ( x n , x c , x p ) , Professor ( x p ) } , and with integrity constraints

Σ C \= { ∀ x p ( Professor ( x p ) ⇒ ∃ x n ∃ x c Learning ( x n , x c , x p ) ) , ∀ x n ∀ x c ∀ y ∀ z ( ( Learning ( x n , x c , z 1 ) ∧ Learning ( x n , x c , z 2 ) ) ⇒ z 1 \= z 2 ) } ,

where the second constraint defines the tuple ( x n , x c ) as a key of the relation Learning .

Let us consider the following composition of the atomic mappings:

M A B : A → B , M B D : B → D , M A C : A → C and M C D : C → D , where M A B \= { ∀ x n ∀ x c ( Takes ( x n , x c ) ⇒ Takes1 ( x n , x c ) ) , ∀ x n ∀ x c ( Takes ( x n , x c ) ⇒ Student ( x n , f 1 ( x n ) ) ) } , M B D \= { ∀ x n ∀ x c ∀ y ( ( Takes1 ( x n , x c ) ∧ Student ( x n , y ) ) ⇒ Enrolment ( y , x c ) ) } M A C \= { ∀ x n ∀ x c ( Takes ( x n , x c ) ⇒ Learning ( x n , x c , f 2 ( x n , x c ) ) ) } , M C D \= { ∀ x n ∀ x c ∀ x p ( Learning ( x n , x c , x p ) ⇒ Teaching ( x p , x c ) ) } .

Hence, their composition is equal to the following mappings:

M A D \= M B D ∘ M A B \= { ∃ f 1 ( ∀ x 1 ∀ x 2 ( Takes ( x 1 , x 2 ) ⇒ Enrolment ( f 1 ( x 1 ) , x 2 ) ) ) } , M A D ′ \= M C D ∘ M A C \= { ∃ f 2 ( ∀ x 1 ∀ x 2 ( Takes ( x 1 , x 2 ) ⇒ Teaching ( f 2 ( x 1 , x 2 ) , x 2 ) ) ) } ,

which are not logically equivalent.

However, we obtain from Definition 67 , for A \= α ∗ ( A ) , B \= α ∗ ( B ) and C \= α ∗ ( C ) :

Flux ( α , ( MakeOperads ( M B D ) ∘ MakeOperads ( M A B ) ) ) \= Flux ( α , MakeOperads ( M A B ) ) ⋂ Flux ( α , MakeOperads ( M B D ) ) \= T ( ‖ Takes ( x n , x c ) ‖ A , π x n ‖ Takes ( x n , x c ) ‖ A ) ⋂ T ( { π x c , y ‖ Takes1 ( x n , x c ) ∧ Student ( x n , y ) ‖ B } ) , and Flux ( α , ( MakeOperads ( M C D ) ∘ MakeOperads ( M A C ) ) ) \= Flux ( α , MakeOperads ( M A C ) ) ⋂ Flux ( α , MakeOperads ( M C D ) ) \= T ( ‖ Takes ( x n , x c ) ‖ A ) ⋂ T ( { π x p , x c ‖ Learning ( x n , x c , x p ) ‖ C } ) .

In the case when in the given universe U \= dom , the domain dom ( y ) for the attribute y of the atom Student ( x n , y ) is disjoint from dom ( x n ) and from dom ( x c ) of the atom Takes ( x n , x c ) , and if dom ( x p ) for the attribute x p of the atom Learning ( x n , x c , x p ) is disjoint from dom ( x n ) and from dom ( x c ) of the atom Takes ( x n , x c ) , then it is easy to verify that

Flux ( α , ( MakeOperads ( M B D ) ∘ MakeOperads ( M A B ) ) ) \= Flux ( α , ( MakeOperads ( M C D ) ∘ MakeOperads ( M A C ) ) ) \= T ( ‖ Takes ( x n , x c ) ‖ A ) .

Consequently, in this case, the two composed mappings M A D and M A D ′ have the same information fluxes from A into target schema D , so that, from the strict semantics point of view, they are equal instance-level mappings.

Now we can show that the information fluxes of the schema mappings have the categorial morphism’s properties.

Corollary 30 ([ 5 ]).

The information fluxes of the schema mappings and the composition (i. e., the set intersection) of information fluxes satisfy categorial properties of the morphisms between instance databases as objects of such a category.

Based on this and the corollary, it is possible to define the categorial semantics for the schema mappings, by defining a functor from the sketch category of a given schema-mapping graph into an instance-level category where the objects are the database instances and the morphisms are characterized by the information fluxes of the schema mappings.

Definition 68.

Any two arrows f , g : A → B where A and B are the instance databases (the simple sets of the relations) in DB are equal if f ˜ \= g ˜ , i. e., if they have the same information fluxes.

The formalization of the schema mappings by means of operads is useful in order to be able to extend each R-algebra α to a functor from the category sketch (obtained from a graph of (inter)schema mappings) into the base DB category, which represents the denotational semantics of this schema database mapping graph.

That is, each schema mapping M A B transformed into its mapping-operad M A B \= MakeOperads ( M A B ) \= { q 1 , … , q n , 1 r ∅ } : A → B may be seen as a morphism of a sketch category, and hence it will be mapped by a functor (R-algebra) α , which satisfies Definition 66 (i. e., such that it is a mapping interpretation ), into the DB category morphism α ∗ ( M A B ) \= { f 1 , … , f n , q ⊥ } : A → B , where A \= α ( S A ) is an instance database of the schema A , B \= α ( S B ) is an instance database of the schema B and f i \= α ( q i ) are the functions obtained from the operads, with the domain equal to the Cartesian product of a subset of relations in the instance A and the codomain is a relation in the instance B .

The functors such that, for every operad’s operation q i \= v i · q A , i in each sketch’s mapping, the function α ( v i ) is an inclusion (injection) will define a model of the schema database mapping system expressed by this sketch. This is the principal idea for the categorical semantics of the schema database mapping systems.

For the composition of complex database mapping graphs, it is important to distinguish the following two basic compositions of database schemas A and B with respect to DBMSs:

  • In the composed schema, in order to make it impossible to write a query over the composition with relations of both databases, the two database schemas should be mutually separated by two independent DBMSs: it is a common case when two databases are separated, and this binary separation-composition at schema level is denoted by A † B (disjoint union) where all elements are indexed by schema symbols (denoted by a label A ¨ , for a schema A \= ( S A , Σ A ) ), equal to the complex schema ( S A † B , Σ A † B ) where S A † B \= ( { A ¨ } × S A ) ⋃ ( { B ¨ } × S B ) and Σ A † B \= ( { A ¨ } × Σ A ) ⋃ ( { B ¨ } × Σ B ) and × is Cartesian product of sets (if B \= A , then we set A ¨ \= 1 and B ¨ \= 2 ).

  • In the composed schema, when the two database schemas are connected into the same DBMS (without any change of the two original database schemas): in this case, we are able to use the queries over this composed schema with relations of both databases for interdatabase mappings. This binary federation-composition, denoted by A ⨁ B , is the (simple) union but with renaming (if we have the same relational symbol r ∈ S A ⋂ S B , then before the union, we rename this symbol in S B by a new fresh relational symbol of the same type), so that S A ⨁ B \= S A ⋃ rn S B , where ⋃ rn denotes the union with renaming.

The equality ′ \= ′ for database schemas is naturally defined as follows: for any two schemas A , B ∈ S , A \= B if π i ( A ) \= π i ( B ) , i \= 1 , 2 . Let us consider the mappings M : A † B → C and M : A ⨁ B → C . In the first case, in any query mapping q ( x ) ⇒ q C ( x ) in the SOtgd of M , all relational symbols in the query q ( x ) must be of the database A or (mutually exclusive) of the database B , i. e.,

(1)

M \= { ∃ f ( ∀ x 1 ( q A , 1 ( x 1 ) ⇒ q C , 1 ( t 1 ) ) ∧ ⋯ ∧ ∀ x k ( q A , k ( x k ) ⇒ q C , k ( t k ) ) ∧ ∀ y 1 ( q B , 1 ( y 1 ) ⇒ q C , k + 1 ( t 1 ′ ) ) ∧ ⋯ ∧ ∀ y m ( q B , m ( y m ) ⇒ q C , k + m ( t m ′ ) ) ) } ,

with t i the tuple of terms with variables in x i , for 1 ≤ i ≤ k , and t i ′ the tuple of terms with variables in y i , for 1 ≤ i ≤ m . Consequently, this mapping is the graph:

with M A C \= { ∃ f A ( ∀ x 1 ( q A , 1 ( x 1 ) ⇒ q C , 1 ( t 1 ) ) ∧ ⋯ ∧ ∀ x k ( q A , k ( x k ) ⇒ q C , k ( t k ) ) ) } and M B C \= { ∃ f B ( ∀ y 1 ( q B , 1 ( y 1 ) ⇒ q C , k + 1 ( t 1 ′ ) ) ∧ ⋯ ∧ ∀ y m ( q B , m ( y m ) ⇒ q C , k + m ( t m ′ ) ) ) } , and f A , f B ⊆ f , while in the case of mapping M : A ⨁ B → C such a decomposition is not possible because we can have a query mapping q ( x ) ⇒ q C ( x ) in the SOtgd of M with relational symbols in q ( x ) from both databases A and B .

If we introduce the mappings M 1 \= { ⋀ { ∀ x i ( r A i ( x i ) ⇒ r A i ( x i ) ) ∣ r A i ∈ A } } and M 2 \= { ⋀ { ∀ y i ( r B i ( y i ) ⇒ r B i ( y i ) ) ∣ r B i ∈ B } } , then we obtain the mapping graph

that can be seen as a cocone diagram for schema database mappings.

Let us consider another dual example, a mapping M : C → A † B . In this case, in any query mapping q C ( x ) ⇒ q ( x ) ∈ M , all relational symbols in the query q ( x ) must be of database A or (mutually exclusive) of database B . That is,

(2)

M \= { ∃ f ( ∀ x 1 ( q C , 1 ( x 1 ) ⇒ q A , 1 ( t 1 ) ) ∧ ⋯ ∧ ∀ x k ( q C , k ( x k ) ⇒ q A , k ( t k ) ) ∧ ∀ y 1 ( q C , k + 1 ( y 1 ) ⇒ q B , 1 ( t 1 ′ ) ) ∧ ⋯ ∧ ∀ y m ( q C , k + m ( y m ) ⇒ q B , m ( t m ′ ) ) ) } .

Consequently, this mapping can be equivalently represented by the graph:

where M C A \= { ∃ f A ( ∀ x 1 ( q C , 1 ( x 1 ) ⇒ q A , 1 ( t 1 ) ) ∧ ⋯ ∧ ∀ x k ( q C , k ( x k ) ⇒ q A , k ( t k ) ) ) } and M B C \= { ∃ f B ( ∀ y 1 ( q B , 1 ( y 1 ) ⇒ q C , k + 1 ( t 1 ′ ) ) ∧ ⋯ ∧ ∀ y m ( q B , m ( y m ) ⇒ q C , k + m ( t m ′ ) ) ) } If we again introduce the mappings M 1 \= { ⋀ { ∀ x i ( r A i ( x i ) ⇒ r A i ( x i ) ) ∣ r A i ∈ A } } and M 2 \= { ⋀ { ∀ y i ( r B i ( y i ) ⇒ r B i ( y i ) ) ∣ r B i ∈ B } } , then

is a dual graph that can be seen as a cone diagram for the schema database mappings.

It is important to notice that differently from the mapping graphs, where the schema mappings are expressed by SOtgds, the small sketch categories derived from such a graph will have the equivalent schema mappings but represented algebraically by the sets of operad’s operations, in order to be able to represent each R-algebra α as a functor from this sketch category (at the schema level) into the denotational (instance level) DB category. For the mappings that involve the composed source schema (by separation operator †) M \= { Φ } : A † B → C , we cannot directly use the algorithm MakeOperads ( M ) because we would obtain operad’s operations possibly with relations of both schemas. Consequently, we have to divide this SOtgd Φ into a conjunction Φ A ∧ Φ B , where Φ A is an SOtgd whose left-hand sides of implication contain only relational symbols in A and Φ B , only relational symbols in B (as in the mapping (1)).

Consequently, we define the complex mapping-operad M ( A † B ) C by

(3)

M ( A † B ) C ≜ [ M A C , M B C ] : A † B → C

where M A C ≜ MakeOperads ( { Φ A } ) \= ( q 1 , … , q k , 1 r ∅ ) : A → C and M B C ≜ MakeOperads ( { Φ B } \= ( q 1 ′ , … , q m ′ , 1 r ∅ ) : B → C are two simple mapping operads by introducing a structural-operator [ _ , _ ] . Information flux of complex mapping operads is different from the information flux of ordinary (simple) mapping operads:

(4)

Flux ( α , [ M A C , M B C ] ) ≜ Flux ( α , M A C ) ⨄ Flux ( α , M B C ) \= { ( 1 , a ) ∣ a ∈ Flux ( α , M A C ) } ⋃ { ( 2 , b ) ∣ b ∈ Flux ( α , M B C ) } .

Analogously, each complex mapping-operad M D ( A † B ) from a simple (nonseparated) schema D into separated schema A † B is denoted as ⟨ M D A , M DB ⟩ : D → A † B where M D A : D → A and M DB : D → B are ordinary (simple) mapping-operads (equal to { 1 r ∅ } if they are not defined), with

(5)

Flux ( α , ⟨ M D A , M DB ⟩ ) ≜ Flux ( α , M D A ) ⨄ Flux ( α , M DB ) .

Any pair of simple mapping-operads M A C , M B D can be expressed by single complex mapping operad:

(6)

M ( A † B ) ( C † D ) \= M A C † M B D ≜ M A C ⨄ M B D : A † B → C † D , with Flux ( α , M A C ⨄ M B D ) ≜ Flux ( α , M D A ) ⨄ Flux ( α , M DB ) .

Now we introduce formally these types of complex mapping operads as follows.

Definition 69.

The n -ary composition of separated simple schemas define the following four types of complex morphisms:

1.

A mapping-operad ⨄ ( M A 1 C 1 , … , M A n C n ) : A 1 † ⋯ † A n → C 1 † ⋯ † C n , with

Flux ( α , ⨄ ( M A 1 C 1 , … , M A n C n ) ) \= ⨄ ( Flux ( α , M A 1 C 1 ) , … , Flux ( α , M A n C n ) ) .

2.

A mapping-operad [ M A 1 C , … , M A n C ] : A 1 † ⋯ † A n → C , with

Flux ( α , [ M A 1 C , … , M A n C ] ) \= ⨄ ( Flux ( α , M A 1 C ) , … , Flux ( α , M A n C ) ) .

3.

A mapping-operad ⟨ M D A 1 , … , M D A n ⟩ : D → A 1 † ⋯ † A n , with

Flux ( α , ⟨ M D A 1 , … , M D A n ⟩ ) \= ⨄ ( Flux ( α , M D A 1 ) , … , Flux ( α , M D A n ) ) .

4.

The composition of last two types of complex morphisms is a mapping operad from D into C :

M D C \= [ M A 1 C , … , M A n C ] ∘ ⟨ M D A 1 , … , M D A n ⟩ \= ⌈ M A 1 C ∘ M D A 1 , … , M A n C ∘ M D A n ⌋ : D → A 1 † ⋯ † A n → C ,

with a set of nonempty mappings M A i C ∘ M D A i : D → C , i \= 1 , … , n , enclosed by structural operator ⌈ _ , … , _ ⌋ , all with the same source and target schemas, so that the resulting information flux is a flux of the union of all these mappings:

Flux ( α , M D C ) \= T ( ⋃ { Flux ( α , M A i C ∘ M D A i ) ∣ 1 ≤ i ≤ n } ) .

5.

Each schema mapping above, with structural operators ⨄,[,],⟨,⟩ and ⌈,⌋, is denominated as a complex ⨄-atomic sketch’s schema mapping.

For a given mapping-interpretation α , we obtain the instance-database complex morphisms, e. g., α ∗ ( [ M A 1 C , … , M A n C ] ) \= [ α ∗ ( M A 1 C ) , … , α ( M A n C ) ] . We also introduce another kind of binary symmetric operations for a composition of the schemas and schema mappings, denoted by ⋂ α , where α is an R-algebra.

Definition 70.

For each R-algebra α , we define an α -intersection symmetric binary operator ⋂ α for the schema mappings, as follows:

1.

For any two simple schemas A and B , their α -intersection is defined by

A ⋂ α B \= ( S , ∅ ) , where S \= { r ∈ R ∣ α ( r ) ∈ T ( α ∗ ( A ) ) ⋂ T ( α ∗ ( B ) ) } .

2.

For any two simple schema mappings M A C : A → C and M B D : B → D , the α -intersection of these two mappings is defined by

M A C ⋂ α M B D \= { Φ } : A ⋂ α B → C ⋂ α D , where Φ is a tgd ⋀ { ∀ x ( r ( x ) ⇒ r ( x ) ) ∣ r ∈ A ⋂ α B and α ( r ) ∈ Flux ( α , MakeOperads ( M A C ) ) ⋂ Flux ( α , MakeOperads ( M B D ) ) } .

It is easy to show that for a simple schema A and R-algebra α , with the instance-database A \= α ∗ ( A ) , the schema of the instance-database T A is equal to A ⋂ α A , i. e., T A \= α ∗ ( A ⋂ α A ) .

Moreover, for A \= α ∗ ( A ) and B \= α ∗ ( B ) , T A ⋂ T B \= α ∗ ( A ⋂ α B ) .

Analogously, for the α -intersection of schema mappings, it holds that

Flux ( α , M A C ⋂ α M B D ) \= Flux ( α , MakeOperads ( M A C ) ) ⋂ Flux ( α , MakeOperads ( M B D ) ) .

The schema separation, connection and α -intersection are necessary in order to manage complex database mappings. The category-theoretic data model that we use has come to be known as the sketch data model .

Notice that, different from the work dedicated to categorical semantics of Entity-Relationship internal relational database models where nodes of sketches are single relations, here, at a higher level of abstraction, the nodes are whole databases. Consequently, in such a framework, we do not use commutative database mapping systems, and hence D is an empty set. In fact, in a database mapping system, the (co)cone diagrams above will never be used in practical representations of database mapping systems. Instead of that, they will be alternatively used only for their self-consistent parts, as a first diagram above, or, equivalently, as a single arrow M : A † B → C . However, for the introduced schema composition operator †, the above cone and cocone diagrams have to be presented in C for our sketches.

A.4   Introduction to field theory and symmetries

In the classical Field Theory (FT) framework, the vacuum corresponds to the zero value, and each wave-packet Ψ can be considered a complex field, i. e., a mapping from the Minkowski time-space manifold with coordinates ( t , r → ) \= ( t , x , y , z ) into the field of complex numbers. In theoretical physics, Minkowski space is often contrasted with Euclidean space. While a Euclidean space has only spacelike dimensions q 0 \= t , a Minkowski space also has one timelike dimension. In the pictorial representations, the time axis is represented as vertical and upward-oriented, where the ascending arrow indicates the future. The Euclidean space R 3 with t \= 0 is then considered as horizontal.

All the world lines of light rays emitted from the event O by any (moving or at rest) light emitter are represented in a four-dimensional real vector space M 4 \= R 1 , 3 by the linear generatrices of the cone with ‖ r → ‖ \= q 0 ≡ c t , t > 0 , which is called the “future light cone of O .” The whole set of light world lines passing at O is the set of generatrices of the “light cone C of O ,” with quadratic equation ‖ r 4 ‖ 2 \= r 4 2 ≡ ( c t ) 2 − ‖ r → ‖ 2 \= ( c t ) 2 − ( x 2 + y 2 + z 2 ) \= 0 . All trajectories inside this light cone are with velocities v less then c , so that for them the distance d s 2 \= ( c d τ ) 2 \= ( c d t ) 2 − ( v d t ) 2 \= ( c d t ) 2 − ( d x 2 + d y 2 + d z 2 ) ≥ 0 as required by the positive metrics with d s 2 \= ( c d t ) 2 + ( i d x 2 ) + ( i d y ) 2 + ( i d z ) 2 , where t , x , y , z are any system of inertial coordinates, and hence we will chose the real time dimension and imaginary three Euclidean dimensions as in [ 168 ] (with metric signature (+,−,−,−)).

Consequently, a vector of position in this time-space 4-dimensional system is given by the Minkowski tetrad (4-dimensional vector base) ( e 0 , e 1 , e 2 , e 3 ) and the reals η i j \= e i · e j , where the matrix ( η i j ) of the metric tensor (and its inverse ( η i j ) ) is given by

(A.22) ( η i j ) \= ( η i j ) \= diag ( 1 , − 1 , − 1 , − 1 ) \= 1 0 0 0 0 − 1 0 0 0 0 − 1 0 0 0 0 − 1

so that any point of this time space is given by a position four-dimensional vector (or Minkowski tetrad [ 168 ]), r 4 \= q 0 e 0 + q 1 e 1 + q 2 e 2 + q 3 e 3 \= c t e 0 + x e 1 + y e 2 + z e 3 \= c t e 0 + r → , where t is the time (i. e., c t is the timelike component of r 4 → , where c is the velocity of light in the vacuum) and r → \= x e 1 + y e 2 + z e 3 is an ordinary Euclidean vector with the three spatial coordinates x , y , z . Its infinitesimal amount is defined by d s \= c d t e 0 + d x e 1 + d y e 2 + d z e 3 , where d t , d x , d y and d z are infinitesimal amounts of time-space dimensions. From the fact that the space-dimensions unit vectors are imaginary, the conjugate vector is equal to r 4 ∗ \= c t e 0 − r → .

Then the inner (scalar) product ⟨ r 4 , r 4 ′ ⟩ \= ( r 4 ) T ( η i j ) ( r 4 ′ ) (where ( r 4 ) \= ( c t , x , y , z ) is a tetrad matrix form of the four-dimensional vector r 4 ) is equal to

r 4 · r 4 ′ \= ( q i e i ) · ( q j ′ e j ) \= ∑ i , j q i x j ′ ( e i · e j ) \= ∑ i , j q i q j ′ η i j \= q 0 q 0 ′ − q 1 q 1 ′ − q 2 q 2 ′ − q 3 q 3 ′ ,

written simply r 4 r 4 ′ as well. A particular case of scalar product is the Lorentz or Minkowski norm ‖ r 4 ‖ \= r 4 r 4 , so that the scalar product can be defined in terms of this Lorentz (or Minkowski) norm by r 4 · r 4 ′ \= 1 2 ‖ r 4 + r 4 ′ ‖ 2 − ‖ r 4 ‖ 2 − ‖ r 4 ′ ‖ 2 . The 4-vector r 4 is called:

1.

timelike if ‖ r 4 ‖ 2 > 0 ;

2.

spacelike if ‖ r 4 ‖ 2 < 0 ;

3.

null if ‖ r 4 ‖ 2 \= 0 .

It is causal if it is timelike or null. Minkowski vector space can be regarded as the space of position vectors, relative to an arbitrarily chosen origin O , of the points (events), which constitute Minkowski time space. For any pair of points r 4 and r 4 ′ we define the squared interval Δ ( r 4 , r 4 ) \= ‖ r 4 − r 4 ′ ‖ , so that for the chosen origin O defined by the point r 4 ′ , the light cone of r 4 ′ is defined by the set of all points r 4 such that Δ ( r 4 , r 4 ′ ) \= 0 . Thus, in this 4-dimensional system (Minkowski tetrad) the time is real while the three orthogonal space coordinates are imaginary. This choice is adopted in order to have that the distance, d s 2 \= d s d s \= ( c d t ) 2 − d x 2 − d y 2 − d z 2 , for all local time-space reference systems of observations of quantum events be the positive real value (where space dimensions are limited).

Galileo’s classical principle of inertial relativity asserts that for any material object in any state of motion there exists a system of space and time coordinates, called inertial coordinates , w. r. t. which the object is instantaneously at rest and inertia is homogeneous and isotropic (the latter being necessary for Newton’s laws of motion to hold at least quasi-statically: for the motion of material objects the most important symmetries are the isotropy of inertia, the conservation of momentum, the law of equal action and reaction, and so on). “Isotropic” space means that the inertia of an object does not depend on any absolute reference direction in space: it is sufficient to say the resistance to acceleration of a resting object is the same in all 3-D spatial directions. In fact, Newton’’s “laws of motion” assert the inertia is homogeneous and isotropic w. r. t. inertial coordinate systems.

“Every body continues its state of rest, or of uniform motion in a right line, unless it is compelled to change that state by the forces impressed upon it.”

What is important in the 4-dimensional Minkowski space M 4 , with its points ( t , r → ) ∈ M 4 , that it is absolute and provides rigorous criteria for inertial and accelerated motion. A free particle, which moves by inertia (constant velocity), is a straight world line in Minkowski time space, whereas the timelike world line of an accelerating particle is clearly different—it is curved (i. e., deformed). These criteria show that in time space the absoluteness of inertial (nonresistant) and accelerated (resistant) motion become more understandable. These absolute properties of world line (straightness and deformation) correspond to the absoluteness (frame independence) of inertial and accelerated motion—it is an experimental fact that a particle moving by inertia offers no resistance to its uniform motion, while an accelerating particle resists its acceleration. A body moving by inertia is represented by geodesic world line. Absolute acceleration is a mere manifestation of the deformation of the world line of an accelerating particle and does not imply some absolute space with respect to which the particle accelerates. From these Minkowski results, we are led to the surprising insight about the origin of inertia—the resistance a particle offers to its acceleration is in fact the static resistance in the deformed world line of the accelerating particle. The world line of a single particle in the universe is either geodesic or deformed, which means that the particle is either moving by inertia or accelerating. And this is basis of general relativity when Einstein linked gravitation with the geometry of time space, where the gravity is not a force but a manifestation of the curvature of time space. In general, relativity a particle, whose world line is geodesic, is a free particle, which moves by inertia. Thanks to Einstein, we know that electromagnetism is fundamentally different from gravitation (at least in its original General Relativity (GR)): electromagnetic phenomena are caused by photons (electromagnetic forces), whereas gravitational phenomena are the manifestation of the non-Euclidean geometry of time space (different from the photons, the existence of gravitons is not demonstrated).

The starting point in the field theory is the Lagrangian density L , from which, by using the Euler–Lagrange equation we can obtain the field partial differential equation (by minimizing the action ∫ d 4 q L ). In effect, the principle of least action can be extended to field theory, where rather than the position of a particle, the values of a field are considered. The history between two fixed field configurations, for which the action is an extremum will be the realized history. The theory is deterministic if this history is unique, i. e., if there is only one history that extremizes the action between two fixed configurations. We will show in this monograph that the history of the particle’s new field (wave-packet) Ψ is unique, so that this completion theory of QM is deterministic. Interactions between particles are due to terms in the Lagrangian, which involves the fields of every considered particle.

In classical physics, the primary reason for introducing the concept of the field is to construct laws of nature that are local. In quantum mechanics, the role of the fields are necessary when we consider the fact that the particles can be created and destroyed as well, so that the number of particles continuously change. Such events happen in the interactions of particle–antiparticle pairs, when a particle of mass m 0 is localized within a distance of order ħ λ c \= ħ 2 m 0 , called the Compton wavelength (it is always smaller than the de Broglie wavelength ħ λ \= 2 π ħ p , i. e., the distance at which the wavelike nature of pointlike particles (used in standard quantum theory) becomes apparent).

In what follows, in order to simplify the mathematical formulas, we will introduce the indexed coordinates ( q 0 , q 1 , q 2 , q 3 ) with q 0 \= c t , instead of the standard time-space coordinates ( t , r → ) \= ( t , x , y , z ) , the variables of the velocity components v 1 , v 2 , v 3 and ∂ j instead of ∂ ∂ q j for j \= 0 , 1 , 2 , 3 .

Thus, the Lagrangian density L is a function of independent variables q j and dependent variables v j , Ψ and their derivatives up to a fixed but arbitrary order, ∂ j Ψ . Thus, for any closed finite time-interval [ t 0 , t 1 ] and time-space volume Ω 4 \= [ t 0 , t 1 ] × R 3 , the action of a field theory with Lagrangian density L is defined by

(A.23) S [ Ψ ] \= ∫ t 0 t 1 d t L \= ∫ Ω 4 d 4 q L ( Ψ , ∂ j Ψ , q j , v j ) .

The action S is a functional of the field Ψ and we are looking for a field configuration Ψ that extremizes the action. The field is written as Ψ ′ \= Ψ + δ Ψ where Ψ is the field configuration (i. e., matter density) that extremizes the action and δ Ψ is a variation, which vanishes on the boundary △ Ω 4 . The action becomes

(A.24) S [ Ψ + δ Ψ ] \= ∫ Ω 4 d 4 q L ( Ψ + δ Ψ , ∂ j ( Ψ + δ Ψ ) , q j , v j ) .

So that, by expanding the L to first order in δ Ψ , we obtain

(A.25) L ( Ψ + δ Ψ , ∂ j ( Ψ + δ Ψ ) , q j , v j ) \= L ( Ψ , ∂ j Ψ , q j , v j ) + δ L δ L \= ∂ L ∂ Ψ δ Ψ + ∑ j \= 0 3 ∂ L ∂ ( ∂ j Ψ ) ∂ j ( δ Ψ ) .

From equation ( A.24 ), the action S is expanded to first order in δ Ψ , as follows:

S [ Ψ + δ Ψ ] \= ∫ Ω 4 d 4 q L ( Ψ , ∂ j Ψ , q j , v j ) + ∫ Ω 4 d 4 q [ ∂ L ∂ Ψ δ Ψ + ∑ j \= 0 3 ∂ L ∂ ( ∂ j Ψ ) δ ( ∂ j Ψ ) ] \= S [ Ψ ] + ∫ Ω 4 d 4 q [ ∂ L ∂ Ψ δ Ψ + ∑ j \= 0 3 ∂ L ∂ ( ∂ j Ψ ) ∂ j ( δ Ψ ) ] ,

where the second term is equal to δ S , so

δ S \= ∫ Ω 4 d 4 q [ ∂ L ∂ Ψ δ Ψ + ∑ j \= 0 3 ∂ L ∂ ( ∂ j Ψ ) ∂ j ( δ Ψ ) ] \= ∫ Ω 4 d 4 q [ ∂ L ∂ Ψ − ∑ j \= 3 ∂ j ∂ L ∂ ( ∂ j Ψ ) ] + δ Ψ [ ∂ L ∂ ( d 0 Ψ ) + ∑ j \= 0 3 ∂ L ∂ ( ∂ j Ψ ) ] | △ Ω 4 \= ∫ Ω 4 d 4 q [ ∂ L ∂ Ψ − ∑ j \= 0 3 ∂ j ∂ L ∂ ( ∂ j Ψ ) ] δ Ψ .

Thus, from the variation principle we have that δ S \= 0 and since the variation δ Ψ is arbitrary, the term in the parentheses of the integral above must vanish, i. e., we obtain the following Euler–Lagrange equation for the field Ψ:

(A.26) ∂ L ∂ Ψ \= ∑ j \= 0 3 ∂ j ( ∂ L ∂ ( ∂ j Ψ ) ) .

Symmetries play a fundamental role in physics because they are related to conservation laws. This is stated in Noether’s theorem, which says that invariance of the action under a symmetry transformation implies the existence of a conserved quantity. For instance, the conservation of the momentum vector p → is associated with translation invariance of the Lagrangian, i. e., the Poincare transformation r → → r → + r 0 → , where r 0 → is a constant vector; while the conservation of energy comes from the invariance under time translations t → t + t 0 . Assume the Lagrangian density L be invariant under a transformation of the matter field Ψ, so that for an infinitesimal transformation Ψ ′ \= Ψ + δ Ψ , we obtain by considering the Euler–Lagrange equation that holds the following:

(A.27) δ L \= ∂ L ∂ Ψ ( δ Ψ ) + ∑ j \= 0 3 ∂ L ∂ ( ∂ j Ψ ) ∂ j ( δ Ψ ) \= ∑ j \= 0 3 ∂ j ( ∂ L ∂ ( ∂ j Ψ ) δ Ψ ) \= 0 .

If the Lagrangian is invariant under infinitesimal transformations, then the equation of motion is invariant as well (the converse is not necessarily true). Suppose now that δ Ψ be the infinitesimal field variation of a continuous symmetry. We know that δ S \= 0 and let δ Ψ be a linear in the infinitesimal transformation parameters α ; then by δ α L we denote the corresponding change of the Lagrangian. In order that the field equations be invariant, it is sufficient that the Lagrangian changes by a total divergence , i. e.,

(A.28) δ α L \= ∑ j \= 0 3 ∂ j K j ( Ψ , α )

for some set of functions K j ( Ψ , α ) , j \= 0 , 1 , 2 , 3 , where Ψ generically denotes the fields on which Lagrangian depends. This follows from the fact that δ S \= ∫ Ω 4 δ L \= ∫ Ω 4 ∇ · K → \= ∮ S 4 d S n → K → \= 0 , i. e., vanishes on the boundary surface S 4 of the 4-dimensional time-space region Ω 4 . However, the equation of motions describe the dynamics inside the integration domain, and the boundary conditions are separately imposed as independent conditions on the possible solutions (e. g., when in classical field theory we want to find the physical path between two fixed points by this variational principle, we fix the boundary conditions for these two endpoints and the computation of the extremum of the action is given by integration of the Lagrangian between these two endpoints). Based on this observation, under arbitrary infinitesimal variations δ Ψ , the Lagrangian must change into the field variations δ Ψ multiplied by their corresponding field equations E ( Ψ ) , and a total derivative term of a function N ( Ψ , δ Ψ ) associated with the boundary contribution and linearly depending on δ Ψ , so that

(A.29) δ L \= δ Ψ E ( Ψ ) + ∑ j \= 0 3 ∂ j N j ( Ψ , δ Ψ ) .

Combining the equations ( A.28 ) and ( A.29 ), where we chose δ Ψ \= δ α Ψ , we conclude that the divergence of K j ( Ψ , α ) − N j ( Ψ , δ α Ψ ) must be proportional to the field equation E ( Ψ ) . Thus, by Noether’s theorem, for any continuous symmetry, there exists the Noether current J j \= N j ( Ψ , δ α Ψ ) − K j ( Ψ , α ) which, according to the above arguments satisfies ∑ j \= 0 3 ∂ J j \= 0 . Thus, by taking the boundary component N j ( Ψ , δ α Ψ ) \= ∂ L ∂ ( ∂ j Ψ ) δ Ψ from the last expression in the equation ( A.27 ), we obtain in the general case when we have n ≥ 1 Lagrangian independent variables Ψ i , 1 ≤ i ≤ n ,

(A.30) J j ( Ψ , α ) \= ∑ i \= 1 n ∂ L ∂ ( ∂ j Ψ i ) δ Ψ i ( α ) − K j ( α ) ,

and hence by elimination of the parameters in α \= { α i } from this equation, for the particular definitions of δ Ψ i ( α ) , we obtain a number of currents J i j by requiring that δ L \= 0 .

Finally, we obtain the continuity equation (a locally conserved current law)

(A.31) ∂ ∂ t J 0 + ∑ i \= 1 3 ∂ ∂ q i J i \= ∂ ∂ t J 0 + ∇ · J → \= 0

where J → \= J 1 e 1 + J 2 e 2 + J 3 e 3 is the Noether’s current. Integrating equation ( A.31 ) over all space R 3 , we obtain

(A.32) 0 \= ∫ R 3 ( ∂ ∂ t J 0 + ∇ · J → ) d V \= d d t ∫ R 3 J 0 d V + ∫ R 3 ∇ · J → d V \= d d t ∫ R 3 J 0 d V

because the second term can be converted into a surface integral (by Gauss’ theorem) that vanishes in a sphere with enough big radius, from the fact that Ψ has a finite volume which is contained in such a big sphere.

Notice that in the field theory, the time-space quantity J 0 is called Noether’s charge density, so that the Noether’s charge (a globally conserved constant of motion) Q is defined by the integral over space of this charge density. That is, Q \= ∫ R 3 J 0 d V so that from the equation ( A.32 ) above, we have

(A.33) d Q d t \= 0 .

Analogously to the point mechanics, we have that the invariances of the Lagrangian density correspond to conservation laws. The general equation ( A.30 ) for the Noether’s current components is not easy to use for the computation of them. Thus, we can use the following method based on the one-parameter family ( α ) of transformations for which the Lagrangian L remains invariant Ψ ( t , r → ) ↦ Ψ ˜ ( t , r → , α ) , where α is the continuous parameter, such that Ψ ˜ ( t , r → , 0 ) \= Ψ ( t , r → ) (i. e., for α \= 0 we obtain the identity transformation; such transformations are typical for the Lie groups of transformations). The transformations may be nonlinear in the generalized coordinates. Suppose that the Lagrangian L is invariant under replacement Ψ → Ψ ˜ (i. e., invariant under this family ( α ) of one-parameter transformations). Then we must have

0 \= d d α | α \= 0 L ( Ψ ˜ , ∂ j Ψ ˜ , q j , v j ) \= ( ∂ L ∂ Ψ ∂ Ψ ˜ ∂ α + ∑ j \= 0 3 ∂ L ∂ ( ∂ j Ψ ) ∂ j Ψ ˜ ∂ α ) α \= 0 \= ( ∑ j \= 0 3 ∂ j ∂ L ∂ ( ∂ j Ψ ) ∂ Ψ ˜ ∂ α + ∂ L ∂ ( ∂ j Ψ ) ∂ j ∂ Ψ ˜ ∂ α ) α \= 0 \= ∑ j \= 0 3 ∂ j ( ∂ L ∂ ( ∂ j Ψ ) ∂ Ψ ˜ ∂ α ) α \= 0 .

This result can be obtained by substituting δ Ψ δ α with ∂ Ψ ˜ ∂ α | 0 and K → \= 0 in equation ( A.30 ). We can write this as ∑ j \= 0 3 ∂ j J j \= 0 , where

(A.34) J j \= ∂ L ∂ ( ∂ j Ψ ) ∂ Ψ ˜ ∂ α | α \= 0 , for j \= 0 , 1 , 2 , 3 .

A.4.1   Vector fields on curved differentiable manifolds

It is necessary to consider the velocity vector field W of the particle’s matter/energy density Φ m ( t , r → ) , where ( t , r → ) ∈ M 4 is the Minkowski coordinate representation of a given point p \= r 4 of the curved 4-dimensional time-space manifold M generated by particle’s energy-density Φ m (in what follows, for simplicity we will use p instead of r 4 ), so that the vector velocity in this point p ∈ M is given by W p ≡ W ( p ) . This more general (than Minkowski’s) framework for vector fields will be introduced, based mainly on the books on differentiable manifolds [ 169 ], [ 170 ], [ 171 ].

Let us denote by C k ( M ) the subset of functions f : M → R , which are k -differentiable, for k ≫ 1 (here we consider smooth case when k \= ∞ ). The important subset in C k ( M ) are the four coordinate functions or, simply coordinates , q i : M → R , 0 ≤ i ≤ 3 . Roughly speaking, a n -dimensional manifold M is a set of points that can be labeled by coordinates, ϕ : M → R n , and here we will consider the smooth curved 4-dimensional time-space manifolds. For a given (local) chart (also called a local coordinate system on M ), ( U , ϕ ) , where U ⊂ M with one-to-one invertible (continuous in both directions) map ϕ : U → R 4 to some open subset of the Euclidean 4-D space R 4 (with its inverse ϕ − 1 ), for any point p ∈ U , q i ( p ) is the value of its i -th coordinate, such that ϕ ( p ) \= ( q 0 ( p ) , … , q 3 ( p ) ) , where q 0 ( p ) is the time coordinate, while other three are the space coordinates of this point p of the curved 4-dimensional manifold M (curved time space in GR). The fact that ϕ is one-to-one mapping ensures that two different points of U differ, at least, in the value of one of the coordinates.

Analogously, for any other (local) coordinate system of chart ( U ′ , ϕ ′ ) , different from this ( U , ϕ ) chart coordinate system, we will denote by q j ′ ∈ C k ( M ) this new coordinate system. These two charts are C k -compatible if U ⋂ U ′ \= ∅ (the empty set), or if the homeomorphisms 4 (also known as a change or transformation of coordinates or transition maps ) ϕ ∘ ϕ ′ − 1 : ϕ ′ ( U ⋂ U ′ ) → ϕ ( U ⋂ U ′ ) and ϕ ′ ∘ ϕ − 1 : ϕ ( U ⋂ U ′ ) → ϕ ′ ( U ⋂ U ′ ) , whose domains are open in R 4 , are differentiable of class C k . That is, for all points p ∈ U ⋂ U ′ , q 0 ( p ) , … , q 3 ( p ) be differentiable functions of class C k (have all k -th continuous partial derivatives) of q 0 ′ ( p ) , … , q 3 ′ ( p ) , and conversely.

Differentiable manifold

We assume that this property is satisfied and that the coordinate changes (the two homomorphisms above) are also diffeomorphisms, 5 for any two charts (thus for any atlas) of the continuous differentiable and smooth curved time-space manifold M used in general relativity. This manifold inherits many of the local properties of Euclidean 4-D space: it is locally path connected, locally compact and locally metrizable. In other words, this differentiable (or, smooth) manifold M is a topological manifold with a globally defined differentiable (or smooth) structure. Each point p of differentiable manifold M has a tangent space, which is a flat Minkowski (pseudo-Euclidean) time-space R 1 , 3 consisting of the tangent vectors of the curves through the point. We recall that a Riemannian manifold is an analytic manifold in which each tangent space is equipped with an inner (or scalar) product of tangent vectors, in a manner which varies smoothly from point to point. This allows one to define various notions such as length, angles, areas (or volumes), curvature, gradients of functions and divergence of vector fields. Any smooth manifold admits a Riemannian metric, and hence also the pseudo-Riemannian 4-D differentiable smooth manifold M used in the general relativity theory. In fact, in this pseudo-Riemannian manifold M , the covariant derivative is often used for the Levi–Civita connection given by Christoffel symbols Γ i k j .

Any differentiable curve lying in the subset U of the manifold M can be given by a mapping γ : I → U ⊂ M , (we denote by I ⊂ R the open subset of R ), so that for each s ∈ R , we obtain some point p \= γ ( s ) ∈ M .

The tangent vector to γ at the point p \= γ ( s 0 ) , denoted by the mapping γ s 0 ′ : C k ( M ) → R , is defined for any function f : M → R by

(A.35) γ s 0 ′ ( f ) ≜ d d s ( f ∘ γ ) | s 0 \= lim s → s 0 f ( γ ( s ) ) − f ( γ ( s 0 ) ) s − s 0

where f ∘ γ denotes the composition of these two mappings. Thus, this vector is tangent vector on the curve γ at point p \= γ ( s 0 ) , and is obtained as a derivation of function f along this curve γ . The 4-dimensional tangent space to the manifold M at point p , denoted by T p M , is the set of all vectors tangent to M at p . For a chart ( U , ϕ ) on M , with coordinates (functions) q i : M → R and point p ∈ U , the natural (or canonical ) vector basis of this local coordinate system at point p is defined by vectors ( ∂ ∂ q i ) p ∈ T p M for 0 ≤ i ≤ 3 , so that for each mapping f ∈ C k ( M ) such that, for the function f ∘ ϕ − 1 : R 4 → R , ∂ ∂ q i ( f ∘ ϕ − 1 ) , is the partial derivative w. r. t. the i -th argument of this function,

(A.36) ( ∂ ∂ q i ) p [ f ] ≜ ∂ ∂ q i ( f ∘ ϕ − 1 ) | ϕ ( p ) \= lim s → 0 f ( ϕ − 1 ( q 0 ( p ) , … , q i ( p ) + s , … , q 3 ( p ) ) ) − f ( ϕ − 1 ( q 0 ( p ) , … , q i ( p ) , … , q 3 ( p ) ) ) s

and for s sufficiently small, so that all the points belong to U , we obtain that for f \= q j , ( ∂ ∂ q i ) p ( q j ) \= ∂ q j ∂ q i | p \= δ i j , and hence we obtained the natural vector basis

(A.37) e i ≜ ( ∂ ∂ q i ) p , i \= 0 , 1 , 2 , 3

of a locally flat Minkowski time-space corresponding to T p M in a small region around the point p . Hence, this natural vector basis defines the components g i j ≡ e i · e j \= ( ∂ ∂ q i ) p · ( ∂ ∂ q j ) p of the metrics (tensor field identified as the gravitational potential) at a point p :

(A.38) g j k \= g 00 g 01 g 02 g 03 g 10 g 11 g 12 g 13 g 20 g 21 g 22 g 23 g 30 g 31 g 32 g 33 .

The connection coefficients Γ i k j , also known as Christoffel symbols of the second kind , are introduced by

(A.39) ∂ ∂ q k e i ≜ ∑ j Γ i k j e j

for the vector basis e i , where Γ i k j \= Γ k i j in nontorsion case that is only considered here. The Christoffel symbols in terms of the metric can be obtained by introduction of Christoffel symbols of the first kind ,

Γ l i k \= Γ l k i ≡ ∑ m g l m Γ i k m , from ∂ ∂ q k g i l \= ∂ ∂ q k ( e i · e l ) \= e i ∂ ∂ q k e l + e l ∂ ∂ q k e i \= from (A.39) \= ∑ j ( g i j Γ l k j + g l j Γ i k j ) \= Γ i l k + Γ l i k ,

and hence,

Γ l i k \= 1 2 ( ∂ ∂ q k g l i + ∂ ∂ q i g l k − ∂ ∂ q l g i k ) , that is , ∑ l g j l Γ l i k \= ∑ l g j l ( ∑ m g l m Γ i k m ) \= ∑ m ( ∑ l g j l g l m ) Γ i k m \= ∑ m δ j m Γ i k m \= Γ i k j ,

i. e.,

(A.40) Γ i k j \= 1 2 ∑ l g j l ( ∂ ∂ q k g l i + ∂ ∂ q i g l k − ∂ ∂ q l g i k )

and, consequently, Γ i k j \= Γ k i j , and

(A.41) ∑ j Γ j k j \= ∑ j Γ k j j \= 1 2 ∑ i , j g i j ∂ ∂ q k g i j .

Based on them are introduced the Riemann curvature tensor R i n k j (it has 20 degrees of freedom), in the nontorsion case, by

(A.42) R i n k j ≜ ∂ ∂ q n Γ i k j − ∂ ∂ q k Γ in j + ∑ m ( Γ m n j Γ i k m − Γ m k j Γ in m ) .

The reduction from the curvilinear Riemann space of GR into a locally flat Minkowski space is given by the condition R i n k j \= 0 . By tensor contraction, we define the tensors

(A.43) R i k ≜ ∑ j R i j k j ,

and hence the well-known Ricci scalar

(A.44) R ≜ ∑ i k g i k R i k .

The covariant derivatives of metric tensors are an example of the conservation of the time-space metric invariance. For the flat Minkowski time space with the metric tensor ( η i j ) given by equation ( A.22 ), the flat metric property is invariant at each time point, i. e., ∂ ∂ q k η i j \= 0 for all components of this tensor. But in curved time space, we have that generally this invariance is not preserved by ordinary derivatives, i. e., from ( A.39 ), ∂ ∂ q k g i j \= ∂ ∂ q k ( e i e j ) \= e i ∂ ∂ q k e j + e j ∂ ∂ q k e i \= e i ∑ n Γ j k n e n + e j ∑ n Γ i k n e n \= ∑ n Γ j k n ( e i e n ) + ∑ n Γ i k n ( e n e j ) \= ∑ n Γ j k n g in + ∑ n Γ i k n g n j ≠ 0 . But we can see that this invariance is preserved by the covariant derivatives D k of curved time-space metrics, i. e., D k g i j \= 0 , so that the curved time-space metric is invariant under covariant derivations.

Thus, any tangent 4-vector v p : C k ( M ) → R on the manifold at point p , i. e., v p ∈ T p M (for simplicity, for the vectors e j in a vector basis we will avoid to use the “arrow” subscript → ), can be expressed as a linear composition of these base vectors by

(A.45) v p \= ∑ i \= 0 3 v p ( q i ) ( ∂ ∂ q i ) p .

In effect, we have that for each coordinate q j ∈ C k ( M ) , is satisfied

v p ( q j ) \= ∑ i \= 0 3 v p ( q i ) ( ∂ ∂ q i ) p ( q j ) \= ∑ i \= 0 3 v p ( q i ) δ i j .

Thus, the tangent vector to curve γ at the point p \= γ ( s 0 ) can be expressed as a linear combination of the basic vectors as γ s 0 ′ \= ∑ i \= 0 3 γ s 0 ′ ( q i ) ( ∂ ∂ q i ) γ ( s 0 ) \= ∑ i \= 0 3 d ( q i ∘ γ ) d s | s 0 ( ∂ ∂ q i ) γ ( s 0 ) .

A geodesic in M is a curve γ : I → M whose acceleration γ ¨ is everywhere orthogonal to M . Thus, a geodesic is a curve in M , which always goes “straight ahead” in the surface. Its acceleration serves only to keep it in the surface and it has no component of acceleration tangent to the surface, so that it has a constant speed γ ˙ ( s ) \= d γ d s (in this case of geodesic, the parameter s represents the time).

A vector field W on U ⊆ M is a function W : U → T M that to each point p of U assigns a tangent vector W p ≡ W ( p ) ∈ T p M . For a given chart ( U , ϕ ) , we have four differentiable vector fields ( ∂ ∂ q i ) on U defined by ( ∂ ∂ q i ) ( p ) ≡ ( ∂ ∂ q i ) p .

Since the tangent vectors ( ∂ ∂ q i ) p form a vector basis on T p M , any vector field W evaluated at point p ∈ U must be linear combination of the tangent vectors ( ∂ ∂ q i ) p with real coefficients W i ( p ) ∈ R , so that W ( p ) \= ∑ i W i ( p ) ( ∂ ∂ q i ) p \= ∑ i W i ( p ) ( ∂ ∂ q i ) ( p ) \= ∑ i [ W i ( ∂ ∂ q i ) ] ( p ) , with functions W i : U → R such that for each p ∈ U , W i ( p ) ≡ W p ( q i ) , so that this vector field W is locally given by

(A.46) W \= ∑ i \= 0 3 W i ( ∂ ∂ q i ) ,

and hence the vector field W is differentiable iff the functions W i are. Let ( q 0 , … , q 3 ) and ( q 0 ′ , … , q 3 ′ ) be two coordinate systems in U and U ′ , respectively. In tensor formalism, W is a contravariant vector.

From ( A.46 ), any vector field in the 4-dimensional manifold M can be given in terms of any set of 4-vector fields such that at each point p ∈ M of their common domain forms a basis { ( ∂ ∂ q i ) p ∣ 0 ≤ i ≤ 3 } for the tangent space T p M at this point p . The use of this kind of set of vector fields, not necessarily associated with coordinate systems, may be convenient when there is some additional structure on the manifold (e. g., a connection, a metric tensor g j k , or a Lie group structure like Poincare transformations).

A.4.2   Transformation of coordinates

Suppose that we have two sets of curvilinear coordinates ( q 0 , … , q 3 ) and ( q 0 ′ , … , q 3 ′ ) then a general 4×4 transformation (i. e., a nonlinear map) q i ↦ q i ′ is defined by the set of transformation equations

(A.47) q i ′ \= q i ′ ( q 0 , … , q 3 ) , i \= 0 , 1 , 2 , 3

which defines the Jacobian matrix J ′ ≡ ( ∂ q i ′ ∂ q j ) , with an example given by ( A.50 ), so that the transformation of vector basis is given by [ e j ] \= J ′ T [ e j ′ ] , where [ e j ′ ] and [ e j ] are the columns of the basis vectors for these two coordinate systems.

Now, if the Jacobian determinant of this coordinate transformation is different from zero

(A.48) J ′ \= | ∂ q i ′ ∂ q j | ≠ 0

then the transformation ( A.47 ) is reversible and the inverse coordinate transformation

(A.49) q j \= q j ( q 0 ′ , … , q 3 ′ ) , i \= 0 , 1 , 2 , 3

exists as well with the Jacobian determinant of this inverse coordinate transformation J \= | ∂ q i ∂ q j ′ | ≠ 0 . Finding the inverse transformation is the problem of matrix inverse. For example, in the Minkowski time space, we can transform the Cartesian coordinates ( q 0 ′ , … , q 3 ′ ) \= ( c t , x , y , z ) into spherical coordinates ( q 0 , … , q 3 ) \= ( c t , r , θ , φ ) , with coordinate transformations, q 0 ′ \= q 0 , q 1 ′ \= r cos θ cos φ \= q 1 cos q 2 cos q 3 , q 2 ′ \= r sin θ cos φ \= q 1 sin q 2 cos q 3 , and q 3 ′ \= r sin φ \= q 1 sin q 3 , with the Jacobian matrix given by

(A.50) J ′ ≡ ( ∂ q i ′ ∂ q j ) \= 1 0 0 0 0 cos q 2 cos q 3 − q 1 sin q 2 cos q 3 q 1 sin q 2 sin q 3 0 sin q 2 cos q 3 q 1 cos q 2 cos q 3 − q 1 sin q 2 sin q 3 0 sin q 3 0 q 1 cos q 3

and the corresponding Jacobian determinant J ′ \= | J ′ | \= | ∂ q i ′ ∂ q j | \= ( q 1 ) 2 cos q 3 . An inverse coordinate transform is given by q 0 \= q 0 ′ , q 1 \= ( q 1 ′ ) 2 + ( q 2 ′ ) 2 + ( q 3 ′ ) 2 , q 2 \= arctan ( q 2 ′ q 1 ′ ) , and q 3 \= arctan ( q 3 ′ ( q 1 ′ ) 2 + ( q 2 ′ ) 2 ) , with J \= | ∂ q i ∂ q j ′ | \= 1 ( q 1 ) 2 cos q 3 .

The covariant metric tensor, for coordinate transformation ( A.47 ), transforms as

(A.51) g j k \= e j · e k \= ( ∑ l e l ′ ∂ q l ′ ∂ q j ) ( ∑ m e m ′ ∂ q m ′ ∂ q k ) \= ∑ l , m \= 0 3 ∂ q l ′ ∂ q j ∂ q m ′ ∂ q k g l m ′ ,

and hence g j k is the element of the matrix obtained by multiplication of the j -th row of the transposed Jacobian matrix J ′ T \= ( ∂ q i ′ ∂ q j ) T and k -th column of the matrix product g j k ′ · ( ∂ q i ′ ∂ q j ) \= g j k ′ · J ′ , i. e., g j k \= J ′ T · ( g j k ′ · J ′ ) , and hence taking determinant of both sides of this matrix equation gives g \= J ′ 2 g ′ (where g \= det ( g j k ) < 0 ), or

(A.52) − g \= J ′ − g ′

where J ′ \= | ∂ q j ′ ∂ q k | is the Jacobian determinant of the Jacobian matrix J ′ of the transformation. The infinitesimal 4-volume d Ω ≡ d 4 q transforms as

(A.53) d Ω \= | ∂ q j ∂ q k ′ | d Ω ′ \= 1 J ′ d Ω ′ .

Consequently, the combination − g d Ω transforms

(A.54) − g d Ω \= J ′ − g ′ 1 J ′ d Ω ′ \= − g ′ d Ω ′

and is thus generally invariant under coordinate transformations, and hence the covariant infinitesimal time-space volume, used in (covariant) tensor equations, is of the form − g d Ω ≡ d 4 q − g .

Furthermore, from the fact that Tr ( M − 1 ∂ M ∂ q k ) \= ∂ ∂ q k ln ( det M ) (holds for matrices n × n of arbitrary size; in our case of 4×4 matrices), we have for M \= g j k ,

1 2 ∂ ∂ q k ln ( det ( g j k ) ) \= 1 2 ∂ ∂ q k ln ( − g ) \= ∂ ∂ q k ln ( − g ) \= 1 − g ∂ ∂ q k − g \= 1 2 Tr ( g j k − 1 ∂ ∂ q k g j k ) \= 1 2 ∑ j ( ∑ i g j i ∂ g i j ∂ q k ) \= 1 2 ∑ j , i g j i ∂ g i j ∂ q k ,

and hence from ( A.41 ), and the fact that metric tensor g j k is symmetric, and hence also its inverse tensor is symmetric, we obtain

(A.55) ∑ j Γ j k j \= 1 2 ∑ i , j g i j ∂ g i j ∂ q k \= 1 − g ∂ ∂ q k − g , and δ − g \= − g 2 ∑ i , j g i j δ g i j .