<<

AN APPROXIMATE LOGIC FOR MEASURES

ISAAC GOLDBRING AND HENRY TOWSNER

Abstract. We present a logical framework for formalizing connections be- tween finitary combinatorics and theory or ergodic theory that have appeared in various places throughout the literature. We develop the basic syntax and semantics of this logic and give applications, showing that the method can express the classic Furstenberg correspondence as well as provide short proofs of the Szemer´edi Regularity Lemma and the hypergraph removal lemma. We also derive some connections between the model-theoretic notion of stability and the Gowers uniformity norms from combinatorics.

1. Introduction Since the 1970’s, diagonalization arguments (and their generalization to ul- trafilters) have been used to connect results in finitary combinatorics with results in measure theory or ergodic theory [14]. Although it has long been known that this connection can be described with first-order logic, a recent striking paper by Hrushovski [22] demonstrated that modern developments in model theory can be used to give new substantive results in this area as well. Papers on various aspects of this interaction have been published from a va- riety of perspectives, with almost as wide a variety of terminology [30, 10, 9, 1, 32, 13, 4]. Our goal in this paper is to present an assortment of these techniques in a common framework. We hope this will make the entire area more accessible. We are typically concerned with the situation where we wish to prove a state- ment 1) about suciently large finite structures which 2) concerns the finite analogs of measure-theoretic notions such as density or integrals. The classic ex- ample of such a statement is Szemer´edi’s Theorem (other examples can be found later in the paper and in the references): Theorem 1.1 (Szemer´edi’s Theorem). For each ✏>0 and each k N>0, there 2 A is an N such that whenever n>N and A [1,n]:= 1,...,n with |n| ✏, there exist a, d such that a, a + d, a +2d, . . . ,✓ a +(k 1)d{ A. } 2 Suppose this statement were false, and therefore that for some particular ✏, some k, and infinitely many n,thereweresetsAn [1,n] serving as counter- examples to the theorem. For each n, we could view✓ the [1,n], together with the An and the function + mod n, as a structure Mn of first-order logic. Using the ultraproduct construction, these finite models can be assembled into a single infinite model M satisfying theLo´sTheorem, which, phrased informally, states: Theorem 1.2. A first-order sentence is true in M if and only the sentence is true in Mn for “almost every” n.

2010 Mathematics Subject Classification. Primary 03B48; Secondary 03C20, 60A10. Key words and phrases. first-order logic, ultraproducts, measure theory. Goldbring’s work was partially supported by NSF grant DMS-1007144 and Towsner’s work was partially supported by NSF grant DMS-1001528. 1 2 ISAAC GOLDBRING AND HENRY TOWSNER

The existence of a and d satisfying the theorem can be expressed by a first- order sentence, so if we could show that this sentence was true in the infinite structure M, then the same sentence would be true in many of the finite structures Mn, which would contradict our assumption. In each of the finite models, we have a natural measure on [1,n], namely the An (normalized) counting measure µ , and the assumption that | | ✏ is simply n n the statement that µn(An) ✏. We would like to produce a measure on M which satisfies some analog of theLo´stheorem. One way to accomplish this is to expand the language of our models with many new predicates for measures, one for each definable set S and rational , and specify that the formula mS, holds in Mn exactly if µn(S) <. Then, for instance, the failure of mA,✏ in the finite structures Mn implies the failure of the same formula in M. With a bit of work, these new predicates are enough to ensure that we can construct a genuine measure, the Loeb measure (see [15]), on the structure M whose properties are related to those of the finite structures via theLo´stheorem. The extension of a language of first-order logic by these predicates has been used in [22], but the details of the construction have not appeared in print. The applications of these predicates for measures are suciently compelling to justify the study of this extension of first-order logic in its own right. It would be quite interesting to see certain results about first-order logic proven for this extension; for example, some of the results in [7] can be viewed as studying the addition of a “random” predicate P to a language of first-order logic, a notion which has natural application in the presence of measures if the result can be extended to include AML. In this paper we define approximate measure logic, or AML, to be an exten- sion of first-order logic in which these new predicates are always present. This serves two purposes. First, to give the full details of extending first-order logic by measure predicates in a fairly general way. Second, we hope that providing a precise formulation will spur the investigation of the distinctive properties of AML. In general, a logic which intends to talk about measure has to make some kind of compromise, since there is a tension between talking about measures in a natural way and talking about the usual first-order notions (which, for instance, impose the presence of projections of sets). AML is not the first attempt at such a combination (see [24, 2]), but di↵ers because it stays much closer to conventional first-order logic. The main oddity, relative to what a naive attempt at a logic for measures might look like, is that the description of measures in the logic is approximate: there can be a slight mismatch between which sentences are true in a structure and what is true about the actual measure. For instance, it is possible to have a structure M together with a measure µ so that M satisfies a sentence saying the measure of a set B is strictly less than ✏ while in fact the measure of B is precisely ✏. This is necessary to accommodate the ultraproduct construction. The next three sections lay out the basic definitions of AML and describe some properties of structures of AML, culminating in the construction of ultraproducts which have well-behaved measures. In Section 5, we present two examples of sim- ple applications, giving a proof of the Furstenberg correspondence between finite sets and dynamical systems, and a proof of the Szemer´edi Regularity Lemma. In Section 6 we prove a Downward L¨owenheim-Skolem theorem for AML. In Section 7, we illustrate several useful model-theoretic techniques in AML and AN APPROXIMATE LOGIC FOR MEASURES 3 apply these to show a connection between definability, the model-theoretic no- tion of stability, and combinatorial quantities known as the Gowers uniformity norms. We intend this section to be a survey of methods that have proven useful. These methods are either more fully developed in the references, or await a fuller development. In this article, m and n range over N := 0, 1, 2,... . For a relation R X Y , x { } ✓ ⇥ x X, and y Y ,wesetR := y Y :(x, y) R and Ry := x X :(x, y) R2. 2 { 2 2 } { 2 2 } The authors thank Ehud Hrushovski, Lou van den Dries, and the members of the UCLA reading seminar on approximate groups: Matthias Aschenbrenner, Greg Hjorth, Terence Tao, and Anush Tserunyan, for helpful conversations on the topic of this paper.

2. Syntax and Semantics A signature for approximate measure logic (AML) is nothing more than a first-order signature. Suppose that is a first-order signature. One forms AML -terms as usual, by applying functionL symbols to constant symbols and variables. WeL let denote the set of -terms. T L Definition 2.1. We define the -formulae of AML as follows: L Any first-order atomic -formula is an AML -formula. • The AML -formulae areL closed under the useL of the usual connectives • and . L ¬ If ' is^ an AML -formula and x is a variable, then x' and x' are AML • -formulae. L 9 8 IfL ~x =(x ,...,x ) is a sequence of distinct variables, q is a non-negative • 1 n rational, ./ <, , and ' is an -formula, then m~x ./q.' is an - formula. 2{ } L L The last constructor, which we will refer to as the measure constructor,inthe above definition behaves like a quantifier in the sense that any of the variables x1,...,xn appearing free in ' become bound in the resulting formula. From now on, ./ will always denote < or .  Convention 2.2. It will become convenient to introduce the following notations:

m~x q.' is an abbreviation for m~x q. 'is an abbreviation for ¬m q.' • ~x ¬ ~x  Remark 2.3. It is not necessary that AML contain precisely one measure for each tuple length. A more general definition could allow multiple measures at each arity. In this case, one would also want to track which measures on pairs, for instance, correspond to the products of which measures on singletons, and so on. There are even situations where it is natural to have a measure on pairs which does not correspond to any product of measures on singletons.1 Further generalizations could involve such things as measures valued in ordered rings. A fully general definition of AML would include in the signature , for each arity, a list of measures together with the ordered ring in which theyL are valued. In this

1A typical example is the proofs in extremal graph theory of sparse analogs of density state- ments, as in the regularity lemma for sparse graphs [26], where the counting measure on pairs is replaced by counting the proportion of pairs from some fixed (typically small) set of pairs. If the fixed set of pairs satisfies certain randomness properties, this measure cannot be viewed as any product measure. 4 ISAAC GOLDBRING AND HENRY TOWSNER paper we eschew these complications and focus only on the simplest case, with a single real-valued measure; the changes needed to handle more general cases are largely routine. Particular examples of AML structures are given by finite structures with the normalized counting measure and by structures with definable Keisler measures. However we would like to define an apriorinotion of semantics for AML: anal- ogously to the definition of a structure of first-order logic, we would like to first state that a certain object is an AML structure and then interpret formulae and sentences within that object. The heart of such a definition should be that an AML structure consists of a first-order structure together with a measure such that all definable sets are measurable. Since identifying the definable sets requires interpreting the logic, this makes it dicult to recognize a valid AML structure without simultaneously interpreting the logic. We adopt a compromise: an AML quasistructure is an object which would be an AML structure except that definable sets may not be measurable. We define the rank of a formula to be the level of nesting of measure quantifiers, and we then, by simultaneous recursion, identify the definable sets of rank n and the quasistructures in which all sets defined by formulae of rank n are measurable; as long as all sets defined by formulae of rank n are measurable, it will be possible to interpret formulae of rank n+1. An AML structure will then be a quasistructure in which this recursion continues through all ranks. We face one additional obstacle: a first-order structure together with a mea- sure does not provide enough information to completely specify the semantics. In order to satisfy compactness, we need to allow the possibility that

M ✏ m~x 0, but M m r.'(~x ). 6✏ ~x  In such a structure, the measure of the set defined by ' should be r,butthis structure must have a di↵erent semantics from a structure N where the measure of the set defined by ' is r and N m r.'(~x ). ✏ ~x  To accomodate this, we pair the measure portion of a structure with a function v which assigns to each set X a value , , or . The values and indicate that the structure can only identify the measure of the set X as it is approximated from above or from below, respectively, while the value indicates that the structure actually identifies the measure of the set X exactly. This issue can only occur when the value of the measure is rational, so if the measure of X is irrational, we always set v(X)= . Definition 2.4. Let be a first-order signature. An AML -quasistructure con- sists of: L L a first-order -structure M; • L M n for each n 1, an algebra n of of M and a finitely additive • measure µMon M such that,B for any m, n, M extends M M and n Bn Bm+n Bm ⌦Bn µM extends µM µM; m+n m ⇥ n for each set X M, an assignment of a value vM(X) , , such • 2Bn n 2{ } that vM(X)= whenever µM(X) / Q. n n 2 AN APPROXIMATE LOGIC FOR MEASURES 5

If the structure M and the arity n are clear from context, we will write µ and M M v instead of µn and vn . Suppose that M is an AML -quasistructure. Let V be the set of variables and suppose also that s : V MLis a function; we call such an s a valuation on ! M. Given any sequence of distinct variables ~v =(v1,...,vn) and any sequence ~c =(c1,...,cn) from M,welets(~c/~v ) be the valuation obtained from s by redefining (if necessary) s at vi to take the value ci. We would now like to define the satisfaction relation M = '[s] by recursion on complexity of formulae in such a way that this extends the| satisfaction relation for first-order logic. However, in order to specify the semantics of the measure constructor, one needs to know that the set defined by the formula following the measure constructor is measurable. Thus, we need to define the semantics in stages while ensuring that the sets defined at each stage are measurable. Towards this end, we define the rank of an AML -formula ', denoted rk('), by induction: L If ' is a classical -formula, then rk(') = 0; • rk( ')=rk( x')=rk(L '); • rk('¬ ) = max(rk(8 '), rk( )); • rk(m_./r.' (~x,~y )) = rk(') + 1. • ~x Suppose that the satisfaction relation M = '(~x )[s] has been defined for for- mulae of rank n. (Note that this is automatic| for n = 0.) As is customary, we often write M= '(~a )if'(~x ) is a formula with free variables among ~x , s is a valuation for which| s(x )=a , and M = '[s]. If '(~x,~y ) is a formula of rank n i i |  and b M ~y ,wethenset'(M,~b):= a M ~x : M = '(~a , ~b) . We also use the 2 | | { 2 | | | } notation v(',~b) to denote v('(M,~b)). We say that the AML -quasistructure M satisfies the rank n measurability condition if, for all formulaeL '(~x,~y ) of rank n and all b M ~y ,wehave  2 | | '(M,b) M. 2B~x Assume| that| M satisfies the rank n measurability condition. We now define the satisfaction relation = for rank n + 1 formulae. We treat the connective and quantifier cases as in| first-order logic and only specify how to deal with the semantics of the measure constructor. Suppose that '(~x,~y ) is a formula of rank n and s is a valuation such that s(~y )=~b. We then declare: M = m

M = m r.'(~x ;~b) if and only if: • | ~x  – µ('(M,~b))

Suppose 0 is signature extending the signature . Suppose that M is an 0- quasistructure.L Then the -reduct of M, denoted ML ,isthe -quasistructureL L |L L obtained from M by “forgetting” to interpret symbols from 0 . We also refer to M as an expansion of M . L \L |L Definition 2.8. Suppose that M and N are -structures. We say that M is a substructure of N if: L (1) the first-order part of M is a substructure of the first-order part of N, and (2) for each B N,wehaveB M n M. 2Bn \ 2Bn We further say that M is an elementary substructure of N if, for all formulae '(~x ) and a M ~x ,wehaveM = '(~a ) if and only if N = '(~a ). 2 | | | | It may seem a bit strange that the notion of substructure does not mention the measure part of the structures in question. However, given that the constructor m~x

3. The Canonical Measures on an -saturated AML structure @1 An extremely important source of AML structures are those that are equipped with an actual measure. Definition 3.1. A measured -structure is an AML -structure M such that n L n L n there is a measure ⌫ on a -algebra of subsets of M extending Defn(M) such that: B AN APPROXIMATE LOGIC FOR MEASURES 7

n n M (1) For definable B M ,wehave⌫ (B)=µn (B). (2) For each m, n ✓ 1, the measure ⌫m+n is an extension of the product measure ⌫m ⌫n (3) (Fubini property)⌦ For every m, n 1 and B m+n,wehave (a) for almost all x M m, Bx n; 2B 2 n 2Bm (b) for almost all y M , By ; 2 n x 2B m m n (c) the functions x ⌫ (B ) are y ⌫ (By) are ⌫ - and ⌫ -measurable, respectively, and7! 7!

m+n n x m m n ⌫ (B)= ⌫ (B )d⌫ (x)= ⌫ (By)d⌫ (y). Z Z For example, any finite -structure equipped with its normalized counting measure is a measured structure;L in fact, these structures (and their ultraprod- ucts) are our primary examples of measured structures. Even if an AML structure does not come equipped with a measure, often there is still a “natural” measure that can be placed on the structure, a process that we now describe. First, we say that an -structure M is 1-compact if whenever L @ n n 1 and (Dm : m N) is a family of definable subsets of M with the 2 finite intersection property, then m Dm = . (If the signature is countable, 2N 6 ; L then this coincides with the notion of an 1-saturated structure more commonly encountered in model theory; whenT the signature@ is countable, we will often use the term saturated rather than compact.) For example, any finite -structure is -compact; many ultraproducts are also -compact. In this section,L we will @1 @1 show that certain 1-compact AML structures can be equipped with a family of canonical measures,@ the so-called Loeb measures. We write ( ) for the -algebra generated by the algebra . B B Suppose that M is an 1-compact AML -structure and (Am : m N) @ n L 2 is a family of definable subsets of M for which m Am is also definable. 2N Then, by -compactness, we have that A = k A for some k 1 m N m m=0 m @ M 2 S 2 N. Consequently, µn Defn(M) is a pre-measure. Thus, by the Caratheodory | S S M extension theorem, there is a measure, which we again call µn or simply µn, on M (Defn(M)), extending the original µn given by µn(B):=inf µM(D ):B D ,D Def (M) for all m . { n m ✓ m m 2 n } m m X [ M n Moreover, if µn (Defn(M)) is -finite, then µ is the unique measure on (Defn(M)) | M extending the original µn . Observe, however, that by 1-compactness again, M M @ µn Defn(M)is-finite if and only if µn Defn(M)isfinite(whichoccursif | M | and only if µ1 (M) is finite by the product property). We refer to the family of M measures (µn ) as the canonical measures on M. Although they are defined for M all 1-compact -structures, we mainly consider them in the case when µ1 (M) is finite,@ for thenL they are truly “canonical.” (Indeed, when a pre-measure on an algebra is not -finite, there are many extensions of it to a measure on ( ); see ExerciseA 1.7.8 in [29].) A Until further notice, we assume that µM Def (M) is a finite pre-measure 1 | 1 on Def (M) (and hence µM Def (M) is a finite pre-measure on Def (M) for 1 n | n n all n 1). Let (Defm(M)) (Defn(M)) denote the product -algebra and µ µ denote the product measure.⌦ Observe that (Def (M)) (Def (M)) m ⌦ n m ⌦ n is generated by sets of the form A B,withA Defm(M)) and B Defn(M)); since A B Def (M) for such⇥A, B,wehave2 (Def (M)) (Def2 (M)) ⇥ 2 m+n m ⌦ n ✓ 8 ISAAC GOLDBRING AND HENRY TOWSNER

(Defm+n(M)). Now observe that, if A Defm(M) and B Defn(M), then µ (A B)=µ (A) µ (B) by the Product2 property. Thus2 m+n ⇥ m · n E := D (Def (M)) (Def (M)) : µ (D)=(µ µ )(D) { 2 m ⌦ n m+n m ⌦ n } contains all sets of the form A B,whereA Defm(M) and B Defn(M). One can easily check that E is a⇥-class. Since the2 sets of the form A2 B,where A Def (M) and B Def (M), form a ⇡-class, we have, by the ⇡-⇥Theorem, 2 m 2 n that (Defm(M)) (Defn(M)) E. (For the definitions of - and ⇡-classes as well as the statement⌦ of the ⇡--theorem,✓ see Section 17.A of [23].) Consequently, we see that µ µ = µ (Def (M)) (Def (M)). This proves: m ⌦ n m+n| m ⌦ n M Lemma 3.2. If M is an 1-compact -structure such that µ (M) is finite, then M, equipped with its canonical@ measures,L satisfies the first two axioms in the definition of a measured structure. The third axiom, requiring that Fubini’s Theorem hold, might still fail for sets which do not belong to (Defm(M)) (Defn(M)). We call an 1-compact - structure whose canonical measures satisfy⌦ the Fubini property a Fubini@ structureL. (The measurability of the functions in (3) always holds for the canonical measures, so really a Fubini structure is one where the displayed equation in the statement of the Fubini property is required to hold.) Thus, by the preceding lemma, a Fubini structure, equipped with its canonical measures, is a measured -structure. The following situation is also important: L Definition 3.3. Suppose that is a classical -structure which is equipped with a family of measures ⌫n onM a -algebra n ofL subsets of Mn extending the algebra of definable sets and such that ⌫m+nBis an extension of ⌫m ⌫n for all m, n 1. We call ( , (⌫n)) a classical measured structure. Then we can⌦ turn M n M M into an -quasistructure M by declaring, for B M , that vn (B)= . We call M the AMLL quasistructure associated to ( , (⌫✓n)). M Remark 3.4. Usually, the AML quasistructure associated to a classical measured structure is not a structure: due to the added expressivity power, there are new definable sets which may not be measurable. (However this quasistructure will satisfy the rank 0 measurability condition, and so satisfaction for formulae of rank 1 can be defined.) For finite classical measured structures (which are the structures most important for our combinatorial applications), the associated AML quasistructure is in fact a structure because all sets are measurable. M Remark 3.5. Consider M, an 1-compact -structure with µ1 (M)finite,equipped M @ L with its family (µn ) of canonical measures. Let be the classical -structure obtained from M by considering only the interpretationsM of the symbolsL in . M L Then ( , (µn )) is a classical measured structure. Let M0 be the AML qua- M M sistructure associated to ( , (µn )). How do M and M0 compare? Suppose that M 0 '(x) is a classical -formula and r Q . It is straightforward to see that M = m r.'(x)impliesL M = m 2 r.'(x). However, the converse need not | x  0 | x  hold. For example, suppose that M0 = mx 0.'(x), whence µ('(M)) = 0. How- M |  ever, if v (')= ,thenM = mx 0.'(x). (Such phenomena can, and will, happen in ultraproducts, as we| ¬ will see in later sections.) Thus, in some sense, M0 is a “completion” of M. We now briefly turn to the question of what our logic can say about these canon- ical measures. We present a couple of examples. Suppose that (X, ) is a measur- able space such that x for every x X. (This happens, forS example, when { }2S 2 AN APPROXIMATE LOGIC FOR MEASURES 9

n (X, )=(M ,(Defn(M))) for M an -structure.) Then a measure µ on X is saidS to be continuous if µ( x ) = 0 forL each x X. The following is immediate. { } 2 Proposition 3.6. Suppose that M is an 1-compact -structure. Then we have >0 @ 1L M = xmy q(x = y):q Q if and only if µ is a continuous measure. | {8  2 } More generally, there is a set (x) consisting of -formulae containing a single free variable x such that, for every -structure M Land every a M, L 2 µ1( a )=0 M = '(a) for all ' . { } , | 2 >0 Indeed, take (x):= my

Proposition 3.7. There is a set T of AML sentences such that, for any 1- M 1 @ compact -structure M with µ1 (M) finite, M = T if and only if µ is a proba- bility measure.L |

Proof. Take T := mx 1(x = x) mx q(x = x):q (0, 1) Q . {  }[{¬  2 \ } ⇤ Proposition 3.8. There is a set T of AML sentences such that, for any 1- M @ compact -structure M with µ1 (M) finite, M = T if and only if M is a Fubini structure.L | Proof. We take T to consist of the following two schemes: (1) For every '(~x,~y,~x ), (~x,~z ) and q, r,t with tt.(' ) , 8 8 ! ~y ^ ~x ! ~x,~y ^ (2) For every⇥ '(~x,~y,~x ), (~x,~z ) and q, r,t with qr < t, ⇤ ~z ~x ( m r.') m q. m t.(' B ) ✏ ~x,~y ^ ri,ri+1 for every tµ (Bri,ri+1 ), we must have M ✏ m~x qi.Bri,ri+1 , and R  since M ✏ T , we also have M m qr . Therefore µm+n( (~x,~y ) B : ~x B ) q r , and i i+1 { 2 2 ri,ri+1 }  i i+1 so µm+n(B) q r . Again, since q r can be made arbitrarily close to  i i i+1 i i i+1 µn(B~x )dµm(~x ), we have µm+n(B) µn(B~x )dµm(~x ). P P Now suppose M is Fubini; we must show that every sentence in T holds. ForR the first family of sentences, supposeR M ~x ( m r.') m ✏ 8 ! ~y ^ ~x q. (with parameters ~c M ~z ). Setting C = (M,~c), we see that µ(C) q. 2 | | Let B = '(M,~c). For each ~a C, µ(B~a ) r.Sinceµ is Fubini, µm+n(B)= n ~x n 2 C µ (B )dµ (~x ) qr, and therefore for each tt.(' ). For the second family of sentences, suppose M ~x ( m r.') m^ R ✏ 8 ! ~y  ^ ~x  q. . Again setting C = (M,~c) and B = '(M,~c), for each ~a C, µ(B~a ) r. m+n n ~x n 2  Since µ is Fubini, µ (B)= C µ (B )dµ (~x ) qr, and therefore for each t>qrwe have M m ra.e. n i if µMi (A ) if µMi (A )=r and vMi (A )= a.e. n > n i n i > Mi Mi < if µn (Ai)=r and vn (Ai)= a.e. M M if µ i (Ai)=r and v i (Ai)= a.e. > n n > M M It is reasonably straightforward> to check that each n is an algebra and µn is : M B a finitely additive measure on n , whence the ultraproduct M is a quasistructure. B M Note that the assignment of ⌫n (A) is consistent with the interpretations of Mi M and as indicating approximation from above or below: if µn (Ai) >µn (A) M a.e., we have obtained the measure µn (A) by approximations from above, thus Mi (irrespective of whether the values of µn (Ai) were obtained exactly or obtained M Mi Mi by approximation themselves) vn (A)= ;ifµn (Ai)=r and vn (Ai)= Mi a.e. then almost every µn (Ai) was found by approximations from above, so the M measure of µn (A) is found the same way. The following theorem is of fundamental importance for our applications of AML. Theorem 4.1 (Lo´sTheorem for AML). Suppose that (M : i I) is a family of i 2 -structures, is a ultrafilter on I,andM = Mi is the ultraproduct of the L U U family (Mi). Let ' be an -formula and s a valuation on M. For each i I, let L Q 2 si be a valuation on Mi such that, for each variable v, we have s(v)=[si(v)] . Then M = '[s] M = '[s ] for -almost all i. U | , i | i U AN APPROXIMATE LOGIC FOR MEASURES 11

Proof. As in the proof of the classicalLos theorem, we proceed by induction on the complexity of formulae. We only need to explain how to deal with the measure constructor cases, that is, we consider a formula '(~x,~y ) such that the theorem holds true for ' and we show that it holds for m~x ./r.' (~x,~y ), where ./ <, . We fix valuations s and s as in the statement of the theorem and set 2{ } i ~bi := si(~y ) and ~b := s(~y ). We will repeatedly use the inductive hypothesis that '(M,~b)= '(Mi,~bi). U If µMi ('(M ,~b )) ra.e. then, symmetrically, we have Mi ✏ m~x >r.'(~x , bi) and M m r.'(~x , ~b ) a.e., and also M m >r.'(~x , ~b) and M m i ✏ ~x i ✏ ~x ✏ ~x r.'(~x , ~b). M M M Finally, if µ ('(Mi,~bi)) = r a.e. then v ('(M,~b)) = v i ('(Mi,~bi)) a.e., so M m

Corollary 4.7. Suppose that (M : i I) is a family of Fubini structures, is i 2 U a nonprincipal ultrafilter on I,andM = Mi. Suppose further that there is a >0 M U c R such that µ (Mi) c for -almost all i. Then M is a Fubini structure. 2 1  U Q Proof. This is immediate from Proposition 3.8 and theLo´stheorem. ⇤

Corollary 4.8. Suppose that (Mi : i I) is a family of 1-compact -structures Mi 2 @ L such that µ1 is a continuous measure for almost all i.Supposethat is a M U nonprincipal ultrafilter on I and M = Mi. Then µ1 is also a continuous measure. U Q Proof. This is immediate from Proposition 3.6 and theLo´stheorem. ⇤ Remark 4.9. Under some set-theoretic assumptions, the converse of the above corollary holds. A nonprincipal ultrafilter on a (necessarily uncountable) index U set I is said to be countably complete if whenever (Dm : m N)isasequence of sets from such that D D for all m,wehave 2 D .With m m+1 m N m the same hypothesesU as in the◆ previous corollary, if we further2 assume2 thatU is M T UMi countably complete, then continuity of µ1 implies continuity of almost all µ1 . The existence of a countably complete ultrafilter is tantamount to the existence of a measurable cardinal, which is a fairly mild set-theoretic assumption that most set theorists are willing to assume when necessary. However, it is straightforward to check that if is countably complete and each Mi is finite, then Mi will also be finite, makingU such ultraproducts unusable for many purposes. U Q Corollary 4.10. There does not exist an -formula '(x) such that for every -compact -structure M, we have L @1 L µM( a )=0 M = '(a). 1 { } , | Proof. Suppose, towards a contradiction, that such an -formula '(x) exists. For L i 1, let Mi be the classical measured -structure whose universe is 1,...,i , whose measures are given by the normalizedL counting measures, and which{ inter-} prets the -structure in an arbitrary fashion. Let Mi be the AML -structure as- L >0 L sociated with Mi. Let be a nonprincipal ultrafilter on N and let M = Mi. UM M U It is easy to see that µ1 (M) 1 and µ1 ( a ) = 0 for any a M. It follows that  { } 2 >0 Q M = x'(x). ByLo´s, we have that Mi = x'(x) for some i N .SinceMi is | -compact,8 it follows that each m M| has8 measure 0, which2 is a contradic- @1 2 i tion. ⇤ Corollary 4.11. There does not exist an -sentence ' such that, whenever M M L M is an 1-compact structure with µ1 (M) finite, then M = ' if and only if µ1 is a probability@ measure. | Proof. Suppose, towards a contradiction, that such a sentence ' exists. For n 1, M 1 let Mn be a finite -structure such that µ1 (Mn)=1 n . Let M := Mn, L U where is a nonprincipal ultrafilter on N>0. Observe that µM(M) = 1, whence U 1 Q M = '.Thus,M = ' for some n, contradicting the fact that µMn 1(M ) < | n | n 1. ⇤ Corollary 4.12. There does not exist a set T of -sentences such that, for any -structure M, M = T if and only if µM is -finite.L L | 1 Proof. Suppose, towards a contradiction, that there is a set T of -sentences M L such that M = T if and only if µ1 is -finite. Let M be a countably in- finite set equipped| with the unnormalized counting measure ⌫(B)= B and | | AN APPROXIMATE LOGIC FOR MEASURES 13 turn M into an AML -structure M by interpreting the symbols in in an arbitrary fashion. NoteL that M = T because M is the union of its singletons,L which are definable and have measure| 1. Let be a nonprincipal ultrafilter on U N N and let N := MU . Then, by theLo´stheorem, we have that N = T ,soµ1 N | is -finite. Since N is 1-compact, we have that µ1 is a finite measure. Thus, @ n for some n N, N = x1 xn( i=1 mx < 1.(x = xi)). Consequently, 2 n| ¬9 ···9 ¬ M = x1 xn( mx < 1.(x = xi)), contradicting the fact that M con- | ¬9 ···9 i=1 ¬ V tains infinitely many singletons of measure 1. ⇤ V We now turn to the connection between integration and ultraproducts. Sup- pose that (M : i I) is a family of -structures and h : M m M n are i 2 L i i ! i functions. We will say that the family (hi : i I)isuniformly definable if there 2 ~z exists a formula '(~x,~y,~z ), where ~x = m and ~x = n, and tuples ~c M | | | | | | i 2 i such that, for all i I, ~a M m and ~b M n,wehaveh (~a )=~b if and only 2 2 i 2 i i if Mi = '(~a , ~b,~ci). If M = Mi and ~c := [~c i] , then byLo´s, we have that '(~x,~y,|~c ) defines a function h : MU m M n, whichU we call the ultraproduct of the Q ! uniformly definable family (hi). We will also need to consider families of functions. Suppose (Mi : i I)is m 2 a family of measured -structures, and, for each i, gi : Mi R is a function. L ! 2 We then say the family (gi : i I)isuniformly layerwise definable if, for each 2 ~z m q Q, there is a formula 'q(~x,~z ) and tuples ~c i M | | such that, for ~a M , 2 2 i 2 i gi(~a ) 0 and choose a partition 1=q 1. For 0 j k,set| |   Sqj ,qj+1 := ~x M m : q (g h )(~x )

We have by definition that 1 q µm(Sqj ,qj+1 ) (g h )dµm q µm(Sqj ,qj+1 ). j+1 i i c  i i i  j+1 i i Xj Z Xj On the other hand, the sets Sqj ,qj+1 partition M m and if ~x Sqj ,qj+1 then, since 2 g h(~x )=lim gi hi(~x i), qj g h(~x ) qj+1, so also U   1 q µm(Sqj ,qj+1 ) (g h)dµm q µm(Sqj ,qj+1 ). j+1 c   j+1 Xj Z Xj m m 1 Therefore we have lim (gi hi)dµi (g h)dµ . Letting c go to , | U | c 1 we have the desired result. ⇤ R R We call the function g as in the conclusion of the previous theorem the ultra- product of the family (gi). Observe that g(~x )=lim gi(~x i) for ~x =[~x i] .Wewill U U particularly be interested in the case that I = N, in which case, using the same m notation as in the statement of the previous theorem, if limi (g hi) dµi = r, then (g h) dµm = r. !1 R RemarkR 4.14. In the previous theorem, one could drop the requirement that the family (gi) be uniformly layerwise definable and instead only require that each gi be measurable. However, the Mi0 and, consequently, M0, would only be quasistructures rather than structures.

5. Correspondence Theorems 5.1. The Furstenberg Correspondence Principle. One application of AML is to give a general framework for correspondence principles between finite struc- tures and dynamical systems. We will only present a proof of the original corre- spondence argument given by Furstenberg [14]; since then, many variations and generalizations have been produced (for instance, [5]). The method given extends immediately to these generalizations. Definition 5.1. Let E Z.Theupper Banach density of E, d(E), is ✓ [n, m] E lim sup | \ |. m n m n !1 Definition 5.2. A dynamical system is a tuple (Y, ,µ,T), where (Y, ,µ)isa probability space and T : Y Y is a bimeasurableB bijection for whichBµ(A)= µ(TA) for all A . ! 2B Furstenberg’s original correspondence can be stated as follows: Theorem 5.3 (Furstenberg). Let E Z with positive upper Banach density be given. Then there is a dynamical system✓ (Y, ,µ,T) and a set A with B 2B µ(A)=d(E) such that for any finite set of integers U, i d( (E i)) µ( T A). i U i U \2 \2 Proof. Let (✏N : N N) be an increasing sequence of positive rational numbers 2 such that supN ✏N = d(E). Then for each N,wemayfindn, m such that m n> [n,m] E N and | m \n | ✏N . Let fn,m :[n, m] [n, m] be the function such that ! fn,m(x)=x+1 when x

Let (Y, A, T ) be the ultraproduct of the Mn,m’s with respect to some nonprin- cipal ultrafilter on N. Let := (Def1(Y )) and let µ be the canonical measure on . It is clear fromLo´s’ theoremB that (Y, ,µ,T) is a dynamical system. Next B B observe that, by our construction, µ(A)=d(E). Now notice that, for any finite i set of integers U, any rational <µ( i U T A), and any N,wemayfindm, n such that m n>N and 2 Ti [n, m] i U fn,m (E [n, m]) | \ 2 \ | >. m n T Fix >0. Then for suciently large N, we also have that

[n, m] i U (E i) | \ 2 | > . m n T i Consequently, d( i U (E i)) µ( i U T A). ⇤ 2 2 T T 5.2. The Regularity Lemma. Definition 5.4. Let M be an AML structure, let A M be a set, let n be a positive integer, and let I [1,n] be given. We define ✓0 (A) to be the Boolean ✓ Bn,I algebra of subsets of M n generated by sets of the form (x ,...,x ) M n : M = '(x ,...,x ) , { 1 n 2 | 1 n } where ' is a formula with parameters from A whose free variables belong to I. When k n,wedefine 0 (A) to be the Boolean algebra generated by the  Bn,k algebras 0 (A) as I ranges over subsets of [1,n] of cardinality k. Bn,I In all cases, we drop 0 to indicate the -algebra generated by the algebra. When A = , we omit it and write . ; Bn,k These algebras were introduced, in a somewhat di↵erent context, by Tao in [30, 31].

Definition 5.5. Suppose that (G, E) is a finite (undirected) graph, U, U 0 G are nonempty, and ✏ is a positive real number. ✓

E (U U 0) (1) We set d(U, U 0):= | \U ⇥U | . ⇥ 0 (2) We say that U and U 0 are ✏-regular if whenever V U, V 0 V 0 are such that V ✏ U and V ✏ U ,thenwehave ✓ ✓ | | | | | 0| | 0| d(U, U 0) d(V,V 0) <✏. | | Theorem 5.6 (Szemer´edi’s Regularity Lemma, [28]). For any k and any ✏> 0, there is a K k such that whenever (G, E) is a finite graph, there is an n [k, K] and a partition G = U1 Un such that, setting B = (i, j): U 2and U are not ✏-regular , we have[···[ { i j }

U U ✏ G 2. i ⇥ j  | | (i,j) B [2 Proof. For a contradiction, suppose the conclusion fails. Then we may find k, ✏ such that for every K k there is a finite graph (GK ,EK ) with no partition into at least k but at mostK components satisfying the theorem. The partition of a graph into singleton elements consists entirely of ✏-regular pairs, so in particular G >Kfor all K. | K | 16 ISAAC GOLDBRING AND HENRY TOWSNER

Let 0 := E ,whereE is a binary predicate symbol. Inductively assume that AMLL signatures{ } have been constructed. Then for L0 ✓L1 ✓L2 ✓··· any two AML n-formulae '(x) and (x), at least one of which does not belong n 1 L to , with only the displayed free variable, we add new unary predicates i=1 Li R', (x) and S', (x)to n+1.Welet := 1 n. We define finite measured S L L n=1 L -structures GK as follows: L S The universe of GK is GK ; • The measures on G are given by the normalized counting measure; • K E is interpreted in GK by EK ; and • R ,S are interpreted by induction on formulae. Having interpreted • ', ', ', ,wemaysetU = '(GK ) and U 0 = (GK ). If U, U 0 are not ✏-regular then set RGK = SGK = . Otherwise, choose V U, V U witnessing ', ', ; ✓ 0 ✓ 0 GK GK the failure of ✏-regularity and set R', = V and S', = V 0. Let G be the ultraproduct of the GK . We work in the canonical measure space on G2. From here on, we will identify formulae ' with their interpretation '(G). Let h := E(E 2,1), the conditional expectation of E with respect to the -algebra .Since|B h can be approximated by simple functions, we may write B2,1

h = ↵i0 Ci Di + h0 ⇥ i K0 X 4 where h0 L2 <✏ /4 and Ci,Di are definable. Let U1,U2,...,Un be the atoms of the finite|| || algebra generated by C D .Thenwehave { i}[{ i} h = ↵i,jU U + h00 i⇥ j i,j n X with h00 L2 h0 L2 and Ui i n is a finite partition of G into definable sets. || || || || { }  Let B be the collection of (i, j) such that RUi,Uj (and therefore SUi,Uj ) are µ(E (R S )) \ Ui,Uj ⇥ Ui,Uj non-empty, and for each (i, j) B,definei,j = µ(R )µ(S ) .ByLo´s’ 2 Ui,Uj Ui,Uj theorem, for each (i, j) B,wehave ↵ ✏. Let B+ B be those (i, j) 2 | i,j i,j| ✓ such that ↵i,j i,j ✏. Suppose µ( (i,j) B Ui Uj) ✏/2. We may assume 2 ⇥ µ( + U U ) ✏/4 (for otherwise we carry out a similar argument with (i,j) B i ⇥ j S B B+).2 S \Again byLo´s’ theorem, for each (i, j) B+, µ(R ) ✏µ(U ) and µ(S ) 2 Ui,Uj i Ui,Uj ✏µ(Uj). Set Z = (i,j) B+ (RUi,Uj SUi,Uj ). Note that Z 2,1 and 2 ⇥ 2B S 0= EZ hZ dµ = EZ ↵i,jU U Z dµ + h0Z dµ i⇥ j i,j n Z Z X Z so we have

h0Z dµ = ↵i,jU U Z EZ dµ i⇥ j Z Z i,j n X = ↵i,jµ(RU ,U )µ(SU ,U ) ER S dµ i j i j Ui,Uj ⇥ Ui,Uj (i,j) B+ Z X2 ↵ µ(R )µ(S ) (↵ ✏)µ(R )µ(S ) i,j Ui,Uj Ui,Uj i,j Ui,Uj Ui,Uj (i,j) B+ X2 AN APPROXIMATE LOGIC FOR MEASURES 17

= ✏µ(RUi,Uj )µ(SUi,Uj ) (i,j) B+ X2 ✏3µ(U )µ(U ) i j (i,j) B+ X2 ✏4/4. 4 But this is a contradiction, since h0Z dµ h0 L2 Z L2 <✏ /4 1. It follows that µ( U U ) ✏/2. || || || || · (i,j) B i ⇥ j R Note that2 what we have constructed is a partition of G which roughly satisfies the regularityS conditions, but in the infinite model. Our final step is to pull this partition down to give a finite model, giving a contradiction. By choosing K n large enough, we may ensure that the following hold: GK Whenever (i, j) B, R = , and therefore Ui(GK ) and Uj(GK ) are • 62 Ui,Uj ; ✏-regular, µ(U (G )) p2µ(U (G)) for each i. • i K  i This implies that

µ U (G ) U (G ) 2µ U (G) U (G) ✏ 0 i K ⇥ j K 1  0 i ⇥ j 1  (i,j) B (i,j) B [2 [2 @ A @ A as desired. ⇤ Remark 5.7. The regularity lemma is usually stated with an additional require- ment that the of the partition pieces be nearly equal. This could be obtained with the following changes: for each integer n, include new unary predicates Pn,1,...,Pn,n in the language, and in the finite models interpret these predicates as a partition into nearly equal pieces. Using these predicates, refine the partition Ui into one where the components have nearly the same mea- sure. When we{ pull} this down to the finite model, the sets will di↵er in size by a very small fraction (choosing parameters correctly, this fraction can be arbi- trarily small, say ✏2), so we may redistribute a small number of points to make these pieces have exactly the same size without making much change to the edge density of large subsets. Remark 5.8. The method in this subsection extends very naturally to hyper- graphs, using the algebras k,k 1 in place of 2,1. An example of a related proof for hypergraphs is given belowB in Section 7.3.B

6. The Downward Lowenheim-Skolem¨ Theorem In this section, we prove the Downward L¨owenheim-Skolem Theorem for AML using an appropriate version of the Tarski-Vaught test. Proposition 6.1 (Tarski-Vaught Test). Suppose that M is a substructure of N. Then M is an elementary substructure of N if and only if: (1) for all formulae '(x; ~y ) and ~a from M, if there is b N with N = '(b,~a), then there is c M with N = '(c;~a );and 2 | 2 | (2) for all formulae '(x; ~y ) and ~a from M, we have µM('(N,~a) M)= \ µN('(N,~a)) and vM('(N,~a) M)=vN('(N,~a)). \ Observe that, assuming (1), '(N,a) M = '(M,a), whence it makes sense \ to speak of µM('(N,a) M) in (2). \ 18 ISAAC GOLDBRING AND HENRY TOWSNER

Proof. First suppose that M is an elementary substructure of N. Then (1) is immediate. To prove (2), first notice that '(N,~a) M = '(M) by elementarity. Suppose, towards a contradiction, that µ('(M,~a))\ = r while µ('(N,~a)) = s with r = s. Without loss of generality, suppose that r

7. Model Theory and Applications 7.1. More Model Theory. We introduce some standard (and less standard) notions from model theory. We often discuss the case where the language is countable, M is 1-saturated, and we consider a countable substructure, since this is the most interesting@ case for our purposes. Most of these results would still hold as long as the saturation of M is greater than the cardinality of either the signature or the submodels we consider. From now on, we fix a countable signature and a measured -structure M (although Lemmas 7.11, 7.10, and 7.13 belowL make no mention ofL the measure and thus these Lemmas go through for an arbitrary -structure). For example, M could be a Fubini structure equipped with its canonicalL measures. Also, for sake of readability, we will write µ for the measure, regardless of the cartesian power of M n under discussion. Finally, we will often identify a formula '(x)with parameters from M with the subset of M n that it defines; in this way, we may AN APPROXIMATE LOGIC FOR MEASURES 19 write µ(') to denote the measure of the definable subset of M n defined by '. Likewise, we may write Y to indicate the complement of the definable set Y . ¬ Definition 7.1. Suppose A M. ✓ (1) A partial type of n-tuples (or an n-type)overA is a collection p(~x ) of formulae with parameters from A,where~x =(x1,...,xn), such that for n every '1,...,'n p,thereis~a M such that M = 'i(~a ) for every i n. 2 2 | (2) A partial type p is said to be a type over A if for every formula ' with suitable free variables and parameters from A,either' p or ' p. (3) A global type is a type over M. 2 ¬ 2 (4) If ~a is a sequence of elements, we write tp(~a / A ) for the set of formulae with parameters from A satisfied by ~a . (5) If M is measured, then the partial type p is wide if for every ' p, µ(') > 0. 2

Remark 7.2. An -structure M is 1-saturated if and only if, whenever A M L @ ~x ✓ is countable and p(~x ) is a partial type over A,thereisa M | | such that M = '(~a ) for all ' p. In this case, we write ~a = p. 2 | 2 | Lemma 7.3. Suppose that A M is countable. Then for almost every ~a , tp(~a / A ) is wide. ✓ Proof. Any ~a such that tp(~a / A ) is not wide must belong to some set of measure 0 definable with parameters from A. There are countably many such sets, so their union has measure 0. ⇤ Lemma 7.4. Suppose that A M is countable. Then for almost every (~a , ~b), ✓ tp(~a / A ~b ) and tp(~b/A ~a ) are both wide. [{ } [{ } Proof. By the previous lemma, for each ~b the set T = ~a :tp(~a / A ~b ) is not wide ~b { [{ } } has measure 0. Therefore µ( (~a , ~b):~a T )= µ(T )dµ ~b (~b) = 0, so the set of { 2 ~b} ~b | | (~a , ~b) such that tp(~a / A ~b ) is not wide has measure 0. By a symmetric argument, [{ } R also the set of (~a , ~b) such that tp(~b/A ~a ) is not wide has measure 0. Therefore [{ } almost every (~a , ~b) is in neither of these sets; for such (~a , ~b), tp(~a / A ~b ) and [{ } tp(~b/A ~a ) are both wide. [{ } ⇤ Definition 7.5. Suppose that (~bi : i I) is a sequence of r-tuples of elements 2 ~ of M,whereI is an initial segment of N, and A M.Then(bi)isasequence ✓ of indiscernibles over A if whenever '(~x 0,...,~xn) is a formula with parameters from A and the displayed variables and m <

Lemma 7.6. Suppose that µ(M) is finite, (~bi) is a sequence of indiscernibles over A M, X is a definable set over A,andµ(X~ ) > 0 holds. Then for any ✓ b0 n, µ( i n X~b ) > 0.  i T 20 ISAAC GOLDBRING AND HENRY TOWSNER

Proof. Suppose the conclusion of the lemma is false and take k>0 minimal so that µ( i k X~b ) = 0. For n k 1, let Cn = i 0 by indiscernibility. However, when k 1 n

Proof. Let X be a set definable over A and suppose (~a , ~b0) X.Then~a ~ 2 2 X~ and, since tp(~a / A b0 )iswide,µ(X~ ) > 0. By the previous lemma, b0 [{ } b0 µ( X~ ) > 0, and is therefore non-empty. By 1-saturation, there is an a0 i n bi @  ~ such that a0 i n X~b simultaneously for all X (~a , b0) that are definable over T 2  i 3 A. Therefore tp(~a ,~b /A)=tp(~a , ~b /A) for all i n. T 0 i 0  ⇤ Remark 7.8. The previous lemma suggests a connection between wideness and the model-theoretic notion of nonforking, as we now explain. First, a formula '(x, b) k-divides over a set A M if there is a sequence (bi : i N)which is indiscernible over A for which✓ b = b and such that '(M,b2 )= for 0 i I i ; any I N with I = k. We say that '(x, b) divides over2 A if it k-divides over A ✓for some k| | 2. We say that '(x, b) forks over ATif there are formulae (x, b ),..., (x, b ) such that '(M,b) n (M,b ) and such that each 1 1 n n ✓ i=1 i i i(x, bi)dividesoverA. Finally, we say that a type p(x) forks over A if it contains a formula which forks over A. In model theory,S when tp(a/A b ) does not fork over A, this implies that a is in some sense independent from[{ } b over A. For example, when working in an algebraically closed field K and k is a subfield of K,thentp(a/k b ) does not fork over k if and only if, whenever a is a generic point for a Zariski[{ closed} set V defined over k,thena does not lie in any Zariski closed set V 0 defined over k(b)withdim(V 0) < dim(V ). Lemma 7.7 shows that if A M is countable and tp(a/A b )iswide,thentp(a/A b ) does not fork over✓ A. [{ } [{ }

Definition 7.9. Suppose that A M and p is a global type. ✓ (1) p is A-invariant if whenever tp(~a 1,...,~an/A)=tp(~a 10 ,...,~an0 /A), we have X~a ,...,~a p X~a ,...,~a p. 1 n 2 , 10 n0 2 (2) p is A-finitely satisfiable if whenever X p, X A = . 2 \ 6 ; Lemma 7.10. Suppose that p is a global type and A M.Ifp is A-finitely satisfiable then p is A-invariant. ✓

Proof. Suppose not; then there are definable X and ~a 1,...,~an,~a10 ,...,~an0 so that X~a ,...,~a p and X~a ,...,~a p.Sincep is a global type, this means X~a ,...,~a p, 1 n 2 10 n0 62 ¬ 10 n0 2 and since p is closed under intersections, X~a ,...,~a X~a ,...,~a p.Butthenthere 1 n \ 10 n0 2 is an element m A such that m X~a ,...,~a X~a ,...,~a , contradicting the fact 2 2 1 n \ 10 n0 that tp(~a 1,...,~an/A)=tp(~a 10 ,...,~an0 /A). ⇤ Lemma 7.11. Let N be an elementary substructure of M.Ifp is a type over N, then there is an extension of p to a global N-finitely satisfiable (and therefore N-invariant) type. AN APPROXIMATE LOGIC FOR MEASURES 21

Proof. Note that, since N is an elementary submodel of M, each X p has the property that X N n = . Let 2 \ 6 ; n p0 = p Y : Y Def (M) and Y N = . [{¬ 2 n \ ;} We will show that every finite subset of p0 is satisfied by an element of N. If not, there is an X p and Y ,...,Y with Y N = such that X Y = .So 2 1 n i \ ; \ i ¬ i ; X N (Yi Yi) = , and since each Yi N = , X M Yi = . \ \ i [¬ 6 ; \ ; \ \ Ti 6 ; Let q be an arbitrary extension of p0 to a (global) type. Suppose q is not finitely satisfiableT in M;thenthereisaY q with Y N = , which is impossibleT since then Y p q. 2 \ ; ¬ 2 0 ✓ ⇤ Definition 7.12. If S is a set and p a global type, write p S for the restriction of p to sets definable over S. | Lemma 7.13. Suppose p is a global A-invariant type, and recursively choose ~ ~ ~ bn ✏ p A bi i 0. Then µ(X~a Y~ ) > 0. \ b 0 \ b0 Proof. Suppose the claim fails, so µ(X~a Y~ ) = 0. By 1-saturation and the fact 0 \ b0 @ that tp(~b0/A)=tp(~b/A), there an ~a 00 with tp(~a 00,~b/A)=tp(~a 0,~b0/A); in this way, we may assume ~b = ~b0. ~ Since q is A-invariant, whenever ~a ⇤ ✏ tp(~a / A ) and b⇤ ✏ q A ~a ⇤ we have ~ ~ | [{ } tp(~a ⇤, b⇤/A)=tp(~a , b/A), and so in particular µ(X~a Y~ )=µ(X~a Y~) > 0. ⇤ b⇤ b ~ ~ \ \ ~ Choose ~a 0 ✏ p and b0 ✏ q A ~a 0 . Let ~a i, bi i n be given so that (bi)is indiscernible over A. For each|>[0{ and} each{C }tp(~a / A ), by the wideness of 2 tp(~a /A ~b ), we have 0 [{ } µ(C ~x : M m <.X(~z,~x ) Y (~z , ~b) ) > 0, \{ ✏ ~z ^ } ⇣ ⌘ and therefore by Lemma 7.7 and 1-saturation we may find an ~a n+1 with tp(~a n+1/A)= @ ~ ~ tp(~a / A ) such that µ(X~a n+1 Y~ ) = 0 for i n. Let bn+1 ✏ q (A ~a i, bi i n \ bi  [{ }  [ ~a n+1 ); by Lemma 7.13, we have ensured that (~bi) remains indiscernible over A. { } ~ For each i,letCi = X~a i Y~ . Since each bn ✏ q ~a n, µ(Ci) ✏; while for i = j, \ bi 6 µ(C C ) = 0. This is a contradiction to the finiteness of µ(M). i \ j ⇤ Lemma 7.15. Suppose that M is -saturated and µ(M) is finite. Suppose that @1 A M is countable, q is an A-invariant type, ~b q A ~a , tp(~b /A)=tp(~b/A), ✓ ✏ | [{ } 0 tp(~a /A)=tp(~a / A ), tp(~a /A ~b ) is wide, X, Y are definable with parameters 0 0 [{ 0} from A,andµ(X~a Y~)=0. Then µ(X~a Y~ )=0. \ b 0 \ b0 22 ISAAC GOLDBRING AND HENRY TOWSNER

Proof. Suppose the claim fails, so µ(X~a Y~ ) > 0. As in the proof of the previous 0 \ b0 lemma, we may assume that ~b = ~b0. Suppose that ~a i,~bi i0 such that for each C tp(~a / A ), 2 2 µ(C ~x : M m ✏.X(~z,~x ) Y (~z , ~b) ) > 0, \{ ✏ ~z ^ } and therefore by Lemma 7.7 and⇣ -saturation we may find⌘ an ~a with tp(~a /A)= @1 n n tp(~a / A ) such that µ(X~a Y~ ) ✏ for i n. For each i,letCi = X~a Y~ .Then n \ bi  i \ bi µ(C ) ✏ for each i and, when i

Theorem 7.16. Suppose M is 1-saturated and µ(M) is finite. Let N be a countable elementary substructure@ of M. Let p, q be types over N and suppose tp(~a / N )=tp(~a /N )=p, tp(~b/N)=tp(~b /N )=q with tp(~a / N ~b ), tp(~a /N 0 0 [{ } 0 [ ~b ) wide. Then for any definable sets X and Y over N, we have µ(X Y ) > 0 { 0} ~a \ ~b i↵ µ(X~a Y~ ) > 0. 0 \ b0 Proof. Fix an extension q0 of q to an N-invariant global type; this is possible by ~ Lemma 7.11. Let ~a ⇤ ✏ p and b⇤ ✏ q0 N ~a ⇤ .Ifµ(X~a Y~ ) > 0 then by Lemma | [{ } ⇤ \ b⇤ 7.14, both µ(X~a Y~) > 0 and µ(X~a Y~ ) > 0. Otherwise, µ(X~a Y~ ) = 0, \ b 0 \ b0 ⇤ \ b⇤ and by Lemma 7.15, both µ(X Y ) = 0 and µ(X Y ) = 0. ~a \ ~b a0 \ b0 ⇤ Definition 7.17. Let N be an elementary substructure of M.AsetR M 2m ✓ is wide-stable over N if R is N-invariant and whenever tp(~a / N )=tp(~a 0/N ), tp(~b/N)=tp(~b /N ), both tp(~a / N ~b ) and tp(~a /N ~b ) are wide, and (~a , ~b) 0 [{ } 0 [{ 0} 2 R, then also (~a ,~b ) R. 0 0 2 R is stable over N if whenever (~a i,~bi) is a sequence of indiscernibles over N and R(~a i,~bj) holds for every i0, there is a stable (respectively, wide-stable) set S definable over N such that µ(R S) <✏. 4 Observe that the wide-stable subsets of M 2m form a -algebra. It can be shown that stable subsets of M 2m form a Boolean algebra. Note that if we replace wideness in the definition of wide-stability with non-forking, we obtain a standard consequence of stability (see Lemma 3.3 of [25]). In particular, since wide types are non-forking, stable implies wide-stable.

Theorem 7.18. Let M be 1-saturated, let N be a countable elementary substruc- @ 2 ture of M,andsupposeµ is finite. If R M is in 2(N), then the following are equivalent: ✓ B

(1) There is U 2,1(N) such that µ(R U)=0; (2) R is ADS; 2B 4 (3) R is ADWS. Proof. (1) (2): First observe that every set of the form A B with A, B ) ⇥ definable over N, is stable: if (ai,bi : i I) is a sequence of indiscernibles over N and (a ,b ) A B for i0, there 2B2,1 4 is S 0 (N) such that µ(R S) <✏; such an S is stable. 2B2,1 4 (2) (3): Immediate since stable definable sets are wide-stable and definable. (3) ) (1): Let R M 2 be definable over N and wide-stable over N.Since ) ✓ 2,1(N) is complete with respect to the pseudometric µ( ), it suces to prove B ·4· B (1) for such an R. For any N-definable A and B and any ✏>0, define A✏ = a A : M m <✏.B R .Set { 2 ✏ y \ a} = A B : µ((A B) R)=0, A, B (N) (AB B):A, B (N) . U { ⇥ ⇥ \ 2B1 }[{ 1/n⇥ 2B1 } n \ Clearly U = belongs to 2,1(N) and satisfies µ(U R) = 0. Suppose, towardsU a contradiction,B that µ(R U) >\0. Then we may find an (a, b) R U Ssuch that tp(a/N) and tp(b/N a )\ are wide. For each A tp(a/N) and B2 tp(\ b/N), we have A B , and therefore[{ } µ((A B) R) > 0.2 Therefore p =(tp(2a/N) tp(b/N)) ⇥R(62x, U y) is a wide partial type.⇥ \ Set ⇥ [{¬ } >0 p0 = p S(x, y):( ✏ Q )(my <✏.S(x, y) p) . [{¬ 8 2 2 } We claim this is also a wide partial type. Towards this end, fix A and B definable over N such that a A and b B. Also fix S(x, y) definable over N so that, for >0 2 2 >0 each ✏ Q , my <✏.S(x, y) p.Since(a, b) / U, we have some ✏ Q such 2 2 2 2 that AB tp(a/N). Set ✏ 62 A0 = a0 A : M =(m ✏.(B R )) (m <✏.S(a0,y)) . { 2 | y \ a0 ^ y } Observe that A0 tp(a/N), whence µ(A0) > 0. It is enough to show that µ((A0 B) ( R S))2> 0. Suppose this is not the case. Then ⇥ \ ¬ \¬ µ((A0 B) R)=µ((A0 B) (S R)). ⇥ \ ⇥ \ \ However,

µ((A0 B) R)= µ(B R )dµ ✏µ(A0) ⇥ \ \ a0 Za0 A0 while 2

µ((A0 B) (S R)) = µ(B (Sa0 Ra0 ))dµ < ✏µ(A0), ⇥ \ \ a A \ \ Z 02 0 yielding a contradiction. Now take any extension of p0 to a wide type q and suppose that (a0,b0) real- izes q. It follows immediately that tp(b0/N a0 )iswide,tp(a0/N )=tp(a/N), and tp(b /N )=tp(b/N). Since tp(b/N a[){ is} wide and tp(a /N )=tp(a/N), 0 [{ } 0 whenever Ba tp(b/N a ), µ(Ba0 ) > 0. By 1-saturation, there is a b00 with tp(b /N a 2)=tp(b/N[{ }a ). But now we have@ (a ,b) R and (a ,b ) R, 00 [{ 0} [{ } 0 0 62 0 00 2 contradicting wide-stability. ⇤ We could generalize these notions to stable relations on pairs of n-tuples, by using the two algebras and (the algebras of sets of 2n-tuples B2n,[1,n] B2n,[n+1,2n] depending only on the first n or only on the second n coordinates, respectively); the arguments are exactly analogous, replacing the singletons with n-tuples. Combining Theorem 7.16 and the proof of the previous theorem, we see:

Corollary 7.19. Suppose M is 1-saturated and µ(M) is finite. Suppose that N is a countable elementary substructure@ of N and that X and Y are definable over N. Then (a, b):µ(X Y ) > 0 di↵ers from an element of by a null set. { a \ b } B2,1 24 ISAAC GOLDBRING AND HENRY TOWSNER

7.3. Hypergraph Removal. We now give a proof of the hypergraph removal lemma [11, 17, 27]; this proof is closely related to the infinitary proof given by Tao [30] in a di↵erent framework. Suppose is the -algebra generated by some collection of formulae with parameters fromB an elementary substructure M of N. Two natural ways to extend would be by extending the collection of formulae and by extending the set M. TheB following lemma states that these two methods are orthogonal in a certain sense. This lemma will be applied in the particular case of the algebras (M), Bn, i,j m ij i (~x , bi) j (~x , bj)  ~ ~ 2R P i m,j k i↵j i (~x , bi)'j (~x , di)   ~ ~ +R P i,j k ↵i↵j'i (~x , di)'j (~x , dj).  R P For each i m, j k, we may choose an r such that (~x , ~b ) (~x , d~ )dµ <   ij i i 'j i r and for each i, j k we may choose an s such that (~x , d~ ) (~x , d~ )dµ < ij ij R 'i i 'j i s , and we may choose these so that ij R (✏ (✏ )/2)2 > (~x , ~b ) (~x , ~b ) 2 r ↵ + s ↵ ↵ . i j i i j j ij i j ij i j Z i,j m i m,j k i,j k X X X

3Hrushovski has pointed out that this proof is reminiscent of early proofs in the stability theory of algebraically closed fields. The full connection between this argument and the amal- gamation methods from the previous section is not completely understood. AN APPROXIMATE LOGIC FOR MEASURES 25

Now let ⇢(~b1,...,~bm, d~1,...,d~k) be the formula m

(~xR , ~b ) ↵ (~x , d~0 ) 2 <✏ (✏ )/2 || i i i i 'i i ||L i m i k X X and

f ↵ (~x , d~0 ) 2 <✏ (✏ )/4. || i 'i i ||L i k X ~ Since i k ↵i'i (~x , di0 ) is measurable with respect to , this contradicts the  A assumption that f E(f ) 2 = ✏. P || |A||L ⇤ The following theorem is essentially the infinitary version of hypergraph re- moval: Theorem 7.21. Let M be an elementary substructure of N. Let n k, [1,n] I✓ k , and suppose that for each each I with I = k, we have a set AI 2I | | 0 2 n,I (M), and suppose there is a >0 such that whenever BI n,I (M) and B n n 2B µ (AI BI ) <for all I , I BI is non-empty. Then µ ( I AI ) > 0. \ 2I 2I 2I Proof. We proceed by main inductionT on k.Whenk = 1, theT claim is trivial: we must have µ(AI ) > 0 for all I, since otherwise we could take BI = ;then n ; µ ( AI )= µ(AI ) > 0. So we assume that k>1 and that whenever BI n 2 n,I (M) and µ (AI BI ) <for all I, I BI is non-empty. Throughout this B T Q \ 2I proof, the variables I and I0 range over elements of . We write (M) for (MT). I Bn,

n (A E(A n,

n (A E(A (M))) A dµ I0 I0 |Bn,

Observe that for any choice of ai i I0 , n,

The function I=I Ai ( xi i I0 , ai i I0 ) is measurable with respect to n,

Since this holds for any ai i I0 , the claim follows by integrating over all choices of a . { } 62 { i} a

We next show that, without loss of generality, we may assume each AI0 belongs to n,

Claim 2. For any I0, there is an A0 n,I 0, µn( A ) > 0. I0 0 I=I0 I I I • \ 6 T 2I n Proof. Define A0 :=T xI0 E(AI n, 0 .Ifµ (A0 AI ) > I0 { | 0 |B } I0 \ I=I0 0thenwehave 6 n T E(AI n, 0, 0 |B Z I=I0 Y6 n and by the previous claim, this implies that that µ ( AI ) > 0. 0 n Suppose that for each I, BI n,I (M)withµ (AI BI ) <for I = I0 and n 2B T \ 6 µ (A0 BI ) <.Since I0 \ 0 n n n µ (AI0 AI0 0 )= AI (1 A0 ) dµ = E(AI n, |I|+1 . B { | |B |I| } Claim 3. For each I, µn(A A ) /2 I \ I⇤  1 Proof. AI A⇤ is the set of points such that (AI E(AI )) (~a ) .By \ I |B +1 Chebyshev’s inequality, the measure of this set is at most |I|

2 2 n 2 2 ( + 1) (AI E(AI )) dµ =( + 1) AI E(AI ) 2 n . |I| |B |I| k |B kL (µ )  2 Z a Claim 4. µn( A ) µn( A )/ ( + 1). I I I I⇤ |I| T T AN APPROXIMATE LOGIC FOR MEASURES 27

Proof. For each I0,

n n µ ((AI⇤ AI0 ) AI⇤)= A⇤ (1 AI ) A⇤ dµ 0 \ \ I0 0 I I=I0 Z I=I0 \6 Y6 n = A⇤ (1 E(AI )) A⇤ dµ I0 0 |B I Z I=I0 Y6 1 n A dµ  +1 I⇤ I |I| Z Y2I 1 n = µ ( A⇤) +1 I I |I| \2I But then

n n n µ ( A⇤ A ) µ ((A⇤ A ) A⇤) |I| µ ( A⇤). I \ I  I0 \ I0 \ I  +1 I I I I0 I=I0 I \2I \2I X \6 |I| \2I a Each AI⇤ may be written in the form i r AI,i⇤ where AI,i⇤ = I AI,i,J⇤ I J (k 1)  2 and A is an element of 0 (M). We may assume that if i = i then A I,i,J⇤ Bn,J S 6 T0 I,i⇤ \ A⇤ = . I,i0 ; We have n n µ ( AI⇤)=µ ( AI,i⇤ I ,J ). I ~ I I i I [1,rI ] J (k 1) \ 2 [ \ 2\ Q For each ~i [1,rI ], let D = I A⇤ . Each A⇤ is an element of I ~i I J ( ) iI ,J,I I,iI ,J 2 2 k 1 0 (M), so we may group the components and write D = [1,n] D where n,J Q T T ~i J ( ) ~i,J B 2 k 1 D = A . ~i,J I J I,i⇤ I ,J T n ~ Suppose, for a contradiction, that µ ( I AI⇤) = 0. Then for every i I [1,rI ], n T n 2 µ (D~)=µ ( D~ ) = 0. By the inductive hypothesis, for each >0, there is i J i,J T Q a collection B 0 (M) such that µn(D B ) <and B = .In T~i,J n,J ~i,J ~i,J J ~i,J 2B \ ; particular, this holds with = k . 2(k 1)( I rI )(maxI rI ) T For each I,i r ,J I,define  I ⇢ Q

BI,i,J⇤ = AI,i,J⇤ B~i,J AI⇤ ,i ,J . \ 2 [ 0 I0 3 ~ I J,I =I i,i\I =i 0◆[06 n 4 5 Claim 5. µ (AI,i,J⇤ BI,i,J⇤ ) k . \  2(k 1)(maxI rI ) Proof. Observe that if x A B then for some ~i with i = i, x B 2 I,i,J⇤ \ I,i,J⇤ I 62 ~i,J [ A . This means x B and x A⇤ = D .So I0 J,I 0=I I⇤ ,i ,J ~i,J I0 J I0,i ,J ~i,J ◆ 6 0 I0 62 2 ◆ I0 S n n T µ (AI,i,J⇤ BI,i,J⇤ ) µ (D~i,J B~i,J ) k . \  \  2 (maxI rI ) ~i [1,r ] k 1 2 XI I Q a Define BI⇤ = i r J BI,i,J⇤ .  I Claim 6. µn(A S B )T . I \ I⇤  28 ISAAC GOLDBRING AND HENRY TOWSNER

Proof. Since µn(A A ) /2, it suces to show that µn(A B ) /2. I \ I⇤  I⇤ \ I⇤ 

n n µ (AI⇤ BI,i,J⇤ )=µ AI,i,J⇤ BI,i,J⇤ \ \ ! [i \J [i \J [i \J n µ AI,i,J⇤ BI,i,J⇤  \ !! [i \J \J n µ A⇤ B⇤  I,i,J \ I,i,J i r J J ! X I \ \ n µ (A⇤ B⇤ )  I,i,J \ I,i,J i r J X I X k r  I · k 1 · k 2 k 1 (maxI rI ) ✓ ◆ /2.  a Note that the sets B satisfy the assumption, and therefore B = . I⇤ I I⇤ 6 ; Claim 7. T B⇤ B . I ✓ ~i,J \I [~i \J

Proof. Suppose x I BI⇤ = I i r J BI,i,J⇤ . Then for each I, there is an 2  I iI rI such that x B⇤ .SinceB⇤ A⇤ , for each I and J I,  2T J I,iI ,JT S TI,iI ,J ✓ I,iI ,J ⇢ x A⇤ . 2 I,iI ,J For any J,letI JT.Then

x BI,i⇤ I ,J = AI,i⇤ I ,J B~i,J AI⇤ ,i ,J . 2 \ 2 [ 0 I0 3 ~i ,i =i I0 J,I 0=I 0 \I0 I ◆[ 6 4 5 In particular, x B (A ) for the particular~i we have chosen. ~i,J I0 J,I 0=I I⇤ ,i ,J 2 [ ◆ 6 0 I0 Since x AI,i⇤ ,J forh each I0 J, it must bei that x B~i,J . This holds for any J, 2 I0 S 2 so x B . 2 J ~i,J a T ~ Since I BI⇤ is non-empty, there is some i such that J B~i,J = .Butthis n 6 ; leads to a contradiction, so it must be that µ ( I AI⇤) > 0, and therefore, as we T n 1 n T have shown, µ ( I AI ) +1 µ ( I AI⇤) > 0. ⇤ 2I |I| 2I T Corollary 7.22.TFor each ✏>0,k andT each k-regular hypergraph (W, F ) there is a >0 such that whenever (V,E) is a k-regular hypergraph such that there are W k at most V | | copies of (W, F ), it is possible to remove at most ✏ V edges to obtain a hypergraph| | with no copies (W, F ). | | Proof. Suppose not. Fix ✏>0,k,(W, F ) so that for each K, there is an k-regular W hypergraph (VK ,EK ) with at most V | | copies of (W, F ) and such that every | | n sub-hypergraph with at least EK ✏ VK edges contains a copy. We consider a signature of| AML| consisting| | of an k-ary predicate E. We con- sider finite measured structures NK defined as follows: AN APPROXIMATE LOGIC FOR MEASURES 29

The universe of N is V , • K K The measures on NK are given by the normalized counting measure, • E is interpreted by E . • K Let N be a (nonprincipal) ultraproduct of these structures and fix a countable [1,n] elementary submodel M. We may assume W =[1,n]. For each I k ,define I 2 n E n,I (M) to be the copy of E on the coordinates I. Observe that if ~x N , 2B I n I 2 ~x is a copy of W exactly if W I F E . In particular, µ ( I F E ) = 0. 2 2 2 n I By the preceding theorem, we can find definable sets BI such that µ (E [1,nT] T \ BI ) <✏/ for each I k so that I BI = . Note that saying this intersection|I| of definable sets2 is empty is expressed by; a single formula, and T is therefore true for almost every structure (VK ,EK ). But then for some K, (VK ,EK BI (GK )) is a sub-hypergraph obtained by removing fewer than k \ ✏ VK edges and containing no copies of (W, F ), yielding a contradiction. ⇤ | | T The second author has extended this method [33] to the setting where (V,E) is a dense sub-hypergraph of a sparse random hypergraph. In this setting one re- places the normalized counting measure with a new counting measure normalized by the ambient random hypergraph, causing substantial additional complications. Remark 7.23. Szemer´edi’s Theorem follows from hypergraph removal using the following, now standard, encoding. Given A [1,n], to find an arithmetic pro- gression of length k + 1, we define a k + 1-partite✓ k-regular hypergraph. For each i [1,k], we take the part Xi to be a copy of [1,n], and we take Xk+1 to be a copy2 of [1,k2n]. Given x X for all i,wesay(x ,...,x ) is an edge i↵ i 2 i 1 k i k i xi A, and when 1 i k,(x1,...,xi 1,xi+1,...,xk+1) is an edge i↵ · 2    j x + i(x x ) A. Pj k,j=i · j k+1 j k,j=i j 2 Suppose6 (x ,...,x ) is a copy6 of the complete k-regular hypergraph on P 1 k+1 P k + 1 vertices (that is, every k-tuple is an edge) with x = x .Thenset k+1 6 i k i a = i x and d = x x = 0. Then we have a A, and for each i k i k+1 i k i P i k,wehave ·  6 2  P P a + id = j x + i(x x )= j x + i(x x ) A. · j k+1 j · j k+1 j 2 j k j k j k,j=i j k,j=i X X X6 X6 On the other hand, for any a A and any sequence (x ,...,x )witha = 2 1 k i k i xi,thesequence(x1,...,xk, i k xi) is also a copy of the complete k- regular · hypergraph on k+1 vertices. It is not possible to remove all such sequences byP removing a small number of edges,P so hypergraph removal implies that there must be many copies of the complete k-regular hypergraph on k +1 vertices;but there are only a small number of sequences (x1,...,xk, i k xi), so the remaining copies must correspond to genuine arithmetic progressions. P

7.4. Gowers Norms.

Definition 7.24. Let G be a finite abelian group and consider g : G R.We ! define the k-th Gowers uniformity norm, k ,by || · ||U k 1 g 2 = g(x + ! ~h). || ||U k G k+1 · | | x G ~h Gk ! 0,1 k X2 X2 2Y{ } 30 ISAAC GOLDBRING AND HENRY TOWSNER

It is not immediate that the right-hand side of the above display is nonnegative; however, this can be derived using an argument similar to that in the proof of Lemma 7.27 below. The Gowers norms were introduced by Gowers in his proof of Szemer´edi’s Theorem [16]. Since then, the norms have proven to be powerful tools in com- binatorics; for instance, these norms have been used to give a proof of the hy- pergraph regularity lemma [17] and in the proof of the Green-Tao theorem on arithmetic progressions in the primes [19]. Related norms for dynamical systems, the Gowers-Host-Kra norms, we introduced by Host and Kra [21], and have sim- ilarly been used to prove recurrence theorems in dynamical systems (for a few examples, see [3, 8]; [12] describes the general method and cites more than twenty examples). Roughly speaking, the U 2 norm is large when a function has a large corre- lation with some group character. The U k norms for larger k are large when a function correlates with a canonical function of a more general type. The exact characterization of these canonical functions was a substantial project [18, 20]. Here we show that, in the setting of AML, these canonical functions can be taken to be the simple functions generated by algebras k,k 1. B In the infinite setting, we give a slightly more general definition:

Definition 7.25. Let M be a measured AML structure and let f : M k R be ! bounded and k-measurable. Define U k by: B || · || 1 k f 2 = f(h!(1),...,h!(k))dµ2k(~h0,~h1). || ||U k 1 k 1 Z ! 0,1 k 2Y{ } Suppose further that + is a definable group operation on M and g : M R k k ! is bounded. Then define f : M R by f(h1,...,hk)=g( hi) and define ! i=1 g U k := f U k . || || 1 || || 1 P Note that in the infinite setting, these are seminorms (and not even a seminorm for k = 1).

Lemma 7.26. Let (Gi : i N) be a sequence of finite abelian groups and, for 2 each i, let gi : Gi [ 1, 1] be a function such that limi gi U k exists. Let be the signature! obtained by adding to the signature for!1 abelian|| || groups unary L predicates Pq for q Q [ 1, 1]. Let Gi be the AML -structure associated to 2 \ L G , equipped with its normalized counting measure, by interpreting P Gi := a i q { 2 Gi : gi(a)

2k 1 !(i) gi U k = 2k gi( hi ), || || Gi | | ~h0,~h1 Gk ! 0,1 k i X2 2Y{ } X which is easily seen by making the substitutions x = h0 and h = h1 i i i i 0 k 2k ~ !(p) k hi .Defineji : Gi Gi by ji(h)=( hp : ! 0, 1 ); observe that ! k 2P{ } (j ) is uniformly definable in G . Now define g : G2 [ 1, 1] by g ((x )) = i i P i0 i ! i0 ! ! 0,1 k gi(x!). Then the lemma follows from Theorem 4.13 (applied to (gi0) and2 ({j )).} Q i ⇤ AN APPROXIMATE LOGIC FOR MEASURES 31

For the rest of this subsection, we fix f : M R which is bounded and -measurable. We further assume that each µk is a! probability measure on . Bk Bk Lemma 7.27. k fdµ f U k . || || 1 Z Proof. Using Fubini’s theorem, we have 2k 2k k k 1 f(~h)dµ (~h) = f(~h)dµ(hk) dµ (h1,...,hk 1) . Z Z ✓Z ◆ By Cauchy-Schwarz and Fubini again, we have k k 1 2 2 ~ k ~ 0 1 k+1 f(h)dµ (h) f(h1,...,hk 1,hk)f(h1,...,hk 1,hk)dµ .  Z ✓Z ◆ Repeating this process, we arrive at 2k f(~h)dµk(~h) f(h!(1),...,h!(k))dµ2k(~h0,~h1)  0 1 k 1 Z Z ! 0,1 k 2Y{ } @ 2k A = f U k . || || 1 ⇤ Lemma 7.28. For each I [1,k] with I = k 1, let B be a definable set in ✓ | | I k,I. Then 0 f I BI U k f U k . B || || 1 || || 1

Proof. It suces toQ show that 0 fBI U k f U k for a single I. Without || || 1 || || 1 loss of generality, we assume I =[1,k 1]. Since f = fB + f ,wehave I BI 2k 2k f k = f + f k U BI BI U || || 1 || || 1 k which in turn expands into a sum of 22 terms of the form !(1) !(k) 2k ~ 0 ~ 1 (fS! )(h1 ,...,hk )dµ (h , h ), Z ! 0,1 k 2Y{ } 2k where each S! is either B or . Observe that fB k corresponds to the I BI k I kU 1 2k term when each S! = BI . Thus, it suces to show that all of the 2 terms are non-negative. Observe that if !(i)=! (i) for each i I but S = S then for any 0 2 ! 6 !0 S! S = 0, whence the corresponding integral is 0. We thus restrict ourselves !0 to the case where, whenever ! I = !0 I, S! = S!0 . In this case, we have

!(1) !(k) 2k ~ 0 ~ 1 (fS! )(h1 ,...,hk )dµ (h , h ) Z ! 0,1 k 2Y{ } !(1) !(k) 2 0 1 2(k 1) = (fS! )(h1 ,...,hk )dµ (hk,hk)dµ ZZ! 0,1 k 2Y{ } 2 !(1) !(k) 2(k 1) = (f )(h ,...,h )dµ(h ) dµ . 2 S! 1 k k 3 Z Z ! 0,1 k 2Y{ } 4 5 32 ISAAC GOLDBRING AND HENRY TOWSNER

Since the inside of the integral is always non-negative, this term is non-negative. ⇤ ~ 0 !(1) !(k) k ~ 1 We set D(f)(h ):= ! 0,1 k,!=~0 f(h1 ,...,hk )dµ (h ). Observe that 2{ } 6 2k k ~ 0 f U k = f D(f)dµ (Rh Q). k k 1 · Lemma 7.29.R D(f) is measurable with respect to k,k 1. B Proof. It suces to show that if E(f k,k 1) =0then || |B || f(~h0)D(f)(~h0)dµk(~h0)=0. Z We have ~ 0 ~ 0 k ~ 0 ~ 0 !(1) !(k) 2k ~ 0 ~ 1 f(h )D(f)(h )dµ (h )= f(h ) f(h1 ,...,hk )dµ (h , h ) Z Z ! 0,1 k,!=~0 2{ Y} 6 ~ 0 !(1) !(k) k ~ 0 k ~ 1 = f(h ) f(h1 ,...,hk )dµ (h )dµ (h ). ZZ ! 0,1 k,!=~0 2{ Y} 6

Observe that, for a given ~h1,wehave ~ 0 !(1) !(k) k ~ 0 f(h ) f(h1 ,...,hk )dµ (h )=0 Z ! 0,1 k,!=~0 2{ Y} 6 !(1) !(k) since k ~ f(h1 ,...,h )is k,k 1-measurable. The lemma now fol- ! 0,1 ,!=0 k B lows. 2{ } 6 Q ⇤ Theorem 7.30. f U k > 0 if and only if E(f k,k 1) > 0. || || 1 || |B || k ~ 0 Proof. If f U k > 0, then fD(f)dµ (h ) > 0; since D(f)is k,k 1-measurable, || || 1 B E(f k,k 1) > 0. || |B || R For the other direction, if E(f k 1) > 0, we may find I -measurable BI so that f dµ = 0, whence|| |B || B BI 6 R Q 0 < f BI dµ f BI U k f U k . | ||| || 1 || || 1 Z YI YI ⇤ References [1] Tim Austin. Deducing the multidimensional Szemer´edi theorem from an infinitary removal lemma. J. Anal. Math.,111:131–150,2010. [2] Seyed-Mohammad Bagheri and Massoud Pourmahdian. The logic of integration. Arch. Math. Logic,48(5):465–492,2009. [3] V. Bergelson, B. Host, B. Kra, and I. Ruzsa. Multiple recurrence and nilsequences. Inven- tiones Mathematicae, 160(2):261–303, May 2005. [4] Vitaly Bergelson. Ergodic Ramsey theory. In Logic and combinatorics (Arcata, Calif., 1985), volume 65 of Contemp. Math., pages 63–87. Amer. Math. Soc., Providence, RI, 1987. [5] Vitaly Bergelson. Ergodic theory and Diophantine problems. In Topics in symbolic dynamics and applications (Temuco, 1997), volume 279 of London Math. Soc. Lecture Note Ser., pages 167–205. Cambridge Univ. Press, Cambridge, 2000. [6] C.C. Chang and J. Keisler. Model Theory, volume 73 of Studies in Logic and the Foundations of Mathematics. Elsevier, 1990. [7] Z. Chatzidakis and A. Pillay. Generic structures and simple theories. Ann. Pure Appl. Logic, 95(1-3):71–92, 1998. AN APPROXIMATE LOGIC FOR MEASURES 33

[8] Qing Chu. Convergence of weighted polynomial multiple ergodic averages. Proc. Amer. Math. Soc.,137(4):1363–1369,2009. [9] G. Elek. Weak convergence of finite graphs, integrated density of states and a cheeger type inequality. Journal of Combinatorial Theory, Series B,98(1):62–68,2008. 10.1016/j.jctb.2007.03.004. [10] G. Elek and B. Szegedy. Limits of hypergraphs, removal and regularity lemmas. a non- standard approach. unpublished, 2007. [11] Peter Frankl and Vojtech R¨odl. Extremal problems on set systems. Random Structures Algorithms,20(2):131–164,2002. [12] N. Frantzikinakis. Some open problems on multiple ergodic averages. ArXiv e-prints, March 2011. [13] H. Furstenberg and Y. Katznelson. Idempotents in compact semigroups and Ramsey theory. Israel J. Math.,68(3):257–270,1989. [14] Harry Furstenberg. Ergodic behavior of diagonal measures and a theorem of sze- merdi on arithmetic progressions. Journal d’Analyse Mathmatique,31:204–256,1977. 10.1007/BF02813304. [15] R. Goldblatt. Lectures on the Hyperreals: An introduction to nonstandard analysis, volume 188 of Graduate Texts in Mathematics. Springer-Verlag, 1998. [16] W. T. Gowers. A new proof of Szemer´edi’s theorem. Geometric And Functional Analysis, 11(3):465–588, Aug 2001. 10.1007/s00039-001-0332-9. [17] W. T. Gowers. Hypergraph regularity and the multidimensional Szemer´edi theorem. Ann. of Math. (2),166(3):897–946,2007. [18] Ben Green and Terence Tao. An inverse theorem for the Gowers U sp 3(G) norm. Proc. Edinb. Math. Soc. (2),51(1):73–153,2008. [19] Ben Green and Terence Tao. The primes contain arbitrarily long arithmetic progressions. Ann. of Math. (2),167(2):481–547,2008. [20] Ben Green, Terence Tao, and Tamar Ziegler. An inverse theorem for the Gowers U 4-norm. Glasg. Math. J.,53(1):1–50,2011. [21] B. Host and B. Kra. Nonconventional ergodic averages and nilmanifolds. Ann. of Math. (2), 161(1):397–488, 2005. 10.4007/annals.2005.161.397. [22] Ehud Hrushovski. Stable group theory and approximate subgroups. http://www.math.huji.ac.il/ ehud/NQF/nqf.pdf, December 2009. [23] A. Kechris. Classical Descriptive Set Theory, volume 156 of Graduate Texts in Mathematics. Springer-Verlag, 1995. [24] H. J. Keisler. Probability quantifiers. In Model-theoretic logics, Perspect. Math. Logic, pages 509–556. Springer, New York, 1985. [25] B. Kim and A. Pillay. Simple theories. Ann. Pure Appl. Logic,88(2-3):149–164,1997. [26] Y. Kohayakawa. Szemer´edi’s regularity lemma for sparse graphs. In Foundations of compu- tational mathematics (Rio de Janeiro, 1997), pages 216–230. Springer, Berlin, 1997. [27] Brendan Nagle, Vojtech R¨odl, and Mathias Schacht. The counting lemma for regular k- uniform hypergraphs. Random Structures Algorithms,28(2):113–179,2006. [28] Endre Szemer´edi. Regular partitions of graphs. In Probl`emes combinatoires et th´eorie des graphes (Colloq. Internat. CNRS, Univ. Orsay, Orsay, 1976), volume 260 of Colloq. Inter- nat. CNRS, pages 399–401. CNRS, Paris, 1978. [29] T. Tao. An Introduction to Measure Theory, volume 126 of Graduate Studies in Mathemat- ics. American Mathematical Society, 2011. [30] Terence Tao. A correspondence principle between (hyper)graph theory and probability the- ory, and the (hyper)graph removal lemma. Journal d’Analyse Mathmatique,103:1–45,2007. 10.1007/s11854-008-0001-0. [31] Terence Tao. Norm convergence of multiple ergodic averages for commuting transforma- tions. Ergodic Theory Dynam. Systems,28(2):657–688,2008. [32] Henry Towsner. Convergence of diagonal ergodic averages. Ergodic Theory Dynam. Systems, 29(4):1309–1326, 2009. 10.1017/S0143385708000722. [33] Henry Towsner. An analytic approach to sparse hypergraphs: Hypergraph removal. sub- mitted, 2012. 34 ISAAC GOLDBRING AND HENRY TOWSNER

University of Illinois at Chicago, Department of Mathematics, Statistics, and Computer Science, Science and Engineering Offices (M/C 249), 851 S. Morgan St., Chicago, IL 60607-7045, USA E-mail address: [email protected] URL: www.math.uic.edu/~isaac

University of Pennsylvania, Department of Mathematics, 209 S. 33rd Street, Philadelphia, PA 19104-6395 E-mail address: [email protected] URL: www.sas.upenn.edu/~htowsner