## 2016年12月22日木曜日

### 数学 - 集合論 - 集合算 - 写像(像、逆像、共通部分、包含関係)

(1. 37)

$\begin{array}{l}y\in f\left(A\right)\cap f\left(B\right)\\ ⇔y\in f\left(A\right)\wedge y\in f\left(B\right)\\ ⇔\exists {x}_{1}\in A\left[f\left({x}_{1}\right)=y\right]\wedge \exists {x}_{2}\in B\left[f\left({x}_{2}\right)=y\right]\\ \\ f\left({x}_{1}\right)=f\left({x}_{2}\right)=y\\ {x}_{1}={x}_{2}\\ {x}_{1}\in A\cap B\\ y\in f\left(A\cap B\right)\end{array}$

(1. 44)

$\begin{array}{l}b\in {f}^{-1}\left(f\left(B\right)\right)\\ f\left(b\right)\in f\left(B\right)\\ \exists {b}_{0}\in B\left[f\left({b}_{0}\right)=f\left(b\right)\right]\\ \\ {b}_{0}=b\\ b\in B\end{array}$

$\begin{array}{l}y\in f\left(B\cap {f}^{-1}\left(A\right)\right)\\ \\ \exists x\in X\left[x\in B\cap {f}^{-1}\left(A\right)\wedge f\left(x\right)=y\right]\\ \exists x\in X\left[x\in B\wedge x\in {f}^{-1}\left(A\right)\wedge f\left(x\right)=y\right]\\ \exists x\in X\left[x\in B\wedge f\left(x\right)\in A\wedge f\left(x\right)=y\right]\\ y\in f\left(B\right)\wedge y\in A\\ y\in f\left(B\right)\cap A\end{array}$

コード(Emacs)

HTML5

<div id="graph0"></div>

<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/d3/4.2.6/d3.min.js" integrity="sha256-5idA201uSwHAROtCops7codXJ0vja+6wbBrZdQ6ETQc=" crossorigin="anonymous"></script>
<script src="sample7.js"></script>



JavaScript

let div_graph = document.querySelector('#graph0'),
svg,
width = 600,
height = 600,

let xscale = d3.scaleLinear()
.domain([-2, 2])
let yscale = d3.scaleLinear()
.domain([-10, 10])
let xaxis = d3.axisBottom().scale(xscale);
let yaxis = d3.axisLeft().scale(yscale);

let range = (start, end, step) => {
let result = [];

for (let i = start; i < end; i += step) {
result.push(i);
}
return result;
};
let draw = (i) => {
let points =
range(-Math.PI / 2 + 0.1, Math.PI / 2 - 0.1, 0.001)
.map((x) => [x, Math.tan(x)]);

console.log(points);
svg = d3.select('#graph0')
.append('svg')
.attr('width', width)
.attr('height', height);

svg.selectAll('circle')
.data(points)
.enter()
.append('circle')
.attr('cx', (d) => xscale(d[0]))
.attr('cy', (d) => yscale(d[1]))
.attr('r', 1)
.attr('stroke', 'green');

svg.append('g')
.attr('transform', translate(0, ${width / 2})) .call(xaxis); svg.append('g') .attr('transform', translate(${height / 2}, 0))
.call(yaxis);
};

draw();