**4. 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 7** (Linear Functional)**.** *Let A be an algebra over a rig R. An R-valued linear function on A, i.e., a function preserving addition 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 8** (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" [24], 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 5** (Linear Function and Function)**.** *Let ϕ be a R-valued linear functional on* C*. Then the function ϕ*ˆ *defined as*

$$
\phi(c) = \phi(\chi^c)
$$

*becomes a Z*(*R*)*-valued function on* C*, i.e., an R-valued function satisfying rϕ*<sup>ˆ</sup>(*c*) = *ϕ*<sup>ˆ</sup>(*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 as*

$$\phi(\alpha) = \sum\_{c \in \mathcal{C}} \alpha(c)\phi(c) = \sum\_{c \in \mathcal{C}} \phi(c)\alpha(c).$$

*and the correspondence is bijective.*

**Proof.** Let *ϕ* be a *R*-valued linear functional. Since *rχ<sup>c</sup>* = *χcr* for any *r* ∈ *R* and *c* ∈ C, we have *rϕ*(*χ<sup>c</sup>*) = *ϕ*(*χ<sup>c</sup>*)*r* which means *rϕ*<sup>ˆ</sup>(*c*) = *ϕ*<sup>ˆ</sup>(*c*)*<sup>r</sup>*. The converse direction and bijectivity directly follows from definitions and Theorem 2.

As a corollary we also have the following:

**Theorem 6** (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*

$$\sum\_{C \in \vert \mathcal{C} \vert} \phi(C) = 1.$$

*(Please 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 9** (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 3.** *For the studies on involutive categories, which are categories with involution satisfying certain conditions, see [20,22] for example.*

**Definition 10** (Involution on Rig)**.** *Let R be a rig. An operation* (·)<sup>∗</sup> *on R preserving addition and covariant/contravariant with respect to multiplication is said to be a covariant/contravariant involution on R when* (·)<sup>∗</sup> ◦ (·)<sup>∗</sup> *is equal to the identity function on R. A rig with contravariant involution is called a* ∗*-rig.*

**Definition 11** (Involution on Algebra)**.** *Let A be an algebra over a rig R with a covariant (resp. contravariant) involution* (·) *. A covariant (resp. contravariant) involution* (·)<sup>∗</sup> *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, i.e.,*

> (*rar*)<sup>∗</sup> = *ra*<sup>∗</sup>*r (covariant case)*, (*rar*)<sup>∗</sup> = *ra*<sup>∗</sup>*r (contravariant case)*.

*An algebra A over a* ∗*-rig R with contravariant involution is called a* ∗*-algebra over R.*

**Theorem 7** (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* <sup>0</sup>*R*0[C] *becomes an algebra with covariant involution (resp.* ∗*-algebra) over R.*

**Proof.** The operation (·)<sup>∗</sup> defined as *α*<sup>∗</sup>(*c*) = *α*(*c*†) becomes a covariant (resp. contravariant) involution on <sup>0</sup>*R*0[C]. For the contravariant case,

$$(a\beta)^{\*}(\mathcal{c}) = \overline{a\beta(\mathcal{c}^{\dagger})} = \overline{\sum\_{\mathfrak{c}^{\dagger} = \mathfrak{c}^{\prime} \circ \mathfrak{c}^{\prime\prime}}} \overline{a(\mathfrak{c}^{\prime})\beta(\mathcal{c}^{\prime\prime})} = \sum\_{\mathfrak{c}^{\dagger} = \mathfrak{c}^{\prime} \circ \mathfrak{c}^{\prime\prime}} \overline{\overline{a(\mathfrak{c}^{\prime})\beta(\mathcal{c}^{\prime\prime})}} = \sum\_{\mathfrak{c}^{\dagger} = \mathfrak{c}^{\prime} \circ \mathfrak{c}^{\prime\prime}} \overline{\beta(\mathcal{c}^{\prime\prime})} \overline{\overline{a(\mathfrak{c}^{\prime\prime})}}$$

which is equal to ∑*<sup>c</sup>*=*c*†◦*c*† *β*(*c*) *<sup>α</sup>*(*c*). By changing the labels of arrows, it can be rewritten as

$$\sum\_{\mathfrak{c} = \mathfrak{c}^{\prime \dagger} \lhd \mathfrak{c}^{\prime \dagger}} \overline{\beta(\mathfrak{c}^{\prime \dagger})} \overline{a(\mathfrak{c}^{\prime})} = \sum\_{\mathfrak{c} = \mathfrak{c}^{\prime} \lhd \mathfrak{c}^{\prime \dagger}} \overline{\beta(\mathfrak{c}^{\prime \dagger})} \overline{a(\mathfrak{c}^{\prime \dagger})} = \sum\_{\mathfrak{c} = \mathfrak{c}^{\prime} \lhd \mathfrak{c}^{\prime \dagger}} \beta^\*(\mathfrak{c}^{\prime}) a^\*(\mathfrak{c}^{\prime \prime}) = \beta^\* a^\*(\mathfrak{c}).$$

The proof for the covariant case is similar and more straightforward.

Every category/rig has a trivial involution (identity). Thus, any category algebra <sup>0</sup>*R*0[C] can be considered to be algebra with involution. In physics, especially quantum theory, the ∗-algebra <sup>0</sup>*R*0[C] where C is a groupoid as †-category with inversion as involution and *R* = C as ∗-rig with complex conjugate as involution. (For the importance of groupoid algebra in physics, see [17] and references therein, for example).

Based on the involutive structure we can define the positivity structure on algebras:

**Definition 12** (Positivity)**.** *A pair of rigs with involution* (*<sup>R</sup>*, *R*+) *is called a positivity structure on R if R*+ *is a subring such that r*,*s* ∈ *R*+ *and r* + *s* = 0 *implies r* = *s* = 0*, and that a*<sup>∗</sup>*a* ∈ *R*+ *for any a* ∈ *R.*

The most typical examples are (C, <sup>R</sup>≥<sup>0</sup>), (<sup>R</sup>, <sup>R</sup>≥<sup>0</sup>), and (<sup>R</sup>≥0, <sup>R</sup>≥<sup>0</sup>). Another interesting example is the tropical algebraic one (R ∪ {∞}, R ∪ {∞}) where R ∪ {∞} is considered to be a rig with respect to min and +.

**Definition 13** (State)**.** *Let R be a rig with involution and* (*<sup>R</sup>*, *R*+) *be a positivity structure on R. A state ϕ on an algebra A with involution over R with respect to* (*<sup>R</sup>*, *R*+) *is a unital linear functional ϕ* : *A* −→ *R which satisfies ϕ*(*a*<sup>∗</sup>*a*) ∈ *R*+ *and ϕ*(*a*<sup>∗</sup>) = *ϕ*(*a*) *for any a* ∈ *R, where* (·)<sup>∗</sup> *and* (·) *denotes the involution on A and R, respectively.*

**Remark 4.** *The last condition ϕ*(*a*<sup>∗</sup>) = *ϕ*(*a*) *follows from other conditions if R* = C*.*

**Definition 14** (Noncommutative Probability Space)**.** *A pair* (*<sup>A</sup>*, *ϕ*) *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 15** (State on Category)**.** *Let R be a rig with involution and* (*<sup>R</sup>*, *R*+) *be a positivity structure on R. A state on the category algebra* <sup>0</sup>*R*0[C] *over R with respect to* (*<sup>R</sup>*, *R*+) *is said to be a state on a category* C *with respect to* (*<sup>R</sup>*, *<sup>R</sup>*+)*.*

As category algebras are in general noncommutative, states on categories provide many concrete noncommutative probability spaces generalizing such simplest examples as interacting Fock spaces [25] 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 8** (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* (*<sup>R</sup>*, *R*+) *and normalized positive semidefinite Z*(*R*)*-valued functions φ with respect to* (*<sup>R</sup>*, *<sup>R</sup>*+)*, i.e., normalized functions such that*

$$\sum\_{\{(c,c')\mid \mathsf{dom}((c')^\dagger) = \mathsf{cod}(c)\}} \overline{\xi^\{ (c') \}} \phi((c')^\dagger \circ c) \xi(c)$$

*is in R*+ *for any function ξ on* C *with finite support and that φ*(*c*†) = *φ*(*c*)*, where* (·)<sup>∗</sup> *and* (·) *denotes the involution on A and R, respectively.*

**Proof.** Please note that a function *ξ* on C with finite support can be considered to be an element in <sup>0</sup>*R*0[C] and vice versa when |C| is finite. Then the theorem follows from the identity

$$\begin{split} \xi^{\star}\xi &= (\sum\_{c' \in \mathcal{C}} \overline{\xi((c')^{\dagger})} \chi^{c'}) (\sum\_{c \in \mathcal{C}} \chi^{c}\overline{\xi}(c)) \\ &= (\sum\_{c' \in \mathcal{C}} \overline{\xi(c')} \chi^{(c')^{\dagger}}) (\sum\_{c \in \mathcal{C}} \chi^{c}\overline{\xi}(c)) \\ &= \sum\_{\{(c,c')|\text{dom}((c')^{\dagger}) = \text{cod}(c)\}} \overline{\xi(c')} \chi^{(c')^{\dagger} \circ c} \overline{\xi}(c). \end{split}$$

and the condition corresponding to *ϕ*(*ξ*<sup>∗</sup>) = *ϕ*(*ξ*).

The theorem above is a generalization of the result stated in Section 2.2.2 in [17] 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 to be noncommutative generalization of probability measure which is associated with 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 [18,19] (as for generalized constructions, see [20–22,26,27] for example) in a semi-Hilbert module defined below, a generalization of Hilbert space:

**Definition 16** (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* ·|· : *E* × *E* −→ *R satisfying*

$$
\langle v^{\prime\prime}|v^{\prime}r^{\prime}+\upsilon r\rangle = \langle v^{\prime\prime}|v^{\prime}\rangle r^{\prime} + \langle v^{\prime\prime}|v\rangle r^{\prime}
$$

$$
\langle v^{\prime}|v\rangle = \overline{\langle v|v^{\prime}\rangle}
$$

$$
\langle v|v\rangle \in R\_{+}
$$

*for any v*, *<sup>v</sup>*, *v* ∈ *E and <sup>r</sup>*,*r* ∈ *R is called a semi-Hilbert module over R.*

> *ϕ*(*α*) =

*v*|*π<sup>ϕ</sup>*(*α*)*v<sup>ϕ</sup>*

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 (*rTr*)(*v*) = *<sup>r</sup>T*(*rv*), where *T* ∈ End(*E*) and *<sup>r</sup>*,*r* ∈ *R*.

**Theorem 9** (Generalized GNS Representation)**.** *Let A be an* ∗*-algebra over a rig R with involution* (·)<sup>∗</sup>*. For any state ϕ on A with respect to* (*<sup>R</sup>*, *<sup>R</sup>*+)*, there exist a semi-Hilbert module Eϕ over R which is also a left R module equipped with a positive semidefinite sesquilibear form* ·|·*<sup>ϕ</sup>, an element eϕ* ∈ *Eϕ such that e<sup>ϕ</sup>*|*e<sup>ϕ</sup><sup>ϕ</sup>* = 1*, and a homomorphism πϕ* : *A* −→ End(*Eϕ*) *between algebras over R such that*

*and*

$$v' | \pi^{\rho}(\mathfrak{a}) v )^{\rho} = \langle \pi^{\rho}(\mathfrak{a}^\*) v' | v \rangle$$

*e<sup>ϕ</sup>*|*π<sup>ϕ</sup>*(*α*)*e<sup>ϕ</sup><sup>ϕ</sup>*

*π<sup>ϕ</sup>*(*α*<sup>∗</sup>)*v*|*v<sup>ϕ</sup>*

*holdforany α* ∈ *A andv*, *v* ∈ *Eϕ.*

**Proof.** Let *Eϕ* be the algebra *A* itself as a module over *R* equipped with ·|·*ϕ* defined by *α*|*α<sup>ϕ</sup>* = *ϕ*((*α*)<sup>∗</sup>*α*). It is easy to show that ·|·*ϕ* is a positive semidefinite sesquilinear form and satisfies *ϕ*(*α*) = *e<sup>ϕ</sup>*|*π<sup>ϕ</sup>*(*α*)*e<sup>ϕ</sup><sup>ϕ</sup>*, and *v*|*π<sup>ϕ</sup>*(*α*)*v<sup>ϕ</sup>* = *π<sup>ϕ</sup>*(*α*<sup>∗</sup>)*v*|*v<sup>ϕ</sup>* where *πϕ* denotes the homomorphism *πϕ* : *A* −→ End(*Eϕ*) defined by *π<sup>ϕ</sup>*(*α*) = *<sup>α</sup>*(·), the left multiplication by *α*, and *eϕ* denotes the unit of *A* as an element of *Eϕ*.

**Remark 5.** *When the rig R is actually a ring, we can construct* <sup>∗</sup>*-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 T*∗ *with v*|*Tv* = *T*<sup>∗</sup>*v*|*v for any v*, *v* ∈ *E. 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*|*Tv* = 0, ∀*<sup>v</sup>*, *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* <sup>∗</sup>*-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* <sup>∗</sup>*-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ϕ* = {*α* ∈ *<sup>A</sup>*|*α*|*α<sup>ϕ</sup>* = 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*.

**Theorem 10** (GNS Representation)**.** *Let A be a* ∗*-algebra over* C*. For any state ϕ on A with respect to* (C, <sup>R</sup>≥<sup>0</sup>)*, there exist a pre-Hilbert space Eϕ over* C *equipped with an inner product* ·|·*<sup>ϕ</sup>, an element eϕ* ∈ *Eϕ such that e<sup>ϕ</sup>*|*e<sup>ϕ</sup><sup>ϕ</sup>* = 1*, and a homomorphism πϕ* : *A* −→ End(*Eϕ*) *between algebras over R such that*

$$p(\mathfrak{a}) = \langle e^{\varrho} | \pi^{\varrho}(\mathfrak{a}) e^{\varrho} \rangle^{\varrho}$$

*and*

$$\langle v' | \pi^{\varrho}(\mathfrak{a}) \upsilon \rangle^{\varrho} = \langle \pi^{\varrho}(\mathfrak{a}^\*) v' | \upsilon \rangle^{\varrho}$$

*hold for any α* ∈ *A and v*, *v* ∈ *Eϕ.*

By taking completion we have usual Hilbert space formulation popular in the context of quantum mechanics.

**Remark 6.** *If the state ϕ is fixed as "standard" one, such as "vacuum", the Dirac bracket notation becomes valid if we interpret as follows:*


> *ϕ*(*α*) =

As corollaries of theorems above, we have the following results, which are extensions of the Theorem 1 in [17]. :

**Theorem 11** (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* (*<sup>R</sup>*, *<sup>R</sup>*+)*, there exist a semi-Hilbert module Eϕ over R which is also a left R module equipped with a sesquilinear form* ·|·*<sup>ϕ</sup>, an element eϕ* ∈ *Eϕ such that e<sup>ϕ</sup>*|*e<sup>ϕ</sup><sup>ϕ</sup>* = 1*, and a homomorphism πϕ* : <sup>0</sup>*R*0[C] −→ End(*Eϕ*) *between algebras over R such that*

$$\text{The first-order coupling between the two-dimensional } \mathcal{N} \text{-matrices is the only possible } \mathcal{N} \text{-matrices with } \mathcal{N} = \{0, 1, 2, \dots, N\} \text{ and } \mathcal{N} = \{0, 1, 2, \dots, N\}.$$

$$\text{The first-order coupling between the two-dimensional } \mathcal{N} \text{-matrices is the only possible } \mathcal{N} \text{-matrices with } \mathcal{N} = \{0, 1, 2, \dots, N\} \text{ and } \mathcal{N} = \{0, 1, 2, \dots, N\}.$$

*e<sup>ϕ</sup>*|*π<sup>ϕ</sup>*(*α*)*e<sup>ϕ</sup><sup>ϕ</sup>*

$$\langle \upsilon' | \pi^{\varrho}(\mathfrak{a}) \upsilon \rangle^{\varrho} = \langle \pi^{\varrho}(\mathfrak{a}^\*) \upsilon' | \upsilon \rangle^{\varrho}$$

*hold for any α* ∈ *A and v*, *v* ∈ *Eϕ.*

**Theorem 12** (GNS Representation of †-Category)**.** *Let* C *be a* †*-category. For any ϕ be a state on* C *with respect to* (C, <sup>R</sup>≥<sup>0</sup>)*, there exist a pre-Hilbert space Eϕ over* C *equipped with an inner product* ·|·*<sup>ϕ</sup>, an element eϕ* ∈ *Eϕ such that e<sup>ϕ</sup>*|*e<sup>ϕ</sup><sup>ϕ</sup>* = 1*, and a homomorphism πϕ* : <sup>0</sup>*R*0[C] −→ End(*Eϕ*) *between algebras over* C *such that*

$$\varphi(\mathfrak{a}) = \langle e^{\mathfrak{q}} | \pi^{\mathfrak{q}}(\mathfrak{a}) e^{\mathfrak{q}} \rangle^{\mathfrak{q}}$$

*and*

*and*

$$\langle v' | \pi^{\wp}(\mathfrak{a}) v \rangle^{\wp} = \langle \pi^{\wp}(\mathfrak{a}^\*) v' | v \rangle^{\wp}$$

*hold for any α* ∈ *A and v*, *v* ∈ *Eϕ.*

**Funding:** This work was partially supported by Research Origin for Dressed Photon, JSPS KAKENHI (grant number 19K03608 and 20H00001) and JST CREST (JPMJCR17N2).

**Institutional Review Board Statement:** Not applicable.

**Informed Consent Statement:** Not applicable.

**Acknowledgments:** The author is grateful to Hiroshi Ando, Soichiro Fujii and Misa Saigo for fruitful discussions and comments.

**Conflicts of Interest:** The author declares no conflict of interest.
