# Hopf "algebroid" structure of a groupoid convolution algebra?

This question is already posted in math.stackexchange, but didn't receive any answer. I'm not sure if this question fits in here, but surely someone in here can guide me to the correct answer.

To make things as simple as possible, let's say we have a discrete group $$G$$. Then the group algebra $$\mathbb{C}[G]$$ (of finitely supported complex valued functions on $$G$$) has a convolution and an involution operation given by $$(f\star g)(x)=\sum_{x=ab}f(a)g(b), \qquad f^{\ast}(x)=\overline{f(x^{-1})}$$

It is easier to interpret $$\mathbb{C}[G]$$ as the free complex vector space spanned by $$G$$ for notational convenience. I came across a statement that says this $$\ast$$-convolution algebra has a natural Hopf algebra structure given by comultiplication $$\Delta(g)=g\otimes g$$ and counit $$\epsilon(g)=1$$, then extended linearly. Also antipode is given by $$\ast$$-operation extended antilinearly.

Now I would like to know, what happen if we replace the group $$G$$ with a groupoid? My naïve guess is that we would get a Hopf algebroid (many object analogue of the known construction). If it is the case, how would the coalgebra look like?

The group ring $$\mathbb{C}[G]$$ is a Hopf algebra that is cocommutative but not commutative. The dual is the ring $$R=\text{Map}(G,\mathbb{C})$$. This is a Hopf algebra with $$(uv)(g)=u(g)v(g)$$ and $$\Delta(u)(g,h)=u(gh)$$ (where we identify $$R\otimes R$$ with $$\text{Map}(G\times G,\mathbb{C})$$). This is commutative but not cocommutative.
At least in the literature that I am familiar with, Hopf algebroids are required to be commutative but not necessarily cocommutative. Given a finite groupoid with object set $$X$$ and morphism set $$G$$, and a ground ring $$k$$, we get a Hopf algebroid $$\text{Map}(G,k)$$ over the ring $$\text{Map}(X,k)$$, so this is more like the dual of $$\mathbb{C}[G]$$ rather than $$\mathbb{C}[G]$$ itself. Similarly, given an affine groupoid scheme $$G$$ over an affine scheme $$X$$, the corresponding ring $$\mathcal{O}_G$$ is a Hopf algebroid over $$\mathcal{O}_X$$, and this actually gives an equivalence between Hopf algebroids and affine groupoid schemes.
Note that $$\mathcal{O}_G$$ has two different structures as an $$\mathcal{O}_X$$-module, coming from the source and target maps from $$G$$ to $$X$$. After choosing one of these, you can construct the ring $$\Gamma=\text{Hom}_{\mathcal{O}_X}(\mathcal{O}_G,\mathcal{O}_X)$$, and this has a natural noncommutative ring structure. But it is usually technically easier to work with the Hopf algebroid $$\mathcal{O}_G$$ and its comodule category rather than $$\Gamma$$ and its module category.
All of these considerations are well-known in algebraic topology, especially in the context of the Hopf algebroids $$MU_*MU$$ and $$BP_*BP$$, which are closely related by a theorem of Quillen to the theory of formal group laws. One standard reference is Appendix A1 of Ravenel's Green Book