Manuscript Offprint
arXiv:2608.25598M-Fibration Theory with Applications to Neural Network Compression
Abstract
The purpose of this paper is to provide a general, comprehensive, theoretical framework that allows one to deal with fibrations on graphs labelled on a commutative monoid. This is a genuine extension of the theory of graph fibrations (as introduced in [1]), that makes it possible to deal with weighted graphs, and also graphs labelled with other algebraic structures. The derived theory also lends itself naturally to consider approximate fibrations. As an example, we show how this framework can be applied to the compression of arbitrary neural networks (including CNNs), providing a strong theoretical underpinning to the recent results in [2].
Keywords: Network analysis, fibrations, neural networks
1 Introduction and Motivations
Graph fibrations were formally described in [1], derived from the much more general definition by Grothendieck [3]. The main motivation, at the time, was to have a formal tool to describe computations in distributed systems. Similar notions had already been used in very different settings, with different goals and under different names: equitable partitions [4, 5], the Weisfeiler–Leman test [6], colour refinement [7], groupoids [8].
While fibrations are still used in the context of distributed computing (see, e.g., [9]), in the last decades the fibration machinery was borrowed in other, quite different, playgrounds as means to describe symmetries in general networks: specifically, in the theory of dynamical systems [8, 10, 11] and in biology [12–14].
Although the theory of fibrations is elegant and simple, there are two important shortcomings that make its usage difficult in these more general contexts. The first is that it is challenging to adapt fibrations to weighted graphs, or more generally to graphs with labels that can be algebraically composed; the theory, as described in [1], allows for labels, but treats them in a “static” way: labels can exist on arcs, but they must be preserved exactly by morphisms. The second problem is that the presence of errors or noise is incompatible with the theory itself. One extra, or one missing arc, or even an arc with a weight that is slightly off, and everything breaks.
These problems can be overcome with ad hoc approaches, and in fact fibrations have been successfully applied also in these more general contexts [2, 13, 15]. Nonetheless, a well-grounded theoretical foundation behind their use is still missing.
The purpose of this paper is to provide a general, comprehensive, theoretical framework that allows one to deal with fibrations on graphs labelled on a commutative monoid. The idea is similar to that of weighted bisimulation of weighted automata [16], and akin to exact lumpability of Markov chains [17, 18], which is the special case in which labels are non-negative reals under addition; other instances of the same idea appear as equitable partitions of weighted graphs and their role in the spectral theory of graphs [4, 5] and, more recently, in the analysis of the expressive power of message-passing graph neural networks [19, 20], and as a tool for the lossless dimension reduction of linear programs [21]. What these approaches have in common is a partition-refinement algorithm [22]; what they lack is a common conceptual framework in which the objects being computed (bases and fibrations, rather than partitions) are first-class citizens, together with their universal properties. Providing such a framework is the purpose of this paper.
As an example of application, we show how the derived theory can be applied to the compression of arbitrary neural networks (including CNNs), providing a strong theoretical underpinning to the recent results in [2].
An equivalence relation (or partition) is said to be finer than an equivalence relation (or, equivalently, is coarser than ) if implies for all .
Graphs and graph morphisms. A graph is defined by , where is a set of nodes, is a set of arcs, and provide the source and target node of each arc; in this paper, we only consider finite graphs, i.e., graphs with a finite set of nodes and arcs. In the following, all subscripts are omitted when they are clear from the context.
We write for the set of arcs from to , i.e., , and extend this notation to sets of nodes by writing . We also use – instead of , so for instance is the set of arcs ending in .
A simple graph is a graph with no parallel arcs, i.e., such that for all .
A graph morphism is a pair of functions and such that the following diagrams commute:
A graph morphism is surjective (also called epimorphic) (injective, bijective, resp.) if both and are surjective (injective, bijective, resp.) functions.
3 M-graphs and M-fibrations
A (standard) graph fibration [1] is a graph morphism such that for every arc and node there exists a unique . This condition is extremely

G

H
Figure 1. Two graphs with labels on some monoid (for the moment, we do not specify the monoid operations). The underlying graph is the same, but the labelling is slightly different (in boldface, the labels that change).
rigid: while the whole theory of graph fibrations is very elegant and has many applications, it is not flexible enough to be applied to weighted or labelled neural networks, unless we just assume that morphisms simply preserve the labels/weights, which is usually something we don't want. In order to overcome this limitation, we introduce the notion of M-fibrations: let us start with the definition of M-graph.
Definition 3.1 (M-graph). Given a commutative monoid , an -graph is a graph together with a function that assigns a label in to each arc of .
From now on, M will always denote a commutative monoid (sometimes enjoying further properties). In Figure 1, you can see two (simple) M-graphs: the monoid M is intentionally left unspecified. Note that here the underlying graph is the same, but the labelling is not.
Definition 3.2 (M-fibration). An M-fibration is a graph morphism between two M-graphs such that for every and node we have
It is easy to see that standard graph fibrations are a special case of M-fibrations, where the monoid is and all arcs in both G and B have label 1. In this case, the condition for being an M-fibration reduces to the condition for being a standard graph fibration (the set over which the sum is taken must have exactly one element).
Some basic properties of M-fibrations are the following:
Proposition 3.1. 1. The composition of two M-fibrations is an M-fibration.
- A bijective M-fibration is an isomorphism of M-graphs (i.e., a bijective graph morphism that preserves the labels of arcs).
Proof. 1. Let and be two M-fibrations. Let and . Then we have:
- Let be a bijective M-fibration. Then for every and node we have
But since is bijective, there is exactly one node and the set has exactly one element, so the last formula reduces to .
4 Minimum base of an M-graph
The theory of graph fibrations [1] ensures that every graph has a minimum base, i.e., for every graph G there exists an epimorphic fibration whose base B is fibration prime (it cannot be fibred non-trivially), and B is unique up to isomorphism; moreover, all such minimal fibrations have the same node component (up to isomorphism of the base), although they may differ on arcs. In this section we prove that the same result holds for M-fibrations, in fact in a stronger form: since minimum bases turn out to be simple graphs, minimal M-fibrations are unique up to isomorphism.
Definition 4.1 (M-equitable partition). Given an M-graph G, an M-equitable partition of G is a partition of such that for every two nodes such that and every part we have
where is the total weight of the arcs from A to z. When we have an equitable partition, given two parts , we write for the common value of for all .
The following proposition shows that M-fibrations and M-equitable partitions are two sides of the same coin: given an M-fibration, the equivalence relation on nodes defined by the fibers of the fibration is an equitable partition, and given an equitable partition, the canonical projection to the quotient graph is an M-fibration.
Proposition 4.1. 1. Let be an epimorphic M-fibration: then the partition associated with the equivalence relation defined by if and only if is an M-equitable partition of G.
- Let be an M-equitable partition of G, and let be the simple M-graph obtained as the quotient of G by (its nodes are the parts of , and there is an arc , labelled by , if and only if ); let be the canonical projection to the quotient graph then is an epimorphic M-fibration.
Proof. 1. Let and let for some . Then, by definition,
The image under of each appearing in the last formula is an arc of starting from and ending in ; conversely, for every , every belongs to (its source is mapped to ). Hence the sets , for , partition , and we can rewrite the last formula factorizing by the image of under :
where the last equality follows from the definition of M-fibration. The last expression does not depend on but only on , so if we have , as desired.
- The only non-trivial part is proving that is an M-fibration. Let be an arc of and let . Then
which is the condition required for to be an M-fibration.
4
☐
The next lemma is crucial in proving the existence of a minimum base for M-fibrations.
Lemma 4.1. Let G be an M-graph. Then there exists a coarsest M-equitable partition of G, i.e., an M-equitable partition such that for every M-equitable partition of G we have is finer than .
Proof. We build a sequence of partitions of as follows: is the trivial partition with a single part , and for we define as the partition of whose parts are the equivalence classes of the relation defined by
This sequence of finer and finer partitions must eventually stabilize (because the set of nodes is finite), i.e., there exists such that (and hence for all , since depends only on ). Note that is -equitable: indeed, says precisely that for all whenever . We claim that is the coarsest -equitable partition of . Suppose that is an -equitable partition of . We prove by induction on that is finer than for all . The base case is trivial. Suppose that is finer than . Let be in the same part of ; then they are also in the same part of . Let be a part of : since is finer than , there are parts of such that (a disjoint union). Since is an -equitable partition and lie in the same part of , we have for every , whence
so are also in the same part of , and we conclude that is finer than . By induction, is finer than for all , and in particular it is finer than .
We are now ready to prove that every M-graph has a minimum base.
Definition 4.2 (M-fibration prime and minimal M-fibration). An M-graph G is M-fibration prime if every epimorphic M-fibration is an isomorphism. An M-fibration is minimal if it is epimorphic and H is M-fibration prime.
Note that every M-fibration prime graph is simple, i.e., it has no parallel arcs, because if G has two parallel arcs a, b from x to y, then G is non-trivially and epimorphically fibred onto the graph H obtained by merging the two arcs with a new arc labelled by (which may be 0: this is why labels are allowed to be 0).
As a consequence of the above results, we have the following theorem, which is the main result of this section (and the equivalent, in the context of M-fibrations, of the well-known result that every graph has a minimum base [1]):
Theorem 4.1. For every M-graph G, we have:
-
there exists a minimal M-fibration ;
-
B is unique up to isomorphism;
-
is unique up to composition with an isomorphism of B.
In the following, we call the minimum base of and the minimum -fibration of , and denote as and as .
We use the definite article, because of its uniqueness up to isomorphism.
Proof. 1. Let be the coarsest -equitable partition of , which exists by Lemma 4.1. Let be the quotient graph and let be the canonical projection onto the quotient graph. By Proposition 4.1 (2), is an epimorphic -fibration. We claim that is -fibration prime. Suppose that is an epimorphic -fibration. Then, by Proposition 3.1 (1), is an epimorphic -fibration, and by Proposition 4.1 (1), it induces an -equitable partition of . The parts of this partition are unions of parts of (the fibres of are unions of fibres of ), so it is coarser than ; but is the coarsest -equitable partition of , so the two partitions coincide, and is injective (hence, being epimorphic, bijective) on nodes. It is then also a bijection on arcs: it is surjective by hypothesis, and if then and have the same source and the same target (by injectivity on nodes), so because is simple. Thus is a bijective -fibration, hence an isomorphism by Proposition 3.1 (2). So we conclude that is -fibration prime.
2 Suppose is a minimal -fibration, and let be the -equitable partition of induced by . Since is the coarsest -equitable partition of , we have that is finer than . Define by for any : this definition is well-posed because if , then , and since is finer than , we have , so . Both and are simple ( because it is -fibration prime, by construction), so extends to arcs as follows: if is the arc of from to , pick (which exists because is epimorphic); then goes from a node of to a node of , so and has an arc from to : we let be this arc. By construction is a graph morphism with , and it is epimorphic: on nodes because is, and on arcs because every arc of is of the form for some .
We now show that is an -fibration. Let be the arc of from to (recall that the nodes of are the parts of , so and as sets of nodes of ), and let ; fix , so that . Since is simple, the arcs of ending in that are mapped by to are exactly the arcs of with . For every such arc, the set of arcs of ending in and mapped by to is , so the -fibration condition for reads . On the other hand, if but has no arc from to , then (an arc from to would be mapped by to an arc from to ), so . Therefore
where we used that the sets , for , partition , and that . This is precisely the condition for to be an M-fibration.
Hence is an epimorphic -fibration; since is -fibration prime, is an isomorphism, which proves 2.
- With the notation above, gives : every minimal -fibration of is obtained from the canonical projection by composition with an isomorphism of its base, and any two minimal -fibrations differ by an isomorphism between their bases.
In Figure 2 we show the minimum base of one of the graphs in Figure 1, when the monoid is (left) or (right). Note that the two minimum bases are different, because the two monoids are different. In both cases, as expected, the minimum base is a simple graph, because

Figure 2. The minimum base of the graph in Figure 1, when the monoid is (left) or (right). We have named each node of with the corresponding part of the coarsest equitable partition of . The only difference between the two minimum bases is the label of the arc from to , which is : in this gives , while in it gives .

Figure 3. The minimum base of the graph in Figure 1, when the monoid is . Again, we have named each node of with the corresponding part of the coarsest equitable partition of . The reason why is different from (see Figure 2, left) is that 0 and 1 cannot be merged (because the two opposite arcs have different labels (5 and 6, instead of 5 in the two directions), and furthermore the arcs coming from 3 and 4 also have different labels and 9, respectively)). Nodes 3 and 4 are merged because the arcs coming from 2 have the same label 30.
every non-simple M-graph is epimorphically fibred onto a simple M-graph obtained by merging parallel arcs.
Conversely, the graph H in Figure 1, which differs from G only in two labels, has a different minimum base, shown in Figure 3: the minimum base is sensitive to every label, and a small change of the labels can change it substantially (this is the starting point of Section 6).
It is worth noting that the proof of Theorem 4.1 is constructive: it provides a simple algorithm to compute the minimum base of an M-graph, by iteratively refining the partition of nodes until it stabilizes. A naive implementation runs in time ; using the “process the smaller half” technique of Paige and Tarjan [22], and assuming that equality in M is decidable in constant time, one obtains , as done for (Markov-chain lumping) in [23]; for standard colour refinement, i.e., , this bound is known to be tight [24].
As we observed, the minimum base of an M-graph is always a simple graph, even if the original graph has parallel arcs. This may seem to contradict the fact that the minimum base of a standard graph fibration may have parallel arcs, but this is not the case: if a standard graph fibration has parallel arcs, then the minimum base is obtained by merging them into a single arc with label equal to the number of merged arcs, which is exactly what happens in the case of M-fibrations with . Another interesting property is that the minimum M-fibration is unique (up to isomorphism of the base), while the minimal fibrations of a standard graph may not be unique (even up to isomorphism of the base), because different minimal fibrations may differ on parallel arcs.
5 Properties of the minimum base of an M-graph and pullbacks
One further property of the minimum base of an M-graph is the following:
G:
H:
B:
:


Figure 4. Top: the M-graphs of Example 5.1. Labels: , , , ; moreover and . Bottom: the cone over the cospan .
Theorem 5.1. For every M-graph G, if is an epimorphic M-fibration, then there is an epimorphic M-fibration such that ; furthermore is isomorphic to .
Proof. The construction of in the proof of Theorem 4.1 (2) never used the fact that is prime, only that it is simple: hence, given an epimorphic -fibration , apply it to (an epimorphic -fibration onto a simple graph, by Proposition 3.1) to get an epimorphic -fibration with ; then is the required fibration. Moreover is an epimorphic -fibration out of the -fibration prime graph , hence an isomorphism .
Now all the properties proved about M-fibrations and minimum bases are analogous to (and in fact proper generalizations of) the properties of standard graph fibrations and minimum bases. But the proofs in [1] follow a different approach, based on the notion of universal total graphs (which arise from a right adjoint, and depend on the unique lifting of paths) and on the fact that fibrations are preserved by pullbacks. Unfortunately, this route is not available in the case of M-fibrations: unique path lifting fails (an arc labelled 2 may lift to two arcs labelled 1), and with it the universal property of universal total graphs (Example 5.2); moreover, the category of M-graphs and M-fibrations does not have pullbacks, in general (Example 5.1).
Example 5.1. Let and consider the M-graphs of Figure 4: has nodes and one arc : labelled 2; has nodes and two arcs : labelled 1; is isomorphic to , but its nodes are called and its arcs : , again labelled 1. The morphisms ( , , ) and (analogously) are M-fibrations. A cone over this cospan is an M-graph with two M-fibrations and such that ; a morphism of cones is itself an M-fibration with and ; a pullback of the cospan is a terminal cone. Commutation forces every node of to lie over or over (i.e., to be mapped by to or to , respectively), and every arc of to go from a node over to a node over , being mapped to some by and to some by . For a node of over let
the total in-weight of along arcs lying over . The -fibration condition for at and reads , and the one for at and reads ; hence, the matrix is
Conversely, for every the -graph of Figure 4 (nodes over and over , arcs with , , and labels , ) is a cone with : both fibration conditions hold at , and there is nothing to check at .
Now let be a morphism of cones and a node of over . Every arc with and is mapped by to an arc with and , and the -fibration condition for says that is the sum of the labels of the arcs of mapped to ; summing over all such we obtain , that is, morphisms of cones preserve the matrix . Hence, if a pullback existed, the images in of the nodes of the cones , would be pairwise distinct (they have distinct matrices): as a consequence, would have uncountably many nodes. No finite (not even countable) pullback exists.
Note that in the standard case (all labels equal to 1) unique lifting makes the fibres of each arc singletons, so the matrix is and forced to be (1): this is why the pullback of the underlying graphs is a pullback of standard fibrations (see [1, Theorem 6.1], which proves even more), and why the argument above needs labels different from 1; the obstruction is the non-uniqueness of the matrices , not their existence.
Example 5.2. The graphs B and G of Figure 4 also show that universal total graphs [1, Sect. 3] lose their universal property; note that here it suffices to take . Recall that the universal total graph of a graph at a node x is the in-tree of all paths ending in x, fibred onto the graph in the obvious way; its universal property [1, Thm. 3.1] states that for every fibration and every node y of H over x there is exactly one fibration from the universal total graph of B at x to H sending the root to y; in particular, the universal total graphs of B at x and of H at y are isomorphic. For M-graphs the same construction (copying the labels) still yields an M-fibration, but the universal property fails: B and G are in-trees, and each is its own universal total graph at and at , respectively; yet there is no M-fibration with (the arc would have to be mapped to or to , and the fibration condition at for the other arc would read ), and . What survives is the fact that the two in-trees are bisimilar as weighted transition systems, and indeed the whole theory of Section 4 can be seen as a theory of weighted bisimilarity of unfoldings; we shall not pursue this point of view here.
6 -approximate M-fibrations
We want to move on to study approximate versions of M-fibrations, which are relevant in applications where we tolerate that the fibration condition may hold only approximately. We first need to have a measure of distance between elements of the monoid:
Definition 6.1. A metric monoid is given by a commutative monoid and a metric on such that for all we have .
By the triangular inequality, we have
and this extends to finite sums: this property is called sum-subadditivity.
Now, we can measure how much a morphism of M-graphs fails to be an M-fibration:
Definition 6.2 (Approximate M-fibration). Given a metric monoid , an -graph , and a morphism of -graphs , for every arc of and every node we define the local fibration error of at as
The global fibration error of is then defined as
A morphism is an -approximate M-fibration if .
It is immediate to observe that if and only if is an M-fibration (all local errors are zero). Moreover, global fibration error is subadditive with respect to composition of morphisms:
Proposition 6.1. If and are morphisms of M-graphs, then .
We can also define how far is a pair of graphs from being linked by an epimorphic M-fibration:
Definition 6.3 (Fibration distance). We define the fibration distance between G and H as
Moreover, we define the function as
The fd function is a quasi-metric in the sense of Lawvere: and if and only if can be epimorphically fibred over . Furthermore, . But is not symmetric, hence it is not a metric.
The function , in mundane words, says how much you can compress with an approximate fibration if you allow for an error of at most . It is non-increasing (if you allow for more error, you can compress more), and (the number of nodes of the minimum base of ). Moreover, for sufficiently large , (the trivial graph with one node and one loop labelled with 0 is an -approximate fibration of any graph, for sufficiently large : you just take to be the maximum sum of incoming labels over all the nodes of ).
The function expresses the trade-off between compression and error, and it is a natural object of study in applications.

Figure 5. An example showing that there is no coarsest -approximate M-equitable partition.
7 -approximate M-equitable partitions
Like in the exact case, we can draw a parallel between -approximate -fibrations and -approximate -equitable partitions. To define them, let us first observe that in a metric monoid we can define a distance between vectors of elements of of the same length: for , , we define . This is a metric on and it is sum-subadditive with respect to the componentwise sum of vectors. We use the same notation for this metric on vectors, and we write for the vector of length whose components are all 0.
Definition 7.1 (Approximate M-equitable partition). Given a metric monoid , an M-graph G, and a partition of with p parts, define the vector of local in-weights of a node x as
A vector is a center of radius for the part iff for all . The inequity of , , is the minimum value such that there exists a center of radius for every part of . We say that is an -approximate -equitable partition if .
Note that is a 0-approximate -equitable partition if and only if there are centers of radius 0 for all parts. The existence of a center of radius 0 for a part is equivalent to the existence of a vector such that for all , which precisely means that for all , i.e., that is an exact -equitable partition. Hence, the notion of -approximate -equitable partition is indeed a generalization of the notion of -equitable partition.
There is an obvious parallel between -approximate M-fibrations and -approximate M-equitable partitions (the analogue of Proposition 4.1); we state it without proof:
Proposition 7.1. 1. Let be an epimorphic -approximate M-fibration: then the partition associated with the equivalence relation defined by if and only if is an -approximate M-equitable partition of G.
- Let be an -approximate M-equitable partition of , and let be the simple M-graph obtained as the quotient of by (its nodes are the parts of , and there is an arc , labelled by , if and only if ); let be the canonical projection to the quotient graph then is an epimorphic -approximate M-fibration.
It is useful to observe that computing is equivalent to computing an -approximate M-equitable partition of with the minimum number of classes. Observe that for , there is no coarsest -approximate M-equitable partition, as the following counterexample shows.
Example 7.1. Consider the graph G in Figure 5, with the monoid and the Euclidean distance. Clearly because G itself is fibration prime (all input weights are distinct). Let us find the inequity of all non-trivial partitions leaving alone: , , , ; mixing with other nodes produces an inequity of 4.5. Hence, for , there are two -approximate -equitable partitions of producing non-isomorphic quotient -graphs (the labels on the arcs will be different, and node will be mapped to different nodes of the quotient graphs). The actual values of are:
Finding an -approximate M-equitable partition of G with the minimum number of classes is a difficult problem: it is an optimization problem, which can be formulated as a MILP, but we conjecture it to be NP-hard. We leave the study of this conjecture to future work.
We can overcome this difficulty by considering a greedy algorithm that iteratively refines the partition of nodes until it stabilizes, as in the exact case. The difference is that now we have to check whether two nodes are -approximately equivalent. This is what Algorithm 1 does: it computes an -approximate M-equitable partition of G, and returns the centers of the parts. Centers can be computed in different ways, depending on the monoid we are working with. One approach that works regardless of the monoid is to take any vector as center, or to take the Chebyshev center (the vector that minimizes the maximum distance from the vectors of the part); the latter solution makes the computation quadratic.
The algorithm is greedy, and it may not return a partition with the minimum number of classes, but it is guaranteed to return a partition with radius at most for each class. The algorithm is a generalization of the one in [23], which is the case and ctr is the mean.
The nodes and arcs of the -approximate minimum base are obtained by the -approximate equitable partition coming from Algorithm 1 (parts are the nodes, an arc is present from C to D if and only if ), like the exact case. For the labels, though, we use the centers of the parts: the label of the arc is the C-component of the center of D.
The -approximate minimum base is not unique, because the centers of the parts are not unique. Once the partition has been computed, though, the number of nodes of the resulting base does not depend on the choice of the centers; the partition itself, however, may depend on the center rule adopted (see Example 7.2).
Example 7.2. Let us try to use Algorithm 1 to compute an -approximate M-equitable partition of the M-graph H of Figure 1, with and . We use the coordinatewise mean as center rule.
We start with the trivial partition and we compute the local in-weights of the nodes: , , , , . The first seed is 0, and the candidate set is ; the center is computed as (the average between (14) and (16)). No node is added to the candidate set. The other class that is created in the split is (they literally share the same vector). So we have a new partition , which is different from the previous one, and we continue. The new vectors are , , , , . The first seed is 0, and the candidate set is ; the center computed this time is (the average between (6,0,10) and (5,0,9)). Proceeding this way, we will in fact not split any further, so the algorithm
Algorithm 1 Certified ε-equitable partition (tolerant refinement, epsilon_partition)
Require: M-graph G over a metric monoid ; ; a center rule ctr mapping a finite family of vectors of to a vector of (e.g., the coordinatewise mean, the Chebyshev center, or anyone of the vectors)
1: ▷ trivial partition
2: repeat
3: for every node :
4:
5: for each class do
6:
7: while do
8: a seed in (the first time: any node; afterwards: the one farthest from the previous seed)
9: ▷ candidates
10:
11: while do
12: remove from the node farthest from
13:
14: end while
15: ▷ absorb
16: add the group , with center , to
17:
18: end while
19: end for
20: if then break
21: end if
22:
23: until false
24: return with its centers ▷ every class has radius w.r.t. its own aggregated vectors
terminates with the -approximate -equitable partition , with centers , , and . The resulting base is shown in Figure 6: the nodes are the parts of the partition, and the arc from part to part (present iff has an arc from to ) is labelled by the -th component of the center of .
An exhaustive search shows that the algorithm (when using coordinatewise mean) produces a base with 4 nodes when , 3 nodes when , and 1 node when . The actual function is 4 in , 3 in and 1 when . This comparison shows that the algorithm is not optimal in the interval , but it is optimal in the other two intervals; using the exact Chebyshev center as center rule, instead, the algorithm attains for every . Note that never takes the value 2: the best partition with two parts, , , has inequity 13, larger than the inequity 12 of the trivial partition — the smallest feasible is not monotone in the number of parts.

Figure 6. The -approximate base of the graph in Figure 1 produced by Algorithm 1, when the monoid is , and we are using the coordinatewise mean as center rule (here it is in fact a smallest -approximate base: no -equitable partition with two parts exists). Observe that if we were using the monoid instead, we could not apply the coordinatewise mean as center rule (division is not defined in ); using the Chebyshev center with integer coordinates, instead, we would get or (both at distance 1 from and ), whereas and would be unchanged.
8 Application: compression of neural networks
Fibrations embed a notion of symmetry in a graph: two nodes that can be fibred together, receive the same input from the same (or equivalent) sources. This notion of symmetry can be fruitfully applied to compress neural networks: two neurons that are equivalent in this sense can be merged into one, and the weights of the incoming arcs can be summed. This idea was introduced in [2]: here we show the mathematical foundations of this approach. The fact that we are using general monoids allows us to treat different types of neural networks, including convolutional neural networks.
Let us briefly describe how a neural network can be represented as an M-graph, using the well-known MNIST classification dataset as reference [25].
In a simple multilayer perceptron (MLP), the translation is quite simple: the nodes of the graph are the neurons, and the arcs are the synaptic connections between them. The weights on the arcs are the synaptic weights, so the natural monoid is . In fact, it is convenient to add explicitly a bias node and to introduce a normalization factor that is different at each layer, so that the distances between the in-weights of the neurons are comparable across layers. Details are given in the caption of Figure 7.
In a convolutional neural network (CNN), it is convenient to represent the network as a graph where the nodes are the channels of the network, and the arcs are the convolutional kernels that connect them. The weights on the arcs are kernels of appropriate sizes. A detailed explanation is given in the caption of Figure 8.
9 Experimental results
For our experiments of neural network compression, we used three trained networks: two for the MNIST dataset (the LeNet-300-100 MLP and LeNet-5 CNN architectures) and one for the CIFAR-10 dataset [26]. The compression was done post-training, so it is not comparable to the method described in [2]. This time, we simply converted the trained networks into M-graphs, and then we applied our -approximate M-fibration algorithm (Algorithm 1) to compress them, and then finally re-converted the compressed graphs back into neural networks, and tried them on the test set to measure their performance. The results are summarized in Table 1, and represented in Figure 9.
For these networks, we observed a phase transition in the accuracy of the compressed networks:
(a) The MLP network: four fully-connected layers, every unit carries one number

(b) The M-graph: one node per unit plus a bias node, one arc per nonzero weight.

Figure 7. LeNet-300-100 [25], an MLP neural network for the MNIST classification problem. Above, the usual representation: here, layers are fully connected. When represented as an M-graph, weights live on the arcs (we added a bias node, to spread biases to the layers), and input and output layers are frozen (their units cannot be merged during the process). Instead of working on , it is more convenient to use so that distances are measured differently on each layer: explicitly, we can define where is the median distance between the total in-weights of the nodes of layer : this way, we can normalize distances across layers when the actual weights vary significantly. Merging a class is the quotient construction: in-weights center, out-weights fibre sums.
(a) The CNN network: a pile of same-sized arrays at every stage

(b) The M-graph: one node per channel/unit (a sheet of the pile), one arc per kernel or weight

Figure 8. LeNet-5-style [25] CNN for the MNIST classification problem. Above, the usual representation. Here , using -distance on each component (with per-layer scale, like in the case of the MLP). Pooling is not in the graph: it acts inside a channel (spatially), and the pixel-level graph fibres exactly onto this one.

Figure 9. Fraction of surviving units (circles) and test accuracy (squares) of the compressed networks as a function of , for the three networks of Table 1; the dotted line is the accuracy of the uncompressed network, and the shaded band contains the phase transition.
for small values of , the accuracy remains almost unchanged, and the size (in number of units and parameters) decreases, but when reaches a critical value (between 0.35 and 0.5 in all three cases), the accuracy drops dramatically.
The sharp transition is a property of the certified, worst-case criterion, not of the networks: heuristics that cluster units by tight (complete-linkage) groups instead of filling the defect budget of every node, and choosing as representative not a metric center but the mean or the least-squares solution, trade the guarantee for a smooth, gracefully degrading accuracy-versus-size curve. These ad hoc heuristics, although interesting in practice, fall beyond the scope of this paper, which is focused on the theoretical foundations of the method.
| network | units | parameters | accuracy | |
|---|---|---|---|---|
| MLP | 0 | 400 (100%) | 267k (100%) | 97.76% |
| 0.4 | 305 (76%) | 210k (79%) | 97.53% | |
| 0.5 | 169 (42%) | 121k (45%) | 79.6% | |
| CNN | 0 | 176 (100%) | 80.2k (100%) | 99.09% |
| 0.4 | 166 (94%) | 74.7k (93%) | 98.89% | |
| 0.5 | 18 (10%) | 2.1k (2.6%) | 14.7% | |
| VGG16-BN | 0 | 5248 (100%) | 15.25M (100%) | 94.16% |
| 0.30 | 3610 (69%) | 8.38M (55%) | 91.53% | |
| 0.35 | 3233 (62%) | 6.75M (44%) | 90.18% | |
| 0.40 | 2493 (48%) | 4.32M (28%) | 10.0% |
Table 1. Certified -approximate -fibrations.
10 Reproducibility
For reproducibility, we provide a self-contained Python library that implements the algorithms described in this paper; furthermore, the library contains a script that is able to take any ONNX neural network and compress it using the -approximate -fibration algorithm, testing it for accuracy and reporting the results. The library is available at https://github.com/boldip/mfib.
11 Conclusions
We introduced a general framework to study fibrations of weighted graphs, and we proved that the minimum base of a weighted graph is unique up to isomorphism. We also introduced the notion of -approximate fibration, and we showed that it can be used to compress neural networks.
Acknowledgement
We thank Hernán Makse, Ian Stewart and Sebastiano Vigna for many fruitful discussions on the topic of this paper.
References
[1] P. Boldi and S. Vigna, "Fibrations of graphs," Discrete Math., vol. 243, pp. 21–66, 2002.
[2] O. M. Velarde, L. C. Parra, P. Boldi, and H. A. Makse, “The role of fibration symmetries in geometric deep learning,” Proc. Natl. Acad. Sci. USA, vol. 123, no. 4, p. e2416552123, 2026.
[3] A. Grothendieck, “Technique de descente et théorèmes d’existence en géométrie algébrique, I. Généralités. Descente par morphismes fidèlement plats,” in Séminaire Bourbaki, Vol. 5, Exp. No. 190. Société Mathématique de France, 1959–1960, pp. 299–327.
[4] A. J. Schwenk, “Computing the characteristic polynomial of a graph,” in Graphs and Combinatorics, ser. Lecture Notes in Mathematics, R. A. Bari and F. Harary, Eds. Springer, 1974, vol. 406, pp. 153–172.
[5] C. Godsil and G. Royle, Algebraic Graph Theory, ser. Graduate Texts in Mathematics. Springer, 2001, vol. 207.
[6] B. Weisfeiler and A. Leman, “The reduction of a graph to canonical form and the algebra which appears therein,” Nauchno-Technicheskaya Informatsia, vol. 2, no. 9, pp. 12–16, 1968, english translation by G. Ryabov.
[7] D. G. Corneil and C. C. Gotlieb, “An efficient algorithm for graph isomorphism,” J. ACM, vol. 17, no. 1, pp. 51–64, 1970.
[8] M. Golubitsky and I. Stewart, Dynamics and Bifurcation in Networks: Theory and Applications of Coupled Differential Equations. Philadelphia: SIAM, 2023.
[9] G. A. D. Luna and G. Viglietta, “Optimal computation in anonymous dynamic networks,” J. ACM, 2026, to appear; preliminary version in Proc. STOC 2023.
[10] M. Golubitsky, I. Stewart, and A. Török, “Patterns of synchrony in coupled cell networks with multiple arrows,” SIAM J. Appl. Dyn. Syst., vol. 4, no. 1, pp. 78–100, 2005.
[11] R. Joly, "Generic balanced synchrony patterns in network dynamics," 2025, arXiv:2510.08187.
[12] F. Morone, I. Leifer, and H. A. Makse, “Fibration symmetries uncover the building blocks of biological networks,” Proc. Natl. Acad. Sci. USA, vol. 117, no. 15, pp. 8306–8314, 2020.
[13] I. Stewart, S. D. S. Reis, and H. A. Makse, “Dynamics and bifurcations in genetic circuits with fibration symmetries,” J. R. Soc. Interface, vol. 21, no. 217, p. 20240386, 2024.
[14] H. A. Makse, P. Boldi, F. Sorrentino, and I. Stewart, Symmetries of living systems: Symmetry fibrations and synchronization in biological networks. Cambridge University Press, 2027, in press; arXiv preprint arXiv:2502.18713.
[15] P. Boldi, I. Leifer, and H. A. Makse, “Quasifibrations of graphs to find symmetries in biological networks,” J. Stat. Mech., vol. 2022, no. 8, p. 083401, 2022.
[16] P. Buchholz, “Bisimulation relations for weighted automata,” Theoret. Comput. Sci., vol. 393, no. 1–3, pp. 109–123, 2008.
[17] J. G. Kemeny and J. L. Snell, Finite Markov Chains. Springer, 1976.
[18] P. Buchholz, “Exact and ordinary lumpability in finite Markov chains,” J. Appl. Probab., vol. 31, no. 1, pp. 59–75, 1994.
[19] C. Morris, M. Ritzert, M. Fey, W. L. Hamilton, J. E. Lenssen, G. Rattan, and M. Grohe, "Weisfeiler and Leman go neural: higher-order graph neural networks," in Proc. 33rd AAAI Conference on Artificial Intelligence, 2019, pp. 4602–4609.
[20] K. Xu, W. Hu, J. Leskovec, and S. Jegelka, “How powerful are graph neural networks?” in Proc. 7th International Conference on Learning Representations (ICLR), 2019.
[21] M. Grohe, K. Kersting, M. Mladenov, and E. Selman, “Dimension reduction via colour refinement,” in Algorithms – ESA 2014, ser. Lecture Notes in Computer Science, vol. 8737. Springer, 2014, pp. 505–516.
[22] R. Paige and R. E. Tarjan, “Three partition refinement algorithms,” SIAM J. Comput., vol. 16, no. 6, pp. 973–989, 1987.
[23] A. Valmari and G. Franceschinis, “Simple time Markov chain lumping,” in Tools and Algorithms for the Construction and Analysis of Systems (TACAS 2010), ser. Lecture Notes in Computer Science, vol. 6015. Springer, 2010, pp. 38–52.
[24] C. Berkholz, P. Bonsma, and M. Grohe, “Tight lower and upper bounds for the complexity of canonical colour refinement,” Theory Comput. Syst., vol. 60, no. 4, pp. 581–614, 2017.
[25] Y. LeCun, L. Bottou, Y. Bengio, and P. Haffner, “Gradient-based learning applied to document recognition,” Proc. IEEE, vol. 86, no. 11, pp. 2278–2324, 1998.
[26] A. Krizhevsky, “Learning multiple layers of features from tiny images,” University of Toronto, Tech. Rep., 2009, technical Report; https://www.cs.toronto.edu/~kriz/cifar.html.