Composition of bibundles I am reading Orbifolds as stacks?
Given Lie groupoids $\mathcal{G}$ and $\mathcal{H}$ there is a notion of what is called a bibundle from $\mathcal{G}$ to $\mathcal{H}$ which is supposed to be a ageneralized notion of a morphism of Lie groupoids.

(rough) Definition : A bibundle is a groupoid principal bundle which is equipped with a second groupoid action from the other side.
(precise) Definition : A bibundle from $\mathcal{G}$ to $\mathcal{H}$ is a manifold $P$ together with maps $a_L:P\rightarrow \mathcal{G}_0$ and $a_R:P\rightarrow \mathcal{H}_0$ such that

*

*there is a left action of $\mathcal{G}$ on $P$ with respect to an anchor $a_L$ and a right action of $\mathcal{H}$ on $P$ with respect to an anchor $a_R$.


*$a_L:P\rightarrow \mathcal{G}_0$ is a principal $H$-bundle.


*$a_R$ is $\mathcal{G}$ invariant.


*the actions of $\mathcal{G}$ and $\mathcal{H}$ commutes.

The point is to make collection of Lie groupoids as a $2$ category with Lie groupoids seen as objects, bibundles as morphisms between objects and isomorphisms of bibundles as maps between bibundles.
For that, we need to define what does it mean to say composition of two maps between Lie groupoids i.e., given bibundles $P:\mathcal{G}\rightarrow \mathcal{H}$ and $Q:\mathcal{H}\rightarrow \mathcal{K}$, we need to declare what is $P\circ Q:\mathcal{G}\rightarrow \mathcal{K}$.
We want it to be a bibundle. So, we need atleast maps $a_L:P\circ Q\rightarrow \mathcal{G}_0$ and $a_R:P\circ Q\rightarrow \mathcal{K}_0$.
What we have is $a_L:P\rightarrow \mathcal{G}_0,a_R:P\rightarrow \mathcal{H}_0,a_L:Q\rightarrow \mathcal{H}_0,a_R:Q\rightarrow \mathcal{K}_0$ such that both $a_L$ are principal bundles.
One natural thing (which I did not realize before) is to consider pullback $P\times_{\mathcal{H}_0}Q$ from maps $a_R:P\rightarrow \mathcal{H}_0,a_L:Q\rightarrow \mathcal{H}_0$ that gives maps $\pi_1:P\times_{\mathcal{H}_0}Q\rightarrow P$ and $\pi_2:P\times_{\mathcal{H}_0}Q\rightarrow Q$ which on composition with $a_L:P\rightarrow \mathcal{G}_0, a_R:Q\rightarrow \mathcal{K}_0$ gives   $a_L\circ \pi_1:P\times_{\mathcal{H}_0}Q\rightarrow \mathcal{G}_0$ and $a_R\circ \pi_2:P\times_{\mathcal{H}_0}Q\rightarrow \mathcal{K}_0$. As  $a_L$ is a submerison, $P\times_{\mathcal{H}_0}Q$ has a smooth manifold structure.
It feels like $P\times_{\mathcal{H}_0}Q$ is the candidate for composition. As said before, we atleast need a manifodl $P\circ Q$ and maps $P\circ Q\rightarrow \mathcal{G}_0$ and $P\circ Q\rightarrow \mathcal{K}_0$.
Along with this, we need action of $\mathcal{G}$ on $P\circ Q$ and an action of $\mathcal{H}$ on $P\circ Q$.
We have obvious action maps

*

*$\mathcal{G}_1\times_{\mathcal{G}_0}(P\times_{\mathcal{H}_0}Q)\rightarrow P\times_{\mathcal{H}_0}Q$ with $(g,(p,q))\mapsto (g.p,q)$


*$(P\times_{\mathcal{H}_0}Q)\times_{\mathcal{H}_0}\mathcal{H}_1\rightarrow P\times_{\mathcal{H}_0}Q$ with $((p,q),h)\mapsto (p,q.h)$
It looks this should be the composition but that paper says some thing more.

Since the action of $\mathcal{H}$ on $P$ is principal, the action of $\mathcal{H}$ on $P\times_{\mathcal{H}_0}Q$ given by $(p,q).h=(p.h,h^{-1}q)$ is free and proper. Hence the quotient $(P\times_{\mathcal{H}_0}Q)/\mathcal{H}$ is a manifold.

I am not able to understand what above statements mean. I have not come across the notion of quotient of a manifold by a Lie groupoid. I only know that if a Lie group acts properly, freely on a manifold, the quotient is a maniofld. What Lie group they are considering here? $\mathcal{H}_1$? I guess no, It is not even a group even though there is a smooth structure.
Can some one help me to see what I am missing here?
EDIT : I think I misunderstood that they are talking about a Lie group action on manifold $P\times_{\mathcal{H}_0}Q$ when they are saying $(P\times_{\mathcal{H}_0}Q)/\mathcal{H}_1$. Even though $\mathcal{H}_1$ is not a Lie group they can still consider the quotient space given by relation coming form the action of $\mathcal{H}_1$.
Let $(p_1,q_1),(p_2,q_2)\in P\times_{\mathcal{H}_0}Q$. We declare
$(p_1,q_1)\sim(p_2,q_2)$ if there exists $h\in \mathcal{H}_1$ such that
$p_1=p_2.h$ and $q_1=h^{-1}q_2$. This is an equivalence relation on $P\times_{\mathcal{H}_0}Q$. I guess they mean $(P\times_{\mathcal{H}_0}Q)/\sim$ in my notation when they say $(P\times_{\mathcal{H}_0}Q)/\mathcal{H}$.
If this is the case, then they use some theorem which says when a quotient space of a manifold given by a relation is a manifold to conclude $(P\times_{\mathcal{H}_0}Q)/\mathcal{H}$ i.e., $(P\times_{\mathcal{H}_0}Q)/\sim$ in my notation is a manifold.
Can some one please confirm if this is what it is.
EDI : STACKY LIE GROUPS says in page $6$ that

Let $\mathcal{G},\mathcal{H},\mathcal{K}$ be Lie groupoids and $M$ be a $\mathcal{G}-\mathcal{H}$ bibundle and $N$ be a $\mathcal{H}-\mathcal{K}$ bibundle.  Viewing
a bibundle as relation of stacks suggests defining the composition of bibundles as $M\circ N=(M\times_{\mathcal{H}_0}N)/\mathcal{H}_1$
where the quotient is with respect to diagonal action $(m,n).h=(m.h,h^{-1}.n)$ for $m,n$ wherever defined.

I am not aware of seeing bibundles as relation of stacks. Can some one help me to see bibundles as relation of stacks. May be then, It would be easier for me to understand why that choice would natural when defining composition.
 A: I will give an example as to why composition of bibundles cannot simply be done as pullback, as well as the relation to perhaps more familiar geometric constructions.
Firstly, note that if $M$ is a manifold and $\mathbf{B}G$ is a one-object Lie groupoid (where the automorphisms of the one object are the Lie group $G$), a bibundle from $M$ to $\mathbf{B}G$ is precisely the same thing as a principal $G$-bundle on $M$. Now consider a homomorphism $\phi\colon G\to H$, and the corresponding functor $\mathbf{B}G\to \mathbf{B}H$. This gives a bibundle from $\mathbf{B}G$ to $\mathbf{B}H$, namely $u(H) \to \ast = Obj(\mathbf{B}G)$, where $u(H)$ is the underlying manifold of the Lie group $H$. The left $\mathbf{B}G$-action is trivial, and the right $\mathbf{B}H$-action (which is the same as an $H$-action) is by multiplication. The naive "composition" of bibundles should give a bibundle from $M$ to $\mathbf{B}H$, which is just a principal $H$-bundle on $M$, but what it actually gives is just $P\times H \to M$, which is the composite of the projection on $P$ and the given map $P\to M$.
The correct composite should be the principal bundle you get by changing the structure group along the given homomorphism $G\to H$, which is the quotient $(P\times H)/G$ by the action of $G$ on $P\times H$ as $(p,h) \mapsto (pg,\phi(g)^{-1}h)$. Equivalently, one can set up an equivalence relation on $P\times H$ so that $(pg,h) \simeq (p,\phi(g)h)$. This generalises directly to the case when you replace $\mathbf{B}G\to \mathbf{B}H$ by some arbitrary functor $X\to Y$ of Lie groupoids (and compose with the bibundle it gives rise to), and with only a little more work when you replace the manifold $M$ by a general Lie groupoid. At that point, you probably will be comfortable with the general case.
