TITLE: Can we get categories like $\mathbf{TopGrp}$ as some kind of a pullback?
QUESTION [5 upvotes]: We can interpret an equational theory, like the theory of groups, in a category like $\mathbf{Top}.$ In this case, we get $\mathbf{TopGrp},$ the category of topological groups.
My question is, can we alternatively get categories like $\mathbf{TopGrp}$ as some kind of a pullback?
Consider the scheme $J$ consisting of two objects $X$ and $Y,$ each of which has an arrow going to a third object $Z$. Now consider the $J$-shaped diagram $D$ in the category $\mathbf{Cat}$ such that $$D(X) = \mathbf{Top}, \; D(Y) = \mathbf{Grp}, \; D(Z) = \mathbf{Set}$$
where the non-identity arrows of $J$ are mapped to the forgetful functors.
This is probably a silly question, but is the pullback (in some suitable sense) of the above diagram $\mathbf{TopGrp}$?
It seems like too much to hope for, since we haven't enforced any compatibility requirements between the group structure and the topological structure.

REPLY [9 votes]: As you say, this can't quite work since you need to have the structures interact. Pullbacks in Cat just don't do that. There is however machinery that does do that, so while it does not quite answer your question I hope you'll find the following of interest. 
So, suppose that you have two theories $T_1,T_2$ (which you can think of as equational theories or Lawvere theories, for the sake of discussion it doesn't really matter). Suppose the models for each theory have underlying sets. What you want is to tensor the two theories into a new theory $T$ whose models will be "the compatible things that are both $T_1$ things and $T_2$ things", whatever that means. Of course, the way we usually do this is by inspecting the axioms for each theory, guessing what would be the correct compatibility condition, analyzing some cases to see if we were wrong or not, iterate, and arrive at the 'right' concept. It would be nice though to have a more systematic approach, which I think (at least partly) motivated your question. 
There are several (different) contexts in which this can be done. I'll briefly describe one of them that uses operads. An operad (by which I mean a colored symmetric operad, aka a symmetric multicategory) is much like a category only arrows may have as input any arbitrary finite tuple of objects (including $0$-tuples), instead of just $1$-tuples of objects as in a category. If you now contemplate what compositions should look like and which rules they should obey you will arrive at the definition of non-symmetric operad. If you further include the possibility to permute the inputs of arrows you'll arrive at the concept of symmetric operad.
Put simply, operads are to categories as calculus in several variables is to single variable calculus. The theory is basically the same, but you discover that some things are special to the single variable situation. That said, functors, equivalences, isomorphisms, etc. immediately make sense for operads. Adjunctions (sadly, so so sadly) don't make immediate sense to operads. Also, thing point of view gives you lots and lots examples of operads. Any monoidal category (e.g., Set, Cat, Top, Ab) can actually be thought of as an operad (just like multivariable functions in analysis can be thought of as single variable functions from $\mathbb R^n$ to $\mathbb R$). Also, any category at all can be thought of as an operads, simply one where all arrows happen to have tuples of length $1$ as input. 
So, the category $Ope$ or operads extends $Cat$, the category of categories. In fact, each of these is an operad, and moreover, each is a 2-operad. Now, the expressive power of operads is much greater than that of categories. It turns out that natural transformations carry over straightforwardly to operads. Therefor, $Ope$ has a functor operad construction: $[P,Q]$, for any two operads. This extends the functor category construction $[C,D]$ for any two categories. 
Exercise: Find an operad $P$ such that $[P, Set]$ is the operad of monoids. Show that $[P, Top]$ is the operad of topological monoids. (This is the connection with the theories $T_1$ and $T_2$ from above. Some operads can be thought of as theories). 
Having these functor operads construction begs the question if its actually an internal hom for some tensor product. The answer is that it is an internal hom for the Boardman-Vogt tensor product. And here we get a connection with the theory $T$ above. The Boardman-Vogt tensor product $P\otimes Q$ of two operads has precisely the property that $[P\otimes Q, R]$ is isomorphic to $[P,[Q,R]]$ and also to $[Q,[P,R]]$. Contemplating what that means shows that it means that $P\otimes Q$ is like a 'theory' for $P$ structures in $Q$ structures, with a compatibility condition. The nice thing is that it is a systematic definition and not an ad-hoc one. So, you don't make any guesses as to what the compatibility condition is, it's just given by the definition of the tensor. 
Final exercise. Consider again the operad $P$ from the previous exercise. What should $[P,[P,Set]]$ be? Since $[P, Set]\cong Mon$, it's just $[P,Mon]$, so it should be monoids in monoids. These are well-known (by the Eckman-Hilton argument) to be just commutative monoids. This can be seen on the level of operads: $[P,[P,Set]]\cong [P\otimes P, Set]$, so one needs to compute $P\otimes P$ and show that one gets an operads corresponding to the theory of commutative monoids (this is a fun exercise).