On density of the image of Q in an arbitrary real number structure
In this file we introduce the image of the concrete rational numbers (as defined earlier) in an arbitrary structure of type CReals. At the end of this file we assign to any real number two rational numbers for which the real number lies betwen image of them; in other words we will prove that the image of rational numbers in dense in any real number structure.
Let R1 be a real number structure.
Injection from Q to an arbitrary real number structure
First we need to define the injection from Q to R1. Note that in Cauchy_CReals we defined inject_Q from an arbitray field F to (R_COrdField F) which was the set of Cauchy sequences of that field. But since R1 is an arbitrary real number structure we can not use inject_Q.To define the injection we need one elemntary lemma about the denominator:
And we define the injection in the natural way, using zring and nring. We call this inj_Q, in contrast with inject_Q defined in Cauchy_CReals.
Next we need some properties of nring, on the setoid of natural numbers:
Lemma nring_strext : forall m n : nat_as_CMonoid,
(nring (R:=R1) m [#] nring (R:=R1) n) -> m [#] n.
Lemma nring_wd : forall m n : nat_as_CMonoid,
(m [=] n) -> nring (R:=R1) m [=] nring (R:=R1) n.
Lemma nring_eq : forall m n : N, m = n -> nring (R:=R1) m [=] nring (R:=R1) n.
Lemma nring_leEq : forall (OF : COrdField) m n,
m <= n -> nring (R:=OF) m [<=] nring (R:=OF) n.
Similarly we prove some properties of zring on the ring of integers:
Lemma zring_strext : forall m n : Z_as_CRing,
(zring (R:=R1) m [#] zring n) -> m [#] n.
Lemma zring_wd : forall m n : Z_as_CRing,
(m [=] n) -> zring (R:=R1) m [=] zring (R:=R1) n.
Lemma zring_less : forall m n : Z_as_CRing,
(m < n)%Z -> zring (R:=R1) m [<] zring (R:=R1) n.
Using the above lemmata we prove the basic properties of inj_Q, i.e. it is a setoid function and preserves the ring operations and oreder operation.
Lemma inj_Q_strext : forall q1 q2, (inj_Q q1 [#] inj_Q q2) -> q1 [#] q2.
Lemma inj_Q_wd : forall q1 q2, (q1 [=] q2) -> inj_Q q1 [=] inj_Q q2.
Lemma inj_Q_plus : forall q1 q2, inj_Q (q1[+]q2) [=] inj_Q q1[+]inj_Q q2.
Lemma inj_Q_mult : forall q1 q2, inj_Q (q1[*]q2) [=] inj_Q q1[*]inj_Q q2.
Lemma inj_Q_less : forall q1 q2, (q1 [<] q2) -> inj_Q q1 [<] inj_Q q2.
Lemma less_inj_Q : forall q1 q2, (inj_Q q1 [<] inj_Q q2) -> q1 [<] q2.
Lemma inj_Q_ap : forall q1 q2, (q1 [#] q2) -> inj_Q q1 [#] inj_Q q2.
Lemma leEq_inj_Q : forall q1 q2, (inj_Q q1 [<=] inj_Q q2) -> q1 [<=] q2.
Lemma inj_Q_leEq : forall q1 q2, (q1 [<=] q2) -> inj_Q q1 [<=] inj_Q q2.
Lemma inj_Q_inv : forall q1, inj_Q [--]q1 [=] [--](inj_Q q1).
Lemma inj_Q_minus : forall q1 q2, inj_Q (q1[-]q2) [=] inj_Q q1[-]inj_Q q2.
Lemma inj_Q_div : forall q1 q2 H, inj_Q (q1/q2)%Q [=] (inj_Q q1[/]inj_Q q2[//]H).
Moreover, and as expected, the AbsSmall predicate is also
preserved under the inj_Q
Lemma inj_Q_AbsSmall : forall q1 q2,
AbsSmall q1 q2 -> AbsSmall (inj_Q q1) (inj_Q q2).
Lemma AbsSmall_inj_Q : forall q e,
AbsSmall (inj_Q e) (inj_Q q) -> AbsSmall e q.
Injection preserves Cauchy property
We apply the above lemmata to obtain following theorem, which says that a Cauchy sequence of elemnts of Q will be Cauchy in R1.
Furthermore we prove that applying nring (which is adding the
ring unit n times) is the same whether we do it in Q or in R1:
Lemma inj_Q_nring : forall n, inj_Q (nring n) [=] nring (R:=R1) n.
Lemma inj_Q_pring : forall n, inj_Q (pring _ n) [=] pring R1 n.
Lemma inj_Q_zring : forall n, inj_Q (zring n) [=] zring (R:=R1) n.
Lemma inj_Q_One : inj_Q 1 [=] 1.
Lemma inj_Q_Zero : inj_Q 0 [=] 0.
Definition inj_Q_hom : RingHom Q_as_CRing R1.
Defined.
Lemma inj_Q_power : forall q1 (n:nat), inj_Q (q1^n)%Q [=] (inj_Q q1[^]n).
Lemma inj_Q_power_Z : forall q1 (n:Z) H, inj_Q (q1^n)%Q [=] ((inj_Q q1)[//]H)[^^]n.
Injection of Q is dense
Finally we are able to prove the density of image of Q in R1. We state this fact in two different ways. Both of them have their specific use.The first theorem states the fact that any real number can be bound by the image of two rational numbers. This is called start_of_sequence because it can be used as an starting point for the typical "interval trisection" argument, which is ubiquitous in constructive analysis.
Theorem start_of_sequence : forall x : R1,
{q1 : Q_as_COrdField | {q2 : Q_as_COrdField | inj_Q q1 [<] x | x [<] inj_Q q2}}.
The second version of the density of Q in R1 states that given
any positive real number, there is a rational number between it and
zero. This lemma can be used to prove the more general fact that there
is a rational number between any two real numbers.
Lemma Q_dense_in_CReals : forall e : R1,
0 [<] e -> {q : Q_as_COrdField | 0 [<] inj_Q q | inj_Q q [<] e}.
Lemma Q_dense_in_CReals' : forall a b : R1,
a [<] b -> {q : Q_as_COrdField | a [<] inj_Q q | inj_Q q [<] b}.
End Rational_sequence_prelogue.