📜 ⬆️ ⬇️

Introduction to topological spaces. Java finite topology programming. Part 2: Base topology. Continuous display

Parts list:





Introduction


Last time we met with the basic concepts of the theory of topological spaces, and also considered a class for representing finite topological spaces, written in the Java language. Today we will move on, examine the concept of a base of topology and get an idea of ​​what it is needed for, and also define the concept of a continuous mapping of topological spaces. The main interest is caused by the fact that in the topological space there is no concept of distance between objects , but nevertheless, we can describe in formal language the sufficient proximity of objects in terms ... Well, by the way, you will find out later.

Base topology


Before we go further, I would like to ask you the following simple question.
')
Exercise 0. Let X be a set of n elements. How many elements does the discrete topology of t contain, which contains all the subsets of the set X?

Obviously, the answer will be 2 n .
If we used the class described in the previous article to create a discrete topology on a set of 10 elements, then we would need to add 1024 sets to the topology: quite a lot of routine work, don't you find?

But with the help of the base, you only need to set only 10 sets instead of 1024. And if your topology is not discrete, then even less.

So, we proceed to the definition. There are several equivalent definitions of the base topology. I will give the basic definition used in the Kolmogorov school, and then I will prove the equivalence of another definition.

Definition 1. A collection J of open subsets of a set X is called a base of topology if any open subset G of the space (X, t) can be represented as the union of a certain set of sets from J.

From the mathematical point of view, this definition is quite understandable, but to program it is a fairly non-trivial task. The situation is complicated by the fact that the set G does not have to be the union of two sets of a base, it can be the union of three, and four, and so on.

Fortunately, the following theorem will help simplify the matter.
Theorem 1. In order for system J to be a base of topology, it is necessary and sufficient that for each open set G and for each point x from G there exists a set G (x) belonging to J and containing x such that G (x) is subset of G.

The proof of the theorem is also rather simple. First we prove the sufficiency of the condition. This means that if the written condition is satisfied, then J will be the base of the topology.
But if it is satisfied, then G can be represented as a union over all x from G of the sets G (x), that is, the condition from the definition is satisfied, and J is the base of the topology.
The necessity of the condition means that if J is a base, then our condition is true. But if J is a base, then any open set is representable as a union of sets from J, whence the condition immediately follows.

This theorem is already better at helping to program the algorithm for determining whether a given system of subsets is a base, however, the difficulty here is that the first quantifier of a condition is a universal quantifier.

And this means that when designing the algorithm, we have to go from the opposite: first, we believe that our system is a base, and we change the solution if the opposite is true.

In mathematics, such conditions are reversed as follows: the quantifier of universality is replaced by the quantifier of existence and vice versa, and the predicate is replaced by the reverse.

Therefore, the algorithm written in natural language will be as follows:

1. We consider that the argument of the method is the base of the topology.
2. If there exists an open set G and such a point x from G that any set G from the method argument containing x is NOT a subset of G, then return FALSE, otherwise return TRUE.
public boolean isBase(FSet<FSet<Integer>> mbbase) { boolean flag = true; Node t = first; while (t != null && flag) { FSet<Integer> open = t.elem; FSet<Integer>.Node openNode = open.first; boolean isSubsetOpen = true; while (openNode != null && isSubsetOpen) { Integer x = openNode.elem; Node baseNode = mbbase.first; boolean forall = true; while (baseNode != null && forall) { if (baseNode.elem.contains(x) && baseNode.elem.subset(open)) forall = false; baseNode = baseNode.next; } if (forall) { flag = false; isSubsetOpen = false; } openNode = openNode.next; } t = t.next; } return flag; } 


Now create a small class for the base.
 public class Base extends FSet<FSet<Integer>>{ public Base() { super(); } } 


This is necessary in order to be able to write a topology constructor on the base.

If we just wrote FSet <FSet>, we would get the following error from the compiler: we already have a constructor with FSet parameters. This is a feature of the Java language.

And to supplement the system to the topology is quite easy, just add a few private methods. But before, simple puzzles.

Problem 1. Let X be the set of cardinality n, and m the discrete topology defined on this set. Find the base topology.

 private void uniteAll() { for (Node p = first; p != null; p = p.next) { for (Node q = first; q != null; q = q.next) add(p.elem.union(q.elem)); } } private void intersectAll() { for (Node p = first; p != null; p = p.next) { for (Node q = first; q != null; q = q.next) add(p.elem.intersection(q.elem)); } } public Topology(Base base) { for (Node p = base.first; p != null; p = p.next) add(p.elem); boolean isTpl = isTopology(); while (!isTpl) { uniteAll(); intersectAll(); isTpl = isTopology(); } } 


Answer to the problem
The base of the topology consists of all singleton subsets: {{1}, {2}, ..., {n}}


If we talk about general topology, then a rather important class of topological spaces are spaces with a countable base. They are also called spaces with the second axiom of countability.

It is easy to see that finite topological spaces, namely, we program them, form a subset of all spaces with the second axiom of countability.

But if this is the second axiom of countability, then there must be the first one, right? We are going to do it now and then plunge into continuous mappings.

Determining neighborhood systems



Definition 2. Let for a point x of a topological space X there exists no more than a countable system of neighborhoods {O n (x)} such that for every open set G containing x there is a neighborhood O n (x) contained in G. This The system is called the defining system of neighborhoods of the point x.

Definition 3. If for each point x there exists its defining system of neighborhoods, then the space satisfies the first axiom of countability.

This definition is of greater interest in the framework of the general topology than in the finite topologies considered now, since it is possible to simply take the system of all neighborhoods of a given point as such a system. However, even here you can put one interesting question, which I will kindly give you.

Task 3. Give an example of a finite topological space in which the defining system of neighborhoods of a point lies strictly inside the system of all neighborhoods of a given point.

 public boolean isFundamentalSystem(int x, ArrayList<FSet<Integer>> neighbourhoods) { boolean flag = true; Node t = first; while (t != null && flag) { FSet<Integer> open = t.elem; if (open.contains(x)) { int i = 0; boolean isSubset = false; while (i < neighbourhoods.size() && !isSubset) { if (neighbourhoods.get(i).subset(open)) isSubset = true; i++; } if (!isSubset) flag = false; } t = t.next; } return flag; } 


Answer to the problem
Let X = {1,2,3,4}, m = {Ø, {1}, {3}, {2,4}, {1,3}, {1,2,4}, {2,3 , 4}, {1,2,3,4}}.

The system {{3}} is the defining system of the neighborhood of point 3.


Continuous display


Here we come to the most interesting place of our lecture today. To continuous mappings.

In principle, Java already has an interface for mappings: Mapper , but due to the fact that it contains two methods, it cannot be used as a functional interface.

I use Java 8, and I would like to write mappings in a more convenient way than to create a class, an implementation interface, and so on. If your development environment does not support Java 8, the method code will still work, but the call code will have to be changed.

So, I will create the following simple interface.
 @FunctionalInterface public interface Mapping { Integer f(Integer x); } 


The summary above is optional, but it will give an error if you add another abstract method to the interface.

We now turn to the mathematical side of the question and give the concept of continuity in terms of neighborhoods of a point.

Definition 4. Let (X, 1) and (Y, 2) be two topological spaces. A mapping f of a space X to a space Y is called continuous at the point x 0 , if for any neighborhood U y 0 of the point y 0 = f (x 0 ) there is a neighborhood V x 0 of the point x 0 such that f (V x 0 ) is contained inside U y 0 . A mapping f is called continuous if it is continuous at each point.

If this is translated into Russian, then the definition of continuity at a point would sound something like this: Whatever neighborhood of the image of a given point we take, there is a neighborhood of this point that the image of this neighborhood lies within the neighborhood of the image of a point.

Just a minute ... If we recall the beginning of the analysis, then we get exactly the definition of the continuity of the function according to Cauchy, with the only difference that we left the epsilon-delta of the language and replaced the partial order ratio in the definition of proximity.

But not everything is so simple here. Therefore, I offer you an interesting puzzle.
Problem 4. Let X be a topological space with a base {{1}, {2,4}, {1,2,3,4}}, Y with a base {{1}, {3}, {1,2, 3.4}}.
Consider the identity mapping f from X to Y, acting by the rule f (x) = x. Is it continuous? If so, prove it. If not, show where it breaks.
The same question applies to the mapping f from Y to X, acting by the rule f (x) = x.

 public boolean isContinuous(Mapping f, Integer x0, Topology Y) { boolean flag = true; int y0 = ff(x0); ArrayList<FSet<Integer>> Uy0 = Y.getNeighbourhoods(y0); ArrayList<FSet<Integer>> Vx0 = getNeighbourhoods(x0); int i = 0; while (i < Uy0.size() && flag) { int j = 0; boolean subset = false; while (j < Vx0.size() && !subset) { FSet<Integer> image = new FSet<>(); for (FSet<Integer>.Node p = Vx0.get(j).first; p != null; p = p.next) { image.add(ff(p.elem)); } if (image.subset(Uy0.get(i))) subset = true; j++; } if (!subset) flag = false; i++; } return flag; } 


This time I will give you the execution code:

 package generaltopology; import java.util.*; public class FSetDemo { public static void main(String[] args) { Base baseX = new Base(); FSet<Integer> x = new FSet<>(); x.add(1); x.add(2); x.add(3); x.add(4); FSet<Integer> a = new FSet<>(); a.add(1); FSet<Integer> b = new FSet<>(); b.add(2); b.add(4); FSet<Integer> c = new FSet<>(); c.add(3); baseX.add(a); baseX.add(b); baseX.add(x); Base baseY = new Base(); baseY.add(a); baseY.add(c); baseY.add(x); Topology tau = new Topology(baseX); System.out.println(tau); Topology tau2 = new Topology(baseY); System.out.println(tau2); for (int i = 1; i <= 4; i++) { System.out.print(tau.isContinuous(u -> u, i, tau2) + " "); } System.out.println(); for (int i = 1; i <= 4; i++) { System.out.print(tau2.isContinuous(u -> u, i, tau) + " "); } } } 


As you can see, the use of lambda expressions is quite justified here, since it allows you to accurately set the rule for mapping one space to another.

And, as I promised, the answer is:

Answer
Neither mapping is continuous.
The mapping of X to Y is discontinuous at point 3.
The mapping of Y to X is discontinuous at points 2 and 4.


Conclusion
Today we got acquainted with the important concept of the base of topology and learned how to build the whole topology of space on it. We learned about the axioms of countability and the fact that finite topologies satisfy both axioms of countability.

In the next part, I plan to talk a little more about the mappings of topological spaces, introduce the notion of open and closed mappings, and also give a sign of the continuity of the mapping, which will be simpler than stated in the definition and move on to a new topic: separability axioms.

At the end of this series of articles, I also plan to give some practical example of the application of the final topology. Thanks for attention!

Source: https://habr.com/ru/post/249163/


All Articles