1. Introduction
The different forms of completeness theorems of real number are the basis on which calculus, and more generally mathematical analysis are built [
1]. Calculus had promoted the development of mathematics largely since the 17th century. It solves the perplexed traditional problems such as tangent and area of curve and has profound practical applications in physics, finance, computer science, and other disciplines. The completeness theorem of real number is very critical in the transition from calculus to analysis [
2]. Analysis which evolved from calculus is a branch of mathematics that studies limit and related theories [
3].
As early as BC, people already had the concept of limit [
4]. The famous Chinese philosopher Zhuangzi wrote in the “Tian Xia”: If from a stick a foot long you every day take the half of it, in myriad ages, it will not be exhausted. In the 17th century, Newton and Leibniz founded far-reaching calculus, but it was questioned due to its unstable foundation. Until the 19th century, the progress of analysis led mathematicians to establish a rigorous limit theory [
3]. The landmark work was mainly explored by Cauchy [
5], Bolzano [
6], and Weierstrass [
7] that defined strictly the limit by “
”.
Between the 18th and 19th centuries, mathematicians gave a variety of forms to express the completeness of real number, which greatly promoted the development in real analysis [
8]. These theorems include: Dedekind fundamental theorem, Supremum theorem, Monotone convergence theorem, Cauchy–Cantor theorem: Nested interval theorem, Heine–Borel–Lebesgue theorem: Finite cover theorem, Bolzano–Weierstrass theorem I: Accumulation point theorem, Bolzano–Weierstrass theorem II: Sequential compactness theorem, Cauchy completeness theorem. The finite cover theorem usually can be used to describe compactness in general topology [
9,
10]. Heine used this theorem early and Borel was the first to state and prove the modern form but the formulation restricted to countable covers. Furthermore, Lebesgue et al. generalized it to arbitrary covers. The sequential compactness theorem was actually first proved by Bolzano in 1817 as a lemma in the proof of the intermediate value theorem. Some fifty years later, the result was considered to have important independent significance, and proved again by Weierstrass [
6]. Since then, it has become an essential theorem in real analysis. With the further study, the establishment of rigorous and complete real number theory became a significant achievement.
The construction of the real number theory can be realized by any real number completeness theorem, apart from Cauchy completeness theorem and Nested interval theorem, which need to add the Archimedes property. At present, there are two usual ways to define real number: axiomatization and construction. The first one is based on a dozen axioms [
11,
12], and the later one can be mainly divided into three approaches: Dedekind cut, Cauchy sequence, and Decimal representation [
13,
14].
There is very little preparatory knowledge required in Landau’s Foundations of Analysis [
15]. Starting from the Peano axioms, the whole number system theory from natural number to complex number are given in turn. In this book, there are several important theorems proved: minimum principle, Archimedes theorem for rational number, the existence of irrational number, and Dedekind fundamental theorem, which embodies the completeness of real number. The whole process is natural and beautiful. Many theories can be developed based on this.
The formalization of mathematics based on a theorem prover, such as Coq [
16,
17,
18,
19], Isabelle [
20] and HOL Light [
21], and so on [
22,
23,
24,
25], has yielded many outstanding achievements over recent years. The “Four-color theorem” has been formally proved in Coq by Gonthier and Werner in 2005 [
26]. Furthermore, Gonthier has presented the machine-checked proof of the “Odd Order theorem” based on Coq in 2012 [
27]. In 2017, Hales et al. have completed the formal proof of the Kepler conjecture [
28]. Those achievements make theorem provers more and more popular in academia. Moreover, the relevant research teams around the world have completed or plan to complete one hundred well-known mathematical theorems including Fundamental Theorem of Algebra, Insolvability of General Higher Degree Equations, and the Central Limit Theorem. Wiedijk pointed out that formal mathematics is the third revolution in the history of mathematics [
25]. Therefore, the formalization of basic mathematical theory is of great significance [
29,
30].
In this work, we formally implement the cyclic proof of eight completeness theorems of real number. The circulating proof is first formalized systematically as far as we know. First of all, we developed the formal system of real number theory strictly following Landau’s “Foundations of Analysis”. Moreover, the every step of the formalizations has been verified in Coq, which can check and enrich the many details in traditional proofs. Additionally, we have presented some new methods to optimize proof steps. All the formal proofs are checked by the proof assistant Coq, which embodies the characteristics of reliability and interactivity. Furthermore, there are several important theory, such as calculus, general topology, and complex analysis, can be constructed based on the “Foundations of Analysis” formal system.
The paper is organized as follows:
Section 2 is dedicated to related work. In
Section 3, we briefly present the required background needed for the understanding of this work. In
Section 4, we introduce the real number theory system strictly following Landau’s “Foundations of Analysis” and add the essential contents to enrich the system. In
Section 5, we present some definitions and consequents about them needed in the proof. In
Section 6, we discuss the cyclic proof of equivalence among completeness theorems of real number in detail. Finally, we draw our conclusions and discuss some potential further work in
Section 7.
2. Related Work
There already exists some formalizations of Landau’s “Foundations of Analysis”. de Bruijn [
31] designed earliest proof checker Automath, and his student van Benthem Jutting has completed the formalization of Landau’s “Foundations of Analysis” in AUT-QE [
32]. This work was significant early progress in formal mathematics. Moreover, Brown has given a particular faithful reproduction of a signature corresponding to the Automath version of Landau’s book [
33]. Guidi has encoded this specification into the formal language “
”, and, furthermore, presents an implemented procedure producing a representation of the “Foundations of Analysis” in Coq [
34]. Their work is similar in concept, but there are some important differences in terms of verification algorithm and solving type inconsistencies, etc.
In addition to the above work, there is some work concerning analysis. Harrison has presented formalized real numbers and calculus on his HOL Light system [
35]. Fleuriot has realized the mechanization of real analysis in Isabelle/HOL [
36]. Moreover, Grimm has defined real numbers from set theory, and he aims to formalize the fundamental notations of mathematics referring to “Elements of Mathematics” of Bourbaki [
37]. Geuvers and Niqui introduced real numbers as the usual Cauchy completion of the rational numbers [
38]. In addition, Cruz-Filipe et al. have developed the the Constructive Coq repository—C-CoRN, where the constructive proofs of the Fundamental Theorem of Algebra and Fundamental Theorem of Calculus were formalized [
39,
40]. In Coq’s standard library, there is already a set of real number theories based on a dozen axioms. The excellent real analysis library—Coquelicot [
41]—is developed by Boldo et al. as an extension of the library. This library accomplishes many achievements, but its definition of real number is non-constructive, which is different from our original intention. We aim to develop a readable and complete real number system where the various types of numbers have a progressive relationship.
Our present work takes from all of the above cited works. We define natural numbers, fractions, rational numbers, cuts, real numbers, and complex numbers in order strictly following Landau’s “Foundations of Analysis”. We define real number by the way of construction (Dedekind cut) instead of axiomatization, and deduce the Dedekind fundamental theorem, which reflects the completeness of this real number theory system. Further from the Dedekind fundamental theorem, we formally implement the cyclic proof of eight completeness theorems.
In our previous conference paper [
42], we had completed the proof of equivalence between Dedekind fundamental theorem and Supremum theorem. Furthermore, we present the properties of continuous functions on closed intervals including boundedness theorem, extreme value theorem, intermediate value theorem, and uniform continuity theorem. This work is an application of our system.
3. Preliminary
Coq is based on an axiom-free type theory called the Calculus of Inductive Constructions [
43,
44,
45]. The core logic is intuitionistic, and a few useful axioms that are independent from the Calculus of Inductive Constructions [
46] can be safely added to Coq (The Logic of Coq is available at:
https://github.com/coq/coq/wiki/The-Logic-of-Coq).
According to different requirements, users can use these axioms in their Coq development. Moreover, the Coq system allows us to set notations for definitions to increase the readability of the code. We use “” represent universal quantifiers and existential quantifiers, and “” represent anonymous function in Coq “fun ”.
3.1. Logic
There are three useful logical axioms: strong excluded middle, propositional extensionality, and functional extensionality. Their formal descriptions are as follows:
By strong excluded middle, we can build a value by dynamically testing whether a proposition is true or false such as piecewise function. Its definition combining “sumbool” is the same as “or” in structure, but their types are different. The definition of “sumbool” function in Coq is as follows:
We have to use the strong excluded middle starting from the real number. Before the real number part, we just use the excluded middle as follows:
Propositional extensionality asserts that two equivalent propositions are equal. Furthermore, proof irrelevance is derivable from propositional extensionality. Proof irrelevance asserts that two proofs of a same proposition are equal:
The types of the form “A→B” are called arrow types, where A and B are themselves types. Arrow types represent the function types: “A→B” is the type of a function that takes an object of type A as argument and returns an object of type B. Moreover, functional extensionality asserts that two functions that produce equal results on all arguments are equal. The property is similar to the property of function equality in set theory, but the function types are not set-theoretic notions like “subsets of cartesian products”.
3.2. Set Theory
The major content of set theory can be expressed through predicate due to the powerful expression ability of Coq. However, we develop a simple set theory based on type theory to get closer to traditional mathematical expression. For the sake of independence and readability, the concepts needed in this system are extracted to complete the formal description and give the mathematical identification. First, open the Section “Ensemble” and declare the local variable “U” of type “Type”, Furthermore, we define “set with element type U”, “belong to”, “non-empty set” in order and close the Section “Ensemble”. Finally, “belong to” is represented by the symbol of “∈” and “the set of elements satisfying the property P” is represented by “/{ x ∣ P /}”.
Partial definitions related to set theory and corresponding contents are as follows (union set, the union of the elements of set, subset, set equality):
In particular, set extensionality is derivable from propositional extensionality and the functional extensionality. Its formal description is as follows:
As is well known, “map” is essential and important concept in set theory; therefore, we give the definitions of injective, surjective, and bijective. Its formal description is as follows:
4. Real Number Theory System
In modern mathematics, a complete system of real number theory can be regarded as an ordered field with completeness theorems of real number. There is very little preparatory knowledge required in Landau’s “Foundations of Analysis” [
15]. Starting from the Peano axioms, natural numbers (positive integers), fractions (positive), and rational numbers/integers (positive) are defined in order. The positive real numbers (called “Cut” in this book) are defined by Dedekind cut, and furthermore, adding negative real numbers and 0 to construct all real numbers. Finally, defining complex numbers by real number pairs and then the whole number system theory is realized naturally. Overall, “Foundations of Analysis” defines real numbers through construction rather than a series of axioms, and introduces the Dedekind fundamental theorem instead of admitting it as an axiom. The formalization of this book is sufficient as the basis in most areas of analysis; furthermore, it is essential to add some notations such as finiteness, the sequence related to enriching the real number theory. We introduce the real number theory system below.
4.1. Foundations of Analysis
4.1.1. Natural Numbers, Fractions, Rational Numbers
Natural numbers are usually defined through Peano axioms, which can be formalized in Coq by variety of approaches. In Morse–Kelley axiomatic set theory [
47,
48], the Peano axioms can be deduced as theorems.On the other hand, the formalization of Peano axioms can be presented directly, and the details can be found in our previous conference paper [
42].
The Coq system uses a very expressive variation on typed -calculus, the Calculus of Inductive Constructions. A fundamental property of the Coq formalism is that computation always terminates. The requirement for termination can ensure the rationality of the defined recursive function. We can define natural number related recursive functions by “Fixpoint” with confidence. The natural numbers defined in this system are positive integers, which are slightly different from the natural numbers in the stand library starting from 0. Combining with “Inductive” to define the natural number set “Nat”, which implies Peano axioms. For readability, “1” means the One, and “x‘” means the successor of x. The formalizations of natural number set and its three initial properties are as follows:
The fraction consists of ordered pairs of natural numbers. Combined with the “Inductive” in the library to define the fractional set “Fra”, it has only one constructor “Over”. Then, “Over ” represents a fraction and are natural numbers. For convenience and readability, “Over ” is represented as “”. Formally, the definition is as follows:
If two fractions satisfy “”, then they are equivalent, expressed by “”. A rational number is a set of all equivalence classes of a certain fraction. First, the “Eqf f” represents a set of all fractions equivalent to fraction f. Next, the “Rat_p1 F” means that F is the equivalence class of a fraction. Finally, the “Record” command is used to define a rational number set because it describes its constructor more clearly. The first constructor in the definition of a rational number is a fraction set, and the second constructor is a restriction or description of properties for the first constructor, that is, the fraction set consists of all fractions equivalent to some fixed fraction. Formally, the definition is as follows:
4.1.2. Cuts, Real Numbers
Dedekind’s definition of real numbers is based on the division of rational number sets. Divide all rational numbers into left and right parts. If there is no maximum number on the left part and no minimum number on the right part, this division is defined as an irrational number; otherwise, it is called a rational number; After the definition of operation and order, it can be proved that these divisions form a complete order field–real number field.
Landau’s definition of Cuts(positive real numbers) refers to Dedekind cut. A rational number set M is a the cut (positive real number), if it satisfies these properties as follows:
- (1)
M is not empty and there exists rational numbers don’t belong to M;
- (2)
M contains all rational numbers smaller than any element in M;
- (3)
With every number it contains, the M also contains a greater one.
Every cut is a positive real number, and each positive real number corresponds to a negative real number. At the same time, in order to define a real number 0 that is different from the positive real number and the negative real number. Hence, the real number type has three constructors. “" represents a positive real number and is a cut, “" represents a negative real number and is a cut, and the capital letter “O" represents 0.
The operations of real number including addition, subtraction, and multiplication are the same as traditional definitions. We can still add the notations to real number operations, which automatically override the previous notations and invalidate the previous ones. Meanwhile, since the division is a partial function, the division of definition needs three input parameters: two real numbers and a proof that the second one is not 0. For example, “ l" represents “x divided by y" and “l" is a proof “". Here are the formalizations in Coq.
4.1.3. Dedekind’s Fundamental Theorem
Let there be given any division of all real numbers into two classes with the following properties:
I: There exists a number of the first class, and also one of the second class.
II: Every number of the first class is less than every number of the second class.
Then, there exists exactly one real number
such that each number smaller than
belongs to the first class and each number greater than
belongs to the second class [
15,
42].
These formal statements are as follows:
4.2. Some Extensions of the System
We define the exponentiating a real number by a natural number and its formalization is as follows:
Next, we present the definitions of the upper and lower bounds of real number set. Based on this, we define the maximum(minimum) of real number set. Moreover, we prove that any finite real number set must have a maximum (minimum).
Finally, we define the intervals and neighbors, denoted by readable symbols like “”, “”, avoiding confusion with notations in the library. The formal descriptions are as follows:
4.2.1. Finiteness
A set is finite if it has a finite number of elements. Let
be the set of positive natural numbers. Usually, a set
S is finite if there exists a bijection function between
and
S. Unlike it, in our system, a set
S is finite if there exists a surjective function from
to
S. Both definitions are correct, but the condition of the latter is weaker. The formal statement of surjective function (surjection) is in
Section 3.2.
We define the natural number set , where m is a natural number is a finite set. If a set S is finite, there exists natural number m and relation f so that f is a surjective function from to S. They can be easily translated in Coq:
By the definition above, we can prove some fundamental properties about finiteness:
The empty set is finite.
If set A and set B are finite, then the union set of A and B is finite.
If set A is finite, and any element in A is finite, then the union of the elements of A is finite.
If set A is finite and set B is the subset of A, then B is finite.
Here is the Coq formal statement of them:
4.2.2. Sequence
The real-valued sequence is defined as a function whose domain is a positive natural number set in this system. If not specified, the sequences mentioned in this article are all real-valued sequences. To avoid confusion, stands for a sequence, stands for a set consisting of all sequence elements, and stands for the value of the sequence at n. The formal statement of sequence’s type is as follows:
There are several notions of sequences such as boundedness, monotonicity, comparison, operations, and their corresponding contents can be clearly seen from formalizations below:
Next, if is a subsequence of , then there has a strictly increasing sequence of natural numbers such that . Its formal statement is as follows:
Moreover, the definition of limit of sequence is consistent with that in modern mathematical analysis (as follows):
The Coq formalization of it is as follows:
In addition, according to definition of limit of sequence, we can prove some properties we need to prove equivalence.
If converges to x and converges to y, then converges to .
If converges to x and converges to x, and there exists N such that for all , then converges to x.
If a sequence converges, then the value it converges to is unique.
The formalizations are as follows:
Furthermore, we construct three common sets or family. The first one consists of all sequence elements: . The second one consists of all sequence pairs: . The third one consists of all sets which consists of a sequence pair whose second coordinate is the element in sequence sets: . We can prove that the second set is equal to the union of the third family. Their formal statements are as follows:
Finally, we can prove that is an infinite set, implying that the natural numbers set is infinite. The formalization is as follows:
5. Basic Definitions and Properties
Before presenting the formalization of the equivalence among completeness theorems of real numbers, it is essential to discuss the basic definitions and properties related to the formalization. First of all, we give the definitions of the supremum and infimum.
Definition 1 (Supremum and Infimum)
. Supremum is the least upper bound for a real number set. Infimum is the greatest lower bound for a real number set.
The formalizations of these will be defined by the bound of set:
There are two direct corollaries from the definitions: If s is the supremum of S, then for each positive real number , there exists a x such that and . Similarly, if s is the infimum of S, then, for each positive real number , there exists an x such that and . The formalizations are as follows:
Next, we define the nested interval.
Definition 2 (Nested interval)
. A sequence of closed intervals is called a nested interval if it has the following properties: I: II:
The formalization of the nested interval can be obtained thorough sequence related notations.
There is a corollary from a nested interval: Let be a nested interval. There exists a unique such that , there exists an N when , Here is the Coq formal statement of them:
The compactness usually be used to describe the completeness in general topology, and its definition involves open cover. The related notions of open cover are as follows:
Definition 3 (Open cover, Finite sub-covering and Infinite cover)
. The family “H" composed of open intervals is an open cover for , if any number in belongs to a member of “H". If can be covered by a finite subset of “H", has a finite sub-covering; if not, only can be covered by infinite numbers of “H".
Since the element of an open set is an open interval, we define “RR” which consists of two real numbers and a condition . The “RRens_ooens” is used to convert a set whose elements type is “RR” into an open interval family. Based on this, we can complete the definitions of open cover, finite sub-covering, only infinite cover. They can be easily translated in Coq:
Furthermore, the accumulation point is another form of limit point, and there are usually two ways to define it.
Definition 4 (Accumulation point)
. “e” is a accumulation point of “E”, if any neighborhood of “e” contains the point that are not equal to “e” in “E”, or any neighborhood of “e” contains infinite points in “E”.
We define accumulation point in two ways, and prove the equivalence between the two definitions. Here are the Coq formal statements of them:
Cauchy sequence is commonly used in metric space, and its definition is as follows:
Definition 5 (Cauchy sequence)
. is a Cauchy sequence, if The Coq formalization of Cauchy sequence is as follows:
6. Formal Proof of the Equivalence
We present the formalization of the equivalence among completeness theorems of real numbers in this section. As shown in
Figure 1, we start from Dedekind fundamental theorem proved in a real number system, in order to prove the Supremum theorem, Monotone convergence theorem, Nested interval theorem, Finite cover theorem, Accumulation point theorem, Sequential compactness theorem, and Cauchy completeness theorem in turn. Finally, we prove the Dedekind fundamental theorem through the Cauchy completeness theorem, thereby we completed the equivalence among completeness theorems of real numbers in a circulating way.
6.1. Supremum Theorem and Infimum Theorem
Theorem 1. Every nonempty subset of real numbers having an upper(lower) bound must have a supremum(infimum) in a real number set.
The formalization of the theorem is expressed directly in Coq as follows:
Proof of Supremum theorem. Let a non-empty set of real numbers with an upper bound be R, and we discuss its situation separately:
case 1: When there is a maximum number M in R, any element in R is less than or equal to M, and then M is an upper bound of R. Meanwhile, M belongs to R so M is less than or equal to any upper bound of R. Thus, M is the supremum of M.
case 2: When there is no maximum number in R, let the real number set composed of all upper bounds of R be , and the set of remaining real numbers be S. Obviously, the union of S and is the whole set of real numbers. Moreover, S and are nonempty, and any element in S is less than any element in . According to the Dedekind fundamental theorem, there exists a unique real number E such that any element which is less than E belongs to S and any number which is greater than E belongs to . Thus, E is the upper bound of S. Since R is a subset of S, E is also the upper bound of R. E is less than or equal to any number in so that E is less than or equal to any upper bound of R. Hence, E is the supremum of R. □
Proof of Infimum theorem. Let a non-empty set of real numbers with a lower bound be R. We construct a set whose elements are the opposite numbers of the elements in R. Obviously, is a non-empty set of real numbers with an upper bound. Thus, has a supremum, say “", by the Supremum theorem. It is easy to see that “" is the infimum of R. □
6.2. Monotone Convergence Theorem
Theorem 2. Every monotonically increasing (decreasing) sequence having an upper(lower) bound converges to some limit.
The formalization of the theorem is expressed directly in Coq as follows:
Proof of Monotone convergence theorem for increasing sequence with upper bound (MCTup). Let be a monotonically increasing sequence that has an upper bound. Then, the has a least upper bound, say , by the Supremum theorem. From the corollary of the Supremum, for , there exists an N with . This implies that because is monotonically increasing. Since is the supremum of , it is not difficult to prove that for . We conclude that . Thus, converges to . □
Proof of Monotone convergence theorem for decreasing sequence with lower bound (MCTdown). Let be a monotonically decreasing sequence that has a lower bound. We construct a new sequence . Obviously, is a monotonically increasing sequence that has an upper bound. Thus, has a limit, say , by the MCTup. It is easy to see that converges to . □
6.3. Nested Interval Theorem
Theorem 3. If is a nested interval, then a unique must exist and The formalization of the theorem is expressed directly in Coq as follows:
Proof of Nested interval theorem. Let and be the two sequences that meet the conditions of the nested interval. Since any element in is smaller than anyone in , the has an upper bound. By the MCTup, there exists a satisfying that converges to . We can prove that converges to because converges to 0. Since is increasing, we can get that any element in is smaller than . Since is decreasing, we can get that any element in is greater than . On the other hand, the is unique because of uniqueness of limit. The proposition is proved. □
As shown in
Figure 2, the formal proof process is highly readable in Coq.
6.4. Finite Cover Theorem (Compactness)
Theorem 4. Every closed interval that can be covered by open intervals has a finite sub-covering.
The formalization of the theorem is expressed directly in Coq as follows:
Proof of Finite cover theorem. First of all, we can prove that, if the first half and second half of a closed interval have a finite sub-covering, then the closed interval has a finite sub-covering. Therefore, if a closed interval only has an infinite covering, then at least one from the first half and the second half only have an infinite covering.
Here are their Coq formal statements:
Let
H be composed of open intervals that can cover
. We hypothesize that
only has an infinite cover and let the
be
. One half of
must only have an infinite cover and let the half be
. One half of
must only have an infinite cover and let the half be
. Thus, continue forming two sequences with the following properties:
We construct these two sequences in Coq through the auxiliary sequence . Let be the midpoint of and , that is, to make it always the midpoint of infinite coverage. These formal statements are as follows:
From our construction, it is not difficult to prove some propositions as follows:
for any n only has an infinite covering.
is an increasing sequence
is a decreasing sequence
Any element in is less than or equal to one in
converges to 0
Here are the Coq formal statements of them:
We can prove that
is a nested interval by FL2, FL3, FL4 and FL5. From the Nested interval theorem, there exists a
for any natural number. Furthermore, there exists a
in
H with
because
and
H covers
. Let
. From the corollary of the nested interval, there exists an
N such that
We can conclude that
can be covered by
, which is an element in
H, contradicting the fact that
only has an infinite covering by FL1. Thus, there must be a finite subset of
H that can cover
. □
6.5. Accumulation Point Theorem
Theorem 5. Every bounded infinite set of real numbers has an accumulation point.
The formalization of the theorem is expressed directly in Coq as follows:
In this formal proof, we need to add an axiom “constructive_indefinite_description” to instantiate an existing variable. We show it clearly through axioms instead of importing the library. The formalizations of axiom and function for getting the existence variable are as follows:
Proof of Accumulation point theorem. Let
E be an infinite set of real numbers with the lower bound
x and the upper bound
y. Assume to the contrary that it is. Then, there is not an accumulation point in
E. We can prove that, for any real number
z, there exists a
such that
Obviously, the above neighborhood of all real numbers can cover , so does E. There exists finite open intervals that can cover (also E) by the Finite cover theorem. Since every open interval of those at most has one point in E, the E has finite elements, contradicting the fact that E is an infinite set of real numbers. Thus, there must exist an accumulation point in E. □
6.6. Sequential Compactness Theorem
Theorem 6. Every bounded sequence has a convergent subsequence.
The formalization of the theorem is expressed directly in Coq as follows:
Let be a sequence with the lower bound x and the upper bound y. We discuss whether is a finite set:
Proof of Sequential compactness theorem for finiteness. There must exist a real number r in such that the is infinite. If not, every element in is finite; then, we can prove that is finite by the Fin_EleUnion, contradicting the fact that is infinite according to the Infin_AllSeq. The formalization of this lemma is as follows:
Next, we can prove another lemma from the SL1: if is finite, then there exists an N such that for any natural number n there exists an m that is greater than n and . The formal description of this lemma is as follows:
Based on these above, we construct which consists of items with a value of in . Furthermore, it is easy to say that is the subsequence of and converges to . The formal description of the theorem for this case is as follows:
It should be noted that we do not need the condition that the is bounded in this case. □
Proof of Sequential compactness theorem for infiniteness. By the Accumulation point theorem, we can prove that has an accumulation point c. According to another equivalent definition of the accumulation point: condensation_point’, there are infinite numbers which belong to in any neighbor of c. Thus, we have a lemma whose formal description is as follows:
We can construct a sequence
such that
Since we can guarantee
by the lemma SL3, the
is the subsequence of
. Furthermore, we can prove that
It is not difficult to prove that the converges to c. The formalization of the theorem for this case is as follows:
Combining two cases, we can conclude that every bounded sequence has a convergent subsequence. □
6.7. Cauchy Completeness Theorem
Theorem 7. A sequence converges if and only if the sequence is a Cauchy sequence.
The formalization of the theorem is expressed directly in Coq as follows:
Proof of Cauchy completeness theorem for Necessity. Fix any positive real number
. If
converges to
, then there exists an
N such that
Due to the arbitrary nature of , is a Cauchy sequence. □
Proof of Cauchy completeness theorem for Sufficiency. If
is a Cauchy sequence, there exists an
such that
Furthermore, letting
m be the successor of
, we have
Since
is a finite set, there exists a maximum
because of the corollary FinMax. Let
, and it is clear to see that
M is the maximum in
. Since the
is bounded, there exists a convergent subsequence of
, says
, by the Sequential compactness theorem. Let
be the limit of this subsequence. Fix any positive real number
. There exists an
such that
Furthermore, since
converges to
, there exists an
such that
Let
. According to the definition of subsequence, for every
, there must be an
m such that
and
. We can conclude that
Due to the arbitrary nature of , converges to . □
6.8. Dedekind Fundamental Theorem
The description of the theorem and its formalization are as shown earlier in
Section 4.1.3.
Proof of Dedekind fundamental theorem. Let be the two sets which satisfy the condition of the Dedekind fundamental theorem. Since and are not empty, let x be in and y be in .
Let the
be
. The midpoint
w in
belongs to
or
. If it belongs to
, then
; otherwise, if it belongs to
, then
. The midpoint
z in
belongs to
or
. If it belongs to
, then
; otherwise, if it belongs to
, then
. Thus, continue forming two sequences with the following properties:
We construct these two sequences in Coq through the auxiliary sequence . Let be the midpoint of and and we construct it by position. These formal statements are as follows:
From our construction, it is not difficult to prove some propositions as follows:
Every element in belongs to .
Every element in belongs to .
is an increasing sequence.
is a decreasing sequence.
converges to 0.
Here are the Coq formal statements of them:
We claim that
is a Cauchy sequence. Fix any positive real number
. Since
converges to 0,
is a Cauchy sequence. There exists an
N such that
If
, it is easy to prove. When
, since
is an increasing sequence and
is a decreasing sequence, we have
so that:
This case is proved, and, when , the proposition can be proved in the same way. Thus, is a Cauchy sequence, and its formalizations are as follows:
From the Cauchy completeness theorem, there exists one
which
converges to. Since
converges to 0,
converges to
. We claim that
is the need. For
, there exists
N so that
. By the lemma IncreaseP, we have
such that
Then, z must belong to Fst. For
, there exists
N so that
. By the lemma DecreaseP, we have
such that
Then, z must belong to Snd. The proposition is proved. □
7. Conclusions and Future Work
The Coq language is extremely powerful and expressive both for reasoning and programming. There are several levels of competence from performing simple proofs to studying complex algorithms [
16].
The completeness theorems of real number are significant properties in real analysis, and it has a wide range of applications. In this paper, we formalize the completeness theorems of real number, including Dedekind fundamental theorem, Supremum theorem, Monotone convergence theorem, Nested interval theorem, Finite cover theorem, Accumulation point theorem, Sequential compactness theorem, and Cauchy completeness theorem. We prove the equivalence among them, and the proof is based on the real number formal system that we developed. In this formalization, all of the proof details have been verified by proof assistant Coq. The Coq files corresponding to the formal proof are available at:
https://github.com/coderfys/Analysis/tree/main/completeness.
In the future, we will give the more formalizations of the equivalence of completeness theorems. For example, the intermediate value theorem can derive the completeness theorems and vice versa (this is not circular since the definition of continuity does not depend on any form of completeness). We will use the intermediate value theorem to prove another completeness theorem whose proof is rarely seen. In addition, we plan to formalize calculus, real analysis, and complex analysis. Furthermore, we will formally prove the important theorems such as fundamental theorem of calculus and Taylor theorem based on “Foundations of Analysis” formal system.