Minimizing the frequency of carries in modular addition
aa r X i v : . [ m a t h . N T ] N ov MINIMIZING THE FREQUENCY OF CARRIES IN MODULARADDITION
FRANCESCO MONOPOLI
Abstract.
When adding integers in base m , carries occur. The same happens moduloa generic integer q when the set of digits is a complete set of residues modulo m forsome positive integer m dividing q . In this paper we prove that asymptotically everydigital set in this setting induces carries with frequency at least 1 /
4, thus generalizingresults of Alon, Diaconis, Shao and Soundararajan. Introduction
Fix a nonnegative integer m . Adding integers in base m results in carries in thefollowing way: take a set A of m elements, the digits, which is a complete set of residuesmodulo m . We will call such a set a digital set . Adding integers x , x with last digits a , a ∈ A , we find the unique element a ∈ A such that a + a ≡ a (mod m ) , which will be the last digit of the sum, and ( a + a − a ) /m will be the carry .It is natural to look for digital sets which minimize either the number of distinctcarries or their frequency at which they generate carries, thus looking for an answer tothe following two questions: Q1:
What is the minimal number of distinct carries that a digital set A induces, i.e.,can we bound from below the quantity C ( A ) := (cid:12)(cid:12)(cid:12)(cid:12)(cid:26) a + a − am : a , a , a ∈ A, a + a ≡ a mod m (cid:27)(cid:12)(cid:12)(cid:12)(cid:12) , and what is the structure of digital sets inducing the minimal number of distinct carries? Q2:
What is the minimal frequency of carries, i.e., can we bound from below thequantity C ( A ) := |{ ( a , a ) ∈ A × A : a + a A }|| A | , and what is the structure of digital sets inducing the minimal frequency of carries?It is not hard to prove that for any digital set A ⊆ Z , C ( A ) ≥ m C ( A ) ≥⌊ m / ⌋ . Moreover, up to certain linear transformations, the only digital set whichinduces only two distinct carries is [0 , m − − m/ , m/
2] (see [3]).The same two questions can be formulated when addition is done modulo a positiveinteger q . In this setting, for m | q , a digital set is a set A ⊆ Z q , | A | = m , which is acomplete set of coset representatives for m Z q .Diaconis, Shao and Soundararajan [3], using an adaptation of the rectification argu-ments in [2] and [5] to this setting, prove that, if q = p and m = p for an odd prime p , then C ( A ) ≥ C ( A ) = 2, then there exist c ∈ Z × p and d ∈ p Z p such that either cA + d = { , , . . . , p − } or cA + d = { , , . . . , p } , thus giving a complete answerto the first question modulo the square of a prime.The aforementioned result has been recently generalized to the generic modulus case[8]. When q is not a prime power we have to impose the additional condition on q and m , that both are composed of the same primes, and the exponent of each primein q is strictly greater than in m . This assumption, which does not exclude anywaythe case of digital sets of cardinality m modulo m , is needed in order to avoid trivialcases of digital sets which are either contained in a nontrivial coset, or are union ofcosets of a nontrivial subgroup. Under this hypothesis, the main result in [8] states that C ( A ) ≥
2, and if C ( A ) = 2, then there exist c ∈ Z × q and d ∈ m Z q such that either cA + d = { , , . . . , m − } or cA + d = { , , . . . , m } .As far as the second question is concerned, Alon [1] proves that for any digital set A ⊆ Z p of cardinality p for an odd prime p , we have C ( A ) ≥ ( p − / p .The proof relies on Pollard’s inequality for sets A ⊆ Z q with the Chowla property,i.e. such that ( a − a , q ) = 1 for any a , a ∈ A . Digital sets in Z p of cardinality p have this property, but this is no longer true if the cardinality of the digital set is nota prime.Generalizations of Pollard’s inequality for generic modulus exist (see [4], [6] and [7]),but none of the known bounds is strong enough to be used is an argument similar tothe one in [1] to provide a bound for C ( A ) in the generic modulus case.The only known bound for C ( A ) in this case can be found in [3], where the authorsprove that C ( A ) ≥ /
9, which is the best bound possible not dependent on the cardi-nality of the digital set, as can be seen by taking cosets representatives for 3 Z ⊆ Z .The main goal of this paper is to prove that the asymptotic bound C ( A ) ≥ / | A | → + ∞ holds, and this is the best bound possible, as can be seen by taking asymmetric interval as digital set. Theorem 1.1.
Let q and m be positive integers composed of the same primes such thatthe exponent of each prime in q is strictly greater than in m . Let A ⊆ Z q be a digital setwith | A | = m . Let p α = max { p α i i : p i prime , p α i i | m } and δ m = 1 if m is odd and δ m = 1 if m is even. Then C ( A ) ≥ µ ( m ) , where µ ( m ) = ( − /p α − /p α + δ m /m if p is odd, if p = 2 .In particular, lim m → + ∞ min | A | = m C ( A ) = 14 . Frequency of carries
For sets
A, B ⊆ Z q and t >
0, let S ( A, B, t ) = t X i =1 | A + i B | = X x ∈ Z q min( t, r A + B ( x )) , where A + i B = { x ∈ A + B : r A + B ( x ) ≥ i } is the set of elements in A + B having atleast i representations as the sum of an element in A and one in B . INIMIZING THE FREQUENCY OF CARRIES IN MODULAR ADDITION 3
Pollard’s inequality states that if A or B has the Chowla property, for 1 ≤ t ≤ min( | A | , | B | ) we have(2.1) S ( A, B, t ) ≥ t min( q, | A | + | B | − t ) . As already observed in the introduction, digital sets having nonprome cardinality donot have the Chowla property, and hence (2.1), which is the tool used in [1] to bound C ( A ) in the prime square modulus case, does not necessarly hold. Nevertheless, in thissection we first prove that, if q = p β is a power of a prime, digital sets A ⊆ Z q , | A | = p α ,0 < α < β , satisfy Pollard’s inequality for t = ⌊ p α / ⌋ :(2.2) S ( A, A, t ) ≥ t (2 p α − t ) . This allows us to prove that for such sets we have C ( A ) ≥ ( p α − p α if p is an odd prime, if p = 2.In order to do this we need the inverse theorem for Pollard’s inequality, due toNazarewicz, O’Brien, O’Neill and Staples [9], characterizing pairs of sets ( A, B ), one ofwhich has the Chowla property, which satisfy equality in (2.1) for some t . Theorem 2.1 (Nazarewicz, O’Brien, O’Neill and Staples) . Let
A, B ⊆ Z q , ≤ t ≤| B | ≤ | A | , B has the Chowla property and S ( A, B, t ) = t min( q, | A | + | B | − t ) . Thenone of the following holds:(1) | B | = t ,(2) | A | + | B | ≥ q + t ,(3) | A | = | B | = t + 1 , and B = g − A for some g ∈ Z q ,(4) A and B are arithmetic progression of the same common difference. We remark that the authors in [9] don’t prove the theorem in his generality for genericmodulus and sets with the Chowla property, but rather restrict their analysis to the caseof modulus q prime, so that the Chowla condition in trivially satisfied by any subset of Z q . However, it is not a hard task to modify their arguments to prove Theorem 2.1.For odd primes we prove the following: Theorem 2.2.
Let
A, B ⊆ Z p β , p odd, be digital sets, | A | = | B | = p α , with < α < β .Then the following hold:(i) S (cid:0) A, B, p α − (cid:1) ≥ p α − p α − ,(ii) S (cid:0) A, B, p α +12 (cid:1) ≥ p α +2 p α − ,(iii) S (cid:0) A, B, p α − (cid:1) = p α − p α − if and only if A and B are arithmetic progressions ofthe same common difference,(iv) S (cid:0) A, B, p α +12 (cid:1) = p α +2 p α − if and only if A and B are arithmetic progressions ofthe same common difference. Before proving the theorem, observe that (ii) implies (i), and (iv) implies (iii). Infact, if (ii) holds, then S (cid:18) A, B, p α − (cid:19) = X x ∈ Z pβ min (cid:18) p α − , r A + B ( x ) (cid:19) FRANCESCO MONOPOLI = X x ∈ Z pβ min (cid:18) p α + 12 , r A + B ( x ) (cid:19) − | A + pα +12 B |≥ p α + 2 p α − − p α = 3 p α − p α − , where | A + pα +12 B | ≤ p α since for every coset x + h p α i ⊆ Z p β we have X y ∈ x + h p α i r A + B ( y ) = p α , and so no more than one element in each coset can have more than ( p α + 1) / A + B . The same argument shows that (iv) implies (iii).To prove Theorem 2.2 we need some easily verified properties of the min function,contained in the following lemma. Lemma 2.3.
Let a i , b i ≥ , i = 1 , . . . , n and c ≥ . Then min n X i =1 a i , n X i =1 b i ! ≥ n X i =1 min( a i , b i )(2.3) n X i =1 min( c, a i ) ≥ min c, n X i =1 a i ! (2.4) Proof.
The first inequality is obvious, since the LHS is either P ni =1 a i or P ni =1 b i , andboth are clearly greater than P ni =1 min( a i , b i ).For the second inequality, if c ≤ a i for some i , then n X i =1 min( c, a i ) ≥ c = min c, n X i =1 a i ! , whereas, if c ≥ a i for all i , then n X i =1 min( c, a i ) = n X i =1 a i ≥ min c, n X i =1 a i ! . (cid:3) Proof of Theorem 2.2.
The proof of Theorem 2.2 goes by induction on α , for all β > α .For α = 1 the claims hold by Pollard’s inequality and Theorem 2.1.Suppose α ≥ A i = i + h p i , B i = i + h p i for i ∈ Z p , and A ′ i = A i − ip ⊆ Z p β − , B ′ i = B i − ip ⊆ Z p β − . Then for all i ∈ Z p , | A ′ i | = p α − , and A ′ i is a digital set in Z p β − , for, iftwo elements a ′ , a ′ ∈ A ′ i satisfy a ′ ≡ a ′ modulo p α − , then a = i + pa ′ ≡ i + pa ′ = a modulo p α , a , a ∈ A , a contradiction with the hypothesis of A being a digital set. Thesame also holds the B ′ j ’s, and so we can apply the induction hypotheses for A ′ i and B ′ j , i, j ∈ Z p .Let δ = P ( A ′ i , B ′ j are arithmetic progressions of the same common difference) INIMIZING THE FREQUENCY OF CARRIES IN MODULAR ADDITION 5 and, for i, j ∈ Z p , let δ i,j = ( A ′ i , B ′ j are arithmetic progressions of the same common difference,0 otherwise,so that δp = P i,j ∈ Z p δ i,j .Define the map ϕ : Z p × Z p → (cid:26) p α − − , p α − + 12 (cid:27) such that, given k ∈ Z p , for exactly ( p − / i, j ) ∈ Z p × Z p with i + j ≡ k mod p we have ϕ ( i, j ) = ( p α − − / p + 1) / i, j ) ∈ Z p × Z p with i + j ≡ k mod p we have ϕ ( i, j ) = ( p α − + 1) /
2. Then, using Lemma 2.3 and theinductive hypotheses, we have X x ∈ Z pβ min (cid:18) p α + 12 , r A + B ( x ) (cid:19) ≥ X k ∈ Z p X x ∈ k + h p i X i + j ≡ k mod p min (cid:0) ϕ ( i, j ) , r A i + B j ( x ) (cid:1) ≥ X k ∈ Z p X i + j ≡ k mod p X x ∈ k + h p i min (cid:0) ϕ ( i, j ) , r A i + B j ( x ) (cid:1) ≥ X k ∈ Z p (cid:20) p − p α − − (cid:18) p α − − p α − − (cid:19) + p + 12 p α − + 12 (cid:18) p α − − p α − + 12 (cid:19) + X i + j ≡ k mod p (1 − δ i,j ) (cid:21) = 3 p α + 2 p α − p − δ ) p , so that if δ ≤ p +14 p we are done.For 1 ≤ d ≤ p β − − , let P A,d = { A ′ i : A ′ i is an arithmetic progression of difference d } .Clearly P d | P A,d | ≤ p , and the same holds for P B,d . Then by Cauchy-Schwarz we have δp = X i ∈ Z p X j ∈ Z p X d χ (( A ′ i , B ′ j ) ∈ P A,d × P B,d )= X d X i ∈ Z p X j ∈ Z p χ (( A ′ i , B ′ j ) ∈ P A,d × P B,d )= X d | P A,d || P B,d |≤ max d ( | P A,d || P B,d | ) X d | P A,d | X d | P B,d | ! ≤ max d ( | P A,d || P B,d | ) p. FRANCESCO MONOPOLI
Without loss of generality, after a dilation if necessary we can certainly assume thatmax d ( | P A,d || P B,d | ) = ( | P A, || P B, | ) , since if A ′ i is an arithmetic progression of differ-ence d not coprime with p , then we would find two elements in A ′ i congruent modulo p α − , but this cannot happen in a digital set.Let ǫ A = | P A, | /p and ǫ B = | P B, | /p , ˜ P A = { A i : A ′ i ∈ P A, } , ˜ P B = { B j : B ′ j ∈ P B, } .Hence δ ≤ √ ǫ A ǫ B . So, if √ ǫ A ǫ B ≤ p +14 p we are done.Suppose this does not hold, so that p +14 p < √ ǫ A ǫ B ≤ ǫ A + ǫ B . For A ′ i ∈ P A, , B ′ j ∈ P B, let A i = u i + p · (cid:20) − p α − − , p α − − (cid:21) , B j = v j + p · (cid:20) − p α − − , p α − − (cid:21) for some u i ∈ i + h p i , v j ∈ j + h p i . Let U = { u i : A ′ i ∈ P A, } , V = { v j : B ′ j ∈ P B, } , and I A , I B be the images respectively of U and V under the canonical projection π : Z p β → Z p . For k ∈ Z p , let r k = r I A + I B ( k ). Since | I A | + | I B | = p ( ǫ A + ǫ B ) ≥ p + p +12 , wehave p +12 ≤ r k ≤ p for all k .Let f ( k ) = p + 12 p α − + 12 + (cid:18) r k − p + 12 (cid:19) p α − −
12 = r k p α − −
12 + p + 12 . Then we can split X x ∈ Z pβ min (cid:18) p α + 12 , r A + B ( x ) (cid:19) ≥ X k ∈ Z p X x ∈ k + h p i (cid:20) min (cid:0) f ( k ) , r P ˜ A + P ˜ B ( x ) (cid:1) (2.5) + min (cid:18) p α + 12 − f ( k ) , ˜ r ( x ) (cid:19) (cid:21) , where ˜ r ( x ) = r ( A \ P ˜ A )+ P ˜ B ( x ) + r P ˜ A +( B \ P ˜ B ) ( x ) + r ( A \ P ˜ A )+( B \ P ˜ B ) ( x ).Lemmas 2.4 and 2.5 below give bounds for the first part of the summation in (2.5),while Lemma 2.6 provides a bound for the second part.Using the fact that the representation function of the sum of two intervals A ′ i , B ′ j istriangular-shaped, we can indeed prove the following: Lemma 2.4.
Let k ∈ Z p and, with the notation above, let x k be the element in k + h p i ⊆ Z p β which maximizes r U + V ( x k ) . Then X x ∈ k + h p i min( f ( k ) , r P ˜ A + P ˜ B ( x )) ≥ r k (cid:18) p α − − p α − − (cid:19) + p α + p α −
2+ min (cid:18) r k − p + 12 , r k − r U + V ( x k ) (cid:19) . Proof.
Fix k and let R = r U + V ( x k ). Recall that for A ′ i ∈ P A, and B ′ j ∈ P B, therepresentation functions of A ′ i + B ′ j is triangular-shaped, i.e., it is a translation of the INIMIZING THE FREQUENCY OF CARRIES IN MODULAR ADDITION 7 function ψ ( x ) = max(0 , p α − − | x | ). For y i ∈ Z p β − let ψ y i ( x ) = ψ ( x − y i ). Then(2.6) X x ∈ k + h p i min( f ( k ) , r P ˜ A + P ˜ B ( x )) = X x ∈ Z pβ − min f ( k ) , X i ∈ I A ,j ∈ I B i + j ≡ k mod p r A ′ i + B ′ j ( x ) . To get the desired bound for (2.6) we minimize(2.7) S ( P k ) = X x ∈ Z pβ − min f ( k ) , r k X i =1 ψ y i ( x ) ! , where P k ranges over all possible multisets of r k elements y , . . . , y r k ∈ Z p β − with thecondition that R y i ’s are equal. Without loss of generality, up to a translation, we canassume that those R points are equal to 0.First of all, we compute S ( ¯ P k,a,b ) for¯ P k,a,b = {− , . . . , − | {z } a , , . . . , | {z } R , , . . . , | {z } b } , with the conditions that a + R + b = r k and a + R, b + R ≥ r k /
2, which imply that a, b ≤ r k /
2. In this case, we have r k X i =1 ψ y i ( x ) = a x = − p α − ,a ( p α − + x + 1) + R ( p α − + x ) + b ( p α − + x − x ∈ [ − p α − + 1 , − ,a ( p α − −
1) + Rp α − + b ( p α − − x = 0 ,a ( p α − − x −
1) + R ( p α − − x ) + b ( p α − − x + 1) x ∈ [1 , p α − − ,b x = p α − . For x ∈ [1 , p α − −
1] we have P r k i =1 ψ y i ( x ) ≥ f ( k ) if and only if1 ≤ x ≤ p α − + 12 + 2( b − a ) − p − r k . We have b − a ) − p − r k ∈ ( − , b − a ≤ b ≤ r k / ≤ p − < p and r k ≥ p +12 . Case 1 : b − a ) − p − r k ∈ ( − , − − p +12 r k ∈ [ − , a > b . In this case, for x ∈ [1 , p α − − P r k i =1 ψ y i ( x ) ≥ f ( k ) if and only if x ≤ p α − − . Hence X x ∈ [1 ,p α − ] min f ( k ) , r k X i =1 ψ y i ( x ) ! = f ( k ) p α − −
32 + p α − − X x = pα − − ( − r k x + p α − r k + b − a ) + b = f ( k ) p α − −
32 + p α − + 12 ( b − a + p α − r k ) − r k p α − −
34 + b. Case 2 : b − a ) − p − r k ∈ [ − , FRANCESCO MONOPOLI
In this case, for x ∈ [1 , p α − − P r k i =1 ψ y i ( x ) ≥ f ( k ) if and only if x ≤ p α − − .Hence X x ∈ [1 ,p α − ] min f ( k ) , r k X i =1 ψ y i ( x ) ! = f ( k ) p α − −
12 + p α − − X x = pα − ( − r k x + p α − r k + b − a ) + b = f ( k ) p α − −
12 + p α − −
12 ( b − a + p α − r k ) − r k p α − − p α − + 14 + b. The same argument gives a similar computation for P x ∈ [ − p α − , − P r k i =1 ψ y i ( x ), wherethe roles of a and b are exchanged.Since we cannot fall into Case 1 both for [ − p α − , −
1] and [1 , p α − ], a simple com-putation shows that, if we fall into Case 1 for [1 , p α − ] and Case 2 for [ − p α − , − X x ∈ [ − p α − ,p α − ] min f ( k ) , r k X i =1 ψ y i ( x ) ! = r k (cid:18) p α − − p α − − (cid:19) + p α + p α − r k − p + 12 + 2 b ≥ r k (cid:18) p α − − p α − − (cid:19) + p α + p α − r k − p + 12 , whereas, if we fall in Case 2 both for [1 , p α − ] and [ − p α − , − X x ∈ [ − p α − ,p α − ] min f ( k ) , r k X i =1 ψ y i ( x ) ! = r k (cid:18) p α − − p α − − (cid:19) + p α + p α − a + b = r k (cid:18) p α − − p α − − (cid:19) + p α + p α − r k − R, thus proving the lemma in this particular case.We now show that for any multiset P k = { y , . . . , y r k } with R equal elements, wehave S ( P k ) ≥ S ( ¯ P k,a,b ) for some choices of a, b with a + b + R = r k .Observe first of all that if ¯ x ∈ Z p β − satisfies P r k i =1 ψ y i (¯ x ) > f ( k ), then f ( k ) = r k p α − −
12 + p + 12 < X y ∈P k :¯ x ∈ supp ψ y ψ y (¯ x ) ≤ p α − · |{ y ∈ P k : ¯ x ∈ supp( ψ y ) }| , so that |{ y ∈ P k : ¯ x ∈ supp( ψ y ) }| ≥ r k p + 1 − r k p α − > j r k k . INIMIZING THE FREQUENCY OF CARRIES IN MODULAR ADDITION 9
Since { y ∈ P k : ¯ x ∈ supp( ψ y ) } ⊆ [¯ x − ( p α − − , ¯ x + ( p α − − x ∈ Z p β − satisfies P r k i =1 ψ y i ( x ) > f ( k ), then x ∈ [¯ x − p α − − , ¯ x + 2( p α − − P k = { y , . . . , y r k } is such that S ( P k ) is minimal, then we can assume thatsupp ( P r k i =1 ψ y i ) ⊆ [¯ x − p α − − , ¯ x + 4( p α − − y [¯ x − p α − − , ¯ x + 3( p α − − x − p α − − , ¯ x + 3( p α − − P ′ k with S ( P ′ k ) ≤ S ( P k ).Note that [¯ x − p α − − , ¯ x +4( p α − − ( Z p β − with the exception of a finite numberof choices of ( p, α, β ), where the conclusions of the lemma can be easily checked, andhence we have that either there exists no element x ∈ Z p β − with P r k i =1 ψ y i ( x ) > f ( k ),and so we get the trivial bound r k p α − in (2.6) and the lemma is true, or we can assumesupp ( P r k i =1 ψ y i ) ( Z p β − .Suppose we are in the latter case, so that we can assume supp ( P r k i =1 ψ y i ) ⊆ I , where I is an interval different from the whole Z p β − , and so for x , x ∈ I , x < x has theobvious meaning.Let σ ( x ) = P r k i =1 ψ y i ( x ). Consider the minimal element y ∈ P k , say with multeplicity m , and consider the multiset P ′ k obtained from P k by translating y to y + 1, i.e., P ′ k = { y ′ i } , with y ′ i = ( y i + 1 if y i = y , y i otherwise.We will show that S ( P ′ k ) ≤ S ( P k ), which is equivalent, for σ ′ ( x ) = P r k i =1 ψ y ′ i ( x ), to X x ∈ Z pβ − max( σ ′ ( x ) − f ( k ) , − max( σ ( x ) − f ( k ) , ≥ . If σ ( x ) < f ( k ) for all x ≤ y the claim holds, since then for all x ∈ Z p β − σ ( x ) < f ( k )or σ ′ ( x ) ≥ σ ( x ).Let ¯ t be the largest nonnegative integer such that σ ( y − ¯ t ) > f ( k ). If ¯ t = 0, theclaim holds since σ ( y + 1) + m ≥ σ ( y ).Let ¯ t > M = |{ y ∈ P k : y = y , y − ¯ t ∈ supp( ψ y ) }| . Then the following hold:(1) σ ( y + t ) ≥ σ ( y − t ) + 2 M for t ∈ [1 , ¯ t + 1],(2) σ ( y − t ) ≥ σ ( y − t −
1) + m + M for t ∈ [0 , ¯ t ],(3) σ ( y − ¯ t ) = σ ( y − ¯ t −
1) + M + m . Case 1: σ ′ ( y − ¯ t ) = σ ( y − ¯ t ) − m ≥ f ( k ).In this case we have σ ( y + ¯ t + 1) ≥ σ ( y − ¯ t −
1) + 2 M = σ ( y − ¯ t ) − m + M ≥ f ( k ).Hence for all x ∈ [ y − ¯ t, y + ¯ t + 1] we have σ ( x ) , σ ′ ( x ) ≥ f ( k ) and so X x ∈ [ y − ¯ t,y +¯ t +1] max(0 , σ ′ ( x ) − f ( k )) − max(0 , σ ( x ) − f ( k )) = X x ∈ [ y − ¯ t,y ] − m + X x ∈ ( y ,y +¯ t +1] m = 0 . Case 2: σ ′ ( y − ¯ t ) = σ ( y − ¯ t ) − m < f ( k ).Since, arguing as above, σ ( y + ¯ t + 1) + m ≥ σ ( y − ¯ t ) ≥ f ( k ), we have X x ∈ [ y − ¯ t,y +¯ t +1] max(0 , σ ′ ( x ) − f ( k )) − max(0 , σ ( x ) − f ( k )) = − σ ( y − ¯ t ) + f ( k )+ X x ∈ [ y − ¯ t +1 ,y ] − m + X x ∈ ( y ,y +¯ t ] m + σ ( y + ¯ t + 1) + m − f ( k ) − τ ≥ , where τ = ( σ ( y + ¯ t + 1) < f ( k ) ,σ ( y + ¯ t + 1) − f ( k ) otherwise.In both cases we have S ( P ′ k ) ≤ S ( P k ) since for all x [ y − ¯ t, y + ¯ t + 1] σ ( x ) < f ( k )or σ ′ ( x ) ≥ σ ( x ).Suppose that R > r k /
2. Say we have a elements y ∈ P k , y < b elements y ∈ P k , y >
0. Then, iterating the shifting procedure explained above, which has anobvious equivalent for the maximal element of P k , if we replace those a elements with y ′ = − b elements with y ′ = 1, we recover a translate of the multiset ¯ P k,a,b with a + b = r k − R and we have S ( ¯ P k,a,b ) ≤ S ( P k ), so that the conclusion of the lemmaholds.Suppose that R ≤ r k /
2. Then all y ∈ P k have multiplicity less or equal to r k /
2, and,with the shifting procedure explained above, we iteratively shift the minimal element y of P k , and we stop doing this as soon as we get y + 1 = y , y < y with multiplicityrespectively m and m and m + m ≤ r k /
2. We do the same thing for the maximalelement of P k , and we end up with a new multiset P ′ k with S ( P ′ k ) ≤ S ( P k ) having atmost three distinct elements, each with multiplicity less or equal to r k /
2. Indeed, sincethe sum of the first two consecutive distinct elements in P ′ k is strictly greater than r k / r k / P ′ k is equal, up to a translation, to ¯ P k,a,b for some a, b satisfying a, b ≤ r k / R ′ = r k − a − b ≤ r k / (cid:18) r k − p + 12 , r k − R ′ (cid:19) = r k − p + 12 = min (cid:18) r k − p + 12 , r k − R (cid:19) , the conclusion follows from the computation at the beginning of the proof. (cid:3) To sum the contributions given by Lemma 2.4, we need the following:
Lemma 2.5. (2.8) X k ∈ Z p min (cid:18) r k − p + 12 , r k − r U + V ( x k ) (cid:19) ≥ p + 12 (cid:18) ( ǫ A + ǫ B ) p − p + 12 (cid:19) . Proof.
Let { R , . . . , R l } = { r U + V ( x k ) : r U + V ( x k ) > ( p + 1) / } .Since r U + V ( x ) ≤ p for all x , we have that R , . . . , R l are the l highest values among { r U + V ( x ) : x ∈ Z p β } .Since U and V have the Chowla property, we have | U || V | − p + 12 (cid:18) | U | + | V | − p + 12 (cid:19) ≥ | U || V | − p +12 X i =1 | U + i V | = min( | U | , | V | ) X i = p +32 | U + i V | = X x ∈ Z pβ max (cid:18) r U + V ( x ) − p + 12 , (cid:19) INIMIZING THE FREQUENCY OF CARRIES IN MODULAR ADDITION 11 = − l p + 12 + l X k =1 R k Recalling that P k ∈ Z p r k = | U || V | = ǫ A ǫ B p , we have X k ∈ Z p min (cid:18) r k − p + 12 , r k − r U + V ( x k ) (cid:19) = X k : r U + V ( x k ) ≤ p +12 (cid:18) r k − p + 12 (cid:19) + X k : r U + V ( x k ) > p +12 ( r k − r U + V ( x k )) ≥ X k ∈ Z p r k − ( p − l ) p + 12 − l p + 12 − ǫ A ǫ B p + p + 12 (cid:18) ( ǫ A + ǫ B ) p − p + 12 (cid:19) = p + 12 (cid:18) ( ǫ A + ǫ B ) p − p + 12 (cid:19) as required. (cid:3) Lemma 2.6. X k ∈ Z p X x ∈ k + h p i min (cid:18) p α + 12 − f ( k ) , ˜ r ( x ) (cid:19) ≥ ǫ A (1 − ǫ B ) p (cid:18) p α − − p α − −
14 + 1 (cid:19) + (1 − ǫ A ) ǫ B p (cid:18) p α − − p α − −
14 + 1 (cid:19) + (1 − ǫ A )(1 − ǫ B ) p (cid:18) p α − − p α − − (cid:19) Proof.
Since for every k we have p α +12 − f ( k ) = ( p − r k ) (cid:16) p α − − (cid:17) , we can compute X k ∈ Z p X x ∈ k + h p i min (cid:18) p α + 12 − f ( k ) , ˜ r ( x ) (cid:19) ≥ X k ∈ Z p X i I A ,j ∈ I B i + j ≡ k mod p min (cid:18) p α − − , r A ′ i + B ′ j ( x ) (cid:19) + X i ∈ I A ,j I B i + j ≡ k mod p min (cid:18) p α − − , r A ′ i + B ′ j ( x ) (cid:19) + X i I A ,j I B i + j ≡ k mod p min (cid:18) p α − − , r A ′ i + B ′ j ( x ) (cid:19) . Using the inductive hypothesis to get a bound better then the one coming from Pollard’sinequality whenever we consider the sumset A ′ i + B ′ j with i I A , j ∈ I B or viceversa,we get the desired bound. (cid:3) Using Lemmas 2.5 and 2.6 we can finish the proof of the Theorem 2.2: (2.9) X x ∈ Z pβ min (cid:18) p α + 12 , r A + B ( x ) (cid:19) ≥ X k ∈ Z p X x ∈ k + h p i (cid:20) min (cid:0) f ( k ) , r P ˜ A + P ˜ B ( x ) (cid:1) + min (cid:18) p α + 12 − f ( k ) , ˜ r ( x ) (cid:19) (cid:21) ≥ ǫ A ǫ B p (cid:18) p α − − p α − − (cid:19) + p p α + p α − p + 12 (cid:18) ( ǫ A + ǫ B ) p − p + 12 (cid:19) + ǫ A (1 − ǫ B ) p (cid:18) p α − − p α − −
14 + 1 (cid:19) + (1 − ǫ A ) ǫ B p (cid:18) p α − − p α − −
14 + 1 (cid:19) + (1 − ǫ A )(1 − ǫ B ) p (cid:18) p α − − p α − − (cid:19) ≥ (cid:18) p α + 2 p α − (cid:19) + p (cid:18) ǫ A + ǫ B ǫ A (1 − ǫ B ) + ǫ B (1 − ǫ A ) − (cid:19) + p (cid:18) ǫ A + ǫ B − (cid:19) . Since p (cid:18) ǫ A + ǫ B ǫ A (1 − ǫ B ) + ǫ B (1 − ǫ A ) − (cid:19) + p (cid:18) ǫ A + ǫ B − (cid:19) ≥ p (cid:18) − ǫ A ǫ B + 3 √ ǫ A ǫ B ) − (cid:19) + p (cid:18) √ ǫ A ǫ B − (cid:19) , and x ( − p ) + x (3 p + p ) − p − p ≥ ≥ x ≥ ( p + 1) / p , the conclusion holdssince we assumed √ ǫ A ǫ B > (3 p + 1) / p ≥ ( p + 1) / p .This concludes the proof of (ii).To prove (iv), notice that, in order to have equality in (iv), from (2.9) we must have ǫ A ǫ B = 1, so that every A ′ i and B ′ j is an arithmetic progression of the same commondifference d , ( d, p ) = 1, and after a dilation if necessary we can assume d = 1. Moreover,by Theorem 2.1, since we must also have equality in (2.8), we have that both U and V arearithmetic progressions of the same common difference d ′ , ( d ′ , p ) = 1, say U = { u , u = u + d ′ , . . . , u p − = u + ( p − d ′ } and V = { v , v = v + d ′ , . . . , v p − = v + ( p − d ′ } .From the proof of part (ii), since u + v ≡ u + v p − modulo p , we deduce that pd ′ ≡ ± p modulo p β , so that d ′ ≡ ± p β − , and A is an arithmetic progressionsof difference d ′ , starting either from u − p α − p or u + p α − p , and the same holds for B ,thus completing the proof of the theorem. (cid:3) We are left to study the case of p = 2, which is way easier and forms the followingtheorem: Theorem 2.7.
Let
A, B ⊆ Z β be digital sets, | A | = | B | = 2 α , with < α < β . Then INIMIZING THE FREQUENCY OF CARRIES IN MODULAR ADDITION 13 (i) S ( A, B, α − ) ≥ α − α − , (ii) S ( A, B, α − ) = 2 α − α − if and only if A and B are arithmetic progressions ofthe same common difference.Proof. The proof goes by induction of α , for all β > α . For α = 1 the claim holds.Suppose α ≥ A = A ∩ h i , A = A ∩ (1 + h i ) ,B = B ∩ h i , B = B ∩ (1 + h i ) . Then, A ′ i = A i − i ⊆ Z β − , B ′ j = B j − i ⊆ Z β − are digital sets of cardinality 2 α − in Z β − ,and thanks to the induction hypothesis we have X x ∈ Z β min (cid:0) α − , r A + B ( x ) (cid:1) ≥ X x ∈h i min (cid:0) α − , r A + B ( x ) (cid:1) + min (cid:0) α − , r A + B ( x ) (cid:1) + X x ∈ h i min (cid:0) α − , r A + B ( x ) (cid:1) + min (cid:0) α − , r A + B ( x ) (cid:1) ≥ · α − (2 α − α − )=2 α − α − as required.Moreover, by the induction hypothesis, equality holds in the chain of inequalitiesabove if and only if A ′ , A ′ , B ′ , B ′ are arithmetic progressions of the same commondifference. A simple analysis shows that the only possibility for A and B to achieve theequality S ( A, B, α − ) = 2 α − α − under this additional condition is that both A and B are arithmetic progression of the same common difference as claimed. (cid:3) Arguing as in [1], Theorems 2.2 and 2.7 allow us to prove the exact bound for C ( A )in the case of digital sets A ⊆ Z p β of cardinality p α , proving that such sets induce atleast ⌊ p α / ⌋ carries, with equality holding if and only if A is a dilation of [ − ( p α − − / , ( p α − − /
2] by a factor d coprime with p if p is odd, or a dilation of [ − α − , α − )or ( − α − , α − ] by an odd factor d if p = 2.We can now prove Theorem 1.1. Proof of Theorem 1.1.
Let m = m ′ p α for p α = max { p α i i : p i prime , p α i i | m } , and A i = A ∩ i + h m ′ i for i = 0 , . . . , m ′ −
1. Writing A = { a j } j =0 ,...m − , where a j ≡ j mod m for all j = 0 , . . . , m −
1, then for all i , A i = { a i , a i + m ′ , . . . , a i +( p α − m ′ } , and so | A i | = p α . Then A ′ i := A i − im ′ ⊆ Z q/m ′ , since A i − i ⊆ m ′ Z q ≃ Z q/m ′ . Moreover, for x, y ∈ A ′ i , we have x y modulo p α , for otherwise we would have i + m ′ x, i + m ′ y ∈ A with i + m ′ x ≡ i + m ′ y mod m , which contradicts the fact that A is a digital set. Hence A ′ i ⊆ Z q/m ′ is a digitalset for every i .Consider the projection π : Z q/m ′ → Z p β , where p β is the highest power of p dividing q/m ′ , β > α .We have that | A ′ i | = p α = | π ( A ′ i ) | , and still for x, y ∈ A ′ i , we have π ( x ) π ( y ) modulo p α , so that π ( A ′ i ) is, once again, a digital set for every i . Case 1 : p odd. Using Theorem 2.2 and Lemma 2.3, we have X x ∈ Z q min (cid:18) p α − , r A i + A j ( x ) (cid:19) = X x ∈ Z q/m ′ min (cid:18) p α − , r A ′ i + A ′ j ( x ) (cid:19) = X y ∈ Z pβ X x ∈ π − ( y ) min (cid:18) p α − , r A ′ i + A ′ j ( x ) (cid:19) ≥ X y ∈ Z pβ min p α − , X x ∈ π − ( y ) r A ′ i + A ′ j ( x ) = X y ∈ Z pβ min (cid:18) p α − , r π ( A ′ i )+ π ( A ′ j ) ( y ) (cid:19) ≥ p α − p α − . Using this inequality and Lemma 2.3, we have X x ∈ Z q min (cid:16)j m k , r A + A ( x ) (cid:17) = m ′ − X k =0 X x ∈ k + h m ′ i min (cid:16)j m k , r A + A ( x ) (cid:17) = m ′ − X k =0 X x ∈ k + h m ′ i min j m k , X i + j ≡ k mod m ′ r A i + A j ( x ) ≥ m ′ − X k =0 X x ∈ k + h m ′ i X i + j ≡ k mod m ′ min (cid:18) p α − , r A i + A j ( x ) (cid:19) ≥ m ′ p α − p α −
14 = 3 m − m /p α − m ′ , so that 3 m − m /p α − m /p α ≤ X x ∈ A + A min (cid:16)j m k , r A + A ( x ) (cid:17) ≤ X x ∈ ( A + A ) ∩ A j m k + X x ∈ ( A + A ) \ A r A + A ( x )and thus X x ∈ ( A + A ) \ A r A + A ( x ) ≥ m − /p α − /p α + δ m /m , where δ m = 1 if m is odd and δ m = 0 if m is even. Case 2 : p = 2.Using Theorem 2.7, we have X x ∈ Z q min (cid:0) α − , r A i + A j ( x ) (cid:1) = X x ∈ Z q/m ′ min (cid:16) α − , r A ′ i + A ′ j ( x ) (cid:17) INIMIZING THE FREQUENCY OF CARRIES IN MODULAR ADDITION 15 = X y ∈ Z α +1 X x ∈ π − ( y ) min (cid:16) α − , r A ′ i + A ′ j ( x ) (cid:17) ≥ X y ∈ Z β min α − , X x ∈ π − ( y ) r A ′ i + A ′ j ( x ) = X y ∈ Z β min (cid:16) α − , r π ( A ′ i )+ π ( A ′ j ) ( y ) (cid:17) ≥ α − α − . Using this inequality and Lemma 2.3, we get X x ∈ Z q min (cid:16) m , r A + A ( x ) (cid:17) = m ′ − X k =0 X x ∈ k + h m ′ i min (cid:16) m , r A + A ( x ) (cid:17) = m ′ − X k =0 X x ∈ k + h m ′ i min m , X i + j ≡ k mod m ′ r A i + A j ( x ) ≥ m ′ − X k =0 X x ∈ k + h m ′ i X i + j ≡ k mod m ′ min (cid:0) α − , r A i + A j ( x ) (cid:1) m ′ (2 α − α − ) = 3 m . Then we get 3 m ≤ m X i =1 | A + i A | = X x ∈ A + A min (cid:16) m , r A + A ( x ) (cid:17) ≤ X x ∈ ( A + A ) ∩ A m X x ∈ ( A + A ) \ A r A + A ( x )and so X x ∈ ( A + A ) \ A r A + A ( x ) ≥ m . Since P x ∈ ( A + A ) \ A r A + A ( x ) counts the couples ( a , a ) ∈ A × A such that a + a A ,i.e. the number of occurrences of carries induced by A , we get the desired conclusion.For an integer m let ϕ ( m ) = max { p α i i : p i prime , p α i i | m } be the largest prime powerdividing m , ψ ( m ) be the largest prime dividing m and ω ( m ) be the function countingthe number of distinct prime factors in m . It’s easy to see that ϕ ( m ) → ∞ as m → ∞ .In fact, suppose this does not hold, and let { m i } be an increasing sequence of integerswith ϕ ( m i ) ≤ L for all i . Then, if ω ( m i ) → ∞ , so does ψ ( m i ), and consequentlythe same holds for ϕ ( m i ), a contradiction. On the other hand, if, up to subsequences, ω ( m i ) ≤ M for all m i , then clearly m i ≤ ω ( m i ) ϕ ( m i ) ≤ LM , which does not go toinfinity, thus leading to a contradiction.Then, since balanced digital sets of cardinality m induce ⌊ m / ⌋ carries and thefunction µ ( m ) tends to 1 / m goes to infinity, we have (cid:22) m (cid:23) m ≥ min | A | = m C ( A ) ≥ µ ( m ) −→
14 for m −→ ∞ , thus completing the proof of the theorem. (cid:3) References
1. N. Alon,
Minimizing the number of carries in addition , SIAM J. Discrete Math. (2013), no. 1,562–566. MR 30354662. Y. F. Bilu, V. F. Lev, and I. Z. Ruzsa, Rectification principles in additive number theory , DiscreteComput. Geom. (1998), no. 3, Special Issue, 343–353, Dedicated to the memory of Paul Erd˝os.MR 1608875 (2000a:11018)3. P. Diaconis, X. Shao, and K. Soundararajan, Carries, group theory, and additive combinatorics , TheAmerican Mathematical Monthly (2014), no. 8, 674–688.4. B. Green and I. Z. Ruzsa,
Sum-free sets in abelian groups , Israel J. Math. (2005), 157–188.MR 2166359 (2006e:11030)5. ,
Sets with small sumset and rectification , Bull. London Math. Soc. (2006), no. 1, 43–52.MR 2201602 (2006i:11027)6. D. J. Grynkiewicz, On extending Pollard’s theorem for t -representable sums , Israel J. Math. (2010), 413–439. MR 2684428 (2011k:11016)7. Y. O. Hamidoune and O. Serra, A note on Pollard’s Theorem , arXiv (2008).8. F. Monopoli and I. Z. Ruzsa,
Carries and the arithmetic progression structure of sets , arXiv (2015).9. E. Nazarewicz, M. O’Brien, M. O’Neill, and C. Staples,
Equality in Pollard’s theorem on set additionof congruence classes , Acta Arith. (2007), no. 1, 1–15. MR 2289969 (2008e:11014)
Dipartimento di Matematica, Universit`a degli Studi di Milano, via Saldini 50, Mi-lano, I-20133 Italy
E-mail address ::