| 1 |
(* |
| 2 |
Copyright © 2006-2008 Russell O’Connor |
| 3 |
|
| 4 |
Permission is hereby granted, free of charge, to any person obtaining a copy of |
| 5 |
this proof and associated documentation files (the "Proof"), to deal in |
| 6 |
the Proof without restriction, including without limitation the rights to |
| 7 |
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of |
| 8 |
the Proof, and to permit persons to whom the Proof is furnished to do so, |
| 9 |
subject to the following conditions: |
| 10 |
|
| 11 |
The above copyright notice and this permission notice shall be included in all |
| 12 |
copies or substantial portions of the Proof. |
| 13 |
|
| 14 |
THE PROOF IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 15 |
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
| 16 |
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| 17 |
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| 18 |
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| 19 |
CONNECTION WITH THE PROOF OR THE USE OR OTHER DEALINGS IN THE PROOF. |
| 20 |
*) |
| 21 |
|
| 22 |
Require Import CoRN.algebra.RSetoid. |
| 23 |
Require Import CoRN.metric2.Metric. |
| 24 |
Require Import CoRN.metric2.UniformContinuity. |
| 25 |
Require Import CoRN.model.totalorder.QposMinMax. |
| 26 |
From Coq Require Import Ring_theory. |
| 27 |
From Coq Require Import Setoid. |
| 28 |
From Coq Require Import QArith. |
| 29 |
From Coq Require Import Qabs. |
| 30 |
From Coq Require Import Qround. |
| 31 |
Require Export CoRN.model.reals.CRreal. |
| 32 |
Require Import CoRN.metric2.Complete. |
| 33 |
Require Export CoRN.reals.fast.CRFieldOps. |
| 34 |
Require Import CoRN.model.rings.Qring. |
| 35 |
Require Import CoRN.algebra.CRing_Homomorphisms. |
| 36 |
Require Import CoRN.model.metric2.Qmetric. |
| 37 |
Require Import CoRN.tactics.CornTac. |
| 38 |
Require Import CoRN.logic.Stability. |
| 39 |
From Coq Require Import ConstructiveEpsilon. |
| 40 |
Require Import CoRN.util.Qdlog. |
| 41 |
Require Import MathClasses.interfaces.abstract_algebra. |
| 42 |
Require Import MathClasses.interfaces.orders. |
| 43 |
Require Import CRArith. |
| 44 |
|
| 45 |
Local Open Scope CR_scope. |
| 46 |
|
| 47 |
|
| 48 |
Lemma inject_Q_product (l: list Q) |
| 49 |
: (' cr_Product l) == @cr_Product CRasCRing (map inject_Q_CR l). |
| 50 |
Proof. |
| 51 |
induction l. |
| 52 |
reflexivity. |
| 53 |
change (' (a * cr_Product l)%Q == @cr_Product CRasCRing (map inject_Q_CR (a :: l))). |
| 54 |
rewrite <- CRmult_Qmult. |
| 55 |
rewrite IHl. |
| 56 |
reflexivity. |
| 57 |
Qed. |
| 58 |
|
| 59 |
Lemma inject_Qred_ap (x y: Q): Qred x <> Qred y -> ' x >< ' y. |
| 60 |
Proof with auto. |
| 61 |
intro. |
| 62 |
apply Qap_CRap. |
| 63 |
intro. |
| 64 |
apply H. |
| 65 |
apply Qred_complete... |
| 66 |
Qed. |
| 67 |
|
| 68 |
Lemma inject_Q_strext : @fun_strext _ CRasCSetoid inject_Q_CR. |
| 69 |
Proof. |
| 70 |
intros x y [Hxy|Hxy]. |
| 71 |
apply: Qlt_not_eq. |
| 72 |
apply Qnot_le_lt. |
| 73 |
intros H. |
| 74 |
absurd ('y <= 'x). |
| 75 |
rewrite -> leEq_def. |
| 76 |
auto with *. |
| 77 |
rewrite -> CRle_Qle. |
| 78 |
auto. |
| 79 |
apply ap_symmetric. |
| 80 |
apply: Qlt_not_eq. |
| 81 |
apply Qnot_le_lt. |
| 82 |
intros H. |
| 83 |
absurd ('x <= 'y). |
| 84 |
rewrite -> leEq_def. |
| 85 |
auto with *. |
| 86 |
rewrite -> CRle_Qle. |
| 87 |
auto. |
| 88 |
Qed. |
| 89 |
|
| 90 |
Definition inject_Q_csf := Build_CSetoid_fun _ _ _ inject_Q_strext. |
| 91 |
|
| 92 |
Lemma inject_Q_hom : RingHom Q_as_CRing CRasCRing. |
| 93 |
Proof. |
| 94 |
exists (inject_Q_csf). |
| 95 |
apply: CRplus_Qplus. |
| 96 |
intros x y. |
| 97 |
apply eq_symmetric. |
| 98 |
apply CRmult_Qmult. |
| 99 |
apply eq_reflexive. |
| 100 |
Defined. |
| 101 |
|