:: Components and Basis of Topological Spaces
:: by Robert Milewski
::
:: Copyright (c) 1999-2021 Association of Mizar Users

scheme :: YELLOW15:sch 1
SeqLambda1C{ F1() -> Nat, F2() -> non empty set , P1[ object ], F3( object ) -> set , F4( object ) -> set } :
ex p being FinSequence of F2() st
( len p = F1() & ( for i being Nat st i in Seg F1() holds
( ( P1[i] implies p . i = F3(i) ) & ( P1[i] implies p . i = F4(i) ) ) ) )
provided
A1: for i being Nat st i in Seg F1() holds
( ( P1[i] implies F3(i) in F2() ) & ( P1[i] implies F4(i) in F2() ) )
proof end;

definition
let X be set ;
let p be FinSequence of bool X;
let q be FinSequence of BOOLEAN ;
func MergeSequence (p,q) -> FinSequence of bool X means :Def1: :: YELLOW15:def 1
( len it = len p & ( for i being Nat st i in dom p holds
it . i = IFEQ ((q . i),TRUE,(p . i),(X \ (p . i))) ) );
existence
ex b1 being FinSequence of bool X st
( len b1 = len p & ( for i being Nat st i in dom p holds
b1 . i = IFEQ ((q . i),TRUE,(p . i),(X \ (p . i))) ) )
proof end;
uniqueness
for b1, b2 being FinSequence of bool X st len b1 = len p & ( for i being Nat st i in dom p holds
b1 . i = IFEQ ((q . i),TRUE,(p . i),(X \ (p . i))) ) & len b2 = len p & ( for i being Nat st i in dom p holds
b2 . i = IFEQ ((q . i),TRUE,(p . i),(X \ (p . i))) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def1 defines MergeSequence YELLOW15:def 1 :
for X being set
for p being FinSequence of bool X
for q being FinSequence of BOOLEAN
for b4 being FinSequence of bool X holds
( b4 = MergeSequence (p,q) iff ( len b4 = len p & ( for i being Nat st i in dom p holds
b4 . i = IFEQ ((q . i),TRUE,(p . i),(X \ (p . i))) ) ) );

theorem :: YELLOW15:1
canceled;

theorem :: YELLOW15:2
canceled;

theorem :: YELLOW15:3
canceled;

::\$CT 3
theorem Th1: :: YELLOW15:4
for X being set
for p being FinSequence of bool X
for q being FinSequence of BOOLEAN holds dom (MergeSequence (p,q)) = dom p
proof end;

theorem Th2: :: YELLOW15:5
for X being set
for p being FinSequence of bool X
for q being FinSequence of BOOLEAN
for i being Nat st q . i = TRUE holds
(MergeSequence (p,q)) . i = p . i
proof end;

theorem Th3: :: YELLOW15:6
for X being set
for p being FinSequence of bool X
for q being FinSequence of BOOLEAN
for i being Nat st i in dom p & q . i = FALSE holds
(MergeSequence (p,q)) . i = X \ (p . i)
proof end;

theorem :: YELLOW15:7
for X being set
for q being FinSequence of BOOLEAN holds len (MergeSequence ((<*> (bool X)),q)) = 0
proof end;

theorem Th5: :: YELLOW15:8
for X being set
for q being FinSequence of BOOLEAN holds MergeSequence ((<*> (bool X)),q) = <*> (bool X)
proof end;

theorem :: YELLOW15:9
for X being set
for x being Subset of X
for q being FinSequence of BOOLEAN holds len (MergeSequence (<*x*>,q)) = 1
proof end;

theorem :: YELLOW15:10
for X being set
for x being Subset of X
for q being FinSequence of BOOLEAN holds
( ( q . 1 = TRUE implies (MergeSequence (<*x*>,q)) . 1 = x ) & ( q . 1 = FALSE implies (MergeSequence (<*x*>,q)) . 1 = X \ x ) )
proof end;

theorem :: YELLOW15:11
for X being set
for x, y being Subset of X
for q being FinSequence of BOOLEAN holds len (MergeSequence (<*x,y*>,q)) = 2
proof end;

theorem :: YELLOW15:12
for X being set
for x, y being Subset of X
for q being FinSequence of BOOLEAN holds
( ( q . 1 = TRUE implies (MergeSequence (<*x,y*>,q)) . 1 = x ) & ( q . 1 = FALSE implies (MergeSequence (<*x,y*>,q)) . 1 = X \ x ) & ( q . 2 = TRUE implies (MergeSequence (<*x,y*>,q)) . 2 = y ) & ( q . 2 = FALSE implies (MergeSequence (<*x,y*>,q)) . 2 = X \ y ) )
proof end;

theorem :: YELLOW15:13
for X being set
for x, y, z being Subset of X
for q being FinSequence of BOOLEAN holds len (MergeSequence (<*x,y,z*>,q)) = 3
proof end;

theorem :: YELLOW15:14
for X being set
for x, y, z being Subset of X
for q being FinSequence of BOOLEAN holds
( ( q . 1 = TRUE implies (MergeSequence (<*x,y,z*>,q)) . 1 = x ) & ( q . 1 = FALSE implies (MergeSequence (<*x,y,z*>,q)) . 1 = X \ x ) & ( q . 2 = TRUE implies (MergeSequence (<*x,y,z*>,q)) . 2 = y ) & ( q . 2 = FALSE implies (MergeSequence (<*x,y,z*>,q)) . 2 = X \ y ) & ( q . 3 = TRUE implies (MergeSequence (<*x,y,z*>,q)) . 3 = z ) & ( q . 3 = FALSE implies (MergeSequence (<*x,y,z*>,q)) . 3 = X \ z ) )
proof end;

theorem Th12: :: YELLOW15:15
for X being set
for p being FinSequence of bool X holds { (Intersect (rng (MergeSequence (p,q)))) where q is FinSequence of BOOLEAN : len q = len p } is Subset-Family of X
proof end;

registration
coherence
for b1 being FinSequence of BOOLEAN holds b1 is boolean-valued
proof end;
end;

definition
let X be set ;
let Y be finite Subset-Family of X;
func Components Y -> Subset-Family of X means :Def2: :: YELLOW15:def 2
ex p being FinSequence of bool X st
( len p = card Y & rng p = Y & it = { (Intersect (rng (MergeSequence (p,q)))) where q is FinSequence of BOOLEAN : len q = len p } );
existence
ex b1 being Subset-Family of X ex p being FinSequence of bool X st
( len p = card Y & rng p = Y & b1 = { (Intersect (rng (MergeSequence (p,q)))) where q is FinSequence of BOOLEAN : len q = len p } )
proof end;
uniqueness
for b1, b2 being Subset-Family of X st ex p being FinSequence of bool X st
( len p = card Y & rng p = Y & b1 = { (Intersect (rng (MergeSequence (p,q)))) where q is FinSequence of BOOLEAN : len q = len p } ) & ex p being FinSequence of bool X st
( len p = card Y & rng p = Y & b2 = { (Intersect (rng (MergeSequence (p,q)))) where q is FinSequence of BOOLEAN : len q = len p } ) holds
b1 = b2
proof end;
end;

:: deftheorem Def2 defines Components YELLOW15:def 2 :
for X being set
for Y being finite Subset-Family of X
for b3 being Subset-Family of X holds
( b3 = Components Y iff ex p being FinSequence of bool X st
( len p = card Y & rng p = Y & b3 = { (Intersect (rng (MergeSequence (p,q)))) where q is FinSequence of BOOLEAN : len q = len p } ) );

registration
let X be set ;
let Y be finite Subset-Family of X;
coherence
proof end;
end;

theorem Th13: :: YELLOW15:16
for X being set
for Y being empty Subset-Family of X holds Components Y = {X}
proof end;

theorem :: YELLOW15:17
for X being set
for Y, Z being finite Subset-Family of X st Z c= Y holds
Components Y is_finer_than Components Z
proof end;

theorem Th15: :: YELLOW15:18
for X being set
for Y being finite Subset-Family of X holds union () = X
proof end;

theorem Th16: :: YELLOW15:19
for X being set
for Y being finite Subset-Family of X
for A, B being set st A in Components Y & B in Components Y & A <> B holds
A misses B
proof end;

definition
let X be set ;
let Y be finite Subset-Family of X;
end;

:: deftheorem defines in_general_position YELLOW15:def 3 :
for X being set
for Y being finite Subset-Family of X holds
( Y is in_general_position iff not {} in Components Y );

theorem :: YELLOW15:20
for X being set
for Y, Z being finite Subset-Family of X st Z is in_general_position & Y c= Z holds
Y is in_general_position
proof end;

theorem :: YELLOW15:21
for X being non empty set
for Y being empty Subset-Family of X holds Y is in_general_position
proof end;

theorem :: YELLOW15:22
for X being non empty set
for Y being finite Subset-Family of X st Y is in_general_position holds
Components Y is a_partition of X
proof end;

theorem Th20: :: YELLOW15:23
for L being non empty RelStr holds
( [#] L is infs-closed & [#] L is sups-closed )
proof end;

theorem Th21: :: YELLOW15:24
for L being non empty RelStr holds
( [#] L is with_bottom & [#] L is with_top )
proof end;

registration
let L be non empty RelStr ;
coherence
( [#] L is infs-closed & [#] L is sups-closed & [#] L is with_bottom & [#] L is with_top )
by ;
end;

theorem :: YELLOW15:25
for L being continuous sup-Semilattice holds [#] L is CLbasis of L
proof end;

theorem :: YELLOW15:26
for L being non empty up-complete Poset st L is finite holds
the carrier of L = the carrier of ()
proof end;

theorem :: YELLOW15:27
for L being lower-bounded sup-Semilattice
for B being Subset of L st B is infinite holds
card B = card ()
proof end;

theorem :: YELLOW15:28
for T being non empty T_0 TopSpace holds card the carrier of T c= card the topology of T
proof end;

theorem Th26: :: YELLOW15:29
for T being TopStruct
for X being Subset of T st X is open holds
for B being finite Subset-Family of T st B is Basis of T holds
for Y being set holds
( not Y in Components B or X misses Y or Y c= X )
proof end;

theorem :: YELLOW15:30
for T being T_0 TopSpace st T is infinite holds
for B being Basis of T holds B is infinite
proof end;

theorem :: YELLOW15:31
for T being non empty TopSpace st T is finite holds
for B being Basis of T
for x being Element of T holds meet { A where A is Element of the topology of T : x in A } in B
proof end;