Closing the category of finitely presented functors under images made constructive

For an additive category $\mathbf{P}$ we provide an explict construction of a category $\mathcal{Q}( \mathbf{P} )$ whose objects can be thought of as formally representing $\frac{\mathrm{im}( \gamma )}{\mathrm{im}( \rho ) \cap \mathrm{im}( \gamma )}$ for given morphisms $\gamma: A \rightarrow B$ and $\rho: C \rightarrow B$ in $\mathbf{P}$, even though $\mathbf{P}$ does not need to admit quotients or images. We show how it is possible to calculate effectively within $\mathcal{Q}( \mathbf{P} )$, provided that a basic problem related to syzygies can be handled algorithmically. We prove an equivalence of $\mathcal{Q}( \mathbf{P} )$ with the subcategory of the category of contravariant functors from $\mathbf{P}$ to the category of abelian groups $\mathbf{Ab}$ which contains all finitely presented functors and is closed under the operation of taking images. Moreover, we characterize the abelian case: $\mathcal{Q}( \mathbf{P} )$ is abelian if and only if it is equivalent to $\mathrm{fp}( \mathbf{P}^{\mathrm{op}}, \mathbf{Ab} )$, the category of all finitely presented functors, which in turn, by a theorem of Freyd, is abelian if and only if $\mathbf{P}$ has weak kernels. The category $\mathcal{Q}( \mathbf{P} )$ is a categorical abstraction of the data structure for finitely presented $R$-modules employed by the computer algebra system Macaulay2, where $R$ is a ring. By our generalization to arbitrary additive categories, we show how this data structure can also be used for modeling finitely presented graded modules, finitely presented functors, and some not necessarily finitely presented modules over a non-coherent ring.


Introduction
The purpose of constructive category theory lies in finding categorical representations (data structures) of mathematical objects such that effective computations become possible [17]. A nice example of this philosophy is provided by the case of finitely presented modules over a ring R: it only requires some basic algorithms for R in order to obtain an effective categorical framework for doing homological algebra [2] that even allows the implementation of concepts like spectral sequences [1,15], Serre quotients [3,9], or the grade filtration [18].
Regarding Ab-categories 1 as "rings with several objects" is a powerful idea thoroughly developed by Mitchell in [13] that yielded remarkable generalizations and clarifications in homological ring theory. Following the idea of generalizing from a ring R to an Ab-category P, the purpose of this paper is to explain, from a constructive and categorical point of view, the data structure for modules over a ring R used by the computer algebra system Macaulay2 [7], and moreover to generalize this data structure from the case of R to the case of P. The upshot is an effective treatment of the smallest subcategory of the category of contravariant additive functors P Ñ Ab which contains all finitely presented functors and is closed under images.
In Macaulay2, the data structure of a module is given by two matrices A P R aˆb and C P R cˆb for a, b, c P Z ě0 . The left R-module corresponding to such a pair of matrices is the (abstract) subquotient module impAq impAqXimpCq , or equivalently impAq`impCq impCq , of the row module R 1ˆb , where we identify a matrix with its induced morphism between free row modules. Given a second pair of matrices A 1 P R a 1ˆb1 and C 1 P R c 1ˆb1 , a morphism from impAq impAqXimpCq to impA 1 q impA 1 qXimpC 1 q is modeled by a matrix M P R aˆa 1 such that we may complete the following square with the dashed arrow to a commutative diagram: whose objects are pairs of morphisms pA ÝÑ B ÐÝ Cq in P having the same range, a so-called cospan. A morphism from pA ÝÑ B ÐÝ Cq to pA 1 ÝÑ B 1 ÐÝ C 1 q is given by a morphism A ÝÑ A 1 in P that respects syzygies, a condition which can formally be expressed similarly to the corresponding condition in the case of matrices over R. We interpret the objects pA γ ÝÑ B ρ ÐÝ Cq of QpPq as entities that "behave" like the subquotient impγq impγqXimpρq , even though neither images nor quotients do have to exist in P.
In this paper, whenever we describe the constructive aspects of the presented theory, we appeal to an intuitive understanding of the concept of an algorithm or a data structure, see [12,Introduction]. All constructions are written in a way such that an implementation in a software project like Cap (categories, algorithms, programming) [10] becomes possible.
In Section 2, we formally construct the category QpPq and describe the main algorithmic problem one needs to be able to solve within P in order to be able to work algorithmically with QpPq: the so-called syzygy inclusion problem (see Definition 2.4). If P has decidable syzygy inclusion, we show how to compute cokernels, universal epi-mono factorizations, lifts along monomorphisms, and colifts along epimorphisms in QpPq.
In Section 3, we prove (Corollary 3.9) that QpPq identifies with the smallest full and replete subcategory of the category of all additive functors P op Ñ Ab (mapping to the category of abelian groups Ab) which contains the representable functors Hom P p´, Aq for A P P and is closed under the operations of taking cokernels and images. In particular, we get a full and faithful functor fppP op , Abq ãÑ QpPq which realizes the category of all finitely presented functors fppP op , Abq as a full subcategory of QpPq. If P " Rows R , then contravariant additive functors to Ab identify with R-modules, and fppRows op R , Abq with the category of finitely presented R-modules. In this case, QpRows R q can be seen as the smallest full and replete subcategory of all R-modules that contains the row modules R 1ˆn for all n ě 0 and is closed under cokernels and images.
By a theorem of Freyd [6], fppP op , Abq is an abelian category if and only if P has weak kernels. We prove that the same characterization holds for QpPq (Theorem 4.1), and show explicitly how weak kernels can be used to construct kernels in QpPq in Section 4. We also introduce the notion of a biased weak pullback in P, which, from an algorithmic point of view, turns out to be more effective in the construction of kernels in QpPq. Finally, we prove that fppP op , Abq and QpPq are equivalent as abstract categories if and only if QpPq is abelian, which, as a byproduct, yields an interesting result that only concerns the category fppP op , Abq: it is abelian if and only if it has epi-mono factorizations.
In the last Section 5, we give an example of a non-coherent ring R, i.e., a ring such that the category Rows R does not admit weak kernels, but which nevertheless has decidable syzygy inclusion (Theorem 5.2). It follows from our discussion in Section 4 that the inclusion fppRows op R , Abq ãÑ QpRows R q is proper. Thus, we may algorithmically perform all the constructions listed in Section 2 within QpRows R q, and this for a greater class of R-modules than finitely presented ones.
To conclude, we discuss how our category constructor Qp´q can also yield a computational model for graded modules, and for finitely presented functor categories on module categories by an iterated application.

Convention.
Given morphisms γ AC : A Ñ C, γ AD : A Ñ D, γ BC : B Ñ C, and γ BD : B Ñ D in an additive category P, we denote the induced morphism between direct sums using the row convention, i.e.,ˆγ We use the notation α¨β : A Ñ C for the composition of morphisms α : A Ñ B and β : B Ñ C, since then, composition of morphisms between direct sums simply becomes matrix multiplication. Given two subobjects U, V ãÑ W in an abelian category, we use the simplified notation U V in order to denote the subquotient U`V V » U U XV of W . We also occasionally use the standard abbreviations epis, monos, isos for epimorphisms, monomorphisms, and isomorphisms, respectively. A mono that arises as the kernel of some morphism in a pointed category is called a normal mono.
A universal epi-mono factorization is an essentially unique factorization of a morphism into an epi followed by a mono. For brevity we also refer to such a factorization as an epi-mono factorization.
Throughout the paper, a functor between two additive categories is always meant to be an additive functor.
The symbol Z ě0 denotes the set of non-negative integers.

The category QpPq
In this section, P always denotes an additive category. The goal is to formally construct an additive category QpPq that admits cokernels and epi-mono factorizations together with a full additive embedding P Ď QpPq. As a running example, the reader can think of P as Rows R , i.e., the full subcategory of R-modules R-Mod generated by row modules R 1ˆn for n P Z ě0 , where R is any unital ring. Morphisms in Rows R will be tacitly identified with matrices over R. The category QpRows R q will turn out to be equivalent to the smallest full and replete subcategory of R-Mod that contains Rows R and is closed under taking cokernels and images in R-Mod.

The category of syzygies
A cospan in P is simply a pair of morphisms 1. Objects, which we also call syzygies, are given by morphisms S σ ÝÑ A in P such that there exists another morphism ω : S ÝÑ C, which we call a syzygy witness, rendering the diagram commutative. Whenever we depict a syzygy by a commutative diagram like the one above, we will draw the syzygy witness with a dashed arrow.

A morphism from a syzygy S
σ ÝÑ A to a syzygy S 1 σ 1 ÝÑ A is given by a morphism τ : S Ñ S 1 such that τ¨σ 1 " σ, i.e., the following diagram commutes: in R-Mod, hence the name category of syzygies. Here, the morphism | γ is given as follows: first, we coastrict γ to its image and obtain the morphism | γ : R 1ˆa ÝÑ impγq. Second, we compose | γ with the natural projection impγq impγq impρq and obtain the desired morphism | γ. Recall that by our convention, impγq impρq is shorthand for impγq impρqXimpγq .

The syzygy inclusion problem
In this subsection, we state an algorithmic problem for P that will turn out to be the key to a computational approach to the yet to be constructed category QpPq.
Definition 2.4. We say that P has decidable syzygy inclusion if it comes equipped with an algorithm whose input is a pair of cospans in P with the same first object and whose output is a constructive answer to the question whether we have an inclusion of full subcategories of the slice category of P over the object A. By a constructive answer, we mean that in the case when the algorithm answers affirmatively, it also provides an additional algorithm pS ÐÝ Cq together with a corresponding syzygy witness ω to a syzygy witness ω 1 that proves σ P SyzpA Definition 2.5. We say that P has decidable lifts if it comes equipped with an algorithm whose input is a diagram Remark 2.7. Having decidable syzygy inclusion can also be rephrased as follows: P has decidable lifts, and we have an algorithm that decides with a simple yes/no answer. For if the algorithm answers yes, we may produce our desired syzygy witnesses using the algorithm for computing lifts.
Example 2.8. In our running example P " Rows R , given two cospans with the same first object pR 1ˆa γ ÝÑ R 1ˆb ρ ÐÝ R 1ˆc q and pR 1ˆa γ 1 ÝÑ R 1ˆb 1 ρ 1 ÐÝ R 1ˆc 1 q, being able to solve their syzygy inclusion problem implies being able to decide the existence of dashed arrows rendering the following diagram with exact rows commutative: Indeed, the rows of a syzygy σ P R sˆa in SyzpR 1ˆa γ ÝÑ R 1ˆb ρ ÐÝ R 1ˆc q for s P Z ě0 can be regarded as a collection of s-many elements in kerp | γq, and asking for the existence of the dashed arrows is the question of whether these rows are also lying in kerp | γ 1 q, which is equivalent to σ being a syzygy in SyzpR 1ˆa can always be answered in the case when R is a (left) computable ring, a notion introduced by Barakat and Lange-Hegermann in [2]. It is defined as a ring that comes equipped with two algorithms: 1. (Algorithm for deciding lifts): given matrices A P R mˆn and B P R qˆn for m, n, q P Z ě0 , decide whether there exists an X P R qˆm such that and in the affirmative case compute such an X.
2. (Algorithm for computing row syzygies): given a matrix A P R mˆn , compute o P Z ě0 and L P R oˆm such that L¨A " 0, and L is (weakly) universal with this property, i.e., for any other T P R pˆm , p P Z ě0 , such that T¨A " 0, we can find a (not necessarily unique) U P R pˆo such that U¨L " T .
Prominent examples of (commutative) computable rings are quotients of polynomial rings krx 1 , . . . x n s for n P Z ě0 by ideals generated by finitely many prescribed polynomials, where k is a computable field k (like Q). This is mainly due to Gröbner basis techniques (see, e.g., [8]). Also, localizations of computable commutative rings R at a multiplicative set S turn out to be computable provided that one may algorithmically determine witnesses for the intersection of finitely generated ideals I Ď R with S being non-empty [16].
Left computable rings are in particular left coherent, i.e., the category of finitely presented left R-modules is abelian. In particular, kerp | γq and kerp | γ 1 q both are finitely presented modules in this case, and the computability of R ensures that we can algorithmically test the inclusion of the finitely many generators 2 of kerp | γq in kerp | γ 1 q.
In Section 5, we will give an example of a non-coherent ring R for which Rows R nevertheless has decidable syzygy inclusion, even though kerp | γq might not be finitely generated.

An auxiliary category
We define an auxiliary additive category AuxpPq. Later, QpPq will arise as a quotient of AuxpPq. Definition 2.9. The additive category AuxpPq is defined by the following data: (1) An object in AuxpPq is given by a cospan in P. We will write such an object as even though Ω A and R A do not formally depend 3 on A.
ÐÝ R B q is given by a morphism α : A Ñ B in P that respects syzygies, i.e., We call this the well-definedness property of the given morphism α in P w.r.t. the source pA (3) Composition and identities are inherited from P.
Remark 2.10. If P has decidable syzygy inclusion, then we can decide the well-definedness property by testing SyzpA Remark 2.11. Composition in AuxpPq is well-defined, i.e., the composition of two morphisms satisfying the well-definedness property again satisfies the well-definedness property. Indeed, given two well-defined morphisms then any syzygy σ P SyzpA which in turn defines a syzygy Remark 2.12. Addition of morphisms in AuxpPq is well-defined. Two well-defined morphisms since the sum of two syzygies having the same source is again a syzygy (simply by adding their syzygy witnesses). The same holds for subtraction. Moreover, the zero morphism It follows that AuxpPq is an Ab-category, i.e., enriched over abelian groups.
since any syzygy σ of the source with witness ω defines a syzygy σ¨ι j of the range with witness ω¨ι j . Similarly, the projections since any syzygy σ of the source with witness ω defines a syzygy σ¨π j of the range with witness ω¨π j . Thus, AuxpPq is also an additive category.
Theorem and Definition 2.14. Let IpPq denote the collection of all morphisms

commutative. Then IpPq forms an ideal of AuxpPq.
Proof. Clearly, all zero morphisms lie in IpPq. Moreover, given addable morphisms α, β P IpPq, we can add their witnesses for being zero to deduce α`β P IpPq.
Next, let pA ÐÝ R C q be two composable morphisms in AuxpPq. If β P IpPq with ζ a witness for being zero, then α¨β P IpPq with α¨ζ a witness for being zero.
If α P IpPq, then α is a syzygy in SyzpB ÐÝ R B q. By the well-definedness property of β, α¨β is a syzygy of SyzpC ÐÝ R C q, which also implies α¨β P IpPq. Thus, IpPq is a collection of abelian subgroups closed under left and right multiplication, or in other words, an ideal of AuxpPq.
Accepted in Compositionality on 2020-05-27. Click on the title to verify.

Definition of the category QpPq
Recall that for any additive category A and any ideal I of A, the additive quotient category A{I has the same objects as A, and
Remark 2.16. Morally, we shall think of an object pA QpPq as a representation of the quotient object " impγ A q impρ A q ". The "Q" in QpPq stands for quotient. Remark 2.17. If P has decidable syzygy inclusion, then we can decide equality of morphisms in QpPq. Deciding equality of two morphisms α and β in QpPq means deciding whether α´β is zero, which is a lifting problem, which we can solve using Remark 2.6.

Notation 2.18. Given a morphism
the corresponding morphism in QpPq.

Construction 2.19.
We construct a full and faithful additive functor emb : P Ñ QpPq that identifies P as a full subcategory of QpPq. On objects, we set and on morphisms, we set

Correctness of the construction. Syzygies in
The objects in P yield a convenient way to cover the objects in QpPq.

Lemma 2.20. Identities of objects in P yield well-defined epimorphisms in QpPq:
Proof. Well-definedness is trivial since syzygy witnesses can be given by zero morphisms. Moreover, being an epimorphism follows from Lemma 2.21.

Lemma 2.21. Every morphism in QpPq of the form
such that id B¨τ " 0, this means that there exists ζ : B Ñ R T such that which implies that τ is already zero.
Accepted in Compositionality on 2020-05-27. Click on the title to verify.

Cokernels
As a first main feature of QpPq, we show how to construct cokernels.

Construction 2.22 (Cokernels). Given a morphism
in QpPq, the following diagram shows us how to construct its cokernel projection along with the universal property: (1) How to read this diagram: the solid arrow pointing up right is the cokernel projection, the solid arrow pointing down right is a test morphism for the universal property of the cokernel, and the dashed arrow pointing straight down is the morphism induced by the universal property. The dotted arrow labeled with ζ is a witness for the composition α¨τ in QpPq being zero, i.e., it denotes a morphism ζ : A Ñ R T such that ζ¨ρ T " α¨τ¨γ T .
Correctness of the construction. Clearly, the morphism id B for the cokernel projection is welldefined, since syzygy witnesses of objects in SyzpB Composing α with the cokernel projection yields zero since we can take the natural inclusion A Ñ R B ' A as a witness for being zero. Next, we have to check well-definedness of the cokernel induced morphism. Given a syzygy e can construct another one: Accepted in Compositionality on 2020-05-27. Click on the title to verify. Now, applying the well-definedness property of the test morphism, we obtain the syzygy We deduce that τ is a syzygy by computing Thus, the cokernel induced morphism is well-defined and it clearly renders the triangle in (1) commutative. For the uniqueness of the induced morphism, it suffices to check that the cokernel projection is an epimorphism, which is the content of Lemma 2.21.

Lifts along monomorphisms
We show that every monomorphism in QpPq is the kernel of its cokernel by means of the following construction.
Construction 2.23 (Lifts along monomorphisms). The following diagram shows us how to construct a lift along a given monomorphism in QpPq for a given test morphism: ccepted in Compositionality on 2020-05-27. Click on the title to verify.
How to read this diagram: the solid horizontal arrow is the cokernel projection of our monomorphism α (see Construction 2.22). The dotted arrow is a witness for the composition of the test morphism τ with the cokernel projection being zero, i.e., the equation holds. The upwards pointing dashed arrow is the desired lift.
Correctness of the construction. First, we show that ζ 2 is well-defined. Given a syzygy we can use the fact that τ satisfies the well-definedness property in order to get a syzygy Using (3), we can construct another syzygy 1 whose syzygy witness can also be interpreted as a witness for the composition of in QpPq being zero. Since α is a monomorphism, this implies σ¨ζ 2 " 0, and so we get our desired syzygy: A (3) in QpPq is a monomorphism if and only if If α is a monomorphism, and σ P SyzpA is zero, and thus σ is zero, which implies σ P SyzpA Conversely, we can test being a monomorphism on compositions of the form which is equivalent to σ being zero.

Universal epi-mono factorizations
As another decisive feature, QpPq admits universal epi-mono factorizations, i.e., essentially unique epi-mono factorizations, and thus in particular images.
Remark 2.27. Since we proved in Construction 2.23 that every mono in QpPq is a normal mono, the theory of factorizations as it is presented in [5,Section 2] implies that it suffices to prove that every morphism in QpPq admits a factorization into a mono and an epi in order to conclude this factorization is already universal. Nevertheless, in Construction 2.28, we will make the universality of the epi-mono factorization explicit, since from the perspective of a computer implementation, it is helpful to have concrete formulas at hand.

Construction 2.28 (Universal epi-mono factorization). Given a morphism
in QpPq, the following diagram shows us how to construct its universal epi-mono factorization along with its universal property: How to read this diagram: the universal epi-mono factorization of α is given by the upper triangle. Furthermore, if τ 1 and τ 2 form another epi-mono factorization of α, then the dashed vertical arrow is the isomorphism induced by its universal property.
Correctness of the construction. The map Accepted in Compositionality on 2020-05-27. Click on the title to verify.
is well-defined. Furthermore, the map is always well-defined. Thus, we verified that the candidate for the universal epi-mono factorization consists of well-defined morphisms. Lemma 2.21 shows that id A is an epimorphism, and Lemma 2.26 proves that we really have an epi-mono factorization.
To check the well-definedness property of the induced morphism, we start with a syzygy and see that the syzygy witness λ can be interpreted as a witness for the composition and τ 2 being a monomorphism we conclude σ¨τ 1 " 0, which gives us the desired syzygy: Thus, the induced morphism is well-defined. It is easy to check that it renders the whole epi-mono factorization diagram commutative: the lower left triangle commutes already in AuxpPq, and from this, the commutativity of the lower right triangle is implied. Last, since the induced morphism is an epimorphism and a monomorphism, Corollary 2.24 proves that it is an isomorphism. Thus, we have successfully constructed a universal epi-mono factorization.

Colifts along epimorphisms
The category QpPq does not necessarily have kernels (see Theorem 4.1). Thus, it does not make sense to ask for every epimorphism to be the cokernel of its kernel. However, the following construction serves as an appropriate substitute.

Construction 2.29 (Colifts along epimorphisms). Let
be an epi in QpPq. Then, its cokernel projection is the zero morphism. Using the explicit construction of the cokernel projection in Construction 2.22, this means that there exists a morphism The following diagram shows us how to construct a colift along the epimorphism α for a given test morphism τ , where test morphism means that τ satisfies the following property: whenever we have a morphism κ in QpPq such that κ¨α " 0, we also have κ¨τ " 0.
Remark 2.30. If P has decidable syzygy inclusion, then we can decide whether a given τ yields a test morphism: indeed, using Lemma 2.20, this is the case if and only if Correctness of the construction. First, we show that the colift ζ 2¨τ satisfies the well-definedness property. Given a syzygy we conclude by multiplying (4) with σ from the left that is also a syzygy, whose syzygy witness can be interpreted as a witness for the composition in QpPq being zero. Since τ is a test morphism, this implies that the composition is zero as well, which gives us the desired well-definedness property.
To show that ζ 2¨τ is really a colift, we multiply (4) with α from the left to see that the composition is also zero. If ζ 3 denotes a witness for this composition being zero, then the equation holds, which means that the diagram (5) commutes.
Accepted in Compositionality on 2020-05-27. Click on the title to verify.

The category QpPq as a subcategory of the category of modules
Let P be an additive category 4 . We denote the category of contravariant additive functors from P to the category of abelian groups Ab by Mod-P and call it the category of right P-modules. Example 3.1. An additive functor F : Rows op R Ñ Ab is uniquely determined up to natural isomorphism by its restriction to the full subcategory of Rows op R spanned by R 1ˆ1 , since it respects direct sums. The image F pR 1ˆ1 q is an abelian group, and the action of F on morphisms encodes a left action of R on F pR 1ˆ1 q, giving it the structure of a left R-module. In this way, we get an equivalence of categories 5 R-Mod » Mod-Rows R .

Notation 3.2. We let
P ÝÑ Mod-P : P Þ Ñ p´, P q denote the Yoneda embedding, where p´, P q is shorthand notation for Hom P p´, P q.

Remark 3.3 (A short interlude on working with Mod-P). Since
Mod-P is a functor category, all limits and colimits are computed pointwise, i.e., after evaluation at every object A P P, see, e.g., [11,Chapter V.3]. Since Mod-P is abelian, the pointwise constructions apply in particular to kernels, cokernels, and images. Deciding whether a morphism in Mod-P is mono/epi can also be decided pointwise, since it is equivalent to the kernel/cokernel being zero, which can be decided pointwise. For every A P P and F P Mod-P, the Yoneda lemma states that a morphism p´, Aq Ñ F is uniquely determined by choosing an image x P F pAq of the element id A P pA, Aq, and every such choice is valid. In particular, the Yoneda lemma implies that the object p´, Aq P Mod-P is projective in Mod-P.
The goal of this section is to construct a functor M : QpPq ÝÑ Mod-P.
We proceed in several steps.

Construction 3.4.
As a first step, we are going to construct a functor M : AuxpPq ÝÑ Mod-P on objects. From an object pA For the action of M on morphisms, we need the following lemma.

Lemma 3.5. A morphism α : A Ñ B in P induces a well-defined morphism between two objects
ÐÝ R B q in AuxpPq if and only if p´, αq restricts as follows: Proof. We compute the evaluation of kerp A q at P P P: Thus, we get a commutative diagram for every evaluation at P P P if and only if the well-definedness property holds.
Construction 3.6. By Lemma 3.5 we can define the action of M on a morphism α : pA in AuxpPq by the unique morphism completing the following commutative diagram: Functoriality of M is implied by the functoriality of taking cokernels of commutative squares. The same holds for additivity.
Lemma 3.7. Given a morphism α : pA where M is the functor described in the Constructions 3.4 and 3.6 and IpPq is the ideal defined in Theorem and Definition 2.14.
Proof. From the diagram (6), we see that M pαq " 0 if and only if there exists a commutative diagram p´, Aq kerp B q p´, Bq.

p´, αq
By the Yoneda lemma, this is equivalent to α P kerp B qpAq, i.e., α P SyzpB ÐÝ R B q, which exactly means α P IpPq. Proof. We use the notation of Construction 3.4. Since QpPq " AuxpPq{IpPq, we get a faithful induced additive functor M by Lemma 3.7. Furthermore, since representable functors are projectives in Mod-P, every natural transformation imp´,γ A q imp´,ρ A q Ñ imp´,γ B q imp´,ρ B q can be lifted to a natural transformation p´, Aq Ñ p´, Bq and from Lemma 3.5, it follows that M is full.
Next, let α : pA denote an arbitrary morphism in QpPq. We have a commutative diagram of the form We compute im`M pαq˘" im` A¨M pαq" im pp´, αq¨ B q which yields for every P P P: which is exactly the application of M to the cokernel projection described in Construction 2.22. Thus, M respects cokernels.
To show that M respects images, it suffices to prove that it respects monos and epis, since this implies that it respects epi-mono factorizations. Since M is additive and respects cokernels, it follows that M respects epimorphisms. Now, let denote a mono in QpPq. In order to test whether M pαq is a mono, the Yoneda lemma implies that it suffices to check test morphisms of the form So, given τ as above which also is a test morphism, i.e., such that τ¨M pαq " 0, it can be written as in QpPq (in fact, M˝emb is the Yoneda embedding). Since α is a mono, it follows that τ 1 " 0, and thus M pτ 1 q " τ " 0.
Recall that a subcategory A of a category B is called replete if for any X P A and isomorphism ι : X Ñ Y in B, ι belongs to A. We get a characterization of the essential image impM q Ď Mod-P, i.e., the smallest full replete subcategory generated by all objects of the form M pA Note that by Theorem 3.8, we have an equivalence QpPq » impM q.

F is closed under taking images in Mod-P.
Proof. The essential image of M satisfies these three properties by Theorem 3.8. Conversely, every F satisfying these properties has to contain the subquotients (7) for a given cospan pA ÐÝ R A q in P, and thus has to contain the essential image of M .
We give a short interlude on some well-known facts about the category of finitely presented functors fppP op , Abq. For an abstract treatment of fppP op , Abq, see [6] or [4], for a constructive treatment, see [14].
An additive functor F : P op Ñ Ab is called finitely presented if there exists an exact sequence p´, Bq p´, Aq F 0 p´, αq in Mod-P for a morphism α : B Ñ A in P. Now, fppP op , Abq is defined as the full subcategory of Mod-P generated by all finitely presented functors. The additive category fppP op , Abq is closed under taking cokernels in Mod-P, and thus can be characterized similarly to impM q: it is the smallest full and replete additive subcategory of Mod-P which contains all representable functors and is closed under taking cokernels. In particular, Corollary 3.9 implies fppP op , Abq Ď impM q, which brings us to a second characterization. Proof. Equation (7) in the proof of Corollary 3.9 shows that every object in impM q is given as an image of a morphism between finitely presented functors.
As we have seen in Section 2, the category impM q admits a diagrammatic approach via the category QpPq which allows for a computer implementation. The same is true for the category fppP op , Abq: it is equivalent to the so-called Freyd category ApPq whose objects are given by morphisms pA ρ Ð Rq in P, and a morphism from pA commutative. Such a diagram represents the zero morphism if and only if α factors as α " λ¨ρ 1 for some morphism A λ Ñ R 1 . For details on possible constructions in ApPq, we refer the reader to [14,Section 3]. We have an equivalence of categories given by: Moreover, it is easy to see that the mapping gives rise to a functor such that we end up with a diagram of functors commutative up to natural isomorphism. In the next section, we will characterize the case in which the inclusion fppP op , Abq Ď impM q is an equivalence.

The abelian case
The goal of this section is to prove the following characterization of the abelian case. The first two subsections in this section are devoted to the construction of kernels in QpPq, and the third subsection to the proof of Theorem 4.1.

A weakening of weak pullbacks
A weak limit of a diagram in a category can be defined exactly as one would define a limit, but without requiring the morphism induced by its universal property to be uniquely determined. Applied to the concept of a pullback, the resulting notion is known as a weak pullback. In this section, we introduce a further weakening: we give up the commutativity of one of the two resulting triangles in the common pullback diagram describing its universal property. 1. An object P pα, γq P P.
Thus, we have the following diagram in which only the indicated parts commute, and the dashed morphism is not necessarily uniquely determined:  1. P has biased weak pullbacks, 2. P has weak pullbacks, Proof. If P has biased weak pullbacks, then P pA α ÝÑ B, 0ÝÑBq is a weak kernel of α. Moreover, we can construct weak pullbacks from direct sums and weak kernels. Last, every weak pullback is also a biased weak pullback.
Despite the statement of Lemma 4.4, biased weak pullbacks are important for us because of two reasons: 1. They have fewer constraints than weak pullbacks and are thus easier to compute.
2. They are all we need in the construction of kernels in QpPq.
We demonstrate the first of these arguments with our running example Rows R .
is a biased weak pullback in Rows R with biased weak pullback projection π if and only if impπq " α´1pimpγqq Proof. Whenever we have a commutative square of the form we have an inclusion impτ q Ď α´1pimpγqq. Now, if impπq " α´1pimpγqq, then we get a morphism upτ q by the projectivity of R 1ˆt in R-Mod rendering the diagram commutative. Thus, we get a biased weak pullback. Conversely, let R 1ˆp and π define a biased weak pullback. For a given v P α´1pimpγqq there is a w P R 1ˆc such that we get a commutative diagram Accepted in Compositionality on 2020-05-27. Click on the title to verify.
where we identify the element v (resp. w) with the map starting from R 1ˆ1 that sends 1 to v (resp. w). Using the weak universal property, we get v " upvq¨π which means v P impπq.
Using Lemma 4.5 we can demonstrate that a biased weak pullback can significantly differ from a weak pullback. We provide a simple example: Example 4.6. By Lemma 4.5, the cospan R 1ˆa 0 ÝÑ 0 0 ÐÝ R 1ˆc in Rows R admits a biased weak pullback with projection R 1ˆa id ÝÑ R 1ˆa . Assume there exists an ω : R 1ˆa Ñ R 1ˆc such that id R 1ˆa and ω define the projections of a weak pullback. Then there has to exist a commutative diagram of the form hich is absurd if c ą 0, since commutativity of the upper triangle implies u 1 " 0, u 2 " id, and commutativity of the lower triangle implies id " u 1¨ω " 0.
Note that R 1ˆc ' R 1ˆa together with its projections to its factors is actually a (weak) pullback of the given cospan, so, this example demonstrates that the computation of biased weak pullbacks instead of weak pullbacks might result in a significant decrease in the number of needed generators (in this concrete example, we save c-many generators).
For computational reasons, whenever it suffices to work with biased weak pullbacks instead of weak pullbacks, one should do so.

Kernels
We show how to construct kernels in QpPq provided P has biased weak pullbacks.

Construction 4.7. Given a morphism
in QpPq, the following diagram shows us how to construct its kernel embedding along with the universal property: How to read this diagram: the solid arrow pointing down right is the kernel embedding, the solid arrow pointing up right is a test morphism for the universal property of the kernel, and the dashed arrow pointing straight up is the morphism induced by the universal property. The biased weak pullback diagram needed in this construction looks as follows: Note that ζ is simply a witness for the composition τ¨α being zero.
Correctness of the construction. To shorten notation we denote the candidate for the kernel object by p K. Any syzygy witness of a σ P Syzp p Kq can also be used as a syzygy witness of σ¨πpα¨γ B , ρ B q in SyzpA Thus, the well-definedness property of the kernel embedding holds. Furthermore, we can take ω as a witness for the composition of the kernel embedding with α being zero. Moreover, the kernel embedding is a mono by Lemma 2.26.
Next, let σ P SyzpT ÐÝ R A q, and since τ " upτ q¨πpα¨γ B , ρ B q, it follows that σ¨upτ q P Syzp p Kq. Thus, the well-definedness property of the kernel induced morphism holds.
Last, the commutativity of the triangle in the kernel diagram already holds in AuxpPq.
Note that at no point in this proof did we need commutativity of the lower triangle in the biased weak pullback diagram. This justifies our introduction of the concept of a biased weak pullback.

Proof of the characterization of the abelian case
Proof of the equivalence of statements p1q´p3q in Theorem 4.1.
p1q ùñ p2q: If P has weak kernels, then it has biased weak pullbacks by Lemma 4.4. It follows from Construction 4.7 that QpPq has kernels. p2q ùñ p3q: Construction 2.29 proves that every epimorphism is the cokernel projection of its kernel embedding in the case when QpPq has kernels, which is true by assumption. All the other axioms of an abelian category hold due to the constructions in Section 2. p3q ùñ p1q: Given a morphism α : A Ñ B in P, compute the kernel embedding κ : pK Ñ Ω K Ð R K q ÝÑ embpAq of embpαq in QpPq. Then κ : K Ñ A is a weak kernel of α.
We say an additive functor F : P op Ñ Ab is finitely generated if it admits an epimorphism p´, Aq F in Mod-P for some A P P. We will need the facts listed in the following lemma, for which we will provide proofs for the sake of completeness. See Remark 3.3 for a recall of working with functor categories.

Suppose given a short exact sequence
in Mod-P. If F 3 is finitely presented and if F 2 is finitely generated, then F 1 is also finitely generated.
Proof. p1q: Let F , G be finitely presented functors with presentations p´, Aq Ñ p´, A 1 q and p´, Bq Ñ p´, B 1 q, respectively. A morphism ν : F Ñ G lifts to a morphism p´, A 1 q Ñ p´, B 1 q, since representable functors are projectives in Mod-P by Remark 3.3. Computing pointwise, we see that the cokernel of ν in Mod-P is given by the cokernel of p´, A 1 ' Bq Ñ p´, B 1 q, and thus, it is finitely presented. So, the inclusion respects cokernels and in particular epis. Furthermore, we have the following equivalences: ν is a mono in fppP op , Abq ðñ @τ : T Ñ F P fppP op , Abq : pτ¨ν " 0q ñ pτ " 0q ðñ @A P P : @x P F pAq :`p´, Aq ðñ @A P P : @x P F pAq : pνpxq " 0q ñ px " 0q ðñ ν is a mono in Mod-P, where we identify elements in F pAq with their corresponding natural transformations due to the Yoneda lemma. p2q: The proof is the same as for modules over a ring, but now in the context of functors. Let p´, Aq Ñ p´, A 1 q be a presentation of F 3 . Then we get a commutative diagram with exact rows by the projectivity of p´, A 1 q and the universal property of the kernel of F 2 Ñ F 3 . The snake lemma implies cokerpβq » cokerpαq.
Since F 2 is finitely generated, it admits an epimorphism p´, Bq F 2 and so does cokerpβq » cokerpαq. Now, from a projective lift p´, Bq p´, Aq F 1 cokerpαq 0 α λ we can finally construct our desired epimorphism p´, A ' Bq F 1 .
Proof of the equivalence of statements p1q, p4q´p7q in Theorem 4.1. p1q ùñ p4q: If P has weak kernels, then Freyd has shown that fppP op , Abq is abelian (see [14] for a constructive proof).
p4q ùñ p5q: Since the inclusion fppP op , Abq Ď Mod-P respects cokernels and epi-mono factorizations (in particular images) by Lemma  since p´, T q is projective. Now, by the Yoneda lemma, the dashed morphism arises from a uniquely determined morphism T Ñ K in P.

A non-coherent ring with decidable syzygy inclusion
Let k be a field. In this subsection, we study the ring from a computational point of view.
Remark 5.1. R is not a coherent ring, since the kernel of the R-module homomorphism R ÝÑ R : r Þ Ñ r¨z is given by which cannot be finitely generated as an R-module.
It follows that Rows R does not have weak kernels 6 . From Theorem 4.1, we can conclude that QpRows R q is not abelian, and we cannot expect to compute kernels in this category. However, the following theorem implies that we can nevertheless perform all the constructions listed in Section 2 within QpRows R q.

Theorem 5.2. If k is a computable field, then the category Rows R has decidable syzygy inclusion.
For the proof, we proceed in three steps.
1. We give a simplification of the syzygy inclusion problem for an arbitrary additive category P (Corollary 5.4).
2. We give an explicit description of the row syzygies for matrices over R (Lemma 5.7).
3. We solve the simplified syzygy inclusion problem for Rows R (Subsubsection 5.1.3).

Lemma 5.3. Let P be an additive category. Let
be a pair of cospans in P with the same first object. Then Proof. "ùñ": Given a syzygy 6 A weak kernel embedding of the morphism R 1ˆ1 z Ñ R 1ˆ1 in Rows R would be a column R 1ˆm Ñ R 1ˆ1 whose m P Z ě0 entries span the kernel of R 1ˆ1 z Ñ R 1ˆ1 in R-Mod which is impossible by Remark 5.1.
e can construct another one: By assumption, this gives us the syzygy witness ω in the diagram which finally yields the desired syzygy we can construct another one: Sˆγ ρσ´ωB y assumption, we get the syzygy witness ω 1 in the diagram

Describing row syzygies of matrices over R
We define several computable subrings of R " krx i , z | i P Ns{xx i z | i P Ny that help us in computing row syzygies. We set R n :" krx 1 , . . . , x n , zs{xx 1 z, . . . , x n zy for n P N which identifies both as a subring and as a quotient ring of R. Moreover, we will regard the polynomial rings krxs :" krx i | i P Ns and krzs as subrings of R.
Remark 5.5. If k is a computable field, then all the rings R n , n P N, krxs, and krzs are also computable. For quotients of polynomial rings in finitely many variables like R n and krzs, this follows from Gröbner bases techniques (see, e.g., [8]). For the polynomial ring in infinitely many variables krxs, note that krxs is a free krx 1 , . . . , x m s module for every m P N. In particular, the inclusion krx 1 , . . . , x m s ãÑ krxs is flat, which implies that we may compute the row syzygies of a given matrix over krxs by computing the row syzygies of the same matrix considered over krx 1 , . . . , x m s for sufficiently large m.
Remark 5.6. We can decompose R at the level of k-vector spaces as R " krxs '`z¨krzs˘.
For p P R, we write p " p x`pz for the corresponding decomposition of the element, i.e., p x P krxs and p z P z¨krzs.
For any ring S and any matrix M P S aˆb , a, b P Z ě0 , we write ker S pM q :" tv P S 1ˆa | v¨M " 0u for the row kernel of M . The next lemma reduces the problem of finding infinitely many generators for the row syzygies of matrices over R to finding finitely many generators of row syzygies for matrices over the coherent subrings R n and krxs. Proof. Given any row pq i q i P R 1ˆa , we decompose its entries w.r.t.
i.e., q i " s i`ti for s i P R n and t i P xx i | i ą ny R . We compute for each j " 1, . . . , b Since p ř a i"1 s i¨pij q P R n and p due to our choice of n.

Solving the syzygy inclusion problem for R
We solve the simplified syzygy inclusion problem for R, which, by Corollary 5.4, suffices to solve the syzygy inclusion problem in general, which proves Theorem 5.2. Let R 1ˆa γ ÝÑ R 1ˆb ÐÝ 0 and R 1ˆa γ 1 ÝÑ R 1ˆb 1 γ 1 ÐÝ R 1ˆc 1 be two cospans in Rows R for a, b, b 1 , c 1 P N. Our goal is to decide algorithmically whether Choose n P N such that all entries of γ, γ 1 , ρ 1 lie in R n . Next, compute generators of ker R pγq according to the description in Lemma 5.7, i.e., compute finitely many generators Proof. By Lemma 5.7, the elements σ i and x n`1¨τj lie in Syz`R 1ˆa γ ÝÑ R 1ˆb ÐÝ 0˘, so, we only have to prove the "ðù" direction. For this direction, we have to show that an arbitrary syzygy pR 1ˆs ÝÑR 1ˆa q P Syz`R 1ˆa γ ÝÑ R 1ˆb ÐÝ 0ȃ lready lies in Syz`R 1ˆa γ 1 ÝÑ R 1ˆb 1 ρ 1 ÐÝ R 1ˆc 1˘. Since such an arbitrary syzygy is nothing but a collection of s-many row syzygies, we may assume that s " 1. So, let pR 1ˆ1 σ ÝÑ R 1ˆa q P Syz`R 1ˆa γ ÝÑ R 1ˆb ÐÝ 0b e a syzygy, which means σ P ker R pγq. By Lemma 5.7, we can write σ as a sum of the form σ " p d ÿ i"1 r i¨σi q`p ÿ iąn j"1,...,e s ij¨xi¨τj q for r i , s ij P R, all but finitely many equal to zero. It follows that we only need to prove or i ą n`1. By assumption, we have which means that there exists a commutative diagram of the form For any i ą n`1, we can define a ring automorphism φ i of R by φ i pzq :" z, φ i px n`1 q :" x i , φ i px i q :" x n`1 , φ i px j q :" x j , j R ti, n`1u.
Proof of Theorem 5.2. Since k is computable, the rings R n and krxs are also computable by Remark 5.5. In particular, we may compute the finitely many elements σ 1 , . . . , σ d and x n`1τ Remark 5.9. If we start with a diagram R 1ˆa R 1ˆc R 1ˆb β α in Rows R , there exists an n P N such that all entries of α and β lie in R n . There exists a lift R 1ˆa R 1ˆc R 1ˆb β α in Rows R if and only if there exists a lift in Rows Rn , since we can always apply the natural epimorphism R R n to the entries of a lift in Rows R in order to obtain a lift in Rows Rn .

Subcategories of graded modules and functors
We have seen that the category constructor Qp´q applied to Rows R for a ring R yields a computational model for a certain subcategory of R-Mod. As a benefit of the abstraction that we made in this paper, we give two more examples of additive categories that yield interesting results when we apply Qp´q to them.
Example 5.10 (Graded modules). Let G be a group and let S be a G-graded ring, i.e., it comes equipped with a decomposition into abelian groups S " À gPG S g such that S g¨Sh Ď S gh for all g, h P G, and the multiplicative unit of S lies in S e for e the neutral element of G. For such a G-graded ring, we may define the category grRows S of graded left row modules. Its objects are given by direct sums of shifts of S (considered as a graded S-module), where the shift by g P G of a graded left S-module M " À hPG M h is defined by Morphisms in grRows S are given by G-graded S-module homomorphisms, which can be identified with matrices over S having homogeneous entries whose degrees are compatible with the shifts occurring in the source and range. Concretely, a morphism Spd 1 q '¨¨¨' Spd r q Ñ Spe 1 q '¨¨¨' Spe s q for d 1 , . . . , d r , e 1 , . . . , e s P G, r, s P Z ě0 is given by a matrix pH ij q ij P S rˆs such that H ij P S d´1 i¨e j for all i, j. A functor F : grRows op S ÝÑ Ab gives rise to a graded left S-module À gPG F pSpg´1qq, and similar to the non-graded case described in Example 3.1, we have an equivalence between Mod-grRows S and the category of graded Smodules. It follows by Corollary 3.9 that QpgrRows S q can be seen as a computational model for the smallest full and replete additive subcategory of all graded S-modules that includes shifts of S, cokernels, and images. Example 5.11 (Functors). For an additive category P, the category QpPq always has cokernels by Construction 2.22. Thus, QpPq op has kernels, so in particular weak kernels, which implies QpQpPq op q » fppQpPq, Abq by Theorem 4.1. Thus, an iterated application of Qp´q can yield a computational model for categories of finitely presented functors on QpPq.