## 2020年6月24日水曜日

### 数学 - Python - 解析学 - 距離空間の世界 - 位相の基礎的諸概念 - 和集合の境界と境界の和集合、包含関係

1. A、 B を 距離空間 X の任意の部分集合とする。

$\begin{array}{l}{\left(A\cup B\right)}^{f}\\ ={\left(A\cup B\right)}^{a}\{\left(A\cup B\right)}^{i}\\ =\left({A}^{a}\cup {B}^{a}\right)\{\left(A\cup B\right)}^{i}\\ =\left({A}^{a}\{\left(A\cup B\right)}^{i}\right)\cup \left({B}^{a}\{\left(A\cup B\right)}^{i}\right)\\ \subset \left({A}^{a}\{A}^{i}\right)\cup \left({B}^{a}\{B}^{i}\right)\\ ={A}^{f}\cup {B}^{f}\end{array}$

（証明終）

コード

#!/usr/bin/env python3
from unittest import TestCase, main
import random
from sympy import Interval, symbols

print('9.')

class Test(TestCase):
def test_boundary_intersect_closure_union(self):
for _ in range(10):
a0, a1, b0, b1 = [random.randrange(-10, 11) for _ in range(4)]
A = Interval(a0, a1)
B = Interval(b0, b1)
self.assertTrue((A | B).boundary.is_subset(
A.boundary | B.boundary))
A = Interval(a0, a1)
B = Interval.Lopen(b0, b1)
self.assertTrue((A | B).boundary.is_subset(
A.boundary | B.boundary))
A = Interval(a0, a1)
B = Interval.Ropen(b0, b1)
self.assertTrue((A | B).boundary.is_subset(
A.boundary | B.boundary))
A = Interval(a0, a1)
B = Interval.open(b0, b1)
self.assertTrue((A | B).boundary.is_subset(
A.boundary | B.boundary))
A = Interval.Lopen(a0, a1)
B = Interval.Lopen(b0, b1)
self.assertTrue((A | B).boundary.is_subset(
A.boundary | B.boundary))
A = Interval.Lopen(a0, a1)
B = Interval.Ropen(b0, b1)
self.assertTrue((A | B).boundary.is_subset(
A.boundary | B.boundary))
A = Interval.Lopen(a0, a1)
B = Interval.open(b0, b1)
self.assertTrue((A | B).boundary.is_subset(
A.boundary | B.boundary))
A = Interval.Ropen(a0, a1)
B = Interval.Ropen(b0, b1)
self.assertTrue((A | B).boundary.is_subset(
A.boundary | B.boundary))
A = Interval.Ropen(a0, a1)
B = Interval.open(b0, b1)
self.assertTrue((A | B).boundary.is_subset(
A.boundary | B.boundary))
A = Interval.open(a0, a1)
B = Interval.open(b0, b1)
self.assertTrue((A | B).boundary.is_subset(
A.boundary | B.boundary))

if __name__ == "__main__":
main()


% ./sample9.py -v
9.
test_boundary_intersect_closure_union (__main__.Test) ... ok

----------------------------------------------------------------------
Ran 1 test in 0.024s

OK
%