Section particular.
Hypothesis alpha_irr : forall n p : Z, (alpha * IZR p)%R <> IZR n.
Hypothesis prop_alpha : (0 < alpha)%R /\ (alpha < 1)%R.
Hypothesis prop_N : forall N : nat, N >= 2.
(**********)
Definition M (N : nat) := first N + last N.
intros; apply (sym_equal (x:=n + first (M N)) (y:=after (M N) n));
apply (tech_after alpha_irr (M N) n (n + first (M N)) H);
auto with arith real.
apply (lt_le_trans n (last (M N)) (M N) H0 (last_N01 (M N))).
unfold M at 2 in |- *;
rewrite (last_eq_M_N alpha_irr prop_alpha prop_N N (M N));
auto with arith real;
rewrite (first_eq_M_N alpha_irr prop_alpha prop_N N (M N));
auto with arith real.
rewrite (plus_comm (first (M N)) (last (M N)));
apply (plus_lt_compat_r n (last (M N)) (first (M N)) H0).
fold (frac_part_n_alpha (n + first (M N)) > frac_part_n_alpha n)%R in |- *;
apply
(Rnot_le_lt (frac_part_n_alpha (n + first (M N))) (frac_part_n_alpha n));
red in |- *; intro;
generalize
(Rplus_le_compat_l (- frac_part_n_alpha (first (M N)))
(frac_part_n_alpha (n + first (M N))) (frac_part_n_alpha n) H1);
rewrite
(Rplus_comm (- frac_part_n_alpha (first (M N)))
(frac_part_n_alpha (n + first (M N))));
rewrite
(Rplus_comm (- frac_part_n_alpha (first (M N))) (frac_part_n_alpha n))
;
fold
(frac_part_n_alpha (n + first (M N)) - frac_part_n_alpha (first (M N)))%R
in |- *;
fold (frac_part_n_alpha n - frac_part_n_alpha (first (M N)))%R in |- *;
cut
(frac_part_n_alpha (n + first (M N)) >= frac_part_n_alpha (first (M N)))%R.
intro; unfold frac_part_n_alpha at 1 2 in |- *;
unfold frac_part_n_alpha in H2;
rewrite <-
(Rminus_fp1 (INR (n + first (M N)) * alpha) (INR (first (M N)) * alpha) H2)
; rewrite (plus_INR n (first (M N)));
rewrite (Rmult_comm (INR n + INR (first (M N))) alpha);
rewrite (Rmult_plus_distr_l alpha (INR n) (INR (first (M N))));
rewrite (Rmult_comm alpha (INR (first (M N)))); unfold Rminus at 1 in |- *;
rewrite
(Rplus_assoc (alpha * INR n) (INR (first (M N)) * alpha)
(- (INR (first (M N)) * alpha)));
rewrite (Rplus_opp_r (INR (first (M N)) * alpha)).
elim (Rplus_ne (alpha * INR n)); intros a b; rewrite a; clear a b;
rewrite (Rmult_comm alpha (INR n)); fold (frac_part_n_alpha n) in |- *;
intro; cut (0 < frac_part_n_alpha (first (M N)))%R.
intro;
generalize
(tech_Rgt_minus (frac_part_n_alpha n) (frac_part_n_alpha (first (M N))) H4);
clear H4 H1 H2; intro; unfold Rgt in H1;
generalize
(Rgt_not_le (frac_part_n_alpha n)
(frac_part_n_alpha n - frac_part_n_alpha (first (M N))) H1);
auto with arith real.
fold (frac_part_n_alpha (first (M N)) > 0)%R in |- *;
apply (fp_first_R0 alpha_irr prop_N (M N)).
unfold Rge in |- *; unfold Rgt in |- *;
cut
((frac_part_n_alpha (first (M N)) < frac_part_n_alpha (n + first (M N)))%R \/
frac_part_n_alpha (first (M N)) = frac_part_n_alpha (n + first (M N))).
intro; elim H2; intro.
left; auto with arith real.
right; auto with arith real.
fold
(frac_part_n_alpha (first (M N)) <= frac_part_n_alpha (n + first (M N)))%R
in |- *; apply (first_n (M N) (n + first (M N)));
auto with arith real;
generalize (plus_lt_compat_r n (last (M N)) (first (M N)) H0);
intro; unfold M at 2 in |- *;
rewrite (first_eq_M_N alpha_irr prop_alpha prop_N N (M N));
auto with arith real;
rewrite (last_eq_M_N alpha_irr prop_alpha prop_N N (M N));
auto with arith real; rewrite (plus_comm (first (M N)) (last (M N)));
assumption.
(**)
intro; elim H1; intros; elim H2; intros; elim H4; intros; elim H6; intros;
clear H6 H4 H2 H1.
elim (le_or_lt x n); intro.
generalize
(Ropp_lt_gt_contravar (frac_part_n_alpha n) (frac_part_n_alpha x) H7);
intro;
generalize
(Rplus_gt_compat_l (frac_part_n_alpha (n + first (M N)))
(- frac_part_n_alpha n) (- frac_part_n_alpha x) H2);
fold (frac_part_n_alpha (n + first (M N)) - frac_part_n_alpha n)%R in |- *;
fold (frac_part_n_alpha (n + first (M N)) - frac_part_n_alpha x)%R in |- *;
fold (frac_part_n_alpha (n + first (M N)) > frac_part_n_alpha x)%R in H8;
generalize
(Rgt_ge (frac_part_n_alpha (n + first (M N))) (frac_part_n_alpha x) H8);
intro; unfold frac_part_n_alpha in H4; unfold frac_part_n_alpha in |- *;
rewrite <- (Rminus_fp1 (INR (n + first (M N)) * alpha) (INR x * alpha) H4);
fold (frac_part_n_alpha x > frac_part_n_alpha n)%R in H7;
generalize
(Rgt_trans (frac_part_n_alpha (n + first (M N)))
(frac_part_n_alpha x) (frac_part_n_alpha n) H8 H7);
intro;
generalize
(Rgt_ge (frac_part_n_alpha (n + first (M N))) (frac_part_n_alpha n) H6);
intro; unfold frac_part_n_alpha in H9;
rewrite <- (Rminus_fp1 (INR (n + first (M N)) * alpha) (INR n * alpha) H9);
rewrite (plus_INR n (first (M N)));
rewrite (Rmult_comm (INR n + INR (first (M N))) alpha);
rewrite (Rmult_plus_distr_l alpha (INR n) (INR (first (M N))));
rewrite (Rmult_comm alpha (INR n)); unfold Rminus at 1 in |- *;
rewrite (Rplus_comm (INR n * alpha) (alpha * INR (first (M N))));
rewrite
(Rplus_assoc (alpha * INR (first (M N))) (INR n * alpha)
(- (INR n * alpha))); rewrite (Rplus_opp_r (INR n * alpha));
elim (Rplus_ne (alpha * INR (first (M N)))); intros a b;
rewrite a; clear a b; rewrite (Rmult_comm alpha (INR (first (M N))));
fold (frac_part_n_alpha (first (M N))) in |- *; unfold Rminus in |- *;
rewrite
(Rplus_assoc (INR (first (M N)) * alpha) (INR n * alpha)
(- (INR x * alpha))); rewrite (Rmult_comm (INR (first (M N))) alpha);
rewrite (Rmult_comm (INR n) alpha);
rewrite <- (Ropp_mult_distr_l_reverse (INR x) alpha);
rewrite (Rmult_comm (- INR x) alpha);
rewrite <- (Rmult_plus_distr_l alpha (INR n) (- INR x));
rewrite <- (Rmult_plus_distr_l alpha (INR (first (M N))) (INR n + - INR x));
fold (INR n - INR x)%R in |- *; rewrite <- (minus_INR n x H1);
rewrite <- (plus_INR (first (M N)) (n - x));
rewrite (Rmult_comm alpha (INR (first (M N) + (n - x))));
fold (frac_part_n_alpha (first (M N) + (n - x))) in |- *;
intro; clear H2 H4 H6 H9; cut (0 < first (M N) + (n - x)).
cut (first (M N) + (n - x) < M N).
intros;
generalize
(first_n (M N) (first (M N) + (n - x)) (prop_N (M N)) H4 H2 prop_alpha);
intro; clear H2 H4; unfold Rgt in H10;
generalize
(Rgt_not_le (frac_part_n_alpha (first (M N)))
(frac_part_n_alpha (first (M N) + (n - x))) H10);
auto with arith real.
unfold M at 2 in |- *;
rewrite (first_eq_M_N alpha_irr prop_alpha prop_N N (M N));
auto with arith real.
apply (plus_lt_compat_l (n - x) (last N) (first (M N)));
rewrite (last_eq_M_N alpha_irr prop_alpha prop_N N (M N));
auto with arith real.
apply (lt_minus_p n (last (M N)) x H0).
apply (lt_O_plus (first (M N)) (n - x) (first_0 (M N) (prop_N (M N)))).
(**)
generalize
(Rplus_lt_compat_l (- frac_part_n_alpha n) (frac_part_n_alpha x)
(frac_part_n_alpha (n + first (M N))) H8);
rewrite (Rplus_comm (- frac_part_n_alpha n) (frac_part_n_alpha x));
rewrite
(Rplus_comm (- frac_part_n_alpha n) (frac_part_n_alpha (n + first (M N))))
; fold (frac_part_n_alpha x - frac_part_n_alpha n)%R in |- *;
fold (frac_part_n_alpha (n + first (M N)) - frac_part_n_alpha n)%R in |- *;
fold (frac_part_n_alpha x > frac_part_n_alpha n)%R in H7;
generalize (Rgt_ge (frac_part_n_alpha x) (frac_part_n_alpha n) H7);
intro;
fold (frac_part_n_alpha (n + first (M N)) > frac_part_n_alpha x)%R in H8;
generalize
(Rgt_trans (frac_part_n_alpha (n + first (M N)))
(frac_part_n_alpha x) (frac_part_n_alpha n) H8 H7);
intro;
generalize
(Rgt_ge (frac_part_n_alpha (n + first (M N))) (frac_part_n_alpha n) H4);
intro; unfold frac_part_n_alpha in H2, H6; unfold frac_part_n_alpha in |- *;
rewrite <- (Rminus_fp1 (INR x * alpha) (INR n * alpha) H2);
rewrite <- (Rminus_fp1 (INR (n + first (M N)) * alpha) (INR n * alpha) H6);
rewrite (plus_INR n (first (M N)));
rewrite (Rmult_comm (INR n + INR (first (M N))) alpha);
rewrite (Rmult_plus_distr_l alpha (INR n) (INR (first (M N))));
rewrite (Rmult_comm alpha (INR n));
rewrite (Rmult_comm alpha (INR (first (M N)))); unfold Rminus at 2 in |- *;
rewrite (Rplus_comm (INR n * alpha) (INR (first (M N)) * alpha));
rewrite
(Rplus_assoc (INR (first (M N)) * alpha) (INR n * alpha)
(- (INR n * alpha))); rewrite (Rplus_opp_r (INR n * alpha));
elim (Rplus_ne (INR (first (M N)) * alpha)); intros a b;
rewrite a; clear a b; fold (frac_part_n_alpha (first (M N))) in |- *;
clear H2 H4 H6; unfold Rminus in |- *; rewrite (Rmult_comm (INR x) alpha);
rewrite <- (Ropp_mult_distr_l_reverse (INR n) alpha);
rewrite (Rmult_comm (- INR n) alpha);
rewrite <- (Rmult_plus_distr_l alpha (INR x) (- INR n));
fold (INR x - INR n)%R in |- *; rewrite (Rmult_comm alpha (INR x - INR n));
generalize (lt_le_weak n x H1); intro; rewrite <- (minus_INR x n H2);
fold (frac_part_n_alpha (x - n)) in |- *; intro; cut (0 < x - n).
intro; cut (x - n < M N).
intro; generalize (first_n (M N) (x - n) (prop_N (M N)) H6 H9 prop_alpha);
intro; clear H9 H6;
generalize
(Rgt_not_le (frac_part_n_alpha (first (M N))) (frac_part_n_alpha (x - n))
H4); auto with arith real.
apply (lt_minus_p x (M N) n H5).
apply (lt_minus2 n x H1).
Qed.
intros; elim (le_lt_or_eq (last (M N)) n H); intro; clear H.
apply (sym_equal (x:=n - last (M N)) (y:=after (M N) n));
apply (tech_after alpha_irr (M N) n (n - last (M N)));
auto with arith real.
apply (lt_trans 0 (last (M N)) n (last_0 (M N) (prop_N (M N))) H1).
apply (lt_minus_p n (M N) (last (M N)) H0).
cut
(frac_part_n_alpha n <
frac_part_n_alpha n - frac_part_n_alpha (last (M N)) + 1)%R.
intro; unfold frac_part_n_alpha in H; generalize H; clear H;
rewrite <- (Rminus_fp2 (INR n * alpha) (INR (last (M N)) * alpha)).
fold (frac_part_n_alpha n) in |- *; rewrite (Rmult_comm (INR n) alpha);
unfold Rminus in |- *;
rewrite <- (Ropp_mult_distr_l_reverse (INR (last (M N))) alpha);
rewrite (Rmult_comm (- INR (last (M N))) alpha);
rewrite <- (Rmult_plus_distr_l alpha (INR n) (- INR (last (M N))));
fold (INR n - INR (last (M N)))%R in |- *;
rewrite <- (minus_INR n (last (M N)) (lt_le_weak (last (M N)) n H1));
rewrite (Rmult_comm alpha (INR (n - last (M N))));
fold (frac_part_n_alpha (n - last (M N))) in |- *;
trivial.
fold (frac_part_n_alpha n) in |- *;
fold (frac_part_n_alpha (last (M N))) in |- *;
generalize
(last_n (M N) n (prop_N (M N))
(lt_trans 0 (last (M N)) n (last_0 (M N) (prop_N (M N))) H1) H0
prop_alpha); intro; unfold Rle in H; elim H; intro;
auto with arith real.
generalize
(contra_tech_fp_alp_irr alpha_irr prop_alpha (last (M N)) n
(lt_not_eq (last (M N)) n H1)); intro; elimtype False;
auto with arith real.
unfold Rminus in |- *;
rewrite
(Rplus_assoc (frac_part_n_alpha n) (- frac_part_n_alpha (last (M N))) 1)
; rewrite (Rplus_comm (- frac_part_n_alpha (last (M N))) 1);
fold (1 - frac_part_n_alpha (last (M N)))%R in |- *;
elim (Rplus_ne (frac_part_n_alpha n)); intros a b;
pattern (frac_part_n_alpha n) at 1 in |- *; rewrite <- a;
clear a b;
apply
(Rplus_lt_compat_l (frac_part_n_alpha n) 0
(1 - frac_part_n_alpha (last (M N))));
fold (1 - frac_part_n_alpha (last (M N)) > 0)%R in |- *;
apply (Rgt_minus 1 (frac_part_n_alpha (last (M N))));
unfold Rgt in |- *; unfold frac_part_n_alpha in |- *;
elim (base_fp (INR (last (M N)) * alpha)); intros;
assumption.
(**)
intro; elim H; intros; elim H2; intros; elim H4; intros; elim H6; intros;
clear H H2 H4 H6.
elim (le_or_lt n x); intro.
generalize
(Rplus_lt_compat_l (- frac_part_n_alpha (n - last (M N)))
(frac_part_n_alpha n) (frac_part_n_alpha x) H7);
intro;
generalize
(Rplus_lt_compat_l 1
(- frac_part_n_alpha (n - last (M N)) + frac_part_n_alpha n)
(- frac_part_n_alpha (n - last (M N)) + frac_part_n_alpha x) H2);
clear H2;
rewrite
(Rplus_comm 1 (- frac_part_n_alpha (n - last (M N)) + frac_part_n_alpha n))
;
rewrite
(Rplus_comm 1 (- frac_part_n_alpha (n - last (M N)) + frac_part_n_alpha x))
;
rewrite
(Rplus_comm (- frac_part_n_alpha (n - last (M N))) (frac_part_n_alpha n))
;
rewrite
(Rplus_comm (- frac_part_n_alpha (n - last (M N))) (frac_part_n_alpha x))
; fold (frac_part_n_alpha n - frac_part_n_alpha (n - last (M N)))%R in |- *;
fold (frac_part_n_alpha x - frac_part_n_alpha (n - last (M N)))%R in |- *;
unfold frac_part_n_alpha in |- *;
rewrite <- (Rminus_fp2 (INR n * alpha) (INR (n - last (M N)) * alpha)).
rewrite <- (Rminus_fp2 (INR x * alpha) (INR (n - last (M N)) * alpha)).
rewrite (minus_INR n (last (M N)) (lt_le_weak (last (M N)) n H1));
unfold Rminus in |- *;
rewrite (Rmult_comm (INR n + - INR (last (M N))) alpha);
rewrite (Rmult_plus_distr_l alpha (INR n) (- INR (last (M N))));
rewrite (Ropp_plus_distr (alpha * INR n) (alpha * - INR (last (M N))));
rewrite <-
(Rplus_assoc (INR n * alpha) (- (alpha * INR n))
(- (alpha * - INR (last (M N))))); rewrite (Rmult_comm (INR n) alpha);
rewrite (Rplus_opp_r (alpha * INR n));
elim (Rplus_ne (- (alpha * - INR (last (M N)))));
intros a b; rewrite b; clear a b;
rewrite (Rmult_comm alpha (- INR (last (M N))));
rewrite <- (Ropp_mult_distr_l_reverse (- INR (last (M N))) alpha);
rewrite (Ropp_involutive (INR (last (M N))));
fold (frac_part_n_alpha (last (M N))) in |- *;
rewrite <-
(Rplus_assoc (INR x * alpha) (- (alpha * INR n)) (INR (last (M N)) * alpha))
; rewrite (Rmult_comm alpha (INR n));
rewrite <- (Ropp_mult_distr_l_reverse (INR n) alpha);
rewrite (Rmult_comm (- INR n) alpha); rewrite (Rmult_comm (INR x) alpha);
rewrite <- (Rmult_plus_distr_l alpha (INR x) (- INR n));
fold (INR x - INR n)%R in |- *; rewrite <- (minus_INR x n H);
rewrite (Rmult_comm (INR (last (M N))) alpha);
rewrite <- (Rmult_plus_distr_l alpha (INR (x - n)) (INR (last (M N))));
rewrite <- (plus_INR (x - n) (last (M N)));
rewrite (Rmult_comm alpha (INR (x - n + last (M N))));
fold (frac_part_n_alpha (x - n + last (M N))) in |- *;
intro; cut (0 < x - n + last (M N)).
intro; cut (x - n + last (M N) < M N).
intro;
generalize
(last_n (M N) (x - n + last (M N)) (prop_N (M N)) H4 H6 prop_alpha);
intro; clear H4 H6;
generalize
(Rgt_not_le (frac_part_n_alpha (x - n + last (M N)))
(frac_part_n_alpha (last (M N))) H2); intro; elimtype False;
auto with arith real.
apply (tech_inter31b (last (M N)) n x (M N) H1 H H5).
rewrite plus_comm;
apply (lt_O_plus (last (M N)) (x - n) (last_0 (M N) (prop_N (M N)))).
fold (frac_part_n_alpha x) in |- *;
fold (frac_part_n_alpha (n - last (M N))) in |- *;
assumption.
fold (frac_part_n_alpha n) in |- *;
fold (frac_part_n_alpha (n - last (M N))) in |- *;
apply
(Rlt_trans (frac_part_n_alpha n) (frac_part_n_alpha x)
(frac_part_n_alpha (n - last (M N))) H7 H8).
(**)
generalize
(Ropp_lt_gt_contravar (frac_part_n_alpha x)
(frac_part_n_alpha (n - last (M N))) H8); unfold Rgt in |- *;
intro;
generalize
(Rplus_lt_compat_l (frac_part_n_alpha n)
(- frac_part_n_alpha (n - last (M N))) (- frac_part_n_alpha x) H2);
clear H2;
fold (frac_part_n_alpha n - frac_part_n_alpha (n - last (M N)))%R in |- *;
fold (frac_part_n_alpha n - frac_part_n_alpha x)%R in |- *;
intro;
generalize
(Rplus_lt_compat_l 1
(frac_part_n_alpha n - frac_part_n_alpha (n - last (M N)))
(frac_part_n_alpha n - frac_part_n_alpha x) H2);
clear H2;
rewrite
(Rplus_comm 1 (frac_part_n_alpha n - frac_part_n_alpha (n - last (M N))))
; rewrite (Rplus_comm 1 (frac_part_n_alpha n - frac_part_n_alpha x));
unfold frac_part_n_alpha in |- *;
rewrite <- (Rminus_fp2 (INR n * alpha) (INR (n - last (M N)) * alpha)).
rewrite <- (Rminus_fp2 (INR n * alpha) (INR x * alpha)).
rewrite (Rmult_comm (INR n) alpha); unfold Rminus at 2 in |- *;
rewrite <- (Ropp_mult_distr_l_reverse (INR x) alpha);
rewrite (Rmult_comm (- INR x) alpha);
rewrite <- (Rmult_plus_distr_l alpha (INR n) (- INR x));
fold (INR n - INR x)%R in |- *;
rewrite <- (minus_INR n x (lt_le_weak x n H));
rewrite (Rmult_comm alpha (INR (n - x)));
fold (frac_part_n_alpha (n - x)) in |- *;
rewrite (minus_INR n (last (M N)) (lt_le_weak (last (M N)) n H1));
unfold Rminus in |- *;
rewrite (Rmult_comm (INR n + - INR (last (M N))) alpha);
rewrite (Rmult_plus_distr_l alpha (INR n) (- INR (last (M N))));
rewrite (Ropp_plus_distr (alpha * INR n) (alpha * - INR (last (M N))));
rewrite <-
(Rplus_assoc (alpha * INR n) (- (alpha * INR n))
(- (alpha * - INR (last (M N))))); rewrite (Rplus_opp_r (alpha * INR n));
elim (Rplus_ne (- (alpha * - INR (last (M N)))));
intros a b; rewrite b; clear a b;
rewrite (Rmult_comm alpha (- INR (last (M N))));
rewrite <- (Ropp_mult_distr_l_reverse (- INR (last (M N))) alpha);
rewrite (Ropp_involutive (INR (last (M N))));
fold (frac_part_n_alpha (last (M N))) in |- *; intro;
cut (0 < n - x).
intro; cut (n - x < M N).
intro; generalize (last_n (M N) (n - x) (prop_N (M N)) H4 H6 prop_alpha);
intro;
generalize
(Rgt_not_le (frac_part_n_alpha (n - x)) (frac_part_n_alpha (last (M N))) H2);
intro; elimtype False; auto with arith real.
apply (lt_minus_p n (M N) x H0).
apply (lt_minus2 x n H).
fold (frac_part_n_alpha n) in |- *; fold (frac_part_n_alpha x) in |- *;
assumption.
fold (frac_part_n_alpha n) in |- *;
fold (frac_part_n_alpha (n - last (M N))) in |- *;
apply
(Rlt_trans (frac_part_n_alpha n) (frac_part_n_alpha x)
(frac_part_n_alpha (n - last (M N))) H7 H8).
rewrite <- H1; rewrite <- (minus_n_n (last (M N)));
apply (after_last prop_alpha prop_N (M N)).
Qed.

(**********)
Lemma tech1 :
forall N n : nat,
N - first N <= n ->
n < last N ->
(frac_part_n_alpha n < frac_part_n_alpha (n + first N - last N))%R.