ycategories-presentation/categories.html

358 lines
11 KiB
HTML
Raw Normal View History

2012-10-27 12:41:18 +00:00
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=1024, user-scalable=no">
<title>Category Theory for Programming</title>
<!-- Required stylesheet -->
<link rel="stylesheet" href="core/deck.core.css">
<!-- Extension CSS files go here. Remove or add as needed. -->
<link rel="stylesheet" href="extensions/goto/deck.goto.css">
<link rel="stylesheet" href="extensions/menu/deck.menu.css">
<link rel="stylesheet" href="extensions/navigation/deck.navigation.css">
<link rel="stylesheet" href="extensions/status/deck.status.css">
<link rel="stylesheet" href="extensions/hash/deck.hash.css">
<link rel="stylesheet" href="extensions/scale/deck.scale.css">
<!-- Transition theme. More available in /themes/transition/ or create your own. -->
<link rel="stylesheet" href="themes/transition/horizontal-slide.css">
<!-- Style theme. More available in /themes/style/ or create your own. -->
<!-- <link rel="stylesheet" href="themes/style/web-2.0.css"> -->
<link rel="stylesheet" href="themes/style/y/main.css" />
<link rel="stylesheet" href="themes/style/y/solarized.css" />
<link href='http://fonts.googleapis.com/css?family=Inconsolata' rel='stylesheet' type='text/css'>
<!-- Required Modernizr file -->
<script src="modernizr.custom.js"></script>
</head>
<body class="deck-container">
2012-11-02 14:25:55 +00:00
<div style="display:none">
\(\newcommand{\F}{\mathbf{F}}\)
\(\newcommand{\C}{\mathcal{C}}\)
\(\newcommand{\D}{\mathcal{D}}\)
\(\newcommand{\id}{\mathrm{id}}\)
\(\newcommand{\ob}[1]{\mathrm{ob}(#1)}\)
\(\newcommand{\hom}[1]{\mathrm{hom}(#1)}\)
</div>
2012-10-27 12:41:18 +00:00
<!-- Begin slides. Just make elements with a class of slide. -->
<section class="slide">
2012-11-02 14:25:55 +00:00
<h1>Category Theory <span class="and"><span class="and">&amp;</span></span> Programming
<div><author style="font-size: .4em"><em class="base01">by</em> Yann Esposito
<div>
<twitter style="font-size: .5em">
<a href="http://twitter.com/yogsototh">@yogsototh</a>,
</twitter>
<googleplus style="font-size: .5em">
<a href="https://plus.google.com/117858550730178181663">+yogsototh</a>
</googleplus>
</div>
</author></div>
</h1>
2012-10-27 12:41:18 +00:00
</section>
<section class="slide">
2012-11-02 14:25:55 +00:00
<h2>Plan</h2>
<ul style="font-size: 2em">
<li class="yellow">Why?</li>
<li>What?</li>
<li>How?</li>
</ul>
2012-10-27 12:41:18 +00:00
</section>
<section class="slide">
2012-11-02 14:25:55 +00:00
<h2>Abstraction Example</h2>
<p>Something you see very often but in different instances.</p>
<div class="slide">
<p>Numbers: 1,2,3,... <em class="small">3400 BC, real numbers 760 BC</em></p>
<figure class="left">
<img src="img/tally-count.png" style="height:3.8em" alt="Aboriginal Tally System"/>
<figcaption>Aboriginal Tally System</figcaption>
</figure>
<figure class="left">
<img src="img/first-real-numbers.png" style="height:3.8em" alt="Mesopotamian Numbers"/>
<figcaption>Mesopotamian base 60 system</figcaption>
</figure>
<figure class="left">
<div class="likeimg" style="height:3.8em;margin-bottom: 1em"><span style="font-size: 3em">&nbsp;0&nbsp;</span></div>
<figcaption>Zero</figcaption>
</figure>
<div class="flush"></div>
2012-10-27 12:41:18 +00:00
</section>
<section class="slide">
2012-11-02 14:25:55 +00:00
<h2>Abstraction Example: Numbers</h2>
<p>Many different things can be understood with numbers</p>
<ul>
<li>How many apple, goats?</li>
<li>Distance</li>
<li>Time</li>
<li>...</li>
</ul>
<p>Manipulated with operators:
<span class="yellow">=</span>,
<span class="yellow">&lt;</span>,
<span class="yellow">&gt;</span>,
<span class="yellow">+</span>,
<span class="yellow">×</span>, ...</p>
2012-10-27 12:41:18 +00:00
</section>
<section class="slide">
2012-11-02 14:25:55 +00:00
<h2>Abstraction Example: Numbers</h2>
<h3>Generalization: rational numbers</h3>
<p>Rational numbers: \(\frac{p}{q}\) (concept is prehistoric): more precise.</p>
<img src="img/egyptian-hieroglyphics.jpg" alt="Egyptian Fractions"/>
</div>
2012-10-27 12:41:18 +00:00
</section>
<section class="slide">
2012-11-02 14:25:55 +00:00
<h2>Abstraction Example: Numbers</h2>
<h3>Generalization: negative numbers</h3>
<p>Negative numbers: ..., -3, -2, -1, 0, 1, 2, ... (100-50 BC): Debts, temperature</p>
<img src="img/negative-numbers.jpg" alt="Negative Numbers (Chinese)"/>
2012-10-27 12:41:18 +00:00
</section>
<section class="slide">
2012-11-02 14:25:55 +00:00
<h2>Abstraction Example: Numbers</h2>
<h3>Generalization: Irrational Numbers</h3>
<p>Irrational numbers: \(\mathbb{A}\), \(\mathbb{R}\) (500 BC → Pythogoras killed Hippasus because of \(\sqrt{2}\)!)</p>
<p>Complex numbers: \(\mathbb{C}\) (100 AD, then 16th century)</p>
2012-10-27 12:41:18 +00:00
</section>
<section class="slide">
2012-11-02 14:25:55 +00:00
<h2>Abstraction Example: Numbers</h2>
<h3>Generalization</h3>
<ul>
<li>More things enter into the notion</li>
<li>More operator to manipulate the notion</li>
</ul>
2012-10-27 12:41:18 +00:00
</section>
<section class="slide">
2012-10-30 13:22:52 +00:00
<h2>Numbers ⇒ Sets</h2>
2012-11-02 14:25:55 +00:00
<table>
<tr>
<th>Numbers</th>
<th>Set Theory (∞)/Abstract Algebra/Topology</th>
</tr>
<tr>
<td>\(\mathbb{N}\): \((+,0)\)</td>
<td>Semigroups</td>
</tr>
<tr>
<td>\(\mathbb{Z}\): \((+,0,\times,1)\)</td>
<td>Rings</td>
</tr>
<tr>
<td>\(\mathbb{Q}\)</td>
<td>Fields</td>
</tr>
<tr>
<td>\(\mathbb{R}\)</td>
<td>Complete Fields (<em class="base01">topology</em>)</td>
</tr>
<tr>
<td>\(\mathbb{C}\)</td>
<td>Algebræ</td>
</tr>
<tr><td></td><td>Modules,Vector Spaces, Monoids, ...</td></tr>
</table>
<p><span class="and" style="visibility:hidden"><span class="and">&amp;</span></span> More <strong>general</strong>: more things are sets.<br/>
<span class="and"><span class="and">&amp;</span></span> More <strong>precise</strong>: clear distinction between concepts.</p>
2012-10-27 12:41:18 +00:00
</section>
<section class="slide">
2012-11-02 14:25:55 +00:00
<h2>Sets ⇒? <span class="yellow">Categories</span></h2>
<table>
<tr>
<th>Numbers</th>
<th>Sets</th>
<th>Categories</th>
</tr>
<tr>
<td>\(\mathbb{N}\): \((+,0)\)</td>
<td>Semigroups</td>
<td>?</td>
</tr>
<tr>
<td>\(\mathbb{Z}\): \((+,0,\times,1)\)</td>
<td>Rings</td>
<td>?</td>
</tr>
<tr>
<td>\(\mathbb{Q}\)</td>
<td>Fields</td>
<td>?</td>
</tr>
<tr>
<td>\(\mathbb{R}\)</td>
<td>Complete Fields (<em class="base01">topology</em>)</td>
<td>?</td>
</tr>
<tr>
<td>\(\mathbb{C}\)</td>
<td>Algebræ</td>
<td>?</td>
</tr>
<tr><td></td><td>Modules,Vector Spaces, Monoids, ...</td><td>?</td></tr>
</table>
2012-10-27 12:41:18 +00:00
</section>
<section class="slide">
2012-11-02 14:25:55 +00:00
<h2><span class="yellow">/.*/</span> ⇒? Category Theory</h2>
<p>Extend <span class="and"><span class="and">&amp;</span></span> Merge different scientific fields</p>
<ul>
<li>Topology</li>
<li>Quantum Physics</li>
<li>Logic</li>
<li><b>Programming</b></li>
</ul>
<p><span class="and" style="visibility:hidden"><span class="and">&amp;</span></span> More <strong>general</strong>: more things are Categories.<br/>
<span class="and"><span class="and">&amp;</span></span> More <strong>precise</strong>: better distinction between concepts.</p>
<p>Young field: <b>194245</b>, Samuel Eilenberg <span class="and"><span class="and">&amp;</span></span> Saunders Mac Lane
2012-10-27 12:41:18 +00:00
</section>
<section class="slide">
2012-11-02 14:25:55 +00:00
<h2>Plan</h2>
<ul style="font-size: 2em">
<li>Why?</li>
<li class="yellow">What?</li>
<li>How?</li>
</ul>
2012-10-27 12:41:18 +00:00
</section>
2012-10-29 16:17:38 +00:00
<section class="slide">
<h2>Definition: Category [Objects]</h2>
2012-11-02 14:25:55 +00:00
<img src="img/mp/objects.png" alt="objects"/>
2012-10-29 16:17:38 +00:00
</section>
<section class="slide">
<h2>Definition: Category [Morphisms]</h2>
2012-11-02 14:25:55 +00:00
<img src="img/mp/morphisms.png" alt="morphisms"/>
2012-10-29 16:17:38 +00:00
</section>
<section class="slide">
<h2>Definition: Category [Composition]</h2>
2012-11-02 14:25:55 +00:00
<p>Composition (∘): \(f:A\rightarrow B, g:B\rightarrow C\)
$$g\circ f:A\rightarrow C$$
</p>
<img src="img/mp/composition.png" alt="composition"/>
2012-10-29 16:17:38 +00:00
</section>
<section class="slide">
<h2>Definition: Category [Laws]</h2>
2012-11-02 14:25:55 +00:00
<ul>
<li>for all \(X\), there is an \(\id_X\), s.t. for all \(f:A\to B\)
<img src="img/mp/identity.png" alt="identity"/>
</li>
<li> Composition is associative:
<img src="img/mp/associativecomposition.png" alt="associative composition"/>
</li>
</ul>
2012-10-29 16:17:38 +00:00
</section>
2012-10-30 13:22:52 +00:00
<section class="slide">
2012-11-02 14:25:55 +00:00
<h2>Can this be a category? <span style="font-size: .5em">(\(\id_X\) implicit)</span></h2>
<figure class="left">
<img src="img/mp/cat-example1.png" alt="Category example 1"/>
<figcaption class="slide">
<span class="green">OK</span>
</figcaption>
</figure>
<figure class="left">
<img src="img/mp/cat-example2.png" alt="Category example 2"/>
<figcaption class="slide">
no candidate for \(g\circ f\)
<span class="red">NO</span>
</figcaption>
</figure>
<figure class="left">
<img src="img/mp/cat-example3.png" alt="Category example 3"/>
<figcaption class="slide">
<span class="green">YES</span>
</figcaption>
</figure>
<figure class="left">
<img src="img/mp/cat-example4.png" alt="Category example 4"/>
<figcaption class="slide">
no candidate for \(f:C\to B\)
<span class="red">NO</span>
</figcaption>
</figure>
<figure class="left">
<img src="img/mp/cat-example5.png" alt="Category example 5"/>
<figcaption class="slide">
\((h∘g)∘f=\id_B∘f=f≠h=h∘\id_A=h∘(g∘f)\)
<span class="red">NO</span>
</figcaption>
</figure>
</section>
<section class="slide">
<h2>Definition: Functor</h2>
<p> A functor is a mapping between two categories.
Let \(\C\) and \(\D\) be two categories.
A <em>functor</em> \(\F\) from \(\C\) to \(\D\):</p>
<ul>
<li> Associate objects: \(A\in\ob{\C}\) to \(\F A \in\ob{\D}\) </li>
<li> Associate morphisms: \(f:A\to B\) to \(\F f : \F A \to \F B\)
such that
<ul>
<li>\( \F \id_X = \id_{\F X} \),</li>
<li>\( \F (g \circ_\C f) = \F g \circ_\D \F f \)</li>
</ul>
</li>
</ul>
2012-10-30 13:22:52 +00:00
</section>
2012-10-27 12:41:18 +00:00
<!-- End slides. -->
<!-- Begin extension snippets. Add or remove as needed. -->
<!-- deck.navigation snippet -->
<a href="#" class="deck-prev-link" title="Previous">&#8592;</a>
<a href="#" class="deck-next-link" title="Next">&#8594;</a>
<!-- deck.status snippet -->
<p class="deck-status">
<span class="deck-status-current"></span>
/
<span class="deck-status-total"></span>
</p>
<!-- deck.goto snippet -->
<form action="." method="get" class="goto-form">
<label for="goto-slide">Go to slide:</label>
<input type="text" name="slidenum" id="goto-slide" list="goto-datalist">
<datalist id="goto-datalist"></datalist>
<input type="submit" value="Go">
</form>
<!-- deck.hash snippet -->
<a href="." title="Permalink to this slide" class="deck-permalink">#</a>
<!-- End extension snippets. -->
<!-- Required JS files. -->
<script src="jquery-1.7.2.min.js"></script>
<script src="core/deck.core.js"></script>
<!-- Extension JS files. Add or remove as needed. -->
<script src="core/deck.core.js"></script>
<script src="extensions/hash/deck.hash.js"></script>
<script src="extensions/menu/deck.menu.js"></script>
<script src="extensions/goto/deck.goto.js"></script>
<script src="extensions/status/deck.status.js"></script>
<script src="extensions/navigation/deck.navigation.js"></script>
<script src="extensions/scale/deck.scale.js"></script>
<!-- Initialize the deck. You can put this in an external file if desired. -->
<script>
$(function() {
$.deck('.slide');
});
</script>
<!-- Y theme -->
<script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script src="js/highlight/highlight.pack.js"></script>
<script>
hljs.initHighlightingOnLoad();
</script>
</body>
</html>