cases (H1 ? H) (w Hw); apply Hv; assumption;
qed.
+lemma infimum_is_lower_bound:
+ ∀C:ordered_set.∀a:sequence C.∀u:C.
+ u is_infimum a → ∀v.v is_lower_bound a → v ≤ u.
+intros 7 (C s u Hu v Hv H); cases Hu (_ H1); clear Hu;
+cases (H1 ? H) (w Hw); apply Hv; assumption;
+qed.
+
+
(* Lemma 2.6 *)
definition strictly_increasing ≝
λC:ordered_set.λa:sequence C.∀n:nat.a (S n) ≰ a n.
for @{'strictly_decreasing $s}.
interpretation "Ordered set strict decreasing" 'strictly_decreasing s =
(strictly_decreasing _ s).
-
-notation "a \uparrow u" non associative with precedence 50 for @{'sup_inc $a $u}.
-interpretation "Ordered set supremum of increasing" 'sup_inc s u =
- (cic:/matita/dama/cprop_connectives/And.ind#xpointer(1/1)
- (increasing _ s)
- (supremum _ s u)).
-notation "a \downarrow u" non associative with precedence 50 for @{'inf_dec $a $u}.
-interpretation "Ordered set supremum of increasing" 'inf_dec s u =
- (cic:/matita/dama/cprop_connectives/And.ind#xpointer(1/1)
- (decreasing _ s)
- (infimum _ s u)).
+
+definition uparrow ≝
+ λC:ordered_set.λs:sequence C.λu:C.
+ s is_increasing ∧ u is_supremum s.
+
+definition downarrow ≝
+ λC:ordered_set.λs:sequence C.λu:C.
+ s is_decreasing ∧ u is_infimum s.
+
+notation < "a \uparrow \nbsp u" non associative with precedence 50 for @{'sup_inc $a $u}.
+notation > "a \uparrow u" non associative with precedence 50 for @{'sup_inc $a $u}.
+interpretation "Ordered set uparrow" 'sup_inc s u = (uparrow _ s u).
+
+notation < "a \downarrow \nbsp u" non associative with precedence 50 for @{'inf_dec $a $u}.
+notation > "a \downarrow u" non associative with precedence 50 for @{'inf_dec $a $u}.
+interpretation "Ordered set downarrow" 'inf_dec s u = (downarrow _ s u).
include "nat/plus.ma".
include "nat_ordered_set.ma".
intro; whd in H1; apply (not_le_Sn_n n); apply (transitive_le ??? H2 H1);]
qed.
+lemma trans_decreasing:
+ ∀C:ordered_set.∀a:sequence C.a is_decreasing → ∀n,m:nat_ordered_set. n ≤ m → a m ≤ a n.
+intros 5 (C a Hs n m); elim m; [
+ rewrite > (le_n_O_to_eq n (not_lt_to_le O n H));
+ intro X; cases (os_coreflexive ?? X);]
+cases (le_to_or_lt_eq ?? (not_lt_to_le (S n1) n H1)); clear H1;
+[2: rewrite > H2; intro; cases (os_coreflexive ?? H1);
+|1: apply (le_transitive ???? (Hs ?) (H ?));
+ intro; whd in H1; apply (not_le_Sn_n n); apply (transitive_le ??? H2 H1);]
+qed.
+
lemma trans_increasing_exc:
∀C:ordered_set.∀a:sequence C.a is_increasing → ∀n,m:nat_ordered_set. m ≰ n → a n ≤ a m.
intros 5 (C a Hs n m); elim m; [cases (not_le_Sn_O n H);]
cases (Hs n1); assumption;]
qed.
+lemma trans_decreasing_exc:
+ ∀C:ordered_set.∀a:sequence C.a is_decreasing → ∀n,m:nat_ordered_set. m ≰ n → a m ≤ a n .
+intros 5 (C a Hs n m); elim m; [cases (not_le_Sn_O n H);]
+intro; apply H;
+[1: change in n1 with (os_carr nat_ordered_set); (* canonical structures *)
+ change with (n<n1); (* is sort elimination not allowed preserved by delta? *)
+ cases (le_to_or_lt_eq ?? H1); [apply le_S_S_to_le;assumption]
+ cases (Hs n); rewrite < H3 in H2; assumption (* ogni goal di tipo Prop non è anche di tipo CProp *)
+|2: cases (os_cotransitive ??? (a n1) H2); [2:assumption]
+ cases (Hs n1); assumption;]
+qed.
+
lemma strictly_increasing_reaches:
∀C:ordered_set.∀m:sequence nat_ordered_set.
m is_strictly_increasing → ∀w.∃t.m t ≰ w.
apply (transitive_le ??? H2 Hp);]]
qed.
-lemma selection:
+lemma selection_uparrow:
∀C:ordered_set.∀m:sequence nat_ordered_set.m is_strictly_increasing →
∀a:sequence C.∀u.a ↑ u → (λx.a (m x)) ↑ u.
intros (C m Hm a u Ha); cases Ha (Ia Su); cases Su (Uu Hu); repeat split;
exists [apply w1]; cases (os_cotransitive ??? (a (m w1)) H); [2:assumption]
cases (trans_increasing_exc C ? Ia ?? H1); assumption;]
qed.
-
+
+lemma selection_downarrow:
+ ∀C:ordered_set.∀m:sequence nat_ordered_set.m is_strictly_increasing →
+ ∀a:sequence C.∀u.a ↓ u → (λx.a (m x)) ↓ u.
+intros (C m Hm a u Ha); cases Ha (Ia Su); cases Su (Uu Hu); repeat split;
+[1: intro n; simplify; apply trans_decreasing_exc; [assumption] apply (Hm n);
+|2: intro n; simplify; apply Uu;
+|3: intros (y Hy); simplify; cases (Hu ? Hy);
+ cases (strictly_increasing_reaches C ? Hm w);
+ exists [apply w1]; cases (os_cotransitive ??? (a (m w1)) H); [assumption]
+ cases (trans_decreasing_exc C ? Ia ?? H1); assumption;]
+qed.
+
(* Definition 2.7 *)
-alias symbol "exists" = "CProp exists".
-alias symbol "and" = "constructive and".
+alias id "ExT23" = "cic:/matita/dama/cprop_connectives/exT23.ind#xpointer(1/1)".
definition order_converge ≝
λO:ordered_set.λa:sequence O.λx:O.
- ∃l:sequence O.∃u:sequence O.
- (*l is_increasing ∧ u is_decreasing ∧*) l ↑ x ∧ u ↓ x ∧
- ∀i:nat. (l i) is_infimum (λw.a (w+i)) ∧ (u i) is_supremum (λw.a (w+i)).
+ ExT23 (sequence O) (λl.l ↑ x) (λu.u ↓ x)
+ (λl,u.∀i:nat. (l i) is_infimum (λw.a (w+i)) ∧ (u i) is_supremum (λw.a (w+i))).
notation < "a \nbsp (\circ \atop (\horbar\triangleright)) \nbsp x" non associative with precedence 50
for @{'order_converge $a $x}.
definition pi1 : ∀A.∀P.sigma A P → A ≝ λA,P,s.match s with [sig_in x _ ⇒ x].
-notation < "'fst' \nbsp x" non associative with precedence 50 for @{'pi1 $x}.
-notation < "'snd' \nbsp x" non associative with precedence 50 for @{'pi2 $x}.
-notation > "'fst' x" non associative with precedence 50 for @{'pi1 $x}.
-notation > "'snd' x" non associative with precedence 50 for @{'pi2 $x}.
interpretation "sigma pi1" 'pi1 x = (pi1 _ _ x).
interpretation "Type exists" 'exists \eta.x =
|2: clear H; intro y0; apply (H3 (fst y0));]]
qed.
+lemma segment_preserves_infimum:
+ ∀O:ordered_set.∀l,u:O.∀a:sequence {[l,u]}.∀x:{[l,u]}.
+ (λn.fst (a n)) is_decreasing ∧
+ (fst x) is_infimum (λn.fst (a n)) → a ↓ x.
+intros; split; cases H; clear H;
+[1: apply H1;
+|2: cases H2; split; clear H2;
+ [1: apply H;
+ |2: clear H; intro y0; apply (H3 (fst y0));]]
+qed.
+
+
(* Definition 2.10 *)
coinductive pair (A,B:Type) : Type ≝ prod : ∀a:A.∀b:B.pair A B.
definition first : ∀A.∀P.pair A P → A ≝ λA,P,s.match s with [prod x _ ⇒ x].
[1: cases (H5 ? W) (w Hw); left; exists [apply w] assumption;
|2: right; exists [apply u]; split; [apply W|apply H4]]
qed.
-
-