Properties and applications of the prime detecting function: infinitude of twin primes, asymptotic law of distribution of prime pairs differing by an even number