学習環境
集合・位相入門 (松坂 和夫 (著)、岩波書店 )の第1章(集合と写像)、2(集合間の演算)、問題6、7を取り組んでみる。
A ∪ (
B ∩ C
)
= (
A ∪ B
) ∩ (
A ∪ C
)
= (
A ∪ B
) ∩ C
A Δ B
= (
A − B
) ∪ (
B − A
)
= (
B − A
) ∪ (
A − B
)
= B Δ A
(
A ∪ B
) − (
A ∩ B
)
= (
A ∪ B
) ∩
(
A ∩ B
)
c
= (
A ∪ B
) ∩ (
A
c
∪
B
c
)
= (
A ∩ (
A
c
∪
B
c
)
) ∪ (
B ∩ (
A
c
∪
B
c
)
)
= (
(
A ∩
A
c
) ∪ (
A ∩
B
c
)
) ∪ (
(
B ∩
A
c
) ∪ (
B ∩
B
c
)
)
= (
ϕ ∪ (
A ∩
B
c
)
) ∪ (
(
B ∩
A
c
) ∪ ϕ
)
= (
A ∩
B
c
) ∪ (
B ∩
A
c
)
= (
A ∩
B
c
) ∪ (
A
c
∩ B
)
(
A Δ B
) Δ C
= (
(
A ∩
B
c
) ∪ (
A
c
∩ B
)
) Δ C
= (
(
(
A ∩
B
c
) ∪ (
A
c
∩ B
)
) ∩
C
c
) ∪ (
(
(
A ∩
B
c
) ∪ (
A
c
∩ B
)
)
c
∩ C
)
= (
(
A ∩
B
c
∩
C
c
) ∪ (
A
c
∩ B ∩
C
c
)
) ∪ (
(
(
A ∩
B
c
)
c
∩
(
A
c
∩ B
)
c
) ∩ C
)
= (
(
A ∩
B
c
∩
C
c
) ∪ (
A
c
∩ B ∩
C
c
)
) ∪ (
(
(
A
c
∪ B
) ∩ (
A ∪
B
c
)
) ∩ C
)
= (
(
A ∩
B
c
∩
C
c
) ∪ (
A
c
∩ B ∩
C
c
)
) ∪ (
(
(
A
c
∪ B
) ∩ (
A ∪
B
c
)
) ∩ C
)
= (
(
A ∩
B
c
∩
C
c
) ∪ (
A
c
∩ B ∩
C
c
)
) ∪ (
(
(
A
c
∩ (
A ∪
B
c
)
) ∪ (
B ∩ (
A ∪
B
c
)
)
) ∩ C
)
= (
(
A ∩
B
c
∩
C
c
) ∪ (
A
c
∩ B ∩
C
c
)
) ∪ (
(
(
A
c
∩
B
c
) ∪ (
B ∩ A
)
) ∩ C
)
= (
(
A ∩
B
c
∩
C
c
) ∪ (
A
c
∩ B ∩
C
c
)
) ∪ (
(
A
c
∩
B
c
∩ C
) ∪ (
A ∩ B ∩ C
)
)
= (
A ∩
B
c
∩
C
c
) ∪ (
A
c
∩ B ∩
C
c
) ∪ (
A
c
∩
B
c
∩ C
) ∪ (
A ∩ B ∩ C
)
A Δ (
B Δ C
)
= A Δ (
(
B ∩
C
c
) ∪ (
B
c
∩ C
)
)
= (
A ∩
(
(
B ∩
C
c
) ∪ (
B
c
∩ C
)
)
c
) ∪ (
A
c
∩ (
(
B ∩
C
c
) ∪ (
B
c
∩ C
)
)
)
= (
A ∩ (
(
B ∩
C
c
)
c
∩
(
B
c
∩ C
)
c
)
) ∪ (
(
A
c
∩ B ∩
C
c
) ∪ (
A
c
∩
B
c
∩ C
)
)
= (
A ∩ (
(
B
c
∪ C
) ∩ (
B ∪
C
c
)
)
) ∪ (
(
A
c
∩ B ∩
C
c
) ∪ (
A
c
∩
B
c
∩ C
)
)
= (
A ∩ (
(
(
B
c
∪ C
) ∩ B
) ∪ (
(
B
c
∪ C
) ∩
C
c
)
)
) ∪ (
(
A
c
∩ B ∩
C
c
) ∪ (
A
c
∩
B
c
∩ C
)
)
= (
A ∩ (
(
B ∩ C
) ∪ (
B
c
∩
C
c
)
)
) ∪ (
(
A
c
∩ B ∩
C
c
) ∪ (
A
c
∩
B
c
∩ C
)
)
= (
(
A ∩ B ∩ C
) ∪ (
A ∩
B
c
∩
C
c
)
) ∪ (
(
A
c
∩ B ∩
C
c
) ∪ (
A
c
∩
B
c
∩ C
)
)
= (
A ∩ B ∩ C
) ∪ (
A ∩
B
c
∩
C
c
) ∪ (
A
c
∩ B ∩
C
c
) ∪ (
A
c
∩
B
c
∩ C
)
(
A Δ B
) Δ C = A Δ (
B Δ C
)
A ∩ (
B Δ C
)
= A ∩ (
(
B ∩
C
c
) ∪ (
B
c
∩ C
)
)
= (
A ∩ B ∩
C
c
) ∪ (
A ∩
B
c
∩ C
)
(
A ∩ B
) Δ (
A ∩ C
)
= (
(
A ∩ B
) ∩
(
A ∩ C
)
c
) ∪ (
(
A ∩ B
)
c
∩ (
A ∩ C
)
)
= (
(
A ∩ B
) ∩ (
A
c
∪
C
c
)
) ∪ (
(
A
c
∪
B
c
) ∩ (
A ∩ C
)
)
= (
A ∩ B ∩
C
c
) ∪ (
A ∩
B
c
∩ C
)
コード(Emacs )
Python 3
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from matplotlib_venn import venn3_unweighted
import matplotlib. pyplot as plt
from sympy import pprint, FiniteSet, Interval
print ( '6.' )
X = FiniteSet (* range ( 7 ))
A = FiniteSet (* range ( 5 ))
B = FiniteSet (* range ( 6 ))
C = FiniteSet (* range ( 7 ))
for X0 in [ X, A, B, C]:
pprint ( X0)
print ( A. is_subset ( C))
print ( A | ( B & C) == ( A | B) & C)
venn3_unweighted ( subsets=( A, B, C))
plt. savefig ( 'sample6.svg' )
入出力結果(Terminal, Jupyter(IPython))
$ ./sample6.py
6.
{0, 1, 2, 3, 4, 5, 6}
{0, 1, 2, 3, 4}
{0, 1, 2, 3, 4, 5}
{0, 1, 2, 3, 4, 5, 6}
True
True
$
0 コメント:
コメントを投稿