Beyond topological persistence: Starting from networks

Nowadays, data generation, representation and analysis occupy central roles in human society. Therefore, it is necessary to develop frameworks of analysis able of adapting to diverse data structures with minimal effort, much as guaranteeing robustness and stability. While topological persistence allows to swiftly study simplicial complexes paired with continuous functions, we propose a new theory of persistence that is easily generalizable to categories other than topological spaces and functors other than homology. Thus, in this framework, it is possible to study complex objects such as networks and quivers without the need of auxiliary topological constructions. We define persistence functions by directly considering relevant features (even discrete) of the objects of the category of interest, while maintaining the properties of topological persistence and persistent homology that are essential for a robust, stable and agile data analysis.


Introduction
Data generation and analysis are becoming central in our society. Therefore, it is necessary to develop novel and interpretable strategies for data representation and classification. Such strategies should be capable of adapting to the diversity of modern data structures, deal with local and global properties of a dataset and be endowed with provable properties.
In recent years, topological data analysis and topological persistence proved to be an extremely effective and flexible theory, finding application in several analytical and classification tasks [14]. In pattern recognition, the topological approach allowed to convey the concept of shape in a more natural way, as a suitable choice of topological spaces and continuous filtering functions. "Size functions" (later "persistent 0-Betti numbers") were the fundamental tool used in the first applications [18,16,15]. Not much later, persistent homology was conceived for deducing the true topology of sampled objects [31,13].
However, topological persistence is categorically limited. Indeed, in order to study a dataset via persistent homology, it is first necessary to represent data points as simplicial complexes. Thereafter, relevant features of the data (maybe originally discrete) have to be represented as continuous functions defined on the auxiliary simplicial complex built before. We propose a generalized theory of persistence that is free of the need of auxiliary topological constructions, and allows for the usage of functors other than homology, while preserving the flexibility of the topological approach. At the same time, this generalized framework gives the possibility to directly work with discrete features; this option is fundamental when dealing, for instance, with combinatorial objects. This is done, in the present paper, by defining persistence functions as a generalization of persistent Betti number functions.
We are aware of the recent categorical generalizations of persistence [3,24,26,11]. Nonetheless, they seem to be rather far from the agile tool for applications we want to make available to the scientific community. In particular, we think that emergent research fields in which data can naturally be represented as objects of a discrete category deserve a dedicated persistence theory, not necessarily mediated by either complexes or homology (e.g. weighted graphs as social and neural networks [12,23]).
An open source implementation of the algorithms for the computation of persistence in the category of weighted graphs is available as a Python package (see net persistence on GitLab). There, we provide basic classes for the description of weighted graphs, the computation of persistence diagrams and the scripts to reproduce computationally heavy examples.
The paper is organized as follows. In Section 2 we delineate the categorical framework within which our generalization can be performed. First, we discuss the necessary hypotheses needed for a category to be suitable for the definition of generalized persistence. Subsequently, we probe the flexibility of the aforementioned categorical framework by extending it to functor categories such as Quiver and SimpSet. In Section 3 we define persistence functions and prove the validity in our framework of the main constructs and results in classical persistent homology (e.g. persistence diagram and stability, respectively). In the same section, we provide two general recipes for the construction of persistence functions in our framework. These constructions are then utilized in Section 4, where graph-theoretical concepts such as blocks, edge-blocks, clique communities and Eulerian subgraphs are used to define persistence functions on simple weighted graphs. Finally, in Section 5 we show under which assumptions on a given category it is possible to construct a coherent sampling from a generalized notion of connected components. This is a natural generalization of the block construction built previously in the case of weighted graphs.

Categorical foundations
The first natural step to be taken to generalize the notion of persistence to arbitrary categories, while maintaining the structure and properties of the classical approach, is to identify a set of requirements that make a category suitable for the definition of filtered objects. In Section 2.1, we will specify these assumptions and ensure that they are verified in commonly used categories (e.g. topological spaces, graphs, simplicial complexes, groups et cetera). Thereafter, in Section 2.2, we will describe a procedure to obtain categories that satisfy these requirements.

Concrete categories
We recall that a concrete category [25,Sect. I.7] is a pair (C, U) where C is a category and U is a faithful functor U : C → Set.
For each object X ∈ C, we define the category C X of subobjects (in the sense of [25,Sect.V.7]) to have as objects all subobjects S φ − → X. Given S φ − → X and T χ − → X in C X , we define the morphisms between them to be all monomorphisms S ψ − → T such that the following diagram commutes: For a subset Z ι − → U(X), we can consider subobjects S A monomorphism can be expressed in terms of pullbacks, i.e. X φ − → Y is a monomorphism if and only if the following diagram is a pullback: As a consequence, all pullback-preserving functors (for example right adjoints) also preserve monomorphisms. So if (C, U) has canonical subobjects, then for every monomorphism φ of C, U(φ) is an injective function.
Remark 2. Given a subset Z ⊆ U(X), if Z has an associated canonical subobject U υ − → X, then U(υ)(U(U )) = Z. Moreover U υ − → X is unique up to a canonical isomorphism, as it is determined by a universal property.
The following proposition will prove that, given a canonical subobject U υ − → X, a subobject T τ − → X is also a subobject of U if and only if the subset of U(X) associated to T is included in the subset associated to U . Proposition 1. Given C, Z ⊆ U(X) and U υ − → X as in definition 1, υ induces an equivalence of categories between C U and C X Z .
Proof. Let us call I the functor from C U to C X Z induced by υ.
given by the terminal object property of U in the C X Z category. σ is a morphism of C X , therefore, by the commutativity of diagram (1), we have υ • σ = φ. Point 3 of Definition 1 allows us to generalize the previous proposition to morphism Y χ − → X that are not necessarily monic.
Furthermore, every morphism Y χ − → X admits a unique canonical factorization up to natural isomorphism.
Examples Let us investigate in which concrete categories these assumptions are verified, starting with the preservation of pullbacks. This is automatically true in all categories where the forgetful functor is the right adjoint of the free functor, which is the case in many classical concrete categories (topological spaces, groups, rings, vector spaces, etc...). It is also automatically true in all concrete categories where the forgetful functor is representable (i.e. of the type U(X) = Hom(A, X) as Hom(A, −) preserves arbitrary limits).
An interesting case are simplicial complexes of dimension at most n, which we denote Simp n (the relevant case for this paper is the category Graph which we recover with n = 1). In this case, we will use a functor that is a disjoint union (or, in categorical terms, coproduct) of representable functors: where S i is the standard simplex of dimension i. In other words, we associate to each simplicial complex X the set of simplicial maps from the standard simplices of dimension at most n to X. Representable functors preserve limits and coproducts commute with pullbacks in Sets, so this functor also preserves pullbacks.
Remark 3. The pullback-preserving hypothesis and even the weaker monomorphism hypothesis are however non-trivial and we can easily build a counterexample. Let us consider a non-injective map between two distinct sets X φ − → Y : We can create a category C whose objects are sets and whose morphisms are the identities and X φ − → Y . X φ − → Y is a monomorphism in C but by construction is not a monomorphism as a map of sets.
The second assumption of Def. 1 is trivially true in all categories where a subset identifies uniquely a subobject (e.g. graphs, simplicial complexes, groups, rings, etc.). It is also verified in categories where a subset has a canonical structure (e.g. topological spaces, where the canonical structure is given by the subspace topology).
The third assumption also trivially applies to all categories where there is a concept of "image" of a map (e.g. groups, rings, topological spaces, vector spaces, graphs, simplicial complexes). Indeed, in these type of categories, a morphism can be factored into an epimorphism onto the image, which in turn is included monomorphically in the codomain.
Filtrations Let R be the poset category of the real numbers. Adapting from [24], we define a filtration in C to be a functor F :R→ C such that if u < v, then F(u) is a subobject of F(v). In other words, we ask F to be monomorphismpreserving.

Proposition 3.
Let (X, f ) be a pair such that X ∈ Obj(C) and f : U(X) → R is an inferiorly bounded function such that for any t ∈ R there is at least one   [24]. For an intuition see Fig. 1, where a topological sphere is filtered by considering level sets interleaved with respect to the critical points of the height function.
Assumption 1. From now on, all pairs (X, f ) will be such that X ∈ Obj(C) and f : U(X) → R is a bounded function such that for any t ∈ R there is at least one subobject X t χt − → X with U(X t ) = f −1 (−∞, t] . The filtrations F (X,f ) and S (X,f ) will be the ones granted by Prop. 3.

Functor categories
The set up from the previous section generalizes quite nicely to functor categories. Let D be a small category [34, Ch. 1, Sect. 1] and (C, U) be a concrete category respecting the assumptions from definition (1). We can define F = Fun(D, C), the category of functors from D to C.
Canonical subobjects First we prove that F has canonical subobjects.  Filtrations Furthermore, if C has small coproducts, then filtrations in C can be used to construct filtrations in F.
A key ingredient for this will be a generalization of Yoneda's lemma. Given d ∈ Obj(D) and X ∈ Obj(C) we can build Φ X,d ∈ Fun(D, C) as follows: That is to say, we associate to d 1 as many "disjoint copies" of X as morphisms from d to d 1 .
Given a morphism d 1 l − → d 2 , we need to define a map from X. To do so, we simply send each X corresponding to a given h to the X corresponding to l • h. Due to the universal property of the coproduct, this defines a unique map Φ X,d (l).

Lemma 2.
Let D be a small category and C be a category with small coproducts.
In the case where C is Set and X is a point, this corresponds to the well known Yoneda lemma.
Proposition 5. Let (C, U) be a concrete category with small coproducts and canonical subobjects and F = Fun(D, C). Given an object d ∈ Obj(D) and a functor F ∈ F, a filtration of subobjects X t → F (d) naturally induces a filtration of subobjects of F .
Proof. By using lemma 2, we can construct a family of natural transformations Φ Xt,d → F . The canonical subobjects associated to each Φ Xt,d → F via the canonical factorization are a filtration of subobjects of F .
Examples This generalization has many interesting applications even in the simple case where C = Set. In that case, our result means that, for each category A the category of presheaves Fun(A op , Set) has canonical subobjects. Particular cases of that include Quiver and SimpSet (the category of oriented multigraphs and simplicial sets respectively), which can be seen as a categorical analogue of Graph and Simp. Furthermore, given an object X ∈ A and a presheaf F ∈ Fun(A op , Set), a filtration of subsets of F (X) induces a filtration of subobjects of F . This is a generalization of the procedure used to create a filtration of subgraphs of a weighted graph (the weight function induces a filtration of subsets of the edges) to arbitrary categories of presheaves.
A separate class of particular cases of this construction comes from the scenario where D is very simple (i.e., the Kronecker category, or free quiver, with two objects and two non-trival morphism from one to the other). In this case C = Top gives the category of topological quivers: we obtain the result that a filtration on the edge space of a topological quiver (i.e. a regular filtration on a topological space) extends to a filtration of the topological quiver.

Persistence functions
Those properties of homology cycles which yield the classical structure (and good properties) of persistence diagrams can and should be required in the much more general framework of concrete categories. We first generalize filtrations to this setting, then recall the propositions of a paper appeared in [20]-translated to the new framework-which grant the wished structure to persistence diagrams. A similar translation from another paper [10] deals with their stability. Sections 3.1 and 3.2 describe two frames of reference for the construction of persistence functions, which will be used for the examples of Section 4.
We are now ready for giving the generalization of Persistent Betti Number functions (also called Rank Invariants) to the proposed setting. We Let λ be a function from the set of pairs (X, f ), to Φ; the one corresponding to (X, f ) will be denoted by λ (X,f ) . Assume also that λ (X,f ) depends on the filtration S (X,f ) in the sense that 1. λ (X,f ) (u, v) is nondecreasing in u and nonincreasing in v; 2. for all u 1 , u 2 , v 1 , v 2 ∈ R such that u 1 ≤ u 2 < v 1 ≤ v 2 the following inequality holds: Remark 5. The persistent Betti number functions, at all homology degrees, are the most relevant example of persistence functions, for which stability holds. In this case, C is the category of topological spaces, U is the forgetful functor and the filtering functions are continuous. The same holds for the category of simplicial complexes, where the filtering function respects the condition that its value on each simplex σ is greater than or equal to its value on each face of σ. See, e.g. [18,31,13]. Graph-theoretical examples, not coming from topological or simplicial constructions, are the object of the whole Section 4.
Remark 6. Conditions 1 and 2 of Def. 2 correspond to Prop. 1 and Lemma 1 of [20], where discontinuities of size functions (equivalently 0-th persistent Betti number functions) were studied. Condition 3, which appears here as part of a definition, is also present as a proposition in [19,Thm. 3.2], [10,Prop.10]. The requirement on the ranges of the filtering functions will be functional to the proof of Lemma 4.
Up to Def. 7, λ (X,f ) : ∆ + → Z will be a persistence function (for which stability does not necessarily hold). Proposition 6, together with Condition 1 of Def. 2, assures that λ (X,f ) only assumes nonnegative values.
Proof. By Assumption 1, f is inferiorly bound, so such a finite infimum exists; then for a lesser u the set The following simple propositions (7 to 12, with the exception of Prop. 10) have the same proofs as the quoted propositions of [20] by the following substitutions (on the left the notation or claim in the reference article is mapped on the equivalent notation or claim in this work): Proposition 7 shows that the discontinuities of persistence functions form straight line segments parallel to coordinate axes.

Proposition 7.
[20, Cor. 1] The following statements hold: Next, we have no isolated discontinuity points. Around discontinuity segments there are discontinuity-free areas: . Let then ε be such that 1/ε > v and the open set W ε (p) of Prop. 9 does not contain discontinuity points. Then for allp = For defining cornerpoints (the points of persistence diagrams) we need a notion of multiplicity, which we again import from classical persistence.
We shall call any p ∈ ∆ + with positive multiplicity a proper cornerpoint.
We shall call any r with positive multiplicity a cornerpoint at infinity.
The next two propositions show that a cornerpoint at infinity gives the position of a half-line of discontinuity, and that a proper cornerpoint is the common end of a horizontal and a vertical discontinuity segment.
is a cornerpoint, then the following statements hold: or the line u = u is a cornerpoint at infinity, or both cases occur.
Remark 7. Propositions 7 to 12, which depend only on Conditions 1 and 2 of Def. 2, grant the appearance with overlapping triangles typical of persistent Betti number functions.
Assumption 3. In the remainder, we require that the function λ (X,f ) has a finite number of cornerpoints (both proper and at infinity).
We now have the analogous, in terms of persistence functions, of the representation theorem for size functions [20,Prop. 10], with a slightly tighter hypothesis and in the clearer notation of [10,Thm.8]. It connects the values of a persistence function at a point with the multiplicities of cornerpoints in the "north-west" area with respect to it. Set Proposition 13. We have Proof. By induction on the number of cornerpoints (proper and at infinity) (u, v) with u < u and v > v. .
The following definition extends the notion of persistence diagram [9,8] to the framework of persistence functions, that we introduced above.
Definition 5. The persistence diagram of λ (X,f ) is the multiset of its cornerpoints (proper and at infinity), each repeated as many times as its multiplicity, together with all points of the diagonal ∆, each counted with infinite (ℵ 0 ) multiplicity. For the sake of simplicity it will just be denoted by D(f ).
We now prove that persistence diagrams-like the classical ones of persistent homology-provide lower bounds for a distance between objects endowed with filtering functions.
Remark 8. These rather unsound assumptions on +∞ are functional to two particular goals. One is to force the matching between cornerpoints at infinity in Def. 6, and to make the distance between two cornerpoints at infinity equal to the difference of their abscissas. The other is to let the difference of the values of corresponding pendant edges-in the proofs of Lemmas 6, 7, 8-vanish.
spectively, let Γ be the set of all bijections between the multisets D(f ) and D(g). We define the bottleneck (formerly matching) distance as the real number As in the "classical" persistence theory, this distance checks the maximum displacement between corresponding points for a given matching either between cornerpoints of the two diagrams or between cornerpoints and their own projections on the diagonal ∆, and takes the minimum among these maxima. Minima and maxima are actually attained because of the requested finiteness.
Always in the concrete category (C, U) let us now consider two pairs (X, f ), where H is the (possibly empty) set of C-isomorphisms between X and Y . We can now generalize some definitions given in [21,10,24].
Let now λ be stable (Def. 2). Recall that [m, M ] is an interval which contains the ranges of all filtering functions. Given any persistence function λ (X,f ) , let λ (X,f ) ∈ Φ be defined as: is still a persistence function (i.e. it respects Conditions 1 and 2 of Def. 2) and its persistence diagram has the same proper cornerpoints as λ (X,f ) , plus one for each cornerpoint at infinity of it, with the same abscissa, with the same multiplicity and with a "high" ordinate.
Proof. See Appendix C.1. Then By Lemma 4 we can substitute persistence diagrams with ones with no cornerpoints at infinity. The proof of the next theorem can then be obtained from the one of Thm. 29 of [10] and its preceding lemmas by recalling that the finiteness of the set of cornerpoints, proved in that paper, is here the explicit requirement Assumption 3, and by the following substitutions (left, numbering of the reference article; right, of the present one): Theorem 1 (Stability). Let λ be stable and (X, f ), (Y, g) be pairs as above; then In the next two sections we provide general constructions of persistence functions, which will be used in Section 4.

Coherent samplings
The following definition is meant to express in our framework the type of partitions that classically generate (stable) persistence functions, e.g. connected components, path-connected components (giving rise to 0-Betti numbers inČech and singular homology respectively). This generalization will be used to define persistence functions-for which stability holds-from the blocks, edge-blocks and clique communities of a weighted graph in Sections 4.1, 4.2 and 4.3.

Definition 8.
A coherent sampling V on (C, U) is the assignment to each X ∈ Obj(C) of a set V(X) of subsets of U(X), such that the following conditions 1 and 2 hold; it will be said to be a stable coherent sampling if also condition 3 holds: Because of the many symbols referring to various sets in the next proof, we suggest that the reader keeps in mind the example of persistent 0-Betti numbers, where the Xs are sublevel sets and the Zs are their path-connected components. The filtration F (X,f ) is the one of Prop. 3.
Proposition 16. Let a coherent sampling V be given on (C, U); for all objects X of C, for all filtering functions f : . Then the functions λ (X,f ) are persistence functions. If the coherent sampling is stable, so is λ.

Steady and ranging sets
Let a concrete category (C, U), with the constraint set at the beginning of Section 3, and whose objects X have finite U(X), be fixed. Given any of its objects X, let F : 2 U (X) → {true, f alse} be any feature such that F (∅) = f alse. We call F -set any set A ⊆ U(X) such that F (A) = true.
In the remainder of this section (X, f ) will be a filtered object satisfying the conditions of Prop. 3. Given any real number u, we denote by X u its subobject f −1 (−∞, u]. We shall say that A ⊆ U(X w ) is an F -set at level w if it is an F -set of the subobject X w . Definition 9. We call A ⊆ U(X) a steady F -set (or simply an s-F -set) at (u, v) ((u, v) ∈ ∆ + ) if it is an F -set at all levels w with u ≤ w < v. We call A a ranging F -set (or simply an r-F -set) at (u, v) if there exist levels w ≤ u and w ≥ v at which it is an F -set.
Let SF (X,f ) (u, v) be the set of s-F -sets at (u, v) and let RF (X,f ) (u, v) be the set of r-F -sets at (u, v).
Remark 11. Of course, steady implies ranging; this is due to the "≤" and "≥" signs in the definitions. By using the strict inequalities in at least one of the two definitions, this implication would fail.
Proof. By the definitions themselves of steady and ranging F -set.
Proposition 17. Let a feature F be fixed on (C, U); for all objects X of C, for all filtering functions f : X → R, the function σ (X,f ) which assigns to (u, v) ∈ ∆ + the number |SF (X,f ) (u, v)| is a persistence function.
Proposition 18. Let a feature F be fixed on (C, U); for all objects X of C, for all filtering functions f : X → R, the function (X,f ) which assigns to (u, v) ∈ ∆ + the number |RF (X,f ) (u, v)| is a persistence function.

Remark 12.
Of course, there are many features which give valid but meaningless persistence functions: the features F such that, if x is an F -set at level u, then it is an F -set also at level v for all v > u.
Remark 13. We still don't know which hypothesis would grant the stability condition 3 of Def. 2.

Graph-theoretical persistence
We take advantage of the general setting established in Section 3 for defining four persistence functions on weighted graphs, without passing through the construction of a simplicial complex and the computation of homology.
Here, the leading idea is that the "classical" construction of persistent homology on a weighted graph seen as a filtered simplicial complex only captures the evolution of connected components and 1-cycles; our general setting, on the contrary, allows us to use the techniques proper of persistence also for other graph-theoretical concepts, without the need of topological constructions. The classical 0-dimensional persistent Betti number function (i.e. the size function) of the weighted graph turns out to be a particular case: one can recover it from the coherent sampling construction, where the sets forming the sampling are the connected components.
In Sections 4.1 to 4.4 the concerned category will be Graph. Given a weighted graph (G, f ) with G = V (G), E(G) , we shall extend the weight function f : E(G) →R := R ∪ {+∞} to a function (which we will, with slight abuse, denote with the same name) f : V (G) ∪ E(G) →R by defining its value on a vertex as +∞ if it is an isolated vertex, and as the minimum value of f on its incident edges otherwise. As mentioned in Section 2, a functor U from Graph to Set is defined by sending each G to Hom(S 0 , G) ∪ Hom(S 1 , G) (where S 0 is the graph with one vertex and no edges, whereas S 1 is the graph with two vertices connected by an edge). (Graph, U) is then easily seen to be a concrete category satisfying the assumption at the beginning of Section 3.
Note that Hom(S 0 , G) V (G) whereas Hom(S 1 , G) V (G) ∪ E(G) ∪ E(G) (as an edge can go in another edge in two ways or it can go into a vertex), so: even though this isomorphism is not canonical. We have a canonical map U(G) → V (G) ∪ E(G) that associates to each homomorphisms in either Hom(S 0 , G) or Hom(S 1 , G) its image. We can use this map to extend our function f from V (G) ∪ E(G) to U(G).

Blocks
We recall that in a (loopless) graph G a cut vertex (or separating vertex) is a vertex v ∈ V (G) whose deletion (along with incident edges) makes the number of connected components of G increase. A block is a connected graph which does not contain any cut vertex. A block of a graph G is a maximal subgraph H such that H is a block [2].
Proposition 19. The assignment B, which maps each graph G to the set of its blocks, is a coherent sampling.
Proof. Let G be a graph. An example of persistent block number function can be seen in Fig. 2. We can then associate to bl (G,f ) , via Def. 5, a persistent block diagram D bl (f ) with all classical features granted by the propositions of Section 3.
A toy example is given in Fig. 9. We now follow the logical line of Thm. 32 of [10] for proving the universality of the bottleneck (or matching) distance among the lower bounds for the natural pseudodistance which can come from distances between persistent block diagrams.

Edge-blocks
We recall that in a graph G a cut edge (or bridge) is an edge e ∈ E(G) whose deletion makes the number of connected components of G increase [2]. We define an edge-block as a connected graph which contains at least one edge, but does not contain any cut edge. An edge-block of a graph G is a maximal subgraph H such that H is an edge-block.
The proofs of the next statements are totally analogous to those of Section 4.1, except for Lemma 7.
Proposition 20. The assignment E, which maps each graph G to the set of its edge-blocks, is a coherent sampling.
Definition 11. Given a weighted graph (G, f ), we call persistent edge-block number the function ebl (G,f ) : ∆ + → Z which maps the pair (u, v) to the number of edge-blocks of U −1 f −1 (−∞, v] containing at least one edge-block of Corollary 3. For all weighted graphs (G, f ) the function ebl (G,f ) is a persistence function. The assignment ebl is stable.
An example of persistent edge-block number function can be seen in Fig. 3. We can associate to ebl (G,f ) , via Def. 5, a persistent edge-block diagram D ebl (f ).   Theorem 3. Ifd is a distance for persistent edge-block diagrams such that

Clique communities
We recall the definition of clique community given in [28]. Given a graph G = (V, E), two of its k-cliques (i.e. cliques of k vertices) are said to be adjacent if they share k − 1 vertices; a k−clique community is a maximal union of k-cliques such that any two of them are connected by a sequence of k-cliques, where each k-clique of the sequence is adjacent to the following one. This construction has been applied to network analysis [35,22,27,17] and to weighted graphs, in the classical topological persistence paradigm, in [30]. Proposition 21. The assignment C k , which maps each graph G to the set of its k-clique communities, is a stable coherent sampling.
Proof. 1. The k-clique communities of a finite graph form a finite set of subgraphs of it. 2. If H is a subgraph of G, each k-clique community of H is contained in exactly one k-clique community of G. 3. Cliques and clique adjacency correspond through graph isomorphisms, so k-clique communities correspond under graph isomorphisms.  Remark 15. Of course, the persistent 2-clique community number function of a weighted graph (G, f ), such that no isolated vertices appear in the filtration, coincides with its persistent 0-Betti number function.
An example of persistent 3-clique community number function can be seen in Fig. 4. We can associate to cc k (G,f ) , via Def. 5, a persistent k-clique community diagram D cc k (f ). Corollary 6. Given weighted graphs (G, f ), (G , f ) and the respective persistent k-clique community diagrams D cc k (f ) D cc k (f ), we have For the proof of next lemma we adopt the same strategy as for Lemma 6 and for Lemma 7.

Steady and ranging Eulerian sets
We now give an example of application of the framework exposed in Section 3.2. Given any graph G = (V, E), we define Eu : 2 V ∪E → {true, f alse} to yield true on a set A if and only if A is a set of vertices whose induced subgraph of G is nonempty, connected, Eulerian and maximal with respect to these properties; in that case A is said to be a Eu-set of G. Let now (G, f ) be a weighted graph. We apply Def. 9 to feature Eu.
Definition 13. Given any real number w, the set of vertices A is a Eu-set at level w if it is a Eu-set of the subgraph G w . It is a steady Eu-set (an s-Eu-set) at (u, v) ((u, v) ∈ ∆ + ) if it is a Eu-set at all levels w with u ≤ w < v. It is a ranging Eu-set (an r-Eu-set) at (u, v) if there exist levels w ≤ u and w ≥ v at which it is a Eu-set. SEu (G,f ) (u, v) and REu (G,f ) (u, v) are respectively the sets of s-Eu-sets and of r-Eu-sets at (u, v).  The function σeu is not stable, as the example of Fig.6 shows: In fact, the maximum absolute value of the weight difference on the same edges is 1, and σ (G,f ) (2.5 − 1, 10 + 1) = 1 > 0 = σ (G,g) (2.5, 10), against Condition 3 of Def. 2.
Also the function eu is not stable, as the example of Fig.7 shows: In fact, the maximum absolute value of the weight difference on the same edges is 1, and (G,f ) (7.5 − 1, 10 + 1) = 1 > 0 = (G,g) (7.5, 10), against Condition 3 of Def. 2.

Coherent sampling from a generalized categorical notion of connectedness
By taking advantage of the framework defined in Sections 2, 2.2 and 3, here we generalize the block and edge-block constructions of Section 4 to an arbitrary category C. First, we provide a unified notion of connected component for a given class F of monomorphisms in C. We prove that F-connected components are a coherent sampling in the sense of definition 8. We finally show how to choose F to recover the analogous of blocks and edge-blocks in a general functor category.
Definition 14. Let (C, U) be a concrete category with canonical subobjects. We say that a family F of monomorphisms in C is canonical subobject-invariant if: for each monomorphism φ ∈ F, pullbacks of φ along canonical subobject inclusions are also in F for each X ∈ Obj(C), the identity morphism of X belongs to F As in [29,Chapter VII 4.16], if the category C has coproducts, we define an object of X ∈ Obj(C) to be connected if the representable functor Hom(X, −) from C to Set preserves coproducts. We recall that, when the category C is extensive (as in [6], a technical condition ensuring compatibility of pullbacks and coproducts), this condition is equivalent to the following two: -C is not initial.
-C cannot be decomposed as a coproduct A B where both A and B are not initial.
Definition 15. Let (C, U) be a concrete category that has canonical subobjects, and is extensive. Let F be a canonical subobject-invariant family of monomor- where the inclusion φ belongs to F, are connected. Given an object C ∈ Obj(C), we say that an F-connected component of C is a maximal canonical subobject X → C such that X is F-connected.
Lemma 9. Given a set of canonical subobjects X ψi − → X i and X i χi − → C for i in I, such that for every i, j ∈ I, χ i • ψ i = χ j • ψ j , let X ξ − → C be the canonical subobject that corresponds to i∈I X i → C. If X and all X i are F-connected, so is X.
Proof. See Appendix E.1. Proposition 23. Given (C, U) and F as above, the assignment E, which maps each object C ∈ Obj(C) to the set of its F-blocks, restricted to objects C ∈ Obj(C) that have a finite number of distinct canonical subobjects, is a coherent sampling.
Note that both blocks and edge-blocks in Graph are a special case of this construction. In the case of blocks we can consider the family F v of monomorphisms X φ − → Y that are vertex deletions, that is to say the image of φ is either Y or Y minus a vertex and all incident edges. This family is canonical subobjectinvariant: a vertex deletion restricted to a subobject is still a vertex deletion. F v -connected components are blocks. Similarly, we can consider the family F e of monomorphisms X φ − → Y that are edge deletions, that is to say the image of φ is either Y or Y minus an edge. This family is canonical subobject-invariant: an edge deletion restricted to a subobject is still an edge deletion. F e -connected components are edge-blocks.
In the following subsection we will show how one can use similar ideas to construct canonical subobject-invariant families of monomorphisms in functor categories.

Block construction in functor categories
In a functor category Fun(D, C) where C is extensive and has canonical subobjects, one can easily construct a class of canonical subobject-invariant monomorphism F using ideas from the Graph construction.
Definition 16. A non-initial object C ∈ Obj(C) is said to be irreducible if whenever we have a monomorphism A → C, either A is initial or A → C is an isomorphism. We consider the initial object to not be irreducible.
A full subcategory I ⊆ C is said to be closed under canonical subobjects if for all object A ∈ Obj(I) and canonical subobject inclusion B → A ∈ Morph(C), B also belongs to I. Definition 17. For a given category C there are at least three examples of full subcategories closed under canonical subobjects that hence can be used to define three a priori distinct notions of generalized connectedness: -Irreducible(C) spanned by objects that are either irreducible or initial.
Remark 16. The usual notion of connectedness correponds to the one induced by Initial(C).
Definition 18. Given a full subcategory I ⊆ C that contains the initial object of C and is closed under canonical subobjects, we say that a monomorphism D → C ∈ Morph(C) is a deletion with respect to I if it is a coproduct inclusion D → D ∪ E with E ∈ Obj(I). If E is not initial we say the deletion is strict.
Remark 17. If C is extensive, the pullback of a deletion along a canonical subobject inclusion is also a deletion, even though the pullback of a strict deletion is not necessarily strict.
Definition 19. Given F ∈ Fun(D, C) and d ∈ Obj(D) and a canonical subobject G φ − → F , we say φ is a d-deletion with respect to I ⊆ C if the following conditions are met: Remark 18. If C is extensive and has canonical subobjects, d-deletions are canonical subobject-invariant.
Given an object X in Fun(D, C) we define the d-blocks of X to be its Fconnected components, where F are d-deletions with respect to Irreducible(C). In the example of quivers (defined as a functor from the Kronecker category Q to Set), we recover blocks and edge-blocks (depending on which of the two objects of the Kronecker category we choose).  Fig. 8. Persistence of a quiver K with a group action of Z2 × Z2. In the top row, on the right a graphical representation of K and the group action: the green arrow is a reflection with respect to the center of the graphical representation of K along the vertical axis. The second copy of Z2 acts on the edges highlighted in blue by identifying opposite edges with coherent orientations. On the right the quotient K/ (Z2 × Z2).
Colors correspond to the action generating the quotient; fixed points are depicted in black. In the middle row, the filtration induced by the cardinality of the orbit and its respective quotients. In the bottom row, the persistence diagrams obtained by considering connected components, blocks with respect to Irreducible(G − Set) and blocks with respect to the category Extrema(G − Set) of initial and terminal objects in G − Set.

Examples of persistence from generalized connectedness
Here, we show how to use the above results to effortlessly construct novel examples of persistence. First of all, we need concrete categories that are extensive and have canonical subobjects. Other than the obvious examples (Set, Graph, Simp, Top, et cetera), we have seen in Section 2.2 that if a concrete category C has canonical subobjects, then so does Fun(D, C), where D is an arbitrary small category. Under the assumption of canonical subobjects (in particular we only need the existence of pullbacks), the same can be said of extensive categories: Proposition 24. If C is extensive and has canonical subobjects, then Fun(D, C) is also extensive and has canonical subobjects.
Proof. The extensive property can be expressed in terms of pullbacks and coproducts. Given that C has pullbacks and coproducts, such limits and colimits in the functor category Fun(D, C) can be computed element-wise.
This is a simple way to generate examples of categories in which to study persistence. Specifically we can focus on cases where the category D has a specific structure so that Fun(D, C) corresponds to well-known objects. In particular we show that our framework can be applied to categories of quiver representations, categories of sets with a group action and quivers in extensive categories with canonical subobjects.
Given a finite group G, we can construct a category G that has only one object * and such that Hom( * , * ) = G. The composition of morphisms is given by the operation in G. Then Fun(G, C) are simply actions of G in C. In particular, we can consider C = Set, in which case we recover the category of G − Set = Fun(G, Set), i.e. sets with a group action of G.
Similarly, given a quiver K we can construct the corresponding path category K, that has as objects the nodes of K and has morphisms paths between nodes in K (as in [26]). Then the objects of Fun(K, C) correspond to representations of the quiver K in the category C.
Remark 19. This is remindful of the construction in [32], with the key difference that [32] studies representations of quivers in vector spaces whereas our framework covers representations of quivers in an arbitrary extensive category (of which vector spaces are not an example).
Finally, we do not need to restrict ourselves to Quiver but we can use arbitrary quiver categories under the assumptions of Proposition 24. Given the Kronecker category Q (with two objects and two morphisms between them), and a category C, Fun(Q, C) corresponds to quivers in the category C. In particular if C = G − Set, we obtain Fun(Q, G − Set) which are quivers equipped with compatible G-actions on the edges and the vertices.
Objects in Fun(Q, G − Set) admit a natural filtration. To each vertex v (or edge e) we can associate the cardinality of its orbit |G · v| (or |G · e| respectively). The cardinality of the orbit of an edge is clearly equal or larger than the cardinality of the orbit of its endpoints, so this function induces a filtration on the quiver.
We are now in a position to generalize the (edge-)block construction to Fun(Q, G − Set). In G − Set an irreducible object is simply a representation of g with only one orbit. Vertex-deletions or edge-deletions with respect to Irreducible(G − Set) correspond to removing an orbit of vertices (as well as all edges incident to it) or an orbit of edges (as well as all vertices incident to it) respectively. Together with the results of Section 5.1, this allows us to easily create a persistence function in this novel setting.
Even though the construction above, based on deletions with respect to Irreducible(G − Set), could have been achieved working directly in Quiver using the quotient quiver (where we identify vertices or edges that are in the same orbit), many variants of it can only be constructed working in the category Fun(Q, G − Set). For instance we may consider deletions with respect to a smaller subcategory Extrema(G − Set) Irreducible(G − Set) that is spanned by initial and terminal objects of G − Set (that is the empty set and the singleton, both with the trivial group action). In this case vertex-deletions or edge-deletions with respect to Extrema(G − Set) correspond to removing a fixed point of the G-action on vertices (as well as all edges incident to it) or a fixed point of the G-action on edges (as well as all vertices incident to it) respectively.
The three different coherent samplings based on vertex deletions with respect to Initial(G − Set), Extrema(G − Set) and Irreducible(G − Set) give a priori distinct persistence diagrams, see Fig. 8 for an example.

Conclusion and perspectives
We described a novel, general data analysis framework that can be swiftly adapted to diverse data types and representations while guaranteeing robustness and stability.
We achieved these aims by formalizing a generalized theory of persistence, that no longer requires topological mediations such as auxiliary simplicial complexes, or the usage of homology as a functor of choice. We identified the properties that make a category suitable for our axiomatic persistence framework. We showed how these hypotheses allow us to define persistence directly in many relevant categories (e.g. graphs and simplices) and functor categories (simplicial sets and quivers), while guaranteeing the basic properties of classical persistence. We defined the generalised persistence functions and discussed their link with the natural pseudodistance. We gave two flexible definitions (namely coherent sampling and ranging sets) for the construction of generalized persistence functions and applied them to toy examples in the category of weighted graphs. Therein, we discussed the stability of the generalized persistence functions built according to our definitions and by considering block, edge-blocks, clique communities and Eulerian sets. Finally, as a confirmation of both generality and agility of our framework, we showed how various concepts of connectivity specific to graphs, such as blocks and edge-blocks are easily extended to other categories, in particular categories of presheaves, where they naturally induce coherent coverings and (generalized) persistence.
We hope that this work paves the road to new applications of the persistence paradigm in various fields. We list a few possible developments that are currently being developed by our team and hopefully by other researchers.
Even though in this work we mainly focused on combinatorial categories, we suspect that an analogous of our theory of generalized connected components and coherent sampling can be extended to a linear setting, where Set, extensive categories and categories of presheaves would be replaced by K − Vec, Abelian categories and categories of representations. This would allow us to extend our framework of generalized persistence to categories relevant in theoretical physics or theoretical chemistry: Lie-group representations, quiver representations or representations of the category of cobordisms (related to topological quantum field theory in [1]). So far we have just considered R as a parameter for filtrations, but there has been much progress in the study of filtering functions with R k [21,7,5] or even S 1 [4] as a range, and of spaces parametrized by a lattice [33]. The definition of persistence functions should be extended to these settings.
Persistence diagrams are but a shadow of much more general and powerful tools: persistence modules and further [3,24,11], on which the interleaving distance plays a central role. It is necessary to connect the ideas of the present paper to that research domain.
Proof. By hypothesis, for each t ∈ R there is a well-defined canonical subob- . As Y v is the terminal object of , there is a unique monomorphism from Y u to Y v such that the following diagram commutes: Proof. Given a functor F ∈ Obj(F), we can associate to it the disjoint union of the sets corresponding to the objects of C in its image, that is to say: The universal property of the coproduct allows to define U(η) for a natural transformation F η − → G.

B.2 Proof of Proposition 4
Proposition. Let D be a small category and (C, U) be a concrete category with canonical subobjects. Then (F, U), as defined in lemma 1, has canonical subobjects.
Proof. Given that C has pullbacks, then also Fun(D, C) has pullbacks computed pointwise. This is generally true for limits (f is a functor from a small category I to Fun(D, C): Coproducts in Set commute with connected limits (e.g. pullbacks), therefore, if I is a connected category: Let us now take a subset Z of U(G). Let's assume that there is a subobject F η − → G such that U(η)(U(F )) = Z. Then we can prove that the category F Z has a terminal object. For each d ∈ D, we can consider the corresponding subset U(η d )(U(F (d))) which in turn, as C has canonical subobjects, must correspond to a canonical subobject X d We can define a functor H sending each The proof of canonical factorization of a morphism F η − → G is in the same spirit as the above: the canonical factorization can first be performed elementwise for all the F (d) Using the uniqueness up to natural isomorphism of these canonical factorizations one can then extend this to the images of morphisms in D.

B.3 Proof of Lemma 2
Lemma. Let D be a small category and C be a category with small coproducts. Given F ∈ Fun(D, C), Hom(Φ X,d , F ) Hom(X, F (d)) Proof. Given a natural transformation η ∈ Hom(Φ X d , F ), we can consider ing X in the copy of X corresponding to the identity in Hom(d, d). X is then the morphism in Hom(X, F (d)) corresponding to η.
In the other direction, let us consider f ∈ Hom(X, F (d)). f induces a natural , which, due to the coproduct universal property, naturally induces a unique map from C Persistence functions -proofs C.1 Proof of Lemma 3 Lemma. Let (X, f ), (Y, g) be such that a C-isomorphism ψ : X → Y and a real number h > 0 exist, for which sup p∈U (X) |f 15. The thesis comes from stability, i.e. from the inequalities (Condition 3 of Def. 2)
Let (X, f ), (Y, g), ψ, h be as in Lemma 3. Let D(f ), D(g), D (f ), D (g) be the persistence diagrams of λ (X,f ) , λ (Y,g) , λ (X,f ) , λ (Y,g) respectively. Then Proof. As a consequence of Lemma 3 and of Prop. 13, the sums of multiplicities of cornerpoints at infinity of D(f ) and of D(g) coincide. So, by Assumption 4, an optimal matching between representative sequences (see Def. 15 of [10], suitably adapted for the presence of several cornerpoints at infinity, with multiplicities) necessarily matches the cornerpoints at infinity of D(f ) with the ones of D(g). The distance between two such matching cornerpoints at infinity is the absolute value of the difference of their abscissas. As for D (f ) and D (g), call high the cornerpoints with ordinate 2M − m and low the ones with ordinate not greater than M . An optimal matching between representative sequences necessarily matches high cornerpoints of D (f ) with high cornerpoints of D (g). In fact, the distance between a high cornerpoint of D(f ) and either its projection on ∆ or any low cornerpoint of D (g) would be greater than the distance between two high cornerpoints. Also in this case the distance between two matching high cornerpoints is the absolute value of the difference of their abscissas, which is equal to the distance of the corresponding cornerpoints at infinity of D(f ) and D(g). Finally, the proper cornerpoints of λ (X,f ) (resp. of λ (Y,g) ) coincide with the low cornerpoints of λ (X,f ) (resp. of λ (Y,g) ).

C.3 Proof of Proposition 16
Proposition. Let a coherent sampling V be given on (C, U); for all objects X of C, for all filtering functions f : X → R, let λ (X,f ) : ∆ + → Z be defined by λ (X,f ) (u, v) to be the number of elements of V F (X,f ) (v) containing at least one element of V F (X,f ) (u) . Then the functions λ (X,f ) are persistence functions. If the coherent sampling is stable, so is λ.
For the remainder of this proof, for any real number w we set X w = F (X,f ) (w). We now prove this easy claim: (*) Let w ≤ w ≤ w and X w ⊆ X w ⊆ X w ⊆ X. For each element Z w ∈ V(X w ) (i.e. a subset of U(X w ) belonging to its sampling) there are exactly one Z w ∈ V(X w ) and one Z w ∈ V(X w ) such that Z w ⊆ Z w ⊆ Z w .
In fact, the existence and uniqueness of Z w are condition 2 of Def. 8. The existence and uniqueness of Z w comes from the same condition and from the transitivity of inclusion.
We shall now prove all claimed inequalities by showing that it is possible to define suitable injective maps.
contain elements of V(X u1 ) (necessarily different by condition 2 of Def. 8), then by (*) they also contain elements of V(X u2 ), which are different by condition 2 of Def. 8. So it is possible to define an injective function from the set of elements of V(X v ), which contain at least one element of V(X u1 ), to the set of elements of V(X v ) which contain at least one element of V(X u2 ). Therefore λ (X,f ) (u 1 , v) ≤ λ (X,f ) (u 2 , v). Let u < v 1 < v 2 ; if Z v2 , Z † v2 ∈ V(X v2 ), with Z v2 = Z † v2 , contain elements Z u , Z † u of V(X u ) (necessarily different by condition 2 of Def. 8), then by (*) there exist Z v1 , Z † v1 ∈ V(X v1 ) (necessarily different by condition 2 of Def. 8) such that Z u ⊆ Z v1 , Z † u ⊆ Z † v1 ; therefore λ (X,f ) (u, v 1 ) ≥ λ (X,f ) (u, v 2 ). 2. Let now u 1 ≤ u 2 < v 1 ≤ v 2 . For i = 1, 2, the difference λ (X,f ) (u 2 , v i ) − λ (X,f ) (u 1 , v i ) is the number of elements of V(X vi ) which contain at least an element of V(X u2 ) but no elements of V(X u1 ). Let Z v2 ∈ V(X v2 ) contain an element Z u2 ∈ V(X u2 ) but no elements of V(X u1 ). Then by (*) there exists Z v1 ∈ V(X v1 ) such that Z u2 ⊆ Z v1 ⊆ Z v2 . No element of V(X u1 ) can be contained in Z v1 , otherwise it would also be contained in Z v2 . If Z v2 ∈ V(X v2 ) is in the same situation as Z v2 but different from it, then the corresponding Z v1 ∈ V(X v1 ) is different from Z v1 by condition 2 of Def. 8. Therefore λ (X,f ) (u 2 , v 1 ) − λ (X,f ) (u 1 , v 1 ) ≥ λ (X,f ) (u 2 , v 2 ) − λ (X,f ) (u 1 , v 2 ) 3. Assume that V is a stable coherent sampling. Given an analogous pair (Y, g), let a C-isomorphism ψ : X → Y exist such that sup p∈U (X) |f (p) − g (U(ψ))(p) | ≤ h (h > 0). For any u > h, v > u, we have X u−h ⊆ ψ −1 (Y u ) ⊆ ψ −1 (Y v ) ⊆ X v+h . Then, by applying (*) twice, if Z v+h ∈ V(X v+h ) contains an element Z u−h ∈ V(X u−h ), then there exist uniquely determined Z u ∈ V ψ −1 (Y u ) , Z v ∈ V X ψ −1 (Y v ) such that Z u−h ⊆ Z u ⊆ Z v ⊆ Z v+h . By condition 3 of Def. 8 we have ψ(Z v ) ∈ V(Y v ) and ψ(Z u ) ∈ V(Y u ), and also ψ(Z u ) ⊆ ψ(Z v ). If Z v+h ∈ V(X v+h ) is E.1 Proof of Lemma 9 Lemma. Given a set of monomorphisms X ψi − → X i and X i χi − → C for i in I, such that ∀i, j ∈ I χ i • ψ i = χ j • ψ j , let X ξ − → C be the canonical subobject that corresponds to i∈I X i → C. If X and all X i are F-block, so is X.
Proof. Let Y φ − → X be a monomorphism in F. LetŶ be the pullback of In turn let Y i be the pullbacks ofŶ → X ← X i and Y be the pullback ofŶ → X ← X As C is extensive,Ŷ i∈I Y i . By hypothesis Y i and Y are connected. Y is not initial as Y maps to it and Y is not initial (initial objects are strict in extensive categories). Let us assume by contradiction that Y A B with A, B not initial. Then we have a morphism Y → A B that, being Y connected, must factor via one or the other: let us assume it is A. Then all Y i → A B also factor via A (as Y i are also connected), so the morphism also factors via A. The morphism i∈I X i π − → X is sent by U to a surjective map of sets (this is generally true for the first morphism of the canonical factorization). As U preserves pullbacks, the morphism is the pullback of U(π) and therefore a surjective map of sets. As a consequencê Y → A B is an epimorphism that factors via A and so A → A B is an epimorphism. This is absurd in an extensive category as B is not initial.

E.2 Proof of Proposition 23
Proposition. Given (C, U) and F as above, the assignment E, which maps each object C ∈ Obj(C) to the set of its F-blocks, restricted to objects C ∈ Obj(C) that have a finite number of distinct canonical subobjects, is a coherent sampling.
Proof. This set is defined in categorical terms and is therefore obviously preserved by isomorphisms. If, by contradiction, an F-block X is contained in two distinct maximal F-blocks X 1 and X 2 of C, then the union of X 1 and X 2 in C is also an F-block, which is absurd as X 1 and X 2 were maximal. Finally, the number of maximal F-blocks is finite as we are restricting ourselves to objects with a finite number of distinct canonical subobjects.