The ImandraX 100 Theorems Project

The Top 100 Mathematical Theorems list, compiled by Paul Sally and popularized by Freek Wiedijk, is a benchmark for formal proof systems. It includes foundational results from number theory, algebra, geometry, analysis, and combinatorics.

ImandraX can also be used as an interactive theorem prover for mathematics. Its executable logic and its proof and counterexample automation carry over from program verification. The ImandraX 100 Theorems project is an ongoing effort by Grant Passmore to formalize these theorems in ImandraX, demonstrating the system's mathematical reasoning capabilities.

Status: 33 / 100

Progress

33 of the 100 theorems have been formally proved in ImandraX. The project is ongoing; contributions welcome!

Proved theorems

#TheoremSource
1Irrationality of √2sqrt2_irrational.iml
3Denumerability of the Rationalsq_denum.iml
4Pythagorean Theorempythagoras.iml
10Euler's Generalization of Fermat's Little Theoremeuler.iml
11Infinitude of Primesinf_primes.iml
19Lagrange's Four-Square Theoremfour_squares.iml
20Fermat's Two-Square Theoremtwo_squares.iml
23Formula for Pythagorean Triplespythagorean_triples.iml
30The Ballot Problemballot.iml
34Divergence of the Harmonic Seriesharmonic.iml
38Arithmetic Mean/Geometric Meanam_gm.iml
42Sum of Reciprocals of Triangular Numberstriangular.iml
44Binomial Theorembinomial.iml
51Wilson's Theoremwilson.iml
52Number of Subsets of a Setnum_subsets.iml
54Konigsberg Bridges Problemkonigsberg.iml
58Formula for Number of Combinationscombinations.iml
60Bezout's Theoremgcd.iml
65Isosceles Triangle Theoremisosceles.iml
66Sum of a Geometric Seriesgeometric_series.iml
68Sum of an Arithmetic Seriesarithmetic_series.iml
69Greatest Common Divisor Algorithmgcd.iml
73Ascending or Descending Sequences (Erdős–Szekeres)ascending.iml
74Principle of Mathematical Inductionmath_induct.iml
77Sum of Kth Powers (Faulhaber's Formula)sum_kth_powers.iml
78Cauchy-Schwarz Inequalitycauchy_schwarz.iml
80Fundamental Theorem of Arithmeticfta.iml
85Divisibility by 3 Rulediv_by_3.iml
88Derangements Formuladerangements.iml
89Factor and Remainder Theoremfactor_remainder.iml
91Triangle Inequalitytri_ineq.iml
93The Birthday Problembirthday.iml
96Principle of Inclusion/Exclusioninclusion_exclusion.iml

Spotlight: Irrationality of √2

The proof that √2 is irrational is one of the most celebrated results in mathematics. The ImandraX formalization follows a proof by infinite descent:

  1. Assume √2 = p/q where p/q is in reduced form (gcd(p,q) = 1)
  2. Then p² = 2q²
  3. Therefore p² is even, so p is even (proved via modular arithmetic)
  4. Write p = 2k, then 4k² = 2q², so q² = 2k², and q is even
  5. But then both p and q are even, contradicting gcd(p,q) = 1

The formalization involves substantial development of modular arithmetic (mod properties), GCD theory, and careful reasoning about squares and parity. Key theorems include:

(* Squares preserve parity *)
theorem square_even_iff_even x =
  ((x * x) mod 2 = 0) = (x mod 2 = 0)
 
(* GCD absorbs common divisors *)
theorem gcd_absorbs_common_divisor d p q =
  (d > 0 && p mod d = 0 && q mod d = 0)
  ==> (gcd p q) mod d = 0
 
(* No coprime solution to p² = 2q² *)
theorem no_coprime_solution_p2_eq_2q2 p q =
  (gcd p q = 1 && p * p = 2 * (q * q))
  ==> false
 
(* The main result *)
theorem sqrt2_is_irrational (r : Rational.t) =
  Rational.is_reduced r
  ==> Rational.square r <> Rational.of_int 2

The full proof is approximately 200 lines of IML, including the modular arithmetic library and GCD theory. It demonstrates ImandraX's ability to handle deep, multi-step mathematical proofs with sophisticated tactic composition.

Mathematical areas covered

The proved theorems span a range of mathematical disciplines:

  • Number theory: Irrationality of √2 (#1), Euler's generalization of Fermat's little theorem (#10), infinitude of primes (#11), four-square theorem (#19), two-square theorem (#20), Pythagorean triples (#23), Wilson's theorem (#51), Bezout's theorem (#60), GCD algorithm (#69), fundamental theorem of arithmetic (#80), divisibility by 3 (#85)
  • Algebra: Binomial theorem (#44), Cauchy-Schwarz inequality (#78), factor and remainder theorem (#89)
  • Analysis: Divergence of harmonic series (#34), AM-GM inequality (#38), geometric series (#66), arithmetic series (#68), sum of kth powers (#77)
  • Combinatorics and probability: Ballot problem (#30), number of subsets (#52), combinations formula (#58), Erdős–Szekeres (#73), derangements (#88), birthday problem (#93), inclusion/exclusion (#96)
  • Geometry: Pythagorean theorem (#4), isosceles triangle (#65), triangle inequality (#91)
  • Set theory / logic: Denumerability of rationals (#3), mathematical induction (#74)
  • Graph theory: Konigsberg bridges (#54)

How to explore the proofs

  1. Clone the repository: git clone https://github.com/imandra-ai/imandra-100-theorems
  2. Open any .iml file in VS Code with the ImandraX extension
  3. Use the goal state viewer to step through the proofs interactively
  4. Try modifying proofs or proving the remaining 67 theorems!