One poster has very kindly taken the time to look at this, and has said that I make an unwarranted assumption about the congruence of primes. I thought I had avoided that problem by calculating the probabilities of where each composite is where only relative to one number n at a time, but am probably mistaken there.
If anyone can clarify for me where I go wrong in my basic assumption about the distribution of composites (it seems to me I use only the distribution of composites in the proof, not primes, but of course maybe I am wrong there), I would be most grateful!
Here it is.
// To search for numbers n such that n-1 and n+1 are both prime, an initially appealing naive approach suggests n is chosen so that primes 2, 3, 5, 7, etc all divide into n. However n grows so quickly that at larger values of n there are soon composites of primes too large to divide n which are in the neighbourhood of n.
With that approach every 30th number is an n dividing by 2, 3 and 5. However, instead note that of the five natural numbers n-2, n-1, n, n+1, and n+2, three of these, n-2, n, and n+2, might divide by 5 and still leave n-1 and n+1 not divisible by 5.
This generalises to ((p_n) - 2)/(p_n) many n having the nearest multiple of p_n not equal to either n-1 or n+1.
By which the integer value of 1/2 . 1/3 . 3.5 . 5/7 . 9/11 ... ((p_n) - 2)/(p_n) gives a lower bound for the number of n in some given range where neither n-1 nor n+1 divide by any of 2, 3, 5, 7, 11 .... p_n.
Trying this approach we note that between the squares of two consecutive primes (p_n-1 squared and p_n squared) three numbers are immediately unavailable as candidates for this type of n (namely p_n-1 squared + 1 ; p_n squared - 1 ; and one other ..... for example there are 25 - 9 - 3 = 13 natural numbers between 25 and 9 adjacent to neither 25 or 9, these being 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23).
We use the fact that if we can sieve out all composites below (p_n)^2 dividing by any prime up to p_n, then only primes remain.
This gives us the following expression (1)
(1) number of valid n between (p_n-1)^2 and (p_n)^2 = integer value of 1/2 . 1/3 . 3/5 ..... ((p_n) - 2)/(p_n) times [(p_n)^2 - (p_n-1)^2 - 3],
which, on multiplying the expression to the left of 'times' by (p_n) and dividing the term on the right in square brackets by (p_n), becomes expression (2)
(2) number of valid n in that range = integer value of 1/2 (1/3 . 3/5 .... ((p_n-1) - 2)/(p_n-1) . ((p_n) - 2) ..) times [(p_n) - ((p_n-1)^2) + 3)/(p_n)],
and rearranging numerators to the left of 'times' (by moving each numerator inside the curved brackets one place to the left) to give expression (3)
(3) number of valid n in that range = integer value of 1/2 (3/3.5/5.9/7 .... ((p_n) - 2)/(p_n-1) ..) times [(p_n) - ((p_n-1)^2) + 3)/(p_n)].
The term in the square brackets to the right of 'times' in expression (3) gives an integer value of at least 3 (for example the three pairs of consecutive primes 5 & 7 ; 11 & 13 ; 17 & 19 yield values of 3 ; 3 + 6/13 ; 3 + 12/19 respectively).
Since the left side multiplying the square brackets after the first couple of terms always > 1/2, the final value is the integer value of at least half 3, which is 1. Therefore there is at least one such n between the squares of any two consecutive primes, therefore infinitely many twin primes, p_B = p_A+2. //