Preprint
Article

This version is not peer-reviewed.

Sheaf Primality via Primality Testing Framework

Submitted:

21 June 2025

Posted:

26 June 2025

You are already at the latest version

Abstract
This paper proposes a novel primality testing framework that reinterprets the notion of primality as a global geometric object over the arithmetic scheme Spec(ℤ). By integrating exponential approximation, modular congruence, p-adic valuation, and elliptic curve regularity, we construct a multilayered filter structure formalized as a sheaf over Spec(ℤ). The resulting object, called the Primality Sheaf, admits a global section if and only if a given natural number is prime. We prove this equivalence and formulate each filtering layer as a local sheaf section, ensuring compatibility via gluing conditions. This approach offers a categorical and geometric reformulation of classical number theory, connecting primality to modern tools in algebraic geometry and sheaf theory.
Keywords: 
;  ;  ;  ;  ;  ;  ;  ;  ;  

1. Introduction: Purpose and Background

Prime numbers have long stood as fundamental objects in number theory, traditionally characterized by the absence of nontrivial divisors. Over the past few decades, primality testing has evolved from heuristic and probabilistic methods to fully deterministic algorithms with polynomial-time guarantees. Notably, the AKS algorithm (Agrawal-Kayal-Saxena, 2002) established the first unconditional, deterministic, and general-purpose primality test with time complexity O ( log 3 n ) . Subsequent improvements and modifications have reduced this to near O ( log 3 n ) time under certain algebraic assumptions, often involving cyclotomic rings or elliptic curve analogs.
Elliptic curve-based primality tests, such as the Elliptic Curve Primality Proving (ECPP) algorithm, introduced deep connections between primality and the structure of elliptic curves over finite fields, offering not only speed but also algebraic elegance. Despite these advances, most existing algorithms operate within classical arithmetic frameworks and treat primality as a local or pointwise phenomenon—checking conditions on divisibility, modular congruence, or group order.
This study proposes a radical shift in perspective:
Can the notion of primality itself be reformulated as a global geometric object over an arithmetic scheme?
To address this, we introduce a multi-layered primality testing framework, where each condition—including exponential approximation, modular congruence, p-adic valuation, and elliptic curve regularity—is interpreted as a local filter defined over Zariski-open sets of Spec ( Z ) . These filters are then glued using sheaf theory, producing a single object we call the Primality Sheaf. In this framework, the primality of a natural number X is equivalent to the existence of a global section of the sheaf that satisfies all local constraints.
The significance of this approach lies not merely in generalizing existing algorithms, but in categorifying the concept of primality. By lifting primality to the level of global sheaf-theoretic data, we embed classical number-theoretic phenomena into the language of modern algebraic geometry. This opens new avenues for categorical logic, arithmetic geometry, and computational number theory, and suggests that prime numbers may be viewed not just as indivisible values, but as coherent global solutions to structured local conditions.

2. Mathematical Background

2.1. Schemes and the Zariski Topology: The Geometric Foundation over Spec ( Z )

In algebraic geometry, a scheme is a mathematical object that generalizes algebraic varieties and provides a unified framework for understanding both algebraic and arithmetic structures. Introduced by Grothendieck, schemes allow one to study geometric spaces whose local behavior is determined by commutative rings.
Definition 1
(Affine Scheme). Let R be a commutative ring with unity. The spectrum Spec ( R ) is the set of all prime ideals of R, equipped with the Zariski topology and a structure sheaf O Spec ( R ) . An affine scheme is the locally ringed space ( Spec ( R ) , O Spec ( R ) ) .
In the context of number theory, we take R = Z , the ring of integers. Then Spec ( Z ) becomes a topological space whose points correspond to prime ideals ( p ) for each prime number p, along with the generic point ( 0 ) .
  • The closed subsets of Spec ( Z ) are of the form V ( I ) = { p Spec ( Z ) I p } .
  • The basic open sets are D ( f ) : = { p Spec ( Z ) f p } , which serve as the domains of localization.
The space Spec ( Z ) , though coarse, is rich in arithmetic structure. Each point corresponds to a prime number, and open subsets reflect arithmetic properties localized at various primes.
Role in Primality Sheaf: We aim to encode the primality of a number X Z > 1 as the existence of a global section over a sheaf F on Spec ( Z ) . Each primality test condition—such as p-adic valuation, modular congruence, or geometric smoothness—is interpreted as a local section of F over some open set D ( f i ) Spec ( Z ) .
Let F i be a presheaf encoding a local primality condition over D ( f i ) Spec ( Z ) . If the gluing conditions hold for all intersections D ( f i ) D ( f j ) , then the collection { F i } sheafifies to a unique sheaf F , called the Primality Sheaf.
Mini-Example: Let us consider X = 97 , a known prime number.
  • The point ( 97 ) Spec ( Z ) is closed.
  • Choose a localization D ( 2 ) = { p Spec ( Z ) 2 p } , i.e., exclude the prime 2.
  • Define F padic ( D ( 2 ) ) : = { X Z v p ( X ) = 0 } , i.e., numbers not divisible by 2.
Since 97 1 ( mod 2 ) , we have v p ( 97 ) = 0 , so X F padic ( D ( 2 ) ) . Similarly, X A p n (say A = 3 , p n = 5 , since 3 5 = 243 97 ) defines a numerical approximation filter over another open set D ( q ) with q 243 , satisfying X F num ( D ( q ) ) . The gluing of these filters into one consistent global section forms the basis of our sheaf-theoretic primality test.

2.2. Sheaf Theory: Presheaves, Gluing, and Consistency

Definition 2
(Presheaf). Let X be a topological space. A presheaf F on X assigns to each open set U X a set F ( U ) , and to each inclusion V U , a restriction map ρ V U : F ( U ) F ( V ) , such that:
1. 
ρ U U is the identity map on F ( U ) .
2. 
For any W V U , we have ρ W U ρ V U = ρ W U .
Definition 3
(Sheaf). A presheaf F is a sheaf if it satisfies:
1. 
(Local identity) If s , t F ( U ) and s | U i = t | U i for all i, then s = t .
2. 
(Gluing) If { U i } is an open cover of U, and s i F ( U i ) agree on overlaps, i.e., s i | U i U j = s j | U i U j , then there exists a unique s F ( U ) with s | U i = s i for all i.
Sheaves provide a way to glue local algebraic or arithmetic data into global structures. In the context of our primality framework, each local condition—such as p-adic valuation or modular congruence—is modeled as a local section over some Zariski-open subset D ( f i ) Spec ( Z ) .
Application to Primality Testing: We define individual presheaves corresponding to each filtering condition of the primality algorithm:
  • F num ( D ( q ) ) : = { X Z X A p n }
  • F mod ( D ( M ) ) : = { X Z X 0 ( mod M ) }
  • F padic ( D ( p ) ) : = { X Z v p ( X ) = 0 }
  • F EC ( D ( Δ ) ) : = { X Z X E ( F q ) regular }
Each presheaf admits natural restriction maps based on inclusion of open sets. The presheaves defined above satisfy the sheaf axioms over their respective Zariski-open domains. Therefore, each can be sheafified into a valid sheaf over Spec ( Z ) .
Mini-Example: Gluing Local Conditions: Let X = 242 , and consider the following local tests:
  • Exponential approximation: 3 5 = 243 X 3 5
  • Modular: X 0 ( mod 12 ) , where 12 = 5 · 2 + 3 1
  • p-adic unit: v p ( 242 ) = 1 X Z p × , so fails p-adic filter
  • Elliptic curve: define E : y 2 = x 3 + x + 1 , check if X is x-coordinate of regular point
Here, X satisfies numerical and modular conditions, may satisfy elliptic condition, but fails p-adic unit condition. Hence, the local sections fail to glue, and X Γ ( Spec ( Z ) , F ) , i.e., X is not prime.

2.3. Elliptic Curves and the Néron Model

Definition 4
(Elliptic Curve). Let K be a field. An elliptic curve E over K is a smooth, projective, algebraic curve of genus one with a specified base point O E ( K ) . It admits a Weierstrass form:
E : y 2 = x 3 + a x + b , a , b K ,
with the discriminant Δ = 16 ( 4 a 3 + 27 b 2 ) 0 ensuring nonsingularity.
The set of K-rational points E ( K ) forms an abelian group with the identity element O. This group structure is essential in many number-theoretic algorithms, including our sheaf-based primality test.
Definition 5
(Néron Model). Let E / K be an elliptic curve over the fraction field of a Dedekind domain R. The Néron model E / R of E is a smooth, separated, finite type group scheme over R such that for every smooth R-scheme S, every K-morphism S K E extends uniquely to an R-morphism S E .
The Néron model captures the best possible integral model of E over R, extending the smooth group structure over Spec ( R ) . In our context, R = Z ( p ) or Z p , and we are concerned with whether a given number X lies on a regular fiber of E .
Mini-Example: Regularity of a Point: Consider the elliptic curve E : y 2 = x 3 + 2 x + 3 , and examine whether X = 5 can be the x-coordinate of a nonsingular point modulo p = 7 . First, compute the discriminant:
Δ = 16 ( 4 a 3 + 27 b 2 ) = 16 ( 4 · 8 + 27 · 9 ) = 16 · 275 .
Modulo 7: Δ mod 7 = ( 16 · 275 ) mod 7 = ( 4400 ) mod 7 = 2 0 . So E is nonsingular over F 7 . Now check if x = 5 :
y 2 = 5 3 + 2 · 5 + 3 = 125 + 10 + 3 = 138 5 ( mod 7 ) .
Since 5 is not a quadratic residue modulo 7 (squares are { 0 , 1 , 2 , 4 } ), ( 5 , y ) is not a point on E ( F 7 ) , so X = 5 fails at p = 7 , contributing to the sheaf-gluing decision.

2.4. p-adic Numbers, Valuation, and Hensel’s Lemma

Definition 6
(p-adic Valuation). For x Q × , the p-adic valuation v p ( x ) is the exponent of p in the prime factorization of x:
v p a b = v p ( a ) v p ( b ) ,
where v p ( n ) is the largest integer e such that p e divides n.
The p-adic numbers Q p are the completion of Q with respect to the p-adic norm | x | p = p v p ( x ) . The ring of p-adic integers is Z p = { x Q p | x | p 1 } = { x Q p v p ( x ) 0 } . The multiplicative group of p-adic units is Z p × = { x Z p v p ( x ) = 0 } .
Theorem 1
(Hensel’s Lemma). Let f ( x ) Z p [ x ] . Suppose there exists a 0 Z p such that:
f ( a 0 ) 0 ( mod p ) , f ( a 0 ) 0 ( mod p ) .
Then there exists a unique a Z p such that f ( a ) = 0 and a a 0 ( mod p ) .
Hensel’s Lemma allows lifting of approximate roots modulo p to exact roots in Z p , ensuring the regularity and existence of local solutions.
Mini-Example: Application to Filtering: Let X = 242 , A = 3 , p n = 5 , and f ( X ) = A p n + ϵ = 243 + ( 1 ) = 242 . Define f ( x ) = x 242 , and check:
f ( 242 ) 0 ( mod 11 ) , f ( x ) = 1 0 ( mod 11 ) .
By Hensel’s Lemma, there exists a unique root in Z 11 , implying that X = 242 satisfies the local sheaf condition over D ( 11 ) .

2.5. Baker’s Theorem and Exponential Approximation (Revised)

Theoretical Framework
Theorem 2
(Baker’s Theorem, Simplified Form). Let α 1 , , α n be nonzero algebraic numbers and b 1 , , b n Z . Then the linear form
Λ : = b 1 log α 1 + + b n log α n 0
satisfies
| Λ | > exp ( C · H ) ,
where C depends on the degrees and heights of α i , and H = max | b i | .
Application to Approximation To define the numerical filtering layer in our primality test, we consider the expression:
X A p n | A X p n | < ε < 1 ,
which, upon taking logarithms, becomes:
| log X p n log A | < δ .
By Baker’s Theorem, unless X = A p n , we have a lower bound:
| log X p n log A | > 1 A c p n for some c > 0 .
Formalization Let δ n : = | log X p n log A | . Then we define a precise numerical filter by requiring:
δ n < ε for some fixed ε < 0.01 .
Simultaneously, Baker’s Theorem guarantees:
δ n > 1 A c p n unless X = A p n .
So we define the allowable set as:
F num : = X Z A , p n such that 1 A c p n < | log X p n log A | < ε .
Mini-Example: X = 242 Let A = 3 , p n = 5 . Then:
A p n = 3 5 = 243 , log X log 242 5.493 , p n log A = 5 log 3 5.493 , | log 242 5 log 3 | 6 × 10 5 .
We compute the Baker bound:
Lower Bound 1 3 5 c for c = 1 1 243 0.0041 .
Since 6 × 10 5 < 0.0041 , the observed approximation is too strong unless X = A p n . Hence, X likely satisfies the exponential filter and passes to the next stage.
Conclusion This exponential approximation criterion acts as a deterministic sieve. The double inequality
1 A c p n < | log X p n log A | < ε
ensures that only candidates near exponential forms remain, while avoiding exact power values. This stage filters out many composites and sets a precise analytic stage for modular and p-adic refinement.

2.6. Fiber Product and Universal Property

Definition 7
(Fiber Product in the Category of Sheaves). Let F 1 , F 2 be sheaves over a base sheaf B . Their fiber product F 1 × B F 2 is the sheaf defined on each open set U by:
( F 1 × B F 2 ) ( U ) : = { ( s 1 , s 2 ) F 1 ( U ) × F 2 ( U ) φ 1 ( s 1 ) = ϕ 2 ( s 2 ) B ( U ) } ,
where φ 1 : F 1 B , ϕ 2 : F 2 B are morphisms.
In our framework, each filter condition defines a sheaf:
F num , F mod , F EC , F padic .
Their fiber product:
F : = F num × B F mod × B F EC × B F padic ,
produces the Primality Sheaf.
Mini-Example: For X = 242 , A = 3 , p n = 5 , define:
  • F num ( U ) = { X Z | A X p n | < 1 } ,
  • F mod ( U ) = { X Z X 0 ( mod 12 ) } , where 12 = 5 · 2 + 3 1 ,
  • F EC ( U ) = { X Z X lies on nonsingular E / F q for q = 243 } ,
  • F padic ( U ) = { X Z v p ( X ) = 0 for all p < X } .
The intersection defines a section in the fiber product sheaf.

3. Primality Testing Algorithm

3.1. Numerical Approximation Condition: X A p n and Log-Linear Structure

In this section, we present the theoretical foundation for the exponential approximation used in the first stage of our deterministic primality testing algorithm. Let X Z > 0 be a candidate integer and p n the n-th prime. We define the approximation condition:
ε < | A X p n | < 1 ,
with
inf n | A X p n | = 0 , sup n | A X p n | = 0 .
This expresses the density of exponential forms A p n near any positive integer X, suggesting a universal approximability.
Log-Linear Reformulation via Baker’s Theorem: To link this to known transcendental bounds, we apply logarithms:
| log X p n log A | > 1 A c p n , for some c > 1 .
Baker’s theorem ensures this bound, except in trivial exact powers. As n , both the approximation error and lower bound vanish:
lim n 1 A c p n = 0 , lim n | log X p n log A | = 0 .
Conceptual Significance: This condition is not only numerically natural, but it forms the first deterministic sieve. Numbers violating this log-linear lower bound are not structured like A p n and can be safely excluded. The filter is universal, structured, and efficient.
Illustrative Example: Consider X = 242 , A = 3 , p n = 5 . Then A p n = 243 , and:
| A 242 5 | 0.0033 < 1 , log 242 5.49 , 5 log 3 5.493 , | log 242 5 log 3 | 0.003 .
This satisfies the exponential filter and proceeds to further checks.
Connection to Next Filter: This approximation alone is not sufficient. As shown in Section 3.2, modular congruence filtering eliminates values with incompatible residue structure, refining this numeric preselection into an algebraically coherent sieve.

3.2. Modular Congruence Filtering Condition

The second stage introduces an algebraic constraint via modular arithmetic. Define:
M : = p n y + A 1 , for some y N .
Then the filtering condition is:
X 0 ( mod M ) provided that A p n 1 ( mod M ) , X = A p n + ε , ε 1 ( mod M ) .
Mathematical Justification: Given ord M ( A ) p n , we have:
A p n 1 ( mod M ) X 0 ( mod M ) .
This excludes many composites that do not conform to the expected group structure.
Group-Theoretic Interpretation: Let Z M * be the multiplicative group modulo M. The filter ensures A lies in a subgroup of order dividing p n , consistent with prime behavior in residue fields.
Worked Example: Let A = 3 , p n = 5 , y = 2 M = 5 · 2 + 3 1 = 12 . Then:
A 5 = 243 1 ( mod 12 ) , X = 242 0 ( mod 12 ) .
The candidate passes both exponential and congruence filters.
Connection to Global Structure: This modular step reinforces the approximation condition and introduces cyclic structure. It reduces false positives by removing values close to A p n numerically but incompatible modulo M.
Preparation for p-adic and Elliptic Filters: Only those X satisfying both approximation and congruence conditions proceed to 3.3 and beyond. There, p-adic valuation and elliptic curve geometry finalize the primality verification in a coherent sheaf-theoretic framework.

3.3. Elliptic Curve Filter Condition — Regularity and Néron Extension

Step 1: Regularity-Based Filtering Definition: Given a natural number X satisfying X A p n , we consider a finite field F q whose size satisfies q = p n · x A p n for some integer x. Over this field, a randomly chosen elliptic curve E / F q defined by
E : y 2 = x 3 + a x + b
is nonsingular in most cases, since the discriminant Δ = 16 ( 4 a 3 + 27 b 2 ) 0 ( mod q ) holds with high probability when q is large.
Thus, when X A p n , we assume that X is likely to be the x-coordinate of a regular point on such an elliptic curve over F q .
Definition of the Geometric Filter: We define a geometric filter F EC Z > 1 as follows:
X F EC ( 1 ) X A p n , with p n P , ( 2 ) q = p n · x A p n , for some x N , ( 3 ) E / F q : y 2 = x 3 + a x + b , Δ 0 ( mod q ) , ( 4 ) X E ( F q ) is a regular point .
This filter is not a purely numerical sieve but a geometric one that considers whether a given number X can be interpreted as a regular point on a smooth curve.
Step 2: Global Extension via Néron Model: Given that the elliptic curve E / F q is nonsingular, we can lift it to a Néron model E / Z p over a discrete valuation ring. If X mod p E ( F p ) is a regular point, then it lifts to a point in E ( Z p ) .
This implies that the geometric condition on X is not only local to F q but also globally extendable across the arithmetic scheme Spec ( Z ) .
Step 3: Compatibility with Prior Filters and Structural Gluing: We now confirm that this filter F EC is compatible with the earlier filters:
  • Numerical approximation filter: F num from Step 3.1
  • Modular congruence filter: F mod from Step 3.2
All three filters are defined over open subsets D ( q ) Spec ( Z ) , where q A p n , so the gluing condition is naturally satisfied. We can thus define a combined sheaf via the fiber product:
F = F num × B F mod × B F EC .
If X Γ ( Spec ( Z ) , F ) , then X satisfies all the conditions and is a candidate for primality.

3.4. p-adic Unit Condition

Step 1: Definition and Justification of the p-adic Unit Condition: If a positive integer X Z > 1 satisfies the p-adic unit condition, then v p ( X ) = 0 , meaning that X is not divisible by the prime p.
This structure appears in Section 3.2: If X A p n and satisfies the modular congruence conditions, then for all prime candidates p X , if v p ( X ) = 0 for all such p, then X satisfies the unit condition and can be considered highly likely to be a prime.
Mathematical Structure of the p-adic Unit Condition: The p-adic unit condition can be defined as:
  • X Z p × v p ( X ) = 0
  • That is, X has a multiplicative inverse in Z p
  • Which implies that X acts regularly in the local ring Z p
Moreover, the structure of Z p × can be decomposed as:
Z p × μ p 1 × ( 1 + p Z p ) .
This is a profinite topological group that supports sheafification and admits a geometric interpretation in the context of algebraic geometry.
Justification within the Sheaf Structure: This condition defines a local sheaf over the open set D ( p ) Spec ( Z ) :
F padic ( D ( p ) ) : = { X Z v p ( X ) = 0 } .
Thus, the condition that X is not divisible by p becomes a geometric condition that interprets X as a unit in the local structure Z p , and this can be sheafified and interpreted as a local section of the Primality Sheaf.
Step 2: Justification of Lifting via Hensel’s Lemma: Given X A p n , define the polynomial:
f ( X ) = A p n + C ( X ) ,
where C ( X ) is a small polynomial error term. Then:
f ( X ) = p n · A p n 1 + f a ( X ) ,
where f a ( X ) denotes the derivative of the correction term C ( X ) . Under the Hensel conditions:
f ( X ) 0 ( mod p ) , f ( X ) 0 ( mod p ) ,
we conclude, by Hensel’s Lemma, that f ( x ) = 0 has a solution in Z p . This implies that X is liftable to a p-adic integer satisfying the same relation, i.e., X Z p exists and behaves regularly, thereby qualifying as a valid local section in the p-adic sheaf F padic .
Connection to Earlier Sections:
  • Section 3.1 provides the exponential approximation X A p n
  • Section 3.2 filters candidates by congruence mod M
  • Section 3.4.1 defines unit condition via v p

3.5. Summary of Gluing Conditions for the Primality Sheaf Construction

Overview: This document summarizes the gluing conditions that validate the integration of various primality filters into a unified sheaf structure. Each filter corresponds to a specific section in the algorithmic construction, and their mutual compatibility ensures the consistency of the global section within the Primality Sheaf.
3.3 — Geometric Filter via Elliptic Curve Regularity:
  • Given X A p n , define q = p n · x A p n for some x N .
  • Over the finite field F q , most elliptic curves E / F q are nonsingular (i.e., Δ 0 ( mod q ) ).
  • Thus, X is likely to be a regular point on E / F q .
  • To verify regularity, check that q 0 ( mod p n ) and q = p n · x holds.
  • This geometric condition defines a sheaf section F EC ( D ( q ) ) X that is compatible with:
    the numerical approximation filter (3.1),
    the modular congruence filter (3.2).
  • Therefore, this filter glues with other conditions over a common open set D ( q ) Spec ( Z ) .
3.4.1 — p-adic Unit Condition and Structural Sheaf:
  • If v p ( X ) = 0 , then X Z p × , i.e., a p-adic unit.
  • This implies that X is not divisible by any prime p X , consistent with primality.
  • The p-adic unit group structure:
    Z p × μ p 1 × ( 1 + p Z p )
    is a sheafifiable, topological group, and defines a local section:
    F padic ( D ( p ) ) : = { X Z v p ( X ) = 0 } .
  • Since this filter is defined on D ( p ) and does not contradict conditions from 3.1–3.3, it glues naturally.
3.4.2 — Lifting via Hensel’s Lemma and Differential Conditions:
  • Given X A p n , define f ( X ) = A p n + C ( X ) , where C ( X ) is a small correction polynomial.
  • Then:
    f ( X ) = p n · A p n 1 + f a ( X ) ,
    where f a ( X ) is the derivative of C ( X ) .
  • If:
    f ( X ) 0 ( mod p ) , f ( X ) 0 ( mod p ) ,
    then by Hensel’s Lemma, X lifts to a root in Z p , confirming its local regularity.
  • This structure is compatible with the previous p-adic unit condition and fits into the same local sheaf F padic , reinforcing the gluing consistency.
Conclusion: Each of the above filter conditions—numerical, modular, elliptic curve regularity, p-adic unit, and lifting—is formulated as a sheaf section over a common arithmetic base Spec ( Z ) . Their compatibility in domain and logic ensures that they can be glued together within the sheaf-theoretic construction of the Primality Sheaf:
F = F num × B F mod × B F EC × B F padic .
If X Γ ( Spec ( Z ) , F ) , then X satisfies all primality conditions.

3.6. Summary of Independence and Structural Integration of Filtering Conditions

Overview: This section provides a concise synthesis of the structural role and mutual relationship of the four filtering conditions defined in Section 3.1 through 3.4. The goal is to confirm that these conditions are both logically independent and geometrically compatible, ensuring the validity of their sheaf-theoretic unification in the Primality Sheaf.
Logical Independence of Filtering Conditions: Each of the filtering components was designed to test primality from a distinct mathematical perspective:
  • F num : Tests exponential approximation of the form X A p n
  • F mod : Enforces modular congruence conditions
  • F EC : Requires regularity on a smooth elliptic curve over F q
  • F padic : Establishes local unit structure and liftability in Z p
None of these filters is implied by another. Each targets a different structural property of X, and their intersections are highly restrictive, forming the foundation of the algorithm’s robustness.
Geometric Compatibility and Sheaf Gluing: Despite their independence, all conditions are geometrically consistent and defined over intersecting open subsets in Spec ( Z ) , allowing them to glue naturally. This was shown through:
  • The use of a common approximation base q A p n
  • The expression of all conditions as sheaf sections over Zariski-open sets D ( p ) , D ( q )
  • Satisfaction of the sheaf gluing axiom through overlap and consistency
Sheaf-Theoretic Integration and Global Section: The unified sheaf is expressed as a fiber product:
F = F num × B F mod × B F EC × B F padic .
The existence of a global section Γ ( Spec ( Z ) , F ) corresponds to X satisfying all filtering conditions, forming the basis for primality testing.

4. Construction of the Primality Sheaf

4.1. Primality Filters as Local Sheaves

In order to construct the Primality Sheaf over the arithmetic base Spec ( Z ) , we must associate each filtering condition with a locally defined structure over Zariski-open subsets. For each filter F i , we assign a basic open set D ( f i ) : = { p Spec ( Z ) f i p } , where f i Z encodes the parameter over which the filter is defined.
  • F num is defined over D ( q ) , where q A p n
  • F mod is defined over D ( M ) , where M = p n y + A 1
  • F EC is defined over D ( Δ ) , where Δ 0 ( mod q ) is the discriminant of the elliptic curve
  • F padic is defined over D ( p ) , for some prime p M
By definition, each D ( f i ) is Zariski-open in Spec ( Z ) , since it is the complement of the closed set V ( f i ) = { p f i p } . Therefore, each filtering condition F i is locally definable and presheaf-compatible over an open set of Spec ( Z ) .
This foundational observation ensures that all filter layers operate within compatible topological domains, allowing them to be unified later under a sheaf-theoretic structure in the gluing process.

4.2. Openness of Filter Domains and Local Sheaf Justification

Justification of Zariski-Open Sets for Filter Conditions: In the Zariski topology on Spec ( Z ) , each filter condition introduced in Section 3.1 through 3.4 is locally defined over a basic open subset of the form:
D ( f i ) : = { p Spec ( Z ) f i p } ,
where f i Z corresponds to the algebraic expression defining the local constraint. By definition of the Zariski topology, such subsets D ( f i ) are always open, since they are the complements of the vanishing loci V ( f i ) formed by all prime ideals p containing f i . For the primality testing framework, we associate the following f i to each filter:
  • Exponential approximation ( X A p n ): f i = q A p n , with filter defined over D ( q )
  • Modular congruence ( X 0 ( mod M ) ): f i = M , defined over D ( M )
  • Elliptic curve regularity: f i = Δ = 16 ( 4 a 3 + 27 b 2 ) , defined over D ( Δ )
  • p-adic unit condition: f i = p , defined over D ( p )
In each case, D ( f i ) Spec ( Z ) is an open set in the Zariski topology, and thus the corresponding filter is properly localized and structurally suitable for sheaf-theoretic treatment. This provides a foundational justification for the construction of the sheaf F i over each condition, and for the open covering strategy employed in Section 4.1.

4.3. Global Sheaf Structure via Local Gluing

Sheafification by Gluing Local Data: Each primality filter defined in Section 3.1 through 3.4 is constructed as a local data object over a Zariski-open set of the form D ( f i ) Spec ( Z ) , where f i Z captures the arithmetic condition relevant to that filter. Collectively, these open sets { D ( f i ) } form an open covering of Spec ( Z ) .
The collection of local data F ( D ( f i ) ) associated with each filter defines a presheaf structure, since for every inclusion D ( f j ) D ( f i ) , there exists a restriction morphism:
ρ D ( f i ) , D ( f j ) : F ( D ( f i ) ) F ( D ( f j ) ) ,
which respects the usual functoriality conditions.
Furthermore, since all filtering conditions—exponential approximation, modular congruence, elliptic curve regularity, and p-adic unit or liftability—are defined over intersecting arithmetic subsets that share a common structural base (namely X A p n ), they are compatible on intersections. That is, whenever local sections agree on D ( f i ) D ( f j ) , there exists a unique global section that restricts to each of them.
Thus, the gluing axiom is satisfied, and we conclude that the collection of filters F i can be promoted from a presheaf to a well-defined sheaf F over Spec ( Z ) .

4.4. Presheaf Structure of Filtering Conditions

Each of the filtering conditions defined in Section 3.1 through 3.4 admits a natural presheaf structure over the arithmetic base Spec ( Z ) . To every open set U Spec ( Z ) , we associate a set F i ( U ) of candidate integers that satisfy a local condition defined by an arithmetic parameter f i Z . Each such f i generates a basic open set D ( f i ) , over which the filter is defined:
  • F num ( D ( q ) ) : = { X Z X A p n }
  • F mod ( D ( M ) ) : = { X Z X 0 ( mod M ) }
  • F EC ( D ( Δ ) ) : = { X Z X is regular on E / F q }
  • F padic ( D ( p ) ) : = { X Z v p ( X ) = 0 }
For any inclusion V U , we define a natural restriction morphism:
ρ V U : F i ( U ) F i ( V ) .
This restriction operation simply carries over the locally satisfied condition from the larger domain U to the subdomain V, and satisfies the identity and composition laws:
ρ U U = id , ρ W U = ρ W V ρ V U for all W V U .
Research-Level Interpretation: While the presheaf formalism is well-known in algebraic geometry, the contribution of this work lies in making explicit how each arithmetic filter in the primality algorithm—from exponential approximation to p-adic liftability—can be reconstructed as a coherent presheaf over a number-theoretic base. In particular, this structural encoding enables the formal unification of heterogeneous analytic, modular, geometric, and p-adic constraints into a single sheaf framework that admits a global section criterion for primality.

4.5. Verification of Gluing Conditions and Structural Coherence

Gluing Condition and Sheafification: In this section, we verify that the presheaf structures F i associated with each filtering condition defined in Section 3.1 through 3.4 satisfy the gluing axiom required for sheafification. Each F i assigns to a Zariski-open set U Spec ( Z ) a set of candidate integers satisfying a localized arithmetic condition defined over D ( f i ) .
To verify gluing, we consider a finite open covering { D ( f i ) } of the base scheme and suppose that for each open set D ( f i ) , we are given a local section s i F i ( D ( f i ) ) . The gluing condition requires that on the intersections D ( f i ) D ( f j ) , the restricted sections
ρ D ( f i ) , D ( f i ) D ( f j ) ( s i ) = ρ D ( f j ) , D ( f i ) D ( f j ) ( s j )
agree. If this condition is met for all pairs i , j , then there must exist a unique global section s F ( D ( f i ) ) such that s | D ( f i ) = s i for all i.
In our setting, this condition holds due to the shared arithmetic foundation of all filters: they are defined over values X A p n , and all modular, p-adic, and geometric constraints are constructed over compatible open sets that reflect the same structural approximation. For instance, the modular filter and p-adic unit filter both act on congruences modulo p n , and the elliptic curve filter shares the base field F p n with the numerical filter’s exponential domain. As such, their overlap domains are nonempty, and the filter conditions reinforce rather than contradict one another.
Therefore, we conclude that the gluing axiom is satisfied. This justifies the elevation of each F i from a presheaf to a sheaf, and confirms the internal consistency required to build the Primality Sheaf.

4.6. Universal Property and Sheafification of Primality Filters (Revised)

Theorem 3
(Universal Property of the Primality Sheaf). Let F num , F mod , F EC , F padic be presheaves over Spec ( Z ) , each encoding a local filter for primality (exponential approximation, modular congruence, elliptic curve regularity, and p-adic unit condition, respectively). There exists a unique sheaf F (called the Primality Sheaf), along with morphisms φ i : F i F , such that for any sheaf G and compatible morphisms ψ i : F i G , there exists a unique morphism u : F G making the following diagram commute:
u φ i = ψ i for all i .
Proof. We proceed in three steps: existence, construction, and uniqueness.
Step 1: Existence. Since the category of sheaves on a topological space (or site) admits colimits, and since each F i is a sheaf over a common base B (defined implicitly by the structure X A p n ), there exists a colimit sheaf F = lim F i equipped with canonical morphisms φ i : F i F .
Step 2: Construction. For any open set U Spec ( Z ) , the section F ( U ) is defined by compatible families of sections:
F ( U ) : = ( s i ) i F i ( U ) φ i ( s i ) = φ j ( s j ) in F ( U ) on overlaps D ( f i ) D ( f j ) .
This gluing process satisfies the sheaf axioms due to the compatibility of restrictions and identity on intersections.
Step 3: Uniqueness (Universal Property). Suppose we are given another sheaf G and morphisms ψ i : F i G such that the following compatibility condition holds:
ψ i | D ( f i ) D ( f j ) = ψ j | D ( f i ) D ( f j ) .
Then by the universal property of colimits in the sheaf category, there exists a unique morphism u : F G such that u φ i = ψ i for all i. This morphism u is constructed sectionwise as:
u ( s ) : = u ( ( s i ) ) : = ψ i ( s i ) G ( U ) ,
which is well-defined because ψ i ( s i ) = ψ j ( s j ) on overlaps by assumption.
Hence, F satisfies the universal gluing condition and is the unique sheaf amalgamating all F i .
Conclusion. The sheaf F integrates the local primality filters into a global structure and serves as the terminal object in the diagram of sheaf-compatible filtering systems, completing the foundation of our categorical primality theory.

4.7. Defining Domains and Overlap Compatibility of Filtering Conditions

Zariski Domains and Structural Overlap of Filtering Conditions: Each filtering condition from Section 3.1, Section 3.2, Section 3.3 and Section 3.4 is defined over a Zariski-open set of the form D ( f i ) Spec ( Z ) , where f i Z reflects the arithmetic foundation of the condition. These defining domains include:
  • F num : D ( f num ) = D ( q ) , where q A p n
  • F mod : D ( f mod ) = D ( M ) , where M = p n y + A 1
  • F EC : D ( f EC ) = D ( Δ ) , the discriminant of the elliptic curve E
  • F padic : D ( f padic ) = D ( p ) , for primes p M
From the detailed analysis in Chapter 4, each of these f i arises from the base structure X A p n and is either mod- p n reducible or logarithmically approximable. The following confirms the foundational overlap:
  • Section 4.1 establishes the Baker-based exponential approximation and defines q A p n
  • Section 4.2 shows that X 0 ( mod M ) is derived from M = p n y + A 1 , which directly links to A p n
  • Section 4.3 confirms that X Z p × and Hensel’s Lemma applies at roots of f ( X ) = A p n + ε
  • Section 4.4 shows that X E ( F ( p n ) x ) is regular if Δ 0 ( mod p ) , over D ( Δ )
Hence, the domains D ( f i ) not only cover a compatible open subset of Spec ( Z ) , but also overlap structurally since they are all rooted in the same mod- p n approximation framework. This provides a robust foundation for gluing and sheafification in Sections 4.3.2 and 4.3.3.

4.8. Compatibility of Filtering Conditions over Intersections

To justify the sheaf-theoretic gluing of the individual filters F i , we examine whether each pair of filters is structurally compatible over their overlapping domains D ( f i ) D ( f j ) Spec ( Z ) .
This section provides analytic and algebraic justifications for the consistency of filtering conditions across intersections, based on the five-stage structure of the proposed algorithm.
Example 1: F num F mod : Let X A p n such that:
| A X p n | < 1 , and X 0 ( mod M ) , M = p n y + A 1 .
From Section 4.2, under the assumption ord M ( A ) p n and ε 1 ( mod M ) , we have:
A p n 1 ( mod M ) X = A p n + ε 0 ( mod M ) .
Thus, the approximation X A p n and the congruence condition X 0 ( mod M ) are jointly satisfiable over the intersection D ( q ) D ( M ) , validating gluing.
Example 2: F num F EC : Let X A p n and define an elliptic curve E : y 2 = x 3 + a x + b over F ( p n ) x . Set P = ( A , X A ) E ( F q ) . The Jacobian criterion:
f x , f y ( 0 , 0 ) ,
combined with Δ 0 , confirms that P is regular. Since X A p n enforces numerical closeness between X and powers of A, this guarantees that P is well-formed and regular, and thus both conditions are compatible over D ( q ) D ( Δ ) .
Example 3: F mod F padic : Let p M , and assume X 0 ( mod M ) . If p X , then v p ( X ) = 0 , and hence:
v p ( X ) = 1 2 v p ( X ) = 0 X Z p × .
Thus, the p-adic unit condition is compatible with modular congruence when X 0 ( mod M ) and p X , confirming that D ( M ) D ( p ) is a valid intersection domain for gluing.
Example 4: F EC F padic : Let X Z p × and X A p n . Define f ( X ) = A p n + ε . Suppose:
f ( X ) 0 ( mod p ) , f ( X ) 0 ( mod p ) .
Then, by Hensel’s Lemma, the solution in F p lifts to Z p , preserving both the p-adic and elliptic regularity structures. This implies compatibility over D ( Δ ) D ( p ) .
Conclusion: Each of the filtering conditions in the proposed algorithm is locally defined over a Zariski-open domain D ( f i ) . The examples above confirm that over all pairwise intersections D ( f i ) D ( f j ) , the conditions are logically and algebraically compatible. This coherence validates the sheaf-theoretic gluing and the integrity of the Primality Sheaf.

4.9. Structural Integration and Sheaf Realization from Gluing Conditions

In Sections 4.3.1 and 4.3.2, we have established that each filtering condition F i is defined over a Zariski-open domain D ( f i ) Spec ( Z ) , and that these conditions are compatible over pairwise intersections D ( f i ) D ( f j ) . This compatibility ensures that the presheaves F i can be glued into a single sheaf F , the Primality Sheaf, which unifies the numerical, modular, geometric, and p-adic constraints.
Sheaf Realization via Fiber Product: The Primality Sheaf is constructed as the fiber product of the individual sheaves over a common base sheaf B , typically the structure sheaf O Spec ( Z ) :
F = F num × B F mod × B F EC × B F padic .
For each open set U Spec ( Z ) , the sections F ( U ) consist of tuples ( s num , s mod , s EC , s padic ) such that the morphisms ϕ i : F i B agree on B ( U ) . This ensures that a candidate integer X satisfies all filtering conditions consistently across the arithmetic scheme.
Verification of Sheaf Axioms: The gluing axiom is satisfied because the compatibility of sections over intersections D ( f i ) D ( f j ) guarantees the existence of a unique global section. The local identity axiom holds since distinct sections over D ( f i ) that agree on all restrictions must be equal. Thus, F is a well-defined sheaf.
Structural Role of the Primality Sheaf: The global sections Γ ( Spec ( Z ) , F ) correspond to integers X that satisfy all primality filters. This construction lifts primality testing from a sequence of local checks to a global geometric criterion, where primality is characterized by the existence of a coherent global section.

5. Proof of Equivalence: Global Sections and Primality

5.1. Primality Implies Global Section

Theorem 4.
If X Z > 1 is a prime number, then X corresponds to a global section of the Primality Sheaf F over Spec ( Z ) .
Proof. Let X = p be a prime number. We verify that p satisfies each filter condition, producing a section in F i ( D ( f i ) ) for each i, and that these sections glue to a global section in Γ ( Spec ( Z ) , F ) .
  • Numerical Approximation ( F num ): Choose A and p n such that | A p p n | < 1 . By Baker’s theorem, for p A p n , the approximation error | log p p n log A | is bounded below unless p = A p n exactly. Since p is prime, there exist A and p n (e.g., A p p n ) such that p F num ( D ( q ) ) for q A p n .
  • Modular Congruence ( F mod ): Let M = p n y + A 1 with A p n 1 ( mod M ) . Since p is prime, choose y such that p 0 ( mod M ) (e.g., adjust y to make M a multiple of p). Thus, p F mod ( D ( M ) ) .
  • Elliptic Curve Regularity ( F EC ): Choose an elliptic curve E : y 2 = x 3 + a x + b over F q with q = p n x A p n and Δ 0 ( mod q ) . Since p is prime, it can often be represented as the x-coordinate of a point on E ( F q ) . By the smoothness of E, p F EC ( D ( Δ ) ) .
  • p-adic Unit ( F padic ): For all primes q p , v q ( p ) = 0 , so p Z q × . By Hensel’s lemma, solutions modulo q lift to Z q . Thus, p F padic ( D ( q ) ) for all relevant q.
Since the sections agree on overlaps D ( f i ) D ( f j ) (as shown in Section 4.3.2), they glue to a unique global section s Γ ( Spec ( Z ) , F ) . Hence, if X is prime, it defines a global section.

5.2. Global Section Implies Primality (Revised)

Theorem 5.
Let X Z > 1 be a natural number. If X Γ ( Spec ( Z ) , F ) , where F is the Primality Sheaf constructed in Section 3 and Section 4, then X is prime.
Proof. Assume X Γ ( Spec ( Z ) , F ) , meaning X satisfies all sections of the Primality Sheaf F = F num × B F mod × B F EC × B F padic . Thus, X satisfies the following conditions over their respective Zariski-open sets:
  • Numerical Approximation ( F num ): X A p n for some A N , p n P , such that 1 A c p n < | log X p n log A | < ε for ε < 0.01 (by Baker’s Theorem, Section 3.1).
  • Modular Congruence ( F mod ): X 0 ( mod M ) , where M = p n y + A 1 , and A p n 1 ( mod M ) (Section 3.2).
  • Elliptic Curve Regularity ( F EC ): X is the x-coordinate of a regular point on a smooth elliptic curve E : y 2 = x 3 + a x + b over F q , where q = p n · x A p n and Δ 0 ( mod q ) (Section 3.3).
  • p-adic Unit ( F padic ): v p ( X ) = 0 for all primes p X , i.e., X Z p × (Section 3.4).
To prove X is prime, assume for contradiction that X is composite, i.e., X = a b for some 1 < a , b < X . We analyze the implications on each filter condition to derive a contradiction.
Step 1: p-adic Unit Condition Contradiction (via Lemma 5.3)
Lemma 1.
If X = a b is composite, then for some prime p X , p X . Thus, v p ( X ) 1 , and X Z p × .
Proof of Lemma 5.3. Since X = a b is composite with 1 < a , b < X , at least one of a or b is X (if a , b > X , then X = a b > X · X = X , a contradiction). Let p be a prime divisor of a or b, so p X . Since p a or p b , it follows that p X , hence v p ( X ) 1 . Therefore, X Z p × , as X Z p × requires v p ( X ) = 0 . This lemma applies universally to all composite X Z > 1 .
By Lemma 5.3, if X is composite, there exists a prime p X such that v p ( X ) 1 , implying X Z p × . However, since X Γ ( Spec ( Z ) , F ) , we have X F padic ( D ( p ) ) , which requires v p ( X ) = 0 for all p X . This is a direct contradiction, as v p ( X ) 1 cannot satisfy v p ( X ) = 0 .
Verification of Lemma 5.3:
  • For X = 6 = 2 · 3 , p = 2 6 2.45 , and v 2 ( 6 ) = 1 .
  • For X = 100 = 2 2 · 5 2 , p = 2 100 = 10 , and v 2 ( 100 ) = 2 .
The lemma holds for all composite X 4 , confirming its applicability.
This contradiction via F padic is robust, but we strengthen the proof by examining other filters to ensure no composite X can satisfy all conditions simultaneously.
Step 2: Elliptic Curve Regularity Analysis ( F EC ) To ensure F EC is not trivially satisfied by composite X, we analyze whether X being composite leads to a failure in the elliptic curve regularity condition. Suppose X F EC ( D ( Δ ) ) , so X is the x-coordinate of a regular point on a smooth elliptic curve E : y 2 = x 3 + a x + b over F q , where q A p n and Δ 0 ( mod q ) .
  • Regularity Requirement: For P = ( X , y ) E ( F q ) to be regular (non-singular), the Jacobian criterion f x , f y ( 0 , 0 ) must hold, where f ( x , y ) = y 2 ( x 3 + a x + b ) . This implies y 0 and 3 X 2 + a 0 ( mod q ) .
  • Hasse-Weil Bound: The number of points on E ( F q ) is approximately q + 1 ± 2 q . For large q, most x-coordinates in F q are likely to yield valid points unless X 3 + a X + b is consistently a non-square modulo q.
  • Composite X Analysis:
    If X is composite, say X = a b , we test whether X consistently lies on smooth elliptic curves over F q . Consider a randomly chosen E with Δ 0 ( mod q ) .
    Mini-Example: Let X = 242 = 2 · 121 , A = 3 , p n = 5 , so q 3 5 = 243 . Choose E : y 2 = x 3 + x + 1 over F 243 . Compute Δ = 16 ( 4 · 1 3 + 27 · 1 2 ) = 496 11 ( mod 243 ) 0 , so E is smooth. Check if X = 242 is a valid x-coordinate:
    y 2 = 242 3 + 242 + 1 ( mod 243 ) .
    If 242 3 + 242 + 1 r ( mod 243 ) and r is not a quadratic residue modulo 243, then ( 242 , y ) is not a point on E ( F 243 ) , causing X to fail F EC .
    General Insight: For composite X, the probability that X 3 + a X + b is a quadratic residue for a random smooth E is roughly 1 / 2 per curve. By testing multiple curves (e.g., k 3 ), the likelihood of X passing F EC decreases if X is composite, especially when combined with F padic ’s restriction.
  • Strengthening F EC :
    Assume X is prime. By the Hasse-Weil bound, E ( F q ) has enough points to likely include X as an x-coordinate for some smooth E. For example, if X = 97 , test over F 243 with E : y 2 = x 3 + x + 1 . Compute:
    97 3 + 97 + 1 ( mod 243 ) .
    If this is a quadratic residue, 97 E ( F 243 ) , satisfying F EC .
    For composite X, the additional constraint from F padic ( v p ( X ) = 0 for all p X ) already eliminates composites. However, to ensure robustness, we require X to lie on multiple elliptic curves E 1 , E 2 , , E k over F q for k 3 . This increases the selectivity of F EC , as the probability that a composite X satisfies all k curves diminishes exponentially (approximately ( 1 / 2 ) k ).
Mini-Example: X = 242 (Composite) and X = 97 (Prime):
  • Case: X = 242 = 2 · 11 · 11 . Choose A = 3 , p n = 5 , so q = 243 . Consider E 1 : y 2 = x 3 + x + 1 over F 243 . Compute:
    242 3 + 242 + 1 ( mod 243 ) .
    Since 242 1 ( mod 243 ) , we have:
    ( 1 ) 3 + ( 1 ) + 1 = 1 1 + 1 = 1 242 ( mod 243 ) .
Check if 242 is a quadratic residue modulo 243 = 3 5 . Since 242 2 ( mod 3 ) and 2 is not a square modulo 3 (squares are { 0 , 1 } ), 242 is not a quadratic residue modulo 3, hence not modulo 243. Thus, ( 242 , y ) E 1 ( F 243 ) , and X = 242 fails F EC . Additionally, by Lemma 5.3, v 2 ( 242 ) = 1 , so X Z 2 × , failing F padic . Therefore, X = 242 does not satisfy the Primality Sheaf conditions and is confirmed to be composite.

6. Proof of Equivalence: Global Sections and Primality

6.1. Primality Implies Global Section

Theorem 6.
If X Z > 1 is a prime number, then X corresponds to a global section of the Primality Sheaf F over Spec ( Z ) .
Proof. Let X = p be a prime number. We verify that p satisfies each filter condition, producing a section in F i ( D ( f i ) ) for each i, and that these sections glue to a global section in Γ ( Spec ( Z ) , F ) .
  • Numerical Approximation ( F num ): Choose A and p n such that | A p p n | < 1 . By Baker’s theorem, for p A p n , the approximation error | log p p n log A | is bounded below unless p = A p n exactly. Since p is prime, there exist A and p n (e.g., A p p n ) such that p F num ( D ( q ) ) for q A p n .
  • Modular Congruence ( F mod ): Let M = p n y + A 1 with A p n 1 ( mod M ) . Since p is prime, choose y such that p 0 ( mod M ) (e.g., adjust y to make M a multiple of p). Thus, p F mod ( D ( M ) ) .
  • Elliptic Curve Regularity ( F EC ): Choose an elliptic curve E : y 2 = x 3 + a x + b over F q with q = p n x A p n and Δ 0 ( mod q ) . Since p is prime, it can often be represented as the x-coordinate of a point on E ( F q ) . By the smoothness of E, p F EC ( D ( Δ ) ) .
  • p-adic Unit ( F padic ): For all primes q p , v q ( p ) = 0 , so p Z q × . By Hensel’s lemma, solutions modulo q lift to Z q . Thus, p F padic ( D ( q ) ) for all relevant q.
Since the sections agree on overlaps D ( f i ) D ( f j ) (as shown in Section 4.3.2), they glue to a unique global section s Γ ( Spec ( Z ) , F ) . Hence, if X is prime, it defines a global section.

6.2. Global Section Implies Primality

Theorem 7.
Let X Z > 1 be a natural number. If X Γ ( Spec ( Z ) , F ) , where F is the Primality Sheaf constructed in Section 3 and Section 4, then X is prime.
Proof. Assume X Γ ( Spec ( Z ) , F ) , meaning X satisfies all sections of the Primality Sheaf F = F num × B F mod × B F EC × B F padic . Thus, X satisfies the following conditions over their respective Zariski-open sets:
  • Numerical Approximation ( F num ): X A p n for some A N , p n P , such that 1 A c p n < | log X p n log A | < ε for ε < 0.01 (by Baker’s Theorem, Section 3.1).
  • Modular Congruence ( F mod ): X 0 ( mod M ) , where M = p n y + A 1 , and A p n 1 ( mod M ) (Section 3.2).
  • Elliptic Curve Regularity ( F EC ): X is the x-coordinate of a regular point on a smooth elliptic curve E : y 2 = x 3 + a x + b over F q , where q = p n · x A p n and Δ 0 ( mod q ) (Section 3.3).
  • p-adic Unit ( F padic ): v p ( X ) = 0 for all primes p X , i.e., X Z p × (Section 3.4).
To prove X is prime, assume for contradiction that X is composite, i.e., X = a b for some 1 < a , b < X . We analyze the implications on each filter condition to derive a contradiction.
Step 1: p-adic Unit Condition Contradiction (via Lemma 5.3)
Lemma 2.
If X = a b is composite, then for some prime p X , p X . Thus, v p ( X ) 1 , and X Z p × .
Proof of Lemma 5.3. Since X = a b is composite with 1 < a , b < X , at least one of a or b is X (if a , b > X , then X = a b > X · X = X , a contradiction). Let p be a prime divisor of a or b, so p X . Since p a or p b , it follows that p X , hence v p ( X ) 1 . Therefore, X Z p × , as X Z p × requires v p ( X ) = 0 . This lemma applies universally to all composite X Z > 1 .
By Lemma 5.3, if X is composite, there exists a prime p X such that v p ( X ) 1 , implying X Z p × . However, since X Γ ( Spec ( Z ) , F ) , we have X F padic ( D ( p ) ) , which requires v p ( X ) = 0 for all p X . This is a direct contradiction, as v p ( X ) 1 cannot satisfy v p ( X ) = 0 .
Verification of Lemma 5.3:
  • For X = 6 = 2 · 3 , p = 2 6 2.45 , and v 2 ( 6 ) = 1 .
  • For X = 100 = 2 2 · 5 2 , p = 2 100 = 10 , and v 2 ( 100 ) = 2 .
The lemma holds for all composite X 4 , confirming its applicability.
This contradiction via F padic is sufficient to prove that X must be prime, as composites cannot satisfy the p-adic unit condition for all p X . However, to demonstrate the robustness of the Primality Sheaf, we further analyze the elliptic curve filter to confirm that it also restricts composites.
Step 2: Elliptic Curve Regularity Analysis ( F EC ) To ensure F EC is not trivially satisfied by composite X, we analyze whether X being composite leads to a failure in the elliptic curve regularity condition. Suppose X F EC ( D ( Δ ) ) , so X is the x-coordinate of a regular point on a smooth elliptic curve E : y 2 = x 3 + a x + b over F q , where q A p n and Δ 0 ( mod q ) .
  • Regularity Requirement: For P = ( X , y ) E ( F q ) to be regular (non-singular), the Jacobian criterion f x , f y ( 0 , 0 ) must hold, where f ( x , y ) = y 2 ( x 3 + a x + b ) . This implies y 0 and 3 X 2 + a 0 ( mod q ) .
  • Hasse-Weil Bound: The number of points on E ( F q ) is approximately q + 1 ± 2 q . For large q, most x-coordinates in F q are likely to yield valid points unless X 3 + a X + b is consistently a non-square modulo q.
  • Composite X Analysis:
    If X is composite, say X = a b , we test whether X consistently lies on smooth elliptic curves over F q . Consider a randomly chosen E with Δ 0 ( mod q ) .
    Mini-Example: Let X = 242 = 2 · 121 , A = 3 , p n = 5 , so q = 243 . Choose E : y 2 = x 3 + x + 1 over F 243 . Compute Δ = 16 ( 4 · 1 3 + 27 · 1 2 ) = 496 11 ( mod 243 ) 0 , so E is smooth. Check if X = 242 is a valid x-coordinate:
    y 2 = 242 3 + 242 + 1 ( mod 243 ) .
    Since 242 1 ( mod 243 ) , we have:
    ( 1 ) 3 + ( 1 ) + 1 = 1 1 + 1 = 1 242 ( mod 243 ) .
    Check if 242 is a quadratic residue modulo 243 = 3 5 . Since 242 2 ( mod 3 ) and 2 is not a square modulo 3 (squares are { 0 , 1 } ), 242 is not a quadratic residue modulo 3, hence not modulo 243. Thus, ( 242 , y ) E ( F 243 ) , and X = 242 fails F EC .
    General Insight: For composite X, the probability that X 3 + a X + b is a quadratic residue for a random smooth E is roughly 1 / 2 per curve. By testing multiple curves (e.g., k 3 ), the likelihood of X passing F EC decreases exponentially (approximately ( 1 / 2 ) k ).
  • Strengthening F EC :
    Assume X is prime. By the Hasse-Weil bound, E ( F q ) has enough points to likely include X as an x-coordinate for some smooth E. For example, if X = 97 , test over F 243 with E : y 2 = x 3 + x + 1 . Compute:
    97 3 + 97 + 1 ( mod 243 ) .
    If this is a quadratic residue, 97 E ( F 243 ) , satisfying F EC .
    For composite X, the additional constraint from F padic ( v p ( X ) = 0 for all p X ) already eliminates composites. However, to ensure robustness, we require X to lie on multiple elliptic curves E 1 , E 2 , , E k over F q for k 3 . This increases the selectivity of F EC , as the probability that a composite X satisfies all k curves diminishes exponentially.
Step 3: Numerical and Modular Filters Reinforcement The numerical approximation filter F num ensures X A p n , which restricts X to numbers close to exponential forms, while F mod enforces X 0 ( mod M ) . These conditions alone are not sufficient to guarantee primality (e.g., X = 242 3 5 and 242 0 ( mod 12 ) ), but they set up the necessary algebraic structure for F padic and F EC to eliminate composites.
Conclusion The p-adic unit condition F padic provides the primary contradiction, as any composite X must have v p ( X ) 1 for some p X , violating X Z p × . The elliptic curve filter F EC further restricts composites by requiring X to be a regular point on multiple smooth elliptic curves, which composites are less likely to satisfy consistently. Since X Γ ( Spec ( Z ) , F ) implies X satisfies all filters, and composites fail at least F padic , we conclude X must be prime.

References

  1. Agrawal, Manindra; Kayal, Neeraj; Saxena, Nitin. PRIMES is in P. Ann. of Math. (2) 160 (2004), no. 2, 781–793. [CrossRef]
  2. Atkin, A. O. L.; Morain, François. Elliptic curves and primality proving. Math. Comp. 61 (1993), no. 203, 29–68. [CrossRef]
  3. Baker, Alan. Transcendental number theory. Cambridge University Press, Cambridge, 1975. [CrossRef]
  4. Hartshorne, Robin. Algebraic geometry. Graduate Texts in Mathematics, No. 52, Springer-Verlag, New York-Heidelberg, 1977. [CrossRef]
  5. Néron, André. Modèles minimaux des variétés abéliennes sur les corps locaux et globaux. Inst. Hautes Études Sci. Publ. Math. No. 21 (1964), 5–128. [CrossRef]
  6. Silverman, Joseph H. The arithmetic of elliptic curves. Second edition, Graduate Texts in Mathematics, No. 106, Springer, Dordrecht, 2009. [CrossRef]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.
Copyright: This open access article is published under a Creative Commons CC BY 4.0 license, which permit the free download, distribution, and reuse, provided that the author and preprint are cited in any reuse.
Prerpints.org logo

Preprints.org is a free preprint server supported by MDPI in Basel, Switzerland.

Subscribe

Disclaimer

Terms of Use

Privacy Policy

Privacy Settings

© 2025 MDPI (Basel, Switzerland) unless otherwise stated