*2.1. Definition of Category*

A category is a mathematical system composed of entities called objects and arrows (or morphisms) satisfying the following four conditions.

**Condition 1.** *For any arrow f , there exist an object called* dom(*f*) *and another object called* cod(*f*)*, which are called the domain of f and the codomain of f , respectively.*

When dom(*f*) = *X* and cod(*f*) = *Y*, we denote it as

> *f* : *X* −→ *Y*

or

$$\mathbf{x} \stackrel{f}{\longrightarrow} \mathbf{y}.$$

Arrows are also denoted in any direction, not only from left to right, as above.

**Condition 2.** *For any pair of morphism f* , *g satisfying* dom(*g*) = cod(*f*)

$$Z \xleftarrow{\mathcal{S}} \underline{\mathbf{v}} \xleftarrow{f} \underline{\mathbf{x}},$$

*there exist an arrow g* ◦ *f*

> *Z g*◦ *f* ←−−− *X*

*called the composition of f* , *g.*

> For the composition of arrows, we assume the following conditions:

**Condition 3** (associative law)**.** *For any triple f* , *g*, *h of arrows satisfying* dom(*h*) = cod(*g*) *and* dom(*g*) = cod(*f*)*,*

$$(h \circ \mathfrak{g}) \circ f = h \circ (\mathfrak{g} \circ f)$$

*holds.*

**Condition 4** (identity law)**.** *For any object X, there exists an arrow called identity arrow* 1*X* : *X* −→ *X. For any arrow f* : *X* −→ *Y*

$$f \circ 1\_X = f = 1\_Y \circ f$$

*holds.*

By the correspondence from objects to their identity arrows, objects can be considered as special kinds of arrows by identifying each object *X* with its identity arrow 1*X*. In sum, the definition of a category is as follows.

**Definition 1** (category)**.** *A category is a system composed of two kinds of entities called objects and arrows, equipped with domain/codomain, composition, and identity, satisfying the associative law and the identity law.*

In a category, we can define the "essential sameness" between objects via the notion of invertible arrows (isomorphism).

**Definition 2** (invertible arrow (isomorphism))**.** *Let* C *be a category. An arrow f* : *X* −→ *Y in* C *is said to be invertible in* C *if there exists some arrow g* : *Y* −→ *X such that*

$$
\emptyset \circ f = 1\_{X \prime} \, f \circ \emptyset = 1\_Y \,.
$$

*An invertible arrow in* C *is also called an isomorphism in* C*.*

There are many categories whose collection of arrows is too large to be a set. In the present paper, we focus on small categories:

**Definition 3** (small category)**.** *A category C is called small if the collection of arrows is a set.*

Let us see the examples of small categories which are used in the present paper.

**Definition 4** (preorder)**.** *A pair* (*<sup>P</sup>*,) *of a set P and a relation on P satisfying p p for any p* ∈ *P and*

$$p \leadsto q \text{ and } q \leadsto r \text{implies } p \leadsto r$$

*for any p*, *q*,*<sup>r</sup>* ∈ *P is called a preordered set. The relation on P is called a preorder on P. The preordered set* (*<sup>P</sup>*,) *can be viewed as a category whose objects are elements of P when we define the relation p q between p*, *q as the unique arrow from p to q. Conversely, we can define a preordered set as a small category such that for any pair of objects p*, *q, there exists at most one arrow from p to q.*

Note that the notion of preorder is a generalization of a partial order and an equivalence relation. As a special extreme case of the concept of preordered sets, we have the following.

**Definition 5** (indiscrete category and discrete category)**.** *An indiscrete category is a small category such that for any pair of objects C*, *C, there exists exactly one morphism from C to C. A discrete category is a small category such that all arrows are identity arrows.*

Note that an indiscrete category corresponds to a complete graph and that any set can be considered as a discrete category.

Additionally, the notion of group, which is essential in the study of symmetry, can also be defined as a small category as follows.

**Definition 6** (monoid and group)**.** *A small category with only one object is called a monoid. A monoid is called a group if all arrows are invertible.*

To see the equivalence between the definition of the group as a category, define the arrows as the elements and the unique identity arrow (which can be identified with the unique object) as the identity element.

By definition, the concept of monoid is a generalization of that of a group, allowing for the existence of non-invertible arrows. the concept of groupoid is another generalization of that of a group:

### **Definition 7** (groupoid)**.** *A small category is said to be a groupoid if all arrows are invertible.*

As for the importance of groupoids in physics, see [14] and references therein, for example. From the mathematical point of view, the present paper is based on an extension of the previous work [14] on groupoid algebras over C into category algebras of an arbitrary (small) category over a (in general, noncommutative) rig *R*, i.e., "ring without negatives" (algebraic system with addition and multiplication), which will be introduced in the next section. Even in the case of *R* = C, this extension physically means allowing for irreversible processes considering a category can be seen as a generalized groupoid allowing for invertible arrows in general. The involution structure of the category algebra is provided by the partial involution structure of the category, as we will see in the next section (†-category introduced later can be seen as a generalization of groupoid).

A functor is defined as a structure-preserving correspondence between two categories, as follows.

**Definition 8** (functor (covariant functor))**.** *Let* C *and* C *be categories. A correspondence F from* C *to* C*, which maps objects and arrows in* C *to objects and arrows in* C*, is said to be a covariant functor or simply a functor from* C *to* C *if it satisfies the following conditions:*


**Definition 9** (contravariant functor)**.** *Let* C *and* C *be categories. A correspondence F from* C *to* C*, which maps objects and arrows in* C *to objects and arrows in* C *is said to be a contravariant functor from* C *to* C *if it satisfies the following conditions:*


**Definition 10** (composition of functors)**.** *Let F be a functor from* C *to* C *and G be a functor from* C *to* C*. The composition functor G* ◦ *F is a functor from* C *to* C*, defined as* (*G* ◦ *<sup>F</sup>*)(*c*) = *<sup>G</sup>*(*F*(*c*)) *for any arrow c in* C*.*

**Definition 11** (identity functor)**.** *Let* C *be a category. A functor from* C *to* C*, which maps any arrow to itself, is called the identity functor.*

We can consider categories consisting of (certain kind of) categories as objects and (certain kind of) functors as arrows.

The concept of involution on the category is important throughout the present paper.

**Definition 12** (involution on category)**.** *Let* C *be a category. A covariant/contravariant endofunctor* (·)† *from* C *to* C *is said to be a covariant/contravariant involution on C when* (·)† ◦ (·)† *is equal to the identity functor on* C*. A category with contravariant involution, which is the identity on objects, is called a* †*-category.*

We conclude this subsection by defining the concept of natural transformation and the related concepts. The concept of natural transformation can be seen as a generalization of the various concepts of transformations in mathematics and other sciences, including physics.

**Definition 13** (natural transformation)**.** *Let* C, D *be categories and F*, *G be functors from a category* C *to a category* D*. A correspondence t is said to be a natural transformation from F to G if it satisfies the following conditions:*

	- *For any f* : *X* −→ *Y in* C*,*

*2.*

$$t\_Y \circ F(f) = G(f) \circ t\_X.$$

*The arrow tX is called the X component of t.*

**Definition 14** (functor category)**.** *Let* C *and* C *be categories. The functor category* C<sup>C</sup> *is a category consisting of functors from* C *to* C *as objects and natural transformations as arrows (domain, codomain, composition, and identity are defined in a natural way).*

**Definition 15** (natural equivalence)**.** *An isomorphism in a functor category, i.e., an invertible natural transformation, is said to be a natural equivalence.*

**Notation 1.** *In the rest of the present paper, categories are always supposed to be small. The set of all arrows in a category* C *is also denoted as* C*.* |C| *denotes the set of all objects, which are identified with corresponding identity arrows in* C*.*
