学習環境
- Surface 3 (4G LTE)、Surface 3 タイプ カバー、Surface ペン(端末)
- Windows 10 Pro (OS)
- 数式入力ソフト(TeX, MathML): MathType
- MathML対応ブラウザ: Firefox、Safari
- MathML非対応ブラウザ(Internet Explorer, Google Chrome...)用JavaScript Library: MathJax
集合・位相入門(松坂 和夫(著)、岩波書店)の第1章(集合と写像)、2(集合の間の演算)、問題3.を取り組んでみる。
問題3.
x∈A−B⇒x∈A∧x∉B⇒x∈A∪B∧x∉B⇒x∈(A∪B)−B⇒x∈A∧x∉B⇒x∈A∧x∉B∩A⇒x∈A−(A∩B)⇒x∈A∧x∉A∩B⇒x∈A∧(x∈Ac∨x∈Bc)⇒x∈A∧x∈Bc⇒x∈A∩Bc⇒x∈A∧x∈Bc⇒x∈A−B
A−B=A⇔((x∈A−B⇒x∈A)∧(x∈A⇒x∈A−B))⇔((x∈A−B⇒x∈A)∧(x∈A⇒x∈A−B))⇔(((x∈A∧x∈Bc)⇒x∈A)∧(x∈A⇒(x∈A∧x∈Bc)))⇔(((x∈A∧x∈Bc)⇒x∈A)∧(x∈A⇒(x∈A∧x∈Bc)))⇔(x∈A⇒(x∈A∧x∈Bc))⇔(x∈Ac∨x∈Bc)⇔(x∈A∩B⇒x∈ϕ)⇔((x∈A∩B⇒x∈ϕ)∧(x∈ϕ⇒x∈A∩B))⇔A∩B=ϕ
A−B=ϕ⇔((x∈A−B⇒x∈ϕ)∧(x∈ϕ⇒x∈A−B))⇔(((x∈A∧x∈Bc)⇒x∈ϕ)∧(x∈ϕ⇒(x∈A∧x∈Bc)))⇔((x∈A∧x∈Bc)⇒x∈ϕ)⇔x∉A∨x∈B⇔(x∈A⇒x∈B)⇔A⊂B
コード(Emacs)
python 3.5
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from matplotlib_venn import venn2 import matplotlib.pyplot as plt import sympy x = sympy.FiniteSet(*range(15)) a = sympy.FiniteSet(*range(10)) b = sympy.FiniteSet(*range(5, 15)) print('a') for s in [a - b, (a | b) - b, a - (a & b), a & (x - b)]: print(s) plt.figure(figsize=(5, 5)) venn2(subsets=(a, b), set_labels=('A', 'B')) plt.savefig('sample3_a.png') plt.show() print('b') a = sympy.FiniteSet(*range(5)) b = sympy.FiniteSet(*range(5, 10)) print(a - b, a, a & b, sep='\n') plt.figure(figsize=(5, 5)) venn2(subsets=(a, b), set_labels=('A', 'B')) plt.savefig('sample3_b.png') plt.show() print('c') a = sympy.FiniteSet(*range(5)) b = sympy.FiniteSet(*range(10)) print(a, b, a - b, a.is_subset(b), sep='\n') plt.figure(figsize=(5, 5)) venn2(subsets=(a, b), set_labels=('A', 'B')) plt.savefig('sample3_c.png') plt.show()
入出力結果(Terminal, IPython)
$ ./sample3.py a {0, 1, 2, 3, 4} {0, 1, 2, 3, 4} {0, 1, 2, 3, 4} {0, 1, 2, 3, 4} b {0, 1, 2, 3, 4} {0, 1, 2, 3, 4} EmptySet() c {0, 1, 2, 3, 4} {0, 1, 2, 3, 4, 5, 6, 7, 8, 9} EmptySet() True $



0 コメント:
コメントを投稿