:: Some Properties of Rectangles on the Plane
:: by Artur Korni{\l}owicz and Yasunari Shidama
::
:: Copyright (c) 2004 Association of Mizar Users

begin

set R = the carrier of R^1;

Lm1: the carrier of = [: the carrier of R^1, the carrier of R^1:]
by BORSUK_1:def 5;

theorem :: TOPREALA:1
for i being Integer
for r being real number holds frac (r + i) = frac r
proof end;

theorem Th2: :: TOPREALA:2
for r, a being real number st r <= a & a < [\r/] + 1 holds
[\a/] = [\r/]
proof end;

theorem Th3: :: TOPREALA:3
for r, a being real number st r <= a & a < [\r/] + 1 holds
frac r <= frac a
proof end;

theorem :: TOPREALA:4
for r, a being real number st r < a & a < [\r/] + 1 holds
frac r < frac a
proof end;

theorem Th5: :: TOPREALA:5
for a, r being real number st a >= [\r/] + 1 & a <= r + 1 holds
[\a/] = [\r/] + 1
proof end;

theorem Th6: :: TOPREALA:6
for a, r being real number st a >= [\r/] + 1 & a < r + 1 holds
frac a < frac r
proof end;

theorem :: TOPREALA:7
for r, a, b being real number st r <= a & a < r + 1 & r <= b & b < r + 1 & frac a = frac b holds
a = b
proof end;

begin

registration
let r be real number ;
let s be real positive number ;
cluster K155(r,(r + s)) -> non empty ;
coherence
not ].r,(r + s).[ is empty
proof end;
cluster K153(r,(r + s)) -> non empty ;
coherence
not [.r,(r + s).[ is empty
proof end;
cluster K154(r,(r + s)) -> non empty ;
coherence
not ].r,(r + s).] is empty
proof end;
cluster K152(r,(r + s)) -> non empty ;
coherence
not [.r,(r + s).] is empty
proof end;
cluster K155((r - s),r) -> non empty ;
coherence
not ].(r - s),r.[ is empty
proof end;
cluster K153((r - s),r) -> non empty ;
coherence
not [.(r - s),r.[ is empty
proof end;
cluster K154((r - s),r) -> non empty ;
coherence
not ].(r - s),r.] is empty
proof end;
cluster K152((r - s),r) -> non empty ;
coherence
not [.(r - s),r.] is empty
proof end;
end;

registration
let r be real non positive number ;
let s be real positive number ;
cluster K155(r,s) -> non empty ;
coherence
not ].r,s.[ is empty
proof end;
cluster K153(r,s) -> non empty ;
coherence
not [.r,s.[ is empty
by XXREAL_1:3;
cluster K154(r,s) -> non empty ;
coherence
not ].r,s.] is empty
by XXREAL_1:2;
cluster K152(r,s) -> non empty ;
coherence
not [.r,s.] is empty
by XXREAL_1:1;
end;

registration
let r be real negative number ;
let s be real non negative number ;
cluster K155(r,s) -> non empty ;
coherence
not ].r,s.[ is empty
proof end;
cluster K153(r,s) -> non empty ;
coherence
not [.r,s.[ is empty
by XXREAL_1:3;
cluster K154(r,s) -> non empty ;
coherence
not ].r,s.] is empty
by XXREAL_1:2;
cluster K152(r,s) -> non empty ;
coherence
not [.r,s.] is empty
by XXREAL_1:1;
end;

begin

theorem :: TOPREALA:8
canceled;

theorem :: TOPREALA:9
canceled;

theorem :: TOPREALA:10
canceled;

theorem :: TOPREALA:11
canceled;

theorem :: TOPREALA:12
canceled;

theorem :: TOPREALA:13
canceled;

theorem :: TOPREALA:14
canceled;

theorem :: TOPREALA:15
canceled;

theorem :: TOPREALA:16
canceled;

theorem :: TOPREALA:17
canceled;

theorem :: TOPREALA:18
canceled;

theorem :: TOPREALA:19
canceled;

theorem :: TOPREALA:20
canceled;

theorem :: TOPREALA:21
canceled;

theorem :: TOPREALA:22
for f being Function
for x, X being set st x in dom f & f . x in f .: X & f is one-to-one holds
x in X
proof end;

theorem :: TOPREALA:23
for f being FinSequence
for i being natural number holds
( not i + 1 in dom f or i in dom f or i = 0 )
proof end;

theorem Th24: :: TOPREALA:24
for x, y, X, Y being set
for f being Function st x <> y & f in product ((x,y) --> (X,Y)) holds
( f . x in X & f . y in Y )
proof end;

theorem Th25: :: TOPREALA:25
for a, b being set holds <*a,b*> = (1,2) --> (a,b)
proof end;

begin

registration
cluster non empty strict TopSpace-like constituted-FinSeqs TopStruct ;
existence
ex b1 being TopSpace st
( b1 is constituted-FinSeqs & not b1 is empty & b1 is strict )
proof end;
end;

registration
let T be constituted-FinSeqs TopSpace;
cluster -> constituted-FinSeqs SubSpace of T;
coherence
for b1 being SubSpace of T holds b1 is constituted-FinSeqs
proof end;
end;

theorem Th26: :: TOPREALA:26
for T being non empty TopSpace
for Z being non empty SubSpace of T
for t being Point of T
for z being Point of Z
for N being open a_neighborhood of t
for M being Subset of Z st t = z & M = N /\ ([#] Z) holds
M is open a_neighborhood of z
proof end;

registration
cluster empty TopSpace-like -> discrete anti-discrete TopStruct ;
coherence
for b1 being TopSpace st b1 is empty holds
( b1 is discrete & b1 is anti-discrete )
proof end;
end;

registration
let X be discrete TopSpace;
let Y be TopSpace;
cluster Function-like quasi_total -> continuous Element of bool [: the carrier of X, the carrier of Y:];
coherence
for b1 being Function of X,Y holds b1 is continuous
by TEX_2:68;
end;

theorem Th27: :: TOPREALA:27
for X being TopSpace
for Y being TopStruct
for f being Function of X,Y st f is empty holds
f is continuous
proof end;

registration
let X be TopSpace;
let Y be TopStruct ;
cluster empty Function-like quasi_total -> continuous Element of bool [: the carrier of X, the carrier of Y:];
coherence
for b1 being Function of X,Y st b1 is empty holds
b1 is continuous
by Th27;
end;

theorem :: TOPREALA:28
for X being TopStruct
for Y being non empty TopStruct
for Z being non empty SubSpace of Y
for f being Function of X,Z holds f is Function of X,Y
proof end;

theorem :: TOPREALA:29
for S, T being non empty TopSpace
for X being Subset of S
for Y being Subset of T
for f being continuous Function of S,T
for g being Function of (S | X),(T | Y) st g = f | X holds
g is continuous
proof end;

theorem :: TOPREALA:30
for S, T being non empty TopSpace
for Z being non empty SubSpace of T
for f being Function of S,T
for g being Function of S,Z st f = g & f is open holds
g is open
proof end;

theorem :: TOPREALA:31
for S, T being non empty TopSpace
for S1 being Subset of S
for T1 being Subset of T
for f being Function of S,T
for g being Function of (S | S1),(T | T1) st g = f | S1 & g is onto & f is open & f is one-to-one holds
g is open
proof end;

theorem :: TOPREALA:32
for X, Y, Z being non empty TopSpace
for f being Function of X,Y
for g being Function of Y,Z st f is open & g is open holds
g * f is open
proof end;

theorem :: TOPREALA:33
for X, Y being TopSpace
for Z being open SubSpace of Y
for f being Function of X,Y
for g being Function of X,Z st f = g & g is open holds
f is open
proof end;

theorem Th34: :: TOPREALA:34
for S, T being non empty TopSpace
for f being Function of S,T st f is one-to-one & f is onto holds
( f is continuous iff f " is open )
proof end;

theorem :: TOPREALA:35
for S, T being non empty TopSpace
for f being Function of S,T st f is one-to-one & f is onto holds
( f is open iff f " is continuous )
proof end;

theorem :: TOPREALA:36
for S being TopSpace
for T being non empty TopSpace holds
( S,T are_homeomorphic iff TopStruct(# the carrier of S, the topology of S #), TopStruct(# the carrier of T, the topology of T #) are_homeomorphic )
proof end;

theorem :: TOPREALA:37
for S, T being non empty TopSpace
for f being Function of S,T st f is one-to-one & f is onto & f is continuous & f is open holds
f is being_homeomorphism
proof end;

begin

theorem :: TOPREALA:38
for r being real number
for f being PartFunc of REAL,REAL st f = REAL --> r holds
f | REAL is continuous
proof end;

theorem :: TOPREALA:39
for f, f1, f2 being PartFunc of REAL,REAL st dom f = (dom f1) \/ (dom f2) & dom f1 is open & dom f2 is open & f1 | (dom f1) is continuous & f2 | (dom f2) is continuous & ( for z being set st z in dom f1 holds
f . z = f1 . z ) & ( for z being set st z in dom f2 holds
f . z = f2 . z ) holds
f | (dom f) is continuous
proof end;

theorem Th40: :: TOPREALA:40
for x being Point of R^1
for N being Subset of REAL
for M being Subset of R^1 st M = N & N is Neighbourhood of x holds
M is a_neighborhood of x
proof end;

theorem Th41: :: TOPREALA:41
for x being Point of R^1
for M being a_neighborhood of x ex N being Neighbourhood of x st N c= M
proof end;

theorem Th42: :: TOPREALA:42
for f being Function of R^1,R^1
for g being PartFunc of REAL,REAL
for x being Point of R^1 st f = g & g is_continuous_in x holds
f is_continuous_at x
proof end;

theorem :: TOPREALA:43
for f being Function of R^1,R^1
for g being Function of REAL,REAL st f = g & g is continuous holds
f is continuous
proof end;

theorem :: TOPREALA:44
for a, r, s, b being real number st a <= r & s <= b holds
[.r,s.] is closed Subset of ()
proof end;

theorem :: TOPREALA:45
for a, r, s, b being real number st a <= r & s <= b holds
].r,s.[ is open Subset of ()
proof end;

theorem :: TOPREALA:46
for a, b, r being real number st a <= b & a <= r holds
].r,b.] is open Subset of ()
proof end;

theorem :: TOPREALA:47
for a, b, r being real number st a <= b & r <= b holds
[.a,r.[ is open Subset of ()
proof end;

theorem Th48: :: TOPREALA:48
for a, b, r, s being real number st a <= b & r <= s holds
the carrier of [:(),():] = [:[.a,b.],[.r,s.]:]
proof end;

begin

theorem :: TOPREALA:49
for a, b being real number holds |[a,b]| = (1,2) --> (a,b) by Th25;

theorem :: TOPREALA:50
for a, b being real number holds
( |[a,b]| . 1 = a & |[a,b]| . 2 = b )
proof end;

theorem Th51: :: TOPREALA:51
for a, b, r, s being real number holds closed_inside_of_rectangle (a,b,r,s) = product ((1,2) --> ([.a,b.],[.r,s.]))
proof end;

theorem Th52: :: TOPREALA:52
for a, b, r, s being real number st a <= b & r <= s holds
|[a,r]| in closed_inside_of_rectangle (a,b,r,s)
proof end;

definition
let a, b, c, d be real number ;
func Trectangle (a,b,c,d) -> SubSpace of TOP-REAL 2 equals :: TOPREALA:def 1
() | (closed_inside_of_rectangle (a,b,c,d));
coherence
() | (closed_inside_of_rectangle (a,b,c,d)) is SubSpace of TOP-REAL 2
;
end;

:: deftheorem defines Trectangle TOPREALA:def 1 :
for a, b, c, d being real number holds Trectangle (a,b,c,d) = () | (closed_inside_of_rectangle (a,b,c,d));

theorem :: TOPREALA:53
canceled;

theorem Th54: :: TOPREALA:54
for a, b, r, s being real number st a <= b & r <= s holds
not Trectangle (a,b,r,s) is empty
proof end;

registration
let a, c be real non positive number ;
let b, d be real non negative number ;
cluster Trectangle (a,b,c,d) -> non empty ;
coherence
not Trectangle (a,b,c,d) is empty
by Th54;
end;

definition
func R2Homeomorphism -> Function of ,() means :Def2: :: TOPREALA:def 2
for x, y being real number holds it . [x,y] = <*x,y*>;
existence
ex b1 being Function of ,() st
for x, y being real number holds b1 . [x,y] = <*x,y*>
proof end;
uniqueness
for b1, b2 being Function of ,() st ( for x, y being real number holds b1 . [x,y] = <*x,y*> ) & ( for x, y being real number holds b2 . [x,y] = <*x,y*> ) holds
b1 = b2
proof end;
end;

:: deftheorem Def2 defines R2Homeomorphism TOPREALA:def 2 :
for b1 being Function of ,() holds
( b1 = R2Homeomorphism iff for x, y being real number holds b1 . [x,y] = <*x,y*> );

theorem Th55: :: TOPREALA:55
for A, B being Subset of REAL holds R2Homeomorphism .: [:A,B:] = product ((1,2) --> (A,B))
proof end;

theorem Th56: :: TOPREALA:56
proof end;

theorem Th57: :: TOPREALA:57
for a, b, r, s being real number st a <= b & r <= s holds
R2Homeomorphism | the carrier of [:(),():] is Function of [:(),():],(Trectangle (a,b,r,s))
proof end;

theorem Th58: :: TOPREALA:58
for a, b, r, s being real number st a <= b & r <= s holds
for h being Function of [:(),():],(Trectangle (a,b,r,s)) st h = R2Homeomorphism | the carrier of [:(),():] holds
h is being_homeomorphism
proof end;

theorem :: TOPREALA:59
for a, b, r, s being real number st a <= b & r <= s holds
[:(),():], Trectangle (a,b,r,s) are_homeomorphic
proof end;

theorem Th60: :: TOPREALA:60
for a, b, r, s being real number st a <= b & r <= s holds
for A being Subset of ()
for B being Subset of () holds product ((1,2) --> (A,B)) is Subset of (Trectangle (a,b,r,s))
proof end;

theorem :: TOPREALA:61
for a, b, r, s being real number st a <= b & r <= s holds
for A being open Subset of ()
for B being open Subset of () holds product ((1,2) --> (A,B)) is open Subset of (Trectangle (a,b,r,s))
proof end;

theorem :: TOPREALA:62
for a, b, r, s being real number st a <= b & r <= s holds
for A being closed Subset of ()
for B being closed Subset of () holds product ((1,2) --> (A,B)) is closed Subset of (Trectangle (a,b,r,s))
proof end;