SearcharxivSearch

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\'ezout'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. 2025-04-04. 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

There is no maximal $K$-degree

The Kolmogorov complexity of a string characterize how complex it is to describe the string. If every prefix of a real $x$ is more complex to describe than every prefix (of the same length) of real $y$, then it is seen as $x$ is more complex to describe than $y$. It is wondered if there is a real $x$ so that no other reals are strictly more complex (to describe) than $x$. The behavior of Kolmogorov complexity functions generated by reals (namely $n\mapsto$ the minimal description length of the real) is quite chaos. Therefore, it is widely believed that there are many reals that are maximally complex to describe. For instance, it is conjectured that all random enough reals have maximal $K$-degree. In this paper, it is shown that there is no real with maximal $K$-degree. Actually, for almost all real $x$, we can uniformly computably find another real whose $K$-degree is strictly above $x$.

math.LO

Quadruples and cubes

We prove, in $\mathsf{ZFC}$, that the $\lambda$-terraced cube relation fails whenever $\lambda$ is an uncountable cardinal. The corresponding terraced relation for quadruples fails for every $\lambda$. If $\lambda$ is $\aleph_0$ then the pretinent terraced relation has consistency strength of at least one Woodin cardinal. We prove positive polarized relations at a successor and a double successor from wondrous ideals. We show, however, that there are no such ideals over two consecutive cardinals simultaneously.

math.LO

Possibilistic Logic over a Logic of Formal Inconsistency

In this article, we have introduced a new possibilistic logic on a logic of formal inconsistency with the aim of developing a possibility theoretic framework to deal with uncertainty and inconsistency meaningfully without leading to a system collapse. We have discussed the syntax and semantics for this logic and have proved the soundness and completeness theorems. A set of new measures of consistency, contradictoriness, and triviality of a set of formulas have been defined. These have then been put to use in an example to show that this framework can provide better means of machine reasoning.

math.LO