Basic Procedures
>
|
#(1)A procedure to generate a topology from a given subbasis S.
|
>
|
GT1:={seq(O intersect S[i],i=1..nops(S))} ; B:=B union GT1;
|
>
|
GT2:={seq(O union B[i],i=1..nops(B))};
|
>
|
#(2)A procedure to check if a given collection over X is Topology or not .
|
>
|
if not`subset`(T,powerset(X)) then false; else
|
>
|
CuT:={seq(O intersect T[i],i=1..nops(T)),seq(O union T[i],i=1..nops(T))};
|
>
|
#A procedure to finds the clopen sets of the topology(T)
|
>
|
CO:=proc(X,T)
|
>
|
if member(X minus A,T)then W:=W union{A};fi;
|
>
|
#A procedure to obtain the relative topology on a subset of X .
|
>
|
#A procedure to chek that if the topology is connected [1].
|
>
|
#A procedure to find the connected components of a given point .
|
>
|
K:=proc(x,X,T)
local i,S,SK;
SK:={};
S:=map2(`union`,{x},powerset(X));
for i to nops(S) do
if isConn(S[i],subspace(S[i],X,T)) then SK:=SK union S[i];fi;
od; SK ;
end:

|
>
|
#(i)A procedure to list all topologies on a finite set.
|
>
|
ALLT:=proc(probableT)
local T,ALLTOPO;
|
>
|
if CheckTopology(T)=true then ALLTOPO:=ALLTOPO union {T};else
|
>
|
#(ii)A procedure to list the connected topologies on a finite set X .
|
>
|
AllConnected:=proc( AllTopologies)
|
>
|
for T in AllTopologies do
|
>
|
if CO(X,T)={X,{}} then B:= B union {T}; else B:=B;
|
>
|
end:
#(iii)A procedure to find the connected components of a given space.
|
>
|
ALLCC:=proc(X,T)
local x,CC;
CC:={};
for x in X do
CC:=CC union {K(x,X,T)};
od;
CC;
end:
|
>
|

|
>
|

|
>
|
probableT:={seq(w union{{},X},w=W)}:
|
| (1) |
>
|
AllTopologies:=ALLT(probableT);
|
| (2) |
>
|
print(`the number of topologies is`,nops(AllTopologies),`over a set with `,nops(X),`points`);
|
| (3) |
>
|
Allconnectedtopologies:=AllConnected(AllTopologies);
|
| (4) |
>
|
print(`there are `,nops(Allconnectedtopologies),`connected spaces on a set X with `,nops(X),`points` ):
|
| (5) |
>
|
|
| (6) |
>
|
probableT:={seq(w union{{},X},w=W)}:
|
>
|
AllTopologies:=ALLT(probableT);
|

| (7) |
>
|
print(`the number of topologies is`,nops(AllTopologies),`over a set with `,nops(X),`points`);
|
| (8) |
>
|
Allconnectedtopologies:=AllConnected(AllTopologies);
|
| (9) |
>
|
print(`there are `,nops(Allconnectedtopologies),`connected spaces on a set X with `,nops(X),`points` );
|
| (10) |
>
|
|
| (11) |
>
|
probableT:={seq(w union{{},X},w=W)}:
|
>
|
AllTopologies:=ALLT(probableT);
|

| (12) |
>
|
print(`the number of topologies is`,nops(AllTopologies),`over a set with `,nops(X),`points`);
|
| (13) |
>
|
Allconnectedtopologies:=AllConnected(AllTopologies);
|

| (14) |
>
|
print(`there are `,nops(Allconnectedtopologies),`connected spaces on a set X with `,nops(X),`points` );
|
| (15) |
>
|
#All connected components;
|
>
|

|
| (16) |
| (17) |
>
|
ALLConnected_Components:=ALLCC(X,T);
|
| (18) |
>
|

|
| (19) |

| (20) |
>
|
ALLConnected_Components:=ALLCC(X,T);
|
| (21) |
>
|

|
| (22) |
>
|
T:={{},{a},{a,b},{c,d},{a,c,d},X};
|
| (23) |
>
|
ALLConnected_Components:=ALLCC(X,T);
|
| (24) |
>
|
|
>
|
|
>
|
|
>
|
|
|