{'fraction_non_alphanumeric': 0.05884613111071703, 'fraction_numerical': 0.010521960158420524, 'mean_word_length': 3.6451125755079627, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 27, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
The Bergman property for endomorphism monoids of some Fra\"{\i}ss\'e limits

Based on an idea of Y. P\'eresse and some results of Maltcev, Mitchell and Ru\v{s}kuc, we present sufficient conditions under which the endomorphism monoid of a countably infinite ultrahomogeneous first-order structure has the Bergman property. This property has played a prominent role both in the theory of infinite permutation groups and, more recently, in semigroup theory. As a byproduct of our considerations, we establish a criterion for a countably infinite ultrahomogeneous structure to be homomorphism-homogeneous.


The Bergman property and Fraïssé limits
Let S be a semigroup. For ∅ = A ⊆ S and n 1 we denote A n = {a 1 · · · a n : a 1 , . . . , a n ∈ A}.
The least subsemigroup of S containing A is said to be generated by A; usually it is denoted by A . Clearly, In particular, if S = A then A is a generating set of S, thus by definition S = n 1 A n . However, it might turn out that only a finite portion of the latter infinitary union suffices to obtain the whole S, that is, S = m n=1 A n holds for some m 1. In such a case we say that S is semigroup Cayley bounded with respect to A. For a group G and its (group) generating set Γ we have that G is generated as a semigroup by Γ ∪ Γ −1 (where Γ −1 = {g −1 : g ∈ Γ}); thus we say that G is group Cayley bounded with respect to Γ if it is semigroup Cayley bounded with respect to A = Γ ∪ Γ −1 (that is, the Cayley graph of G with respect to Γ is of finite diameter). A well-known result of George Bergman [2] asserts that for any (infinite) set X, the symmetric group Sym(X) is group Cayley bounded with respect to every generating set. Hence, the term 'the Bergman property' quickly established itself [8,18] to describe the property of groups of being group Cayley bounded with respect to every generating set. To distinguish between groups and semigroups, we refer to this remarkable property as the group Bergman property; the analogous property for semigroups-the main subject of investigation in a recent contribution by Maltcev, Mitchell and Ruškuc [21]-is called the semigroup Bergman property. For a group G, the semigroup Bergman property obviously implies the group Bergman property. It is still unknown, however, whether the converse is true.
The other principal theme of this paper are the fascinating objects from model theory called Fraïssé limits. Namely, if C is a countable set of finitely generated first-order structures of a fixed countable signature that is closed for taking (isomorphic copies of) substructures, has the joint embedding property (JEP) and the amalgamation property (AP), then a celebrated result of Roland Fraïssé [12,16] guarantees the existence and uniqueness of a countable structure F such that: (i) the set of all finitely generated substructures of F , called the age of F , coincides (up to isomorphism) with C , and (ii) F is ultrahomogeneous, which means that for any isomorphism α : A → A ′ between finitely generated substructures A, A ′ of F there is an automorphism α of F that extends α, i.e. α| A = α.
Following [16], such a structure F is called the Fraïssé limit of C and denoted by Flim(C ). Moreover, any countably infinite ultrahomogeneous structure arises in this way: it is the Fraïssé limit of the class of all of its finitely generated substructures. A class of finitely generated structures that satisfies the premises of the Fraïssé theorem is called a Fraïssé class. It is not difficult to show that if C is a Fraïssé class, and if C denotes the class of all countable structures whose ages consist of structures isomorphic to members of C , then in fact any member of C embeds into Flim(C ). Historically, the first Fraïssé limits discovered were the rational Urysohn space U Q [31] as the limit of all finite metric spaces with rational distances, and Q, the limit of all finite chains [12].
Other classical examples of Fraïssé classes and their limits include: • finite simple graphs and the random graph R [3,4], • finite posets and the generic poset P [29], • finite semilattices and the countable universal ultrahomogeneous semilattice Ω [10], • finite distributive lattices and the countable universal ultrahomogeneous distributive lattice D [11], • finite Boolean algebras and the countable atomless Boolean algebra A.
The paper [21] provides an abundance of examples of well-known semigroups both with and without the Bergman property. A significant part of those examples are semigroups of various mappings, or even morphisms of some structure. However, it is one particular result contained in [21,Theorem 4.2] that will be of a special interest here: this is the assertion that End(R), the endomorphism monoid of the random graph R, has the Bergman property. This claim remained unproved in [21]; the theorem itself was formulated as a consequence of Lemma 2.4 of that paper (see Lemma 2.1 below) and two earlier publications [1,25], which indeed account for all the assertions contained in the theorem except for the one about End(R). Later I learned [23] that the Bergman property for End(R) is a consequence of a result in the recent doctoral thesis of Y. Péresse [27] (a student of Mitchell's) and the already mentioned Lemma 2.4 of [21].
The present note is centered around a series of remarks leading to the conclusion that the convenient and clever trick presented in [27] can be in fact generalized from R to a whole class of countably infinite ultrahomogeneous structures (that is, Fraïssé limits), thus yielding the Bergman property for their endomorphism monoids. This conclusion is reached in the main result of this paper, Theorem 4.2, with the purpose of supplementing the results of [21]. In the following preliminary section, we are going to briefly review the aforementioned trick from [27] and other ingredients needed for our arguments in Section 4. Along the way, in Section 3 we will record an exact description of Fraïssé classes whose limits are homomorphism-homogeneous [6], accompanied with a number of examples.

Strong distortion, coproducts, homomorphism extensions
The results we are about to revisit are based on another motif connected to the Bergman property, and it traces back to an old, classical result of W. Sierpiński, who proved in [30] that if X is an infinite set, then any countable set {f i : i 0} of self-maps (transformations) X → X is contained in a 2-generated subsemigroup of T X , the semigroup of all self-maps of X. Following this landmark example, we say that a semigroup S has Sierpiński rank n < ω if n is the least positive integer with the property that for any countable A ⊆ S there exists s 1 , . . . , s n ∈ S such that A ⊆ s 1 , . . . , s n . If no such n exists, the Sierpiński rank of S is said to be infinite. Of course, the Sierpiński rank of a countable semigroup is simply its rank, the minimum size of its generating set, so that the notion is particularly interesting for uncountable semigroups. So, the result of Sierpiński asserts that T X has Sierpiński rank 2. Some recent results concerning the Sierpiński rank of certain classical transformation semigroups can be found in [24].
A slight modification of this notion produces a convenient method for proving the Bergman property for semigroups. Namely, in several proofs of the finiteness of the Sierpiński rank for various semigroups it turns out-after selecting a countable set A = {a i : i < ω} and s 1 , . . . , s n such that A ⊆ s 1 , . . . , s n -that in the representation a i = w i (s 1 , . . . , s n ) the length of the word w i does not depend on the particular choice of a i , but that it is determined only by the index i. In other words, the Sierpiński property occurs in some sense in a "uniform" way. More formally, call a semigroup S strongly distorted if there exists a sequence of natural numbers (ℓ n ) n<ω and M < ω such that for any sequence (a n ) n<ω of elements of S there exist s 1 , . . . , s M ∈ S and a sequence of words (w n ) n<ω (over an M -letter alphabet) such that |w n | ℓ n and a n = w n (s 1 , . . . , s M ) for all n < ω.
Here is the result that puts strongly distorted semigroups into the context of the initial motivation of this paper. Therefore, any strongly distorted uncountable semigroup has the Bergman property. This observation is the link showing that Lemma 3.10.3 and the proof of Theorem 3.10.4 in [27] in fact establish the Bergman property for End(R). However, the good thing about the latter theorem is that it is not really about the random graph, as it very easily admits a generalization that we present here. But first recall the classical categorytheoretical notion of a coproduct. If {A i : i ∈ I} is a family of first-order structures belonging to a concrete category C (where objects are structures and morphisms are their homomorphisms), then their coproduct (or free sum), denoted by * i∈I A i , is a structure S ∈ C with the following properties: (a) there are embeddings ι i : A i → S for any i ∈ I; (b) for any B ∈ C and any homomorphisms ϕ i : A i → B, i ∈ I, there exists a unique homomorphism ϕ : S → B such that ϕι i = ϕ i holds for all i ∈ I.
(In this paper, mappings are composed right to left, so that f g is a function for which f g(x) means f (g(x)). For a set X, 1 X will always denote the identity mapping on X.) Whenever it exists, the coproduct is unique up to an isomorphism, and it is generated by i∈I ι i (A i ). So, here is the "abstract" version of Theorem 3.10.4 from [27].
Theorem 2.2 (Mitchell [23], Péresse [27]) Let A be an infinite structure with a substructure B satisfying the following conditions: (ii) any homomorphism ϕ : B → A can be extended to an endomorphism ϕ of A.
Then End(A), the endomorphism monoid of A, is strongly distorted. In addition, the Sierpiński rank of End(A) is at most 3.
Proof. Let f 0 , f 1 , . . . be any countable sequence of endomorphisms of A. We construct g 1 , g 2 , g 3 ∈ End(A) such that f k ∈ g 1 , g 2 , g 3 for any k 0. Also, we will freely assume that each A n is actually contained in B. First of all, let g 1 : A → A 0 be any isomorphism. Furthermore, let h n : A n → A n+1 , n < ω, be isomorphisms. By (i) and the definition of the coproduct, since each h n maps into B, there is a homomorphism h : B → B (that is, h ∈ End(B)) such that h| An = h n for any n < ω. By condition (ii), h can be extended to an endomorphism of A, which we denote by g 2 . Then for any n < ω we have g 2 | An = h n and t n = g n 2 g 1 : A → A n is an isomorphism. Now we define the key endomorphism g 3 , which can be informally thought of as a "compressed form" of the sequence Similarly as above, by (i) there exists a homomorphism ψ : B → A such that ψ| A k = ψ k for each k 0. However, by (ii) there is an extension of ψ to g 3 ∈ End(A). Note that g 3 | A k = ψ k holds as well.
It remains to recover f k from g 3 . Indeed, since t k maps into A k , as wanted. So, not only f k ∈ g 1 , g 2 , g 3 , but we uniformly have that the length of the product representing f k is ℓ k = k + 2.
Of course, the coproduct in the category of (simple) graphs is just the disjoint union of the given family of graphs. Hence, n<ω R exists, and, since it is a countably infinite graph, it embeds into R. In addition, as established in Lemma 3.10.3 of [27], R has the remarkable property that for any countable graph G there is an induced subgraph G ′ of R, isomorphic to G, such that any homomorphism ϕ : G ′ → R extends to an endomorphism ϕ of R. As End(R) is known to be uncountable, it follows that it has the Bergman property.
Our main goal here is to see to which extent we can utilize the above theorem in order to cover the cases of some of the most important infinite structures arising as Fraïssé limits. The really intriguing condition here is Theorem 2.1(ii), the possibility of extending a homomorphism from a certain substructure of Flim(C ). More precisely, we will be interested in the conditions under which for any A ∈ C there exists a substructure A ′ of F = Flim(C ) such that A ′ ∼ = A and any homomorphism ϕ : A ′ → F can be extended to an endomorphism of F . These conditions must be nontrivial, as the next example shows.

Example 2.3
Let H n denote the Henson graph [15,19], that is, the Fraïssé limit of the class of all finite simple graphs omitting K n , the complete graph (clique) on n vertices, n 3. Now, H n clearly contains copies of K n−1 and K n−1 and any bijection of vertices f : K n−1 → K n−1 is a graph homomorphism. However, f cannot be extended to an endomorphism f of H n because there is a vertex u adjacent to each vertex of the anticlique K n−1 , so that f (u) would be adjacent to each vertex of the clique K n−1 , which is impossible by the definition of H n . Therefore, H n is not homomorphism-homogeneous. In addition, as shown in [26], every endomorphism of H n is injective, so not every endomorphism of a (finite) subgraph of H n can be extended to a member of End(H n ) (just take two non-adjacent vertices u, v and map them both into u).

The amalgamation property and amalgamated free sums
An amalgam is a quintuple (A, B, C, f 1 , f 2 ) consisting of structures A, B, C together with two embeddings f 1 : A → B and f 2 : A → C. If A, B, C ∈ C for some class C , then we have an amalgam in C . The amalgamation property for C , mentioned earlier, asserts that any amalgam in C can be embedded into a structure D ∈ C , i.e. that there are embeddings g 1 : B → D and g 2 : C → D such that g 1 f 1 = g 2 f 2 . If C is a class of finitely generated structures with the AP (for example, a Fraïssé class), then it is known that the statement of the AP extends to non-finitely generated members of C in the following sense. The proof is rather straightforward, thus it is omitted.

Lemma 2.4 Let C be a class of finitely generated structures satisfying the amalgamation
is an amalgam such that A ∈ C and B, C ∈ C , then it can be embedded into some structure D ∈ C .
In the course of dealing with a Fraïssé class C it would be very useful to fix a canonical way for embedding an amalgam (A, B, C, f 1 , f 2 ) such that A ∈ C and B, C ∈ C into a structure from C . Such possibility is provided by the standard categorical notion of the pushout (see [20] for a background in basic category theory). Recall that if f : X → Y and g : X → Z are two morphisms, then their pushout is an object P together with two morphisms i 1 : Y → P and i 2 : Z → P such that the following diagram commutes: while for any object Q and morphisms j 1 : Y → Q and j 2 : ? ?
In concrete categories of structures we often consider the case when f, g are embeddings, whence in the presence of the AP the homomorphisms i 1 , i 2 must be injective as well. Hence, P can be thought of as the "smallest" structure embedding the amalgam (X, Y, Z, f, g). Accordingly, a structure P will be called the amalgamated free sum of Y and Z with respect to X if there exist embeddings i 1 : Y → P and i 2 : Z → P such that P (with i 1 and i 2 ) is the pushout of the amalgam (X, Y, Z, f, g). If so, we write P = Y * X Z. It is easy to check that the amalgamated free sum, if it exists, is unique up to an isomorphism, and that it is generated by i 1 (Y ) ∪ i 2 (Z). We will consider Fraïssé classes C satisfying the following condition, which is a rather strong form of the AP: ( †) For any amalgam (A, B, C, f 1 , f 2 ) such that A ∈ C , B, C ∈ C , the amalgamated free sum B * A C exists and belongs to C .
For example, it is straightforward to see that the amalgamated free sum of two simple graphs G 1 = (V 1 , E 1 ) and G 2 = (V 2 , E 2 ) sharing a common induced subgraph on V = V 1 ∩ V 2 is simply the graph on V 1 ∪ V 2 whose edges are E 1 ∪ E 2 (in a somewhat simplified form, one may say that the free sum of the amalgam is the amalgam itself). Similarly, the amalgamated free sum of two posets (A 1 , 1 ) and (A 2 , 2 ) over a common subposet on A = A 1 ∩A 2 is the poset (A 1 ∪A 2 , ), where is the transitive closure of the reflexive and antisymmetric relation 1 ∪ 2 on A 1 ∪ A 2 . The existence of amalgamated free sums of semilattices, distributive lattices and Boolean algebras can be traced from [14]; also, the construction of amalgamated free sums for Abelian groups and vector spaces is a part of algebraic folklore.

From amalgamated sums to the construction of Fraïssé limits
Let C be a Fraïssé class satisfying the condition ( †). Equipped with the construction of the amalgamated free sum, we first describe a particular extension A ⋆ for an arbitrary structure A ∈ C . This is in fact a generalization of one of the standard constructions of the random graph described in [3] and an adaptation of the general approach from [16].
First of all, recall that a structure C is a one-point extension of its substructure B if there is an element x ∈ C \ B such that C is generated by B ∪ {x}. Trivially, if B is finitely generated, so is C. Now let {(B i , C i ) : i < ω} be the enumeration of all pairs of structures such that B i ∈ C is a finitely generated substructure of A, while C i is a one-point extension of B i belonging to C ; for each isomorphism type we take one such extension. We construct a chain of structures A i , i 0, as follows. Let A 0 = A and assume that A n has already been constructed for some n 0 such that A ⊆ A n ∈ C . Then B n is a substructure of A and so of A n , whence (B n , A n , C n , 1 Bn , 1 Bn ) is an amalgam such that B n , C n ∈ C and A n ∈ C . The condition ( †) allows us to define Clearly, A n+1 embeds the considered amalgam; therefore, there is no loss of generality in assuming that A n ⊆ A n+1 , so that A is a substructure of A n+1 . Finally, we let This construction can be iterated by setting which is an extension of A. Clearly, any finitely generated substructure of F(A) must belong to some A (m) , and since A (m) ∈ C the finitely generated structure in question belongs to C ; hence, F(A) ∈ C .
Proposition 2.5 Let C be a Fraïssé class satisfying ( †). For any A ∈ C , the structure F(A) constructed as above is isomorphic to the Fraïssé limit of C .
Proof. This is a consequence of another well-known result of Fraïssé [13] (see also [ For example, for an arbitrary countable graph G = (V, E), the graph G ⋆ is obtained by adjoining a vertex u A for each finite subset A ⊆ V such that u A is joined by an edge to v ∈ V if and only if v ∈ A. By iterating this construction, we build a countable graph R(G) "around" the initial graph G. As remarked in [3], regardless of the choice of G, we always end up with R(G) ∼ = R, the countably infinite random graph.
Remark 2.6 Of course, Proposition 2.5 holds in greater generality, for arbitrary Fraïssé classes. The construction of the structure F(A) should be amended in the more general case so that A n+1 is selected to be an arbitrary structure from C embedding the amalgam (B n , A n , C n , 1 Bn , 1 Bn ) and containing A n as a substructure. (Such A n+1 exists by Lemma 2.4.) However, we will need the condition ( †) and the previous more specific construction of F(A) in Section 4, where we present our main arguments; in particular, this will be crucial in the proof of Theorem 4.1.

Homomorphism-homogeneous Fraïssé limits
In an attempt to put the notion of ultrahomogeneity into a more general setting of arbitrary homomorphisms of first-order structures, Cameron and Nešetřil introduced in [6] the property of homomorphism-homogeneity. Namely, a structure A is homomorphismhomogeneous if any homomorphism B → C between its finitely generated substructures can be extended to an endomorphism of A. Recent results concerning characterizations of this property in various classes of structures include [5,7,17,22,28]. In this section, we make a brief pause towards our aim to record a condition equivalent to homomorphismhomogeneity of a Fraïssé limit.
To this end, we introduce yet another property that a Fraïssé class C may or may not satisfy. We say that C satisfies the one-point homomorphism extension property (1PHEP) if for any B, B ′ , C ∈ C such that C is a one-point extension of B, C = B∪{x} , any surjective homomorphism ϕ : B → B ′ can be extended to a homomorphism ϕ ′ : C → C ′ for some C ′ ∈ C containing B ′ . If we require that ϕ ′ is surjective as well, then it is clear that either Remark 3.1 It is quite easy to show that for any class of finitely generated structures of a fixed signature, the 1PHEP is equivalent to the seemingly more general homoamalgamation property (HAP), which, even though it is not explicitly formulated, transpires from the treatment in Section 4 of [6]. Namely, the HAP is the assertion that for any A, B 1 , B 2 ∈ C , any homomorphism ϕ : A → B 1 and any embedding f : A → B 2 there is a structure D ∈ C , an embedding f ′ : B 1 → D and a homomorphism ϕ ′ : B 2 → D such that f ′ ϕ = ϕ ′ f . However, the more specific form of the 1PHEP might be slightly easier to check, as the following examples show.

Example 3.2
The class of all finite simple graphs has the 1PHEP. Indeed, let ϕ : G → H be a surjective graph homomorphism, and let G ′ be a graph obtained from G by adjoining a new vertex x (and some new edges involving x). Construct a new graph H ′ obtained by adjoining a new vertex x ′ to H, while for v ∈ V (H) we set that (x ′ , v) ∈ E(H ′ ) if and only if (x, u) ∈ E(G ′ ) for some u ∈ V (G) such that ϕ(u) = v. Then it is easily verified that ϕ ′ : G ′ → H ′ obtained by extending ϕ by ϕ ′ (x) = x ′ is a (surjective) graph homomorphism.

Example 3.3
We have already seen that the Fraïssé class of all K n -free finite simple graphs fails to satisfy the 1PHEP: a bijection from the vertices of an anti-clique of size n − 1 to a clique of the same size cannot be extended within the considered class to a vertex adjacent to all vertices of the anti-clique.
On the other hand, the "complementary" Fraïssé class to the above one, that of all K n -free finite simple graphs has the 1PHEP: it is quite straightforward to check that the construction from the previous example will work for this class as well. Since ℓ < u holds for any ℓ ∈ L and u ∈ U we have ϕ(ℓ) ϕ(u). So, ϕ(L)∩ϕ(U ) is either empty, or a singleton. In the former case, define an extension C ′ of B ′ by "inserting" a new element y between L ′ = ϕ(L) and U ′ = ϕ(U ); this is possible as ℓ ′ < u ′ holds for any ℓ ′ ∈ L ′ , u ′ ∈ U ′ . It is now a routine to check that the mapping ϕ ′ such that ϕ ′ | B = ϕ and ϕ ′ (x) = y is a poset homomorphism C → C ′ . If, however, ϕ(L) ∩ ϕ(U ) = {x ′ } then extend ϕ to ϕ ′ : C → B ′ by defining ϕ ′ (x) = x ′ ; once again, ϕ ′ turns out to be a homomorphism.
Recall that metric spaces can be viewed as first-order structures over an uncountable language consisting of binary relational symbols indexed by the non-negative reals such that (x, y) ∈ R α (α ∈ R + 0 ) if and only if d(x, y) α. (Of course, we may as well restrict ourselves to metric spaces with rational distances, thus obtaining a countable signature for such structures.) From such a point of view, homomorphisms of metric spaces are just non-expanding functions ϕ so that we have for any x, y. Then, naturally, the notion of an automorphism coincides with that of an isometry, a distance-preserving permutation. First of all, we are going to consider the special case when ϕ, the initial homomorphism, is a bijection. We are looking for a sequence of positive real numbers d i , i < n, such that a (hypothetical) point y ′ with d(y ′ , ϕ(x i )) = d i for all i < n satisfies all the triangle inequalities with the already existing points of M ′ . In other words, the required conditions are: with i, j < n, i = j, in both cases. In addition, we need the third condition There is no loss of generality in assuming that d(y, x 0 ) d(y, x 1 ) . . . d(y, x n−1 ). Now consider the sequence defined by d 0 = d(y, x 0 ) and for 0 < i < n. We claim that these numbers constitute a solution of the system of inequalities (1)-(3) above. Indeed, the condition (3) is immediately satisfied. For (1), we distinguish three subcases. If d i = d(y, x k ) + d(ϕ(x k ), ϕ(x i )) and d j = d(y, x m ) + d(ϕ(x m ), ϕ(x j )) for some k < i and m < j, then since M, M ′ are metric spaces and ϕ is non-expanding. On the other hand, if d i = d(y, x i ) and d j = d(y, x j ), then Finally, if d i = d(y, x k )+d(ϕ(x k ), ϕ(x i )) for some k < i and d j = d(y, x j ) (the symmetric case is analogous), then Concerning (2), assume first that i < j. Then if d i = d(y, x i ) we have as k < i < j. So, it remains to discuss the possibility i > j. If it happens that d i = d(y, x k ) + d(ϕ(x k ), ϕ(x i )) for some k < i, and, in addition, we have k < j as well, then d i + d(ϕ(x i ), ϕ(x j )) d j holds by the identical argument as in the previous displayed chain of equalities and inequations. Otherwise, either k j, or d i = d(y, x i ), both cases implying d i d(y, x k ) d(y, x j ) d j , so (2) holds. This completes the case when ϕ is injective, since M ′ 1 is obtained by adjoining a point y ′ to M ′ such that d(y ′ , ϕ(x i )) = d i for all i < n.
Turning to the general case, when ϕ is not necessarily a bijection, for any z ∈ M ′ choose a point x z ∈ ϕ −1 (z) ⊆ M whose distance to y is minimal among all elements of ϕ −1 (z) (that is, we have d(y, x z ) d(y, x) for all x ∈ M such that ϕ(x) = z). Let M 0 = {x z : z ∈ M ′ }. Now ϕ| M0 : M 0 → M ′ is a bijective homomorphism of finite metric spaces, so by the previous considerations it follows that there is a one-point extension M ′ 1 of M ′ and a homomorphism ψ : M 0 ∪{y} → M ′ 1 extending ϕ| M0 . But then ϕ = ψ ∪ϕ is the required extension of ϕ, since for any x ∈ M we have d( ϕ(y), ϕ(x)) = d(y ′ , ϕ(x)) = d(ψ(y), ψ(x ϕ(x) )) d(y, x ϕ(x) ) d(y, x), as wanted. It remains to note that if all d(y, x i ), d(x i , x j ), d(ϕ(x i ), ϕ(x j )) are rational numbers, so are all d i , thus the second part of the assertion follows, too.
The 1PHEP occurs in algebraic structures as well, where it is intimately related to the congruence extension property (CEP), see [14]. Recall that an algebra A has the CEP if for any subalgebra B of A and any congruence ρ of B there exists a congruence θ of A whose restriction to B is precisely ρ, that is, θ ∩ (B × B) = ρ.  ∩ (B × B)), which is by the given conditions isomorphic to B ′ . Therefore, C/θ ∈ C can be considered as an extension of B ′ , whence ν θ is an extension of ϕ.
By invoking the fact that the varieties of semilattices, distributive lattices, Boolean algebras and vector spaces over a given field F all possess the CEP, we obtain the following conclusion. Proof. Throughout the proof, let F = Flim(C ).
(⇒) Let B, B ′ , C ∈ C be such that C is a one-point extension (or any extension of finite relative rank, for that matter) of B, and let ξ : B → B ′ be a surjective homomorphism. By the properties of the Fraïssé limit, there is no loss of generality if we assume that B, B ′ , C are in fact substructures of F . However, by the given conditions then there is a ξ ∈ End(F ) extending ξ, so that ξ ′ = ξ| C : C → ξ(C) is the homomorphism required by the 1PHEP.
(⇐) Let A be a finitely generated substructure of F , while ϕ : A → F is a homomorphism. Then, since F is countable, there exists a chain {F i : i < ω} of finitely generated substructures of F such that F 0 = A, F i+1 is a one-point extension of F i for each i 0, and F = i<ω F i . We construct by induction a chain of homomorphisms ϕ i : F i → F starting with ϕ 0 = ϕ. By the 1PHEP, given ϕ j for some j 0, there exists a finitely generated structure B ′ j+1 ∈ C , which is an extension of B j = ϕ j (F j ), and a homomorphism ψ j+1 : F j+1 → B ′ j+1 that extends ϕ j (i.e. ψ j+1 | Bj = ϕ j ). Now since F is the Fraïssé limit of C , there exists an embedding f j+1 : to obtain an endomorphism of F that extends ϕ.
By combining the previous proposition, Corollary 3.7, Lemma 3.5 and the examples that precede it, we arrive at the following result. Corollary 3.9 Each of the following Fraïssé limits is homomorphism-homogeneous: R, H n for all n 3, U Q , P, Ω, D, A, and V F ∞ , the ℵ 0 -dimensional vector space over a field F. Remark 3.10 Based on Lemma 3.5 and an analogous approach as in Proposition 3.8, it is now quite easy to prove that the Urysohn space U [31], the completion of U Q , is homomorphism-homogeneous as well. Namely, if X ⊆ U is a finite metric space and ϕ : X → U is a homomorphism, then one can select a countable dense subspace Y ⊆ U isometric to U Q and use Lemma 3.5 to obtain a homomorphism ϕ ′ : X ∪ Y → U extending ϕ. Now it remains to remark that: (a) U is the completion of X ∪ Y , and (b) every homomorphism of metric spaces is a uniformly continuous mapping (since it is in fact a Lipschitz function with constant 1), whence the properties of the completion of a metric space yield an endomorphism ϕ of U extending ϕ.

Homomorphism extensions and the Bergman property
We start immediately with a condition ensuring that an instance of a Fraïssé limit-as constructed in Subsection 2.3-satisfies the condition (ii) from Theorem 2.2, related to the possibility of extending a partial endomorphism of such a limit. Proof. Let ϕ : A → F(A) be any homomorphism. Our aim is to obtain a sequence of homomorphisms will be the desired endomorphism of F(A). Therefore, we start with the assumption that the required sequence has already been constructed up to ϕ (n) for some n 0.
In addition, recall that A (n+1) has been obtained from A (n) by successive amalgamations of all possible (up to isomorphism) one-point C -extensions of finitely generated substructures of A (n) . This results in a sequence of structures A ⊆ . . . whose limit is (A (n) ) ⋆ = A (n+1) . Accordingly, we construct a tower of homomorphisms ϕ has already been constructed. Now, since C satisfies ( †), we know that A (n) k+1 is obtained as the amalgamated free sum of (B For brevity, denote B ′ = ϕ (n) (B (n) k ) and consider the homomorphism between finitely generated C - exists an index p < ω such that B ′ ⊆ A (p) . By the 1PHEP, there exist a structure C ′ ∈ C -that is either B ′ , or its one-point extension-and a surjective homomorphism ε : C (n) k → C ′ agreeing with ϕ (n) (that is, with φ) on B ) for some j. In any case, we may assume that ε(C (n) k ) is a (finitely generated) substructure of A (p+1) .
What we have right now is depicted in the following diagram: , and so we are done.
The combination of Lemma 2.1, Theorem 2.2 and the previous theorem immediately yields the principal result of this paper. Theorem 4.2 Let C be a Fraïssé class satisfying ( †) and the 1PHEP, and let F = Flim(C ). If the coproduct of countably infinitely many copies of F exists and belongs to C , then End(F ) is strongly distorted and its Sierpiński rank is at most 3. If, in addition, End(F ) is not finitely generated, then it has the Bergman property.
Note that one may equivalently replace 'not finitely generated' in the above theorem by 'uncountable': indeed, if End(F ) would be countable, then if would be necessarily finitely generated, because of the finite Sierpiński rank. However, it is again Theorem 4.1 that admits to easily establish | End(F )| > ℵ 0 , for limits F of certain Fraïssé classes C , as the latter inequality will follow from the existence of a structure A ∈ C such that | End(A)| > ℵ 0 . We record the following remark, which is of independent interest as well. We say that a semigroup T divides a semigroup S if T is a homomorphic image of a subsemigroup of S. Then for any structure A ∈ C we have that End(A) divides End(F ).
Proof. By Theorem 4.1 we have that F contains an isomorphic copy A ′ of A such that any endomorphism of A ′ can be extended to an endomorphism of F . Now consider only those endomorphisms f of F that induce (by restriction) an endomorphism of A ′ , that is, f (A ′ ) ⊆ A ′ . Such endomorphisms form a subsemigroup S of End(F ). Now for f, g ∈ S let (f, g) ∈ ρ if and only if f | A ′ = g| A ′ . It is easily seen that ρ is a congruence on S; by the given conditions, S/ρ ∼ = End(A ′ ) ∼ = End(A). Proof. For R, the countably infinite anti-clique works as A in Lemma 4.3, since now any self-map is an endomorphism of A. Similarly, the countably infinite anti-chain A shows the required assertions about End(P). Finally, for limits of Fraïssé classes of algebras it suffices to note that any self-map on X, the set of free generators of the corresponding free algebra F (X), induces an endomorphism of F (X), whence we let X to be countably infinite.
For various reasons, a number of Fraïssé classes and their corresponding limits remain outside the scope of this approach. As we have seen, some of them, such as the finite K n -free simple graphs, fail to have the 1PHEP. Other classes, such as the finite K n -free simple graphs and the finite linear orders have the 1PHEP, and they even have both coproducts and amalgamated free sums in certain broader concrete categories (of simple graphs and posets, respectively), but these sums fail to be K n -free in the former case, or linearly ordered in the latter. Finally, some structures simply do not have coproducts and/or amalgamated free sums. For example, there seems to be no meaningful notion of a coproduct for (rational) metric spaces. This stems from the fact that when we are given a finite metric space M and we wish to add a new point x, then the set of possible vectors of distances of x to the existing elements of M is in general an unbounded subset of R m , where m = |M | (or Q m , if we go for rational distances), thus rendering impossible the choice of the "farthest point" from M -something which would be required should the coproduct of M and a singleton space exist. So, since the linear order Q and the universal rational metric space U Q are historically the oldest examples of Fraïssé limits, it is natural to ask the following questions.