If the prover and verifier agree on which primes are used, the prover can show that A_i and A_e are constructed correctly.
Let x be the product of all included primes.
Let y be the product of all excluded primes.
Let z be the product of all primes.
Let A_i = g^x \mod N
Let A_e = g^y \mod N
Let A_T = g^{z} \mod N
A_T is the accumulator containing all primes. This value can be pre-calculated and stored on chain.
Now I want to use a double Wesolowski proof, to show that x*y=z.
We are substituting:
x = B\lfloor \frac x B \rfloor + x \mod B
We use the following witnesses:
b_1=g^{\lfloor \frac x B \rfloor} \mod N
b_2=A_e^{\lfloor \frac x B \rfloor} \mod N
r=x \mod B
The verifier should check:
b_1^B.g^r \equiv A_i \mod N
b_2^B.A_e^r \equiv A_T \mod N