Built with Alectryon, running Coq+SerAPI v8.10.0+0.7.0. Coq sources are in this panel; goals and messages will appear in the other. Bubbles () indicate interactive fragments: hover for details, tap to reveal contents. Use Ctrl+↑ Ctrl+↓ to navigate, Ctrl+🖱️ to focus.
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
(* * (see LICENSE file for the text of the license) *)
(************************************************************************)
(************************************************************************)
(*********************************************************)
(*********************************************************) Require Export Raxioms. Require Import Rpow_def. Require Import Zpower. Require Export ZArithRing. Require Import Omega. Require Export RealField. Local Open Scope Z_scope. Local Open Scope R_scope. Implicit Type r : R. (*********************************************************)
(*********************************************************)
Reflexivity of the large order
forall r : R, r <= rintro; right; reflexivity. Qed. Hint Immediate Rle_refl: rorders.forall r : R, r <= rforall r : R, r <= rexact Rle_refl. Qed. Hint Immediate Rge_refl: rorders.forall r : R, r <= r
Irreflexivity of the strict order
forall r : R, ~ r < rintros r H; eapply Rlt_asym; eauto. Qed. Hint Resolve Rlt_irrefl: real.forall r : R, ~ r < rforall r : R, ~ r > rexact Rlt_irrefl. Qed.forall r : R, ~ r > rforall r1 r2 : R, r1 < r2 -> r1 <> r2forall r1 r2 : R, r1 < r2 -> r1 <> r2pattern r1 at 2; rewrite H0; trivial. Qed.r1, r2:RH:r1 < r2H0:r1 = r2r1 < r1forall r1 r2 : R, r1 > r2 -> r1 <> r2intros; apply not_eq_sym; apply Rlt_not_eq; auto with real. Qed. (**********)forall r1 r2 : R, r1 > r2 -> r1 <> r2forall r1 r2 : R, r1 < r2 \/ r1 > r2 -> r1 <> r2forall r1 r2 : R, r1 < r2 \/ r1 > r2 -> r1 <> r2r1, r2:RH0:r1 = r2H1:r1 < r2Falser1, r2:RH0:r1 = r2H1:r1 > r2Falser1, r2:RH0:r1 = r2H1:r1 < r2Falseeauto.r1, r2:RH0:r1 = r2H1:r1 <> r2Falser1, r2:RH0:r1 = r2H1:r1 > r2Falseeauto. Qed. Hint Resolve Rlt_dichotomy_converse: real.r1, r2:RH0:r1 = r2H1:r1 <> r2False
Reasoning by case on equality and order
(**********)forall r1 r2 : R, r1 = r2 \/ r1 <> r2intros; generalize (total_order_T r1 r2) Rlt_dichotomy_converse; unfold not; intuition eauto 3. Qed. Hint Resolve Req_dec: real. (**********)forall r1 r2 : R, r1 = r2 \/ r1 <> r2forall r1 r2 : R, r1 < r2 \/ r1 = r2 \/ r1 > r2intros; generalize (total_order_T r1 r2); tauto. Qed. (**********)forall r1 r2 : R, r1 < r2 \/ r1 = r2 \/ r1 > r2forall r1 r2 : R, r1 <> r2 -> r1 < r2 \/ r1 > r2intros; generalize (total_order_T r1 r2); tauto. Qed. (*********************************************************)forall r1 r2 : R, r1 <> r2 -> r1 < r2 \/ r1 > r2
(*********************************************************)
(*********************************************************)
(*********************************************************)
forall r1 r2 : R, r1 < r2 -> r1 <= r2intros; red; tauto. Qed. Hint Resolve Rlt_le: real.forall r1 r2 : R, r1 < r2 -> r1 <= r2forall r1 r2 : R, r1 > r2 -> r1 >= r2intros; red; tauto. Qed. (**********)forall r1 r2 : R, r1 > r2 -> r1 >= r2forall r1 r2 : R, r1 <= r2 -> r2 >= r1destruct 1; red; auto with real. Qed. Hint Immediate Rle_ge: real. Hint Resolve Rle_ge: rorders.forall r1 r2 : R, r1 <= r2 -> r2 >= r1forall r1 r2 : R, r1 >= r2 -> r2 <= r1destruct 1; red; auto with real. Qed. Hint Resolve Rge_le: real. Hint Immediate Rge_le: rorders. (**********)forall r1 r2 : R, r1 >= r2 -> r2 <= r1forall r1 r2 : R, r1 < r2 -> r2 > r1trivial. Qed. Hint Resolve Rlt_gt: rorders.forall r1 r2 : R, r1 < r2 -> r2 > r1forall r1 r2 : R, r1 > r2 -> r2 < r1trivial. Qed. Hint Immediate Rgt_lt: rorders. (**********)forall r1 r2 : R, r1 > r2 -> r2 < r1forall r1 r2 : R, ~ r1 <= r2 -> r2 < r1intros r1 r2; generalize (Rtotal_order r1 r2); unfold Rle; tauto. Qed. Hint Immediate Rnot_le_lt: real.forall r1 r2 : R, ~ r1 <= r2 -> r2 < r1forall r1 r2 : R, ~ r1 >= r2 -> r2 > r1forall r1 r2 : R, ~ r1 >= r2 -> r2 > r1auto with real. Qed.r1, r2:RH:~ r1 >= r2~ r2 <= r1forall r1 r2 : R, ~ r1 <= r2 -> r1 > r2forall r1 r2 : R, ~ r1 <= r2 -> r1 > r2auto with real. Qed.r1, r2:RH:~ r1 <= r2~ r1 <= r2forall r1 r2 : R, ~ r1 >= r2 -> r1 < r2forall r1 r2 : R, ~ r1 >= r2 -> r1 < r2auto with real. Qed.r1, r2:RH:~ r1 >= r2~ r2 <= r1forall r1 r2 : R, ~ r1 < r2 -> r2 <= r1forall r1 r2 : R, ~ r1 < r2 -> r2 <= r1r1, r2:RH:~ r1 < r2H0:r1 < r2r2 <= r1r1, r2:RH:~ r1 < r2H0:r1 = r2r2 <= r1r1, r2:RH:~ r1 < r2H0:r1 > r2r2 <= r1r1, r2:RH:~ r1 < r2H0:r1 = r2r2 <= r1r1, r2:RH:~ r1 < r2H0:r1 > r2r2 <= r1auto with real. Qed.r1, r2:RH:~ r1 < r2H0:r1 > r2r2 <= r1forall r1 r2 : R, ~ r1 > r2 -> r1 <= r2auto using Rnot_lt_le with real. Qed.forall r1 r2 : R, ~ r1 > r2 -> r1 <= r2forall r1 r2 : R, ~ r1 > r2 -> r2 >= r1intros; eauto using Rnot_lt_le with rorders. Qed.forall r1 r2 : R, ~ r1 > r2 -> r2 >= r1forall r1 r2 : R, ~ r1 < r2 -> r1 >= r2eauto using Rnot_gt_ge with rorders. Qed. (**********)forall r1 r2 : R, ~ r1 < r2 -> r1 >= r2forall r1 r2 : R, r2 < r1 -> ~ r1 <= r2forall r1 r2 : R, r2 < r1 -> ~ r1 <= r2unfold not; intuition eauto 3. Qed. Hint Immediate Rlt_not_le: real.(forall r1 r2 : R, r1 < r2 -> ~ r2 < r1) -> (forall r1 r2 : R, r1 < r2 \/ r1 > r2 -> r1 <> r2) -> forall r1 r2 : R, r2 < r1 -> ~ (r1 < r2 \/ r1 = r2)forall r1 r2 : R, r1 > r2 -> ~ r1 <= r2exact Rlt_not_le. Qed.forall r1 r2 : R, r1 > r2 -> ~ r1 <= r2forall r1 r2 : R, r1 < r2 -> ~ r1 >= r2red; intros; eapply Rlt_not_le; eauto with real. Qed. Hint Immediate Rlt_not_ge: real.forall r1 r2 : R, r1 < r2 -> ~ r1 >= r2forall r1 r2 : R, r2 > r1 -> ~ r1 >= r2exact Rlt_not_ge. Qed.forall r1 r2 : R, r2 > r1 -> ~ r1 >= r2forall r1 r2 : R, r2 <= r1 -> ~ r1 < r2forall r1 r2 : R, r2 <= r1 -> ~ r1 < r2r1, r2:Rr2 <= r1 -> ~ r1 < r2unfold Rle; intuition. Qed.r1, r2:R(r1 < r2 -> ~ r2 < r1) -> (r1 < r2 \/ r1 > r2 -> r1 <> r2) -> r2 <= r1 -> ~ r1 < r2forall r1 r2 : R, r1 >= r2 -> ~ r1 < r2intros; apply Rle_not_lt; auto with real. Qed.forall r1 r2 : R, r1 >= r2 -> ~ r1 < r2forall r1 r2 : R, r1 <= r2 -> ~ r1 > r2do 2 intro; apply Rle_not_lt. Qed.forall r1 r2 : R, r1 <= r2 -> ~ r1 > r2forall r1 r2 : R, r2 >= r1 -> ~ r1 > r2do 2 intro; apply Rge_not_lt. Qed. (**********)forall r1 r2 : R, r2 >= r1 -> ~ r1 > r2forall r1 r2 : R, r1 = r2 -> r1 <= r2unfold Rle; tauto. Qed. Hint Immediate Req_le: real.forall r1 r2 : R, r1 = r2 -> r1 <= r2forall r1 r2 : R, r1 = r2 -> r1 >= r2unfold Rge; tauto. Qed. Hint Immediate Req_ge: real.forall r1 r2 : R, r1 = r2 -> r1 >= r2forall r1 r2 : R, r2 = r1 -> r1 <= r2unfold Rle; auto. Qed. Hint Immediate Req_le_sym: real.forall r1 r2 : R, r2 = r1 -> r1 <= r2forall r1 r2 : R, r2 = r1 -> r1 >= r2unfold Rge; auto. Qed. Hint Immediate Req_ge_sym: real.forall r1 r2 : R, r2 = r1 -> r1 >= r2
Remark: Rlt_asym is an axiom
forall r1 r2 : R, r1 > r2 -> ~ r2 > r1do 2 intro; apply Rlt_asym. Qed.forall r1 r2 : R, r1 > r2 -> ~ r2 > r1
forall r1 r2 : R, r1 <= r2 -> r2 <= r1 -> r1 = r2intros r1 r2; generalize (Rlt_asym r1 r2); unfold Rle; intuition. Qed. Hint Resolve Rle_antisym: real.forall r1 r2 : R, r1 <= r2 -> r2 <= r1 -> r1 = r2forall r1 r2 : R, r1 >= r2 -> r2 >= r1 -> r1 = r2auto with real. Qed. (**********)forall r1 r2 : R, r1 >= r2 -> r2 >= r1 -> r1 = r2forall r1 r2 : R, r1 <= r2 <= r1 <-> r1 = r2intuition. Qed.forall r1 r2 : R, r1 <= r2 <= r1 <-> r1 = r2forall r1 r2 : R, r1 >= r2 /\ r2 >= r1 <-> r1 = r2intuition. Qed.forall r1 r2 : R, r1 >= r2 /\ r2 >= r1 <-> r1 = r2
forall r1 r2 r3 r4 : R, r1 = r2 -> r2 < r4 -> r4 = r3 -> r1 < r3intros x x' y y'; intros; replace x with x'; replace y with y'; assumption. Qed.forall r1 r2 r3 r4 : R, r1 = r2 -> r2 < r4 -> r4 = r3 -> r1 < r3forall r1 r2 r3 r4 : R, r1 = r2 -> r2 > r4 -> r4 = r3 -> r1 > r3intros; red; apply Rlt_eq_compat with (r2:=r4) (r4:=r2); auto. Qed.forall r1 r2 r3 r4 : R, r1 = r2 -> r2 > r4 -> r4 = r3 -> r1 > r3
Remark: Rlt_trans is an axiom
forall r1 r2 r3 : R, r1 <= r2 -> r2 <= r3 -> r1 <= r3forall r1 r2 r3 : R, r1 <= r2 -> r2 <= r3 -> r1 <= r3(forall (A : Type) (x y z : A), x = y -> y = z -> x = z) -> (forall r1 r2 r3 : R, r1 < r2 -> r2 < r3 -> r1 < r3) -> (forall r1 r2 r3 r4 : R, r1 = r2 -> r2 < r4 -> r4 = r3 -> r1 < r3) -> forall r1 r2 r3 : R, r1 <= r2 -> r2 <= r3 -> r1 <= r3intuition eauto 2. Qed.(forall (A : Type) (x y z : A), x = y -> y = z -> x = z) -> (forall r1 r2 r3 : R, r1 < r2 -> r2 < r3 -> r1 < r3) -> (forall r1 r2 r3 r4 : R, r1 = r2 -> r2 < r4 -> r4 = r3 -> r1 < r3) -> forall r1 r2 r3 : R, r1 < r2 \/ r1 = r2 -> r2 < r3 \/ r2 = r3 -> r1 < r3 \/ r1 = r3forall r1 r2 r3 : R, r1 >= r2 -> r2 >= r3 -> r1 >= r3eauto using Rle_trans with rorders. Qed.forall r1 r2 r3 : R, r1 >= r2 -> r2 >= r3 -> r1 >= r3forall r1 r2 r3 : R, r1 > r2 -> r2 > r3 -> r1 > r3eauto using Rlt_trans with rorders. Qed. (**********)forall r1 r2 r3 : R, r1 > r2 -> r2 > r3 -> r1 > r3forall r1 r2 r3 : R, r1 <= r2 -> r2 < r3 -> r1 < r3forall r1 r2 r3 : R, r1 <= r2 -> r2 < r3 -> r1 < r3(forall r1 r2 r3 : R, r1 < r2 -> r2 < r3 -> r1 < r3) -> (forall r1 r2 r3 r4 : R, r1 = r2 -> r2 < r4 -> r4 = r3 -> r1 < r3) -> forall r1 r2 r3 : R, r1 <= r2 -> r2 < r3 -> r1 < r3intuition eauto 2. Qed.(forall r1 r2 r3 : R, r1 < r2 -> r2 < r3 -> r1 < r3) -> (forall r1 r2 r3 r4 : R, r1 = r2 -> r2 < r4 -> r4 = r3 -> r1 < r3) -> forall r1 r2 r3 : R, r1 < r2 \/ r1 = r2 -> r2 < r3 -> r1 < r3forall r1 r2 r3 : R, r1 < r2 -> r2 <= r3 -> r1 < r3generalize Rlt_trans Rlt_eq_compat; unfold Rle; intuition eauto 2. Qed.forall r1 r2 r3 : R, r1 < r2 -> r2 <= r3 -> r1 < r3forall r1 r2 r3 : R, r1 >= r2 -> r2 > r3 -> r1 > r3eauto using Rlt_le_trans with rorders. Qed.forall r1 r2 r3 : R, r1 >= r2 -> r2 > r3 -> r1 > r3forall r1 r2 r3 : R, r1 > r2 -> r2 >= r3 -> r1 > r3eauto using Rle_lt_trans with rorders. Qed.forall r1 r2 r3 : R, r1 > r2 -> r2 >= r3 -> r1 > r3
forall r1 r2 : R, {r1 < r2} + {~ r1 < r2}intros; generalize (total_order_T r1 r2) (Rlt_dichotomy_converse r1 r2); intuition. Qed.forall r1 r2 : R, {r1 < r2} + {~ r1 < r2}forall r1 r2 : R, {r1 <= r2} + {~ r1 <= r2}forall r1 r2 : R, {r1 <= r2} + {~ r1 <= r2}r1, r2:R{r1 <= r2} + {~ r1 <= r2}intuition eauto 4 with real. Qed.r1, r2:R{r1 < r2} + {r1 = r2} + {r1 > r2} -> (r1 < r2 \/ r1 > r2 -> r1 <> r2) -> {r1 <= r2} + {~ r1 <= r2}forall r1 r2 : R, {r1 > r2} + {~ r1 > r2}do 2 intro; apply Rlt_dec. Qed.forall r1 r2 : R, {r1 > r2} + {~ r1 > r2}forall r1 r2 : R, {r1 >= r2} + {~ r1 >= r2}intros; edestruct Rle_dec; [left|right]; eauto with rorders. Qed.forall r1 r2 : R, {r1 >= r2} + {~ r1 >= r2}forall r1 r2 : R, {r1 < r2} + {r2 <= r1}intros; generalize (total_order_T r1 r2); intuition. Qed.forall r1 r2 : R, {r1 < r2} + {r2 <= r1}forall r1 r2 : R, {r1 > r2} + {r2 >= r1}intros; edestruct Rlt_le_dec; [left|right]; eauto with rorders. Qed.forall r1 r2 : R, {r1 > r2} + {r2 >= r1}forall r1 r2 : R, {r1 <= r2} + {r2 < r1}intros; generalize (total_order_T r1 r2); intuition. Qed.forall r1 r2 : R, {r1 <= r2} + {r2 < r1}forall r1 r2 : R, {r1 >= r2} + {r2 > r1}intros; edestruct Rle_lt_dec; [left|right]; eauto with rorders. Qed.forall r1 r2 : R, {r1 >= r2} + {r2 > r1}forall r1 r2 : R, r1 < r2 \/ r2 <= r1intros n m; elim (Rle_lt_dec m n); auto with real. Qed.forall r1 r2 : R, r1 < r2 \/ r2 <= r1forall r1 r2 : R, r1 > r2 \/ r2 >= r1intros; edestruct Rlt_or_le; [left|right]; eauto with rorders. Qed.forall r1 r2 : R, r1 > r2 \/ r2 >= r1forall r1 r2 : R, r1 <= r2 \/ r2 < r1intros n m; elim (Rlt_le_dec m n); auto with real. Qed.forall r1 r2 : R, r1 <= r2 \/ r2 < r1forall r1 r2 : R, r1 >= r2 \/ r2 > r1intros; edestruct Rle_or_lt; [left|right]; eauto with rorders. Qed.forall r1 r2 : R, r1 >= r2 \/ r2 > r1forall r1 r2 : R, r1 <= r2 -> {r1 < r2} + {r1 = r2}intros r1 r2 H; generalize (total_order_T r1 r2); intuition. Qed. (**********)forall r1 r2 : R, r1 <= r2 -> {r1 < r2} + {r1 = r2}forall r1 r2 r3 r4 : R, r1 <= r2 < r3 -> {r1 <= r2 < r4} + {r4 <= r2 < r3}intros n m p q; intros; generalize (Rlt_le_dec m q); intuition. Qed. (*********************************************************)forall r1 r2 r3 r4 : R, r1 <= r2 < r3 -> {r1 <= r2 < r4} + {r4 <= r2 < r3}
(*********************************************************)
Remark: Rplus_0_l is an axiom
forall r : R, r + 0 = rintro; ring. Qed. Hint Resolve Rplus_0_r: real.forall r : R, r + 0 = rforall r : R, r + 0 = r /\ 0 + r = rsplit; ring. Qed. Hint Resolve Rplus_ne: real. (**********)forall r : R, r + 0 = r /\ 0 + r = r
Remark: Rplus_opp_r is an axiom
forall r : R, - r + r = 0intro; ring. Qed. Hint Resolve Rplus_opp_l: real. (**********)forall r : R, - r + r = 0forall r1 r2 : R, r1 + r2 = 0 -> r2 = - r1forall r1 r2 : R, r1 + r2 = 0 -> r2 = - r1rewrite Rplus_assoc; rewrite H; ring. Qed. Definition f_equal_R := (f_equal (A:=R)). Hint Resolve f_equal_R : real.x, y:RH:x + y = 0- x + x + y = - xforall r r1 r2 : R, r1 = r2 -> r + r1 = r + r2forall r r1 r2 : R, r1 = r2 -> r + r1 = r + r2apply f_equal. Qed.r, r1, r2:Rr1 = r2 -> r + r1 = r + r2forall r r1 r2 : R, r1 = r2 -> r1 + r = r2 + rforall r r1 r2 : R, r1 = r2 -> r1 + r = r2 + rapply (f_equal (fun v => v + r)). Qed. (**********)r, r1, r2:Rr1 = r2 -> r1 + r = r2 + rforall r r1 r2 : R, r + r1 = r + r2 -> r1 = r2forall r r1 r2 : R, r + r1 = r + r2 -> r1 = r2r, r1, r2:RH:r + r1 = r + r2r1 = - r + r + r1r, r1, r2:RH:r + r1 = r + r2- r + r + r1 = r2r, r1, r2:RH:r + r1 = r + r2- r + r + r1 = r2r, r1, r2:RH:r + r1 = r + r2- r + r + r1 = - r + r + r2r, r1, r2:RH:r + r1 = r + r2- r + r + r2 = r2ring. Qed. Hint Resolve Rplus_eq_reg_l: real.r, r1, r2:RH:r + r1 = r + r2- r + r + r2 = r2forall r r1 r2 : R, r1 + r = r2 + r -> r1 = r2forall r r1 r2 : R, r1 + r = r2 + r -> r1 = r2r, r1, r2:RH:r1 + r = r2 + rr1 = r2now rewrite 2!(Rplus_comm r). Qed. (**********)r, r1, r2:RH:r1 + r = r2 + rr + r1 = r + r2forall r r1 : R, r + r1 = r -> r1 = 0intros r b; pattern r at 2; replace r with (r + 0); eauto with real. Qed. (***********)forall r r1 : R, r + r1 = r -> r1 = 0forall r1 r2 : R, 0 <= r1 -> 0 <= r2 -> r1 + r2 = 0 -> r1 = 0forall r1 r2 : R, 0 <= r1 -> 0 <= r2 -> r1 + r2 = 0 -> r1 = 0a, b:RH:0 <= aH0:0 < bH1:a + b = 0a = 0a, b:RH:0 <= aH0:0 = bH1:a + b = 0a = 0a, b:RH:0 <= aH0:0 < bH1:a + b = 0~ 0 < a + ba, b:RH:0 <= aH0:0 < bH1:a + b = 00 < a + ba, b:RH:0 <= aH0:0 = bH1:a + b = 0a = 0a, b:RH:0 <= aH0:0 < bH1:a + b = 00 < a + ba, b:RH:0 <= aH0:0 = bH1:a + b = 0a = 0a, b:RH:0 <= aH0:0 < bH1:a + b = 00 <= a + 0a, b:RH:0 <= aH0:0 < bH1:a + b = 0a + 0 < a + ba, b:RH:0 <= aH0:0 = bH1:a + b = 0a = 0a, b:RH:0 <= aH0:0 < bH1:a + b = 0a + 0 < a + ba, b:RH:0 <= aH0:0 = bH1:a + b = 0a = 0rewrite <- H0, Rplus_0_r in H1; assumption. Qed.a, b:RH:0 <= aH0:0 = bH1:a + b = 0a = 0forall r1 r2 : R, 0 <= r1 -> 0 <= r2 -> r1 + r2 = 0 -> r1 = 0 /\ r2 = 0forall r1 r2 : R, 0 <= r1 -> 0 <= r2 -> r1 + r2 = 0 -> r1 = 0 /\ r2 = 0a, b:RH:0 <= aH0:0 <= bH1:a + b = 0a = 0a, b:RH:0 <= aH0:0 <= bH1:a + b = 0b = 0a, b:RH:0 <= aH0:0 <= bH1:a + b = 0b = 0rewrite Rplus_comm; auto with real. Qed. (*********************************************************)a, b:RH:0 <= aH0:0 <= bH1:a + b = 0b + a = 0
(*********************************************************) (**********)forall r : R, r <> 0 -> r * / r = 1intros; field; trivial. Qed. Hint Resolve Rinv_r: real.forall r : R, r <> 0 -> r * / r = 1forall r : R, r <> 0 -> 1 = / r * rintros; field; trivial. Qed. Hint Resolve Rinv_l_sym: real.forall r : R, r <> 0 -> 1 = / r * rforall r : R, r <> 0 -> 1 = r * / rintros; field; trivial. Qed. Hint Resolve Rinv_r_sym: real. (**********)forall r : R, r <> 0 -> 1 = r * / rforall r : R, r * 0 = 0intro; ring. Qed. Hint Resolve Rmult_0_r: real. (**********)forall r : R, r * 0 = 0forall r : R, 0 * r = 0intro; ring. Qed. Hint Resolve Rmult_0_l: real. (**********)forall r : R, 0 * r = 0forall r : R, r * 1 = r /\ 1 * r = rintro; split; ring. Qed. Hint Resolve Rmult_ne: real. (**********)forall r : R, r * 1 = r /\ 1 * r = rforall r : R, r * 1 = rintro; ring. Qed. Hint Resolve Rmult_1_r: real. (**********)forall r : R, r * 1 = rforall r r1 r2 : R, r1 = r2 -> r * r1 = r * r2auto with real. Qed.forall r r1 r2 : R, r1 = r2 -> r * r1 = r * r2forall r r1 r2 : R, r1 = r2 -> r1 * r = r2 * rforall r r1 r2 : R, r1 = r2 -> r1 * r = r2 * rr, r1, r2:RH:r1 = r2r1 * r = r2 * rnow apply Rmult_eq_compat_l. Qed. (**********)r, r1, r2:RH:r1 = r2r * r1 = r * r2forall r r1 r2 : R, r * r1 = r * r2 -> r <> 0 -> r1 = r2forall r r1 r2 : R, r * r1 = r * r2 -> r <> 0 -> r1 = r2r, r1, r2:RH:r * r1 = r * r2H0:r <> 0r1 = / r * r * r1r, r1, r2:RH:r * r1 = r * r2H0:r <> 0/ r * r * r1 = r2r, r1, r2:RH:r * r1 = r * r2H0:r <> 0/ r * r * r1 = r2r, r1, r2:RH:r * r1 = r * r2H0:r <> 0/ r * r * r1 = / r * r * r2r, r1, r2:RH:r * r1 = r * r2H0:r <> 0/ r * r * r2 = r2field; trivial. Qed.r, r1, r2:RH:r * r1 = r * r2H0:r <> 0/ r * r * r2 = r2forall r r1 r2 : R, r1 * r = r2 * r -> r <> 0 -> r1 = r2forall r r1 r2 : R, r1 * r = r2 * r -> r <> 0 -> r1 = r2r, r1, r2:RH:r1 * r = r2 * rH0:r <> 0r1 = r2now rewrite 2!(Rmult_comm r). Qed. (**********)r, r1, r2:RH:r1 * r = r2 * rH0:r <> 0r * r1 = r * r2forall r1 r2 : R, r1 * r2 = 0 -> r1 = 0 \/ r2 = 0forall r1 r2 : R, r1 * r2 = 0 -> r1 = 0 \/ r2 = 0r1, r2:RH:r1 * r2 = 0Hz:r1 = 0r1 = 0 \/ r2 = 0r1, r2:RH:r1 * r2 = 0Hnotz:r1 <> 0r1 = 0 \/ r2 = 0r1, r2:RH:r1 * r2 = 0Hnotz:r1 <> 0r1 = 0 \/ r2 = 0rewrite H; auto with real. Qed. (**********)r1, r2:RH:r1 * r2 = 0Hnotz:r1 <> 0r1 * r2 = r1 * 0forall r1 r2 : R, r1 = 0 \/ r2 = 0 -> r1 * r2 = 0intros r1 r2 [H| H]; rewrite H; auto with real. Qed. Hint Resolve Rmult_eq_0_compat: real. (**********)forall r1 r2 : R, r1 = 0 \/ r2 = 0 -> r1 * r2 = 0forall r1 r2 : R, r1 = 0 -> r1 * r2 = 0auto with real. Qed. (**********)forall r1 r2 : R, r1 = 0 -> r1 * r2 = 0forall r1 r2 : R, r2 = 0 -> r1 * r2 = 0auto with real. Qed. (**********)forall r1 r2 : R, r2 = 0 -> r1 * r2 = 0forall r1 r2 : R, r1 * r2 <> 0 -> r1 <> 0 /\ r2 <> 0intros r1 r2 H; split; red; intro; apply H; auto with real. Qed. (**********)forall r1 r2 : R, r1 * r2 <> 0 -> r1 <> 0 /\ r2 <> 0forall r1 r2 : R, r1 <> 0 /\ r2 <> 0 -> r1 * r2 <> 0forall r1 r2 : R, r1 <> 0 /\ r2 <> 0 -> r1 * r2 <> 0case (Rmult_integral r1 r2); auto with real. Qed. Hint Resolve Rmult_integral_contrapositive: real.r1, r2:RH1:r1 <> 0H2:r2 <> 0H:r1 * r2 = 0Falseforall r1 r2 : R, r1 <> 0 -> r2 <> 0 -> r1 * r2 <> 0auto using Rmult_integral_contrapositive. Qed. (**********)forall r1 r2 : R, r1 <> 0 -> r2 <> 0 -> r1 * r2 <> 0forall r1 r2 r3 : R, (r1 + r2) * r3 = r1 * r3 + r2 * r3intros; ring. Qed. (*********************************************************)forall r1 r2 r3 : R, (r1 + r2) * r3 = r1 * r3 + r2 * r3
(*********************************************************) (***********) Definition Rsqr r : R := r * r. Notation "r ²" := (Rsqr r) (at level 1, format "r ²") : R_scope. (***********)unfold Rsqr; auto with real. Qed. (***********)0² = 0unfold Rsqr; intros; elim (Rmult_integral r r H); trivial. Qed. (*********************************************************)forall r : R, r² = 0 -> r = 0
(*********************************************************) (**********)forall r1 r2 : R, r1 = r2 -> - r1 = - r2auto with real. Qed. Hint Resolve Ropp_eq_compat: real. (**********)forall r1 r2 : R, r1 = r2 -> - r1 = - r2- 0 = 0ring. Qed. Hint Resolve Ropp_0: real. (**********)- 0 = 0forall r : R, r = 0 -> - r = 0intros; rewrite H; auto with real. Qed. Hint Resolve Ropp_eq_0_compat: real. (**********)forall r : R, r = 0 -> - r = 0forall r : R, - - r = rintro; ring. Qed. Hint Resolve Ropp_involutive: real. (*********)forall r : R, - - r = rforall r : R, r <> 0 -> - r <> 0forall r : R, r <> 0 -> - r <> 0r:RH:r <> 0H0:- r = 0Falsetransitivity (- - r); auto with real. Qed. Hint Resolve Ropp_neq_0_compat: real. (**********)r:RH:r <> 0H0:- r = 0r = 0forall r1 r2 : R, - (r1 + r2) = - r1 + - r2intros; ring. Qed. Hint Resolve Ropp_plus_distr: real. (*********************************************************)forall r1 r2 : R, - (r1 + r2) = - r1 + - r2
(*********************************************************)forall r1 r2 : R, - (r1 * r2) = - r1 * r2intros; ring. Qed.forall r1 r2 : R, - (r1 * r2) = - r1 * r2forall r1 r2 : R, - r1 * r2 = - (r1 * r2)intros; ring. Qed. Hint Resolve Ropp_mult_distr_l_reverse: real. (**********)forall r1 r2 : R, - r1 * r2 = - (r1 * r2)forall r1 r2 : R, - r1 * - r2 = r1 * r2intros; ring. Qed. Hint Resolve Rmult_opp_opp: real.forall r1 r2 : R, - r1 * - r2 = r1 * r2forall r1 r2 : R, - (r1 * r2) = r1 * - r2intros; ring. Qed.forall r1 r2 : R, - (r1 * r2) = r1 * - r2forall r1 r2 : R, r1 * - r2 = - (r1 * r2)intros; ring. Qed. (*********************************************************)forall r1 r2 : R, r1 * - r2 = - (r1 * r2)
(*********************************************************)forall r : R, r - 0 = rintro; ring. Qed. Hint Resolve Rminus_0_r: real.forall r : R, r - 0 = rforall r : R, 0 - r = - rintro; ring. Qed. Hint Resolve Rminus_0_l: real. (**********)forall r : R, 0 - r = - rforall r1 r2 : R, - (r1 - r2) = r2 - r1intros; ring. Qed. Hint Resolve Ropp_minus_distr: real.forall r1 r2 : R, - (r1 - r2) = r2 - r1forall r1 r2 : R, - (r2 - r1) = r1 - r2intros; ring. Qed. (**********)forall r1 r2 : R, - (r2 - r1) = r1 - r2forall r1 r2 : R, r1 = r2 -> r1 - r2 = 0intros; rewrite H; ring. Qed. Hint Resolve Rminus_diag_eq: real. (**********)forall r1 r2 : R, r1 = r2 -> r1 - r2 = 0forall r1 r2 : R, r1 - r2 = 0 -> r1 = r2forall r1 r2 : R, r1 - r2 = 0 -> r1 = r2rewrite <- (Ropp_involutive r2); apply (Rplus_opp_r_uniq (- r2) r1 H). Qed. Hint Immediate Rminus_diag_uniq: real.r1, r2:RH:- r2 + r1 = 0r1 = r2forall r1 r2 : R, r2 - r1 = 0 -> r1 = r2intros; generalize (Rminus_diag_uniq r2 r1 H); clear H; intro H; rewrite H; ring. Qed. Hint Immediate Rminus_diag_uniq_sym: real.forall r1 r2 : R, r2 - r1 = 0 -> r1 = r2forall r1 r2 : R, r1 + (r2 - r1) = r2intros; ring. Qed. Hint Resolve Rplus_minus: real. (**********)forall r1 r2 : R, r1 + (r2 - r1) = r2forall r1 r2 : R, r1 <> r2 -> r1 - r2 <> 0forall r1 r2 : R, r1 <> r2 -> r1 - r2 <> 0apply H; auto with real. Qed. Hint Resolve Rminus_eq_contra: real.r1, r2:RH:r1 <> r2H0:r1 - r2 = 0Falseforall r1 r2 : R, r1 - r2 <> 0 -> r1 <> r2red; intros; elim H; apply Rminus_diag_eq; auto. Qed. Hint Resolve Rminus_not_eq: real.forall r1 r2 : R, r1 - r2 <> 0 -> r1 <> r2forall r1 r2 : R, r2 - r1 <> 0 -> r1 <> r2red; intros; elim H; rewrite H0; ring. Qed. Hint Resolve Rminus_not_eq_right: real. (**********)forall r1 r2 : R, r2 - r1 <> 0 -> r1 <> r2forall r1 r2 r3 : R, r1 * (r2 - r3) = r1 * r2 - r1 * r3intros; ring. Qed. (*********************************************************)forall r1 r2 r3 : R, r1 * (r2 - r3) = r1 * r2 - r1 * r3
(*********************************************************)/ 1 = 1field. Qed. Hint Resolve Rinv_1: real. (*********)/ 1 = 1forall r : R, r <> 0 -> / r <> 0forall r : R, r <> 0 -> / r <> 0replace 1 with (/ r * r); auto with real. Qed. Hint Resolve Rinv_neq_0_compat: real. (*********)r:RH:r <> 0H0:/ r = 01 = 0forall r : R, r <> 0 -> / / r = rintros; field; trivial. Qed. Hint Resolve Rinv_involutive: real. (*********)forall r : R, r <> 0 -> / / r = rforall r1 r2 : R, r1 <> 0 -> r2 <> 0 -> / (r1 * r2) = / r1 * / r2intros; field; auto. Qed. (*********)forall r1 r2 : R, r1 <> 0 -> r2 <> 0 -> / (r1 * r2) = / r1 * / r2forall r : R, r <> 0 -> - / r = / - rintros; field; trivial. Qed.forall r : R, r <> 0 -> - / r = / - rforall r1 r2 : R, r1 <> 0 -> r1 * / r1 * r2 = r2forall r1 r2 : R, r1 <> 0 -> r1 * / r1 * r2 = r2rewrite Rinv_r; auto with real. Qed.r1, r2:RH:r1 <> 0r1 * / r1 * r2 = 1 * r2forall r1 r2 : R, r1 <> 0 -> r2 * r1 * / r1 = r2forall r1 r2 : R, r1 <> 0 -> r2 * r1 * / r1 = r2transitivity (r2 * (r1 * / r1)); auto with real. Qed.r1, r2:RH:r1 <> 0r2 * r1 * / r1 = r2 * 1forall r1 r2 : R, r1 <> 0 -> r1 * r2 * / r1 = r2forall r1 r2 : R, r1 <> 0 -> r1 * r2 * / r1 = r2r1, r2:RH:r1 <> 0r1 * r2 * / r1 = r2 * 1ring. Qed. Hint Resolve Rinv_r_simpl_l Rinv_r_simpl_r Rinv_r_simpl_m: real. (*********)r1, r2:RH:r1 <> 0r1 * r2 * / r1 = r2 * (r1 * / r1)forall r1 r2 r3 : R, r1 <> 0 -> r1 * / r2 * (r3 * / r1) = r3 * / r2forall r1 r2 r3 : R, r1 <> 0 -> r1 * / r2 * (r3 * / r1) = r3 * / r2a, b, c:RH:a <> 0a * / b * (c * / a) = c * / bring. Qed. (*********************************************************)a, b, c:RH:a <> 0a * / b * (c * / a) = a * / a * (c * / b)
(*********************************************************)
Remark: Rplus_lt_compat_l is an axiom
forall r r1 r2 : R, r1 > r2 -> r + r1 > r + r2eauto using Rplus_lt_compat_l with rorders. Qed. Hint Resolve Rplus_gt_compat_l: real. (**********)forall r r1 r2 : R, r1 > r2 -> r + r1 > r + r2forall r r1 r2 : R, r1 < r2 -> r1 + r < r2 + rforall r r1 r2 : R, r1 < r2 -> r1 + r < r2 + rrewrite (Rplus_comm r1 r); rewrite (Rplus_comm r2 r); auto with real. Qed. Hint Resolve Rplus_lt_compat_r: real.r, r1, r2:RH:r1 < r2r1 + r < r2 + rforall r r1 r2 : R, r1 > r2 -> r1 + r > r2 + rdo 3 intro; apply Rplus_lt_compat_r. Qed. (**********)forall r r1 r2 : R, r1 > r2 -> r1 + r > r2 + rforall r r1 r2 : R, r1 <= r2 -> r + r1 <= r + r2forall r r1 r2 : R, r1 <= r2 -> r + r1 <= r + r2r, r1, r2:RH:r1 < r2 \/ r1 = r2H0:r1 < r2r + r1 < r + r2 \/ r + r1 = r + r2r, r1, r2:RH:r1 < r2 \/ r1 = r2H0:r1 = r2r + r1 < r + r2 \/ r + r1 = r + r2right; rewrite <- H0; auto with zarith real. Qed.r, r1, r2:RH:r1 < r2 \/ r1 = r2H0:r1 = r2r + r1 < r + r2 \/ r + r1 = r + r2forall r r1 r2 : R, r1 >= r2 -> r + r1 >= r + r2auto using Rplus_le_compat_l with rorders. Qed. Hint Resolve Rplus_ge_compat_l: real. (**********)forall r r1 r2 : R, r1 >= r2 -> r + r1 >= r + r2forall r r1 r2 : R, r1 <= r2 -> r1 + r <= r2 + rforall r r1 r2 : R, r1 <= r2 -> r1 + r <= r2 + rr, r1, r2:RH:r1 < r2 \/ r1 = r2H0:r1 < r2r1 + r < r2 + r \/ r1 + r = r2 + rr, r1, r2:RH:r1 < r2 \/ r1 = r2H0:r1 = r2r1 + r < r2 + r \/ r1 + r = r2 + rright; rewrite <- H0; auto with real. Qed. Hint Resolve Rplus_le_compat_l Rplus_le_compat_r: real.r, r1, r2:RH:r1 < r2 \/ r1 = r2H0:r1 = r2r1 + r < r2 + r \/ r1 + r = r2 + rforall r r1 r2 : R, r1 >= r2 -> r1 + r >= r2 + rauto using Rplus_le_compat_r with rorders. Qed. (*********)forall r r1 r2 : R, r1 >= r2 -> r1 + r >= r2 + rforall r1 r2 r3 r4 : R, r1 < r2 -> r3 < r4 -> r1 + r3 < r2 + r4intros; apply Rlt_trans with (r2 + r3); auto with real. Qed. Hint Immediate Rplus_lt_compat: real.forall r1 r2 r3 r4 : R, r1 < r2 -> r3 < r4 -> r1 + r3 < r2 + r4forall r1 r2 r3 r4 : R, r1 <= r2 -> r3 <= r4 -> r1 + r3 <= r2 + r4intros; apply Rle_trans with (r2 + r3); auto with real. Qed. Hint Immediate Rplus_le_compat: real.forall r1 r2 r3 r4 : R, r1 <= r2 -> r3 <= r4 -> r1 + r3 <= r2 + r4forall r1 r2 r3 r4 : R, r1 > r2 -> r3 > r4 -> r1 + r3 > r2 + r4auto using Rplus_lt_compat with rorders. Qed.forall r1 r2 r3 r4 : R, r1 > r2 -> r3 > r4 -> r1 + r3 > r2 + r4forall r1 r2 r3 r4 : R, r1 >= r2 -> r3 >= r4 -> r1 + r3 >= r2 + r4auto using Rplus_le_compat with rorders. Qed. (*********)forall r1 r2 r3 r4 : R, r1 >= r2 -> r3 >= r4 -> r1 + r3 >= r2 + r4forall r1 r2 r3 r4 : R, r1 < r2 -> r3 <= r4 -> r1 + r3 < r2 + r4intros; apply Rlt_le_trans with (r2 + r3); auto with real. Qed.forall r1 r2 r3 r4 : R, r1 < r2 -> r3 <= r4 -> r1 + r3 < r2 + r4forall r1 r2 r3 r4 : R, r1 <= r2 -> r3 < r4 -> r1 + r3 < r2 + r4intros; apply Rle_lt_trans with (r2 + r3); auto with real. Qed. Hint Immediate Rplus_lt_le_compat Rplus_le_lt_compat: real.forall r1 r2 r3 r4 : R, r1 <= r2 -> r3 < r4 -> r1 + r3 < r2 + r4forall r1 r2 r3 r4 : R, r1 > r2 -> r3 >= r4 -> r1 + r3 > r2 + r4auto using Rplus_lt_le_compat with rorders. Qed.forall r1 r2 r3 r4 : R, r1 > r2 -> r3 >= r4 -> r1 + r3 > r2 + r4forall r1 r2 r3 r4 : R, r1 >= r2 -> r3 > r4 -> r1 + r3 > r2 + r4auto using Rplus_le_lt_compat with rorders. Qed. (**********)forall r1 r2 r3 r4 : R, r1 >= r2 -> r3 > r4 -> r1 + r3 > r2 + r4forall r1 r2 : R, 0 < r1 -> 0 < r2 -> 0 < r1 + r2intros x y; intros; apply Rlt_trans with x; [ assumption | pattern x at 1; rewrite <- (Rplus_0_r x); apply Rplus_lt_compat_l; assumption ]. Qed.forall r1 r2 : R, 0 < r1 -> 0 < r2 -> 0 < r1 + r2forall r1 r2 : R, 0 <= r1 -> 0 < r2 -> 0 < r1 + r2intros x y; intros; apply Rle_lt_trans with x; [ assumption | pattern x at 1; rewrite <- (Rplus_0_r x); apply Rplus_lt_compat_l; assumption ]. Qed.forall r1 r2 : R, 0 <= r1 -> 0 < r2 -> 0 < r1 + r2forall r1 r2 : R, 0 < r1 -> 0 <= r2 -> 0 < r1 + r2intros x y; intros; rewrite <- Rplus_comm; apply Rplus_le_lt_0_compat; assumption. Qed.forall r1 r2 : R, 0 < r1 -> 0 <= r2 -> 0 < r1 + r2forall r1 r2 : R, 0 <= r1 -> 0 <= r2 -> 0 <= r1 + r2intros x y; intros; apply Rle_trans with x; [ assumption | pattern x at 1; rewrite <- (Rplus_0_r x); apply Rplus_le_compat_l; assumption ]. Qed. (**********)forall r1 r2 : R, 0 <= r1 -> 0 <= r2 -> 0 <= r1 + r2forall a x b c y d : R, a <= x -> x < b -> c < y -> y <= d -> a + c < x + y < b + dforall a x b c y d : R, a <= x -> x < b -> c < y -> y <= d -> a + c < x + y < b + da, x, b, c, y, d:RH:a <= xH0:x < bH1:c < yH2:y <= da + c < x + ya, x, b, c, y, d:RH:a <= xH0:x < bH1:c < yH2:y <= dx + y < b + dapply Rlt_le_trans with (b + y); auto with real. Qed.a, x, b, c, y, d:RH:a <= xH0:x < bH1:c < yH2:y <= dx + y < b + d
forall r r1 r2 : R, r + r1 < r + r2 -> r1 < r2forall r r1 r2 : R, r + r1 < r + r2 -> r1 < r2r, r1, r2:RH:r + r1 < r + r2- r + r + r1 < - r + r + r2 -> r1 < r2r, r1, r2:RH:r + r1 < r + r2- r + r + r1 < - r + r + r2r, r1, r2:RH:r + r1 < r + r20 + r1 < 0 + r2 -> r1 < r2r, r1, r2:RH:r + r1 < r + r2- r + r + r1 < - r + r + r2rewrite Rplus_assoc; rewrite Rplus_assoc; apply (Rplus_lt_compat_l (- r) (r + r1) (r + r2) H). Qed.r, r1, r2:RH:r + r1 < r + r2- r + r + r1 < - r + r + r2forall r r1 r2 : R, r1 + r < r2 + r -> r1 < r2forall r r1 r2 : R, r1 + r < r2 + r -> r1 < r2r, r1, r2:RH:r1 + r < r2 + rr1 < r2now rewrite 2!(Rplus_comm r). Qed.r, r1, r2:RH:r1 + r < r2 + rr + r1 < r + r2forall r r1 r2 : R, r + r1 <= r + r2 -> r1 <= r2forall r r1 r2 : R, r + r1 <= r + r2 -> r1 <= r2r, r1, r2:RH:r + r1 < r + r2 \/ r + r1 = r + r2H0:r + r1 < r + r2r1 < r2 \/ r1 = r2r, r1, r2:RH:r + r1 < r + r2 \/ r + r1 = r + r2H0:r + r1 = r + r2r1 < r2 \/ r1 = r2right; apply (Rplus_eq_reg_l r r1 r2 H0). Qed.r, r1, r2:RH:r + r1 < r + r2 \/ r + r1 = r + r2H0:r + r1 = r + r2r1 < r2 \/ r1 = r2forall r r1 r2 : R, r1 + r <= r2 + r -> r1 <= r2forall r r1 r2 : R, r1 + r <= r2 + r -> r1 <= r2r, r1, r2:RH:r1 + r <= r2 + rr1 <= r2now rewrite 2!(Rplus_comm r). Qed.r, r1, r2:RH:r1 + r <= r2 + rr + r1 <= r + r2forall r r1 r2 : R, r + r1 > r + r2 -> r1 > r2unfold Rgt; intros; apply (Rplus_lt_reg_l r r2 r1 H). Qed.forall r r1 r2 : R, r + r1 > r + r2 -> r1 > r2forall r r1 r2 : R, r + r1 >= r + r2 -> r1 >= r2intros; apply Rle_ge; apply Rplus_le_reg_l with r; auto with real. Qed. (**********)forall r r1 r2 : R, r + r1 >= r + r2 -> r1 >= r2forall r1 r2 r3 : R, 0 <= r2 -> r1 + r2 <= r3 -> r1 <= r3intros x y z; intros; apply Rle_trans with (x + y); [ pattern x at 1; rewrite <- (Rplus_0_r x); apply Rplus_le_compat_l; assumption | assumption ]. Qed.forall r1 r2 r3 : R, 0 <= r2 -> r1 + r2 <= r3 -> r1 <= r3forall r1 r2 r3 : R, 0 <= r2 -> r1 + r2 < r3 -> r1 < r3intros x y z; intros; apply Rle_lt_trans with (x + y); [ pattern x at 1; rewrite <- (Rplus_0_r x); apply Rplus_le_compat_l; assumption | assumption ]. Qed.forall r1 r2 r3 : R, 0 <= r2 -> r1 + r2 < r3 -> r1 < r3forall r1 r2 r3 : R, 0 >= r2 -> r1 + r2 >= r3 -> r1 >= r3intros x y z; intros; apply Rge_trans with (x + y); [ pattern x at 1; rewrite <- (Rplus_0_r x); apply Rplus_ge_compat_l; assumption | assumption ]. Qed.forall r1 r2 r3 : R, 0 >= r2 -> r1 + r2 >= r3 -> r1 >= r3forall r1 r2 r3 : R, 0 >= r2 -> r1 + r2 > r3 -> r1 > r3intros x y z; intros; apply Rge_gt_trans with (x + y); [ pattern x at 1; rewrite <- (Rplus_0_r x); apply Rplus_ge_compat_l; assumption | assumption ]. Qed. (*********************************************************)forall r1 r2 r3 : R, 0 >= r2 -> r1 + r2 > r3 -> r1 > r3
(*********************************************************)
forall r1 r2 : R, r1 > r2 -> - r1 < - r2forall r1 r2 : R, r1 > r2 -> - r1 < - r2r1, r2:RH:r2 < r1- r1 < - r2r1, r2:RH:r2 < r1r2 + r1 + - r1 < r2 + r1 + - r2r1, r2:RH:r2 < r1r2 < r2 + r1 + - r2exact H. Qed. Hint Resolve Ropp_gt_lt_contravar : core.r1, r2:RH:r2 < r1r2 < r1forall r1 r2 : R, r1 < r2 -> - r1 > - r2unfold Rgt; auto with real. Qed. Hint Resolve Ropp_lt_gt_contravar: real. (**********)forall r1 r2 : R, r1 < r2 -> - r1 > - r2forall r1 r2 : R, r2 < r1 -> - r1 < - r2auto with real. Qed. Hint Resolve Ropp_lt_contravar: real.forall r1 r2 : R, r2 < r1 -> - r1 < - r2forall r1 r2 : R, r2 > r1 -> - r1 > - r2auto with real. Qed. (**********)forall r1 r2 : R, r2 > r1 -> - r1 > - r2forall r1 r2 : R, r1 <= r2 -> - r1 >= - r2unfold Rge; intros r1 r2 [H| H]; auto with real. Qed. Hint Resolve Ropp_le_ge_contravar: real.forall r1 r2 : R, r1 <= r2 -> - r1 >= - r2forall r1 r2 : R, r1 >= r2 -> - r1 <= - r2unfold Rle; intros r1 r2 [H| H]; auto with real. Qed. Hint Resolve Ropp_ge_le_contravar: real. (**********)forall r1 r2 : R, r1 >= r2 -> - r1 <= - r2forall r1 r2 : R, r2 <= r1 -> - r1 <= - r2intros r1 r2 H; elim H; auto with real. Qed. Hint Resolve Ropp_le_contravar: real.forall r1 r2 : R, r2 <= r1 -> - r1 <= - r2forall r1 r2 : R, r2 >= r1 -> - r1 >= - r2auto using Ropp_le_contravar with real. Qed. (**********)forall r1 r2 : R, r2 >= r1 -> - r1 >= - r2forall r : R, 0 < r -> 0 > - rintros; replace 0 with (-0); auto with real. Qed. Hint Resolve Ropp_0_lt_gt_contravar: real.forall r : R, 0 < r -> 0 > - rforall r : R, 0 > r -> 0 < - rintros; replace 0 with (-0); auto with real. Qed. Hint Resolve Ropp_0_gt_lt_contravar: real. (**********)forall r : R, 0 > r -> 0 < - rforall r : R, r > 0 -> - r < 0intros; rewrite <- Ropp_0; auto with real. Qed. Hint Resolve Ropp_lt_gt_0_contravar: real.forall r : R, r > 0 -> - r < 0forall r : R, r < 0 -> - r > 0intros; rewrite <- Ropp_0; auto with real. Qed. Hint Resolve Ropp_gt_lt_0_contravar: real. (**********)forall r : R, r < 0 -> - r > 0forall r : R, 0 <= r -> 0 >= - rintros; replace 0 with (-0); auto with real. Qed. Hint Resolve Ropp_0_le_ge_contravar: real.forall r : R, 0 <= r -> 0 >= - rforall r : R, 0 >= r -> 0 <= - rintros; replace 0 with (-0); auto with real. Qed. Hint Resolve Ropp_0_ge_le_contravar: real.forall r : R, 0 >= r -> 0 <= - r
forall r1 r2 : R, - r2 < - r1 -> r1 < r2forall r1 r2 : R, - r2 < - r1 -> r1 < r2rewrite <- (Ropp_involutive x); rewrite <- (Ropp_involutive y); auto with real. Qed. Hint Immediate Ropp_lt_cancel: real.x, y:RH':- y < - xx < yforall r1 r2 : R, - r2 > - r1 -> r1 > r2auto using Ropp_lt_cancel with rorders. Qed.forall r1 r2 : R, - r2 > - r1 -> r1 > r2forall r1 r2 : R, - r2 <= - r1 -> r1 <= r2forall r1 r2 : R, - r2 <= - r1 -> r1 <= r2x, y:RH:- y <= - xx <= yintro H1; rewrite <- (Ropp_involutive x); rewrite <- (Ropp_involutive y); rewrite H1; auto with real. Qed. Hint Immediate Ropp_le_cancel: real.x, y:RH:- y <= - x- y = - x -> x <= yforall r1 r2 : R, - r2 >= - r1 -> r1 >= r2auto using Ropp_le_cancel with rorders. Qed. (*********************************************************)forall r1 r2 : R, - r2 >= - r1 -> r1 >= r2
(*********************************************************)
Remark: Rmult_lt_compat_l is an axiom
forall r r1 r2 : R, 0 < r -> r1 < r2 -> r1 * r < r2 * rintros; rewrite (Rmult_comm r1 r); rewrite (Rmult_comm r2 r); auto with real. Qed. Hint Resolve Rmult_lt_compat_r : core.forall r r1 r2 : R, 0 < r -> r1 < r2 -> r1 * r < r2 * rforall r r1 r2 : R, r > 0 -> r1 > r2 -> r1 * r > r2 * reauto using Rmult_lt_compat_r with rorders. Qed.forall r r1 r2 : R, r > 0 -> r1 > r2 -> r1 * r > r2 * rforall r r1 r2 : R, r > 0 -> r1 > r2 -> r * r1 > r * r2eauto using Rmult_lt_compat_l with rorders. Qed. (**********)forall r r1 r2 : R, r > 0 -> r1 > r2 -> r * r1 > r * r2forall r r1 r2 : R, 0 <= r -> r1 <= r2 -> r * r1 <= r * r2forall r r1 r2 : R, 0 <= r -> r1 <= r2 -> r * r1 <= r * r2right; rewrite <- H; do 2 rewrite Rmult_0_l; reflexivity. Qed. Hint Resolve Rmult_le_compat_l: real.r, r1, r2:RH:0 = rH0:r1 < r2r * r1 < r * r2 \/ r * r1 = r * r2forall r r1 r2 : R, 0 <= r -> r1 <= r2 -> r1 * r <= r2 * rintros r r1 r2 H; rewrite (Rmult_comm r1 r); rewrite (Rmult_comm r2 r); auto with real. Qed. Hint Resolve Rmult_le_compat_r: real.forall r r1 r2 : R, 0 <= r -> r1 <= r2 -> r1 * r <= r2 * rforall r r1 r2 : R, r >= 0 -> r1 >= r2 -> r * r1 >= r * r2eauto using Rmult_le_compat_l with rorders. Qed.forall r r1 r2 : R, r >= 0 -> r1 >= r2 -> r * r1 >= r * r2forall r r1 r2 : R, r >= 0 -> r1 >= r2 -> r1 * r >= r2 * reauto using Rmult_le_compat_r with rorders. Qed. (**********)forall r r1 r2 : R, r >= 0 -> r1 >= r2 -> r1 * r >= r2 * rforall r1 r2 r3 r4 : R, 0 <= r1 -> 0 <= r3 -> r1 <= r2 -> r3 <= r4 -> r1 * r3 <= r2 * r4forall r1 r2 r3 r4 : R, 0 <= r1 -> 0 <= r3 -> r1 <= r2 -> r3 <= r4 -> r1 * r3 <= r2 * r4x, y, z, t:RH':0 <= xH'0:0 <= zH'1:x <= yH'2:z <= tx * z <= y * tx, y, z, t:RH':0 <= xH'0:0 <= zH'1:x <= yH'2:z <= tx * t <= y * tx, y, z, t:RH':0 <= xH'0:0 <= zH'1:x <= yH'2:z <= tt * x <= t * yapply Rle_trans with z; auto. Qed. Hint Resolve Rmult_le_compat: real.x, y, z, t:RH':0 <= xH'0:0 <= zH'1:x <= yH'2:z <= t0 <= tforall r1 r2 r3 r4 : R, r2 >= 0 -> r4 >= 0 -> r1 >= r2 -> r3 >= r4 -> r1 * r3 >= r2 * r4auto with real rorders. Qed.forall r1 r2 r3 r4 : R, r2 >= 0 -> r4 >= 0 -> r1 >= r2 -> r3 >= r4 -> r1 * r3 >= r2 * r4forall r1 r2 r3 r4 : R, r3 > 0 -> r2 > 0 -> r1 < r2 -> r3 < r4 -> r1 * r3 < r2 * r4intros; apply Rlt_trans with (r2 * r3); auto with real. Qed. (*********)forall r1 r2 r3 r4 : R, r3 > 0 -> r2 > 0 -> r1 < r2 -> r3 < r4 -> r1 * r3 < r2 * r4forall r1 r2 r3 r4 : R, 0 <= r1 -> 0 <= r3 -> r1 < r2 -> r3 < r4 -> r1 * r3 < r2 * r4intros; apply Rle_lt_trans with (r2 * r3); [ apply Rmult_le_compat_r; [ assumption | left; assumption ] | apply Rmult_lt_compat_l; [ apply Rle_lt_trans with r1; assumption | assumption ] ]. Qed. (*********)forall r1 r2 r3 r4 : R, 0 <= r1 -> 0 <= r3 -> r1 < r2 -> r3 < r4 -> r1 * r3 < r2 * r4forall r1 r2 : R, 0 < r1 -> 0 < r2 -> 0 < r1 * r2intros; replace 0 with (0 * r2); auto with real. Qed.forall r1 r2 : R, 0 < r1 -> 0 < r2 -> 0 < r1 * r2Proof Rmult_lt_0_compat.forall r1 r2 : R, r1 > 0 -> r2 > 0 -> r1 * r2 > 0
forall r r1 r2 : R, r <= 0 -> r1 <= r2 -> r * r2 <= r * r1forall r r1 r2 : R, r <= 0 -> r1 <= r2 -> r * r2 <= r * r1r, r1, r2:RH:r <= 0H0:r1 <= r2- - r * r2 <= - - r * r1apply Ropp_le_contravar; auto with real. Qed. Hint Resolve Rmult_le_compat_neg_l: real.r, r1, r2:RH:r <= 0H0:r1 <= r2- (- r * r2) <= - (- r * r1)forall r r1 r2 : R, r <= 0 -> r1 <= r2 -> r * r1 >= r * r2intros; apply Rle_ge; auto with real. Qed. Hint Resolve Rmult_le_ge_compat_neg_l: real.forall r r1 r2 : R, r <= 0 -> r1 <= r2 -> r * r1 >= r * r2forall r r1 r2 : R, r < 0 -> r1 < r2 -> r * r1 > r * r2forall r r1 r2 : R, r < 0 -> r1 < r2 -> r * r1 > r * r2r, r1, r2:RH:r < 0H0:r1 < r2- - r * r1 > - - r * r2apply Ropp_lt_gt_contravar; auto with real. Qed.r, r1, r2:RH:r < 0H0:r1 < r2- (- r * r1) > - (- r * r2)
forall r r1 r2 : R, 0 < r -> r * r1 < r * r2 -> r1 < r2forall r r1 r2 : R, 0 < r -> r * r1 < r * r2 -> r1 < r2z, x, y:RH:0 < zH0:z * x < z * yx < yz, x, y:RH:0 < zH0:z * x < z * yEq0:x = yx < yz, x, y:RH:0 < zH0:z * x < z * yEq0:x > yx < ygeneralize (Rmult_lt_compat_l z y x H Eq0); intro; exfalso; generalize (Rlt_trans (z * x) (z * y) (z * x) H0 H1); intro; apply (Rlt_irrefl (z * x)); auto. Qed.z, x, y:RH:0 < zH0:z * x < z * yEq0:x > yx < yforall r r1 r2 : R, 0 < r -> r1 * r < r2 * r -> r1 < r2forall r r1 r2 : R, 0 < r -> r1 * r < r2 * r -> r1 < r2r, r1, r2:RH:0 < rH0:r1 * r < r2 * rr1 < r2r, r1, r2:RH:0 < rH0:r1 * r < r2 * r0 < rr, r1, r2:RH:0 < rH0:r1 * r < r2 * rr * r1 < r * r2now rewrite 2!(Rmult_comm r). Qed.r, r1, r2:RH:0 < rH0:r1 * r < r2 * rr * r1 < r * r2forall r r1 r2 : R, 0 < r -> r * r1 < r * r2 -> r1 < r2eauto using Rmult_lt_reg_l with rorders. Qed.forall r r1 r2 : R, 0 < r -> r * r1 < r * r2 -> r1 < r2forall r r1 r2 : R, 0 < r -> r * r1 <= r * r2 -> r1 <= r2forall r r1 r2 : R, 0 < r -> r * r1 <= r * r2 -> r1 <= r2z, x, y:RH:0 < zH0:z * x <= z * yz * x < z * y -> x <= yz, x, y:RH:0 < zH0:z * x <= z * yz * x = z * y -> x <= yz, x, y:RH:0 < zH0:z * x <= z * yH1:z * x < z * yx < yz, x, y:RH:0 < zH0:z * x <= z * yz * x = z * y -> x <= yz, x, y:RH:0 < zH0:z * x <= z * yz * x = z * y -> x <= yz, x, y:RH:0 < zH0:z * x <= z * yH1:z * x = z * y/ z * (z * x) <= yz, x, y:RH:0 < zH0:z * x <= z * yH1:z * x = z * y/ z * (z * x) = xz, x, y:RH:0 < zH0:z * x <= z * yH1:z * x = z * y/ z * (z * x) <= / z * (z * y)z, x, y:RH:0 < zH0:z * x <= z * yH1:z * x = z * y/ z * (z * y) = yz, x, y:RH:0 < zH0:z * x <= z * yH1:z * x = z * y/ z * (z * x) = xz, x, y:RH:0 < zH0:z * x <= z * yH1:z * x = z * y/ z * (z * y) = yz, x, y:RH:0 < zH0:z * x <= z * yH1:z * x = z * y/ z * (z * x) = xrewrite <- Rmult_assoc; rewrite Rinv_l; auto with real. Qed.z, x, y:RH:0 < zH0:z * x <= z * yH1:z * x = z * y/ z * (z * x) = xforall r r1 r2 : R, 0 < r -> r1 * r <= r2 * r -> r1 <= r2forall r r1 r2 : R, 0 < r -> r1 * r <= r2 * r -> r1 <= r2r, r1, r2:RH:0 < rH0:r1 * r <= r2 * rr1 <= r2r, r1, r2:RH:0 < rH0:r1 * r <= r2 * r0 < rr, r1, r2:RH:0 < rH0:r1 * r <= r2 * rr * r1 <= r * r2now rewrite 2!(Rmult_comm r). Qed. (*********************************************************)r, r1, r2:RH:0 < rH0:r1 * r <= r2 * rr * r1 <= r * r2
(*********************************************************)forall r1 r2 : R, r1 < r2 -> r1 - r2 < 0forall r1 r2 : R, r1 < r2 -> r1 - r2 < 0r1, r2:RH:r1 < r2r2 + (r1 - r2) < r2 + 0now rewrite Rplus_0_r. Qed. Hint Resolve Rlt_minus: real.r1, r2:RH:r1 < r2r1 < r2 + 0forall r1 r2 : R, r1 > r2 -> r1 - r2 > 0forall r1 r2 : R, r1 > r2 -> r1 - r2 > 0r1, r2:RH:r1 > r2r2 + 0 < r2 + (r1 - r2)now rewrite Rplus_0_r. Qed.r1, r2:RH:r1 > r2r2 + 0 < r1forall a b : R, a < b -> 0 < b - aintros a b; apply Rgt_minus. Qed. (**********)forall a b : R, a < b -> 0 < b - aforall r1 r2 : R, r1 <= r2 -> r1 - r2 <= 0destruct 1; unfold Rle; auto with real. Qed.forall r1 r2 : R, r1 <= r2 -> r1 - r2 <= 0forall r1 r2 : R, r1 >= r2 -> r1 - r2 >= 0forall r1 r2 : R, r1 >= r2 -> r1 - r2 >= 0r1, r2:RH:r1 > r2r1 - r2 >= 0r1, r2:RH:r1 = r2r1 - r2 >= 0right; auto using Rminus_diag_eq with rorders. Qed. (**********)r1, r2:RH:r1 = r2r1 - r2 >= 0forall r1 r2 : R, r1 - r2 < 0 -> r1 < r2forall r1 r2 : R, r1 - r2 < 0 -> r1 < r2r1, r2:RH:r1 - r2 < 0r1 - r2 + r2 < r2r1, r2:RH:r1 - r2 < 0r1 - r2 + r2 = r1ring. Qed.r1, r2:RH:r1 - r2 < 0r1 - r2 + r2 = r1forall r1 r2 : R, r1 - r2 > 0 -> r1 > r2forall r1 r2 : R, r1 - r2 > 0 -> r1 > r2r1, r2:RH:r1 - r2 > 0r1 > 0 + r2r1, r2:RH:r1 - r2 > 0r1 - r2 + r2 > 0 + r2r1, r2:RH:r1 - r2 > 0r1 - r2 + r2 = r1ring. Qed.r1, r2:RH:r1 - r2 > 0r1 - r2 + r2 = r1forall a b : R, 0 < b - a -> a < bintro; intro; apply Rminus_gt. Qed. (**********)forall a b : R, 0 < b - a -> a < bforall r1 r2 : R, r1 - r2 <= 0 -> r1 <= r2forall r1 r2 : R, r1 - r2 <= 0 -> r1 <= r2r1, r2:RH:r1 - r2 <= 0r1 - r2 + r2 <= r2r1, r2:RH:r1 - r2 <= 0r1 - r2 + r2 = r1ring. Qed.r1, r2:RH:r1 - r2 <= 0r1 - r2 + r2 = r1forall r1 r2 : R, r1 - r2 >= 0 -> r1 >= r2forall r1 r2 : R, r1 - r2 >= 0 -> r1 >= r2r1, r2:RH:r1 - r2 >= 0r1 >= 0 + r2r1, r2:RH:r1 - r2 >= 0r1 - r2 + r2 >= 0 + r2r1, r2:RH:r1 - r2 >= 0r1 - r2 + r2 = r1ring. Qed. (**********)r1, r2:RH:r1 - r2 >= 0r1 - r2 + r2 = r1forall r s : R, 0 <= r -> 0 < s -> r + s <> 0forall r s : R, 0 <= r -> 0 < s -> r + s <> 0rewrite Rplus_comm; replace 0 with (0 + 0); auto with real. Qed. Hint Immediate tech_Rplus: real. (*********************************************************)r, s:RH:0 <= rH0:0 < s0 < r + s
(*********************************************************)forall r : R, 0 <= r²forall r : R, 0 <= r²r:Rr0:r < 00 <= r * rr:Rr0:0 <= r0 <= r * rr:Rr0:r < 00 <= - r * - rr:Rr0:0 <= r0 <= r * rreplace 0 with (0 * r); auto with real. Qed. (***********)r:Rr0:0 <= r0 <= r * rforall r : R, r <> 0 -> 0 < r²forall r : R, r <> 0 -> 0 < r²r:RH:r <> 0H0:r < 00 < r * rr:RH:r <> 0H0:r > 00 < r * rr:RH:r <> 0H0:r < 00 < - r * - rr:RH:r <> 0H0:r > 00 < r * rreplace 0 with (0 * r); auto with real. Qed. Hint Resolve Rle_0_sqr Rlt_0_sqr: real. (***********)r:RH:r <> 0H0:r > 00 < r * rforall r1 r2 : R, r1² + r2² = 0 -> r1 = 0intros a b; intros; apply Rsqr_0_uniq; apply Rplus_eq_0_l with (Rsqr b); auto with real. Qed.forall r1 r2 : R, r1² + r2² = 0 -> r1 = 0forall r1 r2 : R, r1² + r2² = 0 -> r1 = 0 /\ r2 = 0forall r1 r2 : R, r1² + r2² = 0 -> r1 = 0 /\ r2 = 0a, b:RH:a² + b² = 0a = 0a, b:RH:a² + b² = 0b = 0a, b:RH:a² + b² = 0b = 0rewrite Rplus_comm; auto with real. Qed. (*********************************************************)a, b:RH:a² + b² = 0b² + a² = 0
(*********************************************************)0 < 10 < 1unfold Rsqr; auto with real. Qed. Hint Resolve Rlt_0_1: real.1² = 10 <= 10 <= 1exact Rlt_0_1. Qed. (*********************************************************)0 < 1
(*********************************************************)forall r : R, 0 < r -> 0 < / rforall r : R, 0 < r -> 0 < / rr:RH:0 < rH0:/ r <= 0Falser:RH:0 < rH0:/ r <= 01 <= 0replace 0 with (r * 0); auto with real. Qed. Hint Resolve Rinv_0_lt_compat: real. (*********)r:RH:0 < rH0:/ r <= 0r * / r <= 0forall r : R, r < 0 -> / r < 0forall r : R, r < 0 -> / r < 0r:RH:r < 0H0:0 <= / rFalser:RH:r < 0H0:0 <= / r1 <= 0replace 0 with (r * 0); auto with real. Qed. Hint Resolve Rinv_lt_0_compat: real. (*********)r:RH:r < 0H0:0 <= / rr * / r <= 0forall r1 r2 : R, 0 < r1 * r2 -> r1 < r2 -> / r2 < / r1forall r1 r2 : R, 0 < r1 * r2 -> r1 < r2 -> / r2 < / r1r1, r2:RH:0 < r1 * r2H0:r1 < r2r1 * r2 * / r2 < r1 * r2 * / r1r1, r2:RH:0 < r1 * r2H0:r1 < r2H1:r1 <> 0H2:r2 <> 0r1 * r2 * / r2 < r1 * r2 * / r1r1, r2:RH:0 < r1 * r2H0:r1 < r2H1:r1 <> 0H2:r2 <> 0r1 < r1 * r2 * / r1r1, r2:RH:0 < r1 * r2H0:r1 < r2H1:r1 <> 0H2:r2 <> 0r1 = r1 * r2 * / r2r1, r2:RH:0 < r1 * r2H0:r1 < r2H1:r1 <> 0H2:r2 <> 0r2 = r1 * r2 * / r1r1, r2:RH:0 < r1 * r2H0:r1 < r2H1:r1 <> 0H2:r2 <> 0r1 = r1 * r2 * / r2symmetry ; auto with real. Qed.r1, r2:RH:0 < r1 * r2H0:r1 < r2H1:r1 <> 0H2:r2 <> 0r1 = r1 * r2 * / r2forall r1 r2 : R, 1 <= r1 -> r1 < r2 -> / r2 < / r1forall r1 r2 : R, 1 <= r1 -> r1 < r2 -> / r2 < / r1x, y:RH':1 <= xH'0:x < y/ y < / xx, y:RH':1 <= xH'0:x < yLt0:0 < x/ y < / xx, y:RH':1 <= xH'0:x < yLt0:0 < xx * / y < x * / xx, y:RH':1 <= xH'0:x < yLt0:0 < xx * / y < 1x, y:RH':1 <= xH'0:x < yLt0:0 < x0 < yx, y:RH':1 <= xH'0:x < yLt0:0 < xy * (x * / y) < y * 1x, y:RH':1 <= xH'0:x < yLt0:0 < xy * (x * / y) < y * 1x, y:RH':1 <= xH'0:x < yLt0:0 < xy * (x * / y) = x -> y * (x * / y) < y * 1x, y:RH':1 <= xH'0:x < yLt0:0 < xy * (x * / y) = xx, y:RH':1 <= xH'0:x < yLt0:0 < xy * (x * / y) = xx, y:RH':1 <= xH'0:x < yLt0:0 < xy <> 0red; apply Rlt_trans with (r2 := x); auto with real. Qed. Hint Resolve Rinv_1_lt_contravar: real. (*********************************************************)x, y:RH':1 <= xH'0:x < yLt0:0 < xy > 0
(*********************************************************) (**********)forall r : R, 0 <= r -> 0 < r + 1forall r : R, 0 <= r -> 0 < r + 1r:RH:0 <= r0 < r + 1pattern 1 at 1; replace 1 with (0 + 1); auto with real. Qed. Hint Resolve Rle_lt_0_plus_1: real. (**********)r:RH:0 <= r1 <= r + 1forall r : R, r < r + 1forall r : R, r < r + 1pattern r at 1; replace r with (r + 0); auto with real. Qed. Hint Resolve Rlt_plus_1: real. (**********)r:Rr < r + 1forall r1 r2 : R, 0 < r2 -> r1 > r1 - r2forall r1 r2 : R, 0 < r2 -> r1 > r1 - r2pattern r1 at 2; replace r1 with (r1 + 0); auto with real. Qed. (*********************************************************)r1, r2:RH:0 < r2r1 + - r2 < r1
(*********************************************************) (**********)forall n : nat, INR (S n) = INR n + 1intro; case n; auto with real. Qed. (**********)forall n : nat, INR (S n) = INR n + 1forall n : nat, INR (1 + n) = INR 1 + INR nintro; simpl; case n; intros; auto with real. Qed. (**********)forall n : nat, INR (1 + n) = INR 1 + INR nforall n m : nat, INR (n + m) = INR n + INR mforall n m : nat, INR (n + m) = INR n + INR mm:natINR (0 + m) = INR 0 + INR mn, m:natHrecn:INR (n + m) = INR n + INR mINR (S n + m) = INR (S n) + INR mn, m:natHrecn:INR (n + m) = INR n + INR mINR (S n + m) = INR (S n) + INR mn, m:natHrecn:INR (n + m) = INR n + INR mINR (S (n + m)) = INR (S n) + INR mrewrite Hrecn; ring. Qed. Hint Resolve plus_INR: real. (**********)n, m:natHrecn:INR (n + m) = INR n + INR mINR (n + m) + 1 = INR n + 1 + INR mforall n m : nat, (m <= n)%nat -> INR (n - m) = INR n - INR mforall n m : nat, (m <= n)%nat -> INR (n - m) = INR n - INR mn, m:natle:(m <= n)%natforall p : nat, INR (p - 0) = INR p - INR 0n, m:natle:(m <= n)%natforall p q : nat, (p <= q)%nat -> INR (q - p) = INR q - INR p -> INR (S q - S p) = INR (S q) - INR (S p)n, m:natle:(m <= n)%natforall p q : nat, (p <= q)%nat -> INR (q - p) = INR q - INR p -> INR (S q - S p) = INR (S q) - INR (S p)rewrite H0; ring. Qed. Hint Resolve minus_INR: real. (*********)n, m:natle:(m <= n)%natp, q:natH:(p <= q)%natH0:INR (q - p) = INR q - INR pINR (q - p) = INR q + 1 - (INR p + 1)forall n m : nat, INR (n * m) = INR n * INR mforall n m : nat, INR (n * m) = INR n * INR mm:natINR (0 * m) = INR 0 * INR mn, m:natHrecn:INR (n * m) = INR n * INR mINR (S n * m) = INR (S n) * INR mn, m:natHrecn:INR (n * m) = INR n * INR mINR (S n * m) = INR (S n) * INR mrewrite plus_INR; rewrite Hrecn; ring. Qed. Hint Resolve mult_INR: real.n, m:natHrecn:INR (n * m) = INR n * INR mINR (m + n * m) = (INR n + 1) * INR mm, n:natINR (m ^ n) = pow (INR m) nnow induction n as [|n IHn];[ | simpl; rewrite mult_INR, IHn]. Qed. (*********)m, n:natINR (m ^ n) = pow (INR m) nforall n : nat, (0 < n)%nat -> 0 < INR nforall n : nat, (0 < n)%nat -> 0 < INR nrewrite S_INR; auto with real. Qed. Hint Resolve lt_0_INR: real.n:natH:(0 < n)%natm:natH0:(1 <= m)%natH1:0 < INR m0 < INR (S m)forall n m : nat, (n < m)%nat -> INR n < INR mforall n m : nat, (n < m)%nat -> INR n < INR mn, m:natH:(n < m)%natINR n < INR (S n)n, m:natH:(n < m)%natm0:natH0:(S n <= m0)%natH1:INR n < INR m0INR n < INR (S m0)rewrite S_INR; apply Rlt_trans with (INR m0); auto with real. Qed. Hint Resolve lt_INR: real.n, m:natH:(n < m)%natm0:natH0:(S n <= m0)%natH1:INR n < INR m0INR n < INR (S m0)forall n : nat, (1 < n)%nat -> 1 < INR napply lt_INR. Qed. Hint Resolve lt_1_INR: real. (**********)forall n : nat, (1 < n)%nat -> 1 < INR nforall p : positive, 0 < INR (Pos.to_nat p)forall p : positive, 0 < INR (Pos.to_nat p)p:positive(0 < Pos.to_nat p)%natapply Pos2Nat.is_pos. Qed. Hint Resolve pos_INR_nat_of_P: real. (**********)p:positive(0 < Pos.to_nat p)%natforall n : nat, 0 <= INR nforall n : nat, 0 <= INR nn:nat0 <= INR 0n:natforall n0 : nat, 0 <= INR (S n0)auto with arith real. Qed. Hint Resolve pos_INR: real.n:natforall n0 : nat, 0 <= INR (S n0)forall n m : nat, INR n < INR m -> (n < m)%natforall n m : nat, INR n < INR m -> (n < m)%natn, m:natINR n < INR m -> (n < m)%natm:natforall n : nat, INR n < INR m -> (n < m)%natn:natH:INR n < INR 0(n < 0)%natm:natIHm:forall n0 : nat, INR n0 < INR m -> (n0 < m)%natn:natH:INR n < INR (S m)(n < S m)%natn:natH:INR n < INR 0(n < 0)%natn:natH:INR n < INR 00 < 0apply pos_INR.n:natH:INR n < INR 00 <= INR nm:natIHm:forall n0 : nat, INR n0 < INR m -> (n0 < m)%natn:natH:INR n < INR (S m)(n < S m)%natm:natIHm:forall n : nat, INR n < INR m -> (n < m)%natH:INR 0 < INR (S m)(0 < S m)%natm:natIHm:forall n0 : nat, INR n0 < INR m -> (n0 < m)%natn:natH:INR (S n) < INR (S m)(S n < S m)%natm:natIHm:forall n0 : nat, INR n0 < INR m -> (n0 < m)%natn:natH:INR (S n) < INR (S m)(S n < S m)%natm:natIHm:forall n0 : nat, INR n0 < INR m -> (n0 < m)%natn:natH:INR (S n) < INR (S m)INR n < INR mapply Rplus_lt_reg_r with (1 := H). Qed. Hint Resolve INR_lt: real. (*********)m:natIHm:forall n0 : nat, INR n0 < INR m -> (n0 < m)%natn:natH:INR n + 1 < INR m + 1INR n < INR mforall n m : nat, (n <= m)%nat -> INR n <= INR mforall n m : nat, (n <= m)%nat -> INR n <= INR mn, m:natH:(n <= m)%natm0:natH0:(n <= m0)%natH1:INR n <= INR m0INR n <= INR (S m0)apply Rle_trans with (INR m0); auto with real. Qed. Hint Resolve le_INR: real. (**********)n, m:natH:(n <= m)%natm0:natH0:(n <= m0)%natH1:INR n <= INR m0INR n <= INR m0 + 1forall n : nat, INR n <> 0 -> n <> 0%natforall n : nat, INR n <> 0 -> n <> 0%natn:natH:INR n <> 0H1:n = 0%natFalserewrite H1; trivial. Qed. Hint Immediate INR_not_0: real. (**********)n:natH:INR n <> 0H1:n = 0%natINR n = 0forall n : nat, n <> 0%nat -> INR n <> 0forall n : nat, n <> 0%nat -> INR n <> 0n:nat0%nat <> 0%nat -> INR 0 <> 0n:natforall n0 : nat, S n0 <> 0%nat -> INR (S n0) <> 0n:natforall n0 : nat, S n0 <> 0%nat -> INR (S n0) <> 0apply Rgt_not_eq; red; auto with real. Qed. Hint Resolve not_0_INR: real.n, n0:natH:S n0 <> 0%natINR n0 + 1 <> 0forall n m : nat, n <> m -> INR n <> INR mforall n m : nat, n <> m -> INR n <> INR mn, m:natH:n <> mH1:(n <= m)%natINR n <> INR mn, m:natH:n <> mH1:(m < n)%natINR n <> INR mn, m:natH:n <> mH1:(n <= m)%natH2:(n < m)%natINR n <> INR mn, m:natH:n <> mH1:(n <= m)%natH2:n = mINR n <> INR mn, m:natH:n <> mH1:(m < n)%natINR n <> INR mn, m:natH:n <> mH1:(n <= m)%natH2:n = mINR n <> INR mn, m:natH:n <> mH1:(m < n)%natINR n <> INR mapply not_eq_sym; apply Rlt_dichotomy_converse; auto with real. Qed. Hint Resolve not_INR: real.n, m:natH:n <> mH1:(m < n)%natINR n <> INR mforall n m : nat, INR n = INR m -> n = mforall n m : nat, INR n = INR m -> n = mn, m:natHR:INR n = INR mn = mn, m:natHR:INR n = INR mH:n = mn = mn, m:natHR:INR n = INR mH:n <> mn = mnow apply not_INR in H. Qed. Hint Resolve INR_eq: real.n, m:natHR:INR n = INR mH:n <> mn = mforall n m : nat, INR n <= INR m -> (n <= m)%natforall n m : nat, INR n <= INR m -> (n <= m)%natn, m:natH:INR n <= INR mH0:INR n < INR m(n <= m)%natn, m:natH:INR n <= INR mH0:INR n = INR m(n <= m)%natgeneralize (INR_eq n m H0); intro; rewrite H1; auto. Qed. Hint Resolve INR_le: real.n, m:natH:INR n <= INR mH0:INR n = INR m(n <= m)%natforall n : nat, n <> 1%nat -> INR n <> 1forall n : nat, n <> 1%nat -> INR n <> 1apply not_INR. Qed. Hint Resolve not_1_INR: real. (*********************************************************)n:natn <> 1%nat -> INR n <> 1
(*********************************************************) (**********)forall n : Z, (0 <= n)%Z -> exists m : nat, n = Z.of_nat mintros z; idtac; apply Z_of_nat_complete; assumption. Qed.forall n : Z, (0 <= n)%Z -> exists m : nat, n = Z.of_nat mforall p : positive, INR (Pos.to_nat p) = IPR pforall p : positive, INR (Pos.to_nat p) = IPR pforall p : positive, 2 * INR (Pos.to_nat p) = IPR_2 pH:forall p : positive, 2 * INR (Pos.to_nat p) = IPR_2 pforall p : positive, INR (Pos.to_nat p) = IPR pp:positiveIHp:2 * INR (Pos.to_nat p) = IPR_2 p2 * INR (Pos.to_nat p~1) = (R1 + R1) * (R1 + IPR_2 p)p:positiveIHp:2 * INR (Pos.to_nat p) = IPR_2 p2 * INR (Pos.to_nat p~0) = (R1 + R1) * IPR_2 p2 * INR (Pos.to_nat 1) = R1 + R1H:forall p : positive, 2 * INR (Pos.to_nat p) = IPR_2 pforall p : positive, INR (Pos.to_nat p) = IPR pp:positiveIHp:2 * INR (Pos.to_nat p) = IPR_2 p2 * (INR 2 * INR (Pos.to_nat p) + 1) = (R1 + R1) * (R1 + 2 * INR (Pos.to_nat p))p:positiveIHp:2 * INR (Pos.to_nat p) = IPR_2 p2 * INR (Pos.to_nat p~0) = (R1 + R1) * IPR_2 p2 * INR (Pos.to_nat 1) = R1 + R1H:forall p : positive, 2 * INR (Pos.to_nat p) = IPR_2 pforall p : positive, INR (Pos.to_nat p) = IPR pp:positiveIHp:2 * INR (Pos.to_nat p) = IPR_2 p2 * INR (Pos.to_nat p~0) = (R1 + R1) * IPR_2 p2 * INR (Pos.to_nat 1) = R1 + R1H:forall p : positive, 2 * INR (Pos.to_nat p) = IPR_2 pforall p : positive, INR (Pos.to_nat p) = IPR p2 * INR (Pos.to_nat 1) = R1 + R1H:forall p : positive, 2 * INR (Pos.to_nat p) = IPR_2 pforall p : positive, INR (Pos.to_nat p) = IPR pH:forall p : positive, 2 * INR (Pos.to_nat p) = IPR_2 pforall p : positive, INR (Pos.to_nat p) = IPR pH:forall p0 : positive, 2 * INR (Pos.to_nat p0) = IPR_2 p0p:positiveINR (Pos.to_nat p~1) = R1 + IPR_2 pH:forall p0 : positive, 2 * INR (Pos.to_nat p0) = IPR_2 p0p:positiveINR (Pos.to_nat p~0) = IPR_2 pH:forall p : positive, 2 * INR (Pos.to_nat p) = IPR_2 pINR (Pos.to_nat 1) = R1H:forall p0 : positive, 2 * INR (Pos.to_nat p0) = IPR_2 p0p:positiveINR 2 * INR (Pos.to_nat p) + 1 = R1 + 2 * INR (Pos.to_nat p)H:forall p0 : positive, 2 * INR (Pos.to_nat p0) = IPR_2 p0p:positiveINR (Pos.to_nat p~0) = IPR_2 pH:forall p : positive, 2 * INR (Pos.to_nat p) = IPR_2 pINR (Pos.to_nat 1) = R1H:forall p0 : positive, 2 * INR (Pos.to_nat p0) = IPR_2 p0p:positiveINR (Pos.to_nat p~0) = IPR_2 pH:forall p : positive, 2 * INR (Pos.to_nat p) = IPR_2 pINR (Pos.to_nat 1) = R1easy. Qed. (**********)H:forall p : positive, 2 * INR (Pos.to_nat p) = IPR_2 pINR (Pos.to_nat 1) = R1forall n : nat, INR n = IZR (Z.of_nat n)forall n : nat, INR n = IZR (Z.of_nat n)INR 0 = IZR (Z.of_nat 0)n:natINR (S n) = IZR (Z.of_nat (S n))n:natINR (S n) = IZR (Z.of_nat (S n))n:natINR (S n) = IZR (Z.pos (Pos.of_succ_nat n))now rewrite <- INR_IPR, SuccNat2Pos.id_succ. Qed.n:natINR (S n) = IPR (Pos.of_succ_nat n)forall p q : positive, IZR (Z.pos p + Z.neg q) = IZR (Z.pos p) + IZR (Z.neg q)forall p q : positive, IZR (Z.pos p + Z.neg q) = IZR (Z.pos p) + IZR (Z.neg q)p, q:positiveIZR (Z.pos_sub p q) = IZR (Z.pos p) + IZR (Z.neg q)p, q:positiveIZR match (p ?= q)%positive with | Eq => 0 | Lt => Z.neg (q - p) | Gt => Z.pos (p - q) end = IZR (Z.pos p) + IZR (Z.neg q)p, q:positiveH:p = qR0 = IPR p + - IPR qp, q:positiveH:(p < q)%positive- IPR (q - p) = IPR p + - IPR qp, q:positiveH:(q < p)%positiveIPR (p - q) = IPR p + - IPR qq:positiveR0 = IPR q + - IPR qp, q:positiveH:(p < q)%positive- IPR (q - p) = IPR p + - IPR qp, q:positiveH:(q < p)%positiveIPR (p - q) = IPR p + - IPR qp, q:positiveH:(p < q)%positive- IPR (q - p) = IPR p + - IPR qp, q:positiveH:(q < p)%positiveIPR (p - q) = IPR p + - IPR qp, q:positiveH:(p < q)%positive- INR (Pos.to_nat q - Pos.to_nat p) = INR (Pos.to_nat p) + - INR (Pos.to_nat q)p, q:positiveH:(q < p)%positiveIPR (p - q) = IPR p + - IPR qp, q:positiveH:(p < q)%positive- (INR (Pos.to_nat q) - INR (Pos.to_nat p)) = INR (Pos.to_nat p) + - INR (Pos.to_nat q)p, q:positiveH:(q < p)%positiveIPR (p - q) = IPR p + - IPR qp, q:positiveH:(q < p)%positiveIPR (p - q) = IPR p + - IPR qp, q:positiveH:(q < p)%positiveINR (Pos.to_nat p - Pos.to_nat q) = INR (Pos.to_nat p) + - INR (Pos.to_nat q)ring. Qed. (**********)p, q:positiveH:(q < p)%positiveINR (Pos.to_nat p) - INR (Pos.to_nat q) = INR (Pos.to_nat p) + - INR (Pos.to_nat q)forall n m : Z, IZR (n + m) = IZR n + IZR mforall n m : Z, IZR (n + m) = IZR n + IZR mp, p0:positiveIZR (Z.pos p + Z.pos p0) = IZR (Z.pos p) + IZR (Z.pos p0)p, p0:positiveIZR (Z.pos p + Z.neg p0) = IZR (Z.pos p) + IZR (Z.neg p0)p, p0:positiveIZR (Z.neg p + Z.pos p0) = IZR (Z.neg p) + IZR (Z.pos p0)p, p0:positiveIZR (Z.neg p + Z.neg p0) = IZR (Z.neg p) + IZR (Z.neg p0)p, p0:positiveIZR (Z.pos (p + p0)) = IZR (Z.pos p) + IZR (Z.pos p0)p, p0:positiveIZR (Z.pos p + Z.neg p0) = IZR (Z.pos p) + IZR (Z.neg p0)p, p0:positiveIZR (Z.neg p + Z.pos p0) = IZR (Z.neg p) + IZR (Z.pos p0)p, p0:positiveIZR (Z.neg p + Z.neg p0) = IZR (Z.neg p) + IZR (Z.neg p0)p, p0:positiveIPR (p + p0) = IPR p + IPR p0p, p0:positiveIZR (Z.pos p + Z.neg p0) = IZR (Z.pos p) + IZR (Z.neg p0)p, p0:positiveIZR (Z.neg p + Z.pos p0) = IZR (Z.neg p) + IZR (Z.pos p0)p, p0:positiveIZR (Z.neg p + Z.neg p0) = IZR (Z.neg p) + IZR (Z.neg p0)p, p0:positiveINR (Pos.to_nat p + Pos.to_nat p0) = INR (Pos.to_nat p) + INR (Pos.to_nat p0)p, p0:positiveIZR (Z.pos p + Z.neg p0) = IZR (Z.pos p) + IZR (Z.neg p0)p, p0:positiveIZR (Z.neg p + Z.pos p0) = IZR (Z.neg p) + IZR (Z.pos p0)p, p0:positiveIZR (Z.neg p + Z.neg p0) = IZR (Z.neg p) + IZR (Z.neg p0)p, p0:positiveIZR (Z.pos p + Z.neg p0) = IZR (Z.pos p) + IZR (Z.neg p0)p, p0:positiveIZR (Z.neg p + Z.pos p0) = IZR (Z.neg p) + IZR (Z.pos p0)p, p0:positiveIZR (Z.neg p + Z.neg p0) = IZR (Z.neg p) + IZR (Z.neg p0)p, p0:positiveIZR (Z.neg p + Z.pos p0) = IZR (Z.neg p) + IZR (Z.pos p0)p, p0:positiveIZR (Z.neg p + Z.neg p0) = IZR (Z.neg p) + IZR (Z.neg p0)p, p0:positiveIZR (Z.neg p + Z.neg p0) = IZR (Z.neg p) + IZR (Z.neg p0)p, p0:positiveIZR (Z.neg (p + p0)) = IZR (Z.neg p) + IZR (Z.neg p0)p, p0:positive- IPR (p + p0) = - IPR p + - IPR p0apply Ropp_plus_distr. Qed. (**********)p, p0:positive- (INR (Pos.to_nat p) + INR (Pos.to_nat p0)) = - INR (Pos.to_nat p) + - INR (Pos.to_nat p0)forall n m : Z, IZR (n * m) = IZR n * IZR mintros z t; case z; case t; simpl; auto with real; unfold IZR; intros m n; rewrite <- 3!INR_IPR, Pos2Nat.inj_mul, mult_INR; ring. Qed.forall n m : Z, IZR (n * m) = IZR n * IZR mforall (z : Z) (n : nat), pow (IZR z) n = IZR (z ^ Z.of_nat n)forall (z : Z) (n : nat), pow (IZR z) n = IZR (z ^ Z.of_nat n)z:Zn:natIZR z * pow (IZR z) n = IZR (Z.pow_pos z (Pos.of_succ_nat n))z:Zn:natIZR z * pow (IZR z) n = IZR (Zpower_nat z (Pos.to_nat (Pos.of_succ_nat n)))z:Zn:natIZR z * pow (IZR z) n = IZR (Zpower_nat z (S n))z:Zn:natIZR z * pow (IZR z) n = IZR (z * nat_rect (fun _ : nat => Z) 1%Z (fun _ : nat => Z.mul z) n)z:Zn:natIZR z * pow (IZR z) n = IZR z * IZR (nat_rect (fun _ : nat => Z) 1%Z (fun _ : nat => Z.mul z) n)rewrite mult_IZR;ring[IHn]. Qed. (**********)z:Zn:natIHn:IZR z * pow (IZR z) n = IZR z * IZR (nat_rect (fun _ : nat => Z) 1%Z (fun _ : nat => Z.mul z) n)IZR z * (IZR z * pow (IZR z) n) = IZR z * IZR (z * nat_rect (fun _ : nat => Z) 1%Z (fun _ : nat => Z.mul z) n)forall n : Z, IZR (Z.succ n) = IZR n + 1intro; unfold Z.succ; apply plus_IZR. Qed. (**********)forall n : Z, IZR (Z.succ n) = IZR n + 1forall n : Z, IZR (- n) = - IZR nintros [|z|z]; unfold IZR; simpl; auto with real. Qed. Definition Ropp_Ropp_IZR := opp_IZR.forall n : Z, IZR (- n) = - IZR nforall n m : Z, IZR (n - m) = IZR n - IZR mforall n m : Z, IZR (n - m) = IZR n - IZR mn, m:ZIZR (n + - m) = IZR n + - IZR mapply plus_IZR. Qed. (**********)n, m:ZIZR (n + - m) = IZR n + IZR (- m)forall n m : Z, IZR n - IZR m = IZR (n - m)forall n m : Z, IZR n - IZR m = IZR (n - m)rewrite <- (Ropp_Ropp_IZR z2); symmetry ; apply plus_IZR. Qed. (**********)z1, z2:ZIZR z1 + - IZR z2 = IZR (z1 + - z2)forall n : Z, 0 < IZR n -> (0 < n)%Zforall n : Z, 0 < IZR n -> (0 < n)%Zz:ZH:0 < 0(0 < 0)%Zz:Zp:positiveH:0 < IZR (Z.pos p)(0 < Z.pos p)%Zz:Zp:positiveH:0 < IZR (Z.neg p)(0 < Z.neg p)%Zz:Zp:positiveH:0 < IZR (Z.pos p)(0 < Z.pos p)%Zz:Zp:positiveH:0 < IZR (Z.neg p)(0 < Z.neg p)%Zz:Zp:positiveH:0 < IZR (Z.neg p)(0 < Z.neg p)%Zz:Zp:positiveH:0 < IZR (Z.neg p)IZR (Z.neg p) <= 0z:Zp:positiveH:0 < IZR (Z.neg p)- IPR p <= R0auto with real. Qed. (**********)z:Zp:positiveH:0 < IZR (Z.neg p)- INR (Pos.to_nat p) <= R0forall n m : Z, IZR n < IZR m -> (n < m)%Zforall n m : Z, IZR n < IZR m -> (n < m)%Zz1, z2:ZH:IZR z1 < IZR z2(0 < z2 - z1)%Zz1, z2:ZH:IZR z1 < IZR z20 < IZR (z2 - z1)exact (Rgt_minus (IZR z2) (IZR z1) H). Qed. (**********)z1, z2:ZH:IZR z1 < IZR z20 < IZR z2 - IZR z1forall n : Z, IZR n = 0 -> n = 0%Zforall n : Z, IZR n = 0 -> n = 0%Zp:positiveH:IZR (Z.pos p) = 0Z.pos p = 0%Zp:positiveH:IZR (Z.neg p) = 0Z.neg p = 0%Zp:positiveH:IZR (Z.pos p) = 0IZR (Z.pos p) > 0p:positiveH:IZR (Z.neg p) = 0Z.neg p = 0%Zp:positiveH:IZR (Z.pos p) = 0IPR p > R0p:positiveH:IZR (Z.neg p) = 0Z.neg p = 0%Zp:positiveH:IZR (Z.pos p) = 0INR (Pos.to_nat p) > R0p:positiveH:IZR (Z.neg p) = 0Z.neg p = 0%Zp:positiveH:IZR (Z.neg p) = 0Z.neg p = 0%Zp:positiveH:IZR (Z.neg p) = 0IZR (Z.neg p) < 0p:positiveH:IZR (Z.neg p) = 0- IPR p < R0apply Ropp_lt_gt_0_contravar, lt_0_INR, Pos2Nat.is_pos. Qed. (**********)p:positiveH:IZR (Z.neg p) = 0- INR (Pos.to_nat p) < R0forall n m : Z, IZR n = IZR m -> n = mintros z1 z2 H; generalize (Rminus_diag_eq (IZR z1) (IZR z2) H); rewrite (Z_R_minus z1 z2); intro; generalize (eq_IZR_R0 (z1 - z2) H0); intro; omega. Qed. (**********)forall n m : Z, IZR n = IZR m -> n = mforall n : Z, n <> 0%Z -> IZR n <> 0forall n : Z, n <> 0%Z -> IZR n <> 0apply eq_IZR; auto. Qed. (*********)z:ZH:z <> 0%ZH0:IZR z = 0z = 0%Zforall n : Z, 0 <= IZR n -> (0 <= n)%Zforall n : Z, 0 <= IZR n -> (0 <= n)%Zz:ZH:0 < IZR z(0 <= z)%Zz:ZH:0 = IZR z(0 <= z)%Zrewrite (eq_IZR_R0 z); auto with zarith real. Qed. (**********)z:ZH:0 = IZR z(0 <= z)%Zforall n m : Z, IZR n <= IZR m -> (n <= m)%Zforall n m : Z, IZR n <= IZR m -> (n <= m)%Zz1, z2:ZH:IZR z1 < IZR z2(z1 <= z2)%Zz1, z2:ZH:IZR z1 = IZR z2(z1 <= z2)%Zz1, z2:ZH:IZR z1 < IZR z2(z1 < z2)%Zz1, z2:ZH:IZR z1 = IZR z2(z1 <= z2)%Zrewrite (eq_IZR z1 z2); auto with zarith real. Qed. (**********)z1, z2:ZH:IZR z1 = IZR z2(z1 <= z2)%Zforall n : Z, IZR n <= 1 -> (n <= 1)%Zforall n : Z, IZR n <= 1 -> (n <= 1)%Zapply le_IZR. Qed. (**********)n:ZIZR n <= 1 -> (n <= 1)%Zforall n m : Z, (n >= m)%Z -> IZR n >= IZR mforall n m : Z, (n >= m)%Z -> IZR n >= IZR mgeneralize (lt_IZR m n H0); intro; omega. Qed.m, n:ZH:(m >= n)%ZH0:IZR m < IZR nFalseforall n m : Z, (n <= m)%Z -> IZR n <= IZR mforall n m : Z, (n <= m)%Z -> IZR n <= IZR munfold Rgt in H0; generalize (lt_IZR n m H0); intro; omega. Qed.m, n:ZH:(m <= n)%ZH0:IZR m > IZR nFalseforall n m : Z, (n < m)%Z -> IZR n < IZR mforall n m : Z, (n < m)%Z -> IZR n < IZR mm, n:ZH:(m < n)%Z(m <= n)%Z -> IZR m < IZR nm, n:ZH:(m < n)%Z(m <= n)%Zm, n:ZH:(m < n)%ZH0:(m <= n)%ZH1:IZR m = IZR nIZR m < IZR nm, n:ZH:(m < n)%Z(m <= n)%Zomega. Qed.m, n:ZH:(m < n)%Z(m <= n)%Zforall z1 z2 : Z, z1 <> z2 -> IZR z1 <> IZR z2intros; red; intro; elim H; apply eq_IZR; assumption. Qed. Hint Extern 0 (IZR _ <= IZR _) => apply IZR_le, Zle_bool_imp_le, eq_refl : real. Hint Extern 0 (IZR _ >= IZR _) => apply Rle_ge, IZR_le, Zle_bool_imp_le, eq_refl : real. Hint Extern 0 (IZR _ < IZR _) => apply IZR_lt, eq_refl : real. Hint Extern 0 (IZR _ > IZR _) => apply IZR_lt, eq_refl : real. Hint Extern 0 (IZR _ <> IZR _) => apply IZR_neq, Zeq_bool_neq, eq_refl : real.forall z1 z2 : Z, z1 <> z2 -> IZR z1 <> IZR z2forall n : Z, -1 < IZR n < 1 -> n = 0%Zforall n : Z, -1 < IZR n < 1 -> n = 0%Zz:ZH1:-1 < IZR zH2:IZR z < 1z = 0%Zz:ZH1:-1 < IZR zH2:IZR z < 1(z <= 0)%Zz:ZH1:-1 < IZR zH2:IZR z < 1(0 <= z)%Zz:ZH1:-1 < IZR zH2:IZR z < 1(0 <= z)%Zapply Z.le_succ_l; apply lt_IZR; trivial. Qed.z:ZH1:-1 < IZR zH2:IZR z < 1(Z.succ (-1) <= z)%Zforall (r : R) (n m : Z), r < IZR n <= r + 1 -> r < IZR m <= r + 1 -> n = mforall (r : R) (n m : Z), r < IZR n <= r + 1 -> r < IZR m <= r + 1 -> n = mr:Rz, x:ZH1:r < IZR zH2:IZR z <= r + 1H3:r < IZR xH4:IZR x <= r + 1z = xr:Rz, x:ZH1:r < IZR zH2:IZR z <= r + 1H3:r < IZR xH4:IZR x <= r + 1(z - x)%Z = 0%Zr:Rz, x:ZH1:r < IZR zH2:IZR z <= r + 1H3:r < IZR xH4:IZR x <= r + 1-1 < IZR (z - x) < 1r:Rz, x:ZH1:r < IZR zH2:IZR z <= r + 1H3:r < IZR xH4:IZR x <= r + 1-1 < IZR z - IZR xr:Rz, x:ZH1:r < IZR zH2:IZR z <= r + 1H3:r < IZR xH4:IZR x <= r + 1IZR z - IZR x < 1r:Rz, x:ZH1:r < IZR zH2:IZR z <= r + 1H3:r < IZR xH4:IZR x <= r + 1r - (r + 1) < IZR z - IZR xr:Rz, x:ZH1:r < IZR zH2:IZR z <= r + 1H3:r < IZR xH4:IZR x <= r + 1r - (r + 1) = -1r:Rz, x:ZH1:r < IZR zH2:IZR z <= r + 1H3:r < IZR xH4:IZR x <= r + 1IZR z - IZR x < 1r:Rz, x:ZH1:r < IZR zH2:IZR z <= r + 1H3:r < IZR xH4:IZR x <= r + 1r - (r + 1) = -1r:Rz, x:ZH1:r < IZR zH2:IZR z <= r + 1H3:r < IZR xH4:IZR x <= r + 1IZR z - IZR x < 1r:Rz, x:ZH1:r < IZR zH2:IZR z <= r + 1H3:r < IZR xH4:IZR x <= r + 1IZR z - IZR x < 1r:Rz, x:ZH1:r < IZR zH2:IZR z <= r + 1H3:r < IZR xH4:IZR x <= r + 1IZR z - IZR x < r + 1 - rr:Rz, x:ZH1:r < IZR zH2:IZR z <= r + 1H3:r < IZR xH4:IZR x <= r + 1r + 1 - r = 1ring. Qed. (**********)r:Rz, x:ZH1:r < IZR zH2:IZR z <= r + 1H3:r < IZR xH4:IZR x <= r + 1r + 1 - r = 1forall (r : R) (n m : Z), r < IZR n -> IZR n <= r + 1 -> r < IZR m -> IZR m <= r + 1 -> n = mintros; apply one_IZR_r_R1 with r; auto. Qed. (**********)forall (r : R) (n m : Z), r < IZR n -> IZR n <= r + 1 -> r < IZR m -> IZR m <= r + 1 -> n = mforall (r : R) (n : Z), r < IZR n -> IZR n <= r + 1 -> (exists s : Z, s <> n /\ r < IZR s <= r + 1) -> Falseforall (r : R) (n : Z), r < IZR n -> IZR n <= r + 1 -> (exists s : Z, s <> n /\ r < IZR s <= r + 1) -> Falseapply H3; apply single_z_r_R1 with r; trivial. Qed. (*********)r:Rz:ZH1:r < IZR zH2:IZR z <= r + 1s:ZH3:s <> zH4:r < IZR sH5:IZR s <= r + 1Falseforall r1 r2 : R, 0 <= r1 -> 0 <= r2 -> 0 <= r1 * r2intros x y H H0; rewrite <- (Rmult_0_l x); rewrite <- (Rmult_comm x); apply (Rmult_le_compat_l x 0 y H H0). Qed.forall r1 r2 : R, 0 <= r1 -> 0 <= r2 -> 0 <= r1 * r2forall x y : R, 0 < x -> x <= y -> / y <= / xforall x y : R, 0 < x -> x <= y -> / y <= / xx, y:RH1:0 < xH2:x < y/ y <= / xx, y:RH1:0 < xH2:x = y/ y <= / xx, y:RH1:0 < xH2:x < y/ y < / xx, y:RH1:0 < xH2:x = y/ y <= / xx, y:RH1:0 < xH2:x < y0 < x * yx, y:RH1:0 < xH2:x = y/ y <= / xx, y:RH1:0 < xH2:x < y0 < yx, y:RH1:0 < xH2:x = y/ y <= / xx, y:RH1:0 < xH2:x = y/ y <= / xapply Rle_refl. Qed.x, y:RH1:0 < xH2:x = y/ y <= / yforall x y : R, 0 < x -> 0 < y -> x <= y -> / y <= / xforall x y : R, 0 < x -> 0 < y -> x <= y -> / y <= / xapply Rinv_le_contravar with (1 := H). Qed.x, y:RH:0 < xx <= y -> / y <= / xintros x y; unfold Rdiv; ring. Qed.forall x y : R, - x / y = - (x / y)forall r1 : R, 2 * r1 = r1 + r1intro; ring. Qed.forall r1 : R, 2 * r1 = r1 + r1forall r1 : R, r1 = r1 / 2 + r1 / 2forall r1 : R, r1 = r1 / 2 + r1 / 2now apply not_0_IZR. Qed.r1:R2 <> 0ring_morph 0 1 Rplus Rmult Rminus Ropp eq 0%Z 1%Z Z.add Z.mul Z.sub Z.opp Zeq_bool IZRring_morph 0 1 Rplus Rmult Rminus Ropp eq 0%Z 1%Z Z.add Z.mul Z.sub Z.opp Zeq_bool IZRforall x y : Z, IZR (x + y) = IZR x + IZR yforall x y : Z, IZR (x - y) = IZR x - IZR yforall x y : Z, IZR (x * y) = IZR x * IZR yforall x : Z, IZR (- x) = - IZR xforall x y : Z, Zeq_bool x y = true -> IZR x = IZR yforall x y : Z, IZR (x - y) = IZR x - IZR yforall x y : Z, IZR (x * y) = IZR x * IZR yforall x : Z, IZR (- x) = - IZR xforall x y : Z, Zeq_bool x y = true -> IZR x = IZR yforall x y : Z, IZR (x * y) = IZR x * IZR yforall x : Z, IZR (- x) = - IZR xforall x y : Z, Zeq_bool x y = true -> IZR x = IZR yforall x : Z, IZR (- x) = - IZR xforall x y : Z, Zeq_bool x y = true -> IZR x = IZR yforall x y : Z, Zeq_bool x y = true -> IZR x = IZR yx, y:ZH:Zeq_bool x y = trueIZR x = IZR ynow apply Zeq_bool_eq. Qed.x, y:ZH:Zeq_bool x y = truex = yx, y:ZIZR x = IZR y -> Zeq_bool x y = truex, y:ZIZR x = IZR y -> Zeq_bool x y = truex, y:ZH:IZR x = IZR yZeq_bool x y = truenow 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]). (*********************************************************)x, y:ZH:IZR x = IZR yx = y
(*********************************************************)forall r1 r2 r3 r4 : R, r3 >= 0 -> r2 > 0 -> r1 < r2 -> r3 < r4 -> r1 * r3 < r2 * r4intros; apply Rle_lt_trans with (r2 * r3); auto with real. Qed.forall r1 r2 r3 r4 : R, r3 >= 0 -> r2 > 0 -> r1 < r2 -> r3 < r4 -> r1 * r3 < r2 * r4forall r1 r2 : R, (forall eps : R, 0 < eps -> r1 <= r2 + eps) -> r1 <= r2forall r1 r2 : R, (forall eps : R, 0 < eps -> r1 <= r2 + eps) -> r1 <= r2x, y:RH:forall eps : R, 0 < eps -> x <= y + epsx <= yx, y:RH:forall eps : R, 0 < eps -> x <= y + epsH1:x <= yx <= yx, y:RH:forall eps : R, 0 < eps -> x <= y + epsH1:y < xx <= yx, y:RH:forall eps : R, 0 < eps -> x <= y + epsH1:y < xx <= yx, y:RH:forall eps : R, 0 < eps -> x <= y + epsH1:y < xx + x <= y + xx, y:RH:forall eps : R, 0 < eps -> x <= y + epsH1:y < xx + x <= 2 * (y + (x - y) * / 2)x, y:RH:forall eps : R, 0 < eps -> x <= y + epsH1:y < x2 * x <= 2 * (y + (x - y) * / 2)x, y:RH:forall eps : R, 0 < eps -> x <= y + epsH1:y < x0 <= 2x, y:RH:forall eps : R, 0 < eps -> x <= y + epsH1:y < xx <= y + (x - y) * / 2x, y:RH:forall eps : R, 0 < eps -> x <= y + epsH1:y < xx <= y + (x - y) * / 2x, y:RH:forall eps : R, 0 < eps -> x <= y + epsH1:y < x0 < (x - y) * / 2x, y:RH:forall eps : R, 0 < eps -> x <= y + epsH1:y < x0 < x - yx, y:RH:forall eps : R, 0 < eps -> x <= y + epsH1:y < x0 < / 2apply Rinv_0_lt_compat, Rlt_0_2. Qed. (**********)x, y:RH:forall eps : R, 0 < eps -> x <= y + epsH1:y < x0 < / 2forall E : R -> Prop, bound E -> (exists x : R, E x) -> exists m : R, is_lub E mintros; elim (completeness E H H0); intros; split with x; assumption. Qed.forall E : R -> Prop, bound E -> (exists x : R, E x) -> exists m : R, is_lub E mforall a b : R, 0 < a -> 0 < b -> 0 < a / bintros; apply Rmult_lt_0_compat;[|apply Rinv_0_lt_compat]; assumption. Qed.forall a b : R, 0 < a -> 0 < b -> 0 < a / bintros a b c; apply Rmult_plus_distr_r. Qed.forall a b c : R, (a + b) / c = a / c + b / cintros a b c; unfold Rminus, Rdiv; rewrite Rmult_plus_distr_r; ring. Qed. (* A test for equality function. *)forall a b c : R, (a - b) / c = a / c - b / cforall r1 r2 : R, {r1 = r2} + {r1 <> r2}forall r1 r2 : R, {r1 = r2} + {r1 <> r2}r1, r2:RH:r1 < r2{r1 = r2} + {r1 <> r2}r1, r2:Re:r1 = r2{r1 = r2} + {r1 <> r2}r1, r2:RH:r1 > r2{r1 = r2} + {r1 <> r2}right; red; intros ->; elim (Rlt_irrefl r2 H).r1, r2:RH:r1 < r2{r1 = r2} + {r1 <> r2}left; assumption.r1, r2:Re:r1 = r2{r1 = r2} + {r1 <> r2}right; red; intros ->; elim (Rlt_irrefl r2 H). Qed. (*********************************************************)r1, r2:RH:r1 > r2{r1 = r2} + {r1 <> r2}
(*********************************************************) Record nonnegreal : Type := mknonnegreal {nonneg :> R; cond_nonneg : 0 <= nonneg}. Record posreal : Type := mkposreal {pos :> R; cond_pos : 0 < pos}. Record nonposreal : Type := mknonposreal {nonpos :> R; cond_nonpos : nonpos <= 0}. Record negreal : Type := mknegreal {neg :> R; cond_neg : neg < 0}. Record nonzeroreal : Type := mknonzeroreal {nonzero :> R; cond_nonzero : nonzero <> 0}.
Compatibility
Notation prod_neq_R0 := Rmult_integral_contrapositive_currified (only parsing). Notation minus_Rgt := Rminus_gt (only parsing). Notation minus_Rge := Rminus_ge (only parsing). Notation plus_le_is_le := Rplus_le_reg_pos_r (only parsing). Notation plus_lt_is_lt := Rplus_lt_reg_pos_r (only parsing). Notation INR_lt_1 := lt_1_INR (only parsing). Notation lt_INR_0 := lt_0_INR (only parsing). Notation not_nm_INR := not_INR (only parsing). Notation INR_pos := pos_INR_nat_of_P (only parsing). Notation not_INR_O := INR_not_0 (only parsing). Notation not_O_INR := not_0_INR (only parsing). Notation not_O_IZR := not_0_IZR (only parsing). Notation le_O_IZR := le_0_IZR (only parsing). Notation lt_O_IZR := lt_0_IZR (only parsing).