Search arXivSearch

arXiv · 2504.03460

Verified Program Extraction in Number Theory: The Fundamental Theorem of Arithmetic and Relatives

Abstract

This article revisits standard theorems from elementary number theory from a constructive, algorithmic, and proof-theoretic perspective, framed within the theory of computable functionals TCF. Key examples include Bézout's identity, the fundamental theorem of arithmetic, and Fermat's factorisation method. All definitions and theorems are fully formalised in the proof assistant Minlog, laying the foundation for a comprehensive formal framework for number theory within Minlog. While formalisation guarantees correctness, the primary emphasis is on the computational content of proofs. Leveraging Minlog's built-in program extraction, we obtain executable terms and export them as Haskell code. The efficiency of the extracted programs plays a central role. We show how performance considerations influence even the original formulation of theorems and proofs. In particular, we compare formalisations based on binary encodings of natural numbers with those using the traditional unary (successor-based) representation. We present several core proofs in detail and reflect on the challenges that arise from formalisation in contrast to informal reasoning. The complete formalisation is available online and linked throughout. Minlog's tactic scripts are designed to follow the structure of natural-language proofs, allowing each derivation step to be traced precisely and thereby bridging the gap between formal and classical mathematical reasoning.

Explore related subjects

Keep this discovery

Explore connections, maps & timelines

BibTeXRIS

Franziskus Wiesnet. 2026-05-22. Verified Program Extraction in Number Theory: The Fundamental Theorem of Arithmetic and Relatives. https://arxiv.org/abs/2504.03460

Cite the original work for its findings. Save a collection to share your selection of sources.

KEEP EXPLORING

Related papers

Natural Term Logic

In this paper we develop a formal system called Natural Term Logic (NTL). NTL aims to represent key aspects of the logical and grammatical mechanisms of natural language as well as grammatical transformations which preserve core logical meaning. NTL can be seen as a refinement of the ideas of Quine's paper `Variables Explained Away' and the technical concepts introduced by Bealer and Zalta. NTL is more fine-grained than Bealer's first-order intensional logic (BL): there is a many-to-one correspondence $ν$ between NTL terms and closed BL terms as well as a canonical map $β$ which assigns to each closed BL term a corresponding NTL term. The map $ν$ can be seen as assigning a core logical content of the NTL term. We define a series of reductions on NTL terms which intuitivelyy speaking capture meaning-preserving syntactic transformations ( transformations which preserved the basic logical meaning of a term) and our main result is that each NTL term $T$ reduces to a unique normal term $N$. The reductions fall into the structural, predicative and pushing-in categories. Predicative reductions decompose NTL terms so that predication is only applied to a primitive term (such terms are called prenormal). A key ingredient in the proof is the fact that $βνN = N$ when $N$ is normal. This suggests that within NTL the normal form of a term expresses the core logical content of the term.

math.LO

Hyper-hyperfiniteness and complexity

We show that if there exists a countable Borel equivalence relation which is hyper-hyperfinite but not hyperfinite, then the complexity of hyperfinite countable Borel equivalence relationsis as high as possible, namely, $Σ^1_2$-complete. We also establish an implication between the question of the effectivity of hyperfiniteness and its complexity.

math.LO

Coordinate recognition: General theory, Groups, and other surprises

A class of structures \emph{recognizes coordinates} if any reduced product of structures from said class witnesses a certain kind of rigidity phenomenon. We provide several equivalent characterizations of this property. This property has (at least) two remarkable consequences, one set-theoretic and one model-theoretic, for reduced products of structures of the said class. First, under appropriate set-theoretic assumptions every isomorphism between such reduced products associated with the Fréchet ideal lifts (modulo a finite change) to an isomorphism between products of the original structures. Second, with an additional mild assumption, it implies a strong quantifier elimination result. Of note, we show that a class recognizes coordinates if and only if an individual formula witnesses a certain syntactic property. We also consider many concrete classes of structures and determine whether or not they recognize coordinates. We place heavy emphasis on well-known classes of groups, such as permutation groups, acylindircally hyperbolic groups, quasisimple groups, free products, and graph products, but we also discuss other classes of structures.

math.LO