Real.v 5.73 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159
(* This file is generated by Why3's Coq driver *)
(* Beware! Only edit allowed sections below    *)
Require Import ZArith.
Require Import Rbase.
(*Add Rec LoadPath "/home/guillaume/bin/why3/share/why3/theories".*)
(*Add Rec LoadPath "/home/guillaume/bin/why3/share/why3/modules".*)

Definition infix_ls: R -> R -> Prop.
(* YOU MAY EDIT THE PROOF BELOW *)
exact Rlt.
Defined.
(* DO NOT EDIT BELOW *)


Definition infix_lseq(x:R) (y:R): Prop := (infix_ls x y) \/ (x = y).

Definition infix_pl: R -> R -> R.
(* YOU MAY EDIT THE PROOF BELOW *)
exact Rplus.
Defined.
(* DO NOT EDIT BELOW *)


Definition prefix_mn: R -> R.
(* YOU MAY EDIT THE PROOF BELOW *)
exact Ropp.
Defined.
(* DO NOT EDIT BELOW *)


Definition infix_as: R -> R -> R.
(* YOU MAY EDIT THE PROOF BELOW *)
exact Rmult.
Defined.
(* DO NOT EDIT BELOW *)


(* YOU MAY EDIT THE CONTEXT BELOW *)

(* DO NOT EDIT BELOW *)

Lemma Unit_def : forall (x:R), ((infix_pl x 0%R) = x).
(* YOU MAY EDIT THE PROOF BELOW *)
exact Rplus_0_r.
Qed.
(* DO NOT EDIT BELOW *)

(* YOU MAY EDIT THE CONTEXT BELOW *)

(* DO NOT EDIT BELOW *)

Lemma Assoc : forall (x:R) (y:R) (z:R), ((infix_pl (infix_pl x y)
  z) = (infix_pl x (infix_pl y z))).
(* YOU MAY EDIT THE PROOF BELOW *)
exact Rplus_assoc.
Qed.
(* DO NOT EDIT BELOW *)

(* YOU MAY EDIT THE CONTEXT BELOW *)

(* DO NOT EDIT BELOW *)

Lemma Inv_def : forall (x:R), ((infix_pl x (prefix_mn x)) = 0%R).
(* YOU MAY EDIT THE PROOF BELOW *)
exact Rplus_opp_r.
Qed.
(* DO NOT EDIT BELOW *)

(* YOU MAY EDIT THE CONTEXT BELOW *)

(* DO NOT EDIT BELOW *)

Lemma Comm : forall (x:R) (y:R), ((infix_pl x y) = (infix_pl y x)).
(* YOU MAY EDIT THE PROOF BELOW *)
exact Rplus_comm.
Qed.
(* DO NOT EDIT BELOW *)

(* YOU MAY EDIT THE CONTEXT BELOW *)

(* DO NOT EDIT BELOW *)

Lemma Assoc1 : forall (x:R) (y:R) (z:R), ((infix_as (infix_as x y)
  z) = (infix_as x (infix_as y z))).
(* YOU MAY EDIT THE PROOF BELOW *)
exact Rmult_assoc.
Qed.
(* DO NOT EDIT BELOW *)

(* YOU MAY EDIT THE CONTEXT BELOW *)

(* DO NOT EDIT BELOW *)

Lemma Mul_distr : forall (x:R) (y:R) (z:R), ((infix_as x (infix_pl y
  z)) = (infix_pl (infix_as x y) (infix_as x z))).
(* YOU MAY EDIT THE PROOF BELOW *)
exact Rmult_plus_distr_l.
Qed.
(* DO NOT EDIT BELOW *)

Definition infix_mn(x:R) (y:R): R := (infix_pl x (prefix_mn y)).

(* YOU MAY EDIT THE CONTEXT BELOW *)

(* DO NOT EDIT BELOW *)

Lemma Comm1 : forall (x:R) (y:R), ((infix_as x y) = (infix_as y x)).
(* YOU MAY EDIT THE PROOF BELOW *)
exact Rmult_comm.
Qed.
(* DO NOT EDIT BELOW *)

(* YOU MAY EDIT THE CONTEXT BELOW *)

(* DO NOT EDIT BELOW *)

Lemma Unitary : forall (x:R), ((infix_as 1%R x) = x).
(* YOU MAY EDIT THE PROOF BELOW *)
exact Rmult_1_l.
Qed.
(* DO NOT EDIT BELOW *)

(* YOU MAY EDIT THE CONTEXT BELOW *)

(* DO NOT EDIT BELOW *)

Lemma NonTrivialRing : ~ (0%R = 1%R).
(* YOU MAY EDIT THE PROOF BELOW *)
apply not_eq_sym.
exact R1_neq_R0.
Qed.
(* DO NOT EDIT BELOW *)

Definition inv: R -> R.
(* YOU MAY EDIT THE PROOF BELOW *)
exact Rinv.
Defined.
(* DO NOT EDIT BELOW *)


(* YOU MAY EDIT THE CONTEXT BELOW *)

(* DO NOT EDIT BELOW *)

Lemma Inverse : forall (x:R), (~ (x = 0%R)) -> ((infix_as x (inv x)) = 1%R).
(* YOU MAY EDIT THE PROOF BELOW *)
exact Rinv_r.
Qed.
(* DO NOT EDIT BELOW *)

Definition infix_sl(x:R) (y:R): R := (infix_as x (inv y)).

(* YOU MAY EDIT THE CONTEXT BELOW *)

(* DO NOT EDIT BELOW *)

Lemma assoc_mul_div : forall (x:R) (y:R) (z:R), (~ (z = 0%R)) ->
  ((infix_sl (infix_as x y) z) = (infix_as x (infix_sl y z))).
(* YOU MAY EDIT THE PROOF BELOW *)
160
intros x y z _.
161 162 163 164 165 166 167 168 169 170 171 172
apply Rmult_assoc.
Qed.
(* DO NOT EDIT BELOW *)

(* YOU MAY EDIT THE CONTEXT BELOW *)

(* DO NOT EDIT BELOW *)

Lemma assoc_div_mul : forall (x:R) (y:R) (z:R), ((~ (y = 0%R)) /\
  ~ (z = 0%R)) -> ((infix_sl (infix_sl x y) z) = (infix_sl x (infix_as y
  z))).
(* YOU MAY EDIT THE PROOF BELOW *)
173 174 175 176
intros x y z (Zy, Zz).
unfold infix_sl, infix_as, inv.
rewrite Rmult_assoc.
now rewrite Rinv_mult_distr.
177 178 179 180 181 182 183 184 185 186 187
Qed.
(* DO NOT EDIT BELOW *)

(* YOU MAY EDIT THE CONTEXT BELOW *)

(* DO NOT EDIT BELOW *)

Lemma assoc_div_div : forall (x:R) (y:R) (z:R), ((~ (y = 0%R)) /\
  ~ (z = 0%R)) -> ((infix_sl x (infix_sl y z)) = (infix_sl (infix_as x z)
  y)).
(* YOU MAY EDIT THE PROOF BELOW *)
188 189 190 191
intros x y z (Zy, Zz).
unfold infix_sl, infix_as, inv.
field.
now split.
192 193 194 195 196 197 198 199 200
Qed.
(* DO NOT EDIT BELOW *)

(* YOU MAY EDIT THE CONTEXT BELOW *)

(* DO NOT EDIT BELOW *)

Lemma Refl : forall (x:R), (infix_lseq x x).
(* YOU MAY EDIT THE PROOF BELOW *)
201
exact Rle_refl.
202 203 204 205 206 207 208 209 210 211
Qed.
(* DO NOT EDIT BELOW *)

(* YOU MAY EDIT THE CONTEXT BELOW *)

(* DO NOT EDIT BELOW *)

Lemma Trans : forall (x:R) (y:R) (z:R), (infix_lseq x y) -> ((infix_lseq y
  z) -> (infix_lseq x z)).
(* YOU MAY EDIT THE PROOF BELOW *)
212
exact Rle_trans.
213 214 215 216 217 218 219 220 221 222
Qed.
(* DO NOT EDIT BELOW *)

(* YOU MAY EDIT THE CONTEXT BELOW *)

(* DO NOT EDIT BELOW *)

Lemma Antisymm : forall (x:R) (y:R), (infix_lseq x y) -> ((infix_lseq y x) ->
  (x = y)).
(* YOU MAY EDIT THE PROOF BELOW *)
223
exact Rle_antisym.
224 225 226 227 228 229 230 231 232
Qed.
(* DO NOT EDIT BELOW *)

(* YOU MAY EDIT THE CONTEXT BELOW *)

(* DO NOT EDIT BELOW *)

Lemma Total : forall (x:R) (y:R), (infix_lseq x y) \/ (infix_lseq y x).
(* YOU MAY EDIT THE PROOF BELOW *)
233 234 235 236 237
intros x y.
destruct (Rle_or_lt x y) as [H|H].
now left.
right.
now apply Rlt_le.
238 239 240 241 242 243 244 245 246 247
Qed.
(* DO NOT EDIT BELOW *)

(* YOU MAY EDIT THE CONTEXT BELOW *)

(* DO NOT EDIT BELOW *)

Lemma CompatOrderAdd : forall (x:R) (y:R) (z:R), (infix_lseq x y) ->
  (infix_lseq (infix_pl x z) (infix_pl y z)).
(* YOU MAY EDIT THE PROOF BELOW *)
248 249
intros x y z.
exact (Rplus_le_compat_r z x y).
250 251 252 253 254 255 256 257 258 259
Qed.
(* DO NOT EDIT BELOW *)

(* YOU MAY EDIT THE CONTEXT BELOW *)

(* DO NOT EDIT BELOW *)

Lemma CompatOrderMult : forall (x:R) (y:R) (z:R), (infix_lseq x y) ->
  ((infix_lseq 0%R z) -> (infix_lseq (infix_as x z) (infix_as y z))).
(* YOU MAY EDIT THE PROOF BELOW *)
260 261
intros x y z H Zz.
now apply Rmult_le_compat_r.
262 263 264 265
Qed.
(* DO NOT EDIT BELOW *)