diff options
author | Guillaume Melquiond <guillaume.melquiond@inria.fr> | 2017-03-05 21:50:19 +0100 |
---|---|---|
committer | Maxime Dénès <mail@maximedenes.fr> | 2017-03-22 17:56:02 +0100 |
commit | 4e6fa17a3ef0b8d12cb8d55305f302338589ad1c (patch) | |
tree | b6ed89f849f9423c9a2b3bee42bd8b9f5b176305 | |
parent | d6ced637d9b7acabef2ccc9e761ec149bc7c93da (diff) |
Make IZR a morphism for field.
There are now two field structures for R: one in RealField and one in
RIneq. The first one is used to prove that IZR is a morphism which is
needed to define the second one.
-rw-r--r-- | theories/Reals/RIneq.v | 25 | ||||
-rw-r--r-- | theories/Reals/Ratan.v | 4 | ||||
-rw-r--r-- | theories/Reals/Rtrigo1.v | 3 |
3 files changed, 28 insertions, 4 deletions
diff --git a/theories/Reals/RIneq.v b/theories/Reals/RIneq.v index 7cd4c00c7..dd2108159 100644 --- a/theories/Reals/RIneq.v +++ b/theories/Reals/RIneq.v @@ -2016,6 +2016,31 @@ Proof. [ apply not_0_INR; discriminate | unfold INR; ring ]. Qed. +Lemma R_rm : ring_morph + R0 R1 Rplus Rmult Rminus Ropp eq + 0%Z 1%Z Zplus Zmult Zminus Zopp Zeq_bool IZR. +Proof. +constructor ; try easy. +exact plus_IZR. +exact minus_IZR. +exact mult_IZR. +exact opp_IZR. +intros x y H. +apply f_equal. +now apply Zeq_bool_eq. +Qed. + +Lemma Zeq_bool_IZR x y : + IZR x = IZR y -> Zeq_bool x y = true. +Proof. +intros H. +apply Zeq_is_eq_bool. +now apply eq_IZR. +Qed. + +Add Field RField : Rfield + (completeness Zeq_bool_IZR, morphism R_rm, constants [IZR_tac], power_tac R_power_theory [Rpow_tac]). + (*********************************************************) (** ** Other rules about < and <= *) (*********************************************************) diff --git a/theories/Reals/Ratan.v b/theories/Reals/Ratan.v index 3e5362efe..e438750df 100644 --- a/theories/Reals/Ratan.v +++ b/theories/Reals/Ratan.v @@ -319,10 +319,10 @@ apply PI2_lower_bound;[split; fourier | ]. destruct (pre_cos_bound (3/2) 1) as [t _]; [fourier | fourier | ]. apply Rlt_le_trans with (2 := t); clear t. unfold cos_approx; simpl; unfold cos_term. -unfold INR. +rewrite !INR_IZR_INZ. simpl. field_simplify. -change (0 */ 1 < 9925632 / 141557760). +unfold Rdiv. rewrite Rmult_0_l. apply Rdiv_lt_0_compat ; now apply IZR_lt. Qed. diff --git a/theories/Reals/Rtrigo1.v b/theories/Reals/Rtrigo1.v index 48dbd1944..17b9677ef 100644 --- a/theories/Reals/Rtrigo1.v +++ b/theories/Reals/Rtrigo1.v @@ -186,7 +186,6 @@ simpl sum_f_R0. unfold cos_term, sin_term; simpl fact; rewrite !INR_IZR_INZ. simpl plus; simpl mult; simpl Z_of_nat. field_simplify. -change (8073344 / 12582912 < 18760 / 24576). match goal with |- IZR ?a / ?b < ?c / ?d => apply Rmult_lt_reg_r with d;[apply (IZR_lt 0); reflexivity | @@ -196,7 +195,7 @@ match goal with end. unfold Rdiv; rewrite !Rmult_assoc, Rinv_l, Rmult_1_r; [ | apply not_eq_sym, Rlt_not_eq, (IZR_lt 0); reflexivity]. -repeat (rewrite <- !plus_IZR || rewrite <- !mult_IZR). +rewrite <- !mult_IZR. apply IZR_lt; reflexivity. Qed. |