1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| The HELM team. *)
8 (* ||A|| http://helm.cs.unibo.it *)
10 (* \ / This file is distributed under the terms of the *)
11 (* v GNU General Public License Version 2 *)
13 (**************************************************************************)
17 include "nat/plus.ma".
18 include "nat/orders.ma".
20 lemma ltwl: ∀a,b,c:nat. b + a < c → a < c.
21 intros 3 (x y z); elim y (H z IH H); [apply H]
22 apply IH; apply lt_S_to_lt; apply H;
25 lemma ltwr: ∀a,b,c:nat. a + b < c → a < c.
26 intros 3 (x y z); rewrite > sym_plus; apply ltwl;
29 include "sequence.ma".
30 include "metric_lattice.ma".
33 λR.λml:mlattice R.λs:sequence ml.λk.λn. δ (s n) k.
35 notation "s ⇝ x" non associative with precedence 50 for @{'tends $s $x}.
37 interpretation "tends to" 'tends s x =
38 (cic:/matita/sequence/tends0.con _ (cic:/matita/sandwich/d2s.con _ _ s x)).
41 let ugo ≝ excess_OF_lattice1 in
42 ∀R.∀ml:mlattice R.∀an,bn,xn:sequence ml.∀x:ml.
43 (∀n. (le (excess_OF_lattice1 ml) (xn n) (an n)) ∧
44 (le (excess_OF_lattice1 ?) (bn n) (xn n))) → True.
45 an ⇝ x → bn ⇝ x → xn ⇝ x.
46 intros (R ml an bn xn x H Ha Hb);
47 unfold tends0 in Ha Hb ⊢ %; unfold d2s in Ha Hb ⊢ %; intros (e He);
48 alias num (instance 0) = "natural number".
49 cases (Ha (e/2) (divide_preserves_lt ??? He)) (n1 H1); clear Ha;
50 cases (Hb (e/2) (divide_preserves_lt ??? He)) (n2 H2); clear Hb;
51 apply (ex_introT ?? (n1+n2)); intros (n3 Lt_n1n2_n3);
52 lapply (ltwr ??? Lt_n1n2_n3) as Lt_n1n3; lapply (ltwl ??? Lt_n1n2_n3) as Lt_n2n3;
53 cases (H1 ? Lt_n1n3) (c daxe); cases (H2 ? Lt_n2n3) (c dbxe);
54 cases (H n3) (H7 H8); clear Lt_n1n3 Lt_n2n3 Lt_n1n2_n3 c H1 H2 H n1 n2;
55 (* the main inequality *)
56 cut (δ (xn n3) x ≤ δ (bn n3) x + δ (an n3) x + δ (an n3) x) as main_ineq; [2:
57 apply (le_transitive ???? (mtineq ???? (an n3)));
58 cut ( δ(an n3) (bn n3)+- δ(xn n3) (bn n3)≈( δ(an n3) (xn n3))) as H11; [2:
59 lapply (le_mtri ?? ??? (ge_to_le ??? H7) (ge_to_le ??? H8)) as H9; clear H7 H8;
60 lapply (feq_plusr ? (- δ(xn n3) (bn n3)) ?? H9) as H10; clear H9;
61 apply (Eq≈ (0 + δ(an n3) (xn n3)) ? (zero_neutral ??));
62 apply (Eq≈ (δ(an n3) (xn n3) + 0) ? (plus_comm ???));
63 apply (Eq≈ (δ(an n3) (xn n3) + (-δ(xn n3) (bn n3) + δ(xn n3) (bn n3))) ? (opp_inverse ??));
64 apply (Eq≈ (δ(an n3) (xn n3) + (δ(xn n3) (bn n3) + -δ(xn n3) (bn n3))) ? (plus_comm ?? (δ(xn n3) (bn n3))));
65 apply (Eq≈ ?? (eq_sym ??? (plus_assoc ????))); assumption;]
66 apply (Le≪ (δ(an n3) (xn n3)+ δ(an n3) x) (msymmetric ??(an n3)(xn n3)));
67 apply (Le≪ (δ(an n3) (bn n3)+- δ(xn n3) (bn n3)+ δ(an n3) x) H11);
68 apply (Le≪ (- δ(xn n3) (bn n3)+ δ(an n3) (bn n3)+δ(an n3) x) (plus_comm ??(δ(an n3) (bn n3))));
69 apply (Le≪ (- δ(xn n3) (bn n3)+ (δ(an n3) (bn n3)+δ(an n3) x)) (plus_assoc ????));
70 apply (Le≪ ((δ(an n3) (bn n3)+δ(an n3) x)+- δ(xn n3) (bn n3)) (plus_comm ???));
71 apply lew_opp; [apply mpositive] apply fle_plusr;
72 apply (Le≫ ? (plus_comm ???));
73 apply (Le≫ ( δ(an n3) x+ δx (bn n3)) (msymmetric ????));
75 split; [ (* first the trivial case: -e< δ(xn n3) x *)
76 apply (lt_le_transitive ????? (mpositive ????));
77 apply lt_zero_x_to_lt_opp_x_zero; assumption;]
78 (* the main goal: δ(xn n3) x<e *)
79 apply (le_lt_transitive ???? main_ineq);
80 apply (Lt≫ (e/2+e/2+e/2)); [apply (divpow ?e 2)]
81 repeat (apply ltplus; try assumption);