在 Mathematica 中生成拓扑空间图
我有数学代码来检查集合的集合是否满足拓扑的定义,我现在想以编程方式生成如下图:
如何做到这一点?
I have mathematica code to check whether a collection of sets satisfies the definition of a topology, I would now like to programmatically generate diagrams like these:
How can this be done?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我不熟悉你的问题,但要从基元创建图表,看起来有点像你粘贴的图表,你可以这样做:
从“基本”案例开始 -
从此处只需向基本情况添加省略号:
请注意,我在调整这些内容时设置了 Frame->True,以便可以看到坐标。
I'm not familiar with your problem but to create diagrams from primitives, that look kind of like the ones you have pasted, you can do this:
start with the "base" case --
From here just add elipses to the base case:
Note that I set Frame->True while tweaking these so I could see the coordinates.
为了补充迈克的酷图,这里有一种方法来检查列表的任意有限列表是否是拓扑,即(1)它是否包含空集,(2)基集,(3)在有限交集下封闭,以及(3)在并集下封闭:
应用于六个示例
,如
给出
编辑1:为了进一步细化公式,请注意,运算符
给出通过采用集合集合的元素的所有并集和交集而获得的集合。如果集合
list
的集合是算子topoCover
的不动点,那么它就是一个拓扑。因此,我们可以定义一个替代函数来检查list
是否是拓扑:如果
list
不是拓扑,则topoCover
给出的小超集>list
这是一个拓扑。因此给出要添加到
list
中以使其成为拓扑的元素。人们还可以考虑作为拓扑的
list
的最大子集以及要从list
中删除的元素以对其进行拓扑化。这是通过使用Applied 来完成的,例如,当
我们获得两个拓扑
时,要删除要删除的元素以从
list
中获取拓扑,可以使用using
list6
就是从我们得到的
list6
中删除{2,3}
或{1,2}
给出一个拓扑。To complement Mike's cool diagrams, here is a way to check if an arbitrary finite list of lists is a topology, that is, (1) if it contains the empty set, (2) the base set, (3) closed under finite intersections, and (3) closed under union:
Applied to the six examples
like
gives
EDIT 1: For a further refinement of the formulation, note that the operator
gives the collection obtained by taking all unions and intersections of the elements of a collection of sets. A collection of sets
list
is a topology if it is a fixed point of the operatortopoCover
. So one can define an alternative function to check iflist
is topology:If
list
is not a topology,topoCover
gives the smalles superset oflist
which is a topology. Sogives the elements to be added to
list
to make it a topology.One can also consider largest subset(s) of
list
which is a topology and the element(s) to be deleted fromlist
to topologize it. This is done by usingApplied, for example, to
list6
aswe get the two topologies
To get the elements to be removed to get a topology from
list
, one can useUsing with
list6
aswe get
that is, removing
{2,3}
or{1,2}
fromlist6
gives a topology.我无法给出数学特定的解决方案,但考虑到在给定的有限集上找到所有拓扑,我可能会分享一些见解。
朴素算法(检查拓扑空间公理的算法)运行时间约为 $2^2^n$。我们将大大减少搜索空间。要实现的关键点是,对于有限集上的每个预序,都有一个拓扑,反之亦然。给定一个拓扑,我们可以创建一个关系,其中 $x \leq y$ iff $y$ 是 $x$ 所属的所有开集的元素。我相信这就是所谓的专业化预购。根据给定的先序,我们可以通过查找上层集合来恢复拓扑。
因此,如果我们可以找到给定集合上的所有预序,我们就可以恢复所有拓扑。查找预订单要容易得多。先序是一种具有传递性和自反性的二元关系。所以搜索空间是$2^n^2$。
还有一些很酷的算法(Floyd-Warshall)可以找到任何给定关系的传递闭包。找到自反闭包也很容易(只需将单位矩阵添加到邻接矩阵表示中)
I wont be able to give a mathematica specific solution however i might share some insight considering finding all the topologies on a given finite set.
The naive algorithm (the one that checks topological space axioms) runtime would be around $2^2^n$. We will reduce the search space considerably. Key point to realize is that for every preorder on a finite set there is a topology and vice versa. Given a topology one can create a relation where $x \leq y$ iff $y$ is element of all the open sets which $x$ belongs to. I believe this is called specialization preorder. From a given preorder one can recover the topology by finding the upper sets.
So if we can find all the preorders on a given set, we can recover all the topologies. Finding preorders is considerably easier. A preorder is a binary relation which is transitive and reflexive. So the search space is $2^n^2$.
There are also cool algorithms (Floyd-Warshall ) to find the transitive closure of any given relation. Finding the reflexive closure is also easy (just add the identity matrix to the adjacency matrix represantation)