:: WEIERSTR semantic presentation

theorem Th1: :: WEIERSTR:1
for b1 being MetrSpace
for b2, b3 being Point of b1
for b4, b5 being Real ex b6 being Point of b1ex b7 being Real st (Ball b2,b4) \/ (Ball b3,b5) c= Ball b6,b7
proof end;

theorem Th2: :: WEIERSTR:2
for b1 being MetrSpace
for b2 being Nat
for b3 being Subset-Family of b1
for b4 being FinSequence st b3 is finite & b3 is_ball-family & rng b4 = b3 & dom b4 = Seg (b2 + 1) holds
ex b5 being Subset-Family of b1 st
( b5 is finite & b5 is_ball-family & ex b6 being FinSequence st
( rng b6 = b5 & dom b6 = Seg b2 & ex b7 being Point of b1ex b8 being Real st union b3 c= (union b5) \/ (Ball b7,b8) ) )
proof end;

theorem Th3: :: WEIERSTR:3
for b1 being MetrSpace
for b2 being Subset-Family of b1 st b2 is finite & b2 is_ball-family holds
ex b3 being Point of b1ex b4 being Real st union b2 c= Ball b3,b4
proof end;

definition
let c1, c2 be non empty TopSpace;
let c3 be Function of c1,c2;
let c4 be Subset-Family of c2;
func c3 " c4 -> Subset-Family of a1 means :Def1: :: WEIERSTR:def 1
for b1 being Subset of a1 holds
( b1 in a5 iff ex b2 being Subset of a2 st
( b2 in a4 & b1 = a3 " b2 ) );
existence
ex b1 being Subset-Family of c1 st
for b2 being Subset of c1 holds
( b2 in b1 iff ex b3 being Subset of c2 st
( b3 in c4 & b2 = c3 " b3 ) )
proof end;
uniqueness
for b1, b2 being Subset-Family of c1 st ( for b3 being Subset of c1 holds
( b3 in b1 iff ex b4 being Subset of c2 st
( b4 in c4 & b3 = c3 " b4 ) ) ) & ( for b3 being Subset of c1 holds
( b3 in b2 iff ex b4 being Subset of c2 st
( b4 in c4 & b3 = c3 " b4 ) ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def1 defines " WEIERSTR:def 1 :
for b1, b2 being non empty TopSpace
for b3 being Function of b1,b2
for b4 being Subset-Family of b2
for b5 being Subset-Family of b1 holds
( b5 = b3 " b4 iff for b6 being Subset of b1 holds
( b6 in b5 iff ex b7 being Subset of b2 st
( b7 in b4 & b6 = b3 " b7 ) ) );

theorem Th4: :: WEIERSTR:4
for b1, b2 being non empty TopSpace
for b3 being Function of b1,b2
for b4, b5 being Subset-Family of b2 st b4 c= b5 holds
b3 " b4 c= b3 " b5
proof end;

theorem Th5: :: WEIERSTR:5
for b1, b2 being non empty TopSpace
for b3 being Function of b1,b2
for b4 being Subset-Family of b2 st b3 is continuous & b4 is open holds
b3 " b4 is open
proof end;

definition
let c1, c2 be non empty TopSpace;
let c3 be Function of c1,c2;
let c4 be Subset-Family of c1;
func c3 .: c4 -> Subset-Family of a2 means :Def2: :: WEIERSTR:def 2
for b1 being Subset of a2 holds
( b1 in a5 iff ex b2 being Subset of a1 st
( b2 in a4 & b1 = a3 .: b2 ) );
existence
ex b1 being Subset-Family of c2 st
for b2 being Subset of c2 holds
( b2 in b1 iff ex b3 being Subset of c1 st
( b3 in c4 & b2 = c3 .: b3 ) )
proof end;
uniqueness
for b1, b2 being Subset-Family of c2 st ( for b3 being Subset of c2 holds
( b3 in b1 iff ex b4 being Subset of c1 st
( b4 in c4 & b3 = c3 .: b4 ) ) ) & ( for b3 being Subset of c2 holds
( b3 in b2 iff ex b4 being Subset of c1 st
( b4 in c4 & b3 = c3 .: b4 ) ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def2 defines .: WEIERSTR:def 2 :
for b1, b2 being non empty TopSpace
for b3 being Function of b1,b2
for b4 being Subset-Family of b1
for b5 being Subset-Family of b2 holds
( b5 = b3 .: b4 iff for b6 being Subset of b2 holds
( b6 in b5 iff ex b7 being Subset of b1 st
( b7 in b4 & b6 = b3 .: b7 ) ) );

theorem Th6: :: WEIERSTR:6
for b1, b2 being non empty TopSpace
for b3 being Function of b1,b2
for b4, b5 being Subset-Family of b1 st b4 c= b5 holds
b3 .: b4 c= b3 .: b5
proof end;

theorem Th7: :: WEIERSTR:7
for b1, b2 being non empty TopSpace
for b3 being Function of b1,b2
for b4 being Subset-Family of b2
for b5 being Subset of b2 st b3 .: (b3 " b4) is_a_cover_of b5 holds
b4 is_a_cover_of b5
proof end;

theorem Th8: :: WEIERSTR:8
for b1, b2 being non empty TopSpace
for b3 being Function of b1,b2
for b4 being Subset-Family of b1
for b5 being Subset of b1 st b4 is_a_cover_of b5 holds
b3 " (b3 .: b4) is_a_cover_of b5
proof end;

theorem Th9: :: WEIERSTR:9
for b1, b2 being non empty TopSpace
for b3 being Function of b1,b2
for b4 being Subset-Family of b2 holds union (b3 .: (b3 " b4)) c= union b4
proof end;

theorem Th10: :: WEIERSTR:10
for b1, b2 being non empty TopSpace
for b3 being Function of b1,b2
for b4 being Subset-Family of b1 holds union b4 c= union (b3 " (b3 .: b4))
proof end;

theorem Th11: :: WEIERSTR:11
for b1, b2 being non empty TopSpace
for b3 being Function of b1,b2
for b4 being Subset-Family of b2 st b4 is finite holds
b3 " b4 is finite
proof end;

theorem Th12: :: WEIERSTR:12
for b1, b2 being non empty TopSpace
for b3 being Function of b1,b2
for b4 being Subset-Family of b1 st b4 is finite holds
b3 .: b4 is finite
proof end;

theorem Th13: :: WEIERSTR:13
for b1, b2 being non empty TopSpace
for b3 being Function of b1,b2
for b4 being Subset of b1
for b5 being Subset-Family of b2 st ex b6 being Subset-Family of b1 st
( b6 c= b3 " b5 & b6 is_a_cover_of b4 & b6 is finite ) holds
ex b6 being Subset-Family of b2 st
( b6 c= b5 & b6 is_a_cover_of b3 .: b4 & b6 is finite )
proof end;

theorem Th14: :: WEIERSTR:14
for b1, b2 being non empty TopSpace
for b3 being Function of b1,b2
for b4 being Subset of b1 st b4 is compact & b3 is continuous holds
b3 .: b4 is compact
proof end;

theorem Th15: :: WEIERSTR:15
for b1 being non empty TopSpace
for b2 being Function of b1,R^1
for b3 being Subset of b1 st b3 is compact & b2 is continuous holds
b2 .: b3 is compact by Th14;

theorem Th16: :: WEIERSTR:16
for b1 being Function of (TOP-REAL 2),R^1
for b2 being Subset of (TOP-REAL 2) st b2 is compact & b1 is continuous holds
b1 .: b2 is compact by Th14;

definition
let c1 be Subset of R^1 ;
func [#] c1 -> Subset of REAL equals :: WEIERSTR:def 3
a1;
correctness
coherence
c1 is Subset of REAL
;
by TOPMETR:24;
end;

:: deftheorem Def3 defines [#] WEIERSTR:def 3 :
for b1 being Subset of R^1 holds [#] b1 = b1;

theorem Th17: :: WEIERSTR:17
for b1 being Subset of R^1 st b1 is compact holds
[#] b1 is bounded
proof end;

theorem Th18: :: WEIERSTR:18
for b1 being Subset of R^1 st b1 is compact holds
[#] b1 is closed
proof end;

theorem Th19: :: WEIERSTR:19
for b1 being Subset of R^1 st b1 is compact holds
[#] b1 is compact
proof end;

Lemma12: for b1 being non empty TopSpace
for b2 being Function of b1,R^1
for b3 being Subset of b1 st b3 <> {} & b3 is compact & b2 is continuous holds
ex b4, b5 being Point of b1 st
( b4 in b3 & b5 in b3 & b2 . b4 = upper_bound ([#] (b2 .: b3)) & b2 . b5 = lower_bound ([#] (b2 .: b3)) )
proof end;

definition
let c1 be Subset of R^1 ;
func upper_bound c1 -> Real equals :: WEIERSTR:def 4
upper_bound ([#] a1);
correctness
coherence
upper_bound ([#] c1) is Real
;
;
func lower_bound c1 -> Real equals :: WEIERSTR:def 5
lower_bound ([#] a1);
correctness
coherence
lower_bound ([#] c1) is Real
;
;
end;

:: deftheorem Def4 defines upper_bound WEIERSTR:def 4 :
for b1 being Subset of R^1 holds upper_bound b1 = upper_bound ([#] b1);

:: deftheorem Def5 defines lower_bound WEIERSTR:def 5 :
for b1 being Subset of R^1 holds lower_bound b1 = lower_bound ([#] b1);

theorem Th20: :: WEIERSTR:20
for b1 being non empty TopSpace
for b2 being Function of b1,R^1
for b3 being Subset of b1 st b3 <> {} & b3 is compact & b2 is continuous holds
ex b4 being Point of b1 st
( b4 in b3 & b2 . b4 = upper_bound (b2 .: b3) )
proof end;

theorem Th21: :: WEIERSTR:21
for b1 being non empty TopSpace
for b2 being Function of b1,R^1
for b3 being Subset of b1 st b3 <> {} & b3 is compact & b2 is continuous holds
ex b4 being Point of b1 st
( b4 in b3 & b2 . b4 = lower_bound (b2 .: b3) )
proof end;

definition
let c1 be non empty MetrSpace;
let c2 be Point of c1;
func dist c2 -> Function of (TopSpaceMetr a1),R^1 means :Def6: :: WEIERSTR:def 6
for b1 being Point of a1 holds a3 . b1 = dist b1,a2;
existence
ex b1 being Function of (TopSpaceMetr c1),R^1 st
for b2 being Point of c1 holds b1 . b2 = dist b2,c2
proof end;
uniqueness
for b1, b2 being Function of (TopSpaceMetr c1),R^1 st ( for b3 being Point of c1 holds b1 . b3 = dist b3,c2 ) & ( for b3 being Point of c1 holds b2 . b3 = dist b3,c2 ) holds
b1 = b2
proof end;
end;

:: deftheorem Def6 defines dist WEIERSTR:def 6 :
for b1 being non empty MetrSpace
for b2 being Point of b1
for b3 being Function of (TopSpaceMetr b1),R^1 holds
( b3 = dist b2 iff for b4 being Point of b1 holds b3 . b4 = dist b4,b2 );

theorem Th22: :: WEIERSTR:22
for b1 being non empty MetrSpace
for b2 being Point of b1 holds dist b2 is continuous
proof end;

theorem Th23: :: WEIERSTR:23
for b1 being non empty MetrSpace
for b2 being Point of b1
for b3 being Subset of (TopSpaceMetr b1) st b3 <> {} & b3 is compact holds
ex b4 being Point of (TopSpaceMetr b1) st
( b4 in b3 & (dist b2) . b4 = upper_bound ((dist b2) .: b3) )
proof end;

theorem Th24: :: WEIERSTR:24
for b1 being non empty MetrSpace
for b2 being Point of b1
for b3 being Subset of (TopSpaceMetr b1) st b3 <> {} & b3 is compact holds
ex b4 being Point of (TopSpaceMetr b1) st
( b4 in b3 & (dist b2) . b4 = lower_bound ((dist b2) .: b3) )
proof end;

definition
let c1 be non empty MetrSpace;
let c2 be Subset of (TopSpaceMetr c1);
func dist_max c2 -> Function of (TopSpaceMetr a1),R^1 means :Def7: :: WEIERSTR:def 7
for b1 being Point of a1 holds a3 . b1 = upper_bound ((dist b1) .: a2);
existence
ex b1 being Function of (TopSpaceMetr c1),R^1 st
for b2 being Point of c1 holds b1 . b2 = upper_bound ((dist b2) .: c2)
proof end;
uniqueness
for b1, b2 being Function of (TopSpaceMetr c1),R^1 st ( for b3 being Point of c1 holds b1 . b3 = upper_bound ((dist b3) .: c2) ) & ( for b3 being Point of c1 holds b2 . b3 = upper_bound ((dist b3) .: c2) ) holds
b1 = b2
proof end;
func dist_min c2 -> Function of (TopSpaceMetr a1),R^1 means :Def8: :: WEIERSTR:def 8
for b1 being Point of a1 holds a3 . b1 = lower_bound ((dist b1) .: a2);
existence
ex b1 being Function of (TopSpaceMetr c1),R^1 st
for b2 being Point of c1 holds b1 . b2 = lower_bound ((dist b2) .: c2)
proof end;
uniqueness
for b1, b2 being Function of (TopSpaceMetr c1),R^1 st ( for b3 being Point of c1 holds b1 . b3 = lower_bound ((dist b3) .: c2) ) & ( for b3 being Point of c1 holds b2 . b3 = lower_bound ((dist b3) .: c2) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def7 defines dist_max WEIERSTR:def 7 :
for b1 being non empty MetrSpace
for b2 being Subset of (TopSpaceMetr b1)
for b3 being Function of (TopSpaceMetr b1),R^1 holds
( b3 = dist_max b2 iff for b4 being Point of b1 holds b3 . b4 = upper_bound ((dist b4) .: b2) );

:: deftheorem Def8 defines dist_min WEIERSTR:def 8 :
for b1 being non empty MetrSpace
for b2 being Subset of (TopSpaceMetr b1)
for b3 being Function of (TopSpaceMetr b1),R^1 holds
( b3 = dist_min b2 iff for b4 being Point of b1 holds b3 . b4 = lower_bound ((dist b4) .: b2) );

theorem Th25: :: WEIERSTR:25
for b1 being non empty MetrSpace
for b2 being Subset of (TopSpaceMetr b1) st b2 is compact holds
for b3, b4 being Point of b1 st b3 in b2 holds
( dist b3,b4 <= upper_bound ((dist b4) .: b2) & lower_bound ((dist b4) .: b2) <= dist b3,b4 )
proof end;

theorem Th26: :: WEIERSTR:26
for b1 being non empty MetrSpace
for b2 being Subset of (TopSpaceMetr b1) st b2 <> {} & b2 is compact holds
for b3, b4 being Point of b1 holds abs ((upper_bound ((dist b3) .: b2)) - (upper_bound ((dist b4) .: b2))) <= dist b3,b4
proof end;

theorem Th27: :: WEIERSTR:27
for b1 being non empty MetrSpace
for b2 being Subset of (TopSpaceMetr b1) st b2 <> {} & b2 is compact holds
for b3, b4 being Point of b1
for b5, b6 being Real st b5 = (dist_max b2) . b3 & b6 = (dist_max b2) . b4 holds
abs (b5 - b6) <= dist b3,b4
proof end;

theorem Th28: :: WEIERSTR:28
for b1 being non empty MetrSpace
for b2 being Subset of (TopSpaceMetr b1) st b2 <> {} & b2 is compact holds
for b3, b4 being Point of b1 holds abs ((lower_bound ((dist b3) .: b2)) - (lower_bound ((dist b4) .: b2))) <= dist b3,b4
proof end;

theorem Th29: :: WEIERSTR:29
for b1 being non empty MetrSpace
for b2 being Subset of (TopSpaceMetr b1) st b2 <> {} & b2 is compact holds
for b3, b4 being Point of b1
for b5, b6 being Real st b5 = (dist_min b2) . b3 & b6 = (dist_min b2) . b4 holds
abs (b5 - b6) <= dist b3,b4
proof end;

theorem Th30: :: WEIERSTR:30
for b1 being non empty MetrSpace
for b2 being Subset of (TopSpaceMetr b1) st b2 <> {} & b2 is compact holds
dist_max b2 is continuous
proof end;

theorem Th31: :: WEIERSTR:31
for b1 being non empty MetrSpace
for b2, b3 being Subset of (TopSpaceMetr b1) st b2 <> {} & b2 is compact & b3 <> {} & b3 is compact holds
ex b4 being Point of (TopSpaceMetr b1) st
( b4 in b3 & (dist_max b2) . b4 = upper_bound ((dist_max b2) .: b3) )
proof end;

theorem Th32: :: WEIERSTR:32
for b1 being non empty MetrSpace
for b2, b3 being Subset of (TopSpaceMetr b1) st b2 <> {} & b2 is compact & b3 <> {} & b3 is compact holds
ex b4 being Point of (TopSpaceMetr b1) st
( b4 in b3 & (dist_max b2) . b4 = lower_bound ((dist_max b2) .: b3) )
proof end;

theorem Th33: :: WEIERSTR:33
for b1 being non empty MetrSpace
for b2 being Subset of (TopSpaceMetr b1) st b2 <> {} & b2 is compact holds
dist_min b2 is continuous
proof end;

theorem Th34: :: WEIERSTR:34
for b1 being non empty MetrSpace
for b2, b3 being Subset of (TopSpaceMetr b1) st b2 <> {} & b2 is compact & b3 <> {} & b3 is compact holds
ex b4 being Point of (TopSpaceMetr b1) st
( b4 in b3 & (dist_min b2) . b4 = upper_bound ((dist_min b2) .: b3) )
proof end;

theorem Th35: :: WEIERSTR:35
for b1 being non empty MetrSpace
for b2, b3 being Subset of (TopSpaceMetr b1) st b2 <> {} & b2 is compact & b3 <> {} & b3 is compact holds
ex b4 being Point of (TopSpaceMetr b1) st
( b4 in b3 & (dist_min b2) . b4 = lower_bound ((dist_min b2) .: b3) )
proof end;

definition
let c1 be non empty MetrSpace;
let c2, c3 be Subset of (TopSpaceMetr c1);
func min_dist_min c2,c3 -> Real equals :: WEIERSTR:def 9
lower_bound ((dist_min a2) .: a3);
correctness
coherence
lower_bound ((dist_min c2) .: c3) is Real
;
;
func max_dist_min c2,c3 -> Real equals :: WEIERSTR:def 10
upper_bound ((dist_min a2) .: a3);
correctness
coherence
upper_bound ((dist_min c2) .: c3) is Real
;
;
func min_dist_max c2,c3 -> Real equals :: WEIERSTR:def 11
lower_bound ((dist_max a2) .: a3);
correctness
coherence
lower_bound ((dist_max c2) .: c3) is Real
;
;
func max_dist_max c2,c3 -> Real equals :: WEIERSTR:def 12
upper_bound ((dist_max a2) .: a3);
correctness
coherence
upper_bound ((dist_max c2) .: c3) is Real
;
;
end;

:: deftheorem Def9 defines min_dist_min WEIERSTR:def 9 :
for b1 being non empty MetrSpace
for b2, b3 being Subset of (TopSpaceMetr b1) holds min_dist_min b2,b3 = lower_bound ((dist_min b2) .: b3);

:: deftheorem Def10 defines max_dist_min WEIERSTR:def 10 :
for b1 being non empty MetrSpace
for b2, b3 being Subset of (TopSpaceMetr b1) holds max_dist_min b2,b3 = upper_bound ((dist_min b2) .: b3);

:: deftheorem Def11 defines min_dist_max WEIERSTR:def 11 :
for b1 being non empty MetrSpace
for b2, b3 being Subset of (TopSpaceMetr b1) holds min_dist_max b2,b3 = lower_bound ((dist_max b2) .: b3);

:: deftheorem Def12 defines max_dist_max WEIERSTR:def 12 :
for b1 being non empty MetrSpace
for b2, b3 being Subset of (TopSpaceMetr b1) holds max_dist_max b2,b3 = upper_bound ((dist_max b2) .: b3);

theorem Th36: :: WEIERSTR:36
for b1 being non empty MetrSpace
for b2, b3 being Subset of (TopSpaceMetr b1) st b2 <> {} & b2 is compact & b3 <> {} & b3 is compact holds
ex b4, b5 being Point of b1 st
( b4 in b2 & b5 in b3 & dist b4,b5 = min_dist_min b2,b3 )
proof end;

theorem Th37: :: WEIERSTR:37
for b1 being non empty MetrSpace
for b2, b3 being Subset of (TopSpaceMetr b1) st b2 <> {} & b2 is compact & b3 <> {} & b3 is compact holds
ex b4, b5 being Point of b1 st
( b4 in b2 & b5 in b3 & dist b4,b5 = min_dist_max b2,b3 )
proof end;

theorem Th38: :: WEIERSTR:38
for b1 being non empty MetrSpace
for b2, b3 being Subset of (TopSpaceMetr b1) st b2 <> {} & b2 is compact & b3 <> {} & b3 is compact holds
ex b4, b5 being Point of b1 st
( b4 in b2 & b5 in b3 & dist b4,b5 = max_dist_min b2,b3 )
proof end;

theorem Th39: :: WEIERSTR:39
for b1 being non empty MetrSpace
for b2, b3 being Subset of (TopSpaceMetr b1) st b2 <> {} & b2 is compact & b3 <> {} & b3 is compact holds
ex b4, b5 being Point of b1 st
( b4 in b2 & b5 in b3 & dist b4,b5 = max_dist_max b2,b3 )
proof end;

theorem Th40: :: WEIERSTR:40
for b1 being non empty MetrSpace
for b2, b3 being Subset of (TopSpaceMetr b1) st b2 is compact & b3 is compact holds
for b4, b5 being Point of b1 st b4 in b2 & b5 in b3 holds
( min_dist_min b2,b3 <= dist b4,b5 & dist b4,b5 <= max_dist_max b2,b3 )
proof end;