image
imagewidth (px) 4.16k
4.76k
|
|---|
From Reasoning Structure to the Ancient Problem of Primes
Author: Zixi Li (Oz Lee) Date: 2025 Publisher: Hugging Face
Citation
@misc{oz_lee_2025,
author = { Oz Lee },
title = { From_Reasoning_Structure_to_the_Ancient_Problem_of_Primes (Revision d9034a1) },
year = 2025,
url = { https://huggingface.co/datasets/OzTianlu/From_Reasoning_Structure_to_the_Ancient_Problem_of_Primes },
doi = { 10.57967/hf/7156 },
publisher = { Hugging Face }
}
Core Contributions
This work presents a fundamental reconceptualization of number theory grounded in semantic structure rather than algorithmic operations, establishing number theory as the minimal interpretable reasoning system.
1. Semantic Critique of Modular Arithmetic
We prove that classical modular arithmetic, despite its computational success, exhibits structural ambiguity:
- Path-agnostic collapse:
7 mod 3 = 1and9 mod 4 = 1yield identical residues but structurally distinct decompositions - External semantic dependence: Mod operations require external definitions (division → multiplication → addition → Peano axioms)
- Structural loss: Chinese Remainder Theorem representations discard decomposition paths
Key Result (Theorem 2.1): Modular arithmetic is path-agnostic—it collapses distinct structural paths into identical equivalence classes, rendering it semantically opaque.
2. Euler Stack Framework
Building on the Euler Stack dynamics, we introduce a dynamic semantic structure for natural numbers:
- Each number
ncorresponds to a unique Abstract Syntax Tree (AST) via stack expansion (push/pop/overwrite) - Structural uniqueness: Unlike mod's equivalence classes, stack-based ASTs preserve decomposition paths
- Weak reversibility: Stack operations enable backtracking, absent in irreversible neural updates
Key Result (Theorem 3.2): Stack-AST correspondence—any Euler Stack trajectory naturally generates a unique AST with semantic bias determined entirely by the operation sequence.
3. Primes as Semantic Irreducibility
We redefine primality not as "divisible only by 1 and itself" (algorithmic test), but as a dynamic semantic property:
Prime(p) ⟺ push(p) admits no legal pop path
- Push: Introduce semantic layer (attempt factorization)
- Pop: Eliminate layer via simpler semantics (successful factorization)
- Push-Pop Asymmetry: Pop must exist (grounding mandatory), push need not (not all numbers require abstraction)
Key Result (Theorem 4.1): Primality-Stack Duality—primes are isomorphic to "push mandatory, pop forbidden" states; composites to "push → pop legal" states.
4. Number Theory as Minimal Explainable Reasoning
We establish an isomorphism between number-theoretic structure and reasoning dynamics:
| Number Theory | Reasoning System |
|---|---|
| Prime irreducibility | Reasoning termination |
| Composite reducibility | Reasoning composition |
| Stack trajectory | Inference path |
| AST representation | Semantic carrier |
Key Result (Theorem 5.1): If interpretability succeeds in number theory (the simplest mathematical domain), it provides a foundation for reasoning in arbitrarily complex systems.
Paper Structure (Roadmap)
Chapter 1: Introduction—The Ancient Question Revisited
- The opacity of modular arithmetic: How mod operations collapse structure
- The paradox: Modern formalism operates at symbolic level, not semantic level
- Our approach: Return to semantic foundations via Euler Stack dynamics
Chapter 2: Related Work and Methodological Foundations
- Chinese Remainder Theorem: CRT as congruence maximization
- Chen's Theorem on Goldbach's Conjecture: Analytic-congruence paradigm limitations
- Paradigm comparison: Congruence/sieve methods vs. semantic/dynamic methods
Table 2.1: Methodological comparison showing orthogonality—classical methods excel at asymptotic existence proofs, our framework excels at structural explanations.
Chapter 3: Structural Weakness of Modular Arithmetic
- Path-agnostic operation (Definition 3.1): Different decomposition paths → identical residues
- External semantic dependence: Mod lacks self-closure
- What we need instead: Structural preservation, intrinsic generation, AST correspondence
Example 3.1: 7 mod 3 = 9 mod 4 = 1 but decompositions 7 = 3×2+1 vs 9 = 4×2+1 are structurally distinct.
Chapter 4: Euler Stack—The Minimal Dynamic Semantic System
- Formal definition (Definition 4.1): Stack as semantic generation structure, not storage
- Computational boundary (Definition 4.2): Fixed bottom frame (prior anchor)
- Operations: Push (semantic introduction), Pop (semantic elimination), Overwrite (local modification)
Theorem 4.1: Weak reversibility—push/pop enable backtracking. Theorem 4.2: Stack-AST correspondence—unique semantic bias per trajectory.
Table 4.1: Comparison showing Euler Stack surpasses mod in structural representation, path preservation, and interpretability.
Chapter 5: Primes as Dynamic Semantic Endpoints
- Number-AST correspondence (Definition 5.1): Each
n ↦ AST(n) - Semantic irreducibility (Definition 5.2): Prime = push mandatory, pop forbidden
- Semantic reducibility (Definition 5.3): Composite = push → pop legal
Lemma chain (5.1–5.4): Constructive derivation from Euler Stack axioms to primality test.
Example 5.1: Composite 12 = 3×4: Push → decompose → pop (successful grounding).
Example 5.2: Prime 7: Push → no factors exist → pop forbidden (semantic stasis).
Chapter 6: Number Theory as Minimal Explainable Reasoning System
- Yonglin Formula for number theory (Theorem 6.1): All reasoning converges to prior anchor
- Incompleteness (Corollary 6.1): Prior anchor cannot explain itself (boundary enables convergence)
- Connection to classical results: Goldbach (AST decomposition), Prime Number Theorem (logarithmic density), Fundamental Theorem (AST uniqueness)
Chapter 7: Experimental Validation
Five experiments with 100% classification accuracy:
- Minimal Semantic Explanation Machine (Algorithm 7.1): Prime/composite test via stack depth
- Stack Trajectory Comparison (Algorithm 7.2): Primes persist at
t=1, composites return tot=0 - Pop-Dominance Convergence (Algorithm 7.3):
p_pop > 0.5guarantees convergence to prior - Classification Statistics: 25 primes (depth 1) + 74 composites (depth 0) in [2,100]
- AST Depth Analysis (Algorithm 7.4): All primes = leaf nodes (depth 0)
Figures:
fig1_stack_trajectories.png: Visual proof of semantic irreducibilityfig2_mod_collapse.png: Path-agnostic property of modfig3_classification.png: 100% sensitivity/specificityfig4_ast_depth.png: Primes as structural endpointsfig5_push_pop_asymmetry.png: Pop-dominance phase transition
Chapter 8: Discussion and Future Directions
- Relationship to computational complexity (stack semantics → circuit complexity?)
- Extensions to algebraic number theory (Gaussian integers, class field theory)
- Implications for AI interpretability (neural networks lack AST structure)
Key Theorems
| Theorem | Statement | Significance |
|---|---|---|
| 2.1 Path-Agnosticity | Mod is path-agnostic: a mod m = b mod n ≠> structural equivalence |
Exposes semantic opacity of classical approach |
| 3.2 Stack-AST Correspondence | Euler Stack trajectories ↔ unique ASTs | Enables semantic transparency |
| 4.1 Primality-Stack Duality | Prime ↔ push mandatory, pop forbidden | Primality as dynamic property, not static label |
| 5.1 Number Theory ≅ Reasoning | Number structure ↔ reasoning structure (isomorphism) | Foundation for interpretable AI |
| 6.1 Yonglin Formula (NT) | All reasoning converges to prior anchor | Incompleteness enables convergence |
Experimental Results
Classification Performance (n ∈ [2, 100])
- Primes (25): All have final stack depth
t = 1(semantic layer cannot be eliminated) - Composites (74): All have final stack depth
t = 0(successful grounding) - Accuracy: 100% sensitivity, 100% specificity, F1 = 1.0
Pop-Dominance Phase Transition
p_pop ≤ 0.5: Stack diverges (unbounded depth)p_pop > 0.5: Stack converges to prior anchort = 0- Critical threshold at
p_pop = 0.5validates Lemma 6.1
AST Depth Distribution
- All primes: Depth = 0 (leaf nodes, no internal structure)
- Composites: Depth ∈ [1,5], mean ≈ 2.1
- Highly composite (e.g., 64 = 2⁶): Depth = 6 (deep semantic tree)
Repository Structure
Prime/
├── interpretable_number_theory.tex # Main paper
├── outputs/
│ ├── fig1_stack_trajectories.png # Prime vs composite dynamics
│ ├── fig2_mod_collapse.png # Modular path-agnosticism
│ ├── fig3_classification.png # 100% accuracy demonstration
│ ├── fig4_ast_depth.png # Primes as leaf nodes
│ ├── fig5_push_pop_asymmetry.png # Convergence phase transition
└── README.md # This file
Building the Paper
Requirements
- LaTeX distribution (TeX Live, MiKTeX, or MacTeX)
- Required packages:
amsmath,amssymb,amsthm,tikz,hyperref,algorithm,booktabs
Compilation
# Compile main paper
pdflatex interpretable_number_theory.tex
pdflatex interpretable_number_theory.tex # Second pass for references
# Compile Euler Stack companion paper
pdflatex euler_stack.tex
pdflatex euler_stack.tex
Running Experiments
python3 experiments.py
Outputs:
- CSV files in
outputs/(classification results, mod structure, AST depth) - PNG figures in
outputs/(5 figures with seaborn visualizations)
Conceptual Architecture
The Central Thesis
Classical number theory: "Prime = divisible only by 1 and itself" (decidable, not explanatory)
Our framework: "Prime = semantic endpoint where introduced layers cannot be eliminated" (structural, interpretable)
The Push-Pop Asymmetry (Observation 4.1)
This is the essence of primality:
- Pop must exist: All reasoning must ground (convergence mandatory)
- Push need not exist: Not all numbers require higher semantics (abstraction optional)
- Primes: Push mandatory (attempt factorization), pop forbidden (no factors exist)
- Composites: Push → pop legal (factorization succeeds, grounding achieved)
Why This Matters for AI
If numbers—the simplest reasoning objects—require semantic structure (ASTs) for interpretability, then:
- Neural networks in ℝᵈ lack this structure: Vector embeddings collapse semantics just as mod collapses decomposition paths
- Stack-based architectures needed: Discrete stack spaces with boundaries preserve semantic structure
- Interpretability is structural: Not a post-hoc explanation technique, but intrinsic consequence of correct operator categories
Relationship to Prior Work
This paper synthesizes insights from two companion works:
When Euler Meets Stack (Revision 31ac1ac):
- Proves sequential models (Transformers, RNNs) structurally fail at reasoning
- Introduces Euler-Stack correspondence: pointer dynamics ≅ honest discrete Euler iterations
- Establishes convergence via Lyapunov function V(t) = stack depth
-
- Phase transitions in NP-hard problems
- Critical density
d_c(L)marking solvable/unsolvable boundary
-
- Yonglin Formula: reasoning converges to prior anchors
- Incompleteness as dynamical system property, not defect
This paper: Applies Euler Stack framework to number theory, redefining primality as semantic irreducibility and establishing number theory as the minimal explainable reasoning system.
Why This Framework is Different
Classical Congruence-Based Paradigm
| Property | Congruence/Sieve Methods |
|---|---|
| Representation | Residue classes {n mod mᵢ} |
| Primality | Divisibility test (algorithmic) |
| Decomposition | External probing via moduli |
| Goldbach problem | Existence via density arguments (Chen's Theorem) |
| Interpretability | Opaque (residue distributions) |
Our Semantic-Dynamic Paradigm
| Property | Euler Stack Semantics |
|---|---|
| Representation | AST trajectories S(n) |
| Primality | Semantic irreducibility (structural) |
| Decomposition | Intrinsic push/pop dynamics |
| Goldbach problem | Semantic decomposition paths |
| Interpretability | Transparent (AST structure) |
Both paradigms are essential: Classical methods provide asymptotic guarantees; our framework provides structural explanations.
Positioning Statement
For Goldbach's Conjecture and prime distribution, I respect professional number theorists to advance those frontiers.
What I aim to do is something different—
To make number theory itself interpretable.
To make "what primes are" not merely a one-line divisibility definition, but a complete semantic-dynamic structure that is visualizable, operational, and traceable.
Future Directions
- Computational complexity: Do AST depth bounds provide alternative hardness measures?
- Algebraic extensions: How do prime ideals in ℤ[i] correspond to stack irreducibility?
- AI interpretability: Can stack-based architectures replace continuous latent spaces in LLMs?
- Automated theorem proving: Does semantic irreducibility suggest new proof strategies?
License
This work is licensed under Creative Commons Attribution 4.0 International (CC-BY-4.0).
You are free to:
- Share and adapt the material for any purpose
- Attribution required to Oz Lee with DOI: 10.57967/hf/7156
Contact
Oz Lee (Zixi Li) Independent Researcher Email: lizx93@mail2.sysu.edu.cn HuggingFace: @OzTianlu
Acknowledgments
This work builds on foundational insights from:
- Gauss's Disquisitiones Arithmeticae (1801) - Congruence theory
- Chen Jingrun's work on Goldbach's Conjecture (1973, 1978)
- The Chinese Remainder Theorem (Sunzi Suanjing, 3rd-5th century)
- Modern computational complexity theory and dynamical systems
Final Statement:
Number theory is not arithmetic. It is a mirror in which reasoning sees itself.
The Euler Stack reveals that the essence of reasoning—discrete states, dynamic operations, irreducible atoms, unique structural biases—already exists in natural numbers.
If interpretability succeeds here, it provides the foundation for reasoning in arbitrarily complex systems. Numbers are not inputs to reasoning; numbers ARE reasoning.
- Downloads last month
- 16