{'fraction_non_alphanumeric': 0.06756555423122765, 'fraction_numerical': 0.009932459276916964, 'mean_word_length': 3.319746862597876, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 13, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Groups definable in two orthogonal sorts

This work can be thought as a contribution to the model theory of group extensions. We study the groups G which are interpretable in the disjoint union of two structures (seen as a two-sorted structure). We show that if one of the two structures is superstable of finite Lascar rank and the Lascar rank is definable, then G is an extension of a group internal to the (possibly) unstable sort by a definable subgroup internal to the stable sort. In the final part of the paper we show that if the unstable sort is an o-minimal expansion of the reals, then G has a natural Lie structure and the extension is a topological cover.


Introduction
This paper can be thought as a contribution to the model-theory of covers of groups in the spirit of [17,8,3]. We assume some familiarity with the basic notions of model theory, but we recall some relevant definitions in §2. A good recent reference is [15].
Given two structures Z and R, let (Z, R) be the two-sorted structure with a sort for Z and another sort for R in a disjoint language (no connections between the two sorts). Note that Z and R are then fully orthogonal in the following sense: any definable subset of Z m × R n is a finite union of sets of the form A × B with A a definable subset of Z m and B ad definable subset of R n .
Our aim is to study the groups G which are interpretable in (Z, R), or equivalently definable in (Z, R) eq (see §2 for the definitions). Obvious examples are the direct products of groups H × K with H definable in Z and K definable in R. More generally one can have a quotient of H × K by a finite subgroup. There are however more interesting examples like the following. Example 1.1. ( [8]) The universal cover f : G → H of a real Lie group H definable in an o-minimal expansion R of the real field is interpretable in ((Z, +), R).
A few comments are in order. By [5] the universal cover f : G → H of H can be realized as a locally definable group and admits a definable section s : H → G (see also [2]). In [8, §8] it is showed that the bijection G → ker(f ) × H induced by the section gives an intepretation of (G, f, R) in the two-sorted structure (ker(f ), R). On the other hand since ker(f ) ∼ = π 1 (H) is abelian and finitely generated, ker(f ) is interpretable in (Z, +) and therefore f : G → H is interpretable in the twosorted structure ((Z, +), R). In the same way one shows that any cover of H is interpretable in ((Z, +), R). (See also [3,Prop. 3.1].) Example 1.1 shows that a group G interpretable in (Z, R) eq does not need to arise from a direct product. The next natural question is whether G is always an extension of a group definable in one sort by a group definable in the other sort. We will show that this is indeed the case under a suitable stability assumption on Z, but let us first show that in full generality the question has a negative answer. To this aim we take Z = R = (R, +, <). So we have two structures Z and R which are at the same time "equal" and orthogonal. There is of course no contradiction: indeed strictly speaking in (Z, R) we only have an isomorphic copy of Z and an isomorphic copy of R with the isomorphism not definable in (Z, R). Example 1.2. Let Z = R = (R, +, <). There is a group G definable in (Z, R) eq with no infinite definable subgroup internal to one of the two sorts. So in particular G cannot be a definable extension of a group internal to one sort by a group internal to the other sort.
Proof. (Based on [11,Example 5.2]) Take G = (Z × R)/Λ with Z 2 ∼ = Λ < Z × R and Λ in sufficiently generic position. Note that Λ is not definable. However we can define G in (Z, R) eq taking a definable set X ⊆ Z × R such that X + Λ = G and X ∩ Λ is finite (a big enough square X = [0, a] × [0, a] will do) and identifying G with X/Γ (where X/Λ is the quotient of X by the equivalent relation "to be in the same coset"). Since we only need a finite portion of Λ to define X/Λ we obtain a definition in (Z, R) eq . This is exactly the example in [11] except that in that paper the authors work with only one sort (which amounts to have the identity map from Z to R at disposal). They prove that in the one-sort setting G has no definable proper infinite subgroups. This holds a fortiori in the two-sorted setting since we have fewer definable sets. Thus clearly G has no infinite subgroups internal to one of the two sorts.
In Example 1.2 it is important to have the order relation < in the language, so the structures are unstable (in the model-theoretic sense). If we work with the stable structures Z = R = (R, +) the argument breaks down since in this case we are not able to define G = (Z × R)/Λ in (Z, R) eq . We will show that under a suitable stability assumption on the Z-sort any group interpretable in (Z, R) is an extension of a group interpretable in R by a group interpretable in Z. Let us recall that in a stable theory the SU-rank coincides the U -rank or "Lascar rank" [15,9]. Our main result is: Theorem (See 7.1). Let Z be a superstable structure of finite SU-rank and assume that the SU-rank is definable. Let R be an arbitrary structure. Given a group (G, ·) Note that in any superstable structure Z of SU-rank 1 (for instance (C, +, ·) or (Z, +), or (R, +)), the SU-rank is definable (see [13]), and therefore Z satisfies the assumption of the theorem.
The subgroup Γ will in general depend on how G sits in the ambient space (Z, R) eq and not only on the definable isomorphism type of G. In particular Γ is neither the minimal nor the maximal Z-internal normal subgroup such that G/Γ is R-internal. For instance if G is the universal cover of the circle group R / Z, then G can be naturally interpreted in ((Z, +), R) by [8], but it has no minimal or maximal Z-internal normal subgroup. In this example Γ is Z-internal if and only if 2Γ is such, and G/Γ is R-internal if and only if G/2Γ is such, so there is no reason to prefer Γ over 2Γ.
The subgroup Γ is easier to describe if G is definable in (Z, R) rather than (Z, R) eq . In this case we have G ⊆ Z m × R n for some m, n ∈ N and we can consider the projection π R : Z m × R n → R n . We then define: where g y = ygy −1 and (Most y)φ(y) means that the projection on Z m of the set of y ∈ G such that φ(y) fails has lower SU-rank than the projection of the whole of G.
The definition of Γ when G is definable in (Z, R) eq is similar, but we need to redefine π R to give meaning to the formula. To do this we will first show that there is a finite-to-one function f from (Z, R) eq to Z eq × R eq (uniform in each sort). Composing with the projection from Z eq × R eq to R eq we obtain the desired substitute for π R and the same definition of Γ will then work.
In §9 we prove: Theorem (See 9.7). If Z is an arbitrary structure and R is o-minimal, then every group G definable in (Z, R) admits a unique "t-topology" in analogy with the ominimal case (treated in [12]).
In particular, if R is based on the reals, then G has a natural Lie group structure. Combining Theorem 9.7 and Theorem 7.1 we then obtain: Corollary (See 9.14). If R is o-minimal and Z is superstable of finite Lascar rank, any group definable in (Z, R) is a cover of a group definable in R.
Here by "cover" we mean a definable morphism which is continuous and open in the t-topology and has a discrete kernel. Note that there are extensions of groups definable in R = (R, +, ·) by (Z, +) that are not covers (see [3,Theorem 3.12]). Among all the extensions, only the covers will be definable in ((Z, +), R) eq . The following example may be instructive: The paper is organized as follows. In §2 we recall some model-theoretic definitions that are needed in the paper: fully orthogonal sets, internal sets, codes and imaginaries. Then we analyze the bearing of these notions for definable sets in (Z, R) eq . In §3 we define a finite-to-one map from (Z, R) eq to Z eq × R eq and establish its properties. In §4 we assume that Z is superstable of finite SU-rank and we define the dimension of a type in (Z, R) eq as the SU-rank of its projection to Z eq (using the projections studied in §3). From the existence of non-forking extensions in Z eq we derive a similar results for (Z, R) eq (Proposition 4.4). We will sometime consider types over "unbounded" sets of parameters, namely sets of parameters whose size depends on the model. In particular in Corollary 4.5 we have a set of parameters including the whole of R and we are nevertheless able to find a suitable realization of the type (this will play a crucial role in the proof of the main theorem). In §5 we define the dimension of definable sets in (Z, R) eq as the maximal dimension of the types of its elements. We can equivalently define the dimension of a definable set in (Z, R) eq as the SU-rank of its "projection" to Z eq . However in order to prove the invariance of the dimension under definable bijections it is more convenient to use the approach via types (since projections do not commute with bijections). In most of the lemmas we do not really need the stability assumption but only the additivity of the SU-rank (which holds also in supersimple theories of finite SU-rank). However superstability is used in Proposition 5.2 and to prove the density property in Theorem 5.4. In §6 we introduce the quantifier "for most x" based on the dimension on (Z, R) eq . This gives us a convenient notation to define the subgroup Γ whose existence is asserted in the main theorem. It is important to assume that in Z the SU-rank is definable in order to ensure that the quantifier "for most x" is a definable operation. Finally in §7 we prove the main theorem, in §8 we derive some consequences, and in §9 we consider the case when R is o-minimal.
Acknowledgements. The results of this paper were obtained through a long chain of successive generalizations in the course of which the hypothesis were progressively weakened. Part of this process was stimulated by conversations with Anand Pillay on the occasion of the meetings "Model Theory in Algebra, Analysis and Arithmetic" (Cetraro, 2-6 July 2012) and "Model Theory: Groups, Geometry, and Combinatorics" (Oberwolfach 6-12 Jan. 2013). We also thank Ya'acov Peterzil for his suggestion to study the subgroup Γ · C G (Γ) (see Corollary 8.3). Preliminary versions of the results were presented at the "Konstanz-Naples Model Theory Days" (Konstanz 6-8 Dec. 2012) and at the Oberwolfach meeting.

Orthogonality and internal sets
Given a complete first order theory T we usually denote by C the monster model of T (see [15]). We can think of C as a proper class model which is κ-saturated for every cardinal κ. Every small (i.e. set-sized) models of T can be embedded in C as an elementary substructure, so we can assume that all the models that we are interested are elementary substructures of C.
Two definable subsets Z and R of C are fully orthogonal if every definable subset It can be shown that if Z and R are fully orthogonal, then so are Z m and R n , but to avoid the verification we can as well include this condition in the definition of full orthogonality.
A definable set X in C is stably embedded if every subset of X definable with parameters from C is definable with parameters from X. In this case we consider X as a structure on its own right with a symbol for each ∅-definable subset of X n for any n.
Given two definable sets X and V in C, X is said to be internal to V , or Vinternal, if X is in the definable closure of V and a finite set of parameters. Equivalently there is a definable surjection from V n to X for some n (see for instance [15,Lemma 10.1.4]). We recall that C has elimination of imaginaries if, by definition, every definable set X in C has a code, where a code for X is a finite tuple c of elements of C such that for every automorphism f of C we have that f fixes c if and only if f fixes X setwise. All the codes for the same set X are interdefinable and X is definable over any of its codes. We follow the common convention of denoting by X a code for X.
As usual C eq denotes the expansion of C with imaginary sorts: for each n ∈ N and each ∅-definable equivalence relation E on C n we have a sort S E interpreted as C n /E together with the natural projection π E : C n → C n /E. Given a ∈ C n the E-equivalence class of a can be seen in two ways: as a definable subset [a] E of C n , or as an element a/E of S E . The structure C eq has elimination of imaginaries. In particular the definable set [a] E can be coded by the element a/E ∈ S E .
The advantage of working in C eq is that quotients of definable sets by definable equivalence relations become definable. It follows in particular that a group is interpretable in C if and only if it is isomorphic to a group definable in C eq . Assumption 2.1. In the rest of the paper we assume that Z and R are stably embedded and fully orthogonal definable subsets of a monster model C. The subsets of Z m × R n definable in C are exactly (up to a natural identification) the definable sets in the two sorted structure (Z, R) (with no connections between the two sorts).
Unless otherwise stated in the sequel by "definable" we mean definable in (Z, R) eq (possibly with parameters from the monster model).
By symmetry all the results depending only on Assumption 2.1 hold with the roles of Z and R interchanged. This applies in particular to the following: Then {X t : t ∈ Z m } is finite. More generally the same holds for a definable family (X t ) t∈Y of subsets of an R-internal set X indexed by a Z-internal set Y (where X and Y are definable sets in (Z, R) eq ).
Proof. For the first part consider the definable set By full orthogonality we can write it as a finite union of definable sets of the form A × B with A ⊆ R n , B ⊆ Z m and the desired result follows at once. For the second part let f : R n → X and g : Z n → Y be definable surjective maps witnessing internality to the respective sorts. By the first part we obtain a map f from Z k to R k whose image is finite by Lemma 2.2. On the other hand the image of f coincides with the projection of X onto the R-coordinates.
Fix a bijection f from F to a finite subset of Z. Then f induces a bijection from X to a definable subset of Z m+1 .
(3) implies (1): Assume (3). Then clearly there is a definable surjective map from Z m+1 to X, so X is Z-internal.
Lemma 2.4. Let X be a definable set in (Z, R) eq which is both Z-internal and R-internal. Then X is finite.
Proof. By the hypothesis there are m, n ∈ N and definable surjective functions f : Z m → X and g : R n → X. For x ∈ Z m let H(x) = g −1 (f (x)) ⊆ R n . By Lemma 2.2 the family of sets {H(x) : x ∈ Z m } is finite. Since distinct elements of X have disjoint preimages through g, it follows that X is finite.
Let us recall that, given a set A of parameters in some structure, the definable closure dcl(A) is the set of points which are definable over A and the algebraic closure acl(A) is the set of points which belong to some finite set definable over A.

Clearly acl(A) ⊇ dcl(A).
Lemma 2.5. Let A be a set of parameters from (Z, R) eq . We have: In particular X is definable over (acl(A)∩Z eq )∪(acl(A)∩R eq ).
(2) Let a be an element of (Z, R) eq . Then a is definable over (acl(a) ∩ Z eq ) ∪ (acl(a) ∩ R eq ).
(3) Let X be a definable subset of some sort of Z eq and suppose that X is definable over A. Then X is definable over dcl(A) ∩ Z eq . (4) For every set of parameters A from (Z, R) eq we have acl(A ∪ R) ∩ Z eq = acl(A) ∩ Z eq .
(5) The type of an element of Z eq over A ∪ R, is implied by its type over Note that in (5) and (6) a type over the big set of parameters R = R(C) is implied by a type over a small set of parameters.
Proof. (1) By considering the sections X r = {x ∈ Z n : (x, r) ∈ X} with r ∈ R m we obtain a finite boolean algebra of definable subsets of Z n . The atoms of this boolean algebra are permuted by any automorphism of the monster model fixing X setwise, so they can be coded by elements in acl(A) ∩ Z eq (the codes can be taken in Z eq by stable embeddedness). It follows that each set in the boolean algebra is definable over acl(A) ∩ Z eq . Similarly, considering the sections over Z n , we obtain a finite boolean algebra of subsets of R m . If U ⊆ Z m and V ⊆ R n are atoms of the respective boolean algebras, then U is definable over acl(A) ∩ Z eq , V is definable over acl(A) ∩ R eq and U × V is either contained or disjoint from X. The desired result follows.
(2) Let X ⊆ Z m × R n be the equivalence class corresponding to a ∈ (Z, R) eq and apply (1).
(3) By stable embeddedness X is definable with parameters from Z eq so it has a code X in Z eq . On the other hand since X is definable over A, we have (4) Without loss of generality we can assume A = ∅. Let b ∈ acl(R) ∩ Z eq . Then there is a tuple r from R and an algebraic formula φ(x, r) such that φ(b, r) holds. Let N ∈ N be the cardinality of X r = {x : φ(x, r)}. We can assume that for all tuples r from R of the same length as r, the set X r = {x : φ(x, r )} has cardinality at most N . Each X r is a subset of a given sort of Z eq (the sort of b), and the family of these sets is indexed by R k for some k (the length of the tuple r). By Lemma 2.2 it follows that the family of sets {X r } r ∈R k is finite, and since each of them is finite, the union r X r is finite. Now it suffices to observe that this union is ∅-definable and contains b.
(6) It suffices to prove the case A = ∅. Let φ(x, r) ∈ tp(b/R) where r is a tuple from R, say r ∈ R k . So r ∈ Y := {y ∈ R k : φ(b, y)}. By stable embeddedness Y can be defined with parameters from R, so it has a code Y in R eq . On the other hand we must also have Y ∈ dcl(b), so φ(b, y) is equivalent to a formula ψ(y) definable over dcl(b) ∩ R eq . To conclude it suffices to observe that the formula ∀y(ψ(y) → φ(x, y)) belongs to tp(b/ dcl(b) ∩ R eq ) and implies φ(x, r) (take y = r).

Imaginaries
In this section we define a finite-to-one function from (Z, R) eq to Z eq × R eq and study its properties.
Lemma 3.1. Given a definable family (X t ) t∈Y of definable susets of Z m indexed by a definable set Y in (Z, R) eq , there is a uniform family ( X t ) t∈Y of codes in the following sense: (1) For each t ∈ Y the set X t ⊆ Z m is coded by X t ∈ Z eq and the function t → X t from Y to the appropriate sort of Z eq is definable.
Proof. Given t ∈ Y , by stable embeddedness there is a formula ϕ(−, b) with parameters b from Z which defines X t (where "−" is the free variable of the formula). By compactness there is a finite collection of formulas φ 1 , . . . , φ k such that for every ) and i is minimal such that there exists such a tuple b. Identifying the indexes 1, . . . , k with tuples from Z we can consider f (t) as an element of the appropriate sort of Z eq and define X t = f (t).
where a → a Z is given by Definition 3.2. Then X Z is a definable subset of some sort of Z eq and by stable embeddedness it is definable in Z eq . Similarly we define Lemma 3.4. Let X be a definable set in (Z, R) eq . Then X is R-internal if and only if X Z is finite. Similary X is Z-internal if and only if X R is finite.
Proof. Let X ⊆ S E = (Z m × R n )/E and suppose that X Z is finite. Unraveling the definitions this means that {π Z (π E (x)) −1 : x ∈ X} is a finite family of non-empty subsets of Z m . So there is a finite subset b of Z m which meets all these sets. Thus X ⊆ π E (b × R n ) ⊆ dcl(bR) and X is R-internal.
Conversely suppose that X is R-internal. Then {π Z (π E (x)) −1 : x ∈ X} is a family of subsets of Z m indexed by an R-internal set, so it must be finite by Lemma 2.2.
Lemma 3.5. Let a ∈ (Z, R) eq . Then a is algebraic over (a Z , a R ) ∈ Z eq × R eq . Proof. By Lemma 3.4 the set {x | x Z = a Z } ∩ {x | x R = a R } is internal to both Z and R, and therefore it is finite by Lemma 2.4 . Since a belongs to this finite set, the Lemma is established. Definition 3.6. Given a ∈ (Z, R) eq define a Z = acl(a)∩Z eq . More generally, given a set A of parameters from (Z, R) eq , define A Z = acl(A) ∩ Z eq . Similarly define a R and A R .
(2) a is definable over a Z ∪ a R .
Proof. By Lemma 3.5 we have acl(a) = acl(a Z a R ), and by Lemma 2.5(4) the element a R ∈ R eq does not contribute to the algebraic closure in Z eq , so the first part is established. The second part is Lemma 2.5(2) in the new notation.

dimension of types
In the sequel we assume that the theory of Z is superstable of finite SU-rank and that the SU-rank is definable. In Z we have a good notion of dimension given by the SU-rank, and we want to define a dimension on (Z, R) eq . We recall the following: (1) (Additivity) For every a, b ∈ M eq and every set A of parameters from M eq we have SU(ab/A) = SU(a/A) + SU(b/aA). (2) (Definability) If M has SU-rank 1, then the SU-rank is definable, namely for every definable family (X t ) t∈Y of sets in M eq and every k ∈ N, the set {t ∈ Y : dim(X t ) = k} is definable.
where A Z = acl(A) ∩ Z eq (Definition 3.6) and a Z is as in Definition 3.2.
Lemma 4.3. Work in (Z, R) eq . We have: Part (2) follows from the additivity formula for the SU-rank in Z eq , observing that aA Z = acl(a Z A Z ), where the algebraic closure is inside Z eq .
For (3) it suffices to observe that Ar Z = A Z .
Proposition 4.4. Let a be an element of (Z, R) eq and A ⊆ B be sets of parameters in (Z, R) eq . Then there is b ∈ (Z, R) eq such that dim(b/B) = dim(a/A) and tp(b/A) = tp(a/A).
Proof. By Lemma 3.5 there is an algebraic formula φ(x, a Z , a R ) (possibly with additional parameters from A) which isolates the type of a over a Z a R A. In particular for each ψ(x) ∈ tp(a/A) we have: Let e ∈ Z eq be a realization of a non-forking extension of tp(a Z /A Z ) to B Z . This means that tp(e/A Z ) = tp(a Z /A Z ) and SU(e/B Z ) = SU(e/A Z ). By Lemma 2.5 (4) we have tp(e/A ∪ R) = tp(a Z /A ∪ R). It follows that we can replace a Z with e in ( †) and obtain |= ∀x(φ(x, e, a R ) → ψ(x)). We have thus proved that φ(x, e, a R ) isolates tp(a/A). Moreover φ(x, e, a R ) is an algebraic consistent formula, since this fact is a property in the type of e inherited from a Z . Choose b ∈ (Z, R) eq such that φ(b, e, a R ) holds. We can assume that φ(x, u, v) implies u = x Z and v = x R , since otherwise we can add these conditions to the formula (using the fact that x → x Z and x → x R are definable functions). Note that in the above Lemma the sets of parameters A and B must be small (with respect to the monster model C), so we cannot take B = Z say. We can nevertheless obtain the following corollary, where Z 0 ≺ Z is a small model, but R = R(C) is interpreted in the monster model. Corollary 4.5. Let a be an element of (Z, R) eq . Then there is b ∈ (Z, R) eq such that dim(b/a) = dim(a) and tp(b/ acl(Z 0 ∪ R)) = tp(a/ acl(Z 0 ∪ R)).
The idea is to use the fact that the type of a over the big set of parameters R is implied by the type of a over the small set a R ⊂ R eq . The details are as follows.
Proof. By Observation 3.7 we have a R = acl(a) ∩ R eq = acl(a R ) ∩ R eq . By Lemma 4.4 (with A = a R and B = a R ∪ a) there is some b with tp(b/a R ) = tp(a/a R ) and dim(b/a R ∪ a) = dim(a/a R ). By Lemma 4.3 the parameters from R eq do not contribute to the dimension, namely dim(a/a R ) = dim(a) and dim(b/a R ∪ a) = dim(b/a). It remains to show that tp(b/ acl(Z 0 ∪ R)) = tp(a/ acl(Z 0 ∪ R)). We can assume that the parameters from Z 0 are named by constants in the language, so we only need to prove worry about R. So assume φ(x, r) ∈ tp(a/R), where r ∈ R eq , and let us prove that φ(x, r) ∈ tp(b/R). By Lemma 2.5(6) there is a formula ψ(x) ∈ tp(a/a R ) which implies φ(x, r). Since tp(b/a R ) = tp(a/a R ) we deduce that φ(b, r) holds. The case when X is included in one of the imaginary sorts M n /E is easily deduced from the real case assuming the definability of the SU-rank. To see this, let D i ⊆ M n be the union of all the E-equivalence classes of SU-rank i. By definability of the SU-rank, the set D i is definable and SU(X) = max i SU(X ∩ π E (D i )). So we can reduce to the case when all the E-equivalence classes have the same SU-rank. Next observe that if all the equivalence classes have SU-rank i, then by additivity of the SU-rank we have dim(X) = dim(π −1 E (X)) − i and similarly for Y . By the real case we deduce that π −1 E (Y ) intersects acl(M 0 ) eq , hence so does Y . Remark 5.3. Reasoning as in the last part of the proof, the definability of the SUrank for definable families in the imaginary sorts of M eq follows (using additivity) from the definability of the SU-rank for definable families in the home sorts M n . Theorem 5.4. Assume that the theory of Z is superstable of finite SU-rank that that the SU-rank is definable. Put in (Z, R) eq the dimension function of Definition 5.1. We have:

Dimension of definable sets
(1) (Additivity) Given a definable surjective function f : X → Y with fibers of constant dimension k, we have dim(X) = dim(Y ) + k.
(4) (Dimension zero) dim(X) = 0 if and only if X is R-internal. (5) (Density) If X is ∅-definable and Y ⊆ X is a definable subset of the same dimension, then for every Z 0 ≺ Z the intersection of acl(Z 0 ∪ R) eq with Y is non-empty. (6) (Definability) Given d ∈ N and a definable family Similarly, starting an element a ∈ X with dim(a) = X and letting b = f (a) we obtain the opposite inequality.
(3) This follows from the additivity property applied to the definable function x → x Z after observing that for each a ∈ X Z the fiber {x ∈ X : x Z = a} is R-internal by Lemma 3.4, and therefore it has dimension zero by the easy part of (4).
(4) Assume dim(X) = 0. Then SU(X Z ) = 0. So X Z is finite and by Lemma 3.4 X is R-internal. The converse is clear. (5) The corresponding property for the SU-rank in Z eq is given by Lemma 5.2. Thanks to (3) we can reduce to the Z eq -case replacing X with X Z and Y with Y Z . Indeed we only need to observe that if Y Z meets acl(Z 0 ∪ R) then so does Y (because y ∈ acl(y Z , y R ) by Lemma 3.5).
(6) Given a definable family (X t : t ∈ Y ) in (Z, R) eq we have dim(X t ) = SU(X t Z ), so we need to prove that SU(X t Z ) = d is a definable condition on t. Since X t Z is definable in Z eq this is almost given by our assumptions on Z. The only problem is that the parameter t does not range in Z but in a sort of (Z, R) eq . However, by stable embeddedness, the set (X t ) Z can be defined by a formula φ(x, b) with parameters b from Z. Moreover by a compactness argument there is a single formula φ(x, y) and a definable function t → b t ∈ Z m (for some m ∈ N) such that for each t ∈ Y the set X t Z is defined by φ(x, b t ). This reduces the definability of dim in (Z, R) eq to the definability of SU in Z eq . 6. The quantifier (Most x ∈ X) Definition 6.1. Given a definable set X in (Z, R) eq and a formula φ(x) we define: From Theorem 5.4 we immediately deduce the following: (2) If f : X → X is a definable bijection, then |= (Most x ∈ X)φ(x) ⇐⇒ (Most x ∈ X)φ(f (x)).
(4) Let φ(x) be a formula, possibly with parameters, and let X be ∅-definable in (Z, R) eq . Suppose that for all points a ∈ X algebraic over Z 0 ∪ R we have φ(a). Then |= (Most x ∈ X)φ(x).
Proof. We apply Theorem 5.4. Part (1) follows from the additivity of dimension. Part (2) from the monotonicity. Part (3) from the definability. Point (4) from the density property.

Main theorem
We are now ready to prove our main result.
Theorem 7.1. Let Z be a superstable structure of finite SU-rank and assume that the SU-rank is definable. Let R be an arbitrary structure. Given a group (G, ·) where g y = ygy −1 and (Most −) stands for (Most − ∈ G). To prove that Γ is a subgroup we use the invariance of the quantifier (Most −) under bijections and the fact that the quantifier distributes over conjunctions (Lemma 6.2). The details are as follows. Let a, b ∈ Γ. We need to show that ab ∈ Γ. We have: b ∈ Γ =⇒ (Most y)(Most x) R(xb y ) = R(x) =⇒ (Most y)(Most x) R(xa y b y ) = R(xa y ) since x → xa y is a bijection =⇒ (Most y)(Most x) R(x(ab) y ) = R(xa y ) On the other hand a ∈ Γ =⇒ (Most y)(Most x) R(xa y ) = R(x) .

So combining the two derivations we obtain
and similarly one obtains Let us now prove that a ∈ Γ implies a −1 ∈ Γ. (Here is where we need the fact that in the definition of Γ we have both xg y and g y x.) We have: where in the last implication we used the fact that x → x(a −1 ) y is a bijection. Similarly we obtain Together with the previous condition this yields a −1 ∈ Γ.
We have thus proved that Γ is a subgroup. Let us now check that Γ is normal in G. To this aim note that b ∈ Γ can be expressed in the form (Most y)Q(b y ) where Q is a suitable formula. If z ∈ G we want to show that b z ∈ Γ, namely (Most y)Q((b z ) y ) holds. This follows from the fact that (b z ) y = b (zy) and y → zy is a definable bijection on G.
We need to prove that Γ is Z-internal. Without loss of generality we can work in a ℵ 1 -saturated model. Suppose for a contradiction that Γ is not Z-internal. Then there is a countable infinite subset {g i : i ∈ ω} of Γ such that R(g i ) = R(g j ) for i = j (Lemma 3.4). By ℵ 1 -saturation and the definition of Γ, there are x, y ∈ G such that for every i ∈ ω we have R(xg y i ) = R(x). Fix such an x, y and let f : G → G be the definable bijection g → xg y . We then have R(f (g i )) = R(x) for all i ∈ ω, namely each g i belongs to the definable set S := {g ∈ G : R(f (g)) = R(x)}. This set is in definable bijection with S := {g ∈ G : R(g) = R(x)} so it is Z-internal by Lemma 3.4. On the other hand, still by Lemma 3.4, S cannot be Z-internal since it contains the infinite sequence {g i : i ∈ ω} and R(g i ) = R(g j ) for all i = j. This contradiction shows that Γ is Z-internal.
Indeed if R(a y x) = R(b y x), then taking r ∈ R in the symmetric difference of R(a y x) and R(b y x), we obtain a formula with parameters in r, x, y which distinguishes the types of a and b.
By Lemma 6.2 this implies Hence, by the definable bijection x → (b −1 ) y x we also get By the same method we obtain namely ab −1 ∈ Γ.

Corollaries
In this section we study the subgroup Γ·C G (Γ) of G and we show that it coincides with G if G is connected (i.e. it has no definable subgroups of finite index). We need the following.
Lemma 8.1. Let f : X → Y be a definable surjective function in (Z, R) eq and suppose that Y is R-internal. Then there is an R-internal definable subset U of X such that f |U : U → Y is surjective.
Proof. We can assume that X ⊆ Z m × R n (if X is a subset of some imaginary sort (Z m × R n )/E we reduce to this case by considering f • π E : Z m × R n → Y ). For t ∈ Z m , let X t denote X ∩ {t} × R n . Then X t is R-internal and by Remark 2.2 the set {f (X t ) : t ∈ Z m } is finite. It follows that there is a finite subset Γ of Z m such that t∈Γ f (X t ) = t∈Z m f (X t ) = Y . So we can take U = t∈Γ X t .
be an exact sequence of definable group homomorphisms in (Z, R) eq and assume that A and C are R-internal. Then B is R-internal.
Proof. By Lemma 8.1 there is an R-internal subset U of B such that f |U : U → C is surjective. Thus B = U · ker(f ). Since U and ker(f ) are R-internal, it follows that B is R-internal.
We can now obtain the following corollary from the main theorem.
(3) If G has no non-trivial Z-internal quotients (this may be regarded as a notion of connectedness), then Γ is included in the center of G. (4) G/Z(Γ) is a direct product of an R-internal and a Z-internal subgroup.
Proof. (1) Consider the action of G on Γ by conjugation. This gives a morphism from G to Aut(Γ) whose kernel is C G (Γ). Thus G/C G (Γ) can be identified with a definable family of automorphisms of Γ, and since Γ is Z-internal it easily follows that G/C G (Γ) is Z-internal.
(2) The group G Γ·C G (Γ) is both Z-internal and R-internal (being a quotient of both G/Γ and G/C G (Γ)), so it must be finite.
(3) If G has no non-trivial Z-internal quotients, then G/C G (Γ) must be trivial (by (1)), so Γ is in the center of G.

O-minimal case
In this section we show (Theorem 9.7) that if R is an o-minimal structure and Z is arbitrary, then every group G definable in (Z, R) admits a unique "t-topology" in analogy with the o-minimal case [12]. In particular, if R is based on the reals, then G has a natural structure of a real Lie group. Moreover any Z-internal subset of G is discrete in the t-topology. If we additionally assume that Z is superstable of finite Lascar rank we can then apply Theorem 7.1 to show that any group G definable in (Z, R) is a cover of a group definable in R (Corollary 9.14). Here by "cover" we mean a definable morphism which is also a local homeomorphism in the t-topologies (we do not require G to be connected).
In §5 we defined a dimension on (Z, R) eq based on the projection on the Zcoordinates and using the SU-rank on Z. In this section we introduce another dimension based on the o-minimal dimension on R. Throughout the section, with the exception of Corollary 9.14, R is o-minimal and Z is arbitrary.
Definition 9.1. Given a definable set X ⊆ Z m × R n , we define dim R (X) as the o-minimal dimension of the projection of X to R n . For X definable in (Z, R) eq we define dim R (X) as the o-minimal dimension of X R , where X R is as in Definition 3.3.
Proposition 9.2. Work in (Z, R) eq , where R is o-minimal. We have: (1) (Additivity) Given a definable surjective function f : X → Y with fibers of constant R-dimension k, we have dim R (X) = dim R (Y ) + k.
Proof. This is similar, mutatis mutandis, to the proof of the corresponding points in Theorem 5.4, but with the roles of Z and R exchanged. Indeed the relevant points of Theorem 5.4 (namely everything with the exception of the "Density" property) do not use the stability assumption, but only the fact that we have a good notion of dimension on the relevant sort. So we can carry out exactly the same arguments with the o-minimal dimension instead of the SU -rank.
Definition 9.3. Given a definable set X and a definable subset Y ⊆ X, we say intersects every R-internal subset of X of maximal dimension into a large set. We say that a point a ∈ X is R-generic over a set of parameters A if a belongs to every R-large subset of X defined over A.
, then X is generic, namely finitely many translates of X cover G.
Proof. Choose a small model M 0 over which G is defined. It suffices to prove that G = G(M 0 ) · X. By orthogonality G has an R-internal definable subset Y of maximal R-dimension which is defined over M 0 (one of the sections over the Z-coordinates). Now if U is R-large in G, then U ∩ Y is large in Y , and since Y is R-internal, it contains a tuple from M 0 . We have thus proved that every R-large subset of G contains a point from M 0 . To finish the proof, let X ⊆ G be R-large and let us show that G = G(M 0 ) · X. To this aim let g ∈ G. Then g · X −1 is R-large in G by the invariance of dim R under definable bijections (which follows from Proposition 9.2), hence it has a point γ from M 0 . It follows that g ∈ γ · X ⊆ G(M 0 ) · X and since g ∈ G was arbitrary we obtain G = G(M 0 ) · X.
Definition 9.5. Let R be o-minimal. We put on R the topology generated by the open intervals, and on Z the discrete topology. Given a subset X ⊆ Z m × R n , we define the ambient topology on X as the topology it inherits from Z m × R n , where the cartesian powers have the product topology.
When X is a definable group, in addition to the ambient topology, we will introduce also a group topology on X, called the t-topology, which will be defined by a suitable modification of the construction in [12]. See also [10,16,7] for similar results. Our proof is self contained. Lemma 9.6. Let X and Y be definable sets in the two-sorted structure (Z, R). Let f : X → Y be a definable function. Then the set of continuity points of f , with respect to the ambient topology, is R-large in X.
Proof. The result is well known in the o-minimal case and since the notion of Rlargeness refers to the R-internal sets we can readily reduce to that case.
Theorem 9.7. Let G be a definable group in (Z, R), with R o-minimal and Z arbitrary. Then G has a unique group topology, called the t-topology, which coincides with the ambient topology on an R-large open subset V of G.
Proof. By Lemma 9.6 there is an R-large subset Y of G × G × G such that the function α : (x, y, z) → xyz from G × G × G to G is continuous on Y (with respect to the ambient topology). Replacing Y with its interior we can assume that Y is open in G × G × G (still with respect to the ambient topology). Note that if (x, y, z) ∈ G × G × G is generic, then it belongs to Y . Let V 0 be the set of all x ∈ G such that for all (g 1 , g 2 ) ∈ G × G which are R-generic over x both (g 1 , x, g 2 ) and (g 1 , g −1 1 xg −1 2 , g 2 ) belong to Y . By the definability of dimension V 0 is definable. Moreover V 0 contains all R-generic elements, so it is R-large in G. Let V be the interior of V 0 in G. Then V is definable, R-large, and open in G. Proof. Let z ∈ Z. We will show that there is an open neighbourhood of z contained in Z and f is continuous at z. Pick (a 1 , b 1 ) ∈ G × G generic over a, b, z.
Write a −1 = a 2 a 1 and b −1 = b 1 b 2 . We write f as the composition of x g → a 1 xb 1 h → a −1 xb −1 where h : ζ → a 2 ζb 2 . Consider the following subsets of Z claim Now we prove that the group operation is t-continuous. The group translations are clearly t-continuous. Since V is R-large, there are a, b, c ∈ V such that ab = c. By Lemma 9.6 the group operation µ is continuous at (a, b) with respect to the ambient topology, hence also t-continuous (since the two topologies coincide on V ). To prove t-continuity at another point (x, y) ∈ G × G, we go from (x, y) to (a, b) by the t-continuous map (ax −1 (·), (·)y −1 b), then from (a, b) to ab by µ, and finally from ab to xy via xa −1 (·)b −1 y. Finally we show that the group inverse x → x −1 is t-continuous. Consider an R-generic point a ∈ G. Then a −1 is also R-generic, so both a and a −1 belong to V . By Lemma 9.6 the group inverse is continuous at a, hence t-continuous. To prove continuity at another point b ∈ G, note that x → (xb −1 a) −1 is t-continuous at b and x −1 = b −1 a(xb −1 a) −1 is obtained by composing with a group translation.
We have thus proved the existence of a group topology which coincides with the ambient topology on an R-large open subsets. Granted the existence, the uniqueness is clear.
In analogy with the o-minimal case we have: Proposition 9.8. Let G be a definable group in (Z, R) with R o-minimal. Every definable subgroup H of G is closed in the t-topology.
Proof. First note that the t-closure of a definable subset of G is definable. Indeed the closure of a definable set in the ambient space is definable and we can reduce to this case working in an R-large subset V of G where the two topologies coincide. So, replacing H with its closure, it suffices to show that a dense subgroup H of G coincides with G. So assume that H is dense. By o-minimality of R, a dense subset of V has interior. It follows that H has interior and therefore it is t-open in G. Being also a dense subgroup, it coincides with G.
We next show that the t-topology of a quotient coincides with the quotient topology. Proof. Let G(f ) be the graph of f . Then X is definably homeomorphic to G(f ). Replacing X with G(f ) we can assume that f is a projection on some coordinates. So we must prove that if Z is a definable subset of X × Y and π : Z → X is the projection on X, then there is an open subset U of Z such that f |U : U → X is an open map. To this aim take a cell decomposition of Z such that the projections of the cells of Z give a cell decomposition of X. Let C be a cell of maximal dimension of X. We can now introduce a notion of connectedness for definable groups in (Z, R). This motivates the parenthetical remark in Corollary 8.3(3).
Definition 9.11. Let G be a definable group in (Z, R). We say that G is t-connected if G satisfies one of the equivalent conditions of Proposition 9.12 below.
Proposition 9.12. Let G be a definable group in (Z, R), with R o-minimal. The following are equivalent: (1) G has no proper clopen definable subsets in the t-topology.
(2) G has no proper open definable subgroups in the t-topology.
(3) G has no definable subgroups H such that G/H is Z-internal.