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 Import Rbase.
Require Import Rfunctions.
Require Import SeqSeries.
Local Open Scope R_scope.

(*****************************************************************)
To define transcendental functions
and exponential function
(*****************************************************************)

(*********)

Un_cv (fun n : nat => Rabs (/ INR (fact (S n)) * / / INR (fact n))) 0

Un_cv (fun n : nat => Rabs (/ INR (fact (S n)) * / / INR (fact n))) 0
eps:R
H:eps > 0
Hgt:eps > 1

exists N : nat, forall n : nat, (n >= N)%nat -> R_dist (Rabs (/ INR (fact (S n)) * / / INR (fact n))) 0 < eps
eps:R
H:eps > 0
Hnotgt:~ eps > 1
exists N : nat, forall n : nat, (n >= N)%nat -> R_dist (Rabs (/ INR (fact (S n)) * / / INR (fact n))) 0 < eps
eps:R
H:eps > 0
Hgt:eps > 1

exists N : nat, forall n : nat, (n >= N)%nat -> R_dist (Rabs (/ INR (fact (S n)) * / / INR (fact n))) 0 < eps
eps:R
H:eps > 0
Hgt:eps > 1
n:nat
H0:(n >= 0)%nat

/ INR (S n) > 0 -> Rabs (/ INR (S n)) < eps
eps:R
H:eps > 0
Hgt:eps > 1
n:nat
H0:(n >= 0)%nat
/ INR (S n) > 0
eps:R
H:eps > 0
Hgt:eps > 1
n:nat
H0:(n >= 0)%nat
H1:/ INR (S n) > 0

/ INR (S n) < eps
eps:R
H:eps > 0
Hgt:eps > 1
n:nat
H0:(n >= 0)%nat
H1:/ INR (S n) > 0
0 <= / INR (S n)
eps:R
H:eps > 0
Hgt:eps > 1
n:nat
H0:(n >= 0)%nat
/ INR (S n) > 0
eps:R
H:eps > 0
Hgt:eps > 1
n:nat
H0:(n >= 0)%nat
H1:/ INR (S n) > 0

/ eps - 1 < 0 -> / INR (S n) < eps
eps:R
H:eps > 0
Hgt:eps > 1
n:nat
H0:(n >= 0)%nat
H1:/ INR (S n) > 0
/ eps - 1 < 0
eps:R
H:eps > 0
Hgt:eps > 1
n:nat
H0:(n >= 0)%nat
H1:/ INR (S n) > 0
0 <= / INR (S n)
eps:R
H:eps > 0
Hgt:eps > 1
n:nat
H0:(n >= 0)%nat
/ INR (S n) > 0
eps:R
H:eps > 0
Hgt:eps > 1
n:nat
H0:(n >= 0)%nat
H1:/ INR (S n) > 0
H2:/ eps < 1 + INR n

/ INR (S n) < eps
eps:R
H:eps > 0
Hgt:eps > 1
n:nat
H0:(n >= 0)%nat
H1:/ INR (S n) > 0
/ eps - 1 < 0
eps:R
H:eps > 0
Hgt:eps > 1
n:nat
H0:(n >= 0)%nat
H1:/ INR (S n) > 0
0 <= / INR (S n)
eps:R
H:eps > 0
Hgt:eps > 1
n:nat
H0:(n >= 0)%nat
/ INR (S n) > 0
eps:R
H:eps > 0
Hgt:eps > 1
n:nat
H0:(n >= 0)%nat
H1:/ INR (S n) > 0

/ eps - 1 < 0
eps:R
H:eps > 0
Hgt:eps > 1
n:nat
H0:(n >= 0)%nat
H1:/ INR (S n) > 0
0 <= / INR (S n)
eps:R
H:eps > 0
Hgt:eps > 1
n:nat
H0:(n >= 0)%nat
/ INR (S n) > 0
eps:R
H:eps > 0
Hgt:eps > 1
n:nat
H0:(n >= 0)%nat
H1:/ INR (S n) > 0

0 <= / INR (S n)
eps:R
H:eps > 0
Hgt:eps > 1
n:nat
H0:(n >= 0)%nat
/ INR (S n) > 0
eps:R
H:eps > 0
Hgt:eps > 1
n:nat
H0:(n >= 0)%nat

/ INR (S n) > 0
unfold Rgt; apply Rinv_0_lt_compat; apply lt_INR_0; apply lt_O_Sn.
eps:R
H:eps > 0
Hnotgt:~ eps > 1

exists N : nat, forall n : nat, (n >= N)%nat -> R_dist (Rabs (/ INR (fact (S n)) * / / INR (fact n))) 0 < eps
eps:R
H:eps > 0
Hnotgt:~ eps > 1

(0 <= up (/ eps - 1))%Z -> exists N : nat, forall n : nat, (n >= N)%nat -> R_dist (Rabs (/ INR (fact (S n)) * / / INR (fact n))) 0 < eps
eps:R
H:eps > 0
Hnotgt:~ eps > 1
(0 <= up (/ eps - 1))%Z
eps:R
H:eps > 0
Hnotgt:~ eps > 1
H0:(0 <= up (/ eps - 1))%Z
x:nat
H1:up (/ eps - 1) = Z.of_nat x
n:nat
H2:(n >= x)%nat

/ INR (S n) > 0 -> Rabs (/ INR (S n)) < eps
eps:R
H:eps > 0
Hnotgt:~ eps > 1
H0:(0 <= up (/ eps - 1))%Z
x:nat
H1:up (/ eps - 1) = Z.of_nat x
n:nat
H2:(n >= x)%nat
/ INR (S n) > 0
eps:R
H:eps > 0
Hnotgt:~ eps > 1
(0 <= up (/ eps - 1))%Z
eps:R
H:eps > 0
Hnotgt:~ eps > 1
H0:(0 <= up (/ eps - 1))%Z
x:nat
H1:up (/ eps - 1) = Z.of_nat x
n:nat
H2:(n >= x)%nat
H3:/ INR (S n) > 0

/ INR (S n) < eps
eps:R
H:eps > 0
Hnotgt:~ eps > 1
H0:(0 <= up (/ eps - 1))%Z
x:nat
H1:up (/ eps - 1) = Z.of_nat x
n:nat
H2:(n >= x)%nat
H3:/ INR (S n) > 0
0 <= / INR (S n)
eps:R
H:eps > 0
Hnotgt:~ eps > 1
H0:(0 <= up (/ eps - 1))%Z
x:nat
H1:up (/ eps - 1) = Z.of_nat x
n:nat
H2:(n >= x)%nat
/ INR (S n) > 0
eps:R
H:eps > 0
Hnotgt:~ eps > 1
(0 <= up (/ eps - 1))%Z
eps:R
H:eps > 0
Hnotgt:~ eps > 1
H0:(0 <= up (/ eps - 1))%Z
x:nat
H1:up (/ eps - 1) = Z.of_nat x
n:nat
H2:(n >= x)%nat
H3:/ INR (S n) > 0

/ eps - 1 < INR x -> / INR (S n) < eps
eps:R
H:eps > 0
Hnotgt:~ eps > 1
H0:(0 <= up (/ eps - 1))%Z
x:nat
H1:up (/ eps - 1) = Z.of_nat x
n:nat
H2:(n >= x)%nat
H3:/ INR (S n) > 0
/ eps - 1 < INR x
eps:R
H:eps > 0
Hnotgt:~ eps > 1
H0:(0 <= up (/ eps - 1))%Z
x:nat
H1:up (/ eps - 1) = Z.of_nat x
n:nat
H2:(n >= x)%nat
H3:/ INR (S n) > 0
0 <= / INR (S n)
eps:R
H:eps > 0
Hnotgt:~ eps > 1
H0:(0 <= up (/ eps - 1))%Z
x:nat
H1:up (/ eps - 1) = Z.of_nat x
n:nat
H2:(n >= x)%nat
/ INR (S n) > 0
eps:R
H:eps > 0
Hnotgt:~ eps > 1
(0 <= up (/ eps - 1))%Z
eps:R
H:eps > 0
Hnotgt:~ eps > 1
H0:(0 <= up (/ eps - 1))%Z
x:nat
H1:up (/ eps - 1) = Z.of_nat x
n:nat
H2:(n >= x)%nat
H3:/ INR (S n) > 0
H4:/ eps < 1 + INR n

/ INR (S n) < eps
eps:R
H:eps > 0
Hnotgt:~ eps > 1
H0:(0 <= up (/ eps - 1))%Z
x:nat
H1:up (/ eps - 1) = Z.of_nat x
n:nat
H2:(n >= x)%nat
H3:/ INR (S n) > 0
/ eps - 1 < INR x
eps:R
H:eps > 0
Hnotgt:~ eps > 1
H0:(0 <= up (/ eps - 1))%Z
x:nat
H1:up (/ eps - 1) = Z.of_nat x
n:nat
H2:(n >= x)%nat
H3:/ INR (S n) > 0
0 <= / INR (S n)
eps:R
H:eps > 0
Hnotgt:~ eps > 1
H0:(0 <= up (/ eps - 1))%Z
x:nat
H1:up (/ eps - 1) = Z.of_nat x
n:nat
H2:(n >= x)%nat
/ INR (S n) > 0
eps:R
H:eps > 0
Hnotgt:~ eps > 1
(0 <= up (/ eps - 1))%Z
eps:R
H:eps > 0
Hnotgt:~ eps > 1
H0:(0 <= up (/ eps - 1))%Z
x:nat
H1:up (/ eps - 1) = Z.of_nat x
n:nat
H2:(n >= x)%nat
H3:/ INR (S n) > 0

/ eps - 1 < INR x
eps:R
H:eps > 0
Hnotgt:~ eps > 1
H0:(0 <= up (/ eps - 1))%Z
x:nat
H1:up (/ eps - 1) = Z.of_nat x
n:nat
H2:(n >= x)%nat
H3:/ INR (S n) > 0
0 <= / INR (S n)
eps:R
H:eps > 0
Hnotgt:~ eps > 1
H0:(0 <= up (/ eps - 1))%Z
x:nat
H1:up (/ eps - 1) = Z.of_nat x
n:nat
H2:(n >= x)%nat
/ INR (S n) > 0
eps:R
H:eps > 0
Hnotgt:~ eps > 1
(0 <= up (/ eps - 1))%Z
eps:R
H:eps > 0
Hnotgt:~ eps > 1
H0:(0 <= up (/ eps - 1))%Z
x:nat
H1:up (/ eps - 1) = Z.of_nat x
n:nat
H2:(n >= x)%nat
H3:/ INR (S n) > 0
H4:IZR (up (/ eps - 1)) = IZR (Z.of_nat x)

/ eps - 1 < INR x
eps:R
H:eps > 0
Hnotgt:~ eps > 1
H0:(0 <= up (/ eps - 1))%Z
x:nat
H1:up (/ eps - 1) = Z.of_nat x
n:nat
H2:(n >= x)%nat
H3:/ INR (S n) > 0
0 <= / INR (S n)
eps:R
H:eps > 0
Hnotgt:~ eps > 1
H0:(0 <= up (/ eps - 1))%Z
x:nat
H1:up (/ eps - 1) = Z.of_nat x
n:nat
H2:(n >= x)%nat
/ INR (S n) > 0
eps:R
H:eps > 0
Hnotgt:~ eps > 1
(0 <= up (/ eps - 1))%Z
eps:R
H:eps > 0
Hnotgt:~ eps > 1
H0:(0 <= up (/ eps - 1))%Z
x:nat
H1:up (/ eps - 1) = Z.of_nat x
n:nat
H2:(n >= x)%nat
H3:/ INR (S n) > 0

0 <= / INR (S n)
eps:R
H:eps > 0
Hnotgt:~ eps > 1
H0:(0 <= up (/ eps - 1))%Z
x:nat
H1:up (/ eps - 1) = Z.of_nat x
n:nat
H2:(n >= x)%nat
/ INR (S n) > 0
eps:R
H:eps > 0
Hnotgt:~ eps > 1
(0 <= up (/ eps - 1))%Z
eps:R
H:eps > 0
Hnotgt:~ eps > 1
H0:(0 <= up (/ eps - 1))%Z
x:nat
H1:up (/ eps - 1) = Z.of_nat x
n:nat
H2:(n >= x)%nat

/ INR (S n) > 0
eps:R
H:eps > 0
Hnotgt:~ eps > 1
(0 <= up (/ eps - 1))%Z
eps:R
H:eps > 0
Hnotgt:~ eps > 1

(0 <= up (/ eps - 1))%Z
eps:R
H:eps > 0
Hnotgt:~ eps > 1

0 <= / eps - 1
eps:R
H:eps > 0
Hnotgt:~ eps > 1
/ eps - 1 <= IZR (up (/ eps - 1))
eps:R
H:eps > 0
H0:eps < 1

0 < / eps - 1 \/ 0 = / eps - 1
eps:R
H:eps > 0
H0:eps = 1
0 < / eps - 1 \/ 0 = / eps - 1
eps:R
H:eps > 0
Hnotgt:~ eps > 1
/ eps - 1 <= IZR (up (/ eps - 1))
eps:R
H:eps > 0
H0:eps = 1

0 < / eps - 1 \/ 0 = / eps - 1
eps:R
H:eps > 0
Hnotgt:~ eps > 1
/ eps - 1 <= IZR (up (/ eps - 1))
eps:R
H:eps > 0
Hnotgt:~ eps > 1

/ eps - 1 <= IZR (up (/ eps - 1))
elim (archimed (/ eps - 1)); intros; clear H1; unfold Rgt in H0; apply Rlt_le; assumption. Qed.