Category Algebras and States on Categories

The purpose of this paper is to build a new bridge between category theory and a generalized probability theory known as noncommutative probability or quantum probability, which was originated as a mathematical framework for quantum theory, in terms of states as linear functionals defined on category algebras. We clarify that category algebras can be considered as generalized matrix algebras and that states on categories as linear functionals defined on category algebras turn out to be generalized of probability measures on sets as discrete categories. Moreover, by establishing a generalization of famous GNS (Gelfand-Naimark-Segal) construction, we obtain representations of category algebras of $^{\dagger}$-categories on certain generalized Hilbert spaces which we call semi-Hilbert modules over rigs.


Introduction
In the present paper we study category algebras and states defined on arbitrary small categories to build a new bridge between category theory (see [EM45,Ma98,Aw10,Lei14] and references therein, for example) and noncommutative probability or quantum probability (see [Ac00,HO07,BGV12] and references therein, for example), a generalized probability theory which was originated as a mathematical framework for quantum theory.
A category algebra is, in short, a convolution algebra of functions on a category. For example, on certain categories called finely finite category [Lei12], which is a categorical generalization of locally finite poset, the convolution operation can be defined on the set of arbitrary functions and it becomes a unital algebra called incidence algebra. Many authors have studied the notions of Möbius inversion, which has been one of fundamental part of combinatorics since the pioneering work by Rota [R64] on posets, in the context of incidence algebras on categories ([CF69, Ler75, CLL80, H80, LM10, Lei12], for example).
There is another approach to obtain the notion of category algebra. As is well known, a group algebra is defined as a convolution algebra consisting of finite linear combinations of elements. By generalization with replacing "elements" by "arrows", one can obtain another notion of category algebra (see [H80], for example), which also includes monoid algebra (in particular polynomial algebras) and groupoid algebras as examples. Note that for a category with infinite number of objects, the algebra is not unital.
The category algebras we focus on in the present paper are unital algebras defined on arbitrary small categories, which are slightly generalized versions of algebras studied under the name of the ring of an additive category [Mi72]. These category algebras include the ones studied in [H80] as subalgebras in general, and they coincide for categories with finite number of objects. Moreover, one of the algebras we study, called "backward finite category algebra", coincides with incidence algebras for combinatorically important cases originally studied in [R64].
The purpose of this paper is to provide a new framework for the interplay between regions of mathematical sciences such as algebra, probability and physics, in terms of states as linear functional defined on category algebras. As is well known, quantum theory can be considered as a noncommutative generalization of probability theory. At the beginning of quantum theory, matrix algebras played a crucial role (see [B49] for example). In the present paper we clarify that category algebras can be considered as generalized matrix algebras and that the notions of states on categories as linear functionals defined on category algebras turns out to be a conceptual generalization of probability measures on sets as discrete categories (For the case of states on groupoid algebras over the complex field C it is already studied [CIM19]).
Moreover, by establishing a generalization of famous GNS (Gelfand-Naimark-Segal) construction [GN43,Se47] (as for the studies in category theoretic context, see [J12,Par18,Y20] for example), we obtain a representation of category algebras of † -categories on certain generalized Hilbert spaces (semi-Hilbert modules over rigs), which can be considered as an extension of the result in [CIM19] for groupoid algebras over C. This construction will provide a basis for the interplay between category theory, noncommutaive probability and other related regions such as operator algebras or quantum physics.
Notation 1. In the present paper, categories are always supposed to be small 1 . 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. We also use the following notations: where C(C, C ′ ) denotes the set of all arrows from C to C ′ .

Category Algebras
We introduce the notion of rig, module over rig, and algebra over rig in order to study category algebras in sufficient generality for various future applications in noncommutative probability, quantum physics and other regions of mathematical sciences such as tropical mathematics.
Definition 2 (Rig). A rig R is a set with two binary operations called addition and multiplication such that 1. R is a commutative monoid with respect to addition with the unit 0, 2. R is a monoid with respect to multiplication with the unit 1, 3. r ′′ (r ′ + r) = r ′′ r ′ + r ′′ r, (r ′′ + r ′ )r = r ′′ r + r ′ r holds for any r, r ′ , r ′′ ∈ R (Distributive law), 4. 0r = 0, r0 = 0 holds for any r ∈ R (Absorption law) .
Definition 3 (Module over Rig). A commutative monoid M under addition with unit 0 together with a left action of R on M (r, m) → rm is called a left module over R if the action satisfies the following: 1. r(m ′ + m) = rm ′ + rm, (r ′ + r)m = r ′ m + rm for any m, m ′ ∈ M and r, r ′ ∈ R.
Dually we can define the notion of right module over R. Let M is left and right module over R. M is called R-bimodule if r ′ (mr) = (r ′ m)r holds for any r, r ′ ∈ R and m ∈ M . The left/right action above is called the scalar multiplication.
Definition 4 (Algebra over Rig). A bimodule A over R is is called an algebra over R if it is also a rig with respect to its own multiplication which is compatible with scalar multiplication, i.e., for any a, a ′ ∈ A and r, r ′ ∈ R.
Usually the term "algebra" is defined on rings and algebras are supposed to have negative elements. In this paper, we use the term algebra to mean the module over rig with multiplication.
Definition 5 (Category Algebra). Let C be a category and R be a rig. An R-valued function α defined on C is said to be of backward (resp. forward) finite propagation if for any object C there are at most finite number of arrows in the support of α whose codomain (resp. domain) is C. The module over R consisting of all R-valued functions of backward (resp. forward) finite propagation together with the multiplication defined by becomes an algebra over R with unit ǫ defined by and is called the category algebra of backward (resp. forward) finite propagation is called the category algebra of finite propagation of C over R.
Remark 6. 0 R 0 [C] coincide with the algebra studied in [Mi72] if R is a ring.
In the present paper we focus on the category algebras is called the indeterminate (See Example 16) corresponding to c.
For indeterminates, it is easy to obtain the following: Theorem 9 (Caluculus of Indeterminates). Let c, c ′ ∈ C, ι c , ι c ′ be the corresponding indeterminates and r ∈ R. Then In short, a category algebra R[C] is an algebra of functions on C equipped with the multiplication which reflects the compositionality structure of C. By the identification of c ∈ C → ι c ∈ R[C], categories are included in category algebras.
Let us establish the basic notions for caluculation in category algebras: are called the the C-column, C ′ -row and (C ′ , C)-entry of α, respectively.
Note that either of the data By definition, the following theorem holds: Theorem 11 (Polynomial Expression). For any α ∈ R[C] The formulae above clarify that category algebras are generalized polynomial algebra (see Example 16). On the other hand, the following theorem, which shows that category algebras are generalized matrix algebras (see Example 21), also follows by definition: Theorem 12 (Matrix Calculus). For any α, α ′ ∈ R[C], C, C ′ ∈ |C| and r ∈ R, the followings hold: The theorem above implies the following: is determined by its action on columns ǫ C / rows C ′ ǫ of the unit ǫ for all C, C ′ ∈ |C|.
Proof. Let α ∈ R[C] and ǫ be the unit of R[C]. Then by definition Remark 14. It is convenient to make use of a kind of "Einstein convention" in physics: Double appearance of object indices which do not appear elsewhere means the sum over all objects in the category. For instance, The notation is quite useful especially for category algebra R[C] where |C| is finite. In that case it is easy to show the decomposition of unit: As a collorary, holds, which means that the multiplication can be interpreted as inner product of columns and rows. Hence, you can insert C C in formulae when C does not appear elsewhere.

Example of Category Algebras
Let us see some important examples of category algebras.
Example 15 (Function Algebra). Let C be a set as discrete category, i.e., a category whose arrows are all identities. Then R[C] is nothing but the R-valued function algebra on |C|, where the operations are defined pointwise.
When the rig R is commutative such as R = C, the function algebra is also commutative. On the other hand, a category algebra is in general noncommutative even if the rig is commutative. In this sense, category algebras can be considered as generalized (noncommutative) function algebras.
As we have noted, category algebras can also be considered as generalized polynomial algebras: Example 16 (Monoid Algebra). Let C be a monoid, i.e., a category with only one object. Then R[C] is the monoid algebra of C. For example, in the case of C = N as additive monoid, R[C] is the polynomial algebra over R.
Since a monoid C has only one object, any α ∈ R[C] can be presented as, by Theorem 11 which make it clear that R[C] is a generalized polynomial algebra.
As special cases of Example 16, we have group algebras.
Example 17 (Group Algebra). Let C be a group, i.e., a monoid whose arrows are all invertible. Then R[C] coincides with the group algebra of C. For example, in the case of C = Z, R[C] is the Laurent polynomial algebra over R.
By another generalization of Example 17 other than Example 16, we have groupoid algebras.
Example 18 (Groupoid Algebra). Let C be a groupoid, i.e., a category whose arrows are all invertible. When |C| is finite, R[C] is nothing but the groupoid algebra of |C|. Otherwise R[C] is a unital extension of the groupoid algebra in conventional sense which is nonunital. R[C] is quite useful to treat certain algebras which appeared in quantum physics [CIM19]. (See Example 19 also.) As special cases of the the Example 18 we have matrix algebras: Example 19 (Matrix Algebra). Let C be an indiscrete category, i.e., a category such that for every pair of objects C, C ′ there is exactly one arrow from C to C ′ . Denote the cardinal of |C| is n. Then R[C] is isomorphic to the matrix algebra M n (R).
Example 19 above shows that matrix algebras are category algebras. Conversely, any category algebra can be considered as generalized matrix algebra (see Theorem 12). This point of view is also useful to study quivers [G72], i.e., directed graphs with multiple edges and loops.
Example 20 (Path Algebra). Let C be the free category of a quiver Q. R[C] coincides with the notion of path algebra when the quiver Q has finite number of vertices. Otherwise the former includes the latter as a subalgebra.
Example 21 (Incidence Algebra). Let C be a finely finite category [Lei12], i.e., a category such that for any c ∈ C there exist finite number of pairs of arrows c ′ , c ′′ ∈ C satisfiyng c = c ′ • c ′′ . Then R C , the set of all functions from C to R, becomes a unital algebra and called the incidence algebra of C over R.
Let C be a category such that for any C ∈ C there exist at most finitely many arrows whose codomain is C. Then R 0 [C] coincides with the incidence algebra on C. for all c. The multiplicative inverse of ζ is denoted as µ and called Möbius function. The relation µζ = ζµ = ǫ is a generalization of the famous Möbius inversion formula, which has been considered as the foundation of combinatorial theory since one of the most important papers in modern combinatorics [R64].

States on Categories
We will introduce the notion of states on categories to provide a foundation for stochastic theories on categories. As we will see, we can construct noncommutative probability space, a generalized notion of measure theoretic probability space based on category algebras. The key insight is that what we need to establish statistical law is the expectation functional, which is the functional which maps each random variable (or "observable" in the quantum physical context) to its expectation value. Considering a functional on R[C] as expectation functional, we can interpret R[C] as an algebra of noncommutative random variables, such as observables of quanta.
Definition 22 (Linear Functional). Let A be an algebra over a rig R. An R-valued linear function on A, i.e., a function preserving addtion and scalar multiplication, is called a linear functional on A. A linear functional on A is said to be unital if ϕ(ǫ) = 1 where ǫ and 1 denote the multiplicative unit in A and R, respectively.
Definition 23 (Linear Functional on Category). Let R be a rig and C be a category. A (unital) linear functional on R[C] is said to be an R-valued (unital) linear functional on the category C.
Although the main theme here is stochastic theory making use of positivity structure defined later, linear functionals on category algebras are used not only in the context with positivity. A very interesting example is "umbral calculus" [RR78], an interesting tool in combinatorics, which can be interpreted as the theory of linear functionals on certain monoid algebras. Hence, studying the linear functionals on a category will lead to a generalization of umbral calculus.
Given a linear functional on a category, we obtain a function on the set of arrows. For categories with a finite number of objects, we can characterize the former in terms of the latter: Theorem 24 (Linear Fuctional and Function). Let ϕ be a R-valued linear fuctional on C. Then the functionφ defined aŝ becomes a Z(R)-valued function on C, i.e., an R-valued function satisfying rφ(c) =φ(c)r for any c ∈ C and r ∈ R. Conversely, when |C| is finite, any Z(R)-valued function φ on C gives R-valued linear functionalφ defined aš and the correspondence is bijective.
Proof. Let ϕ be a R-valued linear functional. Since rι c = ι c r for any r ∈ R and c ∈ C, we have rϕ(ι c ) = ϕ(ι c )r which means rφ(c) =φ(c)r. The converse direction and bijectivity directly follows from definitions and Theorem 11.
As a collorary we also have the following: Theorem 25 (Unital Linear Functional and Normalized Function). Let C be a category such that |C| is finite. Then there is one to one correspondence between R-valued unital linear functionals ϕ and normalized Z(R)-valued functions φ on C, i.e., Z(R)-valued functions φ satisfying C∈|C| φ(C) = 1.
(Note that we identify objects and identity arrows.) To define the notion of state as generalized probability measure which can be applied in noncommutative contexts such as stochastic theory on category algebras, we need the notions of involution and positivity structure.
Definition 26 (Involution on Category). Let C be a category. A covariant/contravariant endofunctor (·) † on 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 identity on objects is called a † -category.

Remark 27.
For the studies on involutive categories, which are categories with involution satisfying certain conditions, see [J12, Y20] for example.
Definition 28 (Involution on Rig). Let R be a rig. An operation (·) * on R preserving addition and covariant/contravariant with respect to multiplication is said to be a covariant/contravariant involution on R when (·) * • (·) * is equal to the identity function on R. A rig with contravariant involution is called a * -rig.
Definition 29 (Involution on Algebra). Let A be an algebra over a rig R with an covariant (resp. contravariant) involution (·) . A covariant (resp. contravariant) involution (·) * on A as a rig is said to be a covariant (resp. contravariant) involution on A as an algebra over R if it is compatible with scalar multiplication, that is, (r ′ ar) * = r ′ a * r (covariant case), (r ′ ar) * = ra * r ′ (contravariant case).
An algebra A over a * -rig R with contravariant involution is called a * -algebra over R.
Theorem 30 (Category Algebra as Algebra with Involution). Let C be a category with a covariant (resp. contravariant) involution (·) † and R be a rig with a covariant (resp. contravariant) involution (·). Then the category algebra 0 R 0 [C] becomes an algebra with covariant involution (resp. * -algebra) over R.
Proof. The operation (·) * defined as α * (c) = α(c † ) becomes a covariant (resp. contravariant) involution on 0 R 0 [C]. For the contravariant case, . By changing the labels of arrows it can be rewritten as The proof for the covariant case is similar and more straightforward.
Every category/rig has a trivial involution (identity). Thus, any category algebra 0 R 0 [C] can be considered as algebra with involution. In physics, especially quantum theory, the * -algebra 0 R 0 [C] where C is a groupoid as † -category with inversion as involution and R = C as * -rig with complex coujugate as involution. (For the importance of groupoid algebra in physics, see [CIM19] and references therein, for example).
Based on the involutive structure we can define the positivity structure on algebras: Definition 31 (Positivity). A pair of rigs with involution (R, R + ) is called a positivity structure on R if R + is a subrig such that r, s ∈ R + and r + s = 0 implies r = s = 0, and that a * a ∈ R + for any a ∈ R.
Definition 32 (State). Let R be a rig with involution and (R, R + ) be a positivity stucture on R. A state ϕ on an algebra A with involution over R with respect to (R, R + ) is a unital linear functional ϕ : A −→ R which satisfies ϕ(a * a) ∈ R + and ϕ(a * ) = ϕ(a) for any a ∈ R, where (·) * and (·) denotes the involution on A and R, respectively.
Remark 33. The last condition ϕ(a * ) = ϕ(a) follows from other conditions if R = C.
Definition 34 (Noncommutative Probability Space). A pair (A, ϕ) consisting of an algebra A with involution over a rig R with involution and an R-valued state ϕ is called a noncommutative probability space.
There are many studies on noncommutative probability spaces where the algebra A is a * -algebra over C. As is well known, the notion of noncommutative probability space essentially includes the one of probability spaces in conventional sense, which corresponds to the cases that algebras A are commutative * -algebras (with certain topological structure). On the other hand, when the algebras are noncommutative, noncommutative probability spaces provide many examples which cannot be reduced to conventional probability spaces, such as models for quantum systems.
Definition 35 (State on Category). Let R be a rig with involution and (R, R + ) be a positivity stucture on R. A state on the category algebra 0 R 0 [C] over R with respect to (R, R + ) is said to be a state on a category C with respect to (R, R + ).
As category algebras are in general noncommutative, states on categories provide many concrete noncommutative probability spaces generalizing such simplest examples as interacting Fock spaces [AB98] which are generalized harmonic oscillators, where the categories are indiscrete categories corresponding to certain graphs.
The notion of state can be characterized for the categories with finite number of objects as follows: Theorem 36 (State and Normalized Positive Semidefinite Function). Let C be a category such that |C| is finite. Then there is one to one correspondence between states ϕ with respect to (R, R + ) and normalized positive semidefinite Z(R)-valued functions φ with respect to (R, R + ), i.e., normalized functions such that is in R + for any function ξ on C with finite support and that φ(c † ) = φ(c), where (·) * and (·) denotes the involution on A and R, respectively.
Proof. Note that a function ξ on C with finite support can be considered as an element in 0 R 0 [C] and vice versa when |C| is finite. Then the theorem follows from the identity and the condition corresponding to ϕ(ξ * ) = ϕ(ξ).
The theorem above is a generalization of the result stated in the section 2.2.2 in [CIM19] for groupoid algebras over C. For the case of discrete category, the notion coincides with the notion of probability measure on objects (identity arrows). Hence, the notion of state on category can be considered as noncommutative generalization of probability measure which is associated to the transition from set as discrete category (0-category) to general category (1-category).
Given a state on a † -category, we can construct a kind of GNS(Gelfand-Naimark-Segal) representation [GN43,Se47] (as for generalized constructions, see [St55,Pas73,J12,Par18,Y20] for example) in a semi-Hilbert module defined below, a generalization of Hilbert space: Definition 37 (Semi-Hilbert Module over Rig). Let R be a rig with involution (·). A right module E over R equipped with a positive semidefinite sesquilinear form, i.e., a function ·|· : for any v, v ′ , v ′′ ∈ E and r, r ′ ∈ R is called a semi-Hilbert module over R.
When a semi-Hilbert module over E is also a left module over R, the set End(E) consisting of module endomorphisms over R on E becomes an algebra over R: The bimodule structure is given by (r ′ T r)(v) = r ′ T (rv), where T ∈ End(E) and r, r ′ ∈ R.
Remark 39. When the rig R is actually a ring, we can construct * -representation of A as follows (This idea is due to Malte Gerhold): We call an endomorphism T on a semi-Hilbert module E adjointable if there is a (not necessarily unique) adjoint, i.e., an endomorphism When E is also a left R module, the set of adjointable endomorphisms Adj(E) becomes a subalgebra over R of End(E). The set Nul(E) = {T | v ′ |T v = 0, ∀v, v ′ ∈ E} becomes a two-sided ideal in Adj(E). When R is a ring, the quotient of Adj(E) by Nul(E) becomes a * -algebra and we can construct the * -representation of A, since we can show that the two "adjoints" of an endomorphism coincide up to some element of Nul(E) by taking subtraction of endomophisms and can define the "taking adjoint" as involution operation in the quotient. In more general cases (especially for the rigs such that the cancellation law for addition does not hold), the GNS construction might not necessarily lead to a * -representations by adjointable endomorphisms.
When A is a * -algebra over C, we can prove Cauchy-Schwarz inequality for semi-Hilbert space. Then the set N ϕ = {α ∈ A| α|α ϕ = 0} becomes a subspace of A. By taking the quotient E ϕ = A/N ϕ , which becomes a pre-Hilbert space, we obtain the following "GNS(Gelfand-Naimark-Segal)" representation of A.
By taking completion we have usual Hilbert space formulation popular in the context of quantum mechanics.
As colloraries of theorems above, we have the following results, which are extensions of the Theorem 1 in [CIM19]. : Theorem 42 (Generalized GNS Representation of † -Category). Let C be a †category and R be a * -rig. For any ϕ be a state on C with respect to (R, R + ), there exist a semi-Hilbert module E ϕ over R which is also a left R module equipped with a sesquilinear form ·|· ϕ , an element e ϕ ∈ E ϕ such that e ϕ |e ϕ ϕ = 1, and a homomorphism π ϕ : 0 R 0 [C] −→ End(E ϕ ) between algebras over R such that ϕ(α) = e ϕ |π ϕ (α)e ϕ ϕ and v ′ |π ϕ (α)v ϕ = π ϕ (α * )v ′ |v ϕ hold for any α ∈ A and v, v ′ ∈ E ϕ .