Number theory in general and analytic primality in
particular are a fundamental field of pure mathematics [1], [2],
[3], [4], [5], [6], which are widely applied in computer
science, AI, IT, algorithm design, coding theories,
cryptography, Internet protocols, biology, and economics [4],
[7], [8], [9], [10]. One of the most challenging questions in
number theory is the Twin Primes Conjecture initiated by de
Polignac in 1849 [11] who queried whether there exist
infinitely many twin primes among nature numbers. There is
no formal proof yet in general, because the nature and
complexity of the problem in the infinite universe of discourse
of number theory.
A typical form of the twin prime conjecture may be
informally expressed according to de Polignac’s suggestion
[4], [11] as follows.
Definition 1. The Twin Primes Conjecture queries
whether there exist infinitely many primes p such that p + 2 or
p2 may also be prime.
Many key milestones towards proving the twin prime
conjecture in the past 173 years have been represented by the
following hypotheses, findings or theorems: a) V. Brun proved
that the sum of the reciprocals of twin primes convergences
to
,2
11
()
2
pp pp
+
+
+
in 1915 [12]; b) T. Tao explored
obstructions to uniformity of primes and their arithmetic
patterns in 2006 [13]; c) T. Goldston, J. Pintz and I. Yildirim
derived that the relative gap of twin primes approaches
1
lim ( ) / log 0
n n n
np p p
+
→ −=
in 2009 [14]; c) Y. Zhang found
that there are infinitely many pairs of twin primes within a
bounded distance
6
1
0 | | 70 10
nn
pp
+
in 2014 [15];
d) T. Tao initiated the International Polymath Project where
optimizations of Zhang's work are conducted since 2014 [16];
and e) J. Maynard reduced Zhang’s bound of prime gaps to
1 1 1
lim( ) 600, lim( ) 12, and lim( ) 6
+ + +
→ → →
n n n n n n
n n n
p p p p p p
successively based on the MaynardTao theorem in 2015 [17].
This work intends to present a formal proof of the twin
prime conjecture based on a discovery of the mirror primes
and their universal distributions in the infinite set
[18]. Then, the set of twin primes

is
recognized as a subset of
where
12
nn
pp
+−
in Section II
using the big-R calculus [19]. The twin prime conjecture is
then deduced to a problem of Cantor’s equivalent countability
among sets of
,
.
, and
, which leads to a formal proof
of the twin prime conjecture in Section III based on the
recursive properties of the prime sequence and the infinite
distribution of
as discovered for proving Goldbach
conjecture [18]. Analytic experiments based on an Algorithm
of Twin-Prime Sieve (ATPS) are designed in Section IV to
demonstrate the proven twin prime theorem and its
applications.
A novel structure and a set of interesting properties of
mirror primes are introduced in recent basic research
breakthroughs [18] as a set of symmetrically adjacent pair of
A Proof of the Twin Prime Conjecture in the Ƥ x Ƥ Space
YINGXU WANG
Dept. of Electrical and Software Engineering
Schulich School of Engineering and Hotchkiss Brain Institute, University of Calgary
2500 University Dr NW, Calgary, Alberta, CANADA T2N 1N4
Abstract: This work presents a formal proof of the twin prime conjecture based on a novel mathematical
structure of mirror primes in the 2-dimensional space of primes. is an infinite recursive
set of pairs of symmetric primes adjacent to any pivotal even number in finite distances
. In the framework of the set of twin primes
is deduced to a subset of the mirror
primes where the half interval Therefore, the equivalence among sets of and
is established, i.e., based on Cantor’s principle of infinite
countability, such that the twin prime conjecture holds. Experiments based on an Algorithm of Twin-Prime
Sieve (ATPS) are designed to demonstrate and visualize the proven twin prime theorem.
Keywords: Number theory, twin prime conjecture, mirror primes, recursive sequence, algebraic number
theory, and algorithm
Received: October 16, 2021. Revised: June 9, 2022. Accepted: July 4, 2022. Published: July 25, 2022.
1. Introduction
2. Formal Models and Properties of
Twin Primes Underpinned by
Mirror Primes
WSEAS TRANSACTIONS on MATHEMATICS
DOI: 10.37394/23206.2022.21.66
E-ISSN: 2224-2880
585
Volume 21, 2022
primes with respect to any even number in
e. Based on the
concept of mirror primes, the set of twin primes may be
deduced to a special category of them where the distance (or
difference of values) is always 2. This approach may
significantly reduce the complex for recursive determination
of twin primes and enables a rigorous inference on whether
there are infinitely many pairs of twin primes.
2.1 Analytic Properties of Primes
It is used to be perceived that the sets of primes
and
twin primes
seem to possess almost irregular members.
However, a new perspective on the underpinned recursive
properties of
and
is introduced as follows.
Definition 2. A prime number p, except 2, is a positive
odd integer
2
o
p
that is not a product of two
smaller integers:
2
( | 0 (mod )), {2}\{1}
n
o
m
p n n m n
R


=
(1)
where the big-R calculus [19] denotes a recursive structure or
manipulates a recursive function.
Based on Definition 2, a general primality verification
method may be derived [18]. Though, alternative sieve
methodologies and algorithms exist [12], [20], [21], [22], [23],
[24].
Definition 3. The primality verification function
()n
determines,
{2}\{1}
o
n
, whether n is prime:
2,
0, 0 (mod ) //
()
1, otherwise //
n
mm
n m n
n
n


=

=
(2)
where
()n
results in a positive verification iff
0 (mod ) for all 2 .


n m m n
Otherwise, as a
shortcut, any negative result
0 (mod )nm
will terminate the
testing by returning false.
The primality checker
()n
plays an important role in
recursive prime generation, which knocks down any
successive odd integer for being prime if it is divisible by any
preceding prime up to
.n


Definition 4. The generic pattern of the set of primes
is
a recursive and infinite sequence of monotonously increasing
odd integers (except 2) validated by the primality checker
()n
:
1
1
1 2 1
31
{}
{ 2, 3, [ ( 2 ) | ( ) 1]},
i
i
i
p
i i i
ik
p
p p p p k p k
R
RR
=
==
= = = = + =
(3)
where
3 2 4 3 5 4
( 2) 5, ( 2) 7, and ( 4 | 2) 11 = + = = + = = + = =p p p p p p k
4
because ( 2 9 | 1) 1+ = = pk
, and etc.
The generic mathematical model of the set of primes
reveals an important recursive property of primes that leads to
the theorem of recursiveness of the prime sequence as proven
in [19]. The recursive pattern of
does not only explains the
nature of primality, but also indicates that any pn
would
remain indeterminable until the preceding primes
1n
] [ , n
pp


have been obtained. This mechanism enables
a new perspective on the nature of primes in
and their
manipulations as elaborated in the following subsection.
2.2 Analytic Properties of Mirror Primes
A novel mathematical concept of the set of mirror primes
is introduced in this work to model the pairs of mirror
primes as a 2-dimensional structure
[18].
establishes a relation between the sequence of pairwise primes
and each pivotal even numbers ne as the center of them.
will
be used to formally model the prime distribution pattern where
at least a pair of mirror primes is symmetrically adjacent to
each ne on both sides within finite distance.
Definition 5. The mirror primes
/2
e
n
p
with respect to a
pivotal even number
2
−+
+
=
ee
pp
n

are pairwise
primes symmetrically adjacent to the central ne within finite
k|
distances:
/2 / 2
/2 /
2
2
2
/2
1
{ ( )
| ( ) ( )) 1)}
,
22
−+
−+
=
=
=
=+
ee
ee
e
e
nn
ee
nn
n
n
k
nn
p k p
p
p k
p
R


(4)
where k is called the half interval of a pair of mirror primes.
For instances, according to Definition 5, the following
pairs of primes are mirror primes symmetrically adjacent to
certain pivot ne/2:
WSEAS TRANSACTIONS on MATHEMATICS
DOI: 10.37394/23206.2022.21.66
Yingxu Wang
E-ISSN: 2224-2880
586
Volume 21, 2022
Based on Definitions 5, the entire set of mirror primes
may be rigorously determined as follows.
Definition 6. The set of mirror primes
is all valid pairs
of adjacent primes with respect to each of the pivotal sequence
4 ne / 2
e bounded by the finite half interval
12
2
e
n
k
:
2
2
1
/2
/2 4
/4
/2 / 2
/2
2/2
( , )
22
[ ]}
{}
{
( ) ( ) | 1
−+
−+
=
=
=
= = +

=

=
e
e
e
ee
ee
ne
k
n
nn
ee
n
n
nn
nn
p k p k
p
pp
R
RR




(5)
where all pairs of mirror primes
/2
e
n
p
in the scope
8e
n
are determined by Definition 5.
On the basis of the properties of mirror primes
, a key
theorem of mirror-prime decomposition for all even numbers
may be formally derived in the following theorem.
Theorem 1 (Mirror Prime Decomposition, MPD). Any
even integer
/ 2 4
ee
n
may be decomposed to the sum of
at least a pair of mirror primes
/2 /2 / 2
(),
2), 2
(
e e e
n n n ee
pnn
kpp k

−+
== +
adjacent to ne/2 as
the pivot within
12
2
e
n
k
steps:
2
2
41
/2 / 2
/2 /2 / 2
/2 / 2
/2
,
) (
22
/ 2 4 :
( ) bounded
by 1
where =
2
2
,,
( , )
22
{
( )
( |
−+
−+
−+
==
+ + +
=−
=

=+
=
ee
e e e
ee
e
ne
nk
ee
nn ee
e
n n n
nn
ee
e
n p p
k
p p p
p
nk
nn
kk
n
nn
kkp
p
RR


/2 / 2
.
1) ( )
}
−+




=

ee
nn
p
(6)
The proof of Theorem 1 has been presented in [18].
Theorem 1 for prime decomposition of arbitrary even integers
is a necessary counterpart of Euclid’s Fundamental Theorem
of Arithmetic [1] for prime factorization. The MPD theorem
provides a general theory and methodology for finding all
pairs of mirror primes, including twin primes, on both sides of
any arbitrary even number ne,
4/2
e
n
, except the
special case
/ 2 2
e
n=
where the mirror primes regress to a
pair of reflexive primes
4(2, 2), 0pk
==
. Theorem 1 will be
adopted to explain the nature of twin primes
in the
following subsection.
2.3 Analytic Properties of Twin Primes
Twin primes are used to be perceived as random pairs of
primes with a constant half-interval k 1 in the spectrum of
.
However, according to the mathematical model of mirror
primes
, as introduced in Section 2.2, the set of twin
primes
may be formally derived as a special subset of
.
Therefore, if the size of
may be determined as proven in
[18], so do
towards solving the twin prime conjecture.
Definition 7. The twin primes
/2
e
n
p
with respect to a pivot
ne,
,
ee
n
are a special pair of mirror primes with a
constant half interval k 1:
/
1
2 /2
/2 2
/2 /
/
2( ) ,
( 1) 1
1, 1
22
( ) 2, 2
−+
+−
=== = +
=
ee ee
ee
nknn
ee
ne
n
n
p
pnn
pp
n
p
p
(7)
where each pair of potential twin primes
//2 2 /2 ),(
ee e
nn n
ppp
−+
=
must be validated by
/2 / 2
( ) ( ) 1
ee
nn
pp


−+
=
for sufficiently determining both of
their primality.
For instances, according to Definition 7:
44
66
88
(8 / 2 | 1) {(4 1) | (4 1) 1} {(3,5)}
(12 / 2 | 1) {(6 1) | (6 1) 1} = {(5, 7)}
(16 / 2 | 1) {(8 1) | (8 1) 1 (8 1) 0}={(7, 9
= = = = =
= = = =
= = = = + =
p p k
p p k
p p k




10 10
)}={ }
(20 / 2 | 1) {(10 1) | (9) 0 (11) 1} = {( 9
= = = = =p p k
 
1290000
12900
12 12
00
1290000
2996863034895 2 |12996863034895 2
,11)}={ }
(24 / 2 | 1) {(12 1) | (12 1) 1} = {(11,13)}
...
2996863034895 2
129000
(
{( 1)}
0
2996863034895 2
)
=
= = = =
=
=
k
p p k
p
p

where the largest pair of twin primes ever known has been
found by PrimeBios in 2016 [26].
2
4
3
5
48
50
1
1
1
{ (4 ) | (4 ) 1)}
= {( ) | (4 1) 1, ( ,6) | (4 2) 1} {( )}
{ (5 ) | (5 ) 1)} {( 7)}
{ (50 ) | (50 ) 1}
= {( ), ( ),( ), ( ), ( )}
=
=
=
==
= =
= = =
==
k
k
k
p k k
3, 5 2 3,5
p k k 3,
p k k
47,53 41,59 29, 71 11,89 3,97
R
R
R

WSEAS TRANSACTIONS on MATHEMATICS
DOI: 10.37394/23206.2022.21.66
Yingxu Wang
E-ISSN: 2224-2880
587
Volume 21, 2022
Definition 8. The set of twin primes
with respect to the
entire spectrum of pivotal even numbers 4 ne / 2
e <
are determined in the constant half interval
1k
dependent on
a valid primality verification for each pair:
/2
/2
/2
/2 / 2
/2 / 2
4
4
{}
= { 2
, )
}
(1
| ( ) ( )) 1
1
2
−+
−+
=
==−
=
+
=
e
ee
ee
e
e
n
nen
nn
e
n
n
p
pp
pp
nn
R
R


(8)
The mathematical models and the recursive properties of

pave a way to the formal proof of the twin
prime conjecture in Section III.
As a long-term challenging problem in number theory, it
is curious to find whether there are infinitely many twin
primes
( , )
e e e
n n n
p p p

−+
=
as the twin prime conjecture
queried [11]. A formal proof for twin prime conjecture is
expected to be based on the fundamental properties of twin
primes
as described in preceding sections including: a) The
universe of discourse of
is constrained by the Cartesian
product of the sets of primes
; b)
is necessarily a
subset of mirror primes, i.e.,

; and c)
is
sufficiently restricted by the uniform half-interval
1k
with
respect to any pivotal
/ 2 \{2}.
ee
n
Hypothesis 1. The Twin Prime Conjecture (TPC) queries
whether there are infinitely many pairs of twin primes

:
/2 4
/2 /2 /2 /2
/2 4
?
|
( , ) | (
|
= () 1)
+ +
=
=

=
==
e
e
e e e e
e
n
n
n n n n
n
p
p p p p
R
R

(9)
The hypothesis of TPC may be formally proven based on
the preparations in Section 2, particularly the recursiveness of
the prime sequence and the mirror prime decomposition
theorem for arbitrary even numbers. According to Theorem 1,
any pair of potential twin primes symmetrically adjacent to a
pivotal even number ne may be efficiently elicited from the set
of mirror primes
/2 /2 /2 /2
/2 4
( , ) | 2)
e e e e
e
n n n n
n
p p p p
R

+ +
=
=
when the distance of the pair is 2 or
1k
.
Lemma 1. The size of the set of mirror primes
/2 /2
/2 4
{ | ( ) ( ) = 1}
ee
e
nn
n
pp
R


−+
=
is infinite.
Proof.
and ,
e
n
because
is infinite, so
is

according to Definition 6. That is, given:
/2 / 2 /2 /2
/2 4
/2
{ ( , ) | ( ) ( )=1} ,
there exist at least a pair of mirror primes with respect to
any pivotal according to Theorem 1,
such that:
= {
+ +
=
=
e e e e
e
e
n n n n
n
e
n
p p p p
n
R

/2 / 2 / 2 /2
4
22
( , ) | ( ) ( ) = 1}
or according to the [ ] by one-to
-one mapping,
( lim ) = lim ( ) =
log
Thus, the infinity of
4
+ +
−+
=
=
= =
e e e e
ee
ee
n n n n
nn
e
nn
e
prime number theore
p p p p
m
n
n
R


holds.
Based on Lemma 1 and Definition 8, the relationship
between
and

may be formally described in Lemma 2.
Lemma 2. The set of twin primes
is a special subset of
mirror primes
determined at the sequential positions
4 / 2
e
nN
:
/2
1
4
22
/2 / 2
{(3,5), [( 6 1)
| ) ) }( ( 1]
−+
=
=
=
=
=
e
ee
ee
n
nn k
N
nn
p
pp
k
RR

(10)
where the distribution pattern of the pivotal ne/2 is constrained
by
1
{4, 6 } {4,6,12,18, ..., 6 , ..., }
k
N k k
R
=
= =
confirmed by
/2 / 2
( ( 1))
−+
=
ee
nn
pp


.
Proof. Lemma 2 holds based on the following necessary
and sufficient conditions:
/2
/2
1
a) , the condition for twin
primes elicitation requires that must be
symmetrically adjacent to the pivot {4, 6 }
2
{4,6,12, ..., 6 , ..., }.
=
=
=
e
e
n
n
e
k
p necessary
p
nNk
k
R
6
/2 6 /2 /2
1 / 2 6 /2
86
Otherwise, if , the potential pair of twin primes is
2
disqualified because:
= ( 1, +1) ,
. ., = (7, 9

=
−
e e e
ee
k
et
n k n n
k n k n N
k
nN
p p p
ep
p
g
RR

10 6
) and = ( 9
k
p

/2
66
1 / 2 6 /2
, 11) .
b) The condition for twin primes validation
ensures any false exception such as:
{ | 1= 6 1)
2
(

= =
=
=
e
ee
n
kk
e
k n k n N
sufficient
pnkpp
RR

24
1= 6 1) 1)}
2
be eliminated, . ., (23, 25
(+ +
=
e
nk
e g p
36
) or ( 35=p
,37).
3. Formal Proof of the Twin Prime
Conjecture
WSEAS TRANSACTIONS on MATHEMATICS
DOI: 10.37394/23206.2022.21.66
Yingxu Wang
E-ISSN: 2224-2880
588
Volume 21, 2022
The necessary condition of twin primes in Lemma 2 is
expressed in an informal way in the literature [27]. However,
without the restriction of the sufficient condition, many false
predictions would be resulted in
.
Example 1. Given a sequence s of arbitrarily pivotal
numbers
e
n
, certain pairs of twin primes can be elicited
from the qualified pairs of mirror primes in
according to
Lemma 2:
1290000
299
,
{0, 1, 9 2, ..., 4, 5, ..., 100, ..., / 6, ...}
{4, 6, 12, ..., 24, 30,
68630348 5 2
...
=
=
e
s
n1290000
600, ..., , ...}
{(3,5),(5,7),(11,13), ..., (23, 25
2996863034895 2
=
1290000 ),(29,31), ..., (599, 601), ..., ( 1), ...}
{2, 2, 2, ..., , 2, ..., 2, ..., 2,
2996863034895 2
=d ...}
where (s, ne,
, d) represent the serial number, pivotal center,
derived twin primes, and their distances, respectively. It is
noteworthy that the candidate pair of (23, 25) centered by ne =
24 is not twin primes because the sufficient condition of
Lemma 2 requires that both
),(
e e e
n n n
p p p

−+
=
must be prime.
Both Lemmas 1 and 2 will enable the proof of the twin
prime hypothesis to be true in order to establish the twin prime
theorem based on Cantor’s principle of equivalent countability
between infinite sets [29].
Theorem 2 (Twin Prime Theorem, TPT). There are
infinitively many pairs of twin primes in

:
/2 /2 /2
/2 4 /2 4
/2
/2 4
/2
|
,
|
1 1 1)
2 2 2
= =
,
)
(
( ) | (
1)
2
(1
−+
+

==
=
+
==
=
= + =
e e e
ee
e
e
e
n
e e e
n n n
nn
n
ne
nn
p p p
p
p
n
n
RR
R

(11)
Theorem 2 holds by a reductive proof based on the
properties and relationships of
and

as given in Lemmas
1 and 2 as follows:
Theorem 2 indicates that, although some pairs of mirror
primes in
would be ineligible because
1k
during twin
prime verification, the entire
still maintains infinity as
what Cantor has proven [29] for the equivalent classes
. =
eo
The proven twin-prime conjecture in Theorem 2 will be
experimentally elaborated in this section by an infinitively
recursive sequence of twin primes
/2 / 2
( , )
ee
nn
pp


−+
.
A numerical algorithm is introduced to demonstrate and
visualize Theorem 2, as well as the infinite distribution pattern
of twin primes in

.
Algorithm 1. The algorithm of Twin-Prime Sieve (ATPS)
is designed based on Theorem 2 as shown in Figure 1. It
provides a twin-prime determination methodology for
selecting
max
e
n
from validated mirror primes
against each
pivotal even integer
/2 4
in type | , where
|
2
−
=
e
e
ee
n
n
R
/2 /2 /2 / 2
2 and ( ) ( ) 1| | | |
+ +
=
e e e e
n n n n
p p p p

.in

The ATPS|PM algorithm is formally
described as a recursive process model (PM) ATPS|PM in
Real-Time Process Algebra (RTPA) [28], which is a form of
Intelligent Mathematics (IM) [5] that enables readers to
empirically test the twin prime theorem.
/2 / 2 /2 /2 /2 / 2
/2 /4 2
/2
4
4
/ 2 4,
1 1 | ) )
22
In the recursive process of twin prime varification fo
,
( , ) ( , ( ( 1).
=r
+ + +

==
=
+
= = =
−==
e e e e e e
ee
e
e
n n n n n n
ee
nn
n
n
nn
.
p p p p p p
RR
R


Proof
/2 / 2
/2 / 2 /2
/142
( , )
( ( 1 )
, the remaining se
, although some ineligibl
t
e
pairs of primes ) ) among = ( 6 1 must be eliminated
according to t of validLemma 2
−+
−+
= =
=
ee
e e e
e
nn
n n n
nk
k
pp
p p p
RR



win primes = \ maintain its
infinity based on Lemma 1, because only finite potential primes in | may be eliminated by
|
. This mechanism ensures:
particular
ee
e
nn
e
n
n
( )
4
/2 / 2
| | lim | ( ) \ ( )| = lim (| | | |)
there are infinitely many twin primes, i.e.:
| | { 2 } = .
Thus
+
=
+
= =
=
e e e e e e e e
ee
n
n n n n n n n n
nn
nn
pp
R



4. Numerical Experiments Based on
the Twin Prime Theorem
WSEAS TRANSACTIONS on MATHEMATICS
DOI: 10.37394/23206.2022.21.66
Yingxu Wang
E-ISSN: 2224-2880
589
Volume 21, 2022
Fig. 1. The algorithm of twin-prime sieve (ATPS)
The ATPS algorithm is a computational expression of the
mathematical models according to Theorems 2. The input (I)
of ATPS|PM is the maximum expected pivotal
max |
ee
n
in the
type of even numbers (
|e
). The output (O) of ATPS|PM is a
set () of valid twin primes adjacent to each potential ne/2
in
||
n
. The Hyperstructure (H) denotes underpinning
Structure Models (SMs) to be operated by the algorithm.
ATPS|PM is implemented by a recursive process in the loop
max
/ 2| 4
|
ee
ee
n
nR
(...) after the upper limit for an expected scope of
iterations is validated by the if-then-(else) structure ( ). It
then determines if each potential pair of twin primes
/2 / 2 / 2 /2
( ), 2|
+ +
e e e e
n n n n
p p p p
is valid according to the
primality test criteria (Eq. 2). Once both the necessary and
sufficient conditions are satisfied, the algorithm displays the
n
th twin pair otherwise it skips (
) the current iteration.
Either outcome leads to the next iteration until the algorithm
reaches
max |
ee
n
.
The ATPS algorithm provides a computational simulation
for visualizing the recursive distribution pattern of twin primes
in

. It may be implemented in MATLAB or
any programming language.
In order to visualize the proven twin prime theorem, a set
of numerical experiments has been designed and implemented
based on Algorithm 1, which provides empirical evidence for
demonstrating the infinitive distribution of twin primes in
.

The time complexity of the ATPS|PM algorithm
is
3
2
max max max
) ( ) )( e e e
O n n O n
. The space requirement for
ATPS|PM is constrained by the memory size of the
underpinning computer. Therefore, for extremely large set of
twin prime detections over 100,000,000, parallel computing
facilities are required for supporting the algorithm.
Experiment 1. Applying Algorithm 1 in MATLAB, a set
of experimental results has been obtained as shown in Figures
2 in the Cartesian space

. Figure 2
demonstrates the trends of detected twin primes in the first 26
pairs of twin primes within the scope of
24/52
e
N
based
on the twin-prime theorem. In Figure 2, the first three curves
show those of
/2 / 2
( , )
2,
+−
ee
nn
e
n
pp

, respectively. Both
/2
e
n
p
+
and
/2
e
n
p
are very close along the curve of
/2
e
n
because their
half interval
/2 / 2
= 1
22
ee
nn
ee
nn
k p p

+−
=
. The fourth curve at
the bottom of Figure 2 shows the gaps
1/2 /2 1
ii
ee
i
e
nn
ii
ee
n
g p p n n

++
= =
between each pair of
validated twin primes in the infinite sequence. For example,
1/2
14
/ 2 4, (3,5)
e
n
e
n p p

= = =
. The density of twin primes d
among
500
500 25
= 5.00%
/ 2 500
is = =
e
n
d
. The maximum gap
among the detected twin primes is 6 12 = 72 at the position
/ 2 24.=
e
n
m
ax
m
/
|
max
1
/ 2 / 2
/2
2
4|
2
a
/
x
|
|PM(< :: >; < :: | ( >;
< :: | | | [( ,
| [ , )|
( , ) 1 >)
{ 8 // 4
, )| ]
|
e
e
e e
e
e
ee
ee
nn
nn
n
ee n
nn
n
e ee
n
n p p
ppp
n
p
n
R
R
ATPS I O
H
max
/
2
/2
/ 2| 4
/2
| 2
|
/2
|
0
|:
|
( | 1
2
|
|1
2
|
( [ 0 (mod
e
ee
e
neo
e
ee nee
o
n
nee
o
n
p
mm o
np
p
pm
n
n
n
R
| ) 0 (mod | )]
|
| // Primality test fail
e
no
pm
/ 2 /
2
The +1th new i
s found
| : | 1
//
)
(" ( "
| : | ,
| )|
ee
nn
P
n
n
pri
n
n pt n
)
)
}
WSEAS TRANSACTIONS on MATHEMATICS
DOI: 10.37394/23206.2022.21.66
Yingxu Wang
E-ISSN: 2224-2880
590
Volume 21, 2022
Table 1. Statistical Distributions of Twin Primes based on the ATPS Algorithm
Scope (N)
500
10,000
100,000
1,000,000
10,000,000
100,000,000
Number of primes (Np)
95
1,229
9,592
78,498
664,579
5,761,455
Number of pairs of twin primes (N)
25
206
1,225
8,170
58,981
440,313
Density of pairs of twin primes (d = N / N)
5.00%
2.10%
1.23%
0.82%
0.59%
0.44%
Maximum gaps between twin primes (gmax)
72
210
630
1,452
1,722
2,868
Position of maximum gap (
/2
e
nN
)
23
145
833
7,121
58,619
428,136
Fig. 2. Experimental results of infinite twin primes
distribution in the space

Experiment 2. Applying the ATPS algorithm for a larger
set of twin primes in the scope of
4 / 2 210
e
n
revealing
similar results as illustrated in Figure 3. There are 206 twin
primes detected and the density of twin primes
10000 210
= = 2.10%.
/ 2 10000
e
dn
=
The maximum gap among the
pairs of detected twin primes is 6 35 = 210 observed at
/ 2 145
e
n=
.
The inductive inference in the formal proof of Theorems 2
provides a rigorous methodology for dealing with the infinite
twin prime problem. More large-scale testing based on
Algorithm 1 have been conducted as summarized in Table 1 to
support the twin prime theorem. The experimental data
provide empirical evidence for Theorem 2 by demonstrating:
a) There is no tendency that the pairs of twin primes will
disappear in the infinite sets of
constrained by


because
lim lim
ee
nn
d n n
→ →
= =
.
b) There is no sign that the gaps gmax between the pairs of
twin primes in
would irruptively jump to infinitive as
shown in Figures 2 and 3.
c) The classes of N and N are equivalent as shown in
Table 1 where N (Lemma 1) is monotonically growing along
N such that
lim | | = .
→ =
nN
Fig. 3. Experimental results of infinite twin primes
distribution in the space

The inductive inference towards the proof of Theorem 2
provides a rigorous methodology for dealing with the infinite
twin prime problem. Large-scale testing based on Algorithm 1
have been conducted as summarized in Table 1 to support the
proven twin prime theorem where the only limitation is
computing speed and memory capacity. The experimental
results have provided empirical evidence for confirming the
twin prime theorem without exception. It demonstrates the
ultimate power of human abstract inference underpinned by
mathematical laws and formal analytic platforms.
Theorem 2, Algorithm 1, and associated experiments
provide both formal proof and empirical verification of the
infinity distribution of twin primes in

. That
is,
lim (| | | | | | | | ) =
→
n

based on Cantor’s
infinitive countability across the equivalent classes of sets in
number theory [29]. The properties of mirror/twin primes and
the theorem of mirror prime decomposition have also been
applied to prove the Goldbach conjecture in my lab [18].
This work has presented a formal proof of the twin prime
conjecture based on a novel mathematical model of two-
dimensional mirror primes

and their symmetric
properties. A fundamental theorem of mirror-prime
decomposition for arbitrary even numbers has been
established towards the proof of the twin prime conjecture. By
5. Conclusion
WSEAS TRANSACTIONS on MATHEMATICS
DOI: 10.37394/23206.2022.21.66
Yingxu Wang
E-ISSN: 2224-2880
591
Volume 21, 2022
observing that the set of twin primes
with
12
nn
pp

+−
as
a subset of mirror primes, this work has deduced the twin
prime conjecture to a special case of the infinity of the
recursive sequence of mirror prims
:
/2 /2 /2 / 2 /2
/2
/2 / 2
/2 / 2
/2
4
2
2
41
and 1 ( )
= ( ) ( ) ( ) 1]
sin |
1:
2
[ , |
( , )
22
ce |
( ) ( )
|{
| 1
+ +
−+
−+
=
==

= = +
=
= =
=
e e e e e
ee
ee
e
n n n n n
nn
ee
nn
ee
e
e
n
ne
nk
n k N
pp
n
p p p
ppk
p
n
p
nk
R
RR




/2 / 2
/2 4
}| = ,
so is ( ) , according
to the MPD theorem and Cantor's equivalent counterability,
such that there are infinitely many pairs of twin
=
p
| | = | , | ,
rimes in
−+
=

ee
nn
e
npp
R


.
The formal prove of the twin prime conjecture has been
based on the discovery on the set of mirror primes

and the establishment of the equivalent countability across
lim (| | | | | | | | ) =
→
n

. Experiments using the
algorithm for twin-prime sieve have visualized the proven
twin-prime theorem and the infinitively recursive properties of
twin primes among
.
This work is supported by the Intelligent Mathematics
Initiative of the International Institute of Cognitive Informatics
and Cognitive Computing (I2CICI), the IEEE SMC Society
Technical Committee on Brain-Inspired Cognitive Systems
(TC-BCS), and the AutoDefence project of DND, Canada.
The author would like to thank the anonymous reviewers for
their valuable suggestions and comments.
[1] Euclid (325-265 BC), The Thirteen Books of Euclid’s
Elements, Translated by T.L. Heath (1928), Dover,
London, UK.
[2] M. Kline (1972), Mathematical Thought from Ancient to
Modern Times, Oxford Univ. Press, Oxford, UK.
[3] M.D. Hendy (1975), Euclid and the Fundamental
Theorem of Arithmetic, Historia Mathematica, 2:189
191.
[4] T. Gowers, J. Barrow-Green and I. Leader eds. (2008),
The Princeton Companion to Mathematics, Princeton
University Press, NJ, USA.
[5] Y. Wang (2021), “On Intelligent Mathematics for AI
(Keynote),” International Conference on Frontiers of
Mathematics and Artificial Intelligence (CFMAI’21), pp.
1-2, Beijing, China, Dec.
[6] G.H. Hardy and E.M. Wright (2008), An Introduction to
the Theory of Numbers, 6th ed., Oxford University Press,
UK.
[7] GIMPS (2021), The Great Internet Mersenne Prime
Search (GIMPS), https://www.mersenne.org/.
[8] H.R. Lewis and C.H. Papadimitriou (1998), Elements of
the Theory of Computation, Prentice-Hall, NY, USA.
[9] J.A. Buchmann (2000), Introduction to Cryptography,
Springer.
[10] Y. Wang, F. Karray, S. Kwong, K.N. Plataniotis, et al.
(2021), On the Philosophical, Cognitive and
Mathematical Foundations of Symbiotic Autonomous
Systems, Phil. Trans. R. Soc. A 379: 20200362, pp.1-20.
https://doi.org/10.1098/rsta.2020.0362.
[11] A. de Polignac (1849), New Research on Prime Numbers
(“Recherches nouvelles sur les nombres premiers (in
French), Comptes rendus, 29:397401.
[12] V. Brun (1915), Über das Goldbachsche Gesetz und die
Anzahl der Primzahlpaare (in German),” Archiv for
Mathematik og Naturvidenskab, 34(8): 319.
[13] T. Tao (2006), ”Obstructions to Uniformity and
Arithmetic Patterns in the Primes,” Pure Appl. Math. 2:
199–217.
[14] D.A. Goldston, J. Pintz, and C.Y. Yildirim (2009),
“Primes in Tuples (I), Ann. of Math. (2), 170(2):819–
862.
[15] Y. Zhang (2014), Bounded Gaps between Primes,
Annals of Mathematics, 179(3):11211174.
[16] T. Tao (2014), Polymath Proposal: Bounded Gaps
between Primes, https://polymathprojects.org/.
[17] J. Maynard (2015), Small Gaps between Primes, Annals
of Mathematics, 181(1):383413. MR 3272929.
[18] Y. Wang (2022), “A Proof of Goldbach Conjecture by
Mirror-Prime Decomposition,” WSEAS Transactions on
Mathematics, 21:563-571.
[19] Y. Wang (2008), On the Big-R Notation for Describing
Iterative and Recursive Behaviors,” Intl Journal of
Cognitive Informatics & Natural Intelligence, 2(1):17-28.
[20] Brun, V. (1915), Über das Goldbachsche Gesetz und die
Anzahl der Primzahlpaare (in German), Archiv for
Mathematik og Naturvidenskab, 34(8): 319.
[21] H.G. Mairson (1977), Some New Upper Bounds on the
Generation of Prime Numbers, Communications of the
ACM, 20(9):664669.
[22] D. Gries and J. Misra (1978), A Linear Sieve Algorithm
for Finding Prime Numbers, Communications of the
ACM, 21(12):999-1003.
[23] P. Pritchard (1987), Linear Prime-Number Sieves: A
Family Tree, Sci. Compt. Program, 9(1):17-35.
[24] G. Greaves (2001), Sieves in Number Theory, Springer,
Berlin.
[25] B. Green and T. Tao (2006), Restriction Theory of the
Selberg Sieve, with applications, J. Theor. Nombres
Bordeaux 18(1):147182.
[26] PrimeBios (2021), https://primes.utm.edu/bios/home.php.
[27] C.K. Caldwell (2018), Are all Primes (past 2 and 3) of
the Forms 6n+1 and 6n-1? https://primes.utm.edu/
notes/faq/six.html.
Acknowledgement
References
WSEAS TRANSACTIONS on MATHEMATICS
DOI: 10.37394/23206.2022.21.66
Yingxu Wang
E-ISSN: 2224-2880
592
Volume 21, 2022
[28] Y. Wang (2008), RTPA: A Denotational Mathematics
for Manipulating Intelligent and Computational
Behaviors, International Journal of Cognitive
Informatics and Natural Intelligence, 2(2):44-62.
[29] G. Cantor (1878), Ein Beitrag zur
Mannigfaltigkeitslehre, Journal r die Reine und
Angewandte Mathematik, 1878(84):242248.
Creative Commons Attribution License 4.0
(Attribution 4.0 International, CC BY 4.0)
This article is published under the terms of the Creative
Commons Attribution License 4.0
https://creativecommons.org/licenses/by/4.0/deed.en_US
WSEAS TRANSACTIONS on MATHEMATICS
DOI: 10.37394/23206.2022.21.66
Yingxu Wang
E-ISSN: 2224-2880
593
Volume 21, 2022