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 Rbase. Require Export QArith_base.
Injection of rational numbers into real numbers.
Definition Q2R (x : Q) : R := (IZR (Qnum x) * / IZR (QDen x))%R.forall p : positive, IZR (Z.pos p) <> 0%Rforall p : positive, IZR (Z.pos p) <> 0%Rnow apply not_O_IZR. Qed. Hint Resolve IZR_nz Rmult_integral_contrapositive : core.p:positiveIZR (Z.pos p) <> 0%Rforall x y : Q, Q2R x = Q2R y -> x == yforall x y : Q, Q2R x = Q2R y -> x == yx1:Zx2:positivey1:Zy2:positiveH:(IZR x1 * / IZR (Z.pos x2))%R = (IZR y1 * / IZR (Z.pos y2))%R(x1 * Z.pos y2)%Z = (y1 * Z.pos x2)%Zx1:Zx2:positivey1:Zy2:positiveH:(IZR x1 * / IZR (Z.pos x2))%R = (IZR y1 * / IZR (Z.pos y2))%RIZR (x1 * Z.pos y2) = IZR (y1 * Z.pos x2)x1:Zx2:positivey1:Zy2:positiveH:(IZR x1 * / IZR (Z.pos x2))%R = (IZR y1 * / IZR (Z.pos y2))%R(IZR x1 * IZR (Z.pos y2))%R = (IZR y1 * IZR (Z.pos x2))%Rx1:Zx2:positivey1:Zy2:positiveX1:=IZR x1:RX2:=IZR (Z.pos x2):RH:(X1 * / X2)%R = (IZR y1 * / IZR (Z.pos y2))%RX2nz:X2 <> 0%R(X1 * IZR (Z.pos y2))%R = (IZR y1 * X2)%Rx1:Zx2:positivey1:Zy2:positiveX1:=IZR x1:RX2:=IZR (Z.pos x2):RY1:=IZR y1:RY2:=IZR (Z.pos y2):RH:(X1 * / X2)%R = (Y1 * / Y2)%RX2nz:X2 <> 0%RY2nz:Y2 <> 0%R(X1 * Y2)%R = (Y1 * X2)%Rx1:Zx2:positivey1:Zy2:positiveX1:=IZR x1:RX2:=IZR (Z.pos x2):RY1:=IZR y1:RY2:=IZR (Z.pos y2):RH:(X1 * / X2)%R = (Y1 * / Y2)%RX2nz:X2 <> 0%RY2nz:Y2 <> 0%R(X2 * X1 * / X2)%R = (X2 * (Y1 * / Y2))%Rx1:Zx2:positivey1:Zy2:positiveX1:=IZR x1:RX2:=IZR (Z.pos x2):RY1:=IZR y1:RY2:=IZR (Z.pos y2):RH:(X1 * / X2)%R = (Y1 * / Y2)%RX2nz:X2 <> 0%RY2nz:Y2 <> 0%RH0:(X2 * X1 * / X2)%R = (X2 * (Y1 * / Y2))%R(X1 * Y2)%R = (Y1 * X2)%Rrewrite Rinv_r_simpl_m in H0; auto; rewrite H0; field; auto. Qed.x1:Zx2:positivey1:Zy2:positiveX1:=IZR x1:RX2:=IZR (Z.pos x2):RY1:=IZR y1:RY2:=IZR (Z.pos y2):RH:(X1 * / X2)%R = (Y1 * / Y2)%RX2nz:X2 <> 0%RY2nz:Y2 <> 0%RH0:(X2 * X1 * / X2)%R = (X2 * (Y1 * / Y2))%R(X1 * Y2)%R = (Y1 * X2)%Rforall x y : Q, x == y -> Q2R x = Q2R yforall x y : Q, x == y -> Q2R x = Q2R yx1:Zx2:positivey1:Zy2:positiveH:(x1 * Z.pos y2)%Z = (y1 * Z.pos x2)%Z(IZR x1 * / IZR (Z.pos x2))%R = (IZR y1 * / IZR (Z.pos y2))%Rx1:Zx2:positivey1:Zy2:positiveH:(x1 * Z.pos y2)%Z = (y1 * Z.pos x2)%ZX1:=IZR x1:RX2:=IZR (Z.pos x2):RX2nz:X2 <> 0%R(X1 * / X2)%R = (IZR y1 * / IZR (Z.pos y2))%Rx1:Zx2:positivey1:Zy2:positiveH:(x1 * Z.pos y2)%Z = (y1 * Z.pos x2)%ZX1:=IZR x1:RX2:=IZR (Z.pos x2):RX2nz:X2 <> 0%RY1:=IZR y1:RY2:=IZR (Z.pos y2):RY2nz:Y2 <> 0%R(X1 * / X2)%R = (Y1 * / Y2)%Rx1:Zx2:positivey1:Zy2:positiveH:(x1 * Z.pos y2)%Z = (y1 * Z.pos x2)%ZX1:=IZR x1:RX2:=IZR (Z.pos x2):RX2nz:X2 <> 0%RY1:=IZR y1:RY2:=IZR (Z.pos y2):RY2nz:Y2 <> 0%R(X1 * Y2)%R = (Y1 * X2)%Rx1:Zx2:positivey1:Zy2:positiveH:(x1 * Z.pos y2)%Z = (y1 * Z.pos x2)%ZX1:=IZR x1:RX2:=IZR (Z.pos x2):RX2nz:X2 <> 0%RY1:=IZR y1:RY2:=IZR (Z.pos y2):RY2nz:Y2 <> 0%RH0:(X1 * Y2)%R = (Y1 * X2)%R(X1 * / X2)%R = (Y1 * / Y2)%Rx1:Zx2:positivey1:Zy2:positiveH:(x1 * Z.pos y2)%Z = (y1 * Z.pos x2)%ZX1:=IZR x1:RX2:=IZR (Z.pos x2):RX2nz:X2 <> 0%RY1:=IZR y1:RY2:=IZR (Z.pos y2):RY2nz:Y2 <> 0%RIZR (x1 * Z.pos y2) = IZR (y1 * Z.pos x2)x1:Zx2:positivey1:Zy2:positiveH:(x1 * Z.pos y2)%Z = (y1 * Z.pos x2)%ZX1:=IZR x1:RX2:=IZR (Z.pos x2):RX2nz:X2 <> 0%RY1:=IZR y1:RY2:=IZR (Z.pos y2):RY2nz:Y2 <> 0%RH0:(X1 * Y2)%R = (Y1 * X2)%R(X1 * / X2)%R = (Y1 * / Y2)%Rx1:Zx2:positivey1:Zy2:positiveH:(x1 * Z.pos y2)%Z = (y1 * Z.pos x2)%ZX1:=IZR x1:RX2:=IZR (Z.pos x2):RX2nz:X2 <> 0%RY1:=IZR y1:RY2:=IZR (Z.pos y2):RY2nz:Y2 <> 0%RH0:(X1 * Y2)%R = (Y1 * X2)%R(X1 * / X2)%R = (Y1 * / Y2)%Rx1:Zx2:positivey1:Zy2:positiveX1:=IZR x1:RX2:=IZR (Z.pos x2):RX2nz:X2 <> 0%RY1:=IZR y1:RY2:=IZR (Z.pos y2):RY2nz:Y2 <> 0%RH0:(X1 * Y2)%R = (Y1 * X2)%R(X1 * / X2)%R = (Y1 * / Y2)%Rrewrite H0; ring. Qed.x1:Zx2:positivey1:Zy2:positiveX1:=IZR x1:RX2:=IZR (Z.pos x2):RX2nz:X2 <> 0%RY1:=IZR y1:RY2:=IZR (Z.pos y2):RY2nz:Y2 <> 0%RH0:(X1 * Y2)%R = (Y1 * X2)%R(X1 * Y2)%R = (X2 * Y1)%Rforall x y : Q, (Q2R x <= Q2R y)%R -> x <= yforall x y : Q, (Q2R x <= Q2R y)%R -> x <= yx1:Zx2:positivey1:Zy2:positiveH:(IZR x1 * / IZR (Z.pos x2) <= IZR y1 * / IZR (Z.pos y2))%R(x1 * Z.pos y2 <= y1 * Z.pos x2)%Zx1:Zx2:positivey1:Zy2:positiveH:(IZR x1 * / IZR (Z.pos x2) <= IZR y1 * / IZR (Z.pos y2))%R(IZR (x1 * Z.pos y2) <= IZR (y1 * Z.pos x2))%Rx1:Zx2:positivey1:Zy2:positiveH:(IZR x1 * / IZR (Z.pos x2) <= IZR y1 * / IZR (Z.pos y2))%R(IZR x1 * IZR (Z.pos y2) <= IZR y1 * IZR (Z.pos x2))%Rx1:Zx2:positivey1:Zy2:positiveX1:=IZR x1:RX2:=IZR (Z.pos x2):RH:(X1 * / X2 <= IZR y1 * / IZR (Z.pos y2))%RX2nz:X2 <> 0%R(X1 * IZR (Z.pos y2) <= IZR y1 * X2)%Rx1:Zx2:positivey1:Zy2:positiveX1:=IZR x1:RX2:=IZR (Z.pos x2):RY1:=IZR y1:RY2:=IZR (Z.pos y2):RH:(X1 * / X2 <= Y1 * / Y2)%RX2nz:X2 <> 0%RY2nz:Y2 <> 0%R(X1 * Y2 <= Y1 * X2)%Rx1:Zx2:positivey1:Zy2:positiveX1:=IZR x1:RX2:=IZR (Z.pos x2):RY1:=IZR y1:RY2:=IZR (Z.pos y2):RH:(X1 * / X2 <= Y1 * / Y2)%RX2nz:X2 <> 0%RY2nz:Y2 <> 0%R(X1 * / X2 * (X2 * Y2) <= Y1 * X2)%Rx1:Zx2:positivey1:Zy2:positiveX1:=IZR x1:RX2:=IZR (Z.pos x2):RY1:=IZR y1:RY2:=IZR (Z.pos y2):RH:(X1 * / X2 <= Y1 * / Y2)%RX2nz:X2 <> 0%RY2nz:Y2 <> 0%R(X1 * / X2 * (X2 * Y2) <= Y1 * / Y2 * (X2 * Y2))%Rx1:Zx2:positivey1:Zy2:positiveX1:=IZR x1:RX2:=IZR (Z.pos x2):RY1:=IZR y1:RY2:=IZR (Z.pos y2):RH:(X1 * / X2 <= Y1 * / Y2)%RX2nz:X2 <> 0%RY2nz:Y2 <> 0%R(0 <= X2 * Y2)%Rx1:Zx2:positivey1:Zy2:positiveX1:=IZR x1:RX2:=IZR (Z.pos x2):RY1:=IZR y1:RY2:=IZR (Z.pos y2):RH:(X1 * / X2 <= Y1 * / Y2)%RX2nz:X2 <> 0%RY2nz:Y2 <> 0%R(0 <= X2)%Rx1:Zx2:positivey1:Zy2:positiveX1:=IZR x1:RX2:=IZR (Z.pos x2):RY1:=IZR y1:RY2:=IZR (Z.pos y2):RH:(X1 * / X2 <= Y1 * / Y2)%RX2nz:X2 <> 0%RY2nz:Y2 <> 0%R(0 <= Y2)%Rnow apply IZR_le. Qed.x1:Zx2:positivey1:Zy2:positiveX1:=IZR x1:RX2:=IZR (Z.pos x2):RY1:=IZR y1:RY2:=IZR (Z.pos y2):RH:(X1 * / X2 <= Y1 * / Y2)%RX2nz:X2 <> 0%RY2nz:Y2 <> 0%R(0 <= Y2)%Rforall x y : Q, x <= y -> (Q2R x <= Q2R y)%Rforall x y : Q, x <= y -> (Q2R x <= Q2R y)%Rx1:Zx2:positivey1:Zy2:positiveH:(x1 * Z.pos y2 <= y1 * Z.pos x2)%Z(IZR x1 * / IZR (Z.pos x2) <= IZR y1 * / IZR (Z.pos y2))%Rx1:Zx2:positivey1:Zy2:positiveH:(x1 * Z.pos y2 <= y1 * Z.pos x2)%ZX1:=IZR x1:RX2:=IZR (Z.pos x2):RX2nz:X2 <> 0%R(X1 * / X2 <= IZR y1 * / IZR (Z.pos y2))%Rx1:Zx2:positivey1:Zy2:positiveH:(x1 * Z.pos y2 <= y1 * Z.pos x2)%ZX1:=IZR x1:RX2:=IZR (Z.pos x2):RX2nz:X2 <> 0%RY1:=IZR y1:RY2:=IZR (Z.pos y2):RY2nz:Y2 <> 0%R(X1 * / X2 <= Y1 * / Y2)%Rx1:Zx2:positivey1:Zy2:positiveH:(x1 * Z.pos y2 <= y1 * Z.pos x2)%ZX1:=IZR x1:RX2:=IZR (Z.pos x2):RX2nz:X2 <> 0%RY1:=IZR y1:RY2:=IZR (Z.pos y2):RY2nz:Y2 <> 0%R(X1 * Y2 <= Y1 * X2)%Rx1:Zx2:positivey1:Zy2:positiveH:(x1 * Z.pos y2 <= y1 * Z.pos x2)%ZX1:=IZR x1:RX2:=IZR (Z.pos x2):RX2nz:X2 <> 0%RY1:=IZR y1:RY2:=IZR (Z.pos y2):RY2nz:Y2 <> 0%RH0:(X1 * Y2 <= Y1 * X2)%R(X1 * / X2 <= Y1 * / Y2)%Rx1:Zx2:positivey1:Zy2:positiveH:(x1 * Z.pos y2 <= y1 * Z.pos x2)%ZX1:=IZR x1:RX2:=IZR (Z.pos x2):RX2nz:X2 <> 0%RY1:=IZR y1:RY2:=IZR (Z.pos y2):RY2nz:Y2 <> 0%R(IZR (x1 * Z.pos y2) <= IZR (y1 * Z.pos x2))%Rx1:Zx2:positivey1:Zy2:positiveH:(x1 * Z.pos y2 <= y1 * Z.pos x2)%ZX1:=IZR x1:RX2:=IZR (Z.pos x2):RX2nz:X2 <> 0%RY1:=IZR y1:RY2:=IZR (Z.pos y2):RY2nz:Y2 <> 0%RH0:(X1 * Y2 <= Y1 * X2)%R(X1 * / X2 <= Y1 * / Y2)%Rx1:Zx2:positivey1:Zy2:positiveH:(x1 * Z.pos y2 <= y1 * Z.pos x2)%ZX1:=IZR x1:RX2:=IZR (Z.pos x2):RX2nz:X2 <> 0%RY1:=IZR y1:RY2:=IZR (Z.pos y2):RY2nz:Y2 <> 0%RH0:(X1 * Y2 <= Y1 * X2)%R(X1 * / X2 <= Y1 * / Y2)%Rx1:Zx2:positivey1:Zy2:positiveX1:=IZR x1:RX2:=IZR (Z.pos x2):RX2nz:X2 <> 0%RY1:=IZR y1:RY2:=IZR (Z.pos y2):RY2nz:Y2 <> 0%RH0:(X1 * Y2 <= Y1 * X2)%R(X1 * / X2 <= Y1 * / Y2)%Rx1:Zx2:positivey1:Zy2:positiveX1:=IZR x1:RX2:=IZR (Z.pos x2):RX2nz:X2 <> 0%RY1:=IZR y1:RY2:=IZR (Z.pos y2):RY2nz:Y2 <> 0%RH0:(X1 * Y2 <= Y1 * X2)%R(X1 * Y2 * (/ X2 * / Y2) <= Y1 * / Y2)%Rx1:Zx2:positivey1:Zy2:positiveX1:=IZR x1:RX2:=IZR (Z.pos x2):RX2nz:X2 <> 0%RY1:=IZR y1:RY2:=IZR (Z.pos y2):RY2nz:Y2 <> 0%RH0:(X1 * Y2 <= Y1 * X2)%R(X1 * Y2 * (/ X2 * / Y2) <= Y1 * X2 * (/ X2 * / Y2))%Rx1:Zx2:positivey1:Zy2:positiveX1:=IZR x1:RX2:=IZR (Z.pos x2):RX2nz:X2 <> 0%RY1:=IZR y1:RY2:=IZR (Z.pos y2):RY2nz:Y2 <> 0%RH0:(X1 * Y2 <= Y1 * X2)%R(0 <= / X2 * / Y2)%Rx1:Zx2:positivey1:Zy2:positiveX1:=IZR x1:RX2:=IZR (Z.pos x2):RX2nz:X2 <> 0%RY1:=IZR y1:RY2:=IZR (Z.pos y2):RY2nz:Y2 <> 0%RH0:(X1 * Y2 <= Y1 * X2)%R(0 < X2)%Rx1:Zx2:positivey1:Zy2:positiveX1:=IZR x1:RX2:=IZR (Z.pos x2):RX2nz:X2 <> 0%RY1:=IZR y1:RY2:=IZR (Z.pos y2):RY2nz:Y2 <> 0%RH0:(X1 * Y2 <= Y1 * X2)%R(0 < Y2)%Rnow apply IZR_lt. Qed.x1:Zx2:positivey1:Zy2:positiveX1:=IZR x1:RX2:=IZR (Z.pos x2):RX2nz:X2 <> 0%RY1:=IZR y1:RY2:=IZR (Z.pos y2):RY2nz:Y2 <> 0%RH0:(X1 * Y2 <= Y1 * X2)%R(0 < Y2)%Rforall x y : Q, (Q2R x < Q2R y)%R -> x < yforall x y : Q, (Q2R x < Q2R y)%R -> x < yx1:Zx2:positivey1:Zy2:positiveH:(IZR x1 * / IZR (Z.pos x2) < IZR y1 * / IZR (Z.pos y2))%R(x1 * Z.pos y2 < y1 * Z.pos x2)%Zx1:Zx2:positivey1:Zy2:positiveH:(IZR x1 * / IZR (Z.pos x2) < IZR y1 * / IZR (Z.pos y2))%R(IZR (x1 * Z.pos y2) < IZR (y1 * Z.pos x2))%Rx1:Zx2:positivey1:Zy2:positiveH:(IZR x1 * / IZR (Z.pos x2) < IZR y1 * / IZR (Z.pos y2))%R(IZR x1 * IZR (Z.pos y2) < IZR y1 * IZR (Z.pos x2))%Rx1:Zx2:positivey1:Zy2:positiveX1:=IZR x1:RX2:=IZR (Z.pos x2):RH:(X1 * / X2 < IZR y1 * / IZR (Z.pos y2))%RX2nz:X2 <> 0%R(X1 * IZR (Z.pos y2) < IZR y1 * X2)%Rx1:Zx2:positivey1:Zy2:positiveX1:=IZR x1:RX2:=IZR (Z.pos x2):RY1:=IZR y1:RY2:=IZR (Z.pos y2):RH:(X1 * / X2 < Y1 * / Y2)%RX2nz:X2 <> 0%RY2nz:Y2 <> 0%R(X1 * Y2 < Y1 * X2)%Rx1:Zx2:positivey1:Zy2:positiveX1:=IZR x1:RX2:=IZR (Z.pos x2):RY1:=IZR y1:RY2:=IZR (Z.pos y2):RH:(X1 * / X2 < Y1 * / Y2)%RX2nz:X2 <> 0%RY2nz:Y2 <> 0%R(X1 * / X2 * (X2 * Y2) < Y1 * X2)%Rx1:Zx2:positivey1:Zy2:positiveX1:=IZR x1:RX2:=IZR (Z.pos x2):RY1:=IZR y1:RY2:=IZR (Z.pos y2):RH:(X1 * / X2 < Y1 * / Y2)%RX2nz:X2 <> 0%RY2nz:Y2 <> 0%R(X1 * / X2 * (X2 * Y2) < Y1 * / Y2 * (X2 * Y2))%Rx1:Zx2:positivey1:Zy2:positiveX1:=IZR x1:RX2:=IZR (Z.pos x2):RY1:=IZR y1:RY2:=IZR (Z.pos y2):RH:(X1 * / X2 < Y1 * / Y2)%RX2nz:X2 <> 0%RY2nz:Y2 <> 0%R(0 < X2 * Y2)%Rx1:Zx2:positivey1:Zy2:positiveX1:=IZR x1:RX2:=IZR (Z.pos x2):RY1:=IZR y1:RY2:=IZR (Z.pos y2):RH:(X1 * / X2 < Y1 * / Y2)%RX2nz:X2 <> 0%RY2nz:Y2 <> 0%R(0 < X2)%Rx1:Zx2:positivey1:Zy2:positiveX1:=IZR x1:RX2:=IZR (Z.pos x2):RY1:=IZR y1:RY2:=IZR (Z.pos y2):RH:(X1 * / X2 < Y1 * / Y2)%RX2nz:X2 <> 0%RY2nz:Y2 <> 0%R(0 < Y2)%Rnow apply IZR_lt. Qed.x1:Zx2:positivey1:Zy2:positiveX1:=IZR x1:RX2:=IZR (Z.pos x2):RY1:=IZR y1:RY2:=IZR (Z.pos y2):RH:(X1 * / X2 < Y1 * / Y2)%RX2nz:X2 <> 0%RY2nz:Y2 <> 0%R(0 < Y2)%Rforall x y : Q, x < y -> (Q2R x < Q2R y)%Rforall x y : Q, x < y -> (Q2R x < Q2R y)%Rx1:Zx2:positivey1:Zy2:positiveH:(x1 * Z.pos y2 < y1 * Z.pos x2)%Z(IZR x1 * / IZR (Z.pos x2) < IZR y1 * / IZR (Z.pos y2))%Rx1:Zx2:positivey1:Zy2:positiveH:(x1 * Z.pos y2 < y1 * Z.pos x2)%ZX1:=IZR x1:RX2:=IZR (Z.pos x2):RX2nz:X2 <> 0%R(X1 * / X2 < IZR y1 * / IZR (Z.pos y2))%Rx1:Zx2:positivey1:Zy2:positiveH:(x1 * Z.pos y2 < y1 * Z.pos x2)%ZX1:=IZR x1:RX2:=IZR (Z.pos x2):RX2nz:X2 <> 0%RY1:=IZR y1:RY2:=IZR (Z.pos y2):RY2nz:Y2 <> 0%R(X1 * / X2 < Y1 * / Y2)%Rx1:Zx2:positivey1:Zy2:positiveH:(x1 * Z.pos y2 < y1 * Z.pos x2)%ZX1:=IZR x1:RX2:=IZR (Z.pos x2):RX2nz:X2 <> 0%RY1:=IZR y1:RY2:=IZR (Z.pos y2):RY2nz:Y2 <> 0%R(X1 * Y2 < Y1 * X2)%Rx1:Zx2:positivey1:Zy2:positiveH:(x1 * Z.pos y2 < y1 * Z.pos x2)%ZX1:=IZR x1:RX2:=IZR (Z.pos x2):RX2nz:X2 <> 0%RY1:=IZR y1:RY2:=IZR (Z.pos y2):RY2nz:Y2 <> 0%RH0:(X1 * Y2 < Y1 * X2)%R(X1 * / X2 < Y1 * / Y2)%Rx1:Zx2:positivey1:Zy2:positiveH:(x1 * Z.pos y2 < y1 * Z.pos x2)%ZX1:=IZR x1:RX2:=IZR (Z.pos x2):RX2nz:X2 <> 0%RY1:=IZR y1:RY2:=IZR (Z.pos y2):RY2nz:Y2 <> 0%R(IZR (x1 * Z.pos y2) < IZR (y1 * Z.pos x2))%Rx1:Zx2:positivey1:Zy2:positiveH:(x1 * Z.pos y2 < y1 * Z.pos x2)%ZX1:=IZR x1:RX2:=IZR (Z.pos x2):RX2nz:X2 <> 0%RY1:=IZR y1:RY2:=IZR (Z.pos y2):RY2nz:Y2 <> 0%RH0:(X1 * Y2 < Y1 * X2)%R(X1 * / X2 < Y1 * / Y2)%Rx1:Zx2:positivey1:Zy2:positiveH:(x1 * Z.pos y2 < y1 * Z.pos x2)%ZX1:=IZR x1:RX2:=IZR (Z.pos x2):RX2nz:X2 <> 0%RY1:=IZR y1:RY2:=IZR (Z.pos y2):RY2nz:Y2 <> 0%RH0:(X1 * Y2 < Y1 * X2)%R(X1 * / X2 < Y1 * / Y2)%Rx1:Zx2:positivey1:Zy2:positiveX1:=IZR x1:RX2:=IZR (Z.pos x2):RX2nz:X2 <> 0%RY1:=IZR y1:RY2:=IZR (Z.pos y2):RY2nz:Y2 <> 0%RH0:(X1 * Y2 < Y1 * X2)%R(X1 * / X2 < Y1 * / Y2)%Rx1:Zx2:positivey1:Zy2:positiveX1:=IZR x1:RX2:=IZR (Z.pos x2):RX2nz:X2 <> 0%RY1:=IZR y1:RY2:=IZR (Z.pos y2):RY2nz:Y2 <> 0%RH0:(X1 * Y2 < Y1 * X2)%R(X1 * Y2 * (/ X2 * / Y2) < Y1 * / Y2)%Rx1:Zx2:positivey1:Zy2:positiveX1:=IZR x1:RX2:=IZR (Z.pos x2):RX2nz:X2 <> 0%RY1:=IZR y1:RY2:=IZR (Z.pos y2):RY2nz:Y2 <> 0%RH0:(X1 * Y2 < Y1 * X2)%R(X1 * Y2 * (/ X2 * / Y2) < Y1 * X2 * (/ X2 * / Y2))%Rx1:Zx2:positivey1:Zy2:positiveX1:=IZR x1:RX2:=IZR (Z.pos x2):RX2nz:X2 <> 0%RY1:=IZR y1:RY2:=IZR (Z.pos y2):RY2nz:Y2 <> 0%RH0:(X1 * Y2 < Y1 * X2)%R(0 < / X2 * / Y2)%Rx1:Zx2:positivey1:Zy2:positiveX1:=IZR x1:RX2:=IZR (Z.pos x2):RX2nz:X2 <> 0%RY1:=IZR y1:RY2:=IZR (Z.pos y2):RY2nz:Y2 <> 0%RH0:(X1 * Y2 < Y1 * X2)%R(0 < X2)%Rx1:Zx2:positivey1:Zy2:positiveX1:=IZR x1:RX2:=IZR (Z.pos x2):RX2nz:X2 <> 0%RY1:=IZR y1:RY2:=IZR (Z.pos y2):RY2nz:Y2 <> 0%RH0:(X1 * Y2 < Y1 * X2)%R(0 < Y2)%Rnow apply IZR_lt. Qed.x1:Zx2:positivey1:Zy2:positiveX1:=IZR x1:RX2:=IZR (Z.pos x2):RX2nz:X2 <> 0%RY1:=IZR y1:RY2:=IZR (Z.pos y2):RY2nz:Y2 <> 0%RH0:(X1 * Y2 < Y1 * X2)%R(0 < Y2)%Rforall x y : Q, Q2R (x + y) = (Q2R x + Q2R y)%Rforall x y : Q, Q2R (x + y) = (Q2R x + Q2R y)%Rx1:Zx2:positivey1:Zy2:positive(IZR (x1 * Z.pos y2 + y1 * Z.pos x2) * / IZR (Z.pos (x2 * y2)))%R = (IZR x1 * / IZR (Z.pos x2) + IZR y1 * / IZR (Z.pos y2))%Rx1:Zx2:positivey1:Zy2:positive(IZR (x1 * Z.pos y2 + y1 * Z.pos x2) * / IZR (Z.pos x2 * Z.pos y2))%R = (IZR x1 * / IZR (Z.pos x2) + IZR y1 * / IZR (Z.pos y2))%Rx1:Zx2:positivey1:Zy2:positive((IZR (x1 * Z.pos y2) + IZR (y1 * Z.pos x2)) * / IZR (Z.pos x2 * Z.pos y2))%R = (IZR x1 * / IZR (Z.pos x2) + IZR y1 * / IZR (Z.pos y2))%Rfield; auto. Qed.x1:Zx2:positivey1:Zy2:positive((IZR x1 * IZR (Z.pos y2) + IZR y1 * IZR (Z.pos x2)) * / (IZR (Z.pos x2) * IZR (Z.pos y2)))%R = (IZR x1 * / IZR (Z.pos x2) + IZR y1 * / IZR (Z.pos y2))%Rforall x y : Q, Q2R (x * y) = (Q2R x * Q2R y)%Rforall x y : Q, Q2R (x * y) = (Q2R x * Q2R y)%Rx1:Zx2:positivey1:Zy2:positive(IZR (x1 * y1) * / IZR (Z.pos (x2 * y2)))%R = (IZR x1 * / IZR (Z.pos x2) * (IZR y1 * / IZR (Z.pos y2)))%Rx1:Zx2:positivey1:Zy2:positive(IZR (x1 * y1) * / IZR (Z.pos x2 * Z.pos y2))%R = (IZR x1 * / IZR (Z.pos x2) * (IZR y1 * / IZR (Z.pos y2)))%Rfield; auto. Qed.x1:Zx2:positivey1:Zy2:positive(IZR x1 * IZR y1 * / (IZR (Z.pos x2) * IZR (Z.pos y2)))%R = (IZR x1 * / IZR (Z.pos x2) * (IZR y1 * / IZR (Z.pos y2)))%Rforall x : Q, Q2R (- x) = (- Q2R x)%Rforall x : Q, Q2R (- x) = (- Q2R x)%Rx1:Zx2:positive(IZR (- x1) * / IZR (Z.pos x2))%R = (- (IZR x1 * / IZR (Z.pos x2)))%Rfield; auto. Qed.x1:Zx2:positive(- IZR x1 * / IZR (Z.pos x2))%R = (- (IZR x1 * / IZR (Z.pos x2)))%Rforall x y : Q, Q2R (x - y) = (Q2R x - Q2R y)%Runfold Qminus; intros; rewrite Q2R_plus; rewrite Q2R_opp; auto. Qed.forall x y : Q, Q2R (x - y) = (Q2R x - Q2R y)%Rforall x : Q, ~ x == 0 -> Q2R (/ x) = (/ Q2R x)%Rforall x : Q, ~ x == 0 -> Q2R (/ x) = (/ Q2R x)%Rx1:Zx2:positive(Qnum (x1 # x2) * QDen 0)%Z <> (Qnum 0 * QDen (x1 # x2))%Z -> (IZR (Qnum match Qnum (x1 # x2) with | 0%Z => 0 | Z.pos p => QDen (x1 # x2) # p | Z.neg p => Z.neg (Qden (x1 # x2)) # p end) * / IZR (QDen match Qnum (x1 # x2) with | 0%Z => 0 | Z.pos p => QDen (x1 # x2) # p | Z.neg p => Z.neg (Qden (x1 # x2)) # p end))%R = (/ (IZR (Qnum (x1 # x2)) * / IZR (QDen (x1 # x2))))%Rx1:Zx2:positive(0 * 1)%Z <> (0 * Z.pos x2)%Z -> (0 * / 1)%R = (/ (0 * / IZR (Z.pos x2)))%Rx1:Zx2:positiveforall p : positive, (Z.pos p * 1)%Z <> (0 * Z.pos x2)%Z -> (IZR (Z.pos x2) * / IZR (Z.pos p))%R = (/ (IZR (Z.pos p) * / IZR (Z.pos x2)))%Rx1:Zx2:positiveforall p : positive, (Z.neg p * 1)%Z <> (0 * Z.pos x2)%Z -> (IZR (Z.neg x2) * / IZR (Z.pos p))%R = (/ (IZR (Z.neg p) * / IZR (Z.pos x2)))%Rx1:Zx2:positiveforall p : positive, (Z.pos p * 1)%Z <> (0 * Z.pos x2)%Z -> (IZR (Z.pos x2) * / IZR (Z.pos p))%R = (/ (IZR (Z.pos p) * / IZR (Z.pos x2)))%Rx1:Zx2:positiveforall p : positive, (Z.neg p * 1)%Z <> (0 * Z.pos x2)%Z -> (IZR (Z.neg x2) * / IZR (Z.pos p))%R = (/ (IZR (Z.neg p) * / IZR (Z.pos x2)))%Rintros; change (IZR (Zneg x2)) with (- IZR (Zpos x2))%R; change (IZR (Zneg p)) with (- IZR (Zpos p))%R; simpl; field; (*auto 8 with real.*) repeat split; auto; auto with real. Qed.x1:Zx2:positiveforall p : positive, (Z.neg p * 1)%Z <> (0 * Z.pos x2)%Z -> (IZR (Z.neg x2) * / IZR (Z.pos p))%R = (/ (IZR (Z.neg p) * / IZR (Z.pos x2)))%Rforall x y : Q, ~ y == 0 -> Q2R (x / y) = (Q2R x / Q2R y)%Rforall x y : Q, ~ y == 0 -> Q2R (x / y) = (Q2R x / Q2R y)%Rforall x y : Q, ~ y == 0 -> Q2R (x * / y) = (Q2R x * / Q2R y)%Rrewrite Q2R_inv; auto. Qed. Hint Rewrite Q2R_plus Q2R_mult Q2R_opp Q2R_minus Q2R_inv Q2R_div : q2r_simpl.x, y:QH:~ y == 0(Q2R x * Q2R (/ y))%R = (Q2R x * / Q2R y)%R