Formalization of the Equivalence among Completeness Theorems of Real Number in Coq

: The formalization of mathematics based on theorem prover becomes increasingly important in mathematics and computer science, and, particularly, formalizing fundamental mathematical theories becomes especially essential. In this paper, we describe the formalization in Coq of eight very representative completeness theorems of real numbers. These theorems include the 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 formalize the real number theory strictly following Landau’s Foundations of Analysis where the Dedekind fundamental theorem can be proved. We extend this system and complete the related notions and properties for ﬁniteness and sequence. We prove these theorems in turn from Dedekind fundamental theorem, and ﬁnally prove the Dedekind fundamental theorem by the Cauchy completeness theorem. The full details of formal proof are checked by the proof assistant Coq, which embodies the characteristics of reliability and interactivity. This work can lay the foundation for many applications, especially in calculus and topology.


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 " − δ, − N".
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 machinechecked 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.

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.

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 "λ t, . . ." represent anonymous function in Coq "fun t => . . .".

Logic
There are three useful logical axioms: strong excluded middle, propositional extensionality, and functional extensionality. Their formal descriptions are as follows:

| left : A -> {A} + {B} | right : A -> {A} + {B}
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: Proposition classic : ∀ P, P \/ ∼P.
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: Proposition proof_irr : ∀ {P :Prop} (p q :P), p = q.
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".

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): Section EnsembleBasic. Set Implicit Arguments.

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.

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: Inductive Nat : Type := | One | Successor : Nat -> Nat. Notation "1" := One. Notation " x' " := (Successor x)(at level 0).
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 x y" represents a fraction and x, y are natural numbers. For convenience and readability, "Over x y" is represented as "x/y". Formally, the definition is as follows: Inductive Fra : Type := Over : Nat -> Nat -> Fra. Notation " x / y " := (Over x y).
If two fractions x 1 /x 2 , y 1 /y 2 satisfy "x 1 y 2 = y 1 x 2 ", then they are equivalent, expressed by "x 1 /x 2 ∼ y 1 /y 2 ". 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:

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. "P ξ" represents a positive real number and ξ is a cut, "N η" 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, "(x/y) l" represents "x divided by y" and "l" is a proof "y <> 0". Here are the formalizations in Coq.

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: The proof details of this theorem and complex number part will not be detailed here. We have completed the Coq formalization, and the complete source is available online: https://github.com/coderfys/Analysis/tree/main/Foundations_of_Analysis/

Some Extensions of the System
We define the exponentiating a real number by a natural number and its formalization is as follows: Fixpoint Pow x n := match n with | 1 => x | m' => (Pow x m) · x end. Notation "x^n" := (Pow x n).
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).

Finiteness
A set is finite if it has a finite number of elements. Let N + be the set of positive natural numbers. Usually, a set S is finite if there exists a bijection function between {1, . . . , n : n ∈ N + } and S. Unlike it, in our system, a set S is finite if there exists a surjective function from {1, . . . , n : n ∈ N + } 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 {n|n < m}, 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 {n|n < m} 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. II. If set A and set B are finite, then the union set of A and B is finite. III. If set A is finite, and any element in A is finite, then the union of the elements of A is finite. IV. 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:

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, (a n ) stands for a sequence, {a n } stands for a set consisting of all sequence elements, and a n stands for the value of the sequence at n. The formal statement of sequence's type is as follows: Definition Seq := Nat -> Real.
Next, if (b n ) is a subsequence of (a n ), then there has a strictly increasing sequence of natural numbers (n k ) k∈N + such that (b n ) = (a n k ). Its formal statement is as follows: Moreover, the definition of limit of sequence is consistent with that in modern mathematical analysis (as follows): lim n→∞ a n = A ⇔ ∀ε > 0, ∃N, ∀n > N ⇒ |a n − A| < ε.
In addition, according to definition of limit of sequence, we can prove some properties we need to prove equivalence.

I.
If (a n ) converges to x and (b n ) converges to y, then (a n + b n ) converges to x + y. II. If (a n ) converges to x and (c n ) converges to x, and there exists N such that a n ≤ b n ≤ c n for all n > N, then (c n ) converges to x. III. If a sequence converges, then the value it converges to is unique. IV. lim n→∞ x 2 n = 0, x ∈ R The formalizations are as follows: Furthermore, we construct three common sets or family. The first one consists of all sequence elements: {a n : n ∈ N + }. The second one consists of all sequence pairs: {(n, a n ) : n ∈ N + }. The third one consists of all sets which consists of a sequence pair whose second coordinate is the element in sequence sets: {{(n, a n )|a n = r} : r ∈ {a n }}. We can prove that the second set is equal to the union of the third family. Their formal statements are as follows: Definition SeqEns (a :Seq) := /{ r | ∃ n, r = a n /}. Definition AllSeq (a :Seq) := /{ z | ∃ n , z = (n, (a n)) /}. Definition SeqFam (a :Seq) := /{ z | ∃ r, r ∈ (SeqEns a) /\ z = /{ z1 | z1 ∈ (AllSeq a) /\ snd z1 = r /} /}. Corollary AllSeq_P : ∀ a, AllSeq a = (SeqFam a).
Finally, we can prove that {(n, a n ) : n ∈ N + } is an infinite set, implying that the natural numbers set is infinite. The formalization is as follows: Corollary Infin_AllSeq : ∀ a, ∼ fin (AllSeq a).

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: Definition supremum y A := Boundup_Ens y A /\ ∀ z, Boundup_Ens z A -> y ≤ z. Definition infimum y A := Bounddown_Ens y A /\ ∀ z, Bounddown_Ens z A -> z ≤ y.
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 x ∈ S and (s − ε) < x. Similarly, if s is the infimum of S, then, for each positive real number ε, there exists an x such that x ∈ S and x < (s + ε). The formalizations are as follows: Corollary Cor_infimum : Next, we define the nested interval. There is a corollary from a nested interval: Let ([a n , b n ]) be a nested interval. There exists a unique ξ ∈ [a n , b n ](n = 1, 2 . . .) such that ∀ε > 0, there exists an N when ∀n > N, [a n , b n | ⊂ µ (ξ). Here is the Coq formal statement of them: Since the element of an open set is an open interval, we define "RR" which consists of two real numbers r 1 , r 2 and a condition r 1 < r 2 . 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".

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. The formalization of the theorem is expressed directly in Coq as follows: Theorem SupremumT : ∀ R, No_Empty R -> ∃ x, Boundup_Ens x R -> ∃ y, supremum y R.
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 S , and the set of remaining real numbers be S. Obviously, the union of S and S is the whole set of real numbers. Moreover, S and S are nonempty, and any element in S is less than any element in S . 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 S . 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 S 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 R whose elements are the opposite numbers of the elements in R. Obviously, R is a non-empty set of real numbers with an upper bound. Thus, R has a supremum, say "sup", by the Supremum theorem. It is easy to see that "− sup" is the infimum of R.

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:
Theorem MCTup : ∀ a, Increase a -> Boundup_Seq a -> ∃ ξ, Limit a ξ.

Proof of Monotone convergence theorem for increasing sequence with upper bound (MCTup) .
Let (a n ) be a monotonically increasing sequence that has an upper bound. Then, the {a n } has a least upper bound, say ξ, by the Supremum theorem. From the corollary of the Supremum, for ∀ε > 0, there exists an N with ξ − ε < a N . This implies that ∀n, n > N ⇒ ξ − ε < a n because (a n ) is monotonically increasing. Since ξ is the supremum of (a n ), it is not difficult to prove that ∀n, a n < ξ + ε for ∀ε > 0. We conclude that ∀ε > 0, ∀n > N ⇒ |a n − ξ| < ε. Thus, (a n ) converges to ξ.

Proof of Monotone convergence theorem for decreasing sequence with lower bound (MCTdown) .
Let (a n ) be a monotonically decreasing sequence that has a lower bound. We construct a new sequence (−a n ). Obviously, (−a n ) is a monotonically increasing sequence that has an upper bound. Thus, (−a n ) has a limit, say ξ, by the MCTup. It is easy to see that (a n ) converges to −ξ.

Nested Interval Theorem
Theorem 3. If ([a n , b n ]) is a nested interval, then a unique ξ ∈ [a n , b n ] must exist and lim n→∞ a n = lim The formalization of the theorem is expressed directly in Coq as follows: Theorem NITex : ∀ a b, NestedIntervals a b -> ∃ ξ, (∀ n, a n ≤ ξ /\ ξ ≤ b n) /\ Limit a ξ /\ Limit b ξ.
Proof of Nested interval theorem. Let (a n ) and (b n ) be the two sequences that meet the conditions of the nested interval. Since any element in {a n } is smaller than anyone in {b n }, the (a n ) has an upper bound. By the MCTup, there exists a ξ satisfying (a n ) that converges to ζ. We can prove that (b n ) converges to ζ because (b n − a n ) converges to 0. Since (a n ) is increasing, we can get that any element in {a n } is smaller than ξ. Since (b n ) is decreasing, we can get that any element in {b n } 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. The formalization of the theorem is expressed directly in Coq as follows: Theorem FinCoverT : ∀ x y cH, OpenCover x y cH -> FinCover x y cH.

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: Corollary CoverP1 : ∀ x y cH, FinCover x (mid x y) cH -> FinCover (mid x y) y cH -> FinCover x y cH. [a n+1 , b n+1 ] ⊂ [a n , b n ](n = 1, 2, 3 . . .), lim n→∞ (b n − a n ) = lim n→∞ y − x 2 n−1 = 0 We construct these two sequences in Coq through the auxiliary sequence (c n ). Let c n be the midpoint of a n and b n , that is, to make it always the midpoint of infinite coverage. These formal statements are as follows: We can prove that ([a n , b n ]) is a nested interval by FL2, FL3, FL4 and FL5. From the Nested interval theorem, there exists a ξ ∈ [a n , b n ] for any natural number. Furthermore, there exists a (α, β) in H with ξ ∈ (α, β) because ξ ∈ [x, y] and H covers [x, y]. Let ε = min{ξ − α, β − ξ}. From the corollary of the nested interval, there exists an N such that ∀n, n > N [a n , b n ] ⊂ U ε (ξ) ⇒ [a n , b n ] ⊂ (α, β) We can conclude that [a n , b n ] can be covered by (α, β), which is an element in H, contradicting the fact that [a n , b n ] only has an infinite covering by FL1. Thus, there must be a finite subset of H that can cover [x, y].

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: Theorem APT : ∀ E x y, x < y -> ∼ fin E -> Bounddown_Ens x E -> Boundup_Ens y E -> ∃ e, AccumulationPoint e E.
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 δ > 0 such that 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.
Let (a n ) be a sequence with the lower bound x and the upper bound y. We discuss whether {a n } is a finite set: Proof of Sequential compactness theorem for finiteness. There must exist a real number r in {a n } such that the {m|a m = r} is infinite. If not, every element in {{(n, a n )|a n = r} : r ∈ {a n }} is finite; then, we can prove that {(m, a m )|m ∈ N + } is finite by the Fin_EleUnion, contradicting the fact that {(m, a m )|m ∈ N + } is infinite according to the Infin_AllSeq. The formalization of this lemma is as follows: Lemma SL1: ∀ a, fin (Seq_En1 a) -> ∃ r, r ∈ (Seq_En1 a) /\ ∼ fin /{ z | z ∈ (AllSeq a) /\ (snd z) = r /}.
Next, we can prove another lemma from the SL1: if {a n } is finite, then there exists an N such that for any natural number n there exists an m that is greater than n and a m = a N . The formal description of this lemma is as follows: Lemma SL2 : ∀ a, fin (Seq_En1 a) -> ∃ N, ∀ n, (∃ m, IGT_N m n /\ a m = a N).
Based on these above, we construct (b n ) which consists of items with a value of a N in (a n ). Furthermore, it is easy to say that (b n ) is the subsequence of (a n ) and converges to a N . 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 (a n ) is bounded in this case.
Proof of Sequential compactness theorem for infiniteness. By the Accumulation point theorem, we can prove that {a n } has an accumulation point c. According to another equivalent definition of the accumulation point: condensation_point', there are infinite numbers which belong to {a n } in any neighbor of c. Thus, we have a lemma whose formal description is as follows: We can construct a sequence (b m ) such that Since we can guarantee ∀m, n m < n m+1 by the lemma SL3, the (b m ) is the subsequence of {a n }. Furthermore, we can prove that It is not difficult to prove that the (b m ) 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.

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: Theorem CCT : ∀ a, (∃ ξ, Limit a ξ) <-> CauchySeq a.
Proof of Cauchy completeness theorem for Necessity. Fix any positive real number ε. If (a n ) converges to ξ, then there exists an N such that Due to the arbitrary nature of ε, (a n ) is a Cauchy sequence.
Proof of Cauchy completeness theorem for Sufficiency. If (a n ) is a Cauchy sequence, there exists an N 1 such that ∀n, m > N 1 → |a n − a m | < 1 Furthermore, letting m be the successor of N 1 , we have ∀n > m → |a n | < |a m | + 1.
Since {a n |n ≤ m} is a finite set, there exists a maximum M 1 because of the corollary FinMax. Let M = max{M 1 , |a m | + 1}, and it is clear to see that M is the maximum in {a n }. Since the {a n } is bounded, there exists a convergent subsequence of (a n ), says (b n ), by the From our construction, it is not difficult to prove some propositions as follows: I.
Every element in {a n } belongs to Fst. II. Every element in {b n } belongs to Snd. III. (a n ) is an increasing sequence. IV. (b n ) is a decreasing sequence. V.
(b n − a n ) converges to 0.
Here are the Coq formal statements of them: We claim that (a n ) is a Cauchy sequence. Fix any positive real number ε. Since (b n − a n ) converges to 0, (b n − a n ) is a Cauchy sequence. There exists an N such that ∀n, m > N → |(b m − a m ) − (b n − a n )| < ε ↓ ∀n, m > N → |(b m − b n ) − (a m − a n )| < ε If m = n, it is easy to prove. When m < n, since a n is an increasing sequence and b n is a decreasing sequence, we have a m ≤ a n , b n ≤ b m so that: |a m − a n | ≤ |(b m − b n ) − (a m − a n )| < ε This case is proved, and, when m < n, the proposition can be proved in the same way. Thus, (a n ) is a Cauchy sequence, and its formalizations are as follows: Lemma DL6 : CauchySeq Coda.
From the Cauchy completeness theorem, there exists one ξ which (a n ) converges to. Since (b n − a n ) converges to 0, (b n ) converges to ξ. We claim that ξ is the need. For ∀z < ξ, there exists N so that |a N − ξ| < ξ − z. By the lemma IncreaseP, we have a N ≤ ξ such that ξ − a N < ξ − z → z < a N Then, z must belong to Fst. For ∀z > ξ, there exists N so that |b N − ξ| < z − ξ. By the lemma DecreaseP, we have ξ ≤ b N such that Then, z must belong to Snd. The proposition is proved.

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.