TITLE: Erik Westzynthius's cool upper bound argument: update?
QUESTION [20 upvotes]: Version 2 of this writeup is
  available, and includes a newer and simple upper bound thanks to
  MathOverflow 88777 as
  well as indirect references to future writeups.  Details of further work
  will be found in these writeups.  GRP 2014.06.04.


In a paper of Erik Westzynthius,

Ueber die Verteilung der Zahlen, die zu den n ersten Primzahlen teilerfremd sind,
  Comm. Phys. Math. Soc. Sci. Fenn., Helsingfors (5) 25 (1931), 1-37

I saw the following upper bound argument.  Having never
studied sieve theory, I was quite impressed by it.  The goal is to bound from above
the quantity max $(q_{i+1} - q_i)$, where the $q_i$ are the positive integers in
increasing order which are relatively prime to $P_n$, the product of the first
n primes.  Here is a sketch of the argument.
Let $a$ and $x$ be real parameters, with $x > 0$ .  Consider the
integers in the open interval $(a, a+x)$, and call this set $H$.  Let us look
at the subsets of $H$ consisting of those integers which are a multiple of the
positive integer $t$; call the size of each such subset $I_t$.  Step 1 is to use
inclusion-exclusion to 
estimate $I_0$, the number of integers in the interval $(a, a+x)$ which are relatively 
prime to $P_n$. (I.e. count integers, throw out multiples of 2, throw out multiples
of 3, add in multiples of (2*3) to compensate, etc.)  We get
$I_0 = \sum_{t \in R} [I_t * (-1)^{\mu(t)}] $.
Here $R$ is the set of positive integers which are of the form 
(warning: sloppy notation) $\prod_{J \subset n} p_j$,
that is all integers whose prime factorizations have only primes less than
or equal to the nth prime, and those occuring only to at most the first power.
(More succinctly, $R$ is also the set of positive divisors of $P_n$.)  For
such a number $t \in R$, $\mu(t)$ is precisely the number of prime factors in $t$,
and $\mu$ is chosen to suggest the Moebius function whose value at such $t$ is 
$(-1)^{\mu(t)}$.  The equality is exact.
Step 2 is to replace $I_t$ with a linearized approximation plus an error term which
I will call $E(t)$.    This substitution gives:
$I_0 = \sum_{t \in R} [ (E(t) + x/t) * (-1)^{\mu(t)} ]$  .
Since the number of multiples of $t$ in the interval $(a, a + x)$ is roughly $x/t$,
the error term $E(t)$ is bounded in absolute value by $1$.  Step 3 will rewrite
the RHS and estimate it pessimistically: $E(t) * (-1)^{\mu(t)}$ will be replaced
by $-1$, and the alternating sum of $x/t$ terms can be rewritten as a product
involving terms of the form $(1 - 1/p_i)$, where $p_i$ is the $i$th prime. There are 
$2^n$ terms of the form $E(t)$, so one gets:
$I_0 \geq [x * \prod_{1 <= i <= n} (1 - 1/p_i) ] - 2^n  = x/Q - 2^n$ .
Here $Q$ is an abbreviation for $1$ divided by the product of the n terms $(1 - 1/p_i)$.
It is roughly log n  for large n.  Here comes the kicker.  Step 4
notes that steps 1 through 3 are essentially independent of $a$, and if $x$ can be
chosen so that $x/Q - 2^n > 0$, then $I_0 > 0$ which means at least one of the $q_i$
is in the interval $(a, a+x)$ when $a > 0$, and such $x$ would be an upper bound for 
$q_{i+1} - q_i$ which is independent of $i$. So choose $x = Q * 2^n$ plus epsilon.
I thought it a neat enough argument (especially the kicker)
that I am sharing it here with other non-students of sieve theory.  Now to the questions.
1) Is there any work done which improves the upper bound for $q_{i+1} - q_i$?
The answer to this is yes, since in a footnote Westzynthius shows how to
improve the bound to $Q * 2^{n-1}$ by counting odd multiples.  So I really want
to know if there are even better bounds out there, done by additional researchers.
I would expect a provable bound to be $Q * 2^g$,  where $g$ is something like a 
polynomial in log(n), but even having $g$ be n to a fractional power would be something.
2) Is there work done which uses something like the Bonferroni inequalities to
improve the above argument?
3) Did Westzynthius publish any other work (possibly nonmathematical) besides the
paper that includes the argument above?
Motivation: I am considering improvements to this argument which do establish
better upper bounds, and am wondering how to push the exponent from n - o(1) 
 down to poly(log(n)).  Especially, I want to know if I am rediscovering how
to replace n by cn for some $c < 1$, as opposed to discovering how to do it.
Gerhard "Ask Me About System Design" Paseman, 2010.09.03

REPLY [2 votes]: After studying Kanold's 1967 paper on Jacobsthal's function, (and being inspired by a preprint http://arxiv.org/abs/1208.5342 that I discuss below,) I found an argument, mostly very simple, which gives some nice results for the effort given.  While Kanold deserves some of the credit for the argument, I have yet to see a statement by him or by anyone else that gives these results, so I present them here.  (Kanold wrote several articles on Jacobsthal's function, many of which I am tracking down, which might have this argument.  I am happy to accept help in obtaining electronic copies of them.)  This is the post I promised over a few months ago in a supplement to a question of Timothy Foo, 
Analogues of Jacobsthal's function  .
For maximum ooh-aah effect, I assume $n$ is squarefree and has $k \gt 2$ prime factors, one of which I call Peter, or $p$ for short.Now $1+tn$ is coprime to $n$ for any integer $t$.  So are most integers of the form $1 + tn/p$, the exceptions being those that are multiples of $p$, and those multiples do not occur as consecutive terms.  Thus, every interval of length $2n/p (=g(p)n/p)$ has at least one integer coprime to $n$ of the form $1+tn/p$.
Let's go further with this.  Let $d \gt 1$ and divide $n$, and let $f=n/d$.  (Here I use $n$ squarefree to get $f$ coprime to $d$.)  Then numbers of the shape $1+tf$ form an arithmetic progression, are coprime to $f$, and (as can be seen by multiplying by $f$'s inverse in the ring of integers mod $d$) you can't pick $g(d)$ consecutive members of this progression without hitting something coprime to $d$ also.  So $g(n) \leq g(d)f = g(d)n/d$ .
While I'm here, let me sharpen the inequality, assuming $f \gt 1$ and $d \gt 1$ are coprime:
there are $\phi(f)$ totients $c$ of $f$ in the interval $[0,f]$, so I can repeat the argument with $c+tf$ instead of $1+tf$.  In the worst case, using all $\phi(f)$ progressions, I get $g(fd) \leq g(d)f - f + g(f)$, which mildly improves upon Kanold's bound $g(d)f -\phi(f)+1$, and matches it when $f$ is prime.  (Of course, for $n=fd$ I really want $g(n)$ to be near $O(g(d)+g(f))$, but I don't yet know how to show that with grade school arithmetic.)
How to use this inequality? Pick the largest divisor $d$ for which one can comfortably compute (a subquadratic in $k$ upper bound for) $g(d)$; I pick $d$ to contain most of the large prime factors of $n$: find prime $q$ dividing $n$ so that $\sigma^{-1}(d)=\sum_{p \text{ prime,} p|n, p \geq q} 1/p$ is less than $1 + 1/2q$; a routine argument yields $g(d)$ is $O(qk)$.  The ugly part is to show that $q \lt k^{0.5}$ (or else $d=n$), that $n/d \lt 2^{3q/2}$ which for large $k$ approaches $2^{3(k^{\epsilon + 1/e})/2}$, and that asymptotically $g(n)$ is $O(e^{k^{1/e}+D\log(k)})$.  This isn't hard after using one of Mertens's theorems and a Chebyshev function; it just isn't pretty.  (Also for smaller $n$, $\epsilon + 1/e$ can be close to $1/2$, but with patience $\epsilon$ will tend to zero.)
This gives a bound that is asymptotically better than my first efforts at this, improves slightly ($k^{0.5}$ replaced by $Ck^{0.37}+ D\log(k)$ on Kanold's bound of $2^\sqrt{k}$ for $k$ not too large, and does not need Kanold's requirement that $k > e^{50}$.  Up until one chooses $d$ and crunches the formulae, it is also a very elementary argument; I suspect even Legendre knew about using the multiplicative inverse to transform a general arithmetic progression to a (effectively) consecutive sequence of integers and still preserve the property of interest here, being a unit in a certain ring (or missing it by that much).  
(One of the benefits of letting this sit for a few months before posting is that I can add cool observations like: If I could get the inequality down to $g(n) \leq g(d)g(n/d)$, I could iterate the
above simple estimate to get an explicit bound of $O(k^c)$, where $c$ is a positive number less than 3.  Or like: using more advanced work combined with the above, I can get $g(n) 
\leq e^{k^{e^{-a}}}Ck^{a}$ for some integers $a$, which seems better than $Ck^{4\log\log{k}}$ if you don't look too closely.)
Further, one can use a computer to refine the method slightly and get estimates which do quite well for small values of $n$, where small here means $k<100$.  Asymptotically though, Stevens's and my upper bounds eventually outperform this bound.
Also, there has been a nice result out of University College Dublin that I will briefly interpret.  Fintan Costello and Paul Watts find a way of presenting a related function recursively, then numerically compute a lower bound on this function which implies an upper bound on Jacobsthal's function computed on some particular values.  I thank them for reminding me about using a multiplicative inverse mod $d$ for $f$, so they deserve a "piece of the action".
These authors work in (and sometimes away from) the integer interval $BM = [b+1,b+2,\ldots,b+m]$.  Given squarefree $n$ and its distinct prime factors, listed in some order as $q_1$ to $q_k$, define $Q_i$ as  $\prod_{0 \lt j \leq i} q_j$. One approach to computing the size $\pi(b,m,n)$ of the set $CP(b,m,n)$ which has those integers in $BM$ coprime to $n$ is to do the standard inclusion-exclusion argument: if we represent by $F(b,m,d)$ the multiples of $d$ in $BM$, and say there are $f(b,m,d)$ many such multiples, and abuse some notation, I then write
$CP(b,m,n) = \sum_{d | n} sgn(d,F(b,m,d))$ .  Here $sgn$ is to suggest adding elements of the set $F(b,m,d)$ if $d$ has an even number of prime factors, and subtracting them instead when $d$ has an odd number of prime factors.
To set up for the recurrent expression, Costello and Watts use just some of the terms on the right hand side of the abused equation, and reorganize the rest of the terms.  In my interpretation of their work, they start with the multiset identity
$$CP(b,m,n) \cup \biguplus_{0 \lt i \leq k} F(b,m,q_i) =
BM \uplus  \biguplus_{0 \lt i \lt j \leq k} RCP(i,j)$$
where $RCP(i,j)$ is $F(b,m,q_iq_j) \cap CP(b,m,Q_{i-1})$, or the subset of $BM$ which has those multiples of $q_iq_j$ whose soonest prime factor in common with $n$ is $q_i$.  
One sees this identity holds by considering a member of $BM$ which has exactly $t$ distinct prime factors in common with $n$.
If $t$ is $0$, then the member occurs only once in $CP(b,m,n)$ and similarly only once in $BM$.  Otherwise, it occurs exactly $t$ times in the left hand side in $t$ distinct terms $F(b,m,q_i)$, and if $l$ is soonest such that $q_l$ is a prime factor of the member, the member occurs only once in each of $t-1$ sets
$RCP(l,j)$ (remember $l$ comes sooner than $j$) and only once in $BM$.
Now the term $RCP(i,j)$ is a subset of an arithmetic progression $A$ with common difference $q_iq_j$. By using the technique above of multiplying by a suitable inverse of $q_iq_j$ in the ring of integers mod $Q_{i-1}$, $A$ corresponds with an integer interval starting near some integer $c_{ijbm}$ of length $f(b,m,q_iq_j)$ which preserves the coprimality status with respect to $Q_{i-1}$: to wit, the size of $RCP(i,j)$ is $\pi(c_{ijbm},f(b,m,q_iq_j),Q_{i-1})$.  Using the $\pi$ term for the size of $CP$ and translating the other sets to numbers gives the numerical recurrent formula of Costello and Watts:
$$\pi(b,m,n) = m - \sum_{0 \lt i \leq k} f(b,m,q_i) 
+ \sum_{0 \lt i \lt j \leq k} \pi(c_{ijbm},f(b,m,q_iq_j),Q_{i-1})$$.
Following work of Hagedorn who computed $h(k)=g(P_k)$ for $k$ less than 50, where $P_k$ is the $k$th primorial, Costello and Watts use their formula and some analysis of coincidence of prime residues to compute an inequality for $\pi_{min}(m,n)$ which is the minimum over all integers $b$ of $\pi(b,m,n)$.  They underestimate $f(b,m,q_iq_j)$ by $\lfloor m/q_iq_j \rfloor$, ignore the $c$'s by using $\pi_min$, pull out the $i=1$ terms from the double sum and rewrite that portion to include a term $E$, depending only on $m$ and the $p_i$, which arises from looking at when estimates for the sizes of the $F(b,m,p_i)$  and $F(b,m,2p_i)$ sets can be improved, and come up with (a refined version, using $p$'s for $q$'s, of) the inequality 
$$m - \sum_{0 \lt i \leq k}  \lceil \frac{m}{p_i} \rceil + \sum_{1 \lt i \leq k} \lfloor \frac{m}{2p_i} \rfloor + E + \sum_{1 \lt i \lt j \leq k} \pi_{min}(\lfloor \frac{m}{p_ip_j} \rfloor,P_{i-1}) \leq \pi_{min}(m,P_k)$$.
With this inequality, Costello and Watts compute $\pi_{low}$, a lower bound approximation to $\pi_{min}$.  Since $h(k) \leq m$ iff $\pi_{min}(m,P_k) \gt 0$, computing $\pi_{low}(m,P_k)$ for various $m$ will give an upper bound on $h(k)$.  They say their computations for $k \leq 10000$ suggest $h(k) \leq Ck^2 \log k$, where $C$ is a constant less than $0.3$ .  Although this data is achieved using data from Hagedorn's work, even without that their algorithm yields values which are a vast improvement on known and easily computable bounds, even the ones listed above.
One item to explore is how an algorithm based on this approximation will perform given different orderings of the prime factors.  I suspect that letting the larger primes come first will give tighter results.  Another item to explore is to see if there is a better term $F$ that will supplant $E$ and some of the recurrent terms in the double sum.  The idea of rewriting the $\pi$ function recursively, while not new, is given new life in this double sum form, and suggests revisiting some old approaches with an eye toward computability.
Gerhard "Ask Me About Coprime Integers" Paseman, 2013.02.05