2020年6月25日木曜日

学習環境

解析入門(中) (松坂和夫 数学入門シリーズ 5) (松坂 和夫(著)、岩波書店)の第12章(距離空間の世界)、12.1(位相の基礎的諸概念)、問題10の解答を求めてみる。


  1. A a i a i = A a i a a \ A a i a f = A α i a \ A a i a f = A a i i = A a i
    A i a i A i a A i a i a A i a a A i a i a A i a A i a A i A i a i A i i = A i A i a i a A i a A i a i a = A i a

    (証明終)

コード

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

print('10.')


class Test(TestCase):
    def test_boundary_intersect_closure_union(self):
        for _ in range(10):
            a0, a1 = [random.randrange(-10, 11) for _ in range(2)]
            A = Interval(a0, a1)
            self.assertEqual(
                A.closure.interior.closure.interior,
                A.closure.interior,
            )
            self.assertEqual(
                A.interior.closure.interior.closure,
                A.interior.closure,
            )
            A = Interval(a0, a1)
            self.assertEqual(
                A.closure.interior.closure.interior,
                A.closure.interior,
            )
            self.assertEqual(
                A.interior.closure.interior.closure,
                A.interior.closure,
            )
            A = Interval(a0, a1)
            self.assertEqual(
                A.closure.interior.closure.interior,
                A.closure.interior,
            )
            self.assertEqual(
                A.interior.closure.interior.closure,
                A.interior.closure,
            )
            A = Interval(a0, a1)
            self.assertEqual(
                A.closure.interior.closure.interior,
                A.closure.interior,
            )
            self.assertEqual(
                A.interior.closure.interior.closure,
                A.interior.closure,
            )
            A = Interval.Lopen(a0, a1)
            self.assertEqual(
                A.closure.interior.closure.interior,
                A.closure.interior,
            )
            self.assertEqual(
                A.interior.closure.interior.closure,
                A.interior.closure,
            )
            A = Interval.Lopen(a0, a1)
            self.assertEqual(
                A.closure.interior.closure.interior,
                A.closure.interior,
            )
            self.assertEqual(
                A.interior.closure.interior.closure,
                A.interior.closure,
            )
            A = Interval.Lopen(a0, a1)
            self.assertEqual(
                A.closure.interior.closure.interior,
                A.closure.interior,
            )
            self.assertEqual(
                A.interior.closure.interior.closure,
                A.interior.closure,
            )
            A = Interval.Ropen(a0, a1)
            self.assertEqual(
                A.closure.interior.closure.interior,
                A.closure.interior,
            )
            self.assertEqual(
                A.interior.closure.interior.closure,
                A.interior.closure,
            )
            A = Interval.Ropen(a0, a1)
            self.assertEqual(
                A.closure.interior.closure.interior,
                A.closure.interior,
            )
            self.assertEqual(
                A.interior.closure.interior.closure,
                A.interior.closure,
            )
            A = Interval.open(a0, a1)
            self.assertEqual(
                A.closure.interior.closure.interior,
                A.closure.interior,
            )
            self.assertEqual(
                A.interior.closure.interior.closure,
                A.interior.closure,
            )


if __name__ == "__main__":
    main()

入出力結果(Zsh、PowerShell、Terminal、Jupyter(IPython))

% ./sample10.py -v
10.
test_boundary_intersect_closure_union (__main__.Test) ... ok

----------------------------------------------------------------------
Ran 1 test in 1.508s

OK
%

0 コメント:

コメントを投稿