Tropical functions on a skeleton

We prove a general finiteness statement for the ordered abelian group of tropical functions on skeleta in Berkovich analytifications of algebraic varieties. Our approach consists in working in the framework of stable completions of algebraic varieties, a model-theoretic version of Berkovich analytifications, for which we prove a similar result, of which the former one is a consequence.


Introduction
1.1.The general context: skeleta in Berkovich geometry.-Let F be a complete non-archimedean field.Among the several frameworks available for doing analytic geometry over F (Tate, Raynaud, Berkovich, Huber...), Berkovich's is the one that encapsulates in the most natural way the deep links between non-archimedean and tropical (or polyhedral) geometry.
Indeed, every Berkovich space X over F contains plenty of natural "tropical" subspaces, which are called skeleta.Roughly speaking, a skeleton of X is a subset S of X on which the sheaf of functions of the form log|f | with f a section of O × X induces a piecewise linear structure; i.e., using such functions one can equip S with a piecewise linear atlas, whose charts are modeled on (rational) polyhedra and whose transition maps are piecewise affine (with rational linear part).
This definition is rather abstract, but there are plenty of concrete examples of skeleta.The prototype of such objects is the "standard skeleton" S n of (G n m ) an , that consists of all Gauss norms with arbitrary real parameters; the family Now if X is an arbitrary analytic space and if φ 1 , . . ., φ m are quasi-finite maps from X to (G n m ) an , then j φ −1 j (S n ) is a skeleton by [Duc12, Th. 5.1], (it consists only of points whose Zariski-closure is n-dimensional, so it is empty if dim X < n), and φ −1 j (S n ) → S n is a piecewise immersion for all j; of course, every piecewise-linear subspace of j φ −1 j (S n ) is still a skeleton.Skeleta were introduced by Berkovich in his seminal work [Ber99] on the homotopy type of analytic spaces, where he proved that any compact analytic space with a polystable formal model admits a deformation retraction to a skeleton (isomorphic to the dual complex of the special fiber), and used it to show that quasi-smooth analytic spaces are locally contractible; they play a key role in the theory of real integration on Berkovich spaces [CLD17].Let us mention that all skeleta encountered in these works are at least locally of the form described above; i.e., piecewise-linear subspaces of finite unions φ −1 j (S n ) for quasi-finite maps φ j : X → (G n m ) an .
1.2.Our main result.-If S is a skeleton of an analytic space X and if f is a regular invertible function defined on a neighborhood of S, then log|f | is a piecewiselinear function on S, and our purpose is to understand what are the piecewise linear functions on S that can arise this way in the algebraic situation.
Let us make precise what we mean.Let X be an algebraic variety over F , say irreducible of dimension n; let us call log-rational any real-valued function of the form log|f | for f a non-zero rational function on X, viewed as defined over U an for U the maximal open subset of X on which f is well-defined and invertible.Let φ 1 , . . ., φ m be (algebraic) quasi-finite maps from X to G n m (the corresponding analytic maps will also be denoted φ 1 , . . ., φ m ).Let S be a subset of the skeleton φ −1 j (S n ) defined J.É.P. -M., 2024, tome 11 by a Boolean combination of inequalities between log-rational functions.Our main theorem is the following finiteness result.
Main Theorem (Berkovich setting).-Let X be an irreducible algebraic variety over F of dimension n and assume F is algebraically closed.Let S be as above.Then there exists finitely many non-zero rational functions f 1 , . . ., f ℓ on X such that the following holds.
(1) The functions log|f 1 |, . . ., log|f ℓ | identify S with a piecewise-linear subset of R ℓ (i.e., a subset defined by a Boolean combination of inequalities between Q-affine functions). ( The group of restrictions of log-rational functions to S is stable under min and max and is generated under addition, subtraction, min and max by the (restrictions of the) functions log|f i | and the constants log|a| for a ∈ F × .
Let us mention that statement (1) is implicitly established in [Duc12] (see op. cit., proof of Theorem 5.1); what is really new here is statement (2).And let us insist on the assumption that F is algebraically closed: for a general F the theorem does not hold, as shown by a counter-example due to Michael Temkin (Remark 7.6).
1.3.About our proof.-In fact, we do not work directly with Berkovich spaces but with the model-theoretic avatar of this geometry, namely the theory of stable completions of algebraic varieties which was introduced by two of the authors in [HL16].Thus, what we actually prove is Theorem 7.2 which is a version of the result above in this model-theoretic framework -the final transfer to Berkovich spaces being straightforward.
Let us give some explanations.Let X be an algebraic variety over a valued field F .We denote by X the stable completion of X.The standard skeleton S n of (G n m ) an has a natural counterpart Σ n in G n m , and φ −1 j (Σ n ) makes sense as a subset of X; moreover, the inequalities between log-regular functions that cut out S inside φ −1 j (S n ) also make sense here, and cut out a subset Σ of φ −1 j (Σ n ).By Theorem 4.2, this subset is F -definably homeomorphic to an F -definable subset of Γ N for some N .It follows moreover from its construction that Σ is contained in the subset X # of X consisting of strongly stably dominated types (or, in other words, of Abhyankar valuations), and even in its subset X # gen of Zariski-generic points.We can now state Theorem 7.2.Let us just precise that what we call a val-rational function is a Γ-valued function of the form val(f ) with f a non-zero rational function on X (here val(f ) is seen as defined on the stable completion of the invertibility locus of f .) Main Theorem (Model-theoretic setting).-Let F be an algebraically closed field endowed with a valuation val : F → Γ ∪ {∞}.Let X be an irreducible algebraic variety over F .Let Υ be an iso-definable subset of X # gen which is Γ-internal, that is, F -definably isomorphic to an F -definable subset of Γ N for some N .
There exists finitely many non-zero rational functions f 1 , . . ., f ℓ on X such that the following holds.
(2) The group of restrictions of val-rational functions to Υ is stable under min and max and generated under addition, subtraction, min and max by the (restrictions of the) functions val(f i ) and the constants val(a) for a ∈ F × .
Let us start with a remark.The Γ-internal subsets we are really interested in for application to Berkovich theory seem to be of a very specific form (they are definable subsets of φ −1 j (Σ n ) for some family (φ j ) of quasi-finite maps from X to G n m ) and our main theorem deals at first sight with far more general Γ-internal subsets.But this is somehow delusive; indeed, we show (Theorem 4.4) that every Γ-internal subset of X # gen is contained in some finite union φ −1 j (Σ n ) as above.We are now going to describe roughly the main steps of the proof of our main theorem.
Step 1. -This first step has nothing to do with valued fields and concerns general divisible abelian ordered groups.Basically, one proves the following.Let D be an M -definable closed subset of Γ n for some divisible ordered group M contained in a model Γ of DOAG, let g 1 , . . ., g m be Q-affine M -definable functions on Γ n , and let f be any continuous and Lipschitz M -definable map from D to Γ, such that for every x in D there is some index i with f (x) = g i (x).Then under these assumptions, f lies in the set of functions from D to Γ generated under addition, subtraction, min and max by the g i , the coordinate functions and M : this is Theorem 3.13.Here the Lipschitz condition refers to a Lipschitz constant in Z ⩾0 , so that it is a void condition when M has no non-trivial convex subgroup and D is definably compact, but meaningful in general.
Step 2. -We start with proving a finiteness result in the spirit of our theorem under a weaker notion of generation.More precisely, we show (Theorem 5.6) the existence of f 1 , . . ., f ℓ as in our statement such that (1) holds and such that the following weak version of (2) holds, with H denoting the group of Γ-valued functions on Υ generated by the val(f i ) and the constants val(a) for a ∈ F × : for every non-zero rational function g on X there exist finitely many elements h 1 , . . ., h r of H such that Υ is covered by its definable subsets {val(g) = val(h i )} for i = 1, . . ., r.
The key point for this step is the purely valuation-theoretic fact that an Abhyankar extension of a defectless valued field is still defectless.It has been given several proofs in the literature, some of which are purely algebraic, some of which are more geometric.For the sake of completeness and for consistency with the general viewpoint of this paper, we give a new one in the appendix, (Theorem A.1) which is model-theoretic and based upon [HL16].It follows already from Theorem 5.6 that skeleta are endowed with a canonical piecewise Z-affine structure.In particular this implies the existence of canonical volumes for skeleta as we spell out in Section 8. J.É.P. -M., 2024, tome 11 Step 3. -One strengthens the statement of Step 2 by showing (Proposition 6.13) that the f i can even be chosen so that all functions (val(g))| Υ as above are Lipschitz, when seen as functions on val(f )(Υ) ⊆ Γ m .This is done as follows.First, by possibly replacing the ground field with a smaller one over which everything is defined, we can assume that val(F × ) has only finitely many convex subgroups.Under this assumption we can achieve by enlarging f that val(f ) induces an embedding Υ(F ′ ) → Γ m (F ′ ) for every coarsening F ′ of F (by a coarsening, we mean that F ′ has the same underlying field as F and a coarser valuation); then for every valued algebraically closed extension L of F and every coarsening L ′ of L the map Υ(L ′ ) → Γ(L ′ ) n induced by val(f ) will be injective, which implies the sought after Lipschitz property by an easy compactness argument.
Step 4. -One proves that the set of functions on Υ of the form val(g) is stable under min and max.This follows from orthogonality between the residue field and the value group sorts in ACVF, see Lemma 7.1.
Step 5. -By the very choice of the f i , every function val(g)| Υ gives rise via the embedding val(f )| Υ to a definable function on val(f )(Υ) that belongs piecewise to the group generated by val(F × ) and the coordinate functions x 1 , . . ., x ℓ (Step 2) and is moreover Lipschitz (Step 3); it is thus (Step 1) equal to t(x 1 , . . ., x ℓ , a) where t is a term in {+, −, min, max} and a a tuple of elements of val(F × ).Then val(g)| Υ = t(val(f 1 )| Υ , . . ., val(f ℓ )| Υ , a) and we are done.
Acknowledgements.-We are very grateful to Michael Temkin for communicating us the example in Remark 7.6.We are also very grateful to the referees for their careful reading and for their many comments that helped us to improve considerably the readability of the paper.

Preliminaries
2.1.Stably dominated types.-The aim of this section is to review some of the material from [HL16] that we will use in this paper.The reader is referred to [HL16] or to the surveys [Duc13] or [Duc16] for more detailed information.In this paper, we shall work in the framework of [HL16], namely the theory ACVF of algebraically closed valued fields K with nontrivial valuation in the geometric language L G of [HHM06].We recall that this language is an extension of the classical three-sorted language with sorts VF, Γ and RES for the valued field, value group and residue field sorts, and additional symbols val and res for the valuation and residue maps, obtained by adding new sorts S m and T m , m ⩾ 1, corresponding respectively to lattices in K m and to the elements of the reduction of such lattices modulo the maximal ideal of the valuation ring.By the main result of [HHM06] ACVF has elimination of imaginaries in L G .
Recall that in a theory T admitting elimination of imaginaries in a given language L, for M |= T and A ⊆ M , a type p(x) in S x (M ) is said to be A-definable if for every L-formula φ(x, y) there exists an L A -formula d p φ(y) such that for every b in M , φ(x, b) ∈ p if and only if M |= d p φ(b).If p ∈ S x (M ) is definable via d p φ, then the same scheme gives rise to a unique type p |N for any elementary extension N of M .There is a general notion of stable domination for A-definable types: stably dominated types are in some sense "controlled by their stable part".In the case of ACVF, there is concrete characterization of A-definable stably dominated types as those which are orthogonal to Γ, meaning that for every elementary extension Let X be an A-definable set in ACVF, with A an L G -structure.A basic result in [HL16] states that there exists a strict A-pro-definable set X such that for any C ⊇ A, X(C) is equal to the set of C-definable stably dominated types on X ([HL16, Th. 3.1]).Here by pro-definable we mean a pro-object in the category of definable sets and strict refers to the fact that the transition morphisms can be chosen to be surjective.Morphisms in the category of pro-definable sets are called definable morphisms.
In fact X can be endowed with a topology that makes it a pro-definable space in the sense of [HL16,§3.3].In this setting there is a model theoretic version of compactness, namely definable compactness: a pro-definable space X is said to be definably compact if every definable type on X has a limit in X.In an o-minimal structure M , this notion is equivalent to the usual one, namely a definable subset X ⊆ M n is definably compact if and only if it is closed and bounded.

Γ-internal sets.
-Let us fix a valued field k and a quasi-projective variety X over k.We denote by Γ the value group of k.The structure induced is that of an ordered abelian group in the language of ordered groups, in particular it is o-minimal.We extend Γ to Γ ∞ = Γ ∪ {∞} with ∞ larger than any element of Γ.A pro-definable set is called iso-definable if it is pro-definably isomorphic to a definable set.A Γ-internal subset Z of X, or more generally of X × Γ m ∞ , is an iso-definable subset such that there exists a surjective definable morphism D → Z (which can be assumed to be bijective by elimination of imaginaries) with D a definable subset of some Γ r ∞ .By [HL16, Th. 6.2.8], if Z is a k-iso-definable and Γ-internal subset of X, there exists some finite k-definable set w and a continuous injective definable morphism In particular if Z is definably compact such an f is a homeomorphism onto its image.

2.3.
The Zariski-generic case.-Assume that k is algebraically closed.We can then assume w = {1, . . ., n}.Then the definable injection Z → Γ n ∞ alluded to above can be obtained by using (locally) valuations of regular functions.Thus if X is irreducible and Z only consists of Zariski-dense points, we can find a dense open subset U of X and invertible functions g 1 , . . ., g n on U such that the functions val(g i ) induce a definable bijection between Z and a k-definable subset of Γ n (without ∞).Moreover, by shrinking U and adding some extra invertible functions to the g i , we can assume that g induces a closed immersion U → G n m ; then the functions val(g i ) induce a We may now define strong deformation retractions.Fix a valued field k and a quasi-projective variety X over k.A strong deformation retraction of X onto Υ ⊆ X is a continuous k-definable morphism A special case of the main result of [HL16] states the following: 2.5.Theorem.-Let X be a quasi-projective variety over a valued field k.Then there is a (k-definable) strong deformation retraction ∞ for some finite definable set w, which is a homeomorphism onto its image and such that for each irreducible component W of X, Υ ∩ W is of o-minimal dimension dim(W ) at each point.
We shall call such a Γ-internal set Υ a retraction skeleton of X.Note that this is what is called a skeleton in [HL16], but we have decided to change the terminology to avoid conflict with the literature.

2.6.
Remark.-When X is smooth and irreducible, there exists a deformation retraction as above with Υ consisting only of Zariski-generic points: this follows from the proof of [HL16,Th. 11.1.1],see also [HL16,Ch. 12]; so if k is a model of ACVF, then Υ can be topologically and k-definably identified with a subset of some Γ m by using valuations of non-zero rational functions (2.3).
Note that the smoothness assumption cannot be dropped for the above: if X is a cubic nodal curve, any retraction skeleton Υ of X contains the nodal point (and any definable topological embedding from Υ into some Γ w ∞ will send the nodal point to a w-uple with at least one infinite coordinate).

2.7.
Strongly stably dominated types.-In fact all retraction skeleta of X are contained in the subspace X # ⊆ X of strongly stably dominated types on X.The study of the space X # is the subject of [HL16,Ch. 8].Loosely speaking the notion of strongly stably dominated corresponds to a strong form of the Abhyankar property for valuations namely that the transcendence degrees of the extension and of the residue field extension coincide.An important property of X # is that it has a natural structure of (strict) ind-definable subset of X.Furthermore, by [HL16, Th. 8.4.2],X # is exactly the union of all the retraction skeleta of X.
It seems plausible that arbitrary Γ-internal subsets of X can be rather pathological, but those contained in X # should be reasonable.We shall see below that this is indeed the case at least for Γ-internal subsets of X # that consist of Zariski-generic points (when X is irreducible).When X is irreducible, we will denote by X # gen the subset of X # consisting of Zariski-generic points.
2.8.Connection with Berkovich spaces.-Let k be a valued field with val(k) ⊆ R ∞ , which we assume to be complete.Let X be a separated and reduced algebraic variety of finite type over k.Denote by X an its analytification in the sense of Berkovich.Chapter 14 of [HL16] is devoted to a detailed study of how one can deduce statements about X an from similar statements about X.This comes from the fact that, if one denotes by k max a maximally complete algebraically closed extension of k with value group R and residue field the algebraic closure of the residue field of k, there is a canonical and functorial map π : X(k max ) → X an which is continuous, surjective, and closed.When k = k max , π is actually a homeomorphism.Furthermore, any k-definable morphism g : X → Γ ∞ induces a unique map g : X an → R ∞ which is continuous if g is, and any (k-definable) strong deformation retraction H : I × X → X induced canonically a strong deformation retraction H : I(R ∞ ) × X an → X an compatible with π for any t ∈ I(R ∞ ).Thus, if one defines a retraction skeleton Σ in X an as the image under π of the k max -points of a retraction skeleton in X, we obtain that when X is quasi-projective there exists a strong deformation retraction of X an onto a retraction skeleton Σ.Furthermore, the fact that retraction skeleta in X are contained in X # implies that any point of Σ, as a type over (k, R), extends to a unique stably dominated type; this type is strongly stably dominated and, restricted to (k, R), it determines an Abhyankar extension of the valued field k, cf.[HL16, Th. 14.2.1].

Finite generation and Lipschitz functions in DOAG
In this section, we work in the theory of divisible ordered abelian groups which is denoted by DOAG, and by definable we mean definable with parameters.We shall usually denote by Γ a model of DOAG.We start with the definition of w-combination and w-generation.
3.1.Definition.-Let X and Y be definable topological spaces and g, f 1 , . . ., f n be definable continuous functions from X to Y .We say g is a w-combination of f 1 , . . ., f n if for every x ∈ X, there is some i ∈ {1, . . ., n} such that f i (x) = g(x).Notationally, J.É.P. -M., 2024, tome 11 In contrast, there is a stronger notion of combination that is very specific to DOAG.

3.2.
Definition. -Let X be a definable topological space and let g and f i , i ∈ I, be definable continuous functions X → Γ.We say that g is an ℓ-combination of the f i if g lies in the (min, max)-lattice generated by (f i ) i∈I .More explicitly, there are f 1 , . . ., f n in (f i ) i∈I such that g is a function obtained by f 1 , . . ., f n and finitely many operations of min, max.
We shall also use the following variants of w and ℓ-combination.

3.3.
Definition. -Let X be a definable topological space and let g and f i be definable continuous functions X → Γ for i ∈ I.We say that g is a (w, +)-combination of the f i if there exist h 1 , . . ., h n in the abelian group generated by the functions f i , i ∈ I such that g is a w-combination of the h i .We say that g is an (ℓ, +)-combination of the f i if g can be described by a formula involving only +, −, min and max and finitely many f i .
We say that a given set of functions containing the f i and stable under w-combination is w-generated by the f i if it consists precisely of the set of all w-combinations of the f i .We define (w, +), ℓ and (ℓ, +)-generation in an analogous way.

3.4.
Example.-Let X = Γ n and m k : X → Γ be the definable function which to (x 1 , . . ., x n ) assigns the k-th smallest x i .Clearly, m k is a w-combination of the coordinate functions x 1 , . . ., x n .On the other hand, it is not hard to see that Hence the m k (x) are even ℓ-combinations of x 1 , . . ., x n .
However, the two notions of combinations do not agree in general.
Clearly g is a w-combination of f 1 and f 2 .However, we claim that g is not an (ℓ, +)-combination of coordinate functions.Indeed, if it were, then it would extend to a continuous Let Γ be a model of DOAG containing Q and in which there is some c > n for all n ∈ N. Since tp (1, c) = tp (α, c) for any 1 > α > 0 and g(1, c) = c, so g ′ (α, c) = c.However g ′ (0, c) = g(0, c) = 0, in contradiction with the continuity of g ′ .For a connected version of this example, replace D by ) and set g = 0 on {0} × [1,2].
This example suggests that interaction of the ambient space and the topology of D plays a role in distinguishing the two notions of combinations.To proceed towards a topological characterization for such properties, we need the following.
. By o-minimality, L must be [0, 1] with at most finitely many points in (0, 1) removed.But removing any point from (0, 1) would lead to a violation of convexity.
Note further that for D convex, working inside the smallest affine subspace containing D, we may assume that cl(int(D)) = cl(D).
Lastly, recall that for any definable subset D of some Γ n , a function f : where m i ∈ Q and c ∈ Γ.Such functions are the most basic definable continuous functions on D. We say f is Z-affine if the m i are all in Z.
3.8.Proposition.-Let Γ be a divisible ordered abelian group and let f 1 , . . ., f m be Q-affine functions on Γ n .Let D ⊆ Γ n be definable and g : D → Γ be a continuous definable function.Assume that g is a w-combination of f 1 , . . ., f m .Then the following are equivalent: (1) g is an ℓ-combination of f 1 , . . ., f m .
(2) g extends to a continuous definable function g ′ : Γ n → Γ that is a w-combination of f 1 , . . ., f m .
(3) g extends to a continuous definable function g ′ : D ′ → Γ on some convex definable set D ′ containing D that is a w-combination by f 1 , . . ., f m .
(5) For some collection S of subsets of {1, . . ., m}, g = min X∈S max i∈X f i .
Proof.-The implications (5) ⇒ (1) ⇒ (2) ⇒ (3) are clear.For (3) ⇒ (4), by working in an elementary extension, we may assume that Γ is a model of the theory of real closed fields RCF.By Remark 3.7 and after replacing D by the convex set D ′ in (3), we may assume the line segment [x, y] connecting x, y is in D. Replace g by g ′ given by (3) as well.Let I j ⊆ [x, y] be {z : g(z) = f j (z)}.By continuity of g and o-minimality, we know that the sets I j are finite unions of closed intervals and Since the functions f i are Q-affine, the functions f ′ i are of the form a i x + b i for some a i , b i ∈ Γ.Let k be the j such that a j is the greatest amongst all the j such that I ′ j ̸ = ∅.If there are multiple such j, pick any.By induction, for a to the right of I ′ k , we have g ′ (a) ⩽ f ′ k (a).Similarly, for a to the left of . For (4) ⇒ (5), consider S to be the collection of subsets X ⊆ {1, . . ., m} such that g ⩽ max i∈X f i on the entire D. Set f := min X∈S max i∈X f i .We claim that J.É.P. -M., 2024, tome 11 g = f .Clearly g ⩽ f , so it suffices to show that g ⩾ f .For each W / ∈ S, there is some y W such that g(y W ) > f i (y W ) for every i ∈ W .By (4), for each x ∈ D, We have that X ∈ S because otherwise, i x X ∈ X.For this x, we have that max i∈X f i (x) ⩾ g(x) and f i (x) ⩽ g(x) for any i ∈ X, hence f (x) ⩽ max i∈X f i (x) = g(x).□ 3.9.Corollary.-Let D ⊆ Γ n be a definable convex set.The set of definable continuous functions from D to Γ is (ℓ, +)-generated by the constants and all rational multiples of coordinate functions. Proof.
-By quantifier elimination, we can find Q-affine functions f 1 , . . ., f n such that g is a w-combination of f 1 , . . ., f n .By Proposition 3.8, we have that g is in fact an ℓ-combination of f 1 , . . ., f n .□ Proposition 3.8 suggests that the agreement of w-combination and ℓ-combination is related to the existence of continuous extensions to an ambient convex space.This motivates the following definition.
Note that Lipschitz functions are automatically continuous and clearly the class of Lipschitz functions depends on the embedding of D in Γ n .Our purpose is now to investigate Lipschitz definable functions on closed definable sets; a first step will consist in reducing to the definably compact case, by using the two following lemmas.

3.11.
Lemma.-Let Γ be a model of DOAG, let D be a subset of Γ n definable over some set A of parameters, and let f : D → Γ be a Lipschitz A-definable map.Let (f i ) be a finite family of Q-affine A-definable functions such that f is a w-combination of the f i | D .Then f admits a unique continuous extension f to cl(D), the set cl(D) and the function f are A-definable, and f is Lipschitz and if a w-combination of the Proof.-The uniqueness of f is clear, as well as the A-definability of cl(D) and f if the latter exists, as one sees by using the definition of the closure and of the limit (with ε and δ. . .).The same reasoning also shows that the set of points of cl(D) ∖ D at which f admits a limit is A-definable.Moreover if f exists it inherits obviously the Lipschitz property of f , and it is also w-generated by the (restrictions of) the f i : indeed, the subset of cl(D) consisting of points x such that there is some i with f (x) = f i (x) is closed and contains D, thus is the whole of cl(D).
It thus remains to show the existence of f , and this can be done after enlarging the model Γ.We can thus suppose that it is equal to the additive group of some real closed field.Let x be a point of cl(D) ∖ D. There exists a half-line L emanating from x such that (x, y) ⊆ D for some y; taking y close enough to x we can assume that f = f j on (x, y) for some j.Then the limit of f at x along the direction of L exists and is equal to f j (x).The Lipschitz property then ensures that this limit does not depend on L, let us denote it by f (x).Since D is defined by affine inequalities, there is a positive γ ∈ Γ such that for every y in Γ n with ∥x − y∥ < γ (say for the Euclidean norm) then either (x, y) Then there is a term t ′ in {+, −, max, min} and a finite tuple Proof.-Assume first that M is a model of DOAG.By our assumption, there exists a term t in {+, −, max, min} and a tuple γ Thus there is m > 0 such that for each i, there exist integers k i and Viewing the above as a first-order formula with constants in the model M and a variable for ν, using o-minimality and model-completeness of M , we have some ν 0 ∈ M >0 such that for any ν ′ > ν 0 , the following holds in M : We then have by construction, which ends the proof when M ̸ = {0}.
where δ is positive and infinitesimal with respect to Γ, set M ′ = Q • δ and let us denote by Z ′ and h ′ the objects deduced from Z and h by base-change to Γ ′ .Applying the above yields a term θ in {+, −, max, min} and a tuple β of elements of We can now state the main result of this section.definable function over M .Let f 1 , . . ., f n be Q-affine functions over M such that g is a w-combination of f 1 , . . ., f n .Then g is an (ℓ, +)-combination of the f i , the constant M -valued functions and the coordinate functions.
Before proving this result we will need some preliminaries on cell decomposition in DOAG.
3.14.Cell decomposition.-Fix a model Γ of DOAG.We shall use the notion of special linear decompositions from [Ele18].In [Ele18], Eleftheriou defines the notion of linear decomposition, which is a cell decomposition using only graphs of Q-affine functions instead of general piecewise Q-affine functions.In fact we will need only to consider bounded linear cells in Γ n .They are defined by induction on n.In Γ 0 the origin is a bounded linear cell.If C is a bounded linear cell in Γ n−1 , f and g are Q-affine functions on Γ n−1 , with f < g on C, the relative interval We denote by π : Γ n → Γ n−1 the projection to the n − 1 first coordinates.A special linear decomposition of a bounded definable set Y ⊆ Γ n is defined recursively in [Ele18] as follows.When n = 1 any cell decomposition of Y is special.If n > 1, a linear decomposition C of Y is special if the following conditions are satisfied: (1) π(C) is a special linear decomposition of π(Y ).
(2) For every pair of cells Γ(f ) S and Γ(g (3) For every pair of cells (f < g) T and X in C, where An important property of special linear decompositions is that if D and E are two cells in such a decomposition such that D ∩cl(E) is non-empty then Note that closures of cells have a simple description: the closure of

Lemma. -Fix a special linear cell decomposition of a closed bounded definable subset of Γ n and let
Proof.-We proceed by induction on n.The case n = 0 is clear.If n > 0, we have that We shall also need the following statement.Proof.
-Let D be a linear decomposition of D. We consider the set F of all sets F of the form F = cl(C), with C a 1-dimensional cell in D, that intersect the hyperplane h = 0 and are not contained in h = 0.For such an F we denote by p F its intersection point with h = 0.There exists a positive integer Indeed, the restrictions of both h and g to the line segment F are linear functions on F vanishing at the endpoint p F of F and the restriction of h is not identically zero, which yields the existence of some M F .In fact the inequality |f , and if F is a face of P of any dimension, then the convex hull of all half-lines directed by 1-faces intersecting F contains P , hence the result, taking P = D and F = D 0 .□ The following statement about separation by hyperplanes will play a key role in our proof of Theorem 3.13.
3.17.Proposition.-Fix a special linear cell decomposition of a closed bounded definable subset of Γ n and let C 1 and C 2 be two cells.Assume

and the hyperplane
Proof.-We shall proceed by induction on n, the case n = 1 being clear.If π(C 1 ) = π(C 2 ), then the statement is clear.Indeed, for each i = 1, 2, we have In the second case we set g i = f i .We may assume that C 1 is above C 2 .The graph of the average of f 1 and g 2 provides the required hyperplane.
Thus we will assume from now on that π(C 1 ) ̸ = π(C 2 ).We set i where f i and g i are Q-affine functions coinciding with f and g on S, since we are working with a special linear cell decomposition.
hyperplane H above h ′ (the hyperplane defined by the same equation in Γ n ).It follows from our description of D 1 ∩ D 2 that H satisfies the required conditions.
Case 2: D 1 ∩ D 2 is non-empty and C is of the form Γ(f ) S .-By the induction hypothesis, there exists an hyperplane h ′ given by an equation h ′ (x ′ ) = 0 in Γ n−1 , with h ′ a Z-affine function, x ′ = (x 1 , . . ., x n−1 ) fulfilling the conditions of Proposition 3.17 relatively to cl(C ′ 1 ) and cl(C ′ 2 ).In particular h ′ ⩾ 0 on π(D 1 ) and h ′ ⩽ 0 on π(D 2 ).We denote by H the hyperplane with equation h In the second case we set by the case assumption and the fact our decomposition is special.Let X be the graph of g 1 over cl(C ′ 1 ).The function x n −f (x ′ ) is identically zero on H ∩ X, hence by Lemma 3.16, there exists a positive integer M such that After increasing M we may assume the inequality is strict when h ′ (x ′ ) ̸ = 0.It follows that the the hyperplane H M with equation M h ′ (x ′ ) − (x n − f (x ′ )) = 0 lies above the set D 1 and strictly above D 1 ∖ H. Using the same argument for D 2 , we get that after possibly increasing M the hyperplane H M lies under the set D 2 and strictly under D 2 ∖ H. Let us check that H M satisfies the required conditions.Indeed, a point then by the induction hypothesis there exists an hyperplane h ′ in Γ n−1 satisfying the required conditions for π(D 1 ) and π(D 2 ) and π −1 (h ′ ) will do the job.Thus we may assume that π(D 1 ) ̸ = π(D 2 ) and π(D 1 ) ∩ π(D 2 ) ̸ = ∅.We choose an hyperplane h ′ in Γ n−1 with equation h ′ (x ′ ) = 0 satisfying the required conditions for π(D 1 ) and π(D 2 ).We may assume In the second case we set We may assume that f 2 > g 1 over π(D 1 ) ∩ π(D 2 ).Note that if we intersect the cells of a special linear cell decomposition of some bounded set W with H we get a special linear cell decomposition of W ∩ H. Thus we can apply the induction hypothesis to D ′ 1 and D ′ 2 , and there exists a Z-affine function f on Γ n such that f > 0 on D ′ 1 and f < 0 on D ′ 2 .We claim that for M a large enough integer the hyperplane M h ′ + f = 0 will separate D 1 and D 2 .
To prove this we proceed similarly as in the proof of Lemma 3.16.We consider the set F of all sets F of the form F = cl(C), with C a 1-dimensional cell contained in D 1 , that intersect H and are not contained in H.For such an F denote by p F the intersection point of F with H.The restriction of f to F can be written as f (p F ) + ℓ F with ℓ F a Q-linear function on F .Since h ′ is strictly positive on F outside p F , there exists a positive integer M F such that M F h ′ + ℓ F ⩾ 0 on F .This still holds on the whole half-line L F containing F with origin p F .Since f (p F ) > 0 by assumption, we get that M F h ′ + f > 0 on L F .Take M 1 = max F (M F ). Proceeding as in the proof of Lemma 3.16 we deduce that M 1 h ′ +f > 0 on D 1 .One proves similarly the existence of M 2 such that M 2 h ′ + f < 0 on D 2 .Thus we can take M = max(M 1 , M 2 ).□ Proof of Theorem 3.13.-By Lemma 3.11 we can assume that D is closed.We may then enlarge the model Γ and assume that it contains some ρ with ρ > M .Let D ρ denote the intersection of D with [−ρ, ρ] m .This is a definably compact subset of Γ m which is definable over M ρ := M ⊕Q•ρ.If we prove that g| Dρ is an (ℓ, +)-combination of the f i , the coordinate functions and some constant functions with values in M ρ , Lemma 3.12 above will allow us to conclude that g is an (ℓ, +)-combination of the f i , the coordinate functions and some constant functions with values in M .We thus may and do assume that D is definably compact.By considering a submodel of M over which everything is defined, we reduce to the case where M has exactly r non-trivial convex subgroups, and we proceed by induction on r.The case r = 0 is obvious since the definably compact set D is then either empty or equal to {0}.Assume now that r > 0 and that the result holds true for smaller values of r.Let M 0 be the smallest non-trivial convex subgroup of M , and M = M/M 0 be the quotient.We are first going to explain why we can assume that g(D(M )) ⊆ M 0 ; this is tautological if M 0 = M , so we assume (just for this reduction step) that M 0 ̸ = M .In this case M is a model of DOAG with r − 1 non-trivial convex subgroups, and the natural map carrying M to M induces a map that carries D(M ) to a definably compact definable subset D of M m (see [CHY21, Th. 4.1.1]for example).Furthermore, since g is Lipschitz, it descends to a definable function g : D(M ) → M , which is Lipshitz as well and is a (w, +)-combinations of the f i .By the induction hypothesis, we then know that g is of the form τ (f 1 , . . ., f n ), where τ is a term involving constants, projections and +, −, min, max only.Replacing g by g − τ (f 1 , . . ., f n ), we may assume that g(D) ⊆ M 0 , as announced.By [Ele18, Fact 2.2] there exists a special linear decomposition D of D such that g is Q-affine on each cell.Clearly D is covered by the closed sets already cover D, but we will not use this.Sets of the form cl(C) with C ∈ D will be referred to as closed cells.
We will now use the separating hyperplanes provided by Proposition 3.17 to build affine functions that will appear in the (ℓ, +)-combination we are seeking for describing g.For this purpose, the inclusion g(D(M )) ⊆ M 0 will be crucial.Proof of the claim.-By Proposition 3.17 there exists a Z-affine function h such that the hyperplane and let G be the Q-affine function such that g = G on D ′ .Replacing g by g − G, we may assume that g = 0 on D ′ .Translating our entire set by c, we may assume that c is the origin.Thus g(0) = 0 and g is actually the restriction of a Q-linear function on D ′′ .On D ′ , for any positive integer m, we have Thus, by Lemma 3.16, there exists a positive integer m such that −g ⩽ −mh on D ′′ .For such an integer m, we have g ⩽ mh on D ′ and g ⩾ mh on D ′′ .□ We can now conclude the proof of Theorem 3.13.Note that g is a w-combination of the functions f i ; it is thus a fortiori a w-combination of the set of functions obtained by adding all the functions f D ′ ,D ′′ from Claim 3.18 to the functions f i .Take x and y in D. If they belong to the same closed cell D ′ = cl(C ′ ), then g(x) = f i (x) and g(y) = f i (y) for some i and condition (4) in Proposition 3.8 is satisfied.If they belong to two distinct closed cells D ′ and D ′′ , then g(x) ⩽ f D ′ ,D ′′ (x) and f D ′ ,D ′′ (y) ⩽ g(y) by Claim 3.18.Thus, by the implication (4) ⇒ (1) in Proposition 3.8, we obtain that g is an ℓ-combination of the functions f i and f D ′ ,D ′′ , which concludes the proof. □ The proof of Claim 3.18 actually yields the following convenient way to check if a given function is Lipschitz on a definably compact set.

3.21.
Remark.-In the case of homogeneous linear equations, with no parameters, equivalence of ℓ-combination and w-combination goes back to work of Beynon [Bey75], see also [Gla99, §5.2] and [Ovc02] for related results.In 2011, as a student, Daniel Lowengrub rediscovered and partially generalized Beynon's results.He also gave Example 3.5 showing that they do not hold over non-archimedean parameters.
Here we fully generalized them, after replacing continuity by a Lipschitz condition.Our proofs in this section make use of his ideas.-Let k be an algebraically closed valued field and let X be an irreducible n-dimensional k-scheme of finite type.
Let Σ n be the image of the definable topological embedding from Γ n into G n m that sends a n-tuple γ to the generic point r γ of the closed n-ball with valuative radius γ and centered at the origin.This set Σ n is the archetypal example of a Γ-internal subset, and it is contained in If dim φ(X) < n then φ( X) does not meet Σ n (since the latter lies over the generic point of G n m ), so Υ = ∅.Assume that dim φ(X) = n, which means that φ is generically finite.Then each point of Υ lies in X # gen by [HL16, Prop.8.1.2]and φ −1 (s) is finite for every s ∈ Σ n .The purpose of what follows is to show that Υ is Γ-internal and purely n-dimensional, and that this also holds more generally for a finite union of pre-images for Σ n under various maps from X → G n m .This is a model-theoretic version of a result that is known in the Berkovich setting, see [Duc12, Th. 5.1].

4.2.
Theorem.-Let X be an n-dimensional k-scheme of finite type and let φ 1 , . . ., φ m be morphisms from X to G n m .The finite union Proof of Theorem 4.2.-It is sufficient to prove that φ −1 j (Σ n ) is Γ-internal and purely n-dimensional for every j.Indeed, assume that this is the case.Then if j and ℓ are two indices the intersection φ ) by [HL16, Lem.8.2.9] so Υ is Γ-internal, and obviously purely n-dimensional as a finite union of purely n-dimensional Γ-internal subsets.
We can thus assume that m = 1, and we write φ instead of φ 1 .By its very definition, Υ is pro-definable, and we have seen above that it is contained in the strict ind-definable set X # .It lies therefore inside a definable subset of X # , and by using once again [HL16, Lem.8.2.9] we see that Υ is iso-definable.Moreover we also have seen above that Υ → Σ n has finite fibers, thus using [HL16, Cor.2.8.4] or the fact that for any tuple a of elements of Γ the algebraic and definable closures of a over k coincide ([HHM06, Lem.3.4.12]),one deduces that the definable set Υ is Γ-internal since Σ n is.
It remains to show that it is purely n-dimensional.Since Υ is contained in X # , and lies over the quasi-finite locus V of φ, it is contained in U for any Zariski-open subset U of V meeting all n-dimensional components of V ; this holds in particular for U the flat locus of φ| V .The flatness of the map U → G n m implies that U → G n m is open by [HL16, Cor.9.7.2],so the finite-to-one map Υ → Σ n is open.As a consequence, Υ is purely n-dimensional.□ Our purpose is now to prove that conversely, every Γ-internal subset of X # gen is contained in some finite union j φ −1 j (Σ n ) as above (Theorem 4.4); this is an instance J.É.P. -M., 2024, tome 11 of the general principle according to which Γ-internal subsets of X # are expected to be reasonable (while general Γ-internal subsets of X can likely be rather pathological).
Originally we used this result through Corollary 4.5 for proving Theorem 7.2, but we finally do not need it anymore.Nonetheless, we have chosen to keep it in this paper, because it seems to us of independent interest, and shows that the main objects considered in this work are more tractable than one could think at first sight.We start with a result which will be used for proving our theorem but is of independent interest; this is the analogue of [Duc12, Th.
m be a morphism, and set Υ = f −1 (Σ n ).Then Υ is exactly the set of points of X at which the tropical dimension of f is equal to n.
for any non-zero polynomial a I T I with coefficients in K. Now let x ∈ X ∖ Υ.Then f 1 , . . ., f n is not an Abhyankar basis at x. Therefore there exists a polynomial a I T I with coefficients in K such that Let V be the subset of X defined by the inequality It is a definable subset of X, and its stable completion is an open neighborhood of x in X. Moreover by the very definition of V , for every y ∈ V there exists two distinct multi-indices I and J with val(a I ) + val(f I (y)) = val(a J ) + val(f J (y)), which shows that val(f )(V ) is contained in a finite union of (n − 1)-dimensional subspaces of Γ n .As a consequence, the tropical dimension of f at x is at most n − 1.
gen .There is a dense open subset U of X such that f induces a finite flat map from U to a dense open subscheme of G n m ; then the induced map U → G n m is open by [HL16, Cor.9.7.2], and since x ∈ X # gen , it belongs to U ; as a consequence, f is open around x.In particular, f ( V ) contains a neighborhood Ω of f (x).Since x ∈ Υ, the image f (x) is equal to r γ for some γ ∈ Γ n .The intersection Ω ∩ Σ n then contains {r δ } δ∈B for B some product of n open intervals containing γ, so val(f )( V ) contains B, and is in particular n-dimensional.The tropical dimension of f at x is thus equal to n. □ We are now ready to establish the announced description of a Γ-internal subset Υ of X # gen .The case where Υ is purely n-dimensional will rely of the description of the maximal tropical dimension locus given by the above proposition.The general case will then be handled by embedding Υ into a purely n-dimensional Γ-internal subset of X # gen -the basic idea for doing this is to increase the dimension of Υ (until n is achieved) by "following" it along a deformation retraction as built in [HL16].

4.4.
Theorem.-Let X be an n-dimensional integral scheme of finite type over k, and let Υ ⊆ X # gen be a Γ-internal subset defined over k.There exists a dense open subset U of X and finitely many morphisms Proof.-Let us first assume that Υ is purely n-dimensional.Since k is algebraically closed, after shrinking X we might assume that there exist finitely many invertible functions f 1 , . . ., f r on X such that val(f ) induces a k-definable homeomorphism between Υ and a definable subset of Γ r (2.3).For every subset I of {1, . . ., r} of cardinality n, let f I be the map from X to G I m given by the f i with i ∈ I. Since Υ is of pure dimension n, for every x ∈ Υ there is at least one subset I of {1, . . ., r} of cardinality n such that the tropical dimension of f I at x is n.By Proposition 4.3, this means that which ends the proof in this particular case.As a by-product, we get in view of Theorem 4.2 that a finite union of purely n-dimensional Γ-internal subset of X # gen is still Γ-internal (and of course purely n-dimensional).
Let us now go back to an arbitrary Υ.In order to prove the theorem, it suffices by the above to show that Υ is contained in some purely n-dimensional Γ-internal subset of X # gen .By shrinking X we can assume that it is quasi-projective.We have already noticed that a finite union of purely n-dimensional Γ-internal subset of X # gen is still Γ-internal and purely n-dimensional, which allows ourselves to cut Υ into finitely many k-definable pieces and to argue piecewise.We thus can assume that Υ is purely d-dimensional for some d, and we argue by descending induction on d, so we assume that our statement holds if the Γ-internal subset involved is equidimensional of dimension > d.
Let α be a k-definable embedding from Υ into some Γ m given by finitely many nonzero rational functions.By [HL16, Th. 11.1.1],there exists a pro-definable deformation retraction h : I × X → X preserving α with a Γ-internal purely n-dimensional image Υ targ contained in X # .Let Υ s = {p ∈ Υ : h(t, p) = p for any t}.By its very definition, Υ s is contained in the set Υ ′ of Zariski-dense points of Υ targ , which is a purely n-dimensional Γ-internal subset of X # gen .It therefore suffices to prove the proposition for the open complement of Υ s in Υ, which is still purely d-dimensional.In other words, we can assume that Υ s = ∅.

J.É.P. -M., 2024, tome 11
Let Υ ′′ = h(I, Υ).We claim that it is iso-definable, and thus Γ-internal.By [HL16, Lem.2.2.8],Υ ′′ is strict pro-definable.Since Υ ⊆ X # , the set Υ ′′ is contained in X # as well by [HL16, Th. 11.1.1]and the latter is strict ind-definable.Hence by compactness, we see that h(I, Υ) is a strict pro-definable subset of a definable set, thus is iso-definable.Note also that the homotopy built in [HL16] is Zariski-generalizing, so Υ ′′ ⊆ X # gen .Since Υ s = ∅, for every p ∈ Υ there are some a p , b p in I with a p < b p such that h| [ap,bp] : [a p , b p ] → X is injective.Since Υ ′′ is Γ-internal, the induced function h : I × Υ → Υ ′′ is a definable function in the o-minimal sense.Let x = h(p, t) be a point of Υ ′′ , with t and p defined over k.We claim that dim p Υ ′′ = d + 1.Indeed, since dim p Υ = d, there exists a point q in U that specializes to p (when viewed as a type over k) and such that α(q) is d-dimensional over k (i.e., its coordinates generate a group of rational rank d over Γ(k)).Now up to replacing t if necessary by an endpoint of an interval containing t on which h(p, •) is constant, we may assume that there exists a non-singleton segment J ⊆ I having t as one of its endpoints such that h(p, •)| J is injective.If K is some subinterval of J containing t defined over k(q) and on which h(q, •) is constant then since h is continuous and thus is compatible with specialization, both endpoints of K have to specialize to t.Thus there exists a non-singleton segment K contained in J and defined over k(q), having one endpoint τ that specializes to t, on which h(q, •) is injective.Now let us choose an element τ ′ of K that specializes to t and such that k(τ ′ ) is of dimension 1 over k(q).By construction h(q, τ ′ ) is a point of Υ ′′ that specializes to h(p, t) and that is (d + 1)-dimensional over k, whence our claim.
It follows that Υ ′′ is of pure dimension d + 1, and it contains Υ.By induction, Υ ′′ is contained in some purely n-dimensional Γ-internal subset of X # gen , and we are done. □ This theorem has an interesting consequence concerning the closure Υ of Υ, or at least its subset Υ gen consisting of Zariski-generic points (let us mention that the general structure of the closure of an arbitrary Γ-internal subset is poorly understood).

4.5.
Corollary.-Let X be an n-dimensional integral scheme of finite type over k, and let Υ ⊆ X # gen be a Γ-internal subset.The set Υ gen is contained in X # and is Γ-internal.

A first finiteness result
The aim in this section is to prove a finiteness result, Theorem 5.6, which is weaker than our main theorem but will be needed in its proof.

5.1.
Notation.-Throughout this section we fix a valued field k, an n-dimensional integral k-scheme of finite type X, and a Γ-internal subset Υ of X # gen .Every non-zero k-rational function f ∈ k(X) gives rise to a k-definable map val(f ) : Υ → Γ.The set of all such maps is denoted by S k (Υ), or simply by S(Υ) if the ground field k is clearly understood from the context.Elements of S(Υ) will be called regular functions from Υ to Γ.By a constant function on Υ we shall always mean a k-definable constant function; i.e., an element of val(k) ⊗ Q.
Assume that val(k) is divisible, in which case S(Υ) contains the constant functions.We shall then say for short that S(Υ) is finitely (w, +)-generated up to constant functions if there exist a finite subset E of S(Υ) such that S(Υ) is (w, +) -generated by E and the constant functions.

5.2.
Remark.-For a subset E of S(Υ) to w-generate S(Υ), it suffices by compactness that for every p ∈ Γ and every f ∈ S(Υ) there exists g ∈ E such that f (p) = g(p).
Our purpose is now to show that if val(k) is divisible and k is defectless, S(Υ) is finitely (w, +)-generated up to constant functions.(Recall that a valued field F is called defectless or stable if every finite extension of F is defectless; to avoid any risk of confusion with the model-theoretic notion of stability use the terminology defectless instead of stable.)The core of the proof is the following proposition about valued field extensions.
Then there exists a quantifier-free formula φ(x, y) in the language of valued fields with parameters in F such that L |= φ(a, b), and such that whenever L ′ = F (a ′ , b ′ ) is a valued field extension with L ′ |= φ(a ′ , b ′ ) and the residue field of K ′ := F (a ′ ) is a regular extension of res(F ), then val(L ′ ) = val(K ′ ).
Proof.-Since F is defectless, K is defectless as well (this was proved by Kuhlmann in [Kuh10], but for the reader's convenience we give a new proof of this fact in the appendix with model-theoretic tools based upon [HL16], see Theorem A.1).Therefore, L h is a defectless finite extension of K h ; let d denote its degree.By assumption one has val(L h ) = val(K h ), so that res(L h ) is of degree d over res (F h ).In other words, res(L) is of degree d over res(K).Now let c 1 , . . ., c r be elements of res(L) that generate it over res(F ); for every i, let P i be a polynomial in i variables with coefficients in res (F ) Choose a lift Q i of P i monic in T with coefficients in the ring of integers of F , and Now L h is a compositum of L and K h , so it is generated by b over K h .Hence there exists a sub-tuple β of b of size d such that b is contained in the K h -vector J.É.P. -M., 2024, tome 11 space generated by β.As K h is the definable closure of K, the latter property can be rephrased as Ψ(a, b) for some quantifier-free formula Ψ in the language of valued fields, with parameters in F .Now let L ′ := F (a ′ , b ′ ) be a valued extension of F , and set K ′ = F (a ′ ).Assume that res(K ′ ) is a regular extension of res (F ), and that ensures that res(L ′ ) contains a field isomorphic to res(F )(c 1 , . . ., c r ) = res(L).Since res(K ′ ) is regular over res(K) = res(F ), the residue field res(L ′ ) contains a field isomorphic to res(L) ⊗ res(F ) res(K ′ ), which is of degree d over res(K ′ ).As a consequence, 4. Generic types of closed balls.-In practice, the above proposition will be applied for a realizing the generic type of a ball over F .Let us collect here some basic facts about such types.If γ is an element of Γ, we denote by r γ the type of the closed ball of (valuative) radius γ, which belongs to A 1 and even to A 1 # .More generally if γ = (γ 1 , . . ., γ n ) we shall denote by r γ the type r γ1 ⊗ • • • ⊗ r γn , which is the generic type of the n-dimensional ball of polyradius (γ 1 , . . ., γ n ) and belongs to A n# .Now let F be a valued field, let K be a valued extension of F and let a 1 , . . ., a r , a r+1 , . . ., a n be elements of K × .Assume the following: Proof.-Let us start with (1).Let Φ be an automorphism of the monster model fixing F (b) pointwise.One has to show that Φ fixes γ, or p -this amounts to the same.Set δ = Φ(γ) and q = Φ(p).Let A be a Φ-invariant subset of Γ containing γ. Since p is orthogonal to Γ, the restriction p| F (γ) implies a complete type r over F (A), which coincides necessarily with the type of b over F (A). Thus p contains the type of b over F (A), and so does Φ(p) since both b and A are Φ-invariant.So p and Φ(p) are two global generically stable F (A)-definable types that coincide over F (A); it follows that they are equal, cf.[Sim15,Prop. 2.35].Now we prove (2).By replacing γ by a suitable subtuple if necessary, we may and do assume that γ = (γ 1 , . . ., γ n ) where the γ i are Z-linearly independent over val (F ) -Let F be a defectless valued field with divisible value group.Let X be an n-dimensional integral F -scheme of finite type, and let Υ be a Γ-internal subset of X # gen ⊆ X.Then S(Υ) is finitely (w, +)-generated up to constant functions.
Proof.-We shall prove the following: for every p ∈ Υ, there exists a F -definable subset W of Υ containing p and finitely many functions a 1 , . . ., a n in F (X) × such that for every x ∈ W and every f ∈ S(Υ), the element val(f (x)) of Γ belongs to the group generated by val(F ) and the val(a i (x)).This will allow us to conclude.Indeed, assume that this statement has been proved.Then by compactness there is a finite cover W of Υ with finitely many sets W as above.Hence S(Υ) is (w, +)-generated by the a i up to constant functions.Let p ∈ Υ.This is a strongly stably dominated global type.Let γ ∈ Γ r be a canonical parameter of definition of p and let b be a realization of p over F (γ).By Lemma 5.5, γ is definable over F (b) and F (b) is Abhyankar over F .As γ is definable over F (b) and as it is defined only up to inter-definability, we can assume that γ = (γ 1 , . . ., γ r ) where the γ i are Z-linearly independent over val(F ), and where each γ i is equal to val(a i ) for some a i ∈ F (b). Since p is stably dominated every element of val(F (b)) belongs to the Q-vector space generated by val(F ) and the γ i .Moreover the group val(F (b)) is finitely generated over val(F ) because F (b) is Abhyankar over F and as val(F ) is divisible, val(F (b)) is torsion-free modulo val(F ); as a consequence, val(F (b))/val(F ) is free of finite rank.We can thus even assume that (γ 1 , . . ., γ r ) is a Z-basis of val(F (b))/val (F ).The valued field F (b) being Abhyankar over F , the family (a 1 , . . ., a r ) can be completed into an Abhyankar basis (a 1 , . . ., a r , a r+1 , . . ., a n ) of F (b) over F such that val(a i ) = 0 for every i ⩾ r + 1 and the residue classes of a r+1 , . . ., a n are algebraically independent over the residue field of F .The field F (b) is then algebraic over F (a 1 , . . ., a n ).We set a = (a 1 , . . ., a n ) and we now denote by γ the n-uple (γ 1 , . . ., γ n ) with γ i = 0 if i ⩾ r + 1, so that γ i = val(a i ) for all i.

J.É.P. -M., 2024, tome 11
Since p is Zariski-generic, a = (a 1 , . . ., a n ) can be interpreted as an n-uple of rational functions on X, giving rise to a map π from a dense open subset of X to A n F .In particular, π induces a map (which we still denote by π) from Υ to A n F , and the fact that a 1 , . . ., a n is an Abhyankar basis of F (b) means that π(p)| F (γ) = r γ | F (γ) ; as both π(p) and r γ are generically stable types defined over F (γ), it follows that π(p) = r γ .
Moreover, the tower F (a r+1 , . . ., a n ) ⊆ F (a) ⊆ F (a, b) fulfills the conditions of Proposition 5.3; hence the latter provides a formula φ(y, x 1 , . . ., x r ) with coefficients in F (a r+1 , . . ., a n ), which we can see as the evaluation at (a r+1 , . . ., a n ) of a formula ψ(y, x 1 , . . ., x n ).Now let W be the subset of Υ defined as the set of types q satisfying the following conditions, with δ i := val(a i (q)): Then W is an F -definable subset of Υ -as far as condition (a) is concerned this is by [HL16, Lem.8.2.9], and it contains p.Now let q be a point of W . Set b ′ = b(q) and a ′ = a(q), and γ ′ i = val(a ′ i ) for all i.Conditions (a) and (b) ensure that F (a ′ ) has a residue field which is regular over res(F (a ′ r+1 , . . ., a ′ n )).Indeed, up to applying an invertible monomial transformation to (a ′ 1 , . . ., a ′ r ) and renormalizing, we can assume that there is some s such that val(a ′ 1 ), . . ., val(a ′ s ) are free modulo val (F ) and that val(a ′ t ) = 0 for s + 1 ⩽ t ⩽ r, in which case the result is obvious since the residue field we consider is then purely transcendental of degree r − s over that of F (a ′ r+1 , . . ., a ′ n ).Using the fact that F (a ′ r+1 , . . ., a ′ n ) ≃ F (a r+1 , . . ., a n ) as valued extensions of F (with a ′ i corresponding to a i ) and the definition of ψ, we see that val(F (b ′ , a ′ )) = val(F (a ′ )).In other words, the value group of q is generated by the a i (q) and val (F ), which ends the proof.□ Our purpose is now to show how the results of section 5 extend quite straightforwardly, at least on affine charts, when Υ is not assumed to consist only of Zariskigeneric points.

5.7.
A more general setting.-We still denote by k a defectless valued field with divisible value group.Let X be an affine k-scheme of finite type, and let Υ be a Γ-internal subset of X # ⊆ X.Let X 1 , . . ., X m be the irreducible Zariski-closed subsets of X whose generic point supports an element of Υ (it follows from [HL16, Cor.10.4.6] and finiteness of the Zariski topology of Γ w ∞ that there is only a finite number of such irreducible subsets); for each i, set By construction, Υ = Υ i and for all i, Υ i consists only in Zariskigeneric points in in X ′ i .We denote by S(Υ) the set of k-definable functions of the form val(f ) with f a regular function on X (and not merely a rational function as above).

5.8.
Proposition.-There exists a finite set E of regular functions on X such that for every f ∈ S(Υ), there exists a finite covering (D a ) a of Υ by closed definable subsets and, for each a, an element λ of k, a finite family (e 1 , . . ., e ℓ ) of elements of E, and a finite family (ε 1 , . . ., ε ℓ ) of elements of {−1, 1} such that: Proof.
-For all i, we can apply Theorem 5.6 to the integral scheme X ′ i and the Γ-internal set Υ i ; let E i be the finite set of rational functions on X ′ i provided by this theorem.Write E i = {g ij /h ij } j where g ij and h ij are non-zero regular functions on the integral affine scheme X i .For all (i, j), let g ′ ij and h ′ ij denote lifts of g ij and h ij to the ring O X (X).We then might take for E the set of all g ′ ij and h ′ ij .□

Specializations and Lipschitz embeddings
As before, Υ is a Γ-internal subset of X # gen for X a separated integral scheme of finite type over a valued field K.The goal of this section is to show the existence of regular embeddings of Υ in some Γ n such that S(Υ) becomes exactly the set of Lipschitz definable functions under certain assumptions.We begin with some definitions.
We will now recall some basic facts about ACV 2 F and specializations, that will provide an important criterion for the existence of good embeddings.6.3.ACV 2 F-specializations.-We consider a triple (K 2 , K 1 , K 0 ) of fields with surjective places r ij : K i → K j for i > j, with r 20 = r 10 • r 21 , such structures are also called V 2 F. The places r 21 and r 20 give rise to two valuations on K 2 , which we denote by val 21 and val 20 respectively.We denote by Γ ij and RES ij the corresponding value groups and residue fields.We consider (K 2 , K 1 , K 0 ) as a substructure of a model of the theory ACV 2 F introduced in [HL16, Ch. 9.3].We will use K 210 to denote the structure (K 2 , K 1 , K 0 ).It is clearly an expansion of (K 2 , val 21 ) via an expansion of the residue field and an expansion of (K 2 , val 20 ) by a convex subgroup in the value group.We will focus on the latter expansion.
Let X be an affine integral scheme of finite type over K 2 , we will use X 20 when we view X as a definable set in an ambient model of ACVF extending (K 2 , val 20 ) and X 21 is defined analogously.There is a natural map s : X # 20 → X # 21 which can be described as follows.Let p ∈ X # 20 .By [HL16, Lem.9.3.8],we have that p generates a complete type p 210 in ACV 2 F. Furthermore, by [HL16, Lem.9.3.10],p 210 as an ACV 2 F-type is stably dominated.Let dim(p) denote the dimension of the Zariski closure of p.Let L |= ACV 2 F extending K 210 and c |= p|L.Since p corresponds to an Abhyankar point in the space of valuations, we see that the residual transcendence degree of tp 21 (c/L) is still dim(p), so tp 21 (c/L) extends to a type s(p) in X # 21 .(Note that here we work in the restricted language where the only valuation is val 21 .) 20 be an ACV 2 F K210 -definable set, then s| Y is a definable function.
Proof.-By the way s is defined, it is a pro-definable function by considering the φdefinitions.Note that a pro-definable function between two definable sets is definable by compactness.□ We need one last lemma before stating our criterion with respect to specializations. Proof.
-By the classification of imaginaries in ACVF [HHM06, Th. 1.01], if Y is not Γ-internal in K 21 , there is an ACVF K21 -definable map (possibly after expanding the language by some constants) that is generically surjective onto the residue field.
By assumption, Y is Γ 20 -internal as an ACV 2 F K210 set.This yields a generically surjective map Γ 20 → RES 21 .Composing with the dominant place RES 21 → RES 20 , we obtain an ACV 2 F-definable map Γ 20 → RES 20 that is generically surjective.By [HL16, Lem.9.3.1(4)],one checks immediately that the two sorts Γ 20 and RES 20 are orthogonal in ACV 2 F, hence a contradiction.□ 6.6.Specializable maps and Lipschitz condition.-Now we introduce the notion of specializations of maps.Let (K, v) be a valued field, we denote by ρ(K) the set of convex subgroups of Γ(K).Clearly, if K is of transcendence degree m over the prime field, then |ρ(K)| ⩽ m + 1.For each ∆ ∈ ρ(K), we have a valuation val 21 : K → Γ(K)/∆ given by quotienting out by ∆, which gives rise to a V 2 F structure we shall denote by K[∆].Each choice of ∆ specifies an expansion of ACVF K to ACV 2 F K by interpreting the convex subgroup to be the convex hull of ∆.Moreover, by varying ∆ one exhausts all the possible expansions of ACVF K to ACV 2 F K .Let X be an integral separated scheme of finite type over K as before.We write X ∆ to denote X as a definable set in ACVF K[∆] .We use s ∆ to denote the map s defined in Section 6.3 when we expand Similarly, if α : Υ → Γ n is some regular embedding, we use α ∆ : Υ ∆ → Γ n 21 to denote the corresponding map.6.7.Definition.-Let α : Υ → Γ n be a regular embedding and let K be a field over which α is defined.We say α is specializable if for every convex subgroup ∆ of Γ(K) the map α ∆ is still an embedding.
6.8.Remark.-Note that the specializability of α does not depend on the choice of K. Namely, let L ⊇ K be an extension of valued fields, it suffices to show that if α is specializable with respect to K, it is so with respect to L. Let ∆ L be a convex subgroup of Γ(L).Note that this gives a convex subgroup ∆ K of Γ(K) by taking intersection.Note that whether α ∆ L is an embedding only depends on ACVF L[∆ L ] , which is an expansion of ACVF K[∆ K ] .Hence the specializability of α over K guarantees that α ∆ L is an embedding.6.9.Remark.-If α : Υ → Γ n is a specializable regular embedding and β : Υ → Γ m is any regular map, the regular embedding (α, β) : Υ → Γ n+m is specializable as well.
6.10.Remark.-Assume α : Υ → Γ n is specializable and defined over K, and Υ ′ ⊆ Υ is definable but not necessarily over K.If α is specializable, so is α| Υ ′ .This follows from a similar argument as in Remark 6.8.More precisely, let L ⊇ K be such that Υ ′ is defined over L, any expansion of ACVF L to ACV 2 F L by some ∆ ′ gives an expansion of ACVF K to ACV 2 F K by some ∆.As α is specializable, α ∆ is an embedding for any ∆, thus α| Υ ′ is specializable.6.11.Theorem.-Let X be an affine integral scheme of finite type over a valued field K and let Υ ⊆ X # be a Γ-internal subset.Let F be a finitely generated field over which all the above is defined.Then there exists a F alg -definable integral regular embedding of Υ into Γ n that is specializable.
Proof.-For each ∆ ∈ ρ(F ), by Lemma 6.5, we have that J.É.P. -M., 2024, tome 11 Consider X as embedded in some affine space.By [HL16, Cor.6.2.5], for each ∆, there are finitely many polynomial functions h ∆ i such that Moreover the h ∆ i 's can be found to be defined over F alg by the proof of [HL16, Cor.6.2.5] (or more precisely, [HL16, Lem.6.2.2]).Since there are only finitely many such ∆'s to consider, putting them as the coordinates, we get some specializable embedding as desired, which can be made integral by concatenation with an arbitrary integral regular embedding, whose existence follows from Lemma 6.2.□ 6.12.Remark.-In the situation of interest for classical non-archimedean geometry, the ground field K will be algebraically closed and equipped with a valuation whose group embeds into R and has therefore no non-trivial proper convex subgroup.The reasoning above then shows that any K-definable regular embedding from Υ into Γ s is specializable.
6.13.Proposition.-Let X be an affine integral scheme of finite type over a valued field K and let Υ ⊆ X # be a Γ-internal subset.If α : Υ → Γ n is a specializable embedding, then the image of S(Υ) is contained in the group of Lipschitz functions.
In other words, all the log-rational functions are Lipschitz and α is Lipschitz.
Proof.-We let W = α(Υ) and use p w to denote α −1 (w) for w ∈ W . Assume there is some f ∈ K(X) such that w → p w (f ) is not Lipschitz.Going to an elementary extension, we may assume there is for all n ∈ N. Take C to be the convex subgroup generated by |w 1 −w 2 |.Consider L to be the same field with the valuation given by quotienting out by C. By our assumption on specializability, we have that α L is an embedding.However, we have w 1 = w 2 , while p w1 (f ) = p w1 (f ) + C ̸ = p w2 (f ) + C = p w2 (f ), a contradiction.□ 6.14.Corollary.-Let X be an affine integral scheme of finite type over an algebraically closed valued field K and let Υ ⊆ X # be a Γ-internal set.Then there exists a good embedding Υ → Γ n .
Proof.-The embedding provided by Theorem 6.11 is K-definable, and it is good in view of Proposition 6.13.□

The main theorem
In this section, we prove the theorem stated in Section 1.3 and we transfer it into the Berkovich setting.
7.1.Lemma.-Let k be a valued field with infinite residue field, let X be a geometrically integral k-scheme and let Υ ⊆ X # gen be a k-definable Γ-internal subset defined over k.The group S(Υ) is stable under min and max.
Proof.-It is enough to prove stability under min.Let p be a point of Υ.If there exists a scalar a of valuation zero such that val(f (p) + ag(p)) > min(val(f )(p), val(g(p))) then res(a) is a well-defined element of the residue field which we call θ(p); otherwise we set (say) θ(p) = 0. Then θ is a k-definable map from the Γ-internal set Υ to the residue field.By orthogonality between the value group and the residue sorts, θ has finite image.Since k has infinite residue field, there exists an element a ∈ O × k whose residue class does not belong to the image of θ.Then f + ag ̸ = 0 and val(f (p) + ag(p)) = min(val(f (p)), val(g(p))) for all p ∈ Υ. □ In the situation of the lemma above, it thus makes sense to speak about an (ℓ, +)generating system of elements of S(Υ).As for (w, +)-generation, we shall say for short that S(Υ) is finitely (ℓ, +)-generated up to the constant functions if there exists a finite subset E of S(Υ) such that E and the k-definable constant functions (i.e., the constant functions taking values in Q ⊗ val(k × )) (ℓ, +)-generate S(Υ).

7.2.
Theorem.-Let k be an algebraically closed valued field.Let X be an integral scheme of finite type over k and let Υ ⊆ X # gen be a Γ-internal subset defined over k.The group S(Υ) is stable under min and max and is finitely (ℓ, +)-generated up to constant functions.
Proof.-By Theorem 6.11, there is a k-definable good embedding α : Υ → Γ n for some n.By Theorem 5.6, S(Υ) is (w, +)-finitely generated up to constant functions.Let f 1 , . . ., f m be finitely many k-rational functions whose valuations (w, +)-generate S(Υ) up to constant functions, adjoining the val(f i ) as new coordinates of α, we may furthermore assume that S(Υ) is (w, +)-generated by the components of α and the constant functions.By possibly enlarging once again α and replacing X with a suitable dense Zariski-open subset we can also assume that α = val(f ) for some closed immersion f : X → G n m ; in particular, α is definably proper and induces a definable homeomorphism Υ ≃ α(Υ).
Let f in S(Υ).Since α is a specializable embedding whose coordinates (w, +)generate S(Υ) up to the constant functions, the composition f • α −1 viewed as a Γ-valued function on α(Υ) is piecewise Z-affine and Lipschitz.In view of Theorem 3.13, this implies that f • α −1 is an ℓ-combination of finitely many Z-affine functions, so that f itself is an (ℓ, +)-combination of the components of α and of constant functions.□ 7.3.Remark.-Assume that k is algebraically closed and let (f 1 , . . ., f n ) be a family of rational functions on X such that S(Υ) is (w, +)-generated (resp.(ℓ, +)-generated) by the val(f i ) and the constant (k-definable) functions.Then for every algebraically closed extension L of k, the val(f i ) and the L-definable constant functions (w, +)generate (resp.(ℓ, +)-generate) S L (Υ) (work with a bounded family of rational functions and use compactness).
Our purpose is now to state and prove the Berkovich avatar of our main theorem.We fix a non-archimedean complete field F .For all n, we denote by S F,n the closed subset {η r } r∈(R × + ) n of G n,an m,F , where η r is the semi-norm a I T → max|a I |r I .In [Duc12,4.6],a general notion of a skeleton is defined for an F -analytic space; the subset S n,F of G n,an m,F is the archetypal example of such an object.But this notion is however slightly too analytic for our purposes here: indeed, if X is an algebraic variety over F then X an might have plenty of skeleta in the sense of [Duc12] that cannot be handled by our methods, since they would not correspond to any Γ-internal subset of X, by lack of algebraic definability.For instance, assume that F is algebraically closed and non-trivially valued, and let f be any non-zero analytic function of A 1,an F with countably many zeroes.Let U be the non-vanishing locus of f , and let Σ be the preimage of S 1,F under f : U → G m .Then Σ is a skeleton in the sense of [Duc12], but topologically this is only a locally finite graph, with countably many branch points.We thus shall need to focus on "algebraic" skeleta.

7.4.
Theorem.-Let us assume that F is algebraically closed.Let X be an integral F -scheme of finite type, and let n be its dimension.Let φ 1 , . . ., φ r be maps where the U i are dense open subsets of X, and let S ⊆ X an be a subset of i φ −1 i (S n ) defined by a Boolean combination of norm inequalities between non-zero rational functions.
There exist finitely many non-zero rational functions f 1 , . . ., f m on X such that the following hold.
(1) The functions log|f 1 |, . . ., log|f m | identify S with a piecewise-linear subset of R m (i.e., a subset defined by a Boolean combination of inequalities between Q-affine functions).
(2) The group of real-valued functions on S of the form log|g| for g a non-zero rational function on X is stable under min and max and is (ℓ, +)-generated by the log|f i | and the constant functions of the form log|λ| with λ ∈ F × .
Proof.-The subset Σ of X given by the same definition as S mutatis mutandis is a Γ-internal set contained in X # gen to which we can thus apply Theorem 7.2.The theorem above then follows by noticing that if L denotes a non-archimedean maximally complete extension of F with value group the whole of R × + , then S is naturally homeomorphic to Σ(L).□ 7.5.Remark.-Note that by Theorem 4.4 the condition that S is a subset of some i φ −1 i (S n ) holds as soon as S is the image of Υ(L) under the projection X(L) → X an with Υ some F -definable Γ-internal subset of X # gen and L as in the above proof.
7.6.Remark.-We insist that we require that the ground field be algebraically closed.Indeed, our theorems (for stable completions as well as for Berkovich spaces) definitely do not hold over an arbitrary non-Archimedean field, even in a weaker version with (w, +)-generation instead of (ℓ, +)-generation, as witnessed by a counter-example that was communicated to the authors by Michael Temkin (this counterexample involves a field with defect, we do not know if our theorem holds for defectless fields with divisible value group as in Theorem 5.6).
For the reader's convenience we will first detail the original counter-example which is written in the Berkovich's language, and then a model-theoretic variant thereof in the Hrushovski-Loeser's language.7.6.1.The Berkovich version.-Let F be a non-archimedean field and let F be the completion of an algebraic closure of F ; assume that the residue field of F is of positive characteristic p and that F admits an immediate extension L of degree p, say L := F (α) with α ∈ F. By general valuation theory, the distance r between α and F is not achieved.
For every s ⩾ r let ξ s be the image on P 1,an F of the Shilov point of the closed F-disc with center α and radius s.If s > r there exists β s in F with |α − β s | ⩽ s, and ξ s is the Shilov point of the closed F -disc with center β s and radius s; but as far as ξ r is concerned, it is the Shilov point of an affinoid domain V of P 1,an F without rational point.
Let v be a rigid point of V .It corresponds to an element ω of F algebraic over F and whose distance to F is equal to r and not achieved.Therefore the extension F (ω) has defect over F , which forces its degree to be divisible by p.In other words, [H (v) : F ] is divisible by p.
In particular if f is any non-zero element of F (T ), the divisor of f | V has degree divisible by p, so that there exists some s > r such that the slope of log|f | on (ξ r , ξ s ) is divisible by p. Now assume that there exists a finite set E of non-zero rational functions such that on the skeleton [ξ r , ∞), every function of the form log|g| with g in F (T ) × belongs piecewise to the group generated by the log|h| for h ∈ E ∪ F × .Then there would exist some s > r such that for every g as above, all slopes of (log|g|)| [ξr,ξs] are divisible by p. Taking g = T − β s leads to a contradiction.7.6.2.The model-theoretic version.-Let F be a perfect valued field of positive residue characteristic p such that there exists an irreducible separable polynomial P ∈ F [T ] with the following property: the smallest closed ball containing all roots of P has no F -rational points, but any bigger F -definable closed ball has one F -point (it is not difficult to exhibit such pairs (F, P ); the easiest case is that of pure characteristic p, where one can take any perfect field F with an height 1 valuation having an element s with val(s) < 0 such that T p − T − s has no root in F , and take P =: T p − T − s; for instance, the perfect closure of F p (s) equipped with the (1/s)-adic valuation will do the job).
Let b be the smallest closed ball containing the roots of P , and let B be a bigger F -definable closed ball.Let I be the interval between their generic points; this is a Γ-internal subset of P 1 contained in P 1,# gen .This interval is naturally parameterized by the interval [V, v] where V is the valuative radius of B and v is that of b, and we will identify them.In particular a linear function from I to Γ has a well-defined J.É.P. -M., 2024, tome 11 slope.We will be interested in the germ of functions on I towards the endpoint v.The number of roots in b of every irreducible polynomial of F [T ] is divisible by p, for otherwise averaging the roots would produce an F -rational point in b.Hence the valuation of every polynomial, and indeed every rational function in F (T ), has slope divisible by p on some interval (i, v) inside I.If the group of functions val(f )|I were finitely (w, +)-generated up to constants, there would be a fixed i < v (defined over F ) such that all val-rational functions have slope divisible by p on [i, v].Now pick an F -rational point a in the closed ball containing b of valuative radius (i + v)/2; then T − a has slope one on (i, (i + v)/2), contradiction.

Applications to (motivic) volumes of skeleta
It follows from Theorem 5.6 on finite (w, +)-generation that skeleta are endowed with a canonical piecewise Z-affine structure.In this section we explain how this implies the existence of canonical volumes for skeleta.
8.1.Some Grothendieck semirings of Γ. -We shall consider various Grothendieck semirings of Γ analogous to those introduced in [HK06, §9] (see also [HK08] for a detailed study of the rich structure of such semirings).Let Γ be a non-trivial divisible ordered abelian group and let A be a fixed subgroup of Γ.We work in the theory DOAG A of (non-trivial) divisible ordered Abelian groups with distinguished constants for elements of the subgroup A. Fix a non negative integer N .One defines a category Γ(N ) as follows (since there is no risk of confusion we omit the A from the notation).An object of Γ(N ) is a finite disjoint union of subsets of Γ N defined by linear equalities and inequalities with Z-coefficients and constants in A. A morphism f between two objects X and Y of Γ(N ) is a bijection such that there exists a finite partition X = 1⩽i⩽r X i with X i in Γ(N ), matrices M i ∈ GL N (Z) and constants a i ∈ A N , such that for x ∈ X i , f (x) = M i x + a i .We denote by K + (Γ(N )) the Grothendieck semigroup of this category, that is the free abelian semigroup generated by isomorphism classes of objects of Γ(N ) modulo the cut and paste relation The inclusion map Γ N → Γ N +1 given by x → (x, 0) induces an inclusion functor Γ(N ) → Γ(N + 1) and we denote by Γ(∞) the colimit of the categories Γ(N ).We may identify the Grothendieck semigroup K + (Γ(∞)) of Γ(∞) with the colimit of the semigroups K + (Γ(N )).It is endowed with a natural structure of a semiring.We may also consider the full subcategory Γ bdd (N ) of Γ(N ) consisting of bounded sets, that is definable subsets of [−γ, γ] N for some non negative γ ∈ Γ (which can be chosen in A), and the corresponding full subcategory Γ bdd (∞) of Γ(∞) and its Grothendieck semiring.The above categories admit natural filtrations F • by dimension, with F n the subcategory generated by objects of o-minimal dimension ⩽ n and we will also consider the induced filtration on Grothendieck rings.

8.2.
Volumes.-Let R be a real closed field.Fix integers 0 ⩽ n ⩽ N .Let W be a bounded piecewise Z-linear definable subset of R N of o-minimal dimension n.We denote by vol n (W ) its n-dimensional volume which can be defined in the following way.After decomposing into simplices, it is enough to define the volume of a simplex spanned by n + 1-points, which one can do via the classical formula over R, choosing the normalization such that, for any family (e 1 , . . ., e n ) of n vectors in R N with integer coordinates which can be completed to a basis of the abelian group Z N , the volume of the simplex with vertices the origin and the endpoints of e 1 , . . ., e n is 1/n!.When R = R, vol n is well-defined thanks to the existence of the Lebesgue measure.In general, the well-definedness of vol n follows from the case of R since after increasing R one can assume it is an an elementary extension of R.
Thus, for any embedding β : A → R with R a real closed field and any integer n, vol n induces a morphism vol n,β : 8.3.Motivic volumes of skeleta.-Let us assume that we are in the setting of Theorem 5.6, that is, k is a defectless valued field with divisible value group, X is an n-dimensional integral k-scheme of finite type and Υ is a Γ-internal subset of X # gen ⊆ X.Then, by Theorem 5.6, S(Υ) is finitely (w, +)-generated up to constant functions.Let α : Υ → Γ N be a definable embedding of the form (val(f 1 ), where the functions val(f i ) are (w, +)-generating S(Υ) up to constant functions.We take for A the group val(k × ).
with the functions val(f ′ i ) (w, +)-generating S(Υ) up to constant functions.After adding zeroes we may assume N = N ′ .Since the functions val(f i ) are (w, +)-generating S(Υ) up to constant functions, there exists a finite partition of Υ into definable pieces Υ j such that on each Υ j we may write (val(f ′ i )) = M j ((val(f i ))) + a j with M j a matrix with coefficients in Z and a j ∈ Γ N .Exchanging α and α ′ we get that the matrix M j lies in GL N (Z).□ Thus, to any Γ-internal subset Υ of X # gen ⊆ X, we may assign a well defined motivic volume MV(Υ) in the ring K + (Γ(∞)), namely the class of α(Υ) for any embedding α as above.
If Υ is contained in a definably compact set, α(Υ) is bounded, thus MV(Υ) lies in Fix an algebraically closed non-archimedean complete field F with value group A. Let X be an integral F -scheme of finite type and of dimension n.Let S ⊆ X an be an algebraic skeleton as in the statement of Theorem 7.4.Then one can assign similarly as J.É.P. -M., 2024, tome 11 above a well defined class MV(S) to S in in K + (R(∞)).Furthermore, if S is relatively compact, since A ⊆ R, one can consider its n-dimensional volume vol n (MV(S)) in R, or more generally its m-dimensional volume if S of dimension ⩽ m. 8.6.Remark.-Note that all the invariants defined above (motivic and actual volumes) are invariant under birational automorphisms and Galois actions.

Appendix. Abhyankar valuations are defectless: a model-theoretic proof
Let K be a field equipped with a Krull valuation v and let L be a finite extension of K. Let v 1 , . . ., v n be the valuations on L extending v, and for every i, let e i and f i be the ramification and inertia indexes of the valued field extension (K, v) → (L, v i ).One always has e i f i ⩽ [L : K], and the extension L of the valued field (K, v) is said to be defectless if equality holds.We shall say that (K, v) is defectless if every finite extension of it is defectless (such a field is also often called stable in the literature, but we think that defectless is a better terminology, if only because stable has a totally different meaning in model theory).
We shall use here the notion of the graded residue field of a valued field in the sense of Temkin, see [Tem04] (we will freely apply the basic facts about graded commutative algebra which are proved therein).A more model-theoretic approach of the latter was introduced independently by the second author and Kazhdan in [HK06] with the notation RV(•) which we have decided to adopt here.The key point making this notion relevant for the study of defect is the following obvious remark: the product e i f i can also be interpreted as the degree of the graded residue extension RV(K, v) → RV(L, v i ).
Examples.-Any algebraically closed valued field is defectless; any complete discretely valued field is defectless; the function field of an irreducible normal algebraic variety, endowed with the discrete valuation associated to an irreducible divisor, is defectless; any valued field whose residue characteristic is zero is defectless.
The purpose of this appendix is to give a new proof of the following well-known theorem.
A.1.Theorem.-Let (K, v) be a defectless valued field, and let G be an abelian ordered group containing v(K × ).Let g = (g 1 , . . ., g n ) be a finite family of elements of G. Endow K(T ) = K(T 1 , . . ., T n ) with the "Gauss extension v g of v with parameter g", i.e., v g ( a The valued field (K(T ), v g ) is still defectless.
This result has been given several proofs by Gruson, Temkin, Ohm, Kuhlmann, Teissier (see [Gru68], [Tem10], [Ohm89], [Kuh10], [Tei14]).To our knowledge, the first proof working in full generality was that of Kuhlmann, the preceding proofs J.É.P. -M., 2024, tome 11 requiring some additional assumptions on K and/or on the g i .Our proof follows a more model theoretic route, relying on the definability of the defectless locus.
Proof.-It is rather long.Before writing it down, let us describe roughly its main steps.One first reduces to the case where n = 1 by arguing inductively (and one sets T = T 1 and g = g 1 ) and then to the case where K is algebraically closed (A.1.2),which requires to understand what happens when one performs a finite ground field extension of K, and this is the point where defectlessness of K is needed.
Then one shows that if (L, w) is an algebraically closed valued extension of K whose value group contains val(K × ) + Zg, then F is defectless over (K(T ), v g ) if and only if F L is defectless over (L(T ), w g ) (A. 1.3).This ultimately relies on the description of definable maps from Γ to the space of lattices (or semi-norms) on a vector space [HL16, Lem.6.2.2], which itself rests on the work [HHM06] on imaginaries in ACVF.This enables us to assume that the valuation of K is non-trivial and g ∈ v(K × ).Now one proceeds as follows: (A) One shows (A.1.5)that there exists a K-definable subset D of Γ so that for every h ∈ v(K × ) the extension F of (K(T ), v h ) is defectless if and only if h ∈ D(K) (and this holds universally, i.e., this equivalence remains true after base change from K to an arbitrary model of ACVF); (B) One shows that D is both definably open and definably closed (A.1.6.1) and non-empty (A.1.6.2),so that D is the whole of Γ; in particular g ∈ D, which ends the proof.
Statement (A) rests on the fact that on a smooth projective curve there exists a line bundle whose quotients of non-zero global sections generate (universally) the group of invertible rational functions (this follows from the Riemann-Roch theorem); the proof uses this fact both directly and indirectly, through one of its important consequences in Hrushovski-Loeser's theory: definability (and not merely pro-definability, as in higher dimensions) of the stable completion of a curve.And statement (B) ultimately relies on defectlessness of the function field of a curve equipped with the discrete valuation associated to a closed point.
A.1.1.First easy reduction.-By a straightforward induction argument, we reduce to the case where n = 1, and we write now T instead of T 1 and g instead of g 1 .
A.1.2.Reduction to the case where K is algebraically closed.-We choose an arbitrary extension w of v to an algebraic closure K of K, and we endow the field K(T ) with the Gauss valuation w g .We assume that (K(T ), w g ) is defectless, and we want to prove that (K(T ), v g ) is defectless too; this is the step in which our defectlessness assumption on K will be used.So, let F be a finite extension of K(T ), and let us prove that it is defectless.
We begin with a general remark which we will use several times.Let K ′ be a finite extension of K.For every extension v ′ of v on K ′ there is a unique extension of v g on K ′ (T ) whose restriction to K ′ coincides with v ′ , namely the Gauss valuation v ′ g J.É.P. -M., 2024, tome 11 (indeed, for such an extension RV(T ) will be transcendental over RV(K ′ ), so this extension is necessarily a Gauss extension of v ′ ).Then it follows by a direct explicit computation that RV(K ′ (T )) = RV(K(T )) ⊗ RV(K) RV(K ′ ), (where K ′ is endowed with v ′ and K ′ (T ) with v ′ g ) which implies that K ′ (T ) is a defectless extension of K(T ).
Let us first handle the case where F is separable over K(T ).Let K ′ be the separable closure of K in F .By the remark above, K ′ (T ) is a defectless extension of K(T ), and it is therefore sufficient to prove that F is a defectless extension of K ′ (T ), thus we can assume that K ′ = K.The tensor product L := K ⊗ K F is then a field, and L is a defectless extension of K(T ) since K(T ) is defectless by assumption.Let w 1 , . . ., w d be the extensions of w to L; for every i, let L i be the valued field (L, w i ).We have by assumption Now each RV(L i ) is a finite extension of RV(K(T )), so it is defined over RV(E(T )) for E a suitable finite extension of K contained in K, which can be chosen to work for all i.Let us set By construction, E i contains a graded subfield of degree [RV(L i ) : RV(K(T ))] over RV(E(T )), so that we have and F ⊗ K E is a defectless extension of E(T ).Moreover, E(T ) is a defectless extension of K(T ) by the remark at the beginning of the proof.Therefore F ⊗ K E is a defectless extension of K(T ) as well, which in turn forces F to be defectless over K(T ).We thus are done when F is separable over K(T ).Now let us handle the general case.In order to prove that F is defectless over K(T ) we may enlarge F , and so we can assume that it is normal over K(T ).Let F 0 be the subfield of F consisting of Galois-invariant elements.This is a purely inseparable extension of K(T ), and F is separable (and even Galois) over F 0 .Since F 0 is a finite extension of K(T ), it is contained in K 0 (T 1/p m ) for some integer m and some purely inseparable finite extension K 0 of K (indeed, if f ∈ K(T ) then for every ℓ the p ℓ -th root f 1/p ℓ is contained in the radicial extension generated by T 1/p ℓ and the p ℓ -th roots of the coefficients of f ).
It is now sufficient to prove that F ⊗ F0 K 0 (T 1/p m ) (which is a field since F and K 0 (T 1/p m ) are respectively separable and purely inseparable over F 0 ) is defectless over K(T ).But F ⊗ F0 K 0 (T 1/p m ) is separable over K 0 (T 1/p m ), so it is defectless over J.É.P. -M., 2024, tome 11 K 0 (T 1/p m ) by the above; and K 0 (T 1/p m ) is defectless over K(T ) by direct computation, resting on the fact that K 0 is defectless over K, which ends this first step.
We thus may and do assume from now on that K is algebraically closed.
A.1.3.Reduction to the case of a rational radius.-Let F be a finite extension of K(T ), and let C be the normal projective K-curve with function field F , equipped with the finite map C → P 1 K inducing K(T ) → F .We want to prove that F is defectless over the valued field (K(T ), v g ) and our purpose now is to reduce to the case where g belongs to v(K × ).
Let us fix a non-trivially valued, algebraically closed extension L of K whose value group contains v(K × ) + Zg; let v L denote the valuation of L. We are going to prove that F L := F ⊗ K(T ) L(T ) is defectless over (L(T ), v L,g ) if and only if F is defectless over K(T ), which will allow to replace (K, v) with (L, v L ) and thus assume that K is non-trivially valued (in other words, K is a model of ACVF) and g ∈ v(K × ).
Let w be any extension of v L,g to F L ; in what follows, F L and its subfields are understood as endowed with (the restriction of) w.The valuation w on F L defines a type on C L over L, whose image on P 1 L is by design the generic type on the closed ball of valuative radius g (centered at the origin).This type is thus strongly stably dominated and definable over K ∪ {g}, see [HL16,Prop. 8.1.2].
Let E be a finite dimensional K-vector subspace of F .It follows from the above that the restriction of w to L ⊗ K E is a norm which is definable with parameters in K ∪ {g}, once a K-basis of E is chosen.Otherwise said, identifying a norm on E with its unit ball, there exists a K-definable function Φ from Γ to the set of lattices of E such that w| L⊗ K E = Φ(g).In view of the general description of such a Φ provided by [HL16, Lem.6.2.2], this implies the existence of a basis e 1 , . . ., e d of E over K and elements h 1 , . . ., h d of v(K × ) ⊕ Qg such that for all x ∈ L ⊗ K E. It immediately follows from (1) that the graded reduction RV(L ⊗ K E) is equal to RV(L) ⊗ RV(K) RV(E).A limit argument then shows that RV(F L ) is nothing but the graded fraction field of RV(L) ⊗ RV(K) RV (F ).As RV(L(T )) is itself equal by a direct computation to the graded fraction field of the graded domain RV(L) ⊗ RV(K) RV(K(T )), we eventually get RV(F L ) = RV(L(T )) ⊗ RV(K(T )) RV (F ).
In particular we have the equality This holds for all extensions w of v L,g to F L (we remind that w is implicitly involved in the above equality).Let P, resp.P L , be the set of extensions of v g to F , resp. of v L,g , to F L .There is a natural restriction map from P L to P, which is injective since formula (2) above ensures that any w ∈ P L is uniquely determined by its restriction to F .We claim that this map is surjective as well.Indeed, to see this, we may enlarge F and assume it is Galois over K(T ).Now let ω ∈ P and let w be an arbitrary element of P L .The restriction w| F belongs to P, so is equal to ω•φ for some φ ∈ Gal(F/K(T )).Then w • φ −1 is a preimage of ω in P L .
Therefore P L → P is bijective.In view of (3) above, this implies that F is a defectless extension of (K(T ), v g ) if and only if F L is a defectless extension of (L(T ), v L,g ), as announced.
Hence we may and do assume from now on that g ∈ v(K × ) and that K is a model of ACVF.
A.1.4.Some specializations.-Let h ∈ v(K × ).Let us choose λ ∈ K such that v(λ) = h and let τ be the image of T /λ in the residue field k of (K(T ), v h ); note that k = res(K)(τ ), and that τ is transcendental over res(K).Let h − and h + be elements of an abelian ordered group containing v(K × ) which are infinitely close to h (with respect to v(K × )), with h − < h < h + .The valuation v h − , resp.v h + is the composition of v h and of the discrete valuation u ∞ , resp.u 0 , of k that corresponds to τ = ∞, resp.τ = 0, and the extensions of v h − , resp.v h + , to F are compositions of extensions of v h and of extensions of u ∞ , resp.u 0 .Since (k, u 0 ) and (k, u ∞ ) are defectless, we see that the following are equivalent: (i) F is a defectless extension of (K(T ), v h − ); (ii) F is a defectless extension of (K(T ), v h ); (iii) F is a defectless extension of (K(T ), v h + ).
In the same spirit, let θ be an element of an abelian ordered group containing v(K × ) and larger than any element of v(K × ).The valuation v θ is the composition of the discrete valuation ω of K(T ) corresponding to the closed point T = 0 and of the valuation of K. Since both (K, v) and (K(T ), ω) are defectless, (K(T ), v θ ) is defectless; in particular, F is a defectless extension of (K(T ), v θ ).
A.1.5.Definability of the defectless locus.-Our purpose is now to prove the existence of a K-definable subset D ⊆ Γ such that for every model (L, w) of ACVF containing K and every h ∈ w(L × ), the extension F L of (L(T ), w h ) is defectless if and only if h ∈ D(L).We first note that in view of A.1.4,F L is a defectless extension of (L(T ), w h ) if and only if it is a defectless extension of (L(T ), w + h ), and it is the latter property we shall focus on.
Let X be an irreducible, smooth, projective curve over K whose function field is isomorphic to F , and such that K(T ) → F is induced by a finite map f : X → P 1 K ; the latter induces a map f : X → P 1 K .It follows from Riemann-Roch that there exists a line bundle L on X such that the quotients s/t for s and t running through the set (Γ ∖ D)(K), then h − and h + belong to (Γ ∖ D)(L).This shows that both D and its complement in Γ are definably open, hence D is both definably open and definably closed.
A.1.6.2.The set D is non-empty.-Now let (L, w) be a model of ACVF containing K such that w(L × ) contains an element θ larger that any element of v(K × ).We have seen in A.1.4 that F is a defectless extension of (K(T ), v θ ).Thus by A.1.3F L is a defectless extension of (L(T ), w θ ).Hence θ ∈ D(L) and D is non-empty. □

3. 6 .
Definition. -Let T be an o-minimal expansion of DOAG and Γ |= T with D ⊆ Γ n definable.We say that D is convex if for any u and v in D, (u + v)/2 ∈ D. 3.7.Remark.-When T is an o-minimal expansion of the theory of real closed fields RCF, this is equivalent to the usual definition of convexity for definable sets.For u, v ∈ D, let L ⊆ [0, 1] be {α : αu + (1 − α)v ∈ D}.By our notion of convexity,

3. 16 .
Lemma.-Let D be a closed bounded definable subset of Γ n .Assume D is convex.Let h be a Q-affine function on Γ n such h ⩾ 0 on D. Let D 0 be the zero locus of h in D. We assume that D 0 is non-empty and D 0 ̸ = D. Let f be a Q-affine function on Γ n which vanishes on D 0 .Then there exists a positive integer M such that, for every x ∈ D, |f (x)| ⩽ M h(x).

3. 18 .
Claim.-Let C ′ and C ′′ be any two distinct cells in D. Set D ′ = cl(C ′ ) and D ′′ = cl(C ′′ ).There exists a function f D ′ ,D ′′ in the group generated by f 1 , . . ., f n , the constant functions and the coordinate functions such that ( * ) g| D ′ ⩽ f D ′ ,D ′′ | D ′ and f D ′ ,D ′′ | D ′′ ⩽ g| D ′′ .J.É.P. -M., 2024, tome 11 using definable compactness of D ′ and D ′′ , we get that there exists a ∈ M 0 such that h| D ′′ < −a < 0 < a < h| D ′ .Moreover, by our assumption that g(D(M ))) ⊆ M 0 , there is b ∈ M 0 such that g(D(M )) ⊆ (−b, b).For any positive integer m we have mh − g > ma − b on D ′ and mh − g < −ma + b on D ′′ .Since M 0 is archimedean, for m large enough, we have ma > b, hence condition ( * ) is satisfied for

3. 19 .
Corollary.-Let D ′ and D ′′ be two definably compact convex sets such thatD ′ ∩ D ′′ = D ′ ∩ H a = D ′′ ∩ H a ̸ = ∅with H a an hyperplane defined by a Z-affine function.Assume further that g a continuous function that is affine on D ′ and D ′′ respectively, then g is Lipschitz on D ′ ∪ D ′′ .3.20.Remark.-Note that one can have definably compact versions of Example 3.5 by replacing [0, ∞) with [0, c] for some c > n • 1 for all n ∈ N.However, the function g there is not Lipschitz because |(0, c) − (1, c)| = 1 and |g(0, c) − g(1, c)| = c.

4 . 1 .
Complements about Γ-internal sets 4.Preimages of the standard Γ-internal subset of G n m .

5 . 6 .
Now choose c = (c 1 , . . ., c n ) realizing r γ over F (b). Then by stable domination, b realizes p over F (γ, c) and in particular over F (c).The type p is strongly stably dominated, and it is definable over F (c) by construction.So res(F (b)) is of transcendence degree dim X over res(F (c)), and F (b, c) is thus Abhyankar over F (c), hence over F since F (c) is Abhyankar over F .Then F (b) is Abhyankar over F .□ Theorem.
∞)) and we can consider its n-dimensional volume vol n,β (MV(Υ)) in R for any embedding β : Γ → R with R a real closed field.Similarly, any definable subset of Υ of o-minimal dimension m ⩽ n contained in a definably compact set has an m-dimensional volume in R. 8.5.Berkovich variants.-These constructions admit direct variants in the Berkovich setting which are transferred from the previous section 8.3 similarly as in the proof of Theorem 7.4.

( 3 )
[RV(F L ) : RV(L(T ))] = [RV(F ) : RV(K(T )].J.É.P. -M., 2024, tome 11 Retractions to skeleta.-Since multiplication does not belong to the structure on the value group sort Γ, we have to consider generalized intervals, which are obtained by concatenating a finite number of (oriented) closed intervals in Γ ∞ .Such a generalized interval I has an origin o I and an end point e I .
where N is an upper bound for the slopes of the f i .So f (y) tends to f (x) when the point y of D tends to x.
□ 3.12.Lemma.-LetM be either {0} or a model of DOAG, let Γ be a model of DOAG containing M , and let ρ be an element of Γ with ρ > M .Let Z ⊆ Γ n be an M -definable subset.Let x 1 , . .., x n : Z → Γ denote the coordinate functions of Z and let h : Z → Γ be an M -definable function.Assume that there exists a term t in {+, −, max, min} and γ