:: The Ordering of Points on a Curve, Part {IV}
:: by Artur Korni{\l}owicz
::
:: Copyright (c) 2002-2021 Association of Mizar Users

Lm1: dom proj1 = the carrier of ()
by FUNCT_2:def 1;

Lm2: dom proj2 = the carrier of ()
by FUNCT_2:def 1;

theorem :: JORDAN18:1
for a, b being Real holds (a - b) ^2 = (b - a) ^2 ;

theorem :: JORDAN18:2
for S, T being non empty TopStruct
for f being Function of S,T
for A being Subset of T st f is being_homeomorphism & A is compact holds
f " A is compact
proof end;

theorem Th3: :: JORDAN18:3
for a being Point of () holds proj2 .: () is bounded_below
proof end;

theorem Th4: :: JORDAN18:4
for a being Point of () holds proj2 .: () is bounded_above
proof end;

theorem Th5: :: JORDAN18:5
for a being Point of () holds proj1 .: () is bounded_above
proof end;

theorem Th6: :: JORDAN18:6
for a being Point of () holds proj1 .: () is bounded_below
proof end;

registration
let a be Point of ();
cluster proj2 .: () -> non empty ;
coherence
not proj2 .: () is empty
by ;
cluster proj2 .: () -> non empty ;
coherence
not proj2 .: () is empty
by ;
cluster proj1 .: () -> non empty ;
coherence
not proj1 .: () is empty
by ;
cluster proj1 .: () -> non empty ;
coherence
not proj1 .: () is empty
by ;
end;

theorem Th7: :: JORDAN18:7
for a being Point of () holds lower_bound () = a 2
proof end;

theorem Th8: :: JORDAN18:8
for a being Point of () holds upper_bound () = a 2
proof end;

theorem :: JORDAN18:9
for a being Point of () holds upper_bound () = a 1
proof end;

theorem :: JORDAN18:10
for a being Point of () holds lower_bound () = a 1
proof end;

Lm3: TopStruct(# the carrier of (), the topology of () #) = TopSpaceMetr ()
by EUCLID:def 8;

registration
let a be Point of ();
coherence
proof end;
coherence
proof end;
coherence
proof end;
coherence
proof end;
end;

theorem Th11: :: JORDAN18:11
for P being Subset of ()
for a being Point of () st a in BDD P holds
not north_halfline a c= UBD P
proof end;

theorem Th12: :: JORDAN18:12
for P being Subset of ()
for a being Point of () st a in BDD P holds
not south_halfline a c= UBD P
proof end;

theorem :: JORDAN18:13
for P being Subset of ()
for a being Point of () st a in BDD P holds
not east_halfline a c= UBD P
proof end;

theorem :: JORDAN18:14
for P being Subset of ()
for a being Point of () st a in BDD P holds
not west_halfline a c= UBD P
proof end;

theorem Th15: :: JORDAN18:15
for C being Simple_closed_curve
for P being Subset of ()
for p1, p2 being Point of () st P is_an_arc_of p1,p2 & P c= C holds
ex R being non empty Subset of () st
( R is_an_arc_of p1,p2 & P \/ R = C & P /\ R = {p1,p2} )
proof end;

definition
let p be Point of ();
let P be Subset of ();
func North-Bound (p,P) -> Point of () equals :: JORDAN18:def 1
|[(p 1),(lower_bound (proj2 .: (P /\ ())))]|;
correctness
coherence
|[(p 1),(lower_bound (proj2 .: (P /\ ())))]| is Point of ()
;
;
func South-Bound (p,P) -> Point of () equals :: JORDAN18:def 2
|[(p 1),(upper_bound (proj2 .: (P /\ ())))]|;
correctness
coherence
|[(p 1),(upper_bound (proj2 .: (P /\ ())))]| is Point of ()
;
;
end;

:: deftheorem defines North-Bound JORDAN18:def 1 :
for p being Point of ()
for P being Subset of () holds North-Bound (p,P) = |[(p 1),(lower_bound (proj2 .: (P /\ ())))]|;

:: deftheorem defines South-Bound JORDAN18:def 2 :
for p being Point of ()
for P being Subset of () holds South-Bound (p,P) = |[(p 1),(upper_bound (proj2 .: (P /\ ())))]|;

theorem :: JORDAN18:16
for P being Subset of ()
for p being Point of () holds
( (North-Bound (p,P)) 1 = p 1 & (South-Bound (p,P)) 1 = p 1 ) by EUCLID:52;

theorem Th17: :: JORDAN18:17
for p being Point of ()
for C being compact Subset of () st p in BDD C holds
( North-Bound (p,C) in C & North-Bound (p,C) in north_halfline p & South-Bound (p,C) in C & South-Bound (p,C) in south_halfline p )
proof end;

theorem Th18: :: JORDAN18:18
for p being Point of ()
for C being compact Subset of () st p in BDD C holds
( (South-Bound (p,C)) 2 < p 2 & p 2 < (North-Bound (p,C)) 2 )
proof end;

theorem Th19: :: JORDAN18:19
for p being Point of ()
for C being compact Subset of () st p in BDD C holds
lower_bound (proj2 .: (C /\ ())) > upper_bound (proj2 .: (C /\ ()))
proof end;

theorem :: JORDAN18:20
for p being Point of ()
for C being compact Subset of () st p in BDD C holds
South-Bound (p,C) <> North-Bound (p,C)
proof end;

theorem Th21: :: JORDAN18:21
for p being Point of ()
for C being Subset of () holds LSeg ((North-Bound (p,C)),(South-Bound (p,C))) is vertical
proof end;

theorem :: JORDAN18:22
for p being Point of ()
for C being compact Subset of () st p in BDD C holds
(LSeg ((North-Bound (p,C)),(South-Bound (p,C)))) /\ C = {(North-Bound (p,C)),(South-Bound (p,C))}
proof end;

theorem :: JORDAN18:23
for p, q being Point of ()
for C being compact Subset of () st p in BDD C & q in BDD C & p 1 <> q 1 holds
North-Bound (p,C), South-Bound (q,C), North-Bound (q,C), South-Bound (p,C) are_mutually_distinct
proof end;

definition
let n be Element of NAT ;
let V be Subset of ();
let s1, s2, t1, t2 be Point of ();
pred s1,s2,V -separate t1,t2 means :: JORDAN18:def 3
for A being Subset of () st A is_an_arc_of s1,s2 & A c= V holds
A meets {t1,t2};
end;

:: deftheorem defines -separate JORDAN18:def 3 :
for n being Element of NAT
for V being Subset of ()
for s1, s2, t1, t2 being Point of () holds
( s1,s2,V -separate t1,t2 iff for A being Subset of () st A is_an_arc_of s1,s2 & A c= V holds
A meets {t1,t2} );

notation
let n be Element of NAT ;
let V be Subset of ();
let s1, s2, t1, t2 be Point of ();
antonym s1,s2 are_neighbours_wrt t1,t2,V for s1,s2,V -separate t1,t2;
end;

theorem :: JORDAN18:24
for n being Element of NAT
for V being Subset of ()
for s1, s2, t being Point of () holds t,t,V -separate s1,s2 by JORDAN6:37;

theorem :: JORDAN18:25
for n being Element of NAT
for V being Subset of ()
for s1, s2, t1, t2 being Point of () st s1,s2,V -separate t1,t2 holds
s2,s1,V -separate t1,t2 by JORDAN5B:14;

theorem :: JORDAN18:26
for n being Element of NAT
for V being Subset of ()
for s1, s2, t1, t2 being Point of () st s1,s2,V -separate t1,t2 holds
s1,s2,V -separate t2,t1 ;

theorem Th27: :: JORDAN18:27
for n being Element of NAT
for V being Subset of ()
for s, t1, t2 being Point of () holds s,t1,V -separate s,t2
proof end;

theorem Th28: :: JORDAN18:28
for n being Element of NAT
for V being Subset of ()
for s, t1, t2 being Point of () holds t1,s,V -separate t2,s
proof end;

theorem Th29: :: JORDAN18:29
for n being Element of NAT
for V being Subset of ()
for s, t1, t2 being Point of () holds t1,s,V -separate s,t2
proof end;

theorem Th30: :: JORDAN18:30
for n being Element of NAT
for V being Subset of ()
for s, t1, t2 being Point of () holds s,t1,V -separate t2,s
proof end;

theorem :: JORDAN18:31
for C being Simple_closed_curve
for p1, p2, q being Point of () st q in C & p1 in C & p2 in C & p1 <> p2 & p1 <> q & p2 <> q holds
p1,p2 are_neighbours_wrt q,q,C
proof end;

theorem :: JORDAN18:32
for C being Simple_closed_curve
for p1, p2, q1, q2 being Point of () st p1 <> p2 & p1 in C & p2 in C & p1,p2,C -separate q1,q2 holds
q1,q2,C -separate p1,p2
proof end;

theorem :: JORDAN18:33
for C being Simple_closed_curve
for p1, p2, q1, q2 being Point of () st p1 in C & p2 in C & q1 in C & p1 <> p2 & q1 <> p1 & q1 <> p2 & q2 <> p1 & q2 <> p2 & not p1,p2 are_neighbours_wrt q1,q2,C holds
p1,q1 are_neighbours_wrt p2,q2,C
proof end;