-include "nat/plus.ma".
-include "nat_ordered_set.ma".
-
-alias symbol "nleq" = "Ordered set excess".
-alias symbol "leq" = "Ordered set less or equal than".
-lemma trans_increasing:
- ∀C:ordered_set.∀a:sequence C.a is_increasing → ∀n,m:nat_ordered_set. m ≰ n → a n ≤ a m.
+definition uparrow ≝
+ λC:half_ordered_set.λs:sequence C.λu:C.
+ increasing ? s ∧ supremum ? s u.
+
+interpretation "Ordered set uparrow" 'funion s u = (uparrow (os_l _) s u).
+interpretation "Ordered set downarrow" 'fintersects s u = (uparrow (os_r _) s u).
+
+lemma h_trans_increasing:
+ ∀C:half_ordered_set.∀a:sequence C.increasing ? a →
+ ∀n,m:nat_ordered_set. n ≤ m → a n ≤≤ a m.
+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 (hos_coreflexive ? (a n) X);]
+cases (le_to_or_lt_eq ?? (not_lt_to_le (S n1) n H1)); clear H1;
+[2: rewrite > H2; intro; cases (hos_coreflexive ? (a (S n1)) H1);
+|1: apply (hle_transitive ???? (H ?) (Hs ?));
+ intro; whd in H1; apply (not_le_Sn_n n); apply (transitive_le ??? H2 H1);]
+qed.
+
+notation "'trans_increasing'" non associative with precedence 90 for @{'trans_increasing}.
+notation "'trans_decreasing'" non associative with precedence 90 for @{'trans_decreasing}.
+
+interpretation "trans_increasing" 'trans_increasing = (h_trans_increasing (os_l _)).
+interpretation "trans_decreasing" 'trans_decreasing = (h_trans_increasing (os_r _)).
+
+lemma hint_nat :
+ Type_of_ordered_set nat_ordered_set →
+ hos_carr (os_l (nat_ordered_set)).
+intros; assumption;
+qed.
+
+coercion hint_nat nocomposites.
+
+lemma h_trans_increasing_exc:
+ ∀C:half_ordered_set.∀a:sequence C.increasing ? a →
+ ∀n,m:nat_ordered_set. m ≰≰ n → a n ≤≤ a m.