A Mechanical Proof of Stirling's Approximation in ACL2(r)

Stirling's approximation to the factorial function is used extensively in science, appearing, for example, in thermal physics, where it is used to calculate entropy. It is also relevant to computer science, where it can be used to estimate the log of the factorial function, resulting in the familiar O(n ln n) bound for sorting. This paper describes a formalization in ACL2(r) of Stirling's approximation to the factorial function and its logarithm. Following the original mathematical derivation, the proofs proceed by first showing that Stirling's formula is correct up to a constant factor, then showing what the value of the constant must be. Along the way, an important equation due to Wallis is needed. This equation is especially significant to the ACL2 community, since its proof relies heavily on induction. The proof of Stirling's theorem and Wallis's formula also rely on the calculation of many integrals and the principle of integration by parts. As such, this formal proof serves both to validate ACL2(r)'s theory of integration, and to suggest some possible improvements.

Authors

Institutions

Publication Details

Journal
Electronic Proceedings in Theoretical Computer Science
Published
2026-12-02
DOI
https://doi.org/10.4204/eptcs.459.1
Citations
1
Primary Topic
Logic, programming, and type systems
Type
article
Field-Weighted Citation Impact
1.95
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
article

A Mechanical Proof of Stirling's Approximation in ACL2(r)

Ruben A. Gamboa
1 citations
Electronic Proceedings in Theoretical Computer Science
Logic, programming, and type systems
1.95
article

A Mechanical Proof of Stirling's Approximation in ACL2(r)

Ruben A. Gamboa
article en
1 citations

Abstract

Stirling's approximation to the factorial function is used extensively in science, appearing, for example, in thermal physics, where it is used to calculate entropy. It is also relevant to computer science, where it can be used to estimate the log of the factorial function, resulting in the familiar O(n ln n) bound for sorting. This paper describes a formalization in ACL2(r) of Stirling's approximation to the factorial function and its logarithm. Following the original mathematical derivation, the proofs proceed by first showing that Stirling's formula is correct up to a constant factor, then showing what the value of the constant must be. Along the way, an important equation due to Wallis is needed. This equation is especially significant to the ACL2 community, since its proof relies heavily on induction. The proof of Stirling's theorem and Wallis's formula also rely on the calculation of many integrals and the principle of integration by parts. As such, this formal proof serves both to validate ACL2(r)'s theory of integration, and to suggest some possible improvements.

Electronic Proceedings in Theoretical Computer ScienceVol. 459
University of Wyoming (US), Kestrel Institute (US)
Openalex Percentile: Top 17%
Logic, programming, and type systems
1.95
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon