+ t1 is_supremum s → t2 is_supremum s → t1 ≈ t2.
+intros (O s t1 t2 Ht1 Ht2); cases Ht1 (U1 H1); cases Ht2 (U2 H2);
+apply le_le_eq; intro X;
+[1: cases (H1 ? X); apply (U2 w); assumption
+|2: cases (H2 ? X); apply (U1 w); assumption]
+qed.
+
+(* Fact 2.5 *)
+lemma h_supremum_is_upper_bound:
+ ∀C:half_ordered_set.∀a:sequence C.∀u:C.
+ supremum ? a u → ∀v.upper_bound ? a v → u ≤≤ v.
+intros 7 (C s u Hu v Hv H); cases Hu (_ H1); clear Hu;
+cases (H1 ? H) (w Hw); apply Hv; [apply w] assumption;
+qed.
+
+notation "'supremum_is_upper_bound'" non associative with precedence 90 for @{'supremum_is_upper_bound}.
+notation "'infimum_is_lower_bound'" non associative with precedence 90 for @{'infimum_is_lower_bound}.
+
+interpretation "supremum_is_upper_bound" 'supremum_is_upper_bound = (h_supremum_is_upper_bound (os_l _)).
+interpretation "infimum_is_lower_bound" 'infimum_is_lower_bound = (h_supremum_is_upper_bound (os_r _)).
+
+(* TEST DUALITY
+lemma test_infimum_is_lower_bound_duality:
+ ∀C:ordered_set.∀a:sequence C.∀u:C.
+ u is_infimum a → ∀v.v is_lower_bound a → u ≥ v.
+intros; lapply (infimum_is_lower_bound a u H v H1); assumption;
+qed.
+*)
+
+(* Lemma 2.6 *)
+definition strictly_increasing ≝
+ λC:half_ordered_set.λa:sequence C.∀n:nat.a (S n) ≰≰ a n.
+
+notation < "s \nbsp 'is_strictly_increasing'" non associative with precedence 45
+ for @{'strictly_increasing $s}.
+notation > "s 'is_strictly_increasing'" non associative with precedence 45
+ for @{'strictly_increasing $s}.
+interpretation "Ordered set strict increasing" 'strictly_increasing s =
+ (strictly_increasing (os_l _) s).
+
+notation < "s \nbsp 'is_strictly_decreasing'" non associative with precedence 45
+ for @{'strictly_decreasing $s}.
+notation > "s 'is_strictly_decreasing'" non associative with precedence 45
+ for @{'strictly_decreasing $s}.
+interpretation "Ordered set strict decreasing" 'strictly_decreasing s =
+ (strictly_increasing (os_r _) s).
+
+definition uparrow ≝
+ λC:half_ordered_set.λs:sequence C.λu:C.
+ increasing ? s ∧ supremum ? s u.
+(*
+notation < "a \uparrow \nbsp u" non associative with precedence 45 for @{'sup_inc $a $u}.
+notation > "a \uparrow u" non associative with precedence 45 for @{'sup_inc $a $u}.
+*)
+interpretation "Ordered set uparrow" 'funion s u = (uparrow (os_l _) s u).
+
+(*
+notation < "a \downarrow \nbsp u" non associative with precedence 45 for @{'inf_dec $a $u}.
+notation > "a \downarrow u" non associative with precedence 45 for @{'inf_dec $a $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 ?? X);]
+cases (le_to_or_lt_eq ?? (not_lt_to_le (S n1) n H1)); clear H1;
+[2: rewrite > H2; intro; cases (hos_coreflexive ?? 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 _)).
+
+(* TEST DUALITY
+lemma test_trans_decreasing_duality:
+ ∀C:ordered_set.∀a:sequence C.a is_decreasing →
+ ∀n,m:nat_ordered_set. n ≤ m → a m ≤ a n.
+intros; apply (trans_decreasing ? H ?? H1); qed.
+*)
+
+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.
+intros 5 (C a Hs n m); elim m; [cases (not_le_Sn_O n H);]
+intro; apply H;
+[1: change in n1 with (hos_carr (os_l nat_ordered_set));
+ change with (n<n1);
+ cases (le_to_or_lt_eq ?? H1); [apply le_S_S_to_le;assumption]
+ cases (Hs n); rewrite < H3 in H2; assumption;
+|2: cases (hos_cotransitive ??? (a n1) H2); [assumption]
+ cases (Hs n1); assumption;]
+qed.
+
+notation "'trans_increasing_exc'" non associative with precedence 90 for @{'trans_increasing_exc}.
+notation "'trans_decreasing_exc'" non associative with precedence 90 for @{'trans_decreasing_exc}.
+
+interpretation "trans_increasing_exc" 'trans_increasing_exc = (h_trans_increasing_exc (os_l _)).
+interpretation "trans_decreasing_exc" 'trans_decreasing_exc = (h_trans_increasing_exc (os_r _)).
+
+alias symbol "exists" = "CProp exists".
+lemma nat_strictly_increasing_reaches:
+ ∀m:sequence nat_ordered_set.
+ m is_strictly_increasing → ∀w.∃t.m t ≰ w.
+intros; elim w;
+[1: cases (nat_discriminable O (m O)); [2: cases (not_le_Sn_n O (ltn_to_ltO ?? H1))]
+ cases H1; [exists [apply O] apply H2;]
+ exists [apply (S O)] lapply (H O) as H3; rewrite < H2 in H3; assumption
+|2: cases H1 (p Hp); cases (nat_discriminable (S n) (m p));
+ [1: cases H2; clear H2;
+ [1: exists [apply p]; assumption;
+ |2: exists [apply (S p)]; rewrite > H3; apply H;]
+ |2: cases (?:False); change in Hp with (n<m p);
+ apply (not_le_Sn_n (m p));
+ apply (transitive_le ??? H2 Hp);]]
+qed.
+
+lemma h_selection_uparrow:
+ ∀C:half_ordered_set.∀m:sequence nat_ordered_set.
+ m is_strictly_increasing →
+ ∀a:sequence C.∀u.uparrow ? a u → uparrow ? ⌊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 (h_trans_increasing_exc ? a Ia); apply (Hm n);
+|2: intro n; simplify; apply Uu;
+|3: intros (y Hy); simplify; cases (Hu ? Hy);
+ cases (nat_strictly_increasing_reaches ? Hm w);
+ exists [apply w1]; cases (hos_cotransitive ??? (a (m w1)) H); [2:assumption]
+ cases (h_trans_increasing_exc ?? Ia ?? H1); assumption;]
+qed.
+
+notation "'selection_uparrow'" non associative with precedence 90 for @{'selection_uparrow}.
+notation "'selection_downarrow'" non associative with precedence 90 for @{'selection_downarrow}.
+
+interpretation "selection_uparrow" 'selection_uparrow = (h_selection_uparrow (os_l _)).
+interpretation "selection_downarrow" 'selection_downarrow = (h_selection_uparrow (os_r _)).
+
+(* Definition 2.7 *)
+definition order_converge ≝
+ λO:ordered_set.λa:sequence O.λx:O.
+ exT23 (sequence O) (λl.l ↑ x) (λu.u ↓ x)
+ (λl,u:sequence O.∀i:nat. (l i) is_infimum ⌊w,a (w+i)⌋ ∧
+ (u i) is_supremum ⌊w,a (w+i)⌋).
+
+notation < "a \nbsp (\cir \atop (\horbar\triangleright)) \nbsp x" non associative with precedence 45
+ for @{'order_converge $a $x}.
+notation > "a 'order_converges' x" non associative with precedence 45
+ for @{'order_converge $a $x}.
+interpretation "Order convergence" 'order_converge s u = (order_converge _ s u).