2
Require Import ArithRing.
3
Require Export Ring Field.
4
Require Import Rdefinitions.
5
Require Import Rpow_def.
6
Require Import Raxioms.
8
Open Local Scope R_scope.
10
Lemma RTheory : ring_theory 0 1 Rplus Rmult Rminus Ropp (eq (A:=R)).
13
intro; apply Rplus_0_l.
15
symmetry in |- *; apply Rplus_assoc.
16
intro; apply Rmult_1_l.
18
symmetry in |- *; apply Rmult_assoc.
20
rewrite Rmult_comm in |- *.
21
rewrite (Rmult_comm n p) in |- *.
22
rewrite (Rmult_comm m p) in |- *.
23
apply Rmult_plus_distr_l.
28
Lemma Rfield : field_theory 0 1 Rplus Rmult Rminus Ropp Rdiv Rinv (eq(A:=R)).
37
Lemma Rlt_n_Sn : forall x, x < x + 1.
40
elim archimed with x; intros.
42
apply Rlt_trans with (IZR (up x)); trivial.
43
replace (IZR (up x)) with (x + (IZR (up x) - x))%R.
44
apply Rplus_lt_compat_l; trivial.
45
unfold Rminus in |- *.
46
rewrite (Rplus_comm (IZR (up x)) (- x)) in |- *.
47
rewrite <- Rplus_assoc in |- *.
48
rewrite Rplus_opp_r in |- *.
51
unfold Rminus in |- *.
52
rewrite (Rplus_comm (IZR (up x)) (- x)) in |- *.
53
rewrite <- Rplus_assoc in |- *.
54
rewrite Rplus_opp_r in |- *.
55
rewrite Rplus_0_l in |- *; trivial.
58
Notation Rset := (Eqsth R).
59
Notation Rext := (Eq_ext Rplus Rmult Ropp).
61
Lemma Rlt_0_2 : 0 < 2.
62
apply Rlt_trans with (0 + 1).
64
rewrite Rplus_comm in |- *.
65
apply Rplus_lt_compat_l.
66
replace 1 with (0 + 1).
71
Lemma Rgen_phiPOS : forall x, InitialRing.gen_phiPOS1 1 Rplus Rmult x > 0.
73
induction x; simpl in |- *; intros.
74
apply Rlt_trans with (1 + 0).
75
rewrite Rplus_comm in |- *.
77
apply Rplus_lt_compat_l.
78
rewrite <- (Rmul_0_l Rset Rext RTheory 2) in |- *.
79
rewrite Rmult_comm in |- *.
80
apply Rmult_lt_compat_l.
83
rewrite <- (Rmul_0_l Rset Rext RTheory 2) in |- *.
84
rewrite Rmult_comm in |- *.
85
apply Rmult_lt_compat_l.
88
replace 1 with (0 + 1).
94
Lemma Rgen_phiPOS_not_0 :
95
forall x, InitialRing.gen_phiPOS1 1 Rplus Rmult x <> 0.
97
specialize (Rgen_phiPOS x).
98
rewrite H in |- *; intro.
99
apply (Rlt_asym 0 0); trivial.
102
Lemma Zeq_bool_complete : forall x y,
103
InitialRing.gen_phiZ 0%R 1%R Rplus Rmult Ropp x =
104
InitialRing.gen_phiZ 0%R 1%R Rplus Rmult Ropp y ->
106
Proof gen_phiZ_complete Rset Rext Rfield Rgen_phiPOS_not_0.
108
Lemma Rdef_pow_add : forall (x:R) (n m:nat), pow x (n + m) = pow x n * pow x m.
110
intros x n; elim n; simpl in |- *; auto with real.
111
intros n0 H' m; rewrite H'; auto with real.
114
Lemma R_power_theory : power_theory 1%R Rmult (eq (A:=R)) nat_of_N pow.
116
constructor. destruct n. reflexivity.
117
simpl. induction p;simpl.
118
rewrite ZL6. rewrite Rdef_pow_add;rewrite IHp. reflexivity.
119
unfold nat_of_P;simpl;rewrite ZL6;rewrite Rdef_pow_add;rewrite IHp;trivial.
120
rewrite Rmult_comm;apply Rmult_1_l.
124
match isnatcst t with
125
| false => constr:(InitialRing.NotConstant)
126
| _ => constr:(N_of_nat t)
129
Add Field RField : Rfield
130
(completeness Zeq_bool_complete, power_tac R_power_theory [Rpow_tac]).