VC density of definable families over valued fields

In this article, we give tight bounds on the Vapnik-Chervonenkis density (VC-density) for definable families over any algebraically closed valued field $K$ (of any characteristic pair) in the language $\mathcal{L}_{\mathrm{div}}$ with signature $(0,1,+,\times,|)$ (where $x | y$ denotes $|x| \leq |y|$). More precisely, we prove that for any parted formula $\phi(\overline{X};\overline{Y})$ in the language $\mathcal{L}_{\mathrm{div}}$ with parameters in $K$, the VC-density of $\phi$ is bounded by $|\overline{X}|$. This result improves the best known results in this direction proved by Aschenbrenner at al., who proved a bound of $2|\bar{X}|$ is shown on the VC-density in the restricted case where the characteristics of the field $K$ and its residue field are both assumed to be $0$. The results in this paper are optimal and without any restriction on the characteristics. We obtain the aforementioned bound as a consequence of another result on bounding the Betti numbers of semi-algebraic subsets of certain Berkovich analytic spaces, mirroring similar results known already in the case of o-minimal structures and for real closed, as well as, algebraically closed fields. The latter result is the first result in this direction and is possibly of independent interest. Its proof relies heavily on recent results of Hrushovski and Loeser.

S.B. would like to acknowledge support from the National Science Foundation awards and DMS-1620271 and CCF-1618918. D.P. would like to acknowledge support from the National Science Foundation award DMS-1502296.

Introduction
In this article, we prove a tight bound on the number of realized 0/1 patterns (or equivalently on the Vapnik-Chervonenkis codensity) of definable families in models of the theory of algebraically closed valued fields with a non-archimedean valuation (henceforth referred to just as ACVF). This result improves on the best known upper bound on this quantity previously obtained by Aschenbrenner et al. in [ADH + 16]. Our result is a consequence of a topological result giving an upper bound on the Betti numbers of certain semi-algebraic sets obtained as Berkovich analytifications of definable sets in certain models of ACVF which we will recall more precisely in the next section.
In order to state our main combinatorial result we need to introduce some preliminary notation and definitions.
(Note that in the special case when n = 1, χ X,V,W ;1 is just the usual characteristic function of the subset X ⊂ V × W ). Forw ∈ W n and σ ∈ {0, 1} n , we will say that σ is realized by the tuple (X w1 , . . . , X wn ) of subsets of V if there exists v ∈ V such that χ X,V,W ;n (v,w) = σ. We will often refer to elements of {0, 1} n colloquially as '0/1 patterns'.
Finally, we define the function χ X,V,W : N → N by χ X,V,W (n) := max w∈W n card(χ X,V,W ;n (V,w)).
The function χ X,V,W is closely related to the notion of VC-codensity of a set system. Since some of the prior results (for example, those in [ADH + 16]) have been stated in terms of VC-codensity it is useful to recall its definition here. We denote vcd S := lim sup n→∞ log(π S (n)) log(n) .
Given a definable subset X ⊂ V × W in some structure, we will denote vcd(X, V, W ) := vcd S , where S = {X v |v ∈ V } ⊂ 2 W . We will call (following the convention in [ below). We will henceforth concentrate on the problem of obtaining tight upper bounds on the function χ X,V,W for the rest of the paper.
1.2. Brief History. For definable families of hypersurfaces in F k of fixed degree over a field F, Babai, Ronyai, and Ganapathy [RBG01] gave an elegant argument using linear algebra to show that the number of 0/1 patterns (cf. Notation 1.1.1) realized by n such hypersurfaces in F k is bounded by C · n k , where C is a constant that depends on the family (but independent of n). This bound is easily seen to be optimal. A more refined topological estimate on these realized 0/1 patterns (in terms of the sums of the Betti numbers) is given in [BPR09], where the methods are more in line with the methods in the current paper.
A similar result was proved in [BPR05] for definable families of semi-algebraic sets in R k , where R is an arbitrary real closed field. For definable families in M k , where M is an arbitrary o-minimal expansion of a real closed field, the first author [Bas10] adapted the methods in [BPR05] to prove a bound of C · n k on the number of 0/1 patterns for such families where C is a constant that depends on the family (see also [JL10]). These bounds were obtained as a consequence of more general results bounding the individual Betti numbers of definable sets defined in terms of the members of the family, and more sophisticated homological techniques (as opposed to just linear algebra) played an important role in obtaining these bounds.
If K is an algebraically closed valued field, then the problem of obtaining tight bounds on vcd(φ) for parted formulas, φ(X, Y ), in the one sorted language of valued fields with parameters in K was considered by Aschenbrenner et al. in [ADH + 16]. In particular, they obtained the nontrivial bound of 2|X| on vcd(φ) in the case when the characteristic pair of K (i.e. the pair consisting of the characteristic of the field K and that of its residue field) is (0, 0) [ADH + 16, Corollary 6.3].
Given that the model-theoretic/algebraic techniques used thus far do not immediately yield the tight upper bound of |X| on vcd(φ(X, Y )) for valued fields, it is natural to consider a more topological approach as in [Bas10]. However, for definable families over a (complete) valued field, it is not a priori clear that there exists an appropriate well-behaved cohomology theory (i.e. with the required finiteness/cohomological dimension properties) that makes the approach in [Bas10] feasible in this situation. For example, ordinary sheaf cohomology with respect to the Zariski orÉtale site for schemes are clearly not suitable. Fortunately, the recent break-through results of Hrushovski and Loeser [HL16] give us an opening in this direction. Instead of considering the original definable subset of an affine variety V defined over K, we can consider the corresponding semi-algebraic subset of the Berkovich analytification B F (V ) of V (see §A.2 below for the definitions). These semi-algebraic subsets have certain key topological tameness properties which are analogous to those used in the case of o-minimal structures, and moreover crucially they are homotopy equivalent to a simplicial complex of dimension at most dim(V ). Therefore, their cohomological dimension is at most dim(V ). In particular, the singular cohomology of the underlying topological spaces satisfies the requisite properties. Thus, in order to bound the number of realizable 0/1 patterns of a finite set of definable subsets of V , we can first replace the finite set of definable subsets of V by the corresponding semi-algebraic subsets of B F (V ), and then try to make use of their tame topological properties to obtain a bound on the number of 0/1 patterns realized by these semi-algebraic subsets. An upper bound on the latter quantity will also be an upper bound on the number of 0/1 patterns realized by the definable subsets that we started with (this fact is elucidated later in Observation 3.3.1 in § 3.3).
Using the results of Hrushovski and Loeser, one can then hope to proceed with the o-minimal case as the guiding principle. While the arguments are somewhat similar in spirit, there are several technical challenges that need to be overcome -for example, an appropriate definition of "tubular neighborhoods" with the required properties (see §3.1 below for a more detailed description of these challenges). The bounds on the sum of the Betti numbers of the semi-algebraic subsets of Berkovich spaces that we obtain in this way are exactly analogous to the ones in the algebraic, semi-algebraic, as well as o-minimal cases. The fact that the cohomological dimension of the semi-algebraic subsets of B F (V ) is bounded by dim(V ) is one key ingredient in obtaining these tight bounds.
Our results on bounding the Betti numbers of semi-algebraic subsets of Berkovich spaces are of independent interest, and the aforementioned results seem to suggest a more general formalism of cohomology associated to NIP structures. For example, one obtains bounds (on the Betti numbers) of the exact same shape and having the same exponents for definable families in the case of algebraic, semialgebraic, o-minimal and valued field structures. Moreover, in each of these cases, these bounds are obtained as a consequence of general bounds on the dimension of certain cohomology groups. Therefore, it is perhaps reasonable to hope for some general cohomology theory (say for NIP structures which are fields) which would in turn give a uniform method of obtaining tight bounds on VC-density via cohomological methods. More generally, it shows that cohomological methods can play an important role in model theory in general.
As a consequence of the bound on the Betti numbers (in fact using the bound only on the 0-th Betti number) we prove that vcd(φ(X, Y )) over an arbitrary algebraically closed valued field is bounded by |X|. One consequence of our methods (unlike the techniques used in [ADH + 16]) is that there are no restrictions on the characteristic pair of the field K.
Finally note that in [ADH + 16] the authors also obtain a bound of 2|X| − 1 on vcd(φ(X, Y )), over Q p , where φ is a formula in Macintyre's language [Mac76]. However, our methods right now do not yield results in this case.
Outline of the paper: In §2 we first introduce the necessary technical background (in §2.1), and then state the main results of the paper, namely Theorems 1 and 2, and Corollary 1 (in §2.2). The proofs of the main results appear in §3. We first give an outline of the proofs in §3.1. We next prove the main topological result of the paper (Theorem 2) in in §3.2, and prove Theorem 1 and Corollary 1 in §3.3 and §3.4 respectively.
In order to make the paper self-contained and for the benefit of the readers, we include in an appendix (Appendix §A) a review of some very classical results about singular cohomology (in §A.1), as well as much more recent ones related to semialgebraic sets associated to definable sets in models of ACVF proved by Hrushovski and Loeser [HL16] (in §A.2). These results are used heavily in the proofs of the main theorems.

Main results
2.1. Model theory of algebraically closed valued fields. In this section K will always denote an algebraically closed non-archimedean valued field K, and the value group of K will be denoted by Γ. Let R := K[X 1 , . . . , X N ] and A N K = Spec(R). Given a closed affine subvariety V = Spec(A) of A N K = Spec(R) and an extension K of K, we will denote by V (K ) ⊂ A N K (K ) the set of K points of V .
We denote by L the two-sorted language where the subscript K denotes constants, functions, relations etc., of the field sort and the subscript Γ denotes the same for the value group sort. When the context is clear we will drop the subscripts. The constant 0 Γ is interpreted as the valuation of 0 (and does not technically belong to the value group). Now suppose that φ is a quantifier-free formula in the language L(K; Γ ∪ {0 Γ }), with free variables of only the field sort. Then, φ is a quantifier-free formula with atoms of the form |F | ≤ λ · |G| where F, G ∈ R and λ ∈ Γ ∪ {0 Γ }. The formula φ gives rise to a definable subset of A N K and, in particular, φ defines a subset of A N K (K ) for every valued extension K of K. We will denote the intersection of this subset with V by R(φ, V ), and by R(φ, V )(K ) the corresponding subset of V (K ).

New Results.
Our main result is the following.
Theorem 1 (Bound on the number of 0/1 patterns). Let K be an algebraically closed valued field with value group Γ. Suppose that V ⊂ A N K and W ⊂ A M K are closed affine subvarieties and let be a formula with parameters in (K; Γ ∪ {0 Γ }) in the language L (with free variables only of the field sort). Then there exists a constant C = C φ,V,W , such that for all n > 0, As an immediate corollary of Theorem 1 we obtain the following bound on the VC-codensity for definable families over algebraically closed valued fields.
Corollary 1 (Bound on the VC-codensity for definable families over ACVF). Let K be an algebraically closed valued field with value group Γ. Let φ(X, Y ) be a formula with parameters in (K; Γ ∪ {0 Γ }) in the language L. Then, vcd(φ) ≤ |X|.
Theorem 1 will follow from a more general topological theorem which we will now state. Before we state the theorem, we recall some more notation.
We now assume that K is an algebraically closed complete valued field with a non-archimedean valuation whose value group Γ is a subgroup of the multiplicative group R >0 .
Given an affine variety V as before, Hrushovski-Loeser [HL16] associate to V a locally compact Hausdorff topological space, denoted by B F (V ). More generally, they associate a locally compact Hausdorff topological space B F (X) to any definable subset X ⊂ V which is functorial in definable maps. In the the present setting, B F (V ) can be identified with the Berkovich analytic space associated to V and has an explicit description in terms of valuations. We refer the reader to Appendix A.2 for a brief review of this construction and its main properties.
Let φ be a formula in the language L(K; Γ ∪ {0 Γ }) with free variables only of the field sort. Note that every L(K; Γ ∪ {0 Γ })-formula is equivalent modulo the twosorted theory of (K; Γ∪{0 Γ }) to a quantifier-free formula (see for example [HHM08, Theorem 7.1 (ii)]). Because of this fact, we can assume without loss of generality in what follows that φ is a quantifier-free formula, and is thus a quantifier-free formula with atoms of the form |F | ≤ λ · |G| where F, G ∈ R and λ ∈ Γ ∪ {0 Γ }.
K is a affine closed subvariety, and φ a formula in the language L(K; Γ ∪ {0 Γ }) with free variables only of the field sort, we will denote Suppose now that V ⊂ A N K and W ⊂ A M K are closed affine subvarieties and let φ(·; ·) be a formula in disjunctive normal form without negations and with atoms of the form |F | ≤ λ · |G|, F, G ∈ K[X 1 , . . . , X N , Y 1 , . . . , Y M ], λ ∈ Γ ∪ {0 Γ }. Then for each w ∈ W (K), R(φ(·, w), V ) is a semi-algebraic subset of B F (V ). Forw = (w 1 , . . . , w n ) ∈ W (K) n and σ ∈ {0, 1} n , we set Given a topological space Z, we denote by H i (Z) the corresponding i-th singular cohomology group of X with rational coefficients. We refer the reader to § A.1 for a brief recollection of the main properties of these cohomology groups. We note that for Z = R(σ,w) these cohomology groups are finite dimensional Q-vector spaces.
denote the corresponding i-th Betti number.
The following theorem, mirroring a similar theorem in the o-minimal case [Bas10], is the main technical result of this paper.
Theorem 2 (Bound on the Betti numbers). Let K be an algebraically closed complete valued field with a non-archimedean valuation whose value group Γ is a subgroup of the multiplicative group R >0 . Suppose that V ⊂ A N K and W ⊂ A M K are closed affine subvarieties and let φ(·; ·) be a formula in disjunctive normal form without negations and with atoms of the form |F | ≤ λ · |G|, F, G ∈ K[X 1 , . . . , X N , Y 1 , . . . , Y M ], λ ∈ Γ ∪ {0 Γ }. Let dim(V ) = k. Then, there exists a constant C = C φ,V,W > 0 such that for allw ∈ W (K) n , and 0 ≤ i ≤ k,

Proofs of the main results
In this section we prove our main results. Before starting the formal proof we first give a brief outline of our methods.
3.1. Outline of the methods used to prove the main theorems. Our main technical result Theorem 2 gives a bound, for each i, 0 ≤ i ≤ k, andw ∈ W (K) n , on the sum over σ ∈ {0, 1} n of the i-th Betti numbers of R(σ,w). The technique for achieving this is an adaptation of the topological methods used to prove a similar result in the o-minimal category in [Bas10] (Theorem 2.1). We recall here the main steps of the proof of Theorem 2.1 in [Bas10].
We assume that V = R N , W = R M , where R is a real closed field and X ⊂ V × W is a closed definable subset in an o-minimal expansion of R.
Step 1. The first step in the proof is to construct definable infinitesimal tubes around the fibers X w1 , . . . , X wn .
Step 2. Let σ ∈ {0, 1} n , and C be a connected component of One proves that there exists a unique connected component D of the complement of the boundaries of the tubes constructed in Step 1 such that C is homotopy equivalent to D. The homotopy equivalence is proved using the local conical structure theorem for o-minimal structures.
Step 3. As a consequence of Step 2, in order to bound σ b i (R(σ,w)), it suffices (using Alexander duality) to bound the Betti numbers of the union of the boundaries of the tubes constructed in Step 1.
Step 4. Bounding the Betti numbers of the union of the boundaries of the tubes is achieved using certain inequalities which follow from the Mayer-Vietoris exact sequence. In these inequalities only the Betti numbers of at most k-ary intersections of the boundaries play a role.
Step 5. One then uses Hardt's triviality theorem for o-minimal structures to get a uniform bound on each of these Betti numbers that depends only on the definable family under consideration i.e. on X, V , and W . Thus, the only part of the bound that grows with n comes from certain binomial coefficients counting the number of different possible intersections one needs to consider.
The method we use for proving Theorem 2 is close in spirit to the proof of Theorem 2.1 in [Bas10] as outlined above but different in many important details. For each of the steps enumerated above we list the corresponding step in the proof of Theorem 2.
Step 1 . We construct again certain tubes around the fibers and give explicit descriptions of the tubes in terms of the formula φ defining the given semialgebraic set R(σ,w). The definition of these tubes is somewhat more complicated than in the o-minimal case (see Notation 3.2.2). The use of two different infinitesimals to define these tubes is necessitated by the singular behavior of the semi-algebraic set defined by |F | ≤ λ|G| near the common zeros of F and G.
Step 2 . The homotopy equivalence property analogous to Step 2 above is proved in Proposition 3.2.6, and the role of local conical structure theorem in the o-minimal case is now played by a corresponding result of Hrushovski and Loeser (see Theorem A.3 below).
Step 3 . We avoid the use of Alexander duality by directly using a Mayer-Vietoris type inequality giving a bound on the Betti numbers of intersections of open sets in terms of the Betti numbers of up to k-fold unions (cf. Proposition 3.2.47).
Step 4 . This step is subsumed by Step 3 .
Step 5 . Finally, instead of using Hardt's triviality to obtain a constant bound on the Betti numbers of these 'small' unions, we use a theorem of Hrushovski and Loeser which states that the number of homotopy types amongst the fibers of any fixed map in the analytic category that we consider is finite (cf. Theorem A.4 below).
We apply Theorem 2 directly to obtain the VC-codensity bound in the case of the theory of ACVF (using Observation 3.3.1). One extra subtlety here is in removing the assumption on the formula φ (which occurs in the hypothesis of Theorem 2). Actually, in order to prove Corollary 1 in general it suffices only to consider φ of the special form having just one atom of the form |F | ≤ λ · |G| or |F | = λ · |G|.
This reduction from the general case to the special case is encapsulated in a combinatorial result (Proposition 3.3.2). With the help of Proposition 3.3.2, Corollary 1 becomes a consequence of Theorem 2 and Observation 3.3.1.
We now give the proofs in full detail. In the next subsection ( §3.2) we give the proof of Theorem 2. In §3.3, we show how to deduce Theorem 1 from Theorem 2. Finally, in §3.4 we show how to deduce Corollary 1 from Theorem 2.
3.2. Proof of Theorem 2. In the following, K will be a fixed algebraically closed non-archimedean (complete real-valued) field and V is an affine variety over K. We shall freely use the results of Hrushovski and Loeser [HL16] on the spaces B F (X) associated to definable subsets X ⊂ V . For the reader's convenience, an exposition (with references) of the results we require below is provided in §A.2. We shall also make use of some standard facts about singular cohomology of topological spaces; we refer the reader to §A.1 for a review of these facts.
K is a closed subvariety, then we set Cube V (R) := Cube N (R)∩B F (V ). Note that this a closed semi-algebraic subset of B F (V ).
Notation 3.2.2. (Open, closed (ε, ε )-tubes) Suppose φ(·) is a formula in disjunctive normal form without negations and with atoms of the form |F | ≤ λ · |G|, with F, G ∈ K[X 1 , . . . , X N ] and λ ∈ R + := R ≥0 . We denote by φ +,o (·; T, T ) the formula obtained from φ by replacing each atom |F | ≤ λ · |G| with λ, G = 0 by the formula and each atom |F | ≤ λ · |G| with λ = 0 or G = 0 by the formula where T, T are new variables of the value sort. Similarly, we denote by the formula obtained from φ by replacing each atom |F | ≤ λ · |G| by the formula For ε > 1, ε > 0, and V a closed subvariety of A N K we set is an open (resp. closed) subset of Cube V (R). Moreover, both of these are semi-algebraic as subsets of B F (V ).

Finally, we set
. Remark 3.2.5. Note that our notation for the 'tubes' above is structured so that a superscript o (resp. c) in the notation indicates that the corresponding tube is open (resp. closed).
The next proposition is the key ingredient for the proof of Theorem 2.
Proof of Lemma 3.2.7. We prove each part separately below.
Proof of Part (1). Let It is clear that f is definable. Note that . The claim now follows as a direct consequence of Theorem A.3.
. As in the previous part, Clearly, g is definable and . As in the previous part, the result follows from an application of Theorem A.3 to the map g.
Proof of Part (3). First, note that S σ (ε, ε , R) is semi-algebraic. Moreover, we observe that the union S 3 σ (ε , R) = s>1 S σ (s, ε , R) is also a semi-algebraic subset of B F (V ). To see this let Clearly, h is definable. Moreover, Proof of Part (4). The proof is similar to that of Part 3. (5). This follows from the definition of S σ (s, s , R).

Proof of Part
Proof of Part (6). This part follows immediately from Theorem A.3.
This completes the proof of Lemma 3.2.7.
We now prove Proposition 3.2.6. Since the proof is long and technical, we begin by giving a general outline. Because of the nature of the argument the steps enumerated do not actually occur in the same order as in the list below.
Step 1. By Lemma 3.2.7 (Part (6)), there exists an R 0 > 0 such that for all R > R 0 the natural inclusion induces an isomorphism: So we fix some R > 0 large enough and consider only the semi-algebraic set R(σ,w) ∩ Cube V (R)).
Step 2. By Lemma 3.2.7 (Part (5)), we have natural inclusions We shall see in Claim 4 below that this induces an isomorphism Step 3. We shall see in Claim 1 below that the natural inclusions Step 4. In order to conclude, we shall show that the direct and inverse limits appearing in Step 2 (proved in Claim 6) and Step 3 (proved in Claim 3) 'stabilize'. This stabilization will result as a consequence of the homotopy equivalences proved in Lemma 3.2.7, and is proved in two intermediate steps (Claims 4 and 5 for Step 2, and Claims 2 and 3 for Step 3).
The proofs involving commutation of the limit (or colimit) functors with cohomology in Steps 2 and 3 all rely on proving that a certain increasing family of compact subspaces S λ ⊂ T , of a semi-algebraic set T , indexed by a real parameter λ, are cofinal in the family of all compact subspaces of S := ∪ λ S λ in T (the families are different for different steps). One then uses Lemma A.1.2 to obtain the desired commutation of various limits (or colimits) with cohomology. The proofs of all these cofinality statements rely on the following basic lemma that we extract out for clarity.
Lemma 3.2.9. Let T be a compact Hausdorff space, Λ a partially ordered set, (C λ ) λ∈Λ an increasing sequence of compact subsets of T , and S := ∪ λ C λ . Suppose that there is a continuous function θ : S → R >0 ∪ {∞} such that the following property holds: Then the family (C λ ) λ∈Λ is cofinal in the family of compact subsets of S in T .
Proof. Let C ⊂ S be a compact subset of S in T . We need to show that there is a λ such that C ⊂ C λ . Since C is compact, F | C attains its minimum θ 0 > 0 on C.
Let λ(θ 0 ) be as in the proposition. Clearly, It follows that C ⊂ C λ(θ0) , and so the family (C λ ) λ∈Λ is cofinal in the family of compact subsets of S in T .
Proof of Proposition 3.2.6.
Claim 1. The natural inclusions As an immediate consequence we also have t , ε, ε , R)).
(Here the inductive limit in (3.2.12) is taken over the poset R >1 × R >0 , partially ordered by (t 1 , t 1 ) (t 2 , t 2 ) if and only if t 2 ≤ t 1 and t 2 ≤ t 1 , and for (t 1 , t 1 ) (t 2 , t 2 ), the morphism Proof of Claim 1. First note that the isomorphism (3.2.13) is an immediate consequence of the isomorphism (3.2.12), and the fact that (see for example [SGA72, Expose 1, page 13] for the last isomorphism). We now proceed to prove the isomorphism (3.2.12). Let Since each TubeCompl −,c V,φ(·,wi) (ε, ε , R) is compact, T is a compact Hausdorff space. Notice that for each t > 1, t > 0, S σ (t, t , ε, ε , R) ⊂ T . We will now show for fixed ε, ε , R, the family of semi-algebraic sets in T . Assuming this fact, the claim follows from Part (1) of Lemma A.1.2.
In order to prove the cofinality statement for the family (3.2.14), we first prove the following cofinality statement from which the cofinality of (3.2.14) will follow.
Suppose that I is a finite set, and let for each as well.
Claim 1a. The family of semi-algebraic sets Proof of Claim 1a. Proving cofinality of the family S (1) (t, t , R) t>1,t >0 in the partially ordered family of open neighborhoods of is equivalent to proving the cofinality of the family of compact subsets in the partially ordered family of compact subsets of For proving the latter we use Lemma 3.2.9, with Λ = R >1 × R >0 , and the family (C λ ) λ∈Λ := (T (1) − S (1) (t, t , R)) (t,t )∈Λ of compact semi-algebraic subsets of the compact set T (1) .
We now define a continuous function θ : We first introduce the following auxiliary functions which will be used in the definition of the function θ. For λ ≥ 0, let H λ (u, v) : R ≥0 × R ≥0 → R ≥0 be defined as follows.
If λ = 0, then It is easy to check that the functions H λ (u, v) are continuous. For each i ∈ I, let θ i : , and let θ : Notice that each θ i , and hence also θ are continuous, since they are compositions of continuous functions.
In order to apply Lemma 3.2.9 it remains to check that θ is positive, and that it satisfies (3.2.10) in Lemma 3.2.9.
Now we return to the proof the Claim 1. Let φ = h∈H φ (h) , where each φ (h) is a conjunction of weak inequalities, |F jh | ≤ λ jh ·|G jh |, j ∈ J h , and H, J h are finite sets.
Proof of Claim 2. The proof is structurally similar to the proof of Claim 1. Let Then T is compact. We will now show for fixed t , ε, ε , R, the family of semialgebraic sets in T . Assuming this fact, the claim follows from Part (1) of Lemma A.1.2.
In order to prove the cofinality statement for the family (3.2.18), we first prove the following cofinality statement from which the cofinality of (3.2.18) will follow.
Suppose that I is a finite set, and let for each i ∈ I, F i , G i ∈ K[X 1 , . . . , X N ], and λ i ∈ R + . Let V be as before, R > 0, and T (2) a compact semi-algebraic subset of Cube V (R). We define is equivalent to proving that the family of compact semi-algebraic sets, is cofinal in the family of compact subsets of T (2) − t>1 S (2) (t, t , R).

S
(2) and The last cofinality statement would follow if for each i we can show that the family of compact semi-algebraic sets S  i (t, t , R) c . This is because if for each compact subspace We now proceed to show the cofinality of the family S It is an easy exercise to check that the functions θ i positive and satisfies Property (3.2.10) in Lemma 3.2.9, with the map λ defined by satisfy the hypothesis of Lemma 3.2.9. This finishes the proof of Claim 2a.
The proof of Claim 2 follows from the proof of Claim 2a, in exactly the same manner as the proof of Claim 1 from Claim 1a and is omitted.
Suppose that I is a finite set, and let for each i ∈ I, F i , G i ∈ K[X 1 , . . . , X N ], and λ i ∈ R + . Let V and R > 0 be as before. We define One can now directly verify that θ is positive and satisfies (3.2.10) in Lemma 3.2.9, with the map λ defined by λ(θ 0 ) = (1 + θ 0 , θ 0 ). We leave the details to the reader. This concludes the proof of Claim 4a.
The proof of Claim 4 from Claim 4a is formally analogous to the similar derivation of Claim 1 from Claim 1a and is omitted.
induce for each fixed s > 0 and R > 0, an isomorphism Proof of Claim 5. The proof is structurally similar to the proof of Claim 4. We will now show for fixed s , R, the family of semi-algebraic sets in S. Assuming this fact, the claim follows from Part (2) of Lemma A.1.2.
In order to prove the cofinality statement for the family (3.2.31), we first prove the following cofinality statement from which the cofinality of (3.2.31) will follow.
Suppose that I is a finite set, and let for each i ∈ I, F i , G i ∈ K[X 1 , . . . , X N ], and λ i ∈ R + . Let V and R > 0 be as before. We define Proof of Claim 5a. Let for each i ∈ I, i (s, s , R). To see this, suppose that we have proven the latter cofinality statement (for each i). Let C ⊂ s>1 S (4) (s, s , R) be a compact subspace. Then C i := C ∩ s>1 S (4) i (s, s , R) is a compact subspace and by hypothesis for each i ∈ I, there exists s 0,i > 1 such that C i ⊂ S It is an easy exercise to check that the functions θ i are positive and satisfy Property (3.2.10) in Lemma 3.2.9, with the map λ defined by λ(θ 0 ) = θ 0 . This completes the proof of Claim 5a.
The proof of Claim 5 follows from the proof of Claim 5a, in exactly the same manner as the proof of Claim 1 from Claim 1a and is omitted.
Proof of Claim 6. It follows from (3.2.27) in Claim 4 that s, s , R)).
We now return to the proof of Proposition 3.2.6. Using Lemma 3.2.7 (Part (6)), we have that for large enough R > 0, one has ( R(σ,w)).
Proof of Proposition 3.2.40. Without any loss of generality we will assume that φ is a disjunction of the formulas φ h , h ∈ H, where H is a finite set, and each φ h is a conjunction of weak inequalities |F hj | ≤ λ hj |G hj |, j ∈ J h , where J h is a finite set. As before for each i we let F ihj := F hj (·, w i ), G ihj := G hj (·, w i ).
Let X ⊂ V be a definable subset where V is an affine variety of dimension k, and U 1 , . . . , U n open semi-algebraic subsets of B F (X). For J ⊂ [1, n], we denote by U J := j∈J U j and U J := j∈J U j . We have the following proposition, which is very similar to [BPRon, Proposition 7.33, Part (ii)].
Proposition 3.2.47. With notation as above, for each i, Proof. We first prove the claim when n = 1. If 0 ≤ i ≤ k − 1, the claim is which is clear. If i = k, the claim is b k (U 1 ) ≤ b k (B F (V )), which is true using Part (d) of Corollary A.6.
The claim is now proved by induction on n. Assume that the induction hypothesis holds for all n − 1 open semi-algebraic subsets of B F (V ), and for all 0 ≤ i ≤ k. It follows from the standard Mayer-Vietoris sequence that Applying the induction hypothesis to the set U [1,n−1] , we deduce that Next, applying the induction hypothesis to the set, which finishes the induction.
Denote by X J ,J the definable subset of V × W j × R 5 defined by the formula and let π j,J ,J : X J ,J → W J ∪J × R 5 denote the projection. It follows from Theorem A.4 (with Y = W j , V viewed as a quasi-projective variety in P N and X J ,J as above) that the number of homotopy types amongst the semi-algebraic sets B F (π −1 j,J ,J (w 1 , . . . , w j , s, s , t, t , R)) is finite, and moreover since each such fiber is homotopy equivalent to a finite simplicial complex by Theorem A.5, there exists a finite bound C i,j,J ,J ∈ Z ≥0 , such that b i (B F (π −1 j,J ,J (w 1 , . . . , w j , s, s , t, t , R)) ≤ C i,j,J ,J , for all (w 1 , . . . , w j ) ∈ W (K) j , s, s , t, t , R ∈ R.
Note that C i,j depend only on V and φ. Also, since each j-ary union amongst the the semi-algebraic sets , is clearly homeomorphic to one of the sets B F (π −1 j,J ,J (w 1 , . . . , w j , s, s , t, t , R)) the i-th Betti number of every such union is bounded by C i,j . It now follows from (3.2.51) and Proposition 3.2.47 that The theorem follows.
3.3. Proof of Theorem 1. We need a couple of preliminary results of a settheoretic nature starting with the following observation.
Then, for every n > 0, Proof. To see this note that a 0/1 pattern is realized by the tuple (Y w1 , . . . , Y wn ) in V , only if it is realized by the tuple (Y w1 , . . . , Y wn ) in V . This follows from the fact that Y ∩ (V × W ) = Y , and therefore for all w ∈ W , Y w ∩ V = Y w .
Let V, W be sets, I a finite set, and for each α ∈ I, let X α be a subset of V ×W . Let i α : X α → V × W denote the inclusion map. Suppose that X is a subset of V × W obtained as a Boolean combination of the X α 's. Let W = α∈I W , and for α ∈ I we j α : W → W denote the canonical inclusion. Let X = α∈I Im((1 V ×j α )•i α ) ⊂ V × W . With this notation we have the following proposition.
To prove the claim first observe that since χ X,V,W ;n (v,w) = χ X,V,W ;n (v ,w), Since X is a Boolean combination of the X α , α ∈ I, there must exist α ∈ I such that v ∈ (X α ) wi ⇔ v ∈ (X α ) wi . It now follows from the definition of X , W that χ X ,V,W ;card(I)·n (v, j n (w)) = χ X ,V,W ;card(I)·n (v , j n (w)). This implies that card(χ X,V,W ;n (V,w)) ≤ card(χ X ,V,W ;card(I)·n (V, j n (w))).
Proof of Theorem 1. We make two reductions. We first claim that it suffices to prove the theorem in the case of an algebraically closed complete valued field of rank one i.e. the value group subgroup of the multiplicative group R + . Secondly, we claim that we can assume without loss of generality that the formula φ is in disjunctive normal form without negations and with atoms of the form |F | ≤ λ·|G|.
Reduction to complete algebraically closed field of rank one: The theory of algebraically closed valued fields in the two sorted language L becomes complete once we fix the characteristic of the field and that of the residue field. Moreover, for each such characteristic pair (0, 0), (0, p), or (p, p) (p a prime) there exists a model (K; Γ) of the theory of algebraically closed valued field such that the value group is a multiplicative subgroup of R + (i.e. of rank one) and K is complete. It follows by a standard transfer argument it suffices to prove the theorem for such a model.
Reduction to the case of disjunctive normal form without negations and with atoms of the form |F | ≤ λ · |G|: We now observe that it suffices to prove the theorem in the case when the formula φ is equivalent to a formula in disjunctive normal form without negations with atoms of the form |F | ≤ λ · |G|. Furthermore, using the first reduction, we may assume that the value group is R + and K is an algebraically closed complete valued field. In particular, we assume that the atoms of φ are of the form |F | ≤ λ · |G|, with λ ∈ R + , and F, G, ∈ K[X, Y ]. Let (φ α ) α∈I be the finite tuple of (closed) atomic formulas appearing in φ. Denote by Note that φ is equivalent to a formula in disjunctive normal form without negations and with atoms of the form |F | ≤ λ · |G|.
Let X α := R(φ α , V × W )(K) and X = R(φ, V × W )(K). Then X is a Boolean combination of the X α 's and we can define X ⊂ V (K) × W (K) where X and W (K) are defined as in Proposition 3.3.2. In particular, we let π 1 : X → V (K) and π 1 : X → W (K) denote the natural projection maps. Similarly, we let and denote the natural projection maps. Note that the diagram is isomorphic to the diagram By isomorphism, we mean that there are natural bijections R(φ , V ×W ×A |I| )(K) → X and Im(π 2 ) → Im(π 2 ) making the resulting morphism of diagrams above commute(with identity as the map on V (K)).
So it suffices to prove that there exists a constant C (depending only on V and φ) such that for all n, This shows that we can assume that φ is equivalent to a formula in disjunctive normal form without negations and with atoms of the form |F | ≤ λ · |G|.
We now use the special case of Theorem 2 obtained by setting i = 0. In that case, b 0 ( R(σ,w)) is the number of connected components, which is at least one as soon as R(σ,w) is non-empty. Now use Observation 3.3.
, noting that there exists a canonical injective map ι : V (K) → B F (V ) such that for each w ∈ W (K) the following diagram of injective maps commutes: This finishes the proof.

Proof of Corollary 1.
Proof of Corollary 1. Corollary 1 follows immediately from Theorem 1 and the following proposition (Proposition 3.4.1) which is well known, but whose proof we include for the sake of completeness.
Proposition 3.4.1. Suppose that there exists a constant C > 0 such that for all For v ∈ V , w i ∈ X v for all i ∈ I, and w i ∈ X v for all i ∈ [1, n] \ I if and only if v ∈ X wi for all i ∈ I, and v ∈ X wi for all i ∈ [1, n] \ I. This implies that The proposition now follows from Definition 1.1.2.
Finally, we recall some properties of singular cohomology with regards to projective and injective limits. These properties are used in the proof of Proposition 3.2.6. Below, we drop the coefficients Q from the notation of singular cohomology groups.
Let I be a directed set, (U i ) i∈I be a directed system of topological spaces, and denote the corresponding direct limit. In particular, for all i ≤ j (i, j ∈ I), we have continuous maps . The latter cohomology groups form an inverse system, and the natural continuous Similarly, an inverse system (U i ) i∈I of topological spaces gives rise to a direct system of corresponding cohomology groups and natural morphism In this article, we only consider direct systems U i given by an increasing sequences of subspaces of a space X or inverse systems U i given by a decreasing sequence of subspaces. In the former case, the direct limit U is given by the union of these spaces, and in the latter case the inverse limit is given by the intersection of these subspaces. The following lemma is our main tool for understanding the corresponding cohomology groups.
is an isomorphism. 2. Let {C i } i∈I be an increasing sequence of compact subspaces of S, and S := i C i .
Suppose that the family C i is cofinal in the family of compact subspaces of S. Then the natural map is an isomorphism.
Proof of Part (2). The statement follows from the fact that singular homology of any space is isomorphic to the direct limit of the singular homology of its compact subspaces [Spa66,Theorem 4.4.6], the fact that the singular cohomology group H * (S, Q) is canonically isomorphic to Hom(H * (S, Q), Q) since Q is a field, and that the dual of a direct limit of finite dimensional vector spaces is the inverse limit of the duals of those vector spaces.
A.2. Recollections from Hrushovski-Loeser. In this section we recall some results from the theory of non-archimedean tame topology due to Hrushovski and Loeser [HL16]. The main reference for this section is Chapter 14 of [HL16], but we refer the reader to [Duc16] for an excellent survey. In particular, we will deal with the model theory of valued fields. We denote by K a complete valued field with values in the ordered multiplicative group of the positive real numbers.
We consider a two sorted language with the two sorts corresponding to valued fields and the value group. The signature of this two sorted language will be (0, 1, where the subscript K denotes constants, functions, relations etc., of the field sort and the subscript R + denotes the same for the value group sort. When the context is clear we will drop the subscripts.
Following [HL16, §14.1], we will denote by F the two sorted structure (K; R + ) viewed as a substructure of a model of ACVF. Given a quasi-projective variety V defined over K and an F-definable subset X of V × R n + , Hrushovski and Loeser [HL16] associate to X (functorially) a topological space B F (X). By definition, this is the space of types, in X, defined over F which are almost orthogonal to the definable set R + . Given a variety V as above, we say that subset Z ⊂ B F (V ) is semi-algebraic if it is of the form B F (X) for an F-definable subset X ⊂ V . We note that X itself can be identified in B F (X) as the set of simple types, and hence there is a canonically defined injection X → B F (X).
We now recall a description of the spaces B F (X) in some special cases and some of their properties; these are the only properties which are used in this article. f g, where f, g ∈ A, λ ∈ R + and ∈ {≤, <, ≥, >} gives a definable subset X of V , and therefore a semi-algebraic subset B F (X) of B F (V ). It can be described in the language of valuations as the set {x ∈ B F (V )|f (x) λg(x)}. In general, the semi-algebraic subset associated to a Boolean combination of such formulas is the corresponding Boolean combination of the semi-algebraic subsets associated to each formula. Moreover, a subset of B F (V ) is semi-algebraic if an only if it is a Boolean combination of subsets of the form {x ∈ B F (X)|f (x) λg(x)}, where f, g ∈ A, λ ∈ R + and ∈ {≤, <, ≥, >}. 6. ( [HL16], 14.1.2) If X is an F-definable subset of an algebraic variety V , then B F (X) is compact if and only if B F (X) is closed in B F (V ) where V is a complete algebraic variety. 7. Suppose V = Spec(A) ⊂ A N K is an affine subvariety, and φ(X; T ) (with X = (X 1 , . . . , X N )) a formula with parameters in (K; R + ). Here X are free variable of the field sort and T is a free variable of the value sort. Suppose a ∈ R + such that for all t, t satisfying, a < t < t , (K; R + ) |= φ(X; t ) → φ(X, t). Let ψ(X) be the formula ∃T (T > a) ∧ φ(X, T ). Then, R(ψ, V ) = a<t R(φ(·; t), V ).
To prove the reverse inclusion, let p ∈ R(ψ, V ). Then, by definition p is a type which is almost orthogonal to the value group, and moreover, there exists x ∈ R(ψ, V )(K ), such that x |= p and (K , R + ) is an elementary extension of (K; R). Hence, there exists t 0 > a, such that (K , R + ) |= φ(x, t 0 ), and so p ∈ R(φ(·, t 0 ), V ). This proves that R(ψ, V ) ⊂ a<t R(φ(·; t), V ).
Given an F-definable map f : X → R + , we will denote by B F (f ) : B F (X) → B F (R + ) = R + the induced map. We will say that B F (f ) is a semi-algebraic map.
The following theorems which are easily deduced from the main theorems in [HL16, Chapter 14] will play a key role in the results of this paper. We will use the same notation as above.
Theorem A.3. [HL16,Theorem 14.4.4] Let V be a quasi-projective variety over K, X ⊂ V be an F-definable subset and f : X → R + be an F-definable map. For t ∈ R + , let B F (X) ≥t denote the semi-algebraic subset B F (X ∩ (f ≥ t)) = B F (X) ∩ (B F (f ) ≥ t) of B F (V ). Then, there exists a finite partition P of R + into intervals, such that for each I ∈ P and for all ε ≤ ε ∈ I, the inclusion B F (X) ≥ε → B F (X) ≥ε is a homotopy equivalence.
Theorem A.4. [HL16, Theorem 14.3.1, Part (1)] Let Y be a variety and X ⊂ Y ×R r + ×P m be an F-definable set. Let π : X → Y ×R r + be the projection map. Then there are finitely many homotopy types amongst the fibers (B F (π −1 (y; t))) (y;t)∈Y ×R r + . Theorem A.5. [HL16, Theorem 14.2.4] Let V be a quasi-projective variety defined over K, and X an F-definable subset of V . Then there exists a sequence of finite simplicial complexes (X i ) i∈N embedded in B F (X) of dimension ≤ dim(V ), deformation retractions π i,j : X i → X j , j < i, and deformation retractions π i : B F (X) → X i , such that π i,j • π i = π j and the canonical map B F (X) → lim ← −i X i is a homeomorphism.
As an immediate consequence of Theorem A.5 we have using the same notation: Corollary A.6. Let V ⊂ A N K be a closed affine subvariety, and let B F (X) be a semi-algebraic subset of V . Note that Parts (a), (b) and (c) follow directly from Theorem A.5.
Proof of Part (d). Recall the definition of Cube V (R) (cf. Notation 3.2.1) and that Cube V (R) is a compact topological space. Similar remarks apply to Cube V (R)∩X. Moreover, arguing as in Part (6) of Lemma 3.2.7, for sufficiently large R the natural inclusions Cube V (R) ∩ X → B F (X) and Cube V (0, R) → B F (V ) induce homotopy equivalences. Therefore, it is sufficient to prove that for all sufficiently large R > 0 the natural induced morphism is surjective.
By Theorem A.5, B F (V ) and hence Cube V (R) for every R > 0, has the homotopy type of a finite simplicial polyhedron of dimension at most dim(V ). Since Cube V (R) is compact, it follows that the cohomological dimension (in the sense of [Ive86,page 196,Definition 9.4]) of Cube V (R) is ≤ dim(V ).
It follows again from Theorem A.5 that there exists a compact polyhedron Z ⊂ Cube V (R) ∩ X (for sufficiently large R > 0) such that Z is a deformation retract of B F (X). Let ι : Z → Cube V (R) ∩ X be the inclusion map. Note that ι induces isomorphisms in cohomology. Since the inclusion of Z in Cube V (R) factors through ι, and ι induces isomorphisms in cohomology, it follows (using the long exact sequence of cohomology for pairs) that H * (Cube V (R), Cube V (R) ∩ X) ∼ = H * (Cube V (R), Z).
We now prove that This gives the desired result by an application of the long exact sequence in cohomology associated to the pair (Cube V (R), Cube V (R) ∩ X).
Recall that Cube V (R) is a compact space, and consequently that Z is a closed subspace of Cube V (R). It follows now [Ive86,page 198,Proposition 9.7] that the cohomological dimension of U := (B F (V ) ∩ Cube V (R)) \ Z is also ≤ dim(V ). This implies that H dim(V )+1 c (U ) ∼ = H dim(V )+1 (Cube V (R), Z) = 0, which finishes the proof.