Katetov functors

We develop a theory of \emph{Katetov functors} which provide a uniform way of constructing Fraisse limits. Among applications, we present short proofs and improvements of several recent results on the structure of the group of automorphisms and the semigroup of endomorphisms of some Fraisse limits.


Introduction
In this paper we present a uniform treatment of several apparently unrelated phenomena. One of the straightforward applications is universality of the groups of automorphisms of Fraïssé limits.
Papers [6] and [2] discuss some of the issues addressed in this paper, without realizing that what we deal with are actually functorial constructions.
Our principal motivation comes from Katětov's construction of the Urysohn space [10], which we briefly present here in the case of the rational Urysohn space. Let X be a metric space with rational distances. A Katětov function over X is every function α : X → Q such that |α(x) − α(y)| d(x, y) α(x) + α(y) for all x, y ∈ X. Let K(X) be the set of all Katětov functions over X. The sup metric turns K(X) into a metric space. There is a natural isometric embedding X ֒→ K(X) which takes a ∈ X to d(a, ·) ∈ K(X). Hence we get a chain of embeddings X ֒→ K(X) ֒→ K 2 (X) ֒→ K 3 (X) ֒→ · · · whose colimit is easily seen to be the rational Urysohn space.
It was first observed in [1] that the construction K is actually functorial with respect to embeddings. Our principal observation is that more is true: if A is the category of all finite metric spaces with rational distances and nonexpansive maps, and C is the category of all countable metric spaces with rational distances and nonexpansive maps, then K can be turned into a functor from A to C if we let K act on morphisms as follows: for a nonexpansive map f : X → Y let K(f ) : K(X) → K(Y ) take α ∈ K(X) tõ α ∈ K(Y ) whereα It is a matter of straightforward calculation to check thatα is indeed a Katětov function over Y , that K(id X ) = id K(X) and that K(g•f ) = K(g)•K(f ).

The setup
Let ∆ = R ∪ F ∪ C be a first-order language where R is a set of relational symbols, F a set of functional symbols and C a set of constant symbols. We say that ∆ is a purely relational language if F = C = ∅. For a ∆-structure A and X ⊆ A, by X A we denote the substructure of A generated by X. We say that A is finitely generated if A = X A for some finite X ⊆ A.
Let C be a category of ∆-structures. A chain in C is a chain of objects and embeddings of the form C 1 ֒→ C 2 ֒→ C 3 ֒→ · · · . Note that although there may be other kinds of morphisms in C, a chain always consists of objects and embeddings. For a C ∈ Ob(C) let Aut(C) denote the permutation group consisting of all automorphisms of C, and let End C (C) denote the transformation monoid consisting of all C-morphisms C → C. Moreover, let age(C) denote the class of all finitely generated objects that embed into C. We say that A has the joint-embedding property (briefly: (JEP)) if every two structures in A embed into a common structure in A.
Standing assumption. Throughout the paper we assume the following. Let ∆ be a first-order language, let C be a category of countably generated ∆structures and some appropriately chosen class of morphisms that includes all embeddings (and hence all isomorphisms). Let A be the full subcategory of C spanned by all finitely generated structures in C. In particular, A is hereditary in the sense that given A ∈ Ob(A), every finitely generated substructure 1 of A is an object of A. We also assume that the following holds: • C has colimits of chains: for every chain C 1 ֒→ C 2 ֒→ · · · in C there is an L ∈ Ob(C) which is a colimit of this diagram in C; • every C ∈ Ob(C) is a colimit of some chain A 1 ֒→ A 2 ֒→ · · · in A; • A has only countably many isomorphism types; and • A has the joint embedding property (JEP).
We say that C ∈ Ob(C) is a one-point extension of B ∈ Ob(C) if there is an embedding j : B ֒→ C and an x ∈ C \ j(B) such that C = j(B) ∪ {x} C . In that case we write j : B֒→ C or simply B֒→ C.
The following lemmas are immediate consequences of the fact that C is a category of ∆-structures and the fact that A is spanned by finitely generated objects in C.
Lemma 2.1 (Reachability) (a) For all A, B ∈ Ob(A) and an embedding A ֒→ B which is not an isomorphism, there exist an n ∈ N and A 1 , . . . , A n ∈ Ob(A) such that A֒→ A 1֒ → A 2֒ → · · ·֒→ A n = B.
(b) For all C, D ∈ Ob(C) and an embedding f : C ֒→ D which is not an isomorphism, there exist C 1 , C 2 . . . ∈ Ob(C) such that Lemma 2.2 Let C, D ∈ Ob(C) be structures such that f : C֒→ D and let A 1 ֒→ A 2 ֒→ . . . be a chain in A whose colimit is C. Then there exists a chain B 1 ֒→ B 2 ֒→ . . . in A whose colimit is D and Proof. Without loss of generality we can assume that C D, and that A 1 The next lemma is rather obvious. Lemma 2.3 (Factoring through the colimit) Let C 1 ֒→ C 2 ֒→ · · · be a chain in C and let L be the colimit of the chain with the canonical embeddings ι k : C k ֒→ L. Then for every A ∈ Ob(A) and every morphism f : A → L there is an n ∈ N and a morphism g : A → C n such that Moreover, if f is an embedding, then so is g.
Proof. Take any C ∈ Ob(C), and let A 1 ֒→ A 2 ֒→ · · · be a chain in A whose colimit is C. Take any B ∈ age(C). Then B ֒→ C, so by Lemma 2.3 there is an n ∈ N and an embedding g : B ֒→ A n such that

Katětov functors
Definition 3.1 A functor K 0 : A → C is a Katětov functor if: then K 0 (f ) : K 0 (A) → K 0 (B) is an embedding in C; and • there is a natural transformation η 0 : ID → K 0 such that for every onepoint extension A֒→ B where A, B ∈ Ob(A), there is an embedding g : B ֒→ K 0 (A) satisfying Theorem 3.2 If there exists a Katětov functor K 0 : A → C then there is a functor K : C → C such that: • K is an extension of K 0 (that is, K and K 0 coincide on A); • there is a natural transformation η : ID → K which is an extension of η 0 (that is, η A = η 0 A whenever A ∈ Ob(A)); • K preserves embeddings; Proof.
Clearly, K coincides with K 0 on A. Let us show how to extend K to the whole of C. We first show how to define K on objects. For each object C of C which is not an object of A fix a chain A C 1 ֒→ A C 2 ֒→ · · · in A whose colimit is C with canonical embeddings ι C n : Then, let K(C) to be the colimit of the chain K 0 (A C 1 ) ֒→ K 0 (A C 2 ) ֒→ · · · with canonical embeddings ι K(C) n : Next, let us show how to define K on morphisms. Let f : B → C be a morphism from B ∈ Ob(A) to an object C ∈ Ob(C) which is not an object of A. By Lemma 2.3 there is an n and a morphism g : Now, choose the least such n and let K(f ) = ι K(C) n The rest of the proof is rather standard.
We also say that K is a Katětov functor and from now on denote both K and K 0 by K, and both η and η 0 by η.

Example 3.3 Consider
A the category of finite graphs, C the category of all countable graphs. A typical Katětov functor assigns to a finite graph G the graph K(G) = G ∪ P(G), where each A ∈ P(G) is connected precisely to its elements. Now let G be an infinite graph. Then K(G) = G ∪ Fin(G), where Fin(X) is the family of all finite subsets of X.
where v is connected to all the vertices of G. Then there is no embedding of H extending η G : G → K(G).

Examples
Example 3.4 A Katětov functor on the category of all finite metric spaces with rational distances and nonexpansive maps was described in Section 1. This is the original Katětov functor.
In the examples below let P 2 (X) = {Y ⊆ X : |Y | = 2}, and let P fin (X) denote the set of all finite subsets of X.

Example 3.5 A Katětov functor on the category of all graphs and graph ho-
For a graph homomorphism f : Moreover, if f is an embedding, then so is f * .
Example 3.6 A Katětov functor on the category of all K n -free graphs and graph embeddings. Fix an integer n 3. Let V, E be a K n -free graph, where E is the set of some 2-element subsets of For a graph embedding f : Example 3.7 A Katětov functor on the category of all digraphs and digraph homomorphisms.
For a digraph homomorphism f : Moreover, if f is an embedding, then so is f * .
Then it is easy to see that * is a linear order on A * . For a monotonous map f : Moreover, if f is an embedding, then so is f * .
Example 3.9 A Katětov functor on the category of all partially ordered sets and monotonous maps. Let 3 be the three element linear order 0 < 1 2 < 1. For a partially ordered set A, Then it is easy to see that * is a partial order on A * . For a monotonous map f : Moreover, if f is an embedding, then so is f * . Example 3.10 A Katětov functor on the category of all tournaments and embeddings. For a finite set A and a positive integer n let A n be the set of all sequences a 1 , . . . , a k of elements of A where k ∈ {0, 1, . . . , n}. In case of k = 0 we actually have the empty sequence , as we will be careful to distinguish the 1-element sequence a from a ∈ A. For a sequence s ∈ A n let |s| denote the length of s. For a tournament T = V, E where E ⊆ V 2 let n = |V | and let T n be the tournament whose set of vertices is V n and whose set of edges is defined lexicographically as follows: • if s and t are sequences such that |s| < |t|, put s → t in T n ; • if s = s 1 , . . . , s k and t = t 1 , . . . , t k are distinct sequences of the same length, find the smallest i such that s i = t i and then put , v does not appear as an entry in s}.
Then it is easy to see that V * , E * is a tournament. For an embedding f : ). This turns K into a functor from the category of finite Boolean algebras into itself which preserves embeddings and such that η : ID → K is a natural transformation.
In order to see that K is indeed a Katětov functor, let us first note . . , a n })) which makes the diagram (1) commute can be defined as the unique Boolean algebra homomorphism such that g(b 0 ) = 0, a 1 , g(b 1 ) = 1, a 1 and g(b i ) = 0, a i ∨ 1, a i for i 2.
For n ∈ N define η n : ID → K n as η n Proof. If g is an isomorphism, take n = 1 and h = η A • g −1 . Assume, therefore, that g is not an isomorphism. Then by Lemma 2.1 (a) there exist an n ∈ N and A 1 , . . . , A n ∈ Ob(A) such that It is easy to see that the diagram in Fig. 1 commutes: the triangles commute by the definition of a Katětov functor, while the parallelograms commute because η is a natural transformation. So, take

Sufficient conditions for the existence of Katětov functors
Let us now present some sufficient conditions for the existence of Katětov functors. Let ∆ be a purely relational language, let A be a ∆-structure, and let The free amalgam of the B i 's over A is the ∆-structure C with universe {B i : i ∈ I} such that each B i is a substructure of C and for every R ∈ ∆ we have that R C = {R B i : i ∈ I} (in other words, no tuple which meets B i \ A and B j \ A for some i = j satisfies any relation symbol in ∆). The following result is implicit in [2] (see Definition 3.7 in [2] and the comment that follows). Theorem 3.13 (implicit in [2]) If A has free amalgamations then a Katětov functor K : A → C exists.
The following theorem in a strengthening of the main result of [6]. We say that A has one-point extension pushouts in C if for every morphism f : such that p • f = q • g and this commuting square is a pushout square in C. Theorem 3.14 If A has has one-point extension pushouts in C then the Katětov functor K : A → C exists.
Proof. Let us first show that every countable source (A֒→ B n ) n∈N has a pushout in C, where A, B 1 , B 2 , . . . ∈ Ob(A). Let e n : A֒→ B n be the embeddings in this source. Let P 2 ∈ Ob(A) together with the embeddings f 2 : B 1 ֒→ P 2 and g 2 : B 2 ֒→ P 2 be the pushout of e 1 and e 2 . Next, let P 3 ∈ Ob(A) together with the embeddings f 3 : P 2 ֒→ P 3 and g 3 : B 3 ֒→ P 3 be the pushout of f 2 • e 1 and e 3 . Then, let P 4 ∈ Ob(A) together with the embeddings f 4 : P 3 ֒→ P 4 and g 4 : B 4 ֒→ P 4 be the pushout of f 3 • f 2 • e 1 and e 4 , and so on: Let P ∈ Ob(C) be the colimit of the chain B 1 ֒→ P 2 ֒→ P 3 ֒→ P 4 ֒→ · · · . It is easy to show that P is the pushout of the source (A֒→ B n ) n∈N .
Let us now construct the Katětov functor as the pushout of all the onepoint extensions of an object in A. More precisely, for every A ∈ Ob(A) let us fix embeddings e n : A֒→ B n , where B 1 , B 2 , . . . is the list of all the one-point extensions of A, where every isomorphism type is taken exactly once to keep the list countable. Define K(A) to be the pushout of the source (e n : A֒→ B n ) n . This is how K acts on objects.
Let us show how K acts on morphisms. Take any morphism h : A → A ′ in A. Let (e i : A֒→ B i ) i∈I be the source consisting of all the onepoint extensions of A (with every isomorphism type is taken exactly once), and let let (e ′ j : A ′֒ → B ′ j ) j∈J be the source consisting of all the one-point extensions of A ′ (with every isomorphism type is taken exactly once). By the assumption, for every i ∈ I there exists an m(i) ∈ J and a morphism h i : B i → B ′ m(i) such that the following is a pushout square in C:

Katětov construction
Definition 4.1 Let K : C → C be a Katětov functor. A Katětov construction is a chain of the form: where C ∈ Ob(C). We denote the colimit of this chain by K ω (C). An object L ∈ Ob(C) can be obtained by the Katětov construction starting from C if L = K ω (C). We say that L can be obtained by the Katětov construction if L = K ω (C) for some C ∈ Ob(C).
Note that K ω is actually a functor C → C: for a morphism f : A → B let K ω (f ) be the unique morphism K ω (A) → K ω (B) from the colimit of the Katětov construction starting from A to the competitive compatible cone with the tip at K ω (B) and morphisms (֒→ • K n (f )) n∈N : Recall that a countable structure L is ultrahomogeneous if every isomorphism between two finitely generated substructures of L extends to an automorphism of L. More precisely, L is ultrahomogeneous if for all A, B ∈ age(L), embeddings j A : A ֒→ L and j B : B ֒→ L, and for ev- Analogously, we say that a countable structure L is C-morphism-homogeneous, if every C-morphism between two finitely generated substructures of L extends to a C-endomorphism of L. More precisely, L is C-morphism-homogeneous if for all A, B ∈ age(L), embeddings j A : A ֒→ L and j B : B ֒→ L, and for every C-morphism f : In particular, if C is the category of all countable ∆structures with all homomorphisms between them, instead of saying that L is C-morphism-homogeneous, we say that L is homomorphism-homogeneous.

Theorem 4.3
If there exists a Katětov functor K : A → C, then A is an amalgamation class, it has a Fraïssé limit L in C, and L can be obtained by the Katětov construction starting from an arbitrary C ∈ Ob(C). Moreover, L is C-morphism-homogeneous.
Proof. Take any C ∈ Ob(C), let be the Katětov construction starting from C, and let L ∈ Ob(C) be the colimit of this chain. Let ι n : K n (C) ֒→ L be the canonical embeddings of the colimit diagram. Let us first show that age(L) = Ob(A). Lemma 2.4 yields age(L) ⊆ Ob(A), so let us show that Ob(A) ⊆ age(L). Take any B ∈ Ob(A) and let A 1 ֒→ A 2 ֒→ · · · be a chain whose colimit is C. Since A has (JEP) there is a D ∈ Ob(A) such that A 1 ֒→ D ←֓ B. Lemma 3.12 then ensures that there is an n ∈ N such that D ֒→ K n (A 1 ). On the other hand, A 1 ֒→ C implies K n (A 1 ) ֒→ K n (C). Therefore, B ֒→ D ֒→ K n (A 1 ) ֒→ K n (C) ֒→ L, so B ∈ age(L). This completes the proof that age(L) = Ob(A).
Next, let us show that L realizes all one-point extensions, that is, let us show that for all A, B ∈ Ob(A) such that A֒→ B and every embedding f : A ֒→ L there is an embedding g : B ֒→ L such that: Take any A, B ∈ Ob(A) such that A֒→ B and let f : A ֒→ L be an arbitrary embedding. By Lemma 2.3 there is an n ∈ N and an embedding h : A ֒→ K n (C) such that f • h = ι n . Note that the following diagram commutes: (the triangle on the left commutes due to the definition of the Katětov functor, the parallelogram in the middle commutes because η is a natural transformation, while the triangle on the right commutes as a part of the colimit diagram for the chain (2)). Let g = ι n+1 • K(h) • j. Having in mind that f = ι n • h, from the last commuting diagram we immediately get that the diagram (3) commutes for this particular choice of g.
Therefore, L realizes all one-point extensions, so L is an ultrahomogeneous countable structure whose age is Ob(A). Consequently, L is the Fraïssé limit of Ob(A), whence we easily conclude that A is an amalgamation class. Moreover, the Fraïssé limit of A can be obtained by the Katětov construction starting from an arbitrary C ∈ Ob(C).
Finally, let us show that L is C-morphism-homogeneous. Take any A, B ∈ age(L), fix the embeddings j A : A ֒→ L and j B : B ֒→ L, and let f : A → B be an arbitrary morphism. Then Having in mind that K ω (A) and K ω (B) are colimits of Katětov constructions starting from A and B, respectively, we conclude that both K ω (A) and K ω (B) are isomorphic to L. Since L is ultrahomogeneous, there exist isomorphisms s : K ω (A) → L and t : Putting diagrams (4) and (5) together we obtain Consequently, if the Katětov functor is defined on a category of countable ∆-structures and all homomorphisms between ∆-structures, the Fraïssé limit of A is both ultrahomogeneous and homomorphism-homogeneous.
Example 4.4 Let n 3 be an integer, let C n be the category of all countable K n -free graphs together with all graph homomorphisms, and let A n be the full subcategory of C n spanned by all finite K n -free graphs. Then there does not exist a Katětov functor K : A n → C n , for if there were one, the Henson graph H n -the Fraïssé limit of A n -would be homomorphismhomogeneous, and we know this is not the case.
(Proof. Since H n is universal for all finite K n -free graphs, it embeds both K n−1 and the star S n , which is the graph where one vertex is adjacent to n − 1 independent vertices. Let f be a partial homomorphism of H n which maps the n − 1 independent vertices of the star S n onto the vertices of K n−1 . If H n were homomorphism-homogeneous, f would extend to an endomorphism f * of H n , so f * applied to the center of the star S n would produce a vertex adjacent to each of the vertices of K n−1 inducing thus a K n in H n , which is not possible.) Note however that there exists a Katětov functor from the category A ′ n of all finite K n -free graphs together with all graph embeddings to the category C ′ n of all countable K n -free graphs together with all graph embeddings (see Example 3.6).
The following theorem shows that the existence of a Katětov functor for varieties of algebras understood as categories whose objects are the algebras of the variety and morphisms are embeddings is equivalent to the amalgamation property for the category of finitely generated algebras of the variety. (⇐) Recall that a partial algebra consists of a set A and some partial operations on A, where a partial operation is any partial mapping A n → A for some n (see [7] for further reference on partial algebras). Clearly, the class of all partial algebras of a fixed type is a free amalgamation class because we can simply identify the elements of the common subalgebra and leave everything else undefined.
According to Theorem 3.14 it suffices to show that A has one-point extension pushouts in C. Take any A 0 , A 1 , A 2 ∈ Ob(A) such that A 0 embeds into A 1 and A 2 is a one-point extension of A 0 . Without loss of generality we can assume that A 0 A 1 and A 0 A 2 . Let G ⊆ A 0 be a finite set which generates A 0 , choose x ∈ A 2 \ A 0 so that G ∪ {x} generates A 2 and let H be a finite set disjoint from G such that G ∪ H generates A 1 . Let S = A 1 ⊕ A 0 A 2 be the partial algebra which arises as the free amalgam of A 1 and A 2 over A 0 in the class of all partial ∆-algebras. Since A has the amalgamation property, there is a C ∈ Ob(A) such that whence follows that C embeds the partial algebra S in the sense of [7, §28]. It is a well-known fact (see again [7, §28]) that if P is a partial algebra which embeds into some total algebra from V then the free algebra F V (P ) exists in V. Therefore, F V (S) exists and belongs to V. It is easy to see that F V (S) is generated by {x} ∪ G ∪ H, so F V (S) is a one-point extension of A 1 . It clearly embeds A 2 , so we have that The universal mapping property, which is the defining property of free algebras, ensures that the above commuting square is actually a pushout square in C. This completes the proof that A has one-point extension pushouts in C.

Corollary 4.6 A Katětov functor exists for the category of all finite semilattices, the category of all finite lattices and for the category of all finite distributive lattices.
Proof. The proof follows immediately from the fact that all the three classes of algebras are well-known examples of amalgamation classes.
The existence of a Katětov functor enables us to quickly conclude that the automorphism group of the corresponding Fraïssé limit is universal, as is the monoid of C-endomorphisms. As an immediate consequence of Theorem 4.3 we have: Corollary 4.7 Let K : A → C be a Katětov functor and let L be the Fraïssé limit of A (which exists by Theorem 4.3). Then for every C ∈ Ob(C): • Aut(C) ֒→ Aut(L); Proof. Since K ω is a functor, we immediately get that Aut(C) ֒→ Aut(K ω (C)) via f → K ω (f ) and that End C (C) ֒→ End C (K ω (C)) via f → K ω (f ). But, K ω (C) ∼ = L due to Theorem 4.3.

Corollary 4.8 For the following Fraïssé limits L we have that Aut(L) embeds all permutation groups on a countable set:
• Q, • the random graph (proved originally in [8]), • Henson graphs (proved originally in [8]), • the random digraph, • the rational Urysohn space (follows also from [14]), • the random poset, • the countable atomless Boolean algebra, • the random semilattice, • the random lattice, • the random distributive lattice.

For the following Fraïssé limits L we have that End(L) embeds all transformation monoids on a countable set:
• Q, • the random graph (proved originally in [3]), • the random digraph, • the rational Urysohn space, • the random poset (proved originally in [5]), • the countable atomless Boolean algebra.
Proof. Having in mind Corollary 4.7, in each case it suffices to show that the corresponding category C contains a countable structure whose automorphism group embeds Sym(N) and whose endomorphism monoid embeds N N considered as a transformation monoid. For example, in case of the rational Urysohn space it suffices to consider the metric space (N, d) where d(m, n) = 1 for all m, n ∈ N, while in the case of the random Boolean algebra it suffices to consider the free Boolean algebra on ℵ 0 generators.
The following example has a twofold purpose: it describes a Katětov functor in a case where the variety of algebras is not locally finite, and at the same time motivates the proof of the Theorem 4.10. Theorem 4.3 tells us that the presence of a Katětov functor implies the amalgamation property for A. Unfortunately, in the general setting this is not the case. The following theorem gives a necessary and sufficient condition for a Katětov functor to exist. It depends on a condition that resembles the Herwig-Lascar-Solecki property (see [9,13]).
C are finitely generated and f : A → B is a C-morphism. We say that C ∈ Ob(C) has the morphism extension property in C if for any choice f 1 , f 2 , . . . of partial morphisms of C there exist D ∈ Ob(C) and m 1 , m 2 , . . . ∈ End C (D) such that C is a substructure of D, m i is an extension of f i for all i, and the following coherence conditions are satisfied for all i, j and k: • if f i is an embedding, then so is m i , and We say that C has the morphism extension property if every C ∈ Ob(C) has the morphism extension property in C. (2) A has (AP) and C has the morphism extension property; (3) A has (AP) and the Fraïssé limit of A has the morphism extension property in C.
Proof. (1) ⇒ (2): From Theorem 4.3 we know that A is an amalgamation class, it has a Fraïssé limit L in C, and L can be obtained by the Katětov construction starting from an arbitrary C ∈ Ob(C). Now, take any C ∈ Ob(C) and let us show that C has the morphism extension property in C. Since L is universal for Ob(C), without loss of generality we can assume that C L. For every finitely generated A C fix an isomorphism j A : K ω (A) → L such that (such an isomorphism exists because L is ultrahomogeneous). Now, for any family A i , f i , B i , i ∈ I, of partial morphisms of C it is easy to see that L together with its endomorphisms is an extension of C and its partial morphisms f i , i ∈ I: The coherence requirements are satisfied since K ω is a functor which preserves embeddings.
A . Since L is a countable structure, there are only countably many partial morphisms p(f ), say, p 1 , p 2 , . . . . By the assumption of (2) there exist D ∈ Ob(C) and A . Then p l • p k = p s , so the coherence requirements imply that m l • m k = m s . Finally, The coherence requirements also ensure that K preserves embeddings.
Let us now show that the set of arrows η A = e • j A constitutes a natural transformation η : ID → K. Take any A-morphism f : A → B. Then A is a partial morphism of L whose extension is m i . This is why the following diagram commutes (where the dashed arrow indicates a partial morphism): which concludes the proof.
Note that the Henson graph H n , n 3, does not have the morphism extension property with respect to all graph homomorphisms (for otherwise there would be a Katětov functor defined on the category of all finite K nfree graphs and all graph homomorphisms, and we know that such a functor cannot exist).
Hypothesis. Every Fraïssé limit has the morphism extension property with respect to embeddings.

Semigroup Bergman property
Following [11], we say that a semigroup S is semigroup Cayley bounded with respect to a generating set U if S = U ∪U 2 ∪. . . ∪U n for some n ∈ N. We say that a semigroup S has the semigroup Bergman property if it is semigroup Cayley bounded with respect to every generating set.
A semigroup S has Sierpiński rank n if n is the least positive integer such that for any countable T ⊆ S there exist s 1 , . . . , s n ∈ S such that T ⊆ s 1 , . . . , s n . If no such n exists, the Sierpiński rank of S is said to be infinite. A semigroup S is strongly distorted if there exists a sequence of natural numbers l 1 , l 2 , l 3 , . . . and an N ∈ N such that for any sequence a 1 , a 2 , a 3 , . . . ∈ S there exist s 1 , . . . , s N ∈ S and a sequence of words w 1 , w 2 , w 3 , . . . over the alphabet {x 1 , x 2 , . . . , x N } such that |w n | l n and a n = w n (s 1 , . . . , s N ) for all n.

Lemma 5.1 ([11]) If S is a strongly distorted semigroup which is not finitely generated, then S has the Bergman property.
It was shown in [12] that End(R), the endomorphism monoid of the random graph, is strongly distorted and hence has the semigroup Bergman property since it is not finitely generated. The idea from [12] was later in [4] directly generalized to classes of structures with coproducts. Here, we present a general treatment in the context of classes for which a Katětov functor exists, and where the (JEP) can be carried out constructively in the sense of the following definition. • for every pair of morphisms f : C → C ′ and g : D → D ′ the diagram below commutes: We also say that F is a natural (JEP) functor for C.
A category C has retractive natural (JEP) if C has natural (JEP) and the functor F has the following additional property: for every C ∈ Ob(C) there exist morphisms ρ * C , λ * Remark 5.3 Note that since F is a covariant functor, the following also holds: • for all f 1 : , and Example 5.4 Any category with coproducts (such as the category of graphs, posets, digraphs) has retractive natural (JEP): just take F (C, D) to be the coproduct of C and D. On the other hand, it is easy to show that the category of all countable metric spaces with distances in Q and nonexpansive maps does not have natural (JEP). Suppose, to the contrary, that there exists a functor F which realizes the natural (JEP) in this category, let U be the rational Urysohn space and let W = F (U, U ). Let a 0 , b 0 ∈ U be arbitrary but fixed, and let δ = d W (λ U (a 0 ), ρ U (b 0 )). Take any a, b ∈ U , let c a : U → U : x → a and c b : U → U : x → b be the constant maps and Example 5.6 Let ∆ be the language consisting of function symbols and constant symbols only so that ∆-structures are actually ∆-algebras, and assume that ∆ contains a constant symbol 1. Then the category of ∆algebras has retractive natural (JEP): take F (C, D) to be C × D where Our aim in this section is to prove the following theorem: Theorem 5.7 Assume that there exists a Katětov functor K : A → C and assume that C has retractive natural (JEP). Let L be the Fraïssé limit of A (which exists by Theorem 4.3). Then End C (L) is strongly distorted and the Sierpiński rank of End C (A) is at most 5. Consequently, if End C (L) is not finitely generated then it has the Bergman property.
The proof of the theorem requires some technical prerequisites. Let us denote the functor which realizes (JEP) in C by (·, ·) so that (C, D) denotes its action on objects, and (f, g) its action on morphisms. For objects C 1 , C 2 , C 3 , . . . , C n and morphisms f, g, f 1 , f 2 , f 3 , . . . , f n of C let Let C denote the colimit of the following chain in C with the canonical embeddings denoted by ι n : , , Let L be the Fraïssé limit of A, which exists by Theorem 4.3. We know that K ω (C) ∼ = L, so let us fix an isomorphism The following diagram commutes because (·, ·) is a natural (JEP) functor: so the following diagram also commutes: Therefore, there is a compatible cone with the tip at L and the morphisms . . over the chain L 1 ֒→ L 2 ֒→ L 3 ֒→ · · · . Since C is a colimit of the chain, there is a unique β : C → L such that In particular, β • ι 1 = id L .
As the next step in the construction, note that the following diagram commutes (again due to the fact that (·, ·) is a natural (JEP) functor): Therefore, there is a compatible cone with the tip at C and the morphisms . . over the chain L 1 ֒→ L 2 ֒→ L 3 ֒→ · · · . Since C is a colimit of the chain, there is a unique σ : C → C such that or, explicitly, An easy induction on n then suffices to show that Also, there is a compatible cone with the tip at C and the morphisms ι 1 •ρ * L , . . over the chain L 2 ֒→ L 3 ֒→ L 4 ֒→ · · · , so there is a unique τ : C → C such that or, explicitly, id L ] n−1 , for all n 1. Another easy induction on n suffices to show that . .) be a sequence of C-endomorphisms of L. As the final step, we shall now construct an endomorphism ϕ(f ) : C → C which encodes the sequence f . Using once more the fact that (·, ·) is a natural (JEP) functor, we immediately get that the following diagram commutes: or, explicitly, . . , f n ], for all n 1.
Proof. (a) This is immediate from the construction of ϕ(f ).
(b) It suffices to note that the diagram below commutes. The square on the left commutes because (·, ·) is natural, while the square on the right commutes by the construction of ϕ(f ). The leftmost square commutes because (·, ·) is natural, while the rightmost square commutes by the construction of ϕ(f ). To see that the second square in this row commutes, just apply the functor (·, ·) to the following two commutative squares (see Remark 5.3): The same argument suffices to show that the third square in the row also commutes.
Proof. In order to make it easier to follow the calculations we underline the expression that is to be reduced in the following step. We are now ready to prove Theorem 5.7.

Proof. (of Theorem 5.7)
We are going to show that End C (K ω (C)), which is isomorphic to End C (L) because L ∼ = K ω (C), is strongly distorted and that the Sierpiński rank of End C (K ω (C)) is at most 5. Take any countable sequence f 1 , f 2 , . . . ∈ End C (K ω (C)), and let us constructα,β,σ,τ ,φ ∈ End C (K ω (C)) as follows, with the notation introduced above.
Corollary 5.10 For the following Fraïssé limits L we have that End C (L) has the Bergman property: • random graph, • random digraph, • rational Urysohn sphere (the Fraïssé limit of the category of all finite metric spaces with rational distances bounded by 1), • random poset, • random Boolean algebra (the Fraïssé limit of the category of all finite Boolean algebras)