You're reading the public-facing archive of the Category Theory Zulip server.
To join the server you need an invite. Anybody can get an invite by contacting Matteo Capucci at name dot surname at gmail dot com.
For all things related to this archive refer to the same person.
My goal for this thread is to communicate an idea that I've been working on to @John Baez (and anyone else who is interested). It's very relevant to the agent-based models that John and I will be working on in Edinburgh later this summer. I'd like to write a paper eventually about this, and it would be helpful to practice my math communication skills here, since I don't have a traditional math background and am often uncertain what level of detail to go into. Any questions/clarifications are welcome!
The core problem is that we are interested in computing the elements of a hom-set, say , in some (adhesive) category . We could call our query and the hom set the answer to our query. What's special about this problem is that we imagine is making little changes very frequently: we want an algorithm which updates our hom-set with respect to a small change rather than having to recompute the whole thing from scratch after each little change.
Our formal model of a change is the application of a rewrite rule (our rules right now will be purely additive via pushout, rather than the usual pushout-complement-followed-by-pushout kind of rewrite rule). Here's an example in the category of graphs:
Screenshot 2025-04-29 at 6.31.31 PM.png
In that example, got 'updated' to via applying via a match morphism . Our incremental search problem is: suppose we already knew for some : how would we figure out what is? We clearly have a subset of it, , but there are a bunch of new morphisms which sprang into existence due to the stuff that got added from the rewrite rule.
In order to explain this, I'll need to make some computational assumptions about to make explicit what it means to "find" morphisms. The following assumptions are motivated by the category of graphs: objects can be small or large, for practical purposes. The objects which appear in rules or queries are small, whereas the objects like and could be large. The computational complexity of enumerating is assumed to be intractable for arbitrary and (see: the subgraph isomorphism problem). However, we will assume it is tractable when performed between small objects. Furthermore, we assume we can efficiently enumerate some subsets of at runtime, in particular, whenever we have a partial map where is nonempty and is small and connected. Extending such a partial map to the subset of which agrees on the overlap corresponds to a rooted subgraph isomorphism problem (which is tractable). We can think of the overlap as initializing certain assignments of parts of to parts of in a search procedure, with the remaining unassigned values determined purely by the connectivity of .
Screenshot 2025-04-29 at 6.41.14 PM.png
So our strategy will be to systematically transform something that seems like a subgraph isomorphism problem into something that looks like the rooted subgraph isomorphism problem, and because of this we'll be much more efficient. And with that I hope I've communicated what the problem is that I'm trying to solve! I should probably stop there before charging ahead to a solution!
Not my field, but to me this looks very closely related to things that the GATAS lab folks work on and could help with, so I'm going to go ahead and tag @Benjamin Merlin Bumpus (he/him).
It'll take me at least a few hours to give a serious response... but I'm glad you're diving in and explaining this.
@Zoltan A. Kocsis (Z.A.K.) Kris has actually collaborated a lot with GATAS, including on this subject.
That's good, it means the similarity wasn't all in my head :sweat_smile:
Looks like a very interesting project.
Kris Brown said:
whenever we have a partial map where is nonempty and is small and connected. Extending such a partial map to the subset of which agrees on the overlap corresponds to a rooted subgraph isomorphism problem (which is tractable)
Out of interest, will you be working with situations where there's a unique extension, or could there be some optimising choice to be made?
Uniqueness isn't really important in this context! For example, some graph rewrite rule might apply to and add an outgoing edge (let's call the new updated graph ). If our query, , is a path of length two, then the solution to our incremental search problem is "look for incoming edges to : every new map in corresponds to one of those!" In that scenario, we could imagine maps the second edge of to the freshly-introduced edge, and there is an extension for every incoming edge to .
Just a thought, but I was hearing recently about @Matthijs Vákár and Tom Smeding's CHAD (Combinatory Homomorphic Automatic Differentiation), and how it's possible to vary their construction to one which could work for data provenance tracking and program slicing. It seems one can apply the automatic differentation idea in a very general setting, relating, in each direction, small changes of input and small changes of output.
I wonder if there's something similar possible here.
Hi, Kris, I'm back . Sorry, that took more than a few hours: I'm in Edinburgh now.
I understand the problem you're trying to solve, you explained it clearly, so I'm ready to start hearing about how you solve it!
The key fact about adhesive categories that I rely on is that any map into the apex of a pushout (e.g. a map into the result of the rewrite of Fig 1 above) induces what I'll call an "adhesive cube", where the side faces are all determined by taking pullbacks with . Because is adhesive, the top face of this cube is itself a pushout: . That is, something which maps into is itself made up of the part that mapped into (i.e. ) and the part of that mapped into (i.e. ), glued together by the part which mapped into (i.e. ).
Screenshot 2025-05-02 at 12.31.18 AM.png
So whenever we apply a rewrite rule, we have the bottom face of an adhesive cube. Any match from our pattern into the result of the rule application, , has an associated adhesive cube. The top face of the cube is a pushout of subobjects of . One thing we can do is consider all the ways we can express as a pushout of two of its subobjects. Maybe this takes some time, but we only need to do it once and store the result, plus we can do it in advance of any of the rewrite rule applications. So let us have all possible top faces of an adhesive cube at our disposal (we can call these decompositions of our pattern ).
One of the side faces of the adhesive cube lives above the rewrite rule (let's call it the rule face of the cube). We assume we are in a setting where we know all of the rewrite rules that might be used, and we know all possible top edges of a rule face (they are subobject morphisms, ). So we can actually compute all possible rule faces for a given subobject morphism + rule (say, ) by looking for pairs of maps and such that they form a pullback square. I'll call this a set of interactions between a subobject morphism and a rewrite rule .
When it comes time to actually find maps , given that a rewrite just occurred, we can iterate over all decompositions and interactions between the and the rewrite rule that was used:
Screenshot 2025-05-02 at 12.49.47 AM.png
In this figure, things in black are "free" (we computed and stored them a long time ago), things in red are what are provided to us (the result of the rewrite), and the remainder in green is what we'll compute: we want to find all of the ways to complete this partial adhesive cube into a full one. In doing so, we'll find all of the matches .
It looks like we need to find two morphisms, but we really just need to find all such that the face that lives over is a pullback square. Then we get for free via copairing . Luckily, we can efficiently find all such possible because we have the partial map . If we filter these results to just those which form a pullback square with , then we will have successfully found all matches because we exhaustively checked all partial adhesive cubes.
A couple of details: there is a particular trivial decomposition where and which we ignore: we do this because we are solving the incremental search problem, and that decomposition will lead to all of (and only) the 'old' matches which we were trying to avoid, i.e. elements of .
There's a little argument I'll need to give tomorrow to convince you that, other than for the trivial decomposition, that the partial map we use to enumerate candidates will always meet the criteria for corresponding to a 'rooted subgraph isomorphism' problem.
Also, here's a figure of the particular two choices of decomposition + interaction (top+side face) that lead to discovering the two new matches from which spring into existence when we apply the rule from Fig 1 above.
Note I'm implicitly specifying graph homomorphisms by saying where the vertices go in cases where it's not simply sending vertices to those with the same name.
also the above was the "base case", and three directions I extend it are: 1.) we can solve the incremental problem even more efficiently if we assume our category's subobjects have complements, 2.) we can relax the assumption that the match used to apply the rewrite rule is monic, 3.) we can process any finite number of simultaneous rewrites at once (e.g. for the case, would the colimit of )
Kris Brown said:
It looks like we need to find two morphisms, but we really just need to find all such that the face that lives over is a pullback square. Then we get for free via copairing . Luckily, we can efficiently find all such possible because we have the partial map . If we filter these results to just those which form a pullback square with , then we will have successfully found all matches because we exhaustively checked all partial adhesive cubes.
I get this, and it's very nice - in fact this brings me closer to grokking the definition of [[adhesive category]] than I'd ever come before, because you're using that scary 'adhesive cube' in the definition in a very intuitively natural way.
Kris Brown said:
There's a little argument I'll need to give tomorrow to convince you that, other than for the trivial decomposition, that the partial map we use to enumerate candidates will always meet the criteria for corresponding to a 'rooted subgraph isomorphism' problem.
This sounds like the point in the paper, if I were reading the paper, that my eyes would glaze over and I'd say "okay, I get the basic idea, I should really get back to work on my own stuff".
(Sorry, that sounds mean, but I figure honest feedback about one particular reader's psychology is worthwhile even if it just shows they are annoyingly uncommitted to understanding what you are trying to explain! Perhaps if I'm not atypical you can just note that readers like me would be perfectly happy to take some things on faith, so you can organize the paper in such a way that the fun easy stuff (which is I think what you just presented) is easy to understand without requiring the reader to follow the more detailed stuff.)
I'm not sure what you're saying is mean, it simply seems to be a statement that mathematicians may not care about computational complexity the same way computer scientists would - so maybe a paper describing reductions of a CT problem to rooted subgraph isomorphism would be better at a computer science conference than a math one.
Kris' paper will, I believe, be aimed at a computer science journal on databases and/or incremental computation. If so, my taste is not very relevant! But I promised to try to understand his explanation and give feedback, so I felt it was a bit rude to announce my eyes were about to glaze over.
Anyway, I hope he continues his explanation.
The argument I omitted is quite short! We want to show the partial map always yields a rooted homomorphism search. This means showing , which itself may not be connected (e.g. the top example in my most recent image), has no connected component which lies outside the image of . First, is nonempty because we ruled out the trivial decomposition. Then, because we assumed is connected and , if some disconnected component of were not in the image of , it would remain a disconnected component in .
Actually I think I forgot to mention that I'd been assuming our pattern is connected: we can do this without loss of generality, since if we were ultimately interested in incrementally monitoring then it suffices to just incrementally monitor and
Locating the intersection of people whose eyes wouldn't glaze over from the definition of a pullback and the people who would truly be interested in the computational complexity of database queries will be a challenge for future me! For the time being I'm happy to just check John is happy with the technical persuasiveness of the argument (but who knows if there ends up being some connection to detecting cycles in graphs which originate from pushouts!).
Let me check if my "optimized algorithm" makes sense: when we are fortunate enough that has complements (terminology I get from Evan and David Jaz's blog post, whereas nlab calls them supplements) we can do something even faster. It's faster in two ways: 1.) you might be worried there are a lot of ways to express as a pushout that we have to iterate over, and 2.) it might seem wasteful that, when we were trying to turn our partial adhesive cubes into complete ones via morphisms we found by extending a partial map from to , we had to filter all the possible extensions by ones which formed a pullback for the side face of the adhesive cube. This optimized algorithm says we'll also solve the problem if we do the same process but 1.) only consider decompositions where 2.) use all of the the extensions of the partial map.
For any match , we have not only a unique adhesive cube, but also what I'll call a unique minimal adhesive cube which one gets from composing two cubes together like in the below diagram:
Screenshot 2025-05-05 at 4.31.18 PM.png
(on the left I've drawn out the top, bottom, and front face of this composite cube)
Note we can see this arbitrary has a unique associated interaction between and , i.e. a pair of maps that forms a pullback with . We get this by precomposing and with and respectively.
So the algorithm is structurally the same: each has a unique cube associated with it, so loop over all partial cubes and try to complete them. But it's nicer to loop over partial minimal adhesive cubes because the possible top faces are generally are a small subset of all possible decompositions of . Also, the way to complete these cubes is simply looking for maps which extend the partial map (no filter step necessary). By the same argument as above, this partial map induces a rooted search problem because is connected and we are excluding the trivial decomposition.