+notation < "a \nbsp (\circ \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).
+
+(* Definition 2.8 *)
+alias symbol "and" = "constructive and".
+definition segment ≝ λO:ordered_set.λa,b:O.λx:O.(x ≤ b) ∧ (a ≤ x).
+
+notation "[a,b]" left associative with precedence 70 for @{'segment $a $b}.
+interpretation "Ordered set sergment" 'segment a b = (segment _ a b).
+
+notation "hvbox(x \in break [a,b])" non associative with precedence 45
+ for @{'segment_in $a $b $x}.
+interpretation "Ordered set sergment in" 'segment_in a b x= (segment _ a b x).
+
+lemma segment_ordered_set:
+ ∀O:ordered_set.∀u,v:O.ordered_set.
+intros (O u v); apply (mk_ordered_set (∃x.x ∈ [u,v]));
+[1: intros (x y); apply (fst x ≰ fst y);
+|2: intro x; cases x; simplify; apply os_coreflexive;
+|3: intros 3 (x y z); cases x; cases y ; cases z; simplify; apply os_cotransitive]
+qed.
+
+notation "hvbox({[a, break b]})" non associative with precedence 90
+ for @{'segment_set $a $b}.
+interpretation "Ordered set segment" 'segment_set a b =
+ (segment_ordered_set _ a b).
+
+(* Lemma 2.9 *)
+lemma segment_preserves_supremum:
+ ∀O:ordered_set.∀l,u:O.∀a:sequence {[l,u]}.∀x:{[l,u]}.
+ ⌊n,fst (a n)⌋ is_increasing ∧
+ (fst x) is_supremum ⌊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.
+
+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 *)
+alias symbol "square" = "ordered set square".
+alias symbol "pi2" = "pair pi2".
+alias symbol "pi1" = "pair pi1".
+definition square_segment ≝
+ λO:ordered_set.λa,b:O.λx:O square.
+ And4 (fst x ≤ b) (a ≤ fst x) (snd x ≤ b) (a ≤ snd x).
+
+definition convex ≝
+ λO:ordered_set.λU:O square → Prop.
+ ∀p.U p → fst p ≤ snd p → ∀y. square_segment ? (fst p) (snd p) y → U y.
+
+(* Definition 2.11 *)
+definition upper_located ≝
+ λO:ordered_set.λa:sequence O.∀x,y:O. y ≰ x →
+ (∃i:nat.a i ≰ x) ∨ (∃b:O.y≰b ∧ ∀i:nat.a i ≤ b).
+
+definition lower_located ≝
+ λO:ordered_set.λa:sequence O.∀x,y:O. x ≰ y →
+ (∃i:nat.x ≰ a i) ∨ (∃b:O.b≰y ∧ ∀i:nat.b ≤ a i).
+
+notation < "s \nbsp 'is_upper_located'" non associative with precedence 45
+ for @{'upper_located $s}.
+notation > "s 'is_upper_located'" non associative with precedence 45
+ for @{'upper_located $s}.
+interpretation "Ordered set upper locatedness" 'upper_located s =
+ (upper_located _ s).
+
+notation < "s \nbsp 'is_lower_located'" non associative with precedence 45
+ for @{'lower_located $s}.
+notation > "s 'is_lower_located'" non associative with precedence 45
+ for @{'lower_located $s}.
+interpretation "Ordered set lower locatedness" 'lower_located s =
+ (lower_located _ s).
+
+(* Lemma 2.12 *)
+lemma uparrow_upperlocated:
+ ∀C:ordered_set.∀a:sequence C.∀u:C.a ↑ u → a is_upper_located.
+intros (C a u H); cases H (H2 H3); clear H; intros 3 (x y Hxy);
+cases H3 (H4 H5); clear H3; cases (os_cotransitive ??? u Hxy) (W W);
+[2: cases (H5 ? W) (w Hw); left; exists [apply w] assumption;
+|1: right; exists [apply u]; split; [apply W|apply H4]]
+qed.
+
+lemma downarrow_lowerlocated:
+ ∀C:ordered_set.∀a:sequence C.∀u:C.a ↓ u → a is_lower_located.
+intros (C a u H); cases H (H2 H3); clear H; intros 3 (x y Hxy);
+cases H3 (H4 H5); clear H3; cases (os_cotransitive ??? u Hxy) (W W);
+[1: cases (H5 ? W) (w Hw); left; exists [apply w] assumption;
+|2: right; exists [apply u]; split; [apply W|apply H4]]
+qed.