BOHR COMPACTIFICATIONS OF GROUPS AND RINGS

Abstract We introduce and study model-theoretic connected components of rings as an analogue of model-theoretic connected components of definable groups. We develop their basic theory and use them to describe both the definable and classical Bohr compactifications of rings. We then use model-theoretic connected components to explicitly calculate Bohr compactifications of some classical matrix groups, such as the discrete Heisenberg group 
${\mathrm {UT}}_3({\mathbb {Z}})$
 , the continuous Heisenberg group 
${\mathrm {UT}}_3({\mathbb {R}})$
 , and, more generally, groups of upper unitriangular and invertible upper triangular matrices over unital rings.


Introduction
The motivation for this research was the study of the model-theoretic connected components of some matrix groups over unital rings in order to describe the classical Bohr compactifications of these matrix groups through the use of model theory.
Bohr compactifications of topological groups play an important role in topological dynamics and harmonic analysis, and they have some applications to differential equations.They allow to reduce many problems in the theory of almost periodic functions on topological groups to the corresponding problems about functions on compact groups.For example, see [Pan90,Pan96].
The model-theoretic connected components of a definable group G (see Section 1 for definitions) are among the fundamental objects used to study G as a first-order structure.They are of particular significance in definable topological dynamics, a generalization of classical topological dynamics.In [GPP14,KP17], the authors introduce and study the notion of the definable Bohr compactification of a group G definable in a first-order structure.This compactification is described in terms of one of the model-theoretic connected components of G.The classical Bohr compactification of a discrete group G is a special case, and arises when G is considered with the full set-theoretic structure (i.e. when every subset of G is 0-definable).Also, the classical Bohr compactification of a topological group was described in [GPP14,KP19] in terms of a suitably defined model-theoretic connected component.
The calculation of model-theoretic connected components of matrix groups over a unital ring naturally led us to the development of the analogous notions of (model-theoretic) connected components of rings.These components were not studied so far and are interesting in their own right.In this paper, our first objective is to give precise definitions of various components of a ring (see Definition 2.1 and the discussion following it), and prove some fundamental results about them such as Proposition 2.5, Proposition 2.6, or Corollary 2.7.In particular, we show in Proposition 2.6 that, as opposed to the group case, the appropriately defined 0-and 00-connected components of a unital ring always coincide.We also relate these components to the model-theoretic connected components of the additive group of the ring (see Corollaries 2.17, 2.22, the examples in Subsection 2.3, and Proposition 2.26).In Subsection 2.4, we observe that ring components can be used to describe the [definable] Bohr compactification of a discrete ring.In Subsection 2.5, we introduce a notion of a model-theoretic component for a topological ring and use it to describe the Bohr compactification of such a ring.Besides elementary algebraic and model-theoretic tools, also certain consequences of Pontryagin duality are involved in some arguments in the above part.All the facts around Pontryagin duality which we need in this paper are discussed in the preliminaries.
Our original objective was to use model-theoretic connected components to explicitly compute both the definable and classical Bohr compactifications of some matrix groups.We focus on the groups UT n pRq and T n pRq, where R is a unital ring.We obtain a general description of the Bohr compactifications of these groups (see Propositions 3.2 and 3.4).In the case of some classical rings, e.g. when R is a field, or the ring of integers, or the ring of polynomials in several variables over an infinite field, we get more precise descriptions, which in particular applies to the discrete Heisenberg group UT 3 pZq (see general Corollary 3.5 and its applications in Subsection 3.4).We also adapt our approach to the groups UT n pRq and T n pRq treated as topological groups (for R being a topological ring), obtaining descriptions of their classical Bohr compactifications, which in particular applies to the continuous Heisenberg group UT 3 pRq (see Propositions 3.25, 3.27, and Example 3.28).
Our method of computing classical Bohr compactifications of the above matrix groups via model-theoretic connected components is novel, and, up to our knowledge, the descriptions of the Bohr compactifications which we obtained have not been known so far.
As an example, let us state here our descriptions of the classical Bohr compactifications of both the discrete and continuous Heisenberg group.
The Bohr compactification of the discrete Heisenberg group UT 3 pZq is -, where Z Bohr is the Bohr compactification of the discrete group pZ, `q, Ẑ is the profinite completion of Z, and the product of two matrices from this set is defined as follows: ¨1 a b where π : Z Bohr Ñ Ẑ is a unique continuous group epimorphism compatible with the maps from Z, provided by universality of Z Bohr .More precisely, the Bohr compactification of UT 3 pZq is the homomorphism from UT 3 pZq to the above group of matrices which is defined coordinatewise by the natural maps Z Ñ Z Bohr and Z Ñ Ẑ.
The Bohr compactification of the topological group UT 3 pRq is ¨1 R Bohr 0 0 1 R Bohr 0 0 1 --R Bohr ˆRBohr , where R Bohr is the Bohr compactification of the topological group pR, `q.More precisely, the Bohr compactification of the topological group UT 3 pRq is the continuous homomorphism from UT 3 pRq to R Bohr ˆRBohr defined coordinatewise by the (Bohr compactification) map R Ñ R Bohr .

Preliminaries
In this paper, we use standard model-theoretic notations.We consider groups and rings as objects definable in some first-order structure M , and often assume the groups and rings themselves to be first-order structures in some language L expanding the language of groups and rings, respectively.We always consider a structure M together with a fixed κ-saturated and strongly κ-homogeneous elementary extension M ą M , where κ ą |M | `|L| is a strong limit cardinal.For a definable set X Ď M , we denote by X its interpretation in M .We call a set A Ď M small if |A| ă κ.If pG, ¨, . ..q is a definable group, we say that a subgroup H ď Ḡ has bounded index if | Ḡ{H| ă κ.For rings, by the index of a subring we mean its index as a subgroup of the additive group of the ring.
Groups and rings will be often equipped with topology compatible with their operations.We make a blanket assumption that all topological groups, topological rings, and topological spaces in general that we consider in this paper are always Hausdorff (unless stated otherwise).We note however that most of the presented theory can be repeated, possibly with minor modifications, by requiring only compact spaces to be Hausdorff.
We will say that M is equipped with the full (set-theoretic) structure if all subsets of M n , n P N, are 0-definable.The language of such a structure will be denoted by L set,M .
If G is a definable group in M , and A Ă M a small set, recall the following well-known subgroups of Ḡ, so-called model-theoretic connected components: ‚ Ḡ0 A , the intersection of all A-definable subgroups of Ḡ with finite index, ‚ Ḡ00 A , the smallest A-type-definable subgroup of Ḡ with bounded index, ‚ Ḡ000 A , the smallest A-invariant subgroup of Ḡ with bounded index.We refer to [Gis11,BCG13] for the properties of the connected components which we are going to use and explain below.Clearly Ḡ000 A ď Ḡ00 A ď Ḡ0 A .Sometimes (e.g. in theories with NIP), the group Ḡ0 A does not depend on the choice of A, in which case we say that Ḡ0 " Ḡ0 H exists, and similarly for the other components.Each component is a normal subgroup of Ḡ.

The quotients Ḡ{ Ḡ000
A , Ḡ{ Ḡ00 A , Ḡ{ Ḡ0 A can be equipped with the logic topology (where a set is closed if and only if its preimage under the quotient map is type-definable over a small set of parameters), making them respectively a quasi-compact (i.e.not necessarily Hausdorff), a compact, and a profinite topological group.The same holds for the quotient of Ḡ by any normal subgroup of bounded index which is A-invariant, A-type-definable, or an intersection of some A-definable subgroups of Ḡ, respectively.
Let G be a topological group.A compactification of G is a compact topological group K together with a continuous homomorphism φ : G Ñ K with dense image.The Bohr compactification of G is a compactification φ : G Ñ K satisfying the following universal property: if φ 1 : G Ñ K 1 is a compactification of G, then φ 1 " f ˝φ for a unique continuous homomorphism f : K Ñ K 1 .The Bohr compactification of G always exists and is unique up to isomorphism.We will denote this object by G Bohr .It is a classical notion in topological dynamics and harmonic analysis.It can be naturally extended to the category of topological rings, and other topological-algebraic objects, as done in [Hol64,HK99].
The work in [GPP14] and [KP17] developed a model-theoretic version of Bohr compactifications.Let us briefly explain this setting.Suppose X is a definable set and C a compact topological space.Recall that a function f : X Ñ C is said to be definable if for each pair of disjoint, closed subsets C 1 , C 2 Ď C, there are definable, disjoint subsets U 1 , U 2 Ď X such that f ´1rC i s Ď U i for i " 1, 2. For a definable group G, we call its compactification φ : G Ñ K definable if φ is definable.The results of [GPP14] show that a group G definable in a model M has the universal definable (called the definable Bohr ) compactification, which is just the quotient Ḡ{ Ḡ00 M or rather the quotient homomorphism G Ñ Ḡ{ Ḡ00 M ; we will denote it by G dBohr .In the full (set-theoretic) setting L set,M , G dBohr " G Bohr (for G treated as a discrete group), and the last result specializes to the following corollary.
M is the (classical) Bohr compactification of the discrete group G.In this way, definable compactifications can be viewed as a generalization of classical ones.If G is a locally compact abelian group, harmonic analysis provides a description of G Bohr in terms of Pontryagin duality.Recall that the group Hom c pG, S 1 q of all continuous homomorphisms from G into the circle group S 1 " R{Z " r´1 2 , 1 2 q can be endowed with the compact-open topology, making it a locally compact abelian group.This object is called the Pontryagin dual of G, which we denote by p G: p G " Hom c pG, S 1 q.
Fact 1.2 ([Kat04], Chapter VII, Section 5).Let G be a locally compact abelian topological group.Then its Bohr compactification where p G disc denotes p G considered with the discrete topology.Moreover, still assuming that G is a locally compact abelian group, the map b is injective, that is for every g P Gzteu, there is Recall that a profinite group is an inverse limit of finite groups.The next fact is [RZ10, Theorem 2.9.6](b).
Fact 1.4.The Pontryagin dual of a profinite abelian group is a discrete, torsion abelian group.Conversely, the Pontryagin dual of a discrete, torsion abelian group is a profinite abelian group.
From the last two facts, we get:

Corollary 1.5. A discrete abelian group G is torsion if and only if p
G is profinite.
We will need the following fact (e.g.see [Dik18,Theorem 3.3.14]) in our analysis of modeltheoretic connected components.We give a short proof based on Pontryagin duality.
Fact 1.6.A discrete abelian group G is of finite exponent if and only if G Bohr is profinite.
Proof.(Ñ) Assume that G is of finite exponent.Then p G is also of finite exponent (as if g n " e for all g P G, then f n pgq " f pgq n " f pg n q " 0 for any f P p G and g P G), so p G is a torsion abelian group.Therefore, by Fact 1.2 and Corollary 1.5, G Bohr -Hom ´p G disc , S 1 ¯is profinite.
(Ð) Assume that G Bohr is profinite.Then p G is torsion (again by Fact 1.2 and Corollary 1.5).Suppose for a contradiction that G is not of finite exponent.Then, by [BCG13, Lemma 4.9], there is a homomorphism from G to S 1 with dense image.Such a homomorphism is an element of p G of infinite order, a contradiction.
Remark.Alternatively, the implication (Ð) can be obtained using the Baire category theorem and Fact 1.3 in place of [BCG13, Lemma 4.9].First, observe that every torsion, compact abelian group K has finite exponent.Indeed, by the Baire category theorem, for some n P N ą0 the closed subgroup Krns :" tk : k n " eu of K is clopen and so of finite index; since K is torsion and abelian, this implies that K has finite exponent.Hence, since in our case K :" p G is torsion (by Fact 1.2 and Corollary 1.5) and compact (by [RZ10, Proposition 2.9.1(b)]), it has finite exponent.Therefore, since G -p p G, we conclude that G has finite exponent, too.A is profinite for any small set of parameters A Ă Ḡ. Proof.We may assume that A Ď G. Let Ḡ be a monster model for both the full language and original language.Then Ḡ{ Ḡ00 A is a topological quotient of Ḡ{ Ḡ00 H , where the former quotient is computed in the original language and the latter one in the full language.Since Ḡ{ Ḡ00 H is a profinite group, so is Ḡ{ Ḡ00 A .
Another important consequence of Pontryagin duality is the following fact (see [RZ10, Proposition 5.1.2]).Recall that under our assumptions, topological spaces are considered to be Hausdorff.

Fact 1.9. A topological, unital ring is profinite if and only if it is compact.
Throughout the rest of the paper, R " pR, `, ¨, 0, 1, . ..q is a (not necessarily commutative) unital ring, possibly with an additional structure, R ą R is a κ-saturated and strongly κhomogeneous elementary extension of R, and A Ă R a small set of parameters.More generally, one can consider a ring R which is 0-definable in a structure M .We assume that R is unital in order to proceed more smoothly in some proofs, apply Fact 1.9, or talk about the groups of invertible upper triangular matrices, but many definitions and observations work without this assumption, which will be mentioned in some places.However, an important consequence of Fact 1.9, namely the equality of the components in Proposition 2.6(iv), requires unitality (see the discussion after Question 2.8).
Whenever we consider an ideal I of a ring R, we will specify whether we mean a left, right, or two-sided ideal; except the cases where the (unital) ring R is commutative.The following inclusions are obvious: In fact, we prove in Proposition 2.6(i)-(iii) that the components of the top row of the diagram coincide with the respective components of the bottom row.That is, there is no need to distinguish between the ring components and ideal components, which justifies item (v) of Definition 2.1.We moreover prove in Proposition 2.6(iv) that the components R0 A,ring and R00 A,ring also coincide in any (unital) ring.This means that among the defined components there are only at most two distinct ones, and we leave as a question whether they coincide (see Question 2.8).We will keep distinguishing the components from the diagram until after Proposition 2.6 is proven.
The following example shows that (similarly to the group 00-component) the component R00 R,ideal can be thought of as a generalization of the kernel of the standard part map in the sense that it coincides with this kernel in a certain class of compact rings.
Example 2.2.If R is a compact topological ring with a basis of neighborhoods of 0 consisting of definable sets, and all definable subsets of R have the Baire property, then R00 R,ideal " kerpstq, where st : R Ñ R is the "standard part" map, and R{ R00 R,ideal -R.In particular, this applies to the ring Z p of p-adic integers in the (pure) language of rings.
Proof.Let µ be the two-sided ideal of R consisting of the infinitesimals, that is the intersection of the Ū 's with U ranging over all definable neighborhoods of 0. It is well-known that compactness of R yields a well-defined group (in fact, also ring) homomorphism st : R Ñ R defined by stprq :" r 1 for a unique r 1 P R with r ´r1 P µ; moreover, kerpstq " µ and R{ kerpstq -R which is of bounded size.Therefore, R00 R,ideal Ď kerpstq.It remains to show that kerpstq Ď R00 R,ring .Write R00 R,ring as the intersection of some R-definable sets Pi , i P I, such that for every i there is j with Pj ´P j Ď Pi .Then each P i (computed in R) is generic (that is some finitely many additive translates of P i cover R), and so, by compactness of R, each P i is non-meager.Since each P i has also the Baire property, we conclude from Pettis theorem (see [Kec95,Theorem 9.9]) that each P i ´Pi is a neighborhood of 0. By the choice of the P i 's, for every i there is j such that P j ´Pj Ď P i , so we conclude that each P i is a definable neighborhood of 0. Hence, kerpstq " µ Ď R00 R,ring .Thus, we get the induced (abstract) isomorphism from R{ R00 R,ideal to R. To see that it is a homeomorphism, it is enough to show that it is continuous (as both rings are compact).For this we need to check that st ´1rF s is type-definable for any closed subset F of R. Note that F " Ş rPRzF U c r for some choice of definable neighborhood U r of r (which exists by assumption).So it is enough to check that st ´1rF s " µ `ŞrPRzF Ū c r which is clearly type-definable, where Ūr is the interpretation of U r in R.This is left for the reader.
The fact that the assumptions are satisfied for the ring Z p follows from quantifier elimination in Q p in Macintyre's language and the definability of Z p in Q p (see [Bél12]).
Consider the action of the monoid p R, ¨q on R by left multiplication.For any r P R, the map f r : R Ñ R given by f r pxq :" r ¨x is an endomorphism of the additive group p R, `q.For X Ď R, define its setwise stabilizer as Stab RpX q :" r P R : r ¨X Ď X ( .
For any X, Write r 2 " r 1 `a for some a P Stab RpGq, and consider any r 1 P f ´1 r 1 rGs X G. Then r 1 r 1 P G and ar 1 P G, so r 2 r 1 " r 1 r 1 `ar 1 P G, and therefore r 1 P f ´1 r 2 rGs.This proves the claim.As f ´1 r rGs X G depends only on the Stab RpGq-coset of r, JpGq can be written as the intersection of a small number of type-definable sets over the same small set of parameters (namely A together with a fixed set of representatives of the Stab RpGq-cosets), so JpGq is type-definable.Since JpGq is A-invariant, it is in fact A-type-definable.Since the subgroups f ´1 r rGs, r P R, of the additive group of R have uniformly bounded index, an intersection of a small number of such subgroups is also a subgroup of bounded index.Hence, JpGq has bounded index.
(ii) follows by a similar argument.
A key point in what follows is the trivial observation below that the assumption that the index of the stabilizer is bounded is always satisfied when G is a bounded index subring of R. A standard observation about the connected components of groups is that each component has only boundedly many conjugates, so it must contain their intersection.In Lemma 2.3, we instead used the assumption on the index of the stabilizer.Interestingly, the assumption that the index of the left [or right] stabilizer is bounded is sufficient to find a two-sided ideal instead of just one-sided one, as proved in the proposition below.
Proposition 2.5.Let G ď p R, `q be a subgroup with bounded index such that either Proof.(i) Let I l and I r be the smallest A-type-definable left and right, respectively, ideals in R with bounded index.By Remark 2.4 applied to S :" I l , we see that Stab 1 RpI l q has bounded index.Thus, by Lemma 2.3, I l contains I r .In the same way, I r contains I l .Hence, I l " I r " R00 A,ideal is a two-sided ideal.Now, suppose that Stab RpGq has bounded index (the case when Stab 1 RpGq has bounded index is similar).Then, by Lemma 2.3, G contains I l , so we are done by the conclusion of first paragraph of this proof.
(ii) The argument is again similar.
We are now able to prove that some of the connected components introduced in Definition 2.1 are actually equal.

Proposition 2.6. (i) R000
A,ring " R000 A,ideal , (ii) R00 A,ring " R00 A,ideal , (iii) R0 A,ring " R0 A,ideal , (iv) R0 A,ring " R00 A,ring .Proof.Items (i) and (ii) follow from Remark 2.4 and Proposition 2.5 applied to G " S :" R000 A,ring and G " S :" R00 A,ring , respectively.We prove (iii) and (iv).Since the quotient ring R{ R00 A,ideal is compact, it is profinite by Fact 1.9, so there is a basis of neighborhoods of 0 that consists of clopen two-sided ideals.Let π : R Ñ R{ R00 A,ideal be the quotient map.We have R00 A,ideal " ( .

Consider a clopen two-sided ideal I of R{ R00
A,ideal .Both J :" π ´1rI s and its complement are type-definable, hence definable.Also, J has finite index.Since R00 A,ideal ď J , the orbit of J under Autp R{Aq is bounded and so finite by definability of J .Thus, Ş f PAutp R{Aq f rJ s is Adefinable with finite index.This shows that R00 A,ideal is an intersection of A-definable two-sided ideals with finite index, and therefore R00 A,ideal " R0 A,ideal .In particular, R00 A,ring Ď R0 A,ring Ď R0 A,ideal " R00 A,ideal " R00 A,ring (where the last equality holds by (ii)), and so we get (iii) and (iv).
We now adopt the notation from item (v) of Definition 2.1; that is, we write R000 A for R000 A,ideal p" R000 A,ring q, R00 A for R00 A,ideal p" R00 A,ring q, and R0 A for R0 A,ideal p" R0 A,ring q.Proposition 2.6 establishes that R00 A " R0 A regardless of the first-order structure of R.This is in stark contrast to the case of groups.The key difference is that due to Pontryagin duality, every (unital) compact topological ring is necessarily profinite, hence totally disconnected (which forces R{ R00 A and R{ R0 A to be the same object).The analogous statement is not true for groups.In particular, by Corollary 1.7, given an abelian group G with infinite exponent considered with the full structure, the (compact) quotient Ḡ{ Ḡ00 G is not profinite; it follows that Ḡ00 G ‰ Ḡ0 G .A concrete instance of this case is pZ, `q, discussed in more detail in Example 2.18.Another counterexample is the circle group S :" S 1 pRq defined in an o-minimal expansion of R. We have S0 H " S, but S00 H ‰ S0 H as it consists of the infinitesimal elements of S.

Regarding the components R00
A and R000 A , let us write explicitly what we have observed in the first paragraph of the proof of Proposition 2.5.

Corollary 2.7. (i) R00
A is the smallest left and the smallest right A-type-definable ideal of R with bounded index.

(ii) R000
A is the smallest left and the smallest right A-invariant ideal of R with bounded index.Question 2.8.Is R000 A " R00 A p" R0 A q? Equivalently, is R{ R000 A always profinite?This question is strongly related to some problems concerning our computation of the typedefinable connected component of unitriangular groups, which will be discussed in Section 3.2 after Question 3.6.In particular, see Lemma 3.8 for equivalent statements.
We conclude this subsection with a discussion on what happens if we drop the assumption that R is unital.First, observe that this assumption is not needed in Lemma 2.3, Remark 2.4 and Proposition 2.5 (working with JpGq X G in place of JpGq in the proof).However, the assumption that R is unital was used in the proofs of Proposition 2.6 (iii) and (iv).Nevertheless, it turns out that (iii) holds also for non-unital rings, which is explained below, whereas (iv) fails in general: to see it, start from any abelian group pR, `, . . .q for which p R, `q00 A ‰ p R, `q0 A and turn it into a (non-unital) ring with the trivial multiplication.Then the above additive group components coincide with the respective ring components, so R00 A " p R, `q00 A ‰ p R, `q0 A " R0 A .The proofs of Lemma 2.3, Remark 2.4 and Proposition 2.5 can be easily adapted to yield the following lemma.
Lemma 2.9.Let R be any (not necessarily unital) ring.Let G ď p R, `q be an A-definable subgroup with finite index such that Stab RpGq [respectively Stab 1 RpGq] has finite index.Then: RpSq are both of finite index; (iii) G contains the intersection of all A-definable left ideals of finite index and also the intersection of all A-definable right ideals of finite index, and these two intersections coincide and form a two-sided ideal.
Proof.(i) In the proof of Lemma 2.3(i), it is enough to work with JpGq X G and observe that all f ´1 r rGs X G are definable and of finite index and there are only finitely many of them.(ii) follows as in Remark 2.4.(iii) We modify the proof of Proposition 2.5(i).Consider any A-definable left ideal I of finite index.By (ii), Stab 1 RpI q has finite index.Thus, by (i), I contains an A-definable right ideal of finite index.Symmetrically, we have the same statements for switched roles of "left" and "right".This implies that the intersection of all A-definable left ideals of finite index coincides with the intersection of all A-definable right ideals of finite index, and so it is a two-sided ideal.Moreover, by (i) this two-sided ideal is contained in G.

Proposition 2.10. For an arbitrary (not necessarily unital) ring R, R0
A,ring " R0 A,ideal coincides with the intersection of all A-definable left [right] ideals of finite index.
Proof.By Lemma 2.9, the intersection of all A-definable left [right] ideals of finite index is a two-sided ideal I. Since I is type-definable, R{I is a compact topological ring (with the logic topology).It is also profinite as a group, as I is an intersection of definable finite index subgroups.
Claim.If a topological ring is profinite as a group, then it is profinite as a ring.In particular, R{I is profinite as a ring.Proof of Claim.Let S be a topological ring which is profinite as a group.Then S has a basis of neighborhoods of 0 consisting of clopen subgroups, and we need to show that it has a basis of neighborhoods of 0 consisting of clopen two-sided ideals.So take a clopen subgroup V Ď S. For each x P S, there are open neighborhoods U x Q 0 and By compactness, there are finitely many x 0 , x 1 , . . ., x n´1 such that S " Clearly, U is an open neighborhood of 0 and SU S `U Ď V .Let H be the group generated by SU S `U .Then H is a two-sided ideal.Since SU S `U is open, H is open (therefore clopen), and H Ď V because V is a group.This suffices.
Hence, as in the proof of Proposition 2.6, we get that I is an intersection of A-definable two-sided ideals of finite index.Thus, R0 A,ideal Ď I, but the opposite inclusion is immediate from the definition of I, so we have equality.Hence, by Lemma 2.9 (ii) and (iii), we easily get R0 A,ideal Ď R0 A,ring , while the opposite inclusion is obvious.2.2.Characterization of the ring components.We now give a characterization of the ring components in terms of subgroups of the additive group.For convenience, the following result is stated in two parts, even though the components R00 A and R0 A are equal.Proposition 2.11.(i) R00 A is the intersection of all A-type-definable subgroups G of p R, `q with bounded index such that rp R, `q : Stab RpGqs is bounded.

(ii) R0
A is the intersection of all A-definable subgroups G of p R, `q with finite index such that rp R, `q : Stab RpGqs is finite.
Proof.If G is a subgroup of p R, `q with bounded index such that Stab RpGq has bounded index, then, by Proposition 2.5(i), R00 A Ď G, and so: Conversely, we have the following lemma.
Lemma 2.12.Let G be an A-type-definable subgroup of p R, `q with bounded index.The following conditions are equivalent: RpGq in items (ii) and (iii).
Likewise the lemma below for A-definable groups.
Lemma 2.13.Let G be an A-definable subgroup of p R, `q with finite index.The following are equivalent: RpGq has bounded index.If G is A-definable, then the same holds for "bounded" replaced by "finite".
2.3.Ring components vs. additive group components.Our goal is to compare the connected components of R to the connected components of the additive group p R, `q.We start with an immediate observation.

It is natural to ask under which conditions R00
A is equal to one of the group components.Namely, Question 2.16.When R00 A " p R, `q00 A ?When R00 A " p R, `q0 A ?Our objective is now to find a characterization of when p R, `q0 A " p R, `q00 A .This equality means exactly that the group quotient R{p R, `q00 A is profinite (this equivalence is well-known and can be justified by an argument as in the proof of Proposition 2.6).Below is an immediate consequence of Corollary 1.7 for additive groups of rings.
Corollary 2.17.Suppose that R is considered with the full structure.
(i) If pR, `q has infinite exponent, then p R, `q{p R, `q00 R is not profinite, and so R is profinite, and so p R, `q00 R " p R, `q0 R .A fundamental example of a ring whose additive group has infinite exponent is the ring of integers.Regardless of the structure on Z, every subgroup of p Z, `q with finite index is of the form n Z for some n ‰ 0, and so it is 0-definable.Hence, for any structure on Z, p Z, `q0 " Ş n‰0 n Z exists and is an ideal, so it coincides with Z0 (which therefore exists).Example 2.18.Consider Z with the full structure.Since Z has infinite exponent, the above comment and Corollary 2.17 imply that Z00 Z " Z0 " p Z, `q0 ‰ p Z, `q00 Z .Using more explicit arguments, in [BCG13, Example 4.5] the same conclusion was obtained working with the pure ring structure pZ, `, ¨q.
The core argument behind Corollary 1.7 relies on harmonic analysis and the description of the Bohr compactification which it provides.On the other hand, both this corollary as well as the corollaries which we derive from it are stated in algebraic and model-theoretic terms.This leads to a question whether they can be proved by means of model-theory, e.g.: Question 2.19.Can one prove Corollary 2.17 without referring to Pontryagin duality?
We have already seen that R00 A " R0 A may be strictly bigger than p R, `q00 A .Now, we give examples where R00 A is strictly bigger than p R, `q0 A .Example 2.20.We are going to find an infinite field K and a 0-definable proper subgroup H ă R " p K, `q with finite index.In a field of characteristic p ą 0, such a subgroup always exist, and we can add a predicate for it.But we also give an example for a pure field structure.
Let p be prime and n P N ą0 .Consider the finite field F p n in the language of rings.The 0definable function f : F p n Ñ F p n given by f pxq " x p ´x is a homomorphism of pF p n , `q whose kernel is the prime field F p Ď F p n .Hence, the image of f is a subgroup of pF p n , `q with index p, and this is also true in the ultraproduct K :" ś nPN F p n {U for a non-principal U .Then K is infinite and has the desired subgroup H. Then p R, `q0 A ď H Ĺ R00 A " K. Remark 2.21.In a field K of characteristic 0, the group pK, `q is divisible and has no subgroups of finite index, so p K, `q0 " K exists and coincides with K00 .
Lemmas 2.12 and 2.13 give us the following straightforward criteria for when the typedefinable connected component of R differs from the connected components of p R, `q.

Corollary 2.22. (i) R00
A ‰ p R, `q00 A if and only if there exists an A-type-definable G ď p R, `q with bounded index such that rp R, `q : Stab RpGqs is unbounded.

(ii) R0
A ‰ p R, `q0 A if and only if there exists an A-definable G ď p R, `q with finite index such that rp R, `q : Stab RpGqs is infinite.
Observe that if A Ď R, then on the right-hand side of the second criterion the ring R can be replaced by R. Now, we give an application of the second criterion.The example Z 2 rXs was suggested to us by Światos law Gal.
Example 2.23.(1) Let R :" Z 2 rXs be equipped with the full structure.We will show that it satisfies the right hand side of Corollary 2.22(ii) for any A Ď R, so R0 Then h is an epimorphism of groups and G :" ker h is a subgroup of R of index 2.We will check that f P Stab R pGq iff f is constant, which directly implies that rp R, `q : Stab Rp Ḡqs is infinite.
Clearly 0, 1 P Stab R pGq.Now, take f P Z 2 rXs with degpf q " k ą 0. Fix some natural n ą 1 such that 2 n ´k ą 2 n´1 .Let g :" X 2 n ´k.Then g P G, but hpf ¨gq " a 2 n " 1, so f ¨g R G.
(2) The above example generalizes to any R :" Kr Xs equipped with the full structure, where K is a field of characteristic p ą 0 and X " pX i q iăλ is a (possibly infinite) tuple of variables.Namely, let h : R Ñ Z p be given by h ´ÿ aīX ī¯: where π : pK, `q Ñ pZ p , `q is any group homomorphism which is the identity on Z p , and a 2 k is aī for the tuple ī with 2 k on the first position and 0 elsewhere.As in (1), G :" kerphq has finite index in pR, `q, whereas Stab R pGq has infinite index, because each polynomial in KrX 0 szZ p is not in Stab R pGq.So R0 A ‰ p R, `q0 A for any A Ď R. Example 2.23(1) implies that for R :" ZrXs we also have R0 A ‰ p R, `q0 A , but in order to see this, we need to make a few general remarks which may be useful in other situations, too.
Remark 2.24.Suppose R, S are rings A-definable in some structure M and f : S Ñ R is an A-definable epimorphism.Then f r SÅ s " R Å and f rp S, `qÅ s " p R, `qÅ , where ˚P t0, 00, 000u.
Proof.This follows easily from the fact that for any group epimorphism h : G Ñ H and subgroups K ď G and L ď H, we have rH : f rKss ď rG : Ks and rG : f ´1rLss ď rH : Ls.
Notice that whenever R is a ring definable in a structure M , then each of the components RÅ and p R, `qÅ (where ˚P t0, 00, 000u and A Ď R) computed with respect to the language L set,R coincides with the one with respect to the language L set,M .
Example 2.25.For S :" Zr Xs ( X a tuple of variables of an arbitrary length) equipped with the full structure and any A Ď S we have S0 A ‰ p S, `q0 A .In order to see this, let R :" Z 2 rXs and take an epimorphism f : S Ñ R. Let M consist of two sorts S and R and equip it with the full structure.By the comment preceding this example, we can compute our components with respect to L set,M in place of L set,R .Since f is 0-definable in M , the conclusion follows from Example 2.23(1) and Remark 2.24.
In Example 2.18, the left hand side of the criterion in 2.22(i) holds, so the right hand side holds as well.But can one see directly that the RHS of (i) holds in this example?Also, the left hand of the criterion in 2.22(ii) fails in this example, so the right hand side fails as well, but this is trivially seen directly, as each subgroup of finite index of pZ, `q is an ideal.
Below we show a positive result for the case of a group component which does not depend on the parameters (which is for example always the case under NIP).
Proof.By Corollary 2.7 and Remark 2.15, to prove (i), it is sufficient to show that if p R, `q0 exists, then it is a left ideal.For any r P R, the set f ´1 r rp R, `q0 s is an intersection of definable subgroups of p R, `q of finite index, so p R, `q0 Ď f ´1 r rp R, `q0 s.In (ii), the proof of p R, `q00 " R00 is similar; then the remaining equality follows from Remark 2.15.
In (iii), the proof of p R, `q000 " R000 is again similar.Since p R, `q000 exists, so does p R, `q00 .As p R, `q is abelian, by [KP19, Theorem 0.5], we have p R, `q000 " p R, `q00 .The remaining equalities follow from (ii).
2.4.Definable compactifications of rings.We now turn our attention to the notion of definable compactifications of rings.Let us recall the notion of definable compactification.
(1) For a definable X Ď R and a compact topological space C a function f : X Ñ C is said to be definable if for each pair of disjoint, closed subsets C 1 , C 2 Ď C, there are definable, disjoint subsets U 1 , U 2 Ď X such that f ´1rC i s Ď U i for i " 1, 2.
(2) A definable compactification of a ring R " pR, `, ¨, . ..q is a compact topological ring C together with a definable ring homomorphism φ : R Ñ C with dense image.(3) The definable Bohr compactification of R is a unique up to isomorphism definable compactification φ : R Ñ C which satisfies the following universal property: if As in the context of groups, if a ring R is considered in the full set-theoretic language L set,R , then a definable [Bohr] compactification is the same thing as a classical [resp.Bohr] compactification of R considered with the discrete topology.
An essential result of [GPP14] shows the existence and uniqueness of the definable Bohr compactification of a definable group by means of its connected components.We state an analogous result for rings.
Proposition 2.28.The definable Bohr compactification of R is R{ R00 R with the natural map Proof.This is proven similarly to Proposition 3.4 of [GPP14], as the argument about lifting a group homomorphism also works for ring homomorphisms.
The above definition and proposition are valid also for non-unital rings.Let us note that in contrast with groups, by Fact 1.9, the definable Bohr compactification of a unital ring R coincides with the universal definable, profinite compactification of R.
2.5.Model-theoretic connected components of topological rings and the classical Bohr compactification.In [GPP14] and in Section 2 of [KP19], the classical Bohr compactification of a topological group G was described as Ḡ{ Ḡ00 top , where G is equipped with a structure in which all open sets are 0-definable (e.g. with the full structure), where Ḡ00 top can be described as the smallest 0-type-definable, bounded index subgroup of Ḡ containing the infinitesimals.In fact, several equivalent definitions of Ḡ00 top are given in Section 2 of [KP19].Here, we want to present an analog for topological rings, describing their Bohr compactifications (which coincide with the universal profinite compactifications for unital rings) in terms of a suitable component, where the Bohr compactification of a topological ring R is, of course, defined as the unique universal (ring) compactification of R.
Let R be a ring 0-definable in a structure M so that all open subsets of R are 0-definable (e.g.M " R is equipped with the full structure).Let µ be the ring of infinitesimal elements in R. Then Rµ Ď µ, but µ is not necessarily a left ideal of R.
M , an M -type-definable subring of bounded index.As before, for any r P R, let f r : R Ñ R be given by f r pxq :" r ¨x.Let JpGq :" Ş rP R f ´1 r rGs (intersected additionally with G, if one wishes to drop our general assumption that R is unital); it is the largest left ideal of R contained in G.By Remak 2.4 and the proof of Lemma 2.3, we can find a small set S (e.g. a set of representatives of cosets of G in R which contains 1) such that JpGq " Ş rPS f ´1 r rGs and so JpGq is M -type-definable.We will prove that JpGq " G, which shows that G is a left ideal.Then the right version of this argument shows that G is also a right ideal, so we will be done.
We need to show that G Ď JpGq.Let Gpxq be the partial type defining G, and Jpxqthe partial type defining JpGq.Both types are with parameters from M .Take any formula ϕpxq P Jpxq.It is enough to show that G Ď ϕp Rq.By compactness, we can find ψpxq P Gpxq and s 0 , . . ., s n´1 P S such that f ´1 s 0 rψp Rqs X ¨¨¨X f ´1 s n´1 rψp Rqss Ď ϕp Rq.So we can find r 0 , . . ., r n´1 P R such that f ´1 r 0 rψp Rqs X ¨¨¨X f ´1 r n´1 rψp Rqs Ď ϕp Rq.Since for every r P R, G Ď f ´1 r rGs, we have G Ď f ´1 r 0 rψp Rqs X ¨¨¨X f ´1 r n´1 rψp Rqs Ď ϕp Rq.Definition 2.30.R00 top :" µ `R 00 M .

Since R00
M is the smallest M -type-definable two-sided ideal [ring] of bounded index, we get the following corollary.

Corollary 2.31. R00
top is the smallest M -type-definable, bounded index two-sided ideal containing µ and also the smallest M -type-definable, bounded index ring containing µ.
Proposition 2.32.The quotient map π : R Ñ R{ R00 top is the Bohr compactification of the topological ring R.
Proof.The proof is a straightforward adaptation of the proof of [KP19, Fact 2.4(ii)], so we will skip it.Let us only remark that, using the notation from the proof of [KP19, Fact 2.4(ii)], since kerpf ˚q is a bounded index two-sided ideal which is an intersection of some sets of the form Ū for U open in R, we see that it is a 0-type-definable, bounded index two-sided ideal containing µ, and so R00 top Ď kerpf ˚q by Corollary 2.31.

Classical and definable Bohr compactifications of some matrix groups
Our aim in this section is to describe the definable (in particular classical, taking the full structure) Bohr compactifications of some classical discrete groups.We focus on the groups UT n pRq and T n pRq of (respectively) upper unitriangular and invertible upper triangular matrices over a (unital) ring R and describe their type-definable connected components in order to compute their definable Bohr compactifications.This is done in Subsection 3.2.In Subsection 3.4, we apply these general considerations to some classical rings R (such as Z or Kr Xs), computing explicitly the definable Bohr compactifications of UT n pRq and T n pRq for those rings.In the last subsection, we apply our approach to the topological groups UT n pRq and T n pRq for R being a topological (unital) ring, computing their classical Bohr compactifications.
In this section, we often write matrices where some of the coefficients are replaced with sets of coefficients to denote the set of matrices in which the coefficients can be (independently) chosen from the sets that replace them.Similarly, we replace submatrices with sets of submatrices.
3.1.Some linear algebra over rings.First, we analyze the structure of the group UT n pRq for a unital ring R. The following belongs to standard linear algebra.A matrix B P UT n`1 pRq can be written as ˆA v 0 1 ˙for some A P UT n pRq and v P R n .The map ψ : UT n`1 pRq Ñ UT n pRq given by sending B to its upper-left n ˆn submatrix A is a group epimorphism.Its kernel consists of all matrices of the form ˆI v 0 1 ˙, v P R n , and is naturally isomorphic to pR, `qn .
The short exact sequence splits via the map s : UT n pRq Ñ UT n`1 pRq which sends A to ˆA 0 0 1 ˙.Hence, UT n`1 pRq becomes a semidirect product UT n pRq˙φ pR, `qn .With a direct calculation, we verify that the action φ : UT n pRq Ñ AutppR, `qn q is just the standard action of UT n pRq on the R-module R n : ˆA 0 0 1 Thus, the group operation in UT n pRq ˙φ pR, `qn is just pA, vq ¨pA 1 , v 1 q " pAA 1 , v `Av 1 q.We now perform a similar analysis for T n pRq.First, consider the following variant of the semidirect product of groups.Suppose that K, H and N are groups, and that there are: a left action φ 1 : K Ñ AutpN q and a right action φ 2 : H Ñ AutpN q.For k P K, h P H, n P N , write kn and nh in place of φ 1 pkqpnq and φ 2 phqpnq, respectively.The set K ˆH ˆN can be equipped with the following operation: It is easy to see that this is a group operation if and only if both actions commute, that is if kpnhq " pknqh for all k P K, h P H, n P N .In that case, we will denote such a group as pK, Hq ˙φ2 φ 1 N .The groups K ˆH and N are naturally embedded in pK, Hq ˙φ2 φ 1 N as K ˆH ˆt1u, and t1u ˆt1u ˆN respectively.The subgroup N ď pK, Hq ˙φ2 φ 1 N is normal.The action of K ˆH on N by conjugation is as follows: pk, h, 1q ¨p1, 1, nq ¨pk, h, 1q ´1 " pk, h, 1q ¨p1, 1, nq ¨pk ´1, h ´1, 1q " p1, 1, knh ´1q.
Note that if either of the actions φ 1 , φ 2 is trivial, then pK, Hq ˙φ2 φ 1 N is just a semidirect product of K ˆH and N .Now, consider a matrix B P T n`1 pRq.It can be written as ˆA v 0 r ˙for some A P T n pRq, v P R n , and r P R ˚.We consider a product of two matrices represented this way: From the calculation above, it follows that T n`1 pRq is isomorphic to the group pT n pRq, R ˚q˙φ 2 φ 1 pR n , `q with A P T n pRq acting on R n by v Þ Ñ Av, and R ˚acting on R n by v Þ Ñ vr.Hence, the conjugate of v P R n by pA, rq P T n pRq ˆR˚i s pAvqr ´1 " Apvr ´1q.

Discrete triangular groups.
Recall that R is a unital ring, and A Ă R is a small set of parameters.Our first goal is to describe UTp Rq 00 A , the A-type-definable connected component of UT n p Rq, along with the quotient UTp Rq{ UTp Rq 00 A .In particular, for A :" R, we get a description of the definable Bohr compactification of UT n pRq; working in L set,R , this compactification coincides the classical Bohr compactification of the discrete group UT n pRq.A natural candidate for the component is UT n p R00 A q.However, we will see that in general it may happen that UTp Rq 00 A ň UT n p R00 A q. Define a sequence I i,A p Rq, i P N ą0 , of A-type-definable subgroups of p R, `q as follows: A , ‚ for i ą 0 let I i`1,A p Rq be the smallest A-type-definable subgroup of p R, `q containing the set R ¨Ii,A p Rq.
Moreover, if for some i P N ą0 the group I i,A p Rq is a two-sided ideal (or just left ideal) of R, then I j,A p Rq " R00 A for all j ě i.Conversely, if I j,A p Rq is constant for j ě i, then I i,A p Rq " R00 A is an ideal.Indeed, since I i,A p Rq " I i`1,A p Rq, it is a bounded index, A-type-definable left ideal contained in R00 A , and so it coincides with R00 A by Corollary 2.7.When R and A are fixed, we will omit the parameters and write I i to denote I i,A p Rq. Proposition 3.1.

UT n p Rq 00
A " While the groups I i need not be (two-sided) ideals, if i, j ă k, then for any coset a `Ii P p R, `q{I i and b `Ij P p R, `q{I j we have pa `Ii qpb `Ij q Ď ab `Ik ; that is, the coset ab `Ik is well-defined.Consequently, if S " ř s v s w s where each w s and each v s is a coset of I is and I js , respectively, then S can be unambiguously considered as an element of p R, `q{I k for any k such that i s , j s ă k for all s.In the result below, the group operation on the set of matrices is defined using this identification.
, where B :" p R, `q andis a topological group isomorphism, with the right hand side equipped with the product topology induced from the logic topologies on the quotients B{I .The quotient B{I 1 is exactly the definable Bohr compactification of pR, `q.More precisely, the definable Bohr compactification of UT n pRq is the homomomorphism from UT n pRq to the above group of matrices given coordinatewise as the quotients by the appropriate I i 's.
To state the analogous results for the group T n p Rq, we need to define another non-decreasing sequence I 1 i,A p Rq, i P N ą0 , of A-type-definable subgroups of p R, `q as follows: ‚ I 1 1,A p Rq is the smallest A-type-definable subgroup of p R, `q which contains p R, `q00 A and which is closed under multiplication by R˚f rom both left and right.‚ for i ą 0 let I 1 i`1,A p Rq be the smallest A-type-definable subgroup of p R, `q that contains the set R ¨I1 i,A p Rq ¨R ˚and that is closed under multiplication by R˚f rom both left and right.By definition and induction, we have I i,A p Rq Ď I 1 i,A p Rq Ď R00 A for all R, A, i.Hence, if I j,A p Rq is constant for j ě i, then I 1 i,A p Rq " R00 A .Also, as before, if I 1 j,A p Rq is constant for j ě i, then I 1 i,A p Rq " R00 A .Again, when R and A are fixed, we write I 1 i to denote I 1 i,A p Rq. Proposition 3.3.

T n p Rq 00
A " ¨p R˚, ¨q00 The group operation in the result below uses the identifications analogous to those discussed before Proposition 3.2: Proposition 3.4.The definable Bohr compactification of the (discrete) group T n pRq is , where P :" p R˚, ¨q{p R˚, ¨q00 R is the definable Bohr compactification of pR ˚, ¨q, B :" p R, `q, andis a topological group isomorphism, with the right hand side equipped with the product topology induced from the logic topologies on the quotients B{I 1 i .
More precisely, the definable Bohr compactification of T n pRq is the homomomorphism from T n pRq to the above group of matrices given coordinatewise as the quotients by p R˚, ¨q00 R or by the appropriate I 1 i 's.We will prove Propositions 3.1-3.4later in this subsection.From now on, when we compute Bohr compactications, we will be describing them only as compact groups, skipping the information about the actual homomorphisms from the groups in question to these compact groups, since these homomorphisms are always as in the last parts of Propositions 3.2 and 3.4.
The descriptions of the definable Bohr compactifications of UT n pRq and T n pRq given by Propositions 3.2 and 3.4 can be significantly improved under the following condition on the ring R: I i,R p Rq " R00 R for all i ě 2. p:q The condition asserts exactly that the sequence I i,R p Rq stabilizes after (at most) two steps.Assuming p:q, each quotient p R, `q{I i,R p Rq and p R, `q{I 1 i,R p Rq for i ě 2 is the ring definable Bohr compactification R dBohr of R. Hence, by Propositions 3.2 and 3.4, we get: Corollary 3.5.Assume R satisfies p:q.Then the definable Bohr compactification of the group considered with the product topology.
In the next subsection, we will consider several classes of rings, each time showing that they satisfy p:q.This motivates the following: Question 3.6.Does p:q hold for every ring R?
Condition p:q is strongly related to Question 2.8, which is explained in the next two lemmas.
On the other hand, J is an R-invariant left ideal which contains p R, `q00 R and so has bounded index, hence it must contain R000 R by Corollary 2.7.Lemma 3.8.Let J be the subgroup of p R, `q generated by R ¨p R, `q00 R .The following conditions are equivalent.
(i) J is type-definable.
(ii) J is generated by R ¨p R, `q00 R in finitely many steps.(iii) R000 R " R00 R .If the above equivalent conditions hold, then p:q holds for R.
A positive answer to Question 2.8 is the assertion that condition (iii) of Lemma 3.8 holds, yielding p:q and the descriptions of the definable Bohr compactifications of UT n pRq and T n pRq given by Corollary 3.5.So Question 2.8 can be restated in the following enriched form.Question 3.9.Do the equivalent conditions from Lemma 3.8 hold for every unital ring?If yes, is there a bound on the number of steps which are needed to generate a group by R¨p R, `q00 R which works for all rings R?
We expect a positive answer to this question (so also to Question 3.6).This will be dealt with in a forthcoming paper of the third author and Tomasz Rzepecki.In the next subsection, we will give a positive answer in several concrete examples.
Let us only argue here that in order to answer Questions 2.8 and 3.6 for commutative, unital rings R in the full language L set,R , we can restrict the context to polynomial rings over Z in possibly infinitely many variables.This essentially follows from the fact that for each commutative, unital ring there is a ring of polynomials Zr Xs (where X is a tuple of possibly infinitely many variables) and an epimorphism f : Zr Xs Ñ R. Indeed, let us work in the two-sorted structure M with sorts R and Zr Xs in the language L set,M .Then all the relevant "components" associated with R computed in L set,R coincide with the ones computed in L set,M , and similarly for the ring Zr Xs; hence, we can work in L set,M .Put P :" Zr Xs, and let P be the interpretation of P in the monster model M .Finally, since f is a 0-definable ring epimorphism, by Remark 2.24, we have f r P 000 H s " R000 H , f r P 00 H s " R00 H , and we easily check that f rI i,H p P qs " I i,H p Rq for all i.
The same holds for non-commutative rings, using free rings in non-commuting variables in place of polynomial rings.
We now show a number of lemmas needed in the proofs of Propositions 3.1-3.4.We will be using notations and observations from Subsection 3.1.Lemma 3.10.Let K, H, and N be 0-definable groups and G :" pK, Hq˙φ 2 φ 1 N with 0-definable actions φ 1 , φ 2 .Then Ḡ00 A " p K00 A ˆH 00 A q ˙φ2 φ 1 N 1 , where N 1 is the smallest A-type-definable, bounded index subgroup of N invariant under the actions of both K and H on N .
Proof.First observe that a subgroup N 0 ď N is invariant under the actions of K and H if and only if it is invariant under conjugation by elements of K ˆH.The group Ḡ00 A X N is a bounded index, A-type-definable subgroup of N invariant under the action of K ˆH by conjugation, so it contains N 1 .The group Ḡ00 A X p K ˆHq is an A-type-definable subgroup of K ˆH of bounded index, so it contains p K ˆHq 00 A " K00 A ˆH 00 A .Thus, p K00 A ˆH 00 A q ˙φ2 φ 1 N 1 Ď Ḡ00 A .Since N 1 is invariant under both group actions, p K00 A ˆH 00 A q ˙φ2 φ 1 N 1 is a group.It is A-type-definable and with bounded index, so we get Ḡ00 A " p K00 A ˆH 00 A q ˙φ2 φ 1 N 1 .Corollary 3.11.Let H and N be 0-definable groups and G :" H ˙φ N with a 0-definable action φ.Then Ḡ00 A " H00 A ˙φ N 1 , where N 1 is the smallest A-type-definable, bounded index subgroup of N invariant under the action of H on N .Lemma 3.12.(i) Let G :" UT n pRq ˙φ pR, `qn , where φpAqpvq :" Av.Then the smallest bounded index, invariant under the action of UT n p Rq, and A-type-definable subgroup N 1 of p R, `qn is equal to I n ˆIn´1 ˆ. . .ˆI1 .
(ii) Let G :" pT n pRq ˆpR ˚, ¨qq ˙φ2 φ 1 pR, `qn , where φ 1 pAqpvq :" Av and φ 2 prqpvq :" vr.Then the smallest bounded index, invariant under the actions of both T n p Rq and R˚, and A-type-definable subgroup N 1 of p R, `qn is equal to Proof.For k ď n, let S k be the image of the embedding of p R, `qk into p R, `qn by the map pv k , . . ., v 1 q Þ Ñ p0, . . ., 0, v k , . . ., v 1 q.We freely identify S k with p R, `qk .First we show (i).We prove the following by induction on k: For k " 1, simply observe that N 1 X S 1 is an A-type-definable subgroup of p R, `q of bounded index so it must contain I 1 .Now, suppose the statement holds for some k ą 0. Let C " tc P R : pc, 0, 0, . . ., 0q P N 1 X S k`1 u.
We have N 1 X S k`1 Ě C ˆIk ˆ. . .ˆI1 .We conclude the induction by showing that C Ě I k`1 .Let x P I k be arbitrary and take v :" p0, x, 0, . . ., 0q P N 1 X S k`1 .For any r P R there is an A P UT n p Rq such that φpAqpvq " prx, x, 0, . . ., 0q P S k`1 .As N 1 is invariant under UT n p Rq, we have φpAqpvq P N 1 and also φpAqpvq ´v " prx, 0, 0, . . ., 0q P N 1 X S k`1 .This shows that C contains the set R ¨Ik .Therefore, since C is an A-type-definable subgroup of p R, `q of bounded index, it contains I k`1 .We have that N 1 " N 1 X S n Ě I n ˆ. . .ˆI1 .As I n ˆ. . .ˆI1 is A-type-definable with bounded index, it remains to show that it is invariant under the action of UT n p Rq. Take v " pv n , v n´1 , . . ., v 1 q P Rn .For a unitriangular matrix A, Av is of the form pv n `v1 n , v n´1 v1 n´1 , . . ., v 2 `v1 2 , v 1 q, where each v 1 i is an R-linear combination of tv j : j ă iu.So v P I n ˆ. ..ˆI 1 implies Av P I n ˆ. . .ˆI1 , since I i Ě I i `RI i´1 `. . .`RI 1 .
We now prove (ii).First, let r, r 1 P R˚a nd let I denote the n ˆn identity matrix.Since N 1 is closed under the actions φ 1 , φ 2 , we have rN 1 r 1 " prIqN 1 r 1 Ď N 1 , so N 1 is closed under multiplication by R˚f rom both left and right.Now, similarly to (i), we prove by induction on k that For k " 1, we again observe that N 1 XS 1 is an A-type-definable subgroup of p R, `q of bounded index.It is closed under multiplication by R˚f rom both sides, so it must contain I 1 1 .Now, suppose the statement holds for some k ą 0. Define C as in the proof of item (i).Then 1 and we need to show C Ě I 1 k`1 .Let x P I 1 k be arbitrary and take v :" p0, x, 0, . . ., 0q P N 1 X S k`1 .For any r P R and r 1 P Rt here is an A P T n p Rq such that Avr 1 " prxr 1 , xr 1 , 0, . . ., 0q P S k`1 .We have Avr 1 P N 1 and also Avr 1 ´vr 1 " prxr 1 , 0, 0, . . ., 0q P N 1 X S k`1 .This shows that C contains the set R¨I 1 k ¨R ˚.Since C is an A-type-definable subgroup of p R, `q of bounded index, closed under multiplication by R˚f rom both left and right, it contains I 1 k`1 .We now have that N 1 is A-type-definable with bounded index, and clearly invariant under multiplication by R˚f rom the right, it remains to show that it is invariant under the action of T n p Rq. Take v " pv n , v n´1 , . . ., v 1 q P Rn .For a triangular matrix A, Av is of the form pr n v n `v1 n , r n´1 v n´1 `v1 n´1 , . . ., r 2 v 2 `v1 2 , r 1 v 1 q, where for each i, v 1 i is an R-linear combination of tv j : j ă iu and r i P R˚.So We are now ready to prove the previously stated results.
Proof of Proposition 3.1.By Corollary 3.11 and Lemma 3.12(i), we have UT n`1 p Rq 00 A -UT n p Rq 00 A ˙pI n ˆ. . .ˆI1 q -¨UT n p Rq 00 A I n . . .
where the isomorphisms are the obvious ones so that the first and the last group are in fact equal.Hence, the result follows by induction on n.
Proof of Proposition 3.2.Write H for the group of matrices on the right hand side of the formula in Proposition 3.2.Let F : UT n p Rq Ñ H be the map sending a matrix ra ij s P UT n p Rq to the matrix rb ij s P H defined by As the group operation in H is the ordinary matrix multiplication after the identification of the product of cosets a `Ii , b `Ij with ab `Ik for all a, b P R and i, j ă k, the map F is a group homomorphism.It is clearly onto, and Proposition 3.1 implies that kerpF q " UT n p Rq 00 A .Hence, UT n p Rq{ UT n p Rq 00 A -H as an abstract group.By compactness of the logic topologies, in order to see that this isomorphism is a homeomorphism, it is enough to check that it is continuous.But this is clear, as the preimage by F of a subbasic closed set S in the product topology on H (i.e. S consists of all matrices in H whose fixed pi, jq-th entry belongs to a fixed closed subset of B{I j´i ) is type-definable.
The proofs of Propositions 3.3-3.4are similar to the two previous ones.

Connected components of abelian groups via characters.
In this subsection, we give a description in terms of characters of the type-definable connected component of any abelian group.It will be needed to get descriptions of some Bohr compactifications in the next subsection, and may prove to be useful in future studies.
Let G be an abelian group definable in a structure M .Recall that HompG, S 1 q is the group of all homomorphisms from G to the compact group S 1 " R{Z " r´1 2 , 1 2 q.By Hom def pG, S 1 q we denote the subgroup consisting of all definable homomorphisms in the sense explained before Fact 1.1.Note that if all subsets of G are definable, then Hom def pG, S 1 q " HompG, S 1 q.
The next fact follows from the proofs of Lemma 3.2 and Proposition 3.4 of [GPP14].
Fact 3.13.Each χ P Hom def pG, S 1 q extends uniquely to an M -definable homomorphism χ P Homp Ḡ, S 1 q, where M -definable means that the preimages of all closed subsets of S 1 are Mtype-definable subsets of Ḡ.
Lemma 3.2 of [GPP14] provides the following construction of χ from the fact above.Let g P Ḡ and let ppxq :" tppg{M q.For a formula φpxq P p, let cl pχrφpGqsq denote the closure of χrφpGqs in S 1 .The set Ş φPp cl pχrφpGqsq is shown to be a singleton in S 1 , and χpgq is defined to be the unique element of this singleton.
Proposition 3.14.Suppose that G is an abelian group 0-definable in M .Then p Ḡ, `q00 M " Proof.The second equality is obvious.So we focus on the first equality.(Ď) Observe that for every χ P Hom def pG, S 1 q, kerp χq " č  is an M -type-definable subgroup of Ḡ of bounded index.Hence, kerp χq contains p Ḡ, `q00 M .(Ě) Take a P Ḡzp Ḡ, `q00 M .Let i : Ḡ Ñ Ḡ{p Ḡ, `q00 M be the (M -definable) quotient map.Since ipaq is not the neutral element and Ḡ{p Ḡ, `q00 M is a compact abelian group, the second part of Fact 1.2 yields ϕ P Hom c p Ḡ{p Ḡ, `q00 M , S 1 q with ϕpipaqq ‰ 0. Then χ 1 :" ϕ ˝i : Ḡ Ñ S 1 is a character which is definable over M .Hence, by Fact 3.13, χ :" χ 1 | G : G Ñ S 1 is a definable character with χ " χ 1 .We get that χpaq ‰ 0, so a R χ´1 "`´1 m , 1 m ˘‰ for any m P N such that 1 m ă | χpaq|.Remark 3.15.Let G be any group equipped with the full structure, and χ : G Ñ S 1 a (0definable) character.Let m ą 1.Take the 0-definable set D :" χ ´1 "`´1 m , 1 m ˘‰ and write D for its interpretation in Ḡ. Then: The right hand side of the inclusion is 0-type-definable.If the inclusion fails, then there is a 0-definable subset P of G such that Dz P is non-empty and disjoint from χ´1 "" ´1 m , 1 m ‰‰ .But then we can find r P DzP .Since r P G and r P Dz P , we have that χprq " χprq is not in , a contradiction with the definition of D and the fact that r P D.
(ii) If this fails, then there is r in χ´1 "`´1 m , 1 m ˘‰ X Dc .Hence, by the definition of χ, we get that χprq is in the closure of χrD c s Ď p´1 m , 1 m q c , so χprq R p´1 m , 1 m q, a contradiction.By Proposition 3.14 and Remark 3.15, we get Corollary 3.16.Let G be an abelian group equipped with the full structure.Then 3.4.Triangular groups over some classical rings.We apply Propositions 3.2 and 3.4 (more precisely, Corollary 3.5) to compute definable (so also classical by equipping the ring of coefficients with the full structure) Bohr compactifications of UT n pRq and T n pRq for the following classical rings R: fields, Z, Kr Xs or even KrGs (where K is a field and G is a group or semigroup).
For each of the above classes of rings, we first consider the group UT n pRq.We show that the set R ¨p R, `q00 R generates a group in finitely many steps, whence condition (ii) of Lemma 3.8 is satisfied.This shows that p:q holds for each of the considered rings, so we can apply Corollary 3.5 to compute the definable Bohr compactification of UT n pRq.In fact, in these examples, the set R ¨p R, `q00 R generates R00 R in one step, i.e.R ¨p R, `q00 R " R00 R .(On the other hand, one can show that the case of ZrXs equipped with the full structure requires exactly two steps, which will be shown in the aforementioned forthcoming paper of the third author with Tomasz Rzepecki).For each R, after dealing with the compactification of UT n pRq, we follow with the computation of the compactification of T n pRq.
We begin with the case of an infinite field R " K.For any A, K ¨p K, `q00 A " K and so for all i ě 2 we have I i,A p Kq " K, the only non-trivial ideal of K. Corollary 3.5 gives us that the We now work with R :" Z.
Proof.Since p Z, `q0 " Z 0 is an ideal, we clearly have Z ¨pZ , `q00 Z Ď p Z, `q0 , so it is remains to prove p Z, `q0 Ď Z ¨pZ , `q00 Z .The group p Z, `q00 Z is the intersection of a downward directed by inclusion family tP i p Zqu iPI of 0-definable sets.For every i P I we can find n i P P i pZqzt0u.Then n i ¨Z Ď P i p Zq ¨Z " Z ¨Pi p Zq. Thus, p Z, `q0 " Ş nPN ą0 n ¨Z Ď Z ¨Pi p Zq.By compactness, we conclude that p Z, `q0 Ď Z ¨č iPI P i p Zq " Z ¨pZ , `q00 Z .
This lemma implies that p:q holds for R " Z.The quotient p Z, `q{I 1,Z p Zq is the definable Bohr compactification pZ, `qdBohr of pZ, `q, whereas p Z, `q{I 2,Z p Zq " p Z, `q{p Z, `q0 is Ẑ, i.e. the profinite completion of Z. So, by Corollary 3.5, we get that the definable Bohr .
We are now interested in the rings of polynomials R :" Kr Xs, where K is an arbitrary infinite field and X is a (possibly infinite) tuple of variables.We show that R ¨p R, `q00 R " R " R0 R (i.e.again R ¨p R, `q00 R generates R0 R in a single step).In fact, we will work more generally with any ring R containing an infinite subfield K, covering also rings of the form KrGs, where G is a group or semigroup.
Recall the notion of a thick set from [Gis11, Definition 3.1].
Definition 3.19.A subset D of a group is said to be thick if it is symmetric and there is a natural number n ą 0 such that for any elements g 0 , . . ., g n´1 there exist i ă j ă n with g ´1 i g j P D. By compactness, it is clear that for any A-definable group G, each definable superset D of Ḡ00 A contains a definable superset of Ḡ00 A that is thick in Ḡ, namely D X D´1 .Hence Ḡ00 A is the intersection of some directed family of A-definable thick subsets of Ḡ.
Note that for an arbitrary (unital) ring R, R¨p R, `q00 A Ď R00 A " R0 A .Hence, by compactness, we get Lemma 3.20.Let R be any ring.

(i) R¨p R, `q00
A " R0 A if and only if for every A-definable superset P of p R, `q00 A there is an A-definable two-sided (or just left or right) ideal P 1 of R of finite index with P 1 Ď RP .(ii) R ¨p R, `q00 A " R if and only if for every P as in (i), R " RP .(iii) R˚¨p R, `q00 A " R if and only if for every P as in (i), R " R˚P .
Proposition 3.21.Let R be any ring containing an infinite field K (e.g.R " Kr Xs), equipped with any structure.Then R ¨p R, `q00 A " R " R0 A .Proof.We need to check that the right hand side of item (ii) from Lemma 3.20 is satisfied.For this, take any A-definable symmetric subset P of R containing p R, `q00 A .Then P is thick.So P X K is thick in K, hence there is a non-zero d P P X K (as K is infinite).Since d is invertible, Rd " R. Thus, we have proved that RP " R, so we are done.
As a corollary, we extend the description of the definable Bohr compactification of UT n pKq from the beginning of the subsection to UT n pRq for any R containing an infinite field K.By the last proposition, I i,R p Rq " R for all i ą 1, so Corollary 3.5 yields the following description of UT n pRq dBohr : ¨1 pR, `qdBohr 0 . . .We now turn to the group T n pRq for R containing an infinite field K. First, we need to show the following strengthening of Proposition 3.21 whose proof is less elementary, as it uses Proposition 3.14.Proposition 3.22.Let R be any ring containing an infinite field K (e.g.R " Kr Xs), equipped with any structure.Then R˚¨p R, `q00 A " R " R0 A .Proof.Without loss of generality, we can assume that A " R (enlarging R and A if necessary).
We need to check that the right hand side of item (iii) from Lemma 3.20 is satisfied.For this, take any symmetric R-definable set D containing p R, `q00 A .Note that D is thick in R and that its realization D in R is also thick in R. We need to show that R " R ˚D.
Choose a basis tb i u iPI for R treated as a linear space over K.
Claim.For every finite J Ď I there is a thick subset D J of K such that ř jPJ D J b j Ď D. Proof of Claim.By Proposition 3.14 and compactness, there are finitely many R-definable characters χ 0 , . . ., χ k´1 : pR, `q Ñ S 1 and m P N ą0 such that χ ´1 0 rr´1 m , 1 m ssX¨¨¨Xχ ´1 k´1 rr´1 m , 1 m ss Ď D. Let χ ij : pK, `q Ñ S 1 be the character defined as the composition χ i ˝ej , where e j : pK, `q Ñ R is given by e j paq :" ab j .Put n :" |J|.Then, for D ij :" χ ´1 ij rr´1 mn , 1 mn ss (where i " 0, . . ., k ´1 and j P J) we have Since each D ij is thick (as the preimage of a thick set by a homomorphism), the set D J defined as Ş iăk,jPJ D ij is also thick (see [Gis10, Lemma 1.2]).By the last displayed formula, we have Claim.For every n P ω and thick subset D n of K we have K ¨Dˆn n " K ˆn, where X ˆn denotes the n-fold Cartesian power, and ¨coordinatewise multiplication.
Proof of Claim.We need to show that for every a 0 , . . ., a n´1 P K there exists a P K such that pa 0 , . . ., a n´1 q P a ¨Dˆn n .Since 0 P D n , we can assume that all the a i 's are non-zero.Then the last statement is equivalent to the condition a ´1 0 D n X ¨¨¨X a ´1 n´1 D n ‰ t0u.Now, since D n is thick and each a ´1 i ¨is an automorphism of pK, `q, each a ´1 i D n is thick, so the intersection of all of them is also thick by [Gis10, Lemma 1.2], so contains a non-zero element, because K is infinite.Now take any x P R. Then there are a finite J Ď I and k j P K for j P J such that x " ř jPJ k j b j .By the first claim, there is a thick subset D J of K such that -´pR ˚, ¨qdBohr ¯n .
3.5.Topological triangular groups.We describe how our approach can be adapted to compute the classical Bohr compactification of UT n pRq and T n pRq treated as topological groups with the product topology induced from the topology on R, where we assume that R is a (unital) topological ring.
In order to do that, we need first to recall how to present model-theoretically the Bohr compactification of a topological group.So let G be a topological group 0-definable in a first order structure M in such a way that all open subsets of G are 0-definable (e.g.we can work in L set,M ).Following [KP19, Definition 2.3], we define Ḡ00 top to be the smallest bounded index subgroup of Ḡ which is an intersection of some sets of the form Ū for U open in G. Let µ denote the intersection of the Ū 's for U ranging over all open neighborhoods of the neutral element of G; µ is the group of infinitesimal elements of Ḡ. Proposition 2.1 of [GPP14] or Fact 2.4 of [KP19] says that Ḡ00 top is a normal subgroup of Ḡ, and the quotient mapping π : G Ñ Ḡ{ Ḡ00 top is the Bohr compactification of G (treated as a topological group).Proposition 2.5 of [KP19] describes Ḡ00 top as the smallest M -type-definable [or 0-type-definable], bounded index subgroup of Ḡ which contains µ.We will be using this description rather than the original definition.
We need the following variant of Lemma 3.10.
Lemma 3.23.(i) Let I 1 , . . ., I n be topological groups 0-definable in M .Equip G :" I n Î1 with the product topology, and assume that all open subsets of G are 0-definable in M .Then µ " µ In ˆ¨¨¨ˆµ I 1 (where µ I i is the group of infinitesimals in I i ), and Ḡ00 top " Īn 00 top ˆ¨¨¨ˆĪ 1 00 top .(ii) Let K, H, and N be topological groups 0-definable in M , and let φ 1 and φ 2 be continuous, 0-definable, respectively left and right actions by automorphisms of K on N and of H on N .Equip G :" pK, Hq ˙φ2 φ 1 N with the product topology, and assume that all open subsets of G are 0-definable in M .Then µ " pµ K ˆµH q ˙φ2 φ 1 µ N (where µ K , µ H , and µ N are the groups of infinitesimals in K, H, and N , respectively), and Ḡ00 top " p K00 top ˆH 00 top q ˙φ2 φ 1 N 1 , where N 1 is the smallest 0-type-definable, bounded index subgroup of N containing µ N (equivalently, containing N 00 top ), and invariant under the actions of both K and H. (iii) Let H and N be topological groups 0-definable in M , and let φ be a continuous, 0-definable left action of H on N by automorphisms.Equip G :" H ˙φ N with the product topology, and assume that all open subsets of G are 0-definable in M .Then µ " µ H ˙φ µ N (where µ H and µ N are the groups of infinitesimals in H and N , respectively), and Ḡ00 top " H00 top ˙φ N 1 , where N 1 is the smallest 0-type-definable, bounded index subgroup of N containing µ N (equivalently, containing N 00 top ), and invariant under the action of H.
Proof.(i) follows easily from the definitions of infinitesimals and product topology, and the aforementioned characterization of Ḡ00 top in terms of µ. (ii) Note that G is a topological group.Observe that all open subsets of K, of H, and of N are 0-definable in M , so the objects µ K , µ H , µ N , K00 top , H00 top , and N 00 top are defined.As in (i), the equality µ " pµ K ˆµH q ˙φ2 φ 1 µ N is clear from definitions.Having this, the equality Ḡ00 top " p K00 top ˆH 00 top q ˙φ2 φ 1 N 1 follows as in Lemma 3.10, using the aforementioned characterization of Ḡ00 top in terms of µ. (iii) follows from (ii).
Let now R be a (unital) topological ring.We work in L set,R .Define a sequence I i p Rq, i ą 0, of 0-type-definable subgroups of p R, `q as follows: I 1 p Rq :" p R, `q00 top , and for i ą 0, I i`1 p Rq is the smallest 0-type-definable subgroup of p R, `q containing the set R ¨Ii p Rq.By Corollary 2.31, we have p R, `q00 top " I 1 p Rq ď I 2 p Rq ď . . .ď I i p Rq ď . . .ď R00 top , and all the comments right after the definition of I i,A in Subsection 3.2 have their obvious counterparts.In particular, I j is constant for j ě i if and only of I i " R00 top .Using Lemma 3.23, one can easily check that the proof of Lemma 3.12(i) adapts to the present context, so we get the following variant of Proposition 3.1.Keeping in mind the identifications as in the discrete case described right after Proposition 3.1, the proof of the next result is the same as for Proposition 3.2 (using Proposition 3.24 in place of 3.1)., where B :" p R, `q and the topology on the right hand side is the product topology induced from the logic topologies on the quotients B{I i .The quotient B{I 1 is exactly the Bohr compactification of the topological group pR, `q.
In order to state similar results for T n p Rq, we need to and do assume that the group of units pR ˚, ¨q is topological with the topology induced from R. As in the discrete case, to state the results for the group T n p Rq, we need to define another non-decreasing sequence I 1 i p Rq, i P N ą0 , of 0-type-definable subgroups of p R, `q as follows: I 1 1 p Rq is the smallest 0-typedefinable subgroup of p R, `q which contains p R, `q00 top and which is closed under multiplication by R˚f rom both left and right; for i ą 0, I 1 i`1 p Rq is the smallest 0-type-definable subgroup of p R, `q that contains the set R ¨I1 i p Rq ¨R ˚and that is closed under multiplication by R˚f rom both left and right.And again, the comments right after the definition of I 1 i,A in Subsection 3.2 have their obvious counterparts.In particular, I i p Rq Ď I 1 i p Rq Ď R00 top for all i.Using Lemma 3.23, one can easily check that the proof of Lemma 3.12(ii) adapts to the present context, so we get the following variants of Propositions 3.3 and 3.4., where P :" p R˚, ¨q{p R˚, ¨q00 top is the Bohr compactification of the topological group pR ˚, ¨q, B :" p R, `q, andis a topological group isomorphism, with the right hand side equipped with the product topology induced from the logic topologies on the quotients B{I 1 i .We expect that the following variant of p:q is true for every topological ring: top for all i ě 2. p::q Using Lemma 2.29, one can show that p::q would follow from a positive answer to Question 3.9.This will be discussed in the forthcoming paper.For now, notice that if R satisfies p::q, then our formulas for the Bohr compactifications of the topological groups UT n pRq and T n pRq obtained in Propositions 3.25 and 3.27 simplify in the same manner as in Corollary 3.5 but with each definable Bohr compactification replaced by the (topological) Bohr compactification.
Example 3.28.Let R " K be a topological field (e.g.R).Then K ¨p K, `q00 top " K, and so for all i ą 1, I i p Kq " K. Let Q :" p K, `q{p K, `q00 top , i.e. the Bohr compactification of the topological group pK, `q.By Proposition 3.25, the Bohr compactification of the topological group UT n pKq is Let P :" p K˚, ¨q{p K˚, ¨q00 top , i.e. the Bohr compactification of the topological group pK ˚, ¨q.Since K˚¨p K, `q00 top " K, and so for all i ě 1, I 1 i p Kq " K, by Proposition 3.27, the Bohr compactification of the topological group T n pKq is Remark 2.4.Let S be a subring of R. Then S Ď Stab RpSq and S Ď Stab 1 RpSq.Thus, if S has bounded index, so do Stab RpSq and Stab 1 RpSq.

UT n p -
Kq{ UT n p Kq 00 top -Q n´1 .
2. Model-theoretic connected components of rings 2.1.General theory.We define the following model-theoretic connected components of R in a way analogous to model-theoretic connected components of groups.

in G. We claim that JpGq has the desired properties. It is clearly A-invariant. We may write JpGq as Ş
is a subring, then Stab RpSq is the largest subring of R in which S is a left ideal; it is known as the left idealizer of S in R [Goo76, p. 121].We similarly consider the action of p R, ¨q on R by right multiplication and denote the setwise stabilizer of X under this action by Stab 1 RpX q :" r P R : X ¨r Ď X Stab RpGq, (iii) Stab RpGq has finite index.Also, we can replace Stab RpGq with Stab 1 RpGq in items (ii) and (iii)., and if G is A-definable, then Stab RpGq is also A-definable, and so Stab RpGq is of bounded index if and only if it is of finite index.Corollary 2.14.Let G ď p R, `q be A-type-definable with bounded index.Then Stab RpGq has bounded index if and only if Stab 1 A Proposition 3.2.The definable Bohr compactification of the (discrete) group UT n pRq is UT n p Rq{ UT n p Rq 00 R -¨1 B{I 1 B{I 2 . . .B{I n´2 B{I n´1 definable Bohr compactification UT n pKq dBohr of UT n pKq is We similarly note that for any A we have I 1 i,A p Kq " K for all i ě 1, so, by Corollary 3.5, the definable Bohr compactification T n pKq dBohr of T n pKq is compactification UT n pZq dBohr of UT n pZq is One easily gets a description of the (topological) connected component of UT n pZq dBohr .For a topological group G, we will denote its topological connected component as G t in order to avoid confusions with its model-theoretic components.Corollary 3.18.´UTn pZq dBohr ¯t -ˆ´pZ, `qdBohr ¯t˙n ´1 .Moving to T n pZq, observe that Z˚" Z ˚" t1, ´1u, and hence I 1 i " I i for all i.Then, by Proposition 3.4 or Corollary 3.5, the definable Bohr compactification T n pZq dBohr of T n pZq is Hence, we have x P ř jPJ Kb j " K ř jPJ D J b j Ď KD, where the equality ř jPJ Kb j " K ř jPJ D J b j is provided by the second claim.Thus, we have shown that R Ď KD Ď R ˚D, so R " R ˚D.
Proposition 3.25.Let R be a (unital) topological ring.Then the Bohr compactification of the topological group UT n pRq equals UT n p Rq{ UT n p Rq 00 top -¨1 B{I 1 B{I 2 . . .B{I n´2 B{I n´1 The group operation in the result below uses the identifications analogous to those discussed before Proposition 3.2: Proposition 3.27.The Bohr compactification of the topological group T n pRq is T n p Rq{ T n p Rq 00 top -