This commit is contained in:
Boris Marinov 2023-06-08 11:48:45 +03:00
parent bafe695933
commit 1ddf048bb1
7 changed files with 394 additions and 19 deletions

View File

@ -229,7 +229,7 @@ However functions in most programming languages can also be quite different from
Why are functions in programming different? Well, at the time when most programming paradigms that are in use today were created, computer resources were much more limited than today, and programming much more cumbersome, so people had bigger problems than the fact that their functions were not mathematically sound. Nowadays, many people feel that mathematical functions are too limiting and hard to use.
They might be right. Mathematical functions have one big advantage over non-mathematical ones — their type signature tells you everything that the function does. This is probably the reason why most functional languages are strongly-typed.
And they might be right. But mathematical functions have one big advantage over non-mathematical ones — their type signature tells you everything that the function does. This is probably the reason why most functional languages are strongly-typed.
Purely-functional programming languages
---
@ -238,7 +238,7 @@ We said that while all mathematical functions are also programming functions, th
A peculiarity in such languages is that they don't directly allow for writing functions (like rendering stuff on screen, I/O, etc.) that perform operations other than returning values.
In purely functional programming languages, such operations are outsourced to the language's runtime, using a style of programming called *continuation passing style*.
In purely functional programming languages, such operations are *outsourced* to the language's runtime, using a style of programming called *continuation passing style*.
{% if site.distribution == 'print'%}
@ -317,7 +317,7 @@ Composition is the essence of all things categorical. The key insight is that th
**Question:** Think about which qualities of a function make composition possible, e.g., does it work with other types of relationships, like many-to-many and one-to-many.
The Power of Composition
Composition of relationships
---
To understand how powerful composition is, consider the following: one set being connected to another means that each function from the second set can be transferred to a corresponding function from the first one.
@ -330,10 +330,23 @@ For example, if we again take the relationship between a person and his mother a
Although you might be seeing functional composition for the first time, the intuition behind it is there — we all know that each person whom our mother is related to is automatically our relative as well — our mother's father is our grandfather, our mother's partner is our father, etc.
Representing Composition with Commutative Diagrams
Composition in engineering
---
In the last diagram, the equivalence between $f \bullet g$ and the new function $h$ is expressed by the fact that if you follow the arrow $h$ for any element of set $Y$ you will get to the same element of the set $G$ as the one you will get if you follow the $g$ and then follow $f$. Diagrams that express such equivalence between sequences of function applications are called *commutative diagrams*.
Besides being useful for *analyzing* relationships that already exist, the principle of composition can help you in the practice of *building* objects that exhibit such relationships i.e. engineering.
One of the main ways in which modern engineering differs from ancient craftsmanship is the concept of a *part/module/component* - a product that performs a given function that is not made to be used directly, but is instead optimized to be combined with other such products in order to form a "end-user" product. For example, an *espresso machine* is just a combination of the components, such as , *pump, heater, grinder group* etc, when composed in an appropriate way.
![A espresso machine ](../01_set/machine.svg)
**Task:** Think about what would be those functions' sources and targets.
The diagram
Representing composition with commutative diagrams
---
In functional composition diagrams, the equivalence between the successive application of the two composed functions ($f \bullet g$) and the new function ($h$) is expressed by the fact that if you follow the arrow $h$ for any element of set $Y$ you will get to the same element of the set $G$ as the one you will get if you follow the $g$ and then follow $f$. Diagrams that express such equivalence between sequences of function applications are called *commutative diagrams*.
![Functional composition](../01_set/functions_compose.svg)
@ -351,14 +364,16 @@ Having this insight allows us to redefine functional composition in a more visua
Diagrams that show functions without showing the elements of the sets are called *external diagrams*, as opposed to the ones that we saw before, which are *internal*.
At this point you might be worried that I had forgotten that I am supposed to talk about category theory and I am just presenting a bunch of irrelevant concepts. I really tend to do that, but not now — the fact that *functional composition* can be presented without even mentioning category theory doesn't stop it from being one of category theory's *most important concepts*. We will see why shortly, but we have to review a few more things first.
At this point you might be worried that I had forgotten that I am supposed to talk about category theory and I am just presenting a bunch of irrelevant concepts. I really tend to do that, but not now — the fact that *functional composition* can be presented without even mentioning category theory doesn't stop it from being one of category theory's *most important concepts*.
In fact, we can say (although this is not an official definition) that category theory is the study of things that are *function-like* (we call them *morphisms*) --- ones that have source and target, and that can be composed with one another in an associative way.
And there is another way of defining category theory without defining category theory: it is what you get if you replace the concept of equality with the concept of *isomorphism*. We haven't talked about isomorphisms yet, but this is what we will be doing till the end of this chapter.
Isomorphism
===
Let's check another concept which is very important in category theory (although it is not exclusive to it) — the concept of an *isomorphism*.
To do that, we go back to the examples of the types of relationships that functions can represent, and to the first and most elementary of them all — the *one-to-one* type of relationship. We know that all functions have exactly one element from the source set, pointing to one element from the target set. But for one-to-one functions *the reverse is also true* — exactly one element from the target set points to one element from the source.
To explain what isomorphism is, we go back to the examples of the types of relationships that functions can represent, and to the first and most elementary of them all — the *one-to-one* type of relationship. We know that all functions have exactly one element from the source set, pointing to one element from the target set. But for one-to-one functions *the reverse is also true* — exactly one element from the target set points to one element from the source.
![Opposite colors](../01_set/function_one_one.svg)
@ -511,3 +526,16 @@ At this point there are no more examples that we can add. In fact, because we co
Before we close this chapter, there is one meta-note that we should definitely make: according to the definition of a number that we presented, a number is not an *object*, but a whole *system of interconnected objects*, containing in this case an infinite number of objects. This may seem weird to you, but it's actually pretty characteristic of the categorical way of modeling things.
{%endif%}
Addendum: The case of composition in software development
===
> An unstructured monolithic design is not a good idea, except maybe for a tiny operating system in, say, a toaster, but even there it is arguable.--- Andrew S. Tanenbaum
Software development is a peculiar discipline --- in theory, it should be just some sort of *engineering*, however the way it is executed in practice is sometimes closer to *craftsmanship*, with the principle of composition not being utilized to the fullest.
To see why, imagine a person (e.g. me), tinkering with some sort of engineering problem e.g. trying to fix a machine or modify it to serve a new purpose. If the machine in question is mechanical or electrical, this person will be forced to pretty much make due with the components that already exist, simply because they can rarely afford to manufacture new components themselves (or at least they would avoid it if possible). This limitation, forces component manufacturers to create components that are versatile and that work well together, in the same way in which pure functions work well together. And this in turn makes it easy for engineers to create better machines without doing all the work themselves.
But things are different if the machine in question is software-based --- due to the ease with which new software components can be rolled out, our design can blur the line that separates some of the components or even do away with the concept of component altogether and make the whole program one giant component (*monolithic design*). Worse, when no ready-made components are available, this approach is actually easier than the component-based approach that we described in the previous paragraph, and so many people use it.
This is bad, as the benefits of monolithic design are mostly short-term --- not being separated to components makes programs harder to reason about, harder to modify (e.g. you cannot replace a faulty component with a new one) and generally more primitive than component-based programs. For this reasons, I think that currently, programmers are losing out by not utilizing the principles of functional composition. In fact, I was so unhappy with the situation that I decided to write a whole book on applied category theory to help people understand the principles of composition better --- it's called Category Theory Illustrated (Oh wait, I am writing that right now, aren't I?)

View File

@ -0,0 +1,341 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
viewBox="0 -44.1 595.3 380.5"
version="1.1"
id="svg4199"
sodipodi:docname="machine.svg"
inkscape:version="1.2.2 (1:1.2.2+202212051552+b0a8486541)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs4203" />
<sodipodi:namedview
id="namedview4201"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
showgrid="false"
inkscape:zoom="1.2404731"
inkscape:cx="334.54979"
inkscape:cy="250.71081"
inkscape:window-width="1080"
inkscape:window-height="1864"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="svg4199"
showguides="false" />
<g
id="g4607"
transform="matrix(0.92994918,0,0,0.92994918,-15.120779,-58.310243)"
style="fill:#80e5ff;fill-opacity:1">
<circle
opacity="0.14"
stroke="#000000"
stroke-width="6"
stroke-miterlimit="10"
cx="97.153519"
cy="140.71695"
r="39.099998"
id="circle4157"
style="fill:#80e5ff;fill-opacity:1" />
<circle
fill="#d069a9"
stroke="#808285"
stroke-width="6"
stroke-miterlimit="10"
cx="93.353516"
cy="138.21695"
r="39.099998"
id="circle4159"
style="fill:#80e5ff;fill-opacity:1" />
</g>
<g
id="g4607-1"
transform="matrix(0.78659523,0.49605789,-0.49605789,0.78659523,220.7677,77.127679)">
<circle
opacity="0.14"
stroke="#000000"
stroke-width="6"
stroke-miterlimit="10"
cx="97.153519"
cy="140.71695"
r="39.099998"
id="circle4157-2" />
<circle
fill="#d069a9"
stroke="#808285"
stroke-width="6"
stroke-miterlimit="10"
cx="93.353516"
cy="138.21695"
r="39.099998"
id="circle4159-70"
style="fill:#803300" />
</g>
<g
id="g4607-1-9"
transform="matrix(0.78659523,0.49605789,-0.49605789,0.78659523,371.85283,73.039281)">
<circle
opacity="0.14"
stroke="#000000"
stroke-width="6"
stroke-miterlimit="10"
cx="97.153519"
cy="140.71695"
r="39.099998"
id="circle4157-2-3" />
<circle
fill="#d069a9"
stroke="#808285"
stroke-width="6"
stroke-miterlimit="10"
cx="93.353516"
cy="138.21695"
r="39.099998"
id="circle4159-70-6"
style="fill:#803300" />
</g>
<g
id="g4607-1-9-6"
transform="matrix(0.78659523,0.49605789,-0.49605789,0.78659523,494.80677,-5.9619496)"
style="fill:#2b1100">
<circle
opacity="0.14"
stroke="#000000"
stroke-width="6"
stroke-miterlimit="10"
cx="97.153519"
cy="140.71695"
r="39.099998"
id="circle4157-2-3-1"
style="fill:#2b1100" />
<circle
fill="#d069a9"
stroke="#808285"
stroke-width="6"
stroke-miterlimit="10"
cx="93.353516"
cy="138.21695"
r="39.099998"
id="circle4159-70-6-8"
style="fill:#2b1100" />
</g>
<g
id="g4607-3"
transform="matrix(0.92994918,0,0,0.92994918,136.76357,-57.609885)">
<circle
opacity="0.14"
stroke="#000000"
stroke-width="6"
stroke-miterlimit="10"
cx="97.153519"
cy="140.71695"
r="39.099998"
id="circle4157-6" />
<circle
fill="#d069a9"
stroke="#808285"
stroke-width="6"
stroke-miterlimit="10"
cx="93.353516"
cy="138.21695"
r="39.099998"
id="circle4159-7"
style="fill:#80e5ff" />
</g>
<g
id="g4607-3-6"
transform="matrix(0.92994918,0,0,0.92994918,290.70718,-54.893122)">
<circle
opacity="0.14"
stroke="#000000"
stroke-width="6"
stroke-miterlimit="10"
cx="97.153519"
cy="140.71695"
r="39.099998"
id="circle4157-6-2" />
<circle
fill="#d069a9"
stroke="#808285"
stroke-width="6"
stroke-miterlimit="10"
cx="93.353516"
cy="138.21695"
r="39.099998"
id="circle4159-7-9"
style="fill:#ff5555" />
</g>
<path
fill="#808082"
d="m 110.37531,65.977926 c 0,0 0.84801,-0.243321 2.35426,-0.644938 1.50626,-0.4016 3.75974,-0.864657 6.38881,-1.404874 5.34711,-0.983589 12.45168,-1.706616 19.71452,-1.771378 7.16994,-0.06872 14.4013,0.609815 19.76265,1.488385 1.29289,0.240902 2.58973,0.388895 3.60389,0.617997 1.10707,0.233036 2.02831,0.458195 2.76766,0.582585 0.64647,0.120457 1.01416,0.229103 1.01416,0.229103 l -2.39965,10.509304 c 6.99743,-2.589124 14.52084,-4.411325 22.73249,-4.901331 -4.55207,-6.801303 -10.42459,-13.193141 -17.16476,-18.877092 l -2.39967,10.509309 c 0,0 -0.36768,-0.108693 -1.01415,-0.229103 -0.83227,-0.128314 -1.75352,-0.353483 -2.86059,-0.586518 -1.10707,-0.233036 -2.4039,-0.381028 -3.6968,-0.621923 -5.45424,-0.882512 -12.87143,-1.568908 -20.22719,-1.50808 -7.35576,0.06082 -14.73907,0.772063 -20.17909,1.751727 -2.72198,0.536283 -4.97547,0.999333 -6.57463,1.396998 -1.59916,0.397683 -2.44718,0.641004 -2.44718,0.641004 z"
id="path4169"
style="stroke-width:0.929949" />
<path
fill="#808082"
d="m 263.18584,226.68671 c 0,0 0.848,-0.24332 2.35426,-0.64494 1.50626,-0.4016 3.75974,-0.86466 6.3888,-1.40487 5.34711,-0.98359 12.45169,-1.70662 19.71453,-1.77138 7.16993,-0.0688 14.4013,0.60982 19.76263,1.48838 1.2929,0.2409 2.58974,0.38891 3.6039,0.618 1.10707,0.23304 2.02831,0.45819 2.76767,0.58259 0.64645,0.12045 1.01416,0.2291 1.01416,0.2291 l -2.39965,10.50931 c 6.99742,-2.58913 14.52084,-4.41133 22.73247,-4.90134 -4.55205,-6.8013 -10.42457,-13.19314 -17.16475,-18.87709 l -2.39966,10.50931 c 0,0 -0.36769,-0.1087 -1.01415,-0.2291 -0.83227,-0.12832 -1.75352,-0.35348 -2.86059,-0.58652 -1.10707,-0.23303 -2.40391,-0.38102 -3.6968,-0.62192 -5.45424,-0.88252 -12.87144,-1.56891 -20.22721,-1.50808 -7.35575,0.0608 -14.73905,0.77206 -20.17907,1.75172 -2.72198,0.53628 -4.97548,0.99933 -6.57463,1.397 -1.59917,0.39768 -2.44718,0.64101 -2.44718,0.64101 z"
id="path4169-0"
style="stroke-width:0.929949" />
<path
fill="#808082"
d="m 263.25379,68.893232 c 0,0 0.83696,-0.278984 2.32487,-0.743959 1.48792,-0.464974 3.7198,-1.022943 6.32366,-1.673908 5.3007,-1.208934 12.36832,-2.231878 19.62192,-2.603858 7.16062,-0.371979 14.41421,0 19.80792,0.650965 1.30193,0.18599 2.60386,0.278985 3.62681,0.464975 1.11593,0.185989 2.04588,0.371979 2.78985,0.464974 0.65095,0.09299 1.02294,0.185989 1.02294,0.185989 l -1.95289,10.601419 c 6.88162,-2.88284 14.32121,-5.021722 22.50476,-5.858682 -4.83573,-6.602634 -10.97339,-12.740299 -17.94802,-18.134004 l -1.95289,10.60142 c 0,0 -0.37198,-0.09299 -1.02295,-0.18599 -0.83695,-0.09299 -1.7669,-0.278985 -2.88284,-0.464975 -1.11594,-0.185988 -2.41786,-0.278983 -3.7198,-0.464973 -5.48669,-0.650965 -12.92629,-1.022945 -20.27289,-0.650965 -7.34659,0.37198 -14.69319,1.394923 -20.0869,2.603858 -2.69684,0.650964 -4.92873,1.208934 -6.50965,1.673908 -1.5809,0.464974 -2.41786,0.743959 -2.41786,0.743959 z"
id="path4169-5"
style="stroke-width:0.929949" />
<path
fill="#808082"
d="m 414.53317,226.09945 c 0,0 0.83259,-0.29173 2.29378,-0.83488 1.46119,-0.54316 3.56759,-1.46819 6.02506,-2.5474 4.93153,-2.28888 11.1464,-5.80644 17.10983,-9.95259 5.88991,-4.08922 11.39792,-8.82365 15.26446,-12.64016 0.91563,-0.94405 1.8882,-1.81455 2.58324,-2.58782 0.76855,-0.83019 1.39005,-1.54653 1.9214,-2.07548 0.45783,-0.47203 0.69503,-0.77326 0.69503,-0.77326 l -8.03389,-7.18753 c 7.20631,-1.93299 14.39842,-4.79585 21.38184,-9.14358 0.218,8.18117 -0.87813,16.79165 -3.0915,25.32618 l -8.03391,-7.1875 c 0,0 -0.23716,0.30125 -0.695,0.77325 -0.6049,0.58587 -1.2264,1.30222 -1.99497,2.1324 -0.76856,0.83019 -1.74113,1.70071 -2.65677,2.64475 -3.94007,3.87344 -9.59515,8.72172 -15.63213,12.92481 -6.03696,4.20309 -12.47242,7.8914 -17.4775,10.23721 -2.531,1.13614 -4.63742,2.06116 -6.17212,2.66125 -1.53473,0.60007 -2.36733,0.89182 -2.36733,0.89182 z"
id="path4169-0-7"
style="stroke-width:0.929949" />
<path
fill="#808082"
d="m 414.68138,76.207548 c 0,0 0.84418,0.256251 2.32704,0.737104 1.48288,0.480841 3.62652,1.315944 6.12745,2.290212 5.02395,2.078188 11.38206,5.329658 17.51556,9.219818 6.05763,3.83637 11.76103,8.33354 15.78556,11.983048 0.95476,0.90446 1.96328,1.73305 2.69041,2.47621 0.80299,0.79693 1.45424,1.48634 2.0075,1.99233 0.47737,0.45224 0.72711,0.74318 0.72711,0.74318 l -7.72261,7.52097 c 7.28164,1.6264 14.58844,4.1824 21.74954,8.2308 -0.12833,-8.18306 -1.58776,-16.73947 -4.16021,-25.172728 l -7.72263,7.520988 c 0,0 -0.24975,-0.29095 -0.72712,-0.74318 -0.62914,-0.55976 -1.28037,-1.24916 -2.08338,-2.0461 -0.803,-0.79693 -1.81152,-1.625518 -2.76627,-2.529978 -4.10042,-3.70327 -9.95556,-8.30796 -16.16495,-12.25187 -6.20938,-3.94392 -12.79511,-7.356685 -17.89495,-9.488644 -2.57681,-1.028031 -4.72047,-1.863122 -6.27919,-2.397737 -1.55875,-0.534616 -2.40294,-0.790868 -2.40294,-0.790868 z"
id="path4169-5-9"
style="stroke-width:0.929949" />
<g
aria-label="pump"
id="text4663"
style="font-size:31.8616px;line-height:1.25;word-spacing:0px;fill:#333333;stroke-width:0.796539"
transform="matrix(0.64609611,0,0,0.64609611,39.809939,-2.4534316)">
<path
d="m 117.59148,80.557655 v 9.147764 h -5.56956 V 65.653644 h 5.56956 v 2.551417 q 1.15125,-1.524627 2.55142,-2.240268 1.40017,-0.731199 3.22038,-0.731199 3.22039,0 5.28953,2.566974 2.06913,2.551418 2.06913,6.58079 0,4.029372 -2.06913,6.596347 -2.06914,2.551417 -5.28953,2.551417 -1.82021,0 -3.22038,-0.715641 -1.40017,-0.731199 -2.55142,-2.255826 z m 3.70267,-11.279131 q -1.78911,0 -2.75367,1.32238 -0.949,1.306824 -0.949,3.780454 0,2.47363 0.949,3.796011 0.96456,1.306824 2.75367,1.306824 1.7891,0 2.72255,-1.306824 0.949,-1.306823 0.949,-3.796011 0,-2.489187 -0.949,-3.796011 -0.93345,-1.306823 -2.72255,-1.306823 z"
style="font-weight:bold;-inkscape-font-specification:'sans-serif Bold'"
id="path6142" />
<path
d="M 134.64241,76.294921 V 65.653644 h 5.60068 v 1.742431 q 0,1.415726 -0.0156,3.56265 -0.0156,2.131367 -0.0156,2.847008 0,2.100252 0.1089,3.033698 0.10891,0.917888 0.37338,1.337938 0.34226,0.54451 0.88677,0.840101 0.56007,0.295591 1.27571,0.295591 1.74243,0 2.73811,-1.337938 0.99567,-1.337939 0.99567,-3.718224 v -8.603255 h 5.56956 v 17.424313 h -5.56956 v -2.520302 q -1.26015,1.524627 -2.67587,2.255826 -1.40017,0.715641 -3.09593,0.715641 -3.01814,0 -4.605,-1.851333 -1.5713,-1.851333 -1.5713,-5.382868 z"
style="font-weight:bold;-inkscape-font-specification:'sans-serif Bold'"
id="path6144" />
<path
d="m 173.66043,68.547325 q 1.0579,-1.617972 2.50474,-2.458073 1.4624,-0.855658 3.20483,-0.855658 3.00259,0 4.57389,1.851333 1.5713,1.851333 1.5713,5.382868 v 10.610162 h -5.60068 v -9.085534 q 0.0156,-0.202247 0.0156,-0.420051 0.0156,-0.217804 0.0156,-0.622297 0,-1.851333 -0.54451,-2.675876 -0.54451,-0.840101 -1.75799,-0.840101 -1.58686,0 -2.45807,1.306823 -0.85566,1.306824 -0.88678,3.780454 v 8.556582 h -5.60067 v -9.085534 q 0,-2.893681 -0.49784,-3.718224 -0.49783,-0.840101 -1.77354,-0.840101 -1.60242,0 -2.47363,1.322381 -0.87122,1.306823 -0.87122,3.749338 v 8.57214 h -5.60067 V 65.653644 h 5.60067 v 2.551417 q 1.02679,-1.477955 2.34917,-2.224711 1.33794,-0.746756 2.94036,-0.746756 1.80466,0 3.18927,0.871215 1.38461,0.871216 2.10025,2.442516 z"
style="font-weight:bold;-inkscape-font-specification:'sans-serif Bold'"
id="path6146" />
<path
d="m 196.28092,80.557655 v 9.147764 h -5.56956 V 65.653644 h 5.56956 v 2.551417 q 1.15125,-1.524627 2.55142,-2.240268 1.40016,-0.731199 3.22038,-0.731199 3.22039,0 5.28953,2.566974 2.06913,2.551418 2.06913,6.58079 0,4.029372 -2.06913,6.596347 -2.06914,2.551417 -5.28953,2.551417 -1.82022,0 -3.22038,-0.715641 -1.40017,-0.731199 -2.55142,-2.255826 z m 3.70266,-11.279131 q -1.7891,0 -2.75366,1.32238 -0.949,1.306824 -0.949,3.780454 0,2.47363 0.949,3.796011 0.96456,1.306824 2.75366,1.306824 1.78911,0 2.72255,-1.306824 0.94901,-1.306823 0.94901,-3.796011 0,-2.489187 -0.94901,-3.796011 -0.93344,-1.306823 -2.72255,-1.306823 z"
style="font-weight:bold;-inkscape-font-specification:'sans-serif Bold'"
id="path6148" />
</g>
<g
aria-label="grinder"
id="text4663-6"
style="font-size:31.8616px;line-height:1.25;word-spacing:0px;fill:#333333;stroke-width:0.796539"
transform="matrix(0.64609611,0,0,0.64609611,101.07676,72.693086)">
<path
d="m 257.5001,210.92092 q -1.15125,1.52463 -2.53586,2.24027 -1.38461,0.71564 -3.20483,0.71564 -3.18927,0 -5.27397,-2.50474 -2.08469,-2.52031 -2.08469,-6.40966 0,-3.90491 2.08469,-6.3941 2.0847,-2.50475 5.27397,-2.50475 1.82022,0 3.20483,0.71564 1.38461,0.71565 2.53586,2.25583 v -2.58253 h 5.60067 v 15.66632 q 0,4.20051 -2.66032,6.40966 -2.64476,2.22471 -7.68536,2.22471 -1.63353,0 -3.15816,-0.24892 -1.52463,-0.24892 -3.06481,-0.76231 v -4.34052 q 1.46239,0.8401 2.86256,1.24459 1.40017,0.42005 2.8159,0.42005 2.7381,0 4.01381,-1.19792 1.27571,-1.19792 1.27571,-3.74934 z m -3.67155,-10.84352 q -1.72688,0 -2.69144,1.27571 -0.96456,1.2757 -0.96456,3.60932 0,2.39584 0.93345,3.64043 0.93344,1.22904 2.72255,1.22904 1.74243,0 2.70699,-1.27571 0.96456,-1.27571 0.96456,-3.59376 0,-2.33362 -0.96456,-3.60932 -0.96456,-1.27571 -2.70699,-1.27571 z"
style="font-weight:bold;-inkscape-font-specification:'sans-serif Bold'"
id="path6164" />
<path
d="m 281.3963,201.19753 q -0.7312,-0.34226 -1.4624,-0.49784 -0.71564,-0.17113 -1.44684,-0.17113 -2.14692,0 -3.31373,1.38461 -1.15125,1.36906 -1.15125,3.93603 v 8.02763 h -5.56956 v -17.42431 h 5.56956 v 2.86256 q 1.07346,-1.71131 2.45807,-2.48918 1.40017,-0.79343 3.34485,-0.79343 0.28003,0 0.60674,0.0311 0.32671,0.0156 0.949,0.0933 z"
style="font-weight:bold;-inkscape-font-specification:'sans-serif Bold'"
id="path6166" />
<path
d="m 284.16552,196.45252 h 5.56956 v 17.42431 h -5.56956 z m 0,-6.78304 h 5.56956 v 4.54277 h -5.56956 z"
style="font-weight:bold;-inkscape-font-specification:'sans-serif Bold'"
id="path6168" />
<path
d="m 312.60449,203.26667 v 10.61016 h -5.60067 v -1.72687 -6.3941 q 0,-2.25583 -0.10891,-3.11149 -0.0933,-0.85566 -0.34226,-1.26015 -0.32671,-0.54451 -0.88677,-0.8401 -0.56007,-0.31115 -1.27571,-0.31115 -1.74243,0 -2.73811,1.3535 -0.99567,1.33794 -0.99567,3.71822 v 8.57214 h -5.56956 v -17.42431 h 5.56956 v 2.55142 q 1.26015,-1.52463 2.67587,-2.24027 1.41573,-0.7312 3.12705,-0.7312 3.01814,0 4.57388,1.85133 1.5713,1.85133 1.5713,5.38287 z"
style="font-weight:bold;-inkscape-font-specification:'sans-serif Bold'"
id="path6170" />
<path
d="m 329.62431,199.00394 v -9.33446 h 5.60067 v 24.20735 h -5.60067 v -2.5203 q -1.15125,1.54018 -2.53586,2.25582 -1.38461,0.71565 -3.20483,0.71565 -3.22039,0 -5.28953,-2.55142 -2.06913,-2.56698 -2.06913,-6.59635 0,-4.02937 2.06913,-6.58079 2.06914,-2.56697 5.28953,-2.56697 1.80466,0 3.18927,0.7312 1.40017,0.71564 2.55142,2.24027 z m -3.67156,11.27913 q 1.78911,0 2.72255,-1.30683 0.94901,-1.30682 0.94901,-3.79601 0,-2.48919 -0.94901,-3.79601 -0.93344,-1.30682 -2.72255,-1.30682 -1.77354,0 -2.72254,1.30682 -0.93345,1.30682 -0.93345,3.79601 0,2.48919 0.93345,3.79601 0.949,1.30683 2.72254,1.30683 z"
style="font-weight:bold;-inkscape-font-specification:'sans-serif Bold'"
id="path6172" />
<path
d="m 357.96993,205.118 v 1.58686 h -13.02156 q 0.20224,1.96023 1.41572,2.94035 1.21348,0.98012 3.39152,0.98012 1.75799,0 3.59377,-0.5134 1.85133,-0.52895 3.79601,-1.58685 v 4.29385 q -1.9758,0.74675 -3.95159,1.12013 -1.97579,0.38894 -3.95158,0.38894 -4.72946,0 -7.35866,-2.39585 -2.61365,-2.4114 -2.61365,-6.75192 0,-4.26273 2.56697,-6.70525 2.58254,-2.44251 7.09419,-2.44251 4.10716,0 6.56523,2.47363 2.47363,2.47363 2.47363,6.6119 z m -5.72513,-1.85133 q 0,-1.58686 -0.93345,-2.55142 -0.91788,-0.98012 -2.4114,-0.98012 -1.61797,0 -2.6292,0.91789 -1.01123,0.90233 -1.26015,2.61365 z"
style="font-weight:bold;-inkscape-font-specification:'sans-serif Bold'"
id="path6174" />
<path
d="m 375.12977,201.19753 q -0.7312,-0.34226 -1.4624,-0.49784 -0.71564,-0.17113 -1.44684,-0.17113 -2.14692,0 -3.31373,1.38461 -1.15125,1.36906 -1.15125,3.93603 v 8.02763 h -5.56956 v -17.42431 h 5.56956 v 2.86256 q 1.07346,-1.71131 2.45807,-2.48918 1.40017,-0.79343 3.34485,-0.79343 0.28003,0 0.60674,0.0311 0.3267,0.0156 0.949,0.0933 z"
style="font-weight:bold;-inkscape-font-specification:'sans-serif Bold'"
id="path6176" />
</g>
<g
aria-label="heater"
id="text4663-3"
style="font-size:31.8616px;line-height:1.25;word-spacing:0px;fill:#333333;stroke-width:0.796539"
transform="matrix(0.64609611,0,0,0.64609611,105.7173,0.60697537)">
<path
d="m 258.87791,73.500266 v 10.610162 h -5.60068 v -1.726874 -6.362986 q 0,-2.286941 -0.1089,-3.142599 -0.0933,-0.855658 -0.34226,-1.260151 -0.32671,-0.54451 -0.88677,-0.840101 -0.56007,-0.311149 -1.27571,-0.311149 -1.74243,0 -2.73811,1.353496 -0.99567,1.337939 -0.99567,3.718224 v 8.57214 h -5.56956 V 59.903079 h 5.56956 v 9.334453 q 1.26015,-1.524627 2.67587,-2.240269 1.41573,-0.731199 3.12704,-0.731199 3.01814,0 4.57389,1.851334 1.5713,1.851333 1.5713,5.382868 z"
style="font-weight:bold;-inkscape-font-specification:'sans-serif Bold'"
id="path6151" />
<path
d="m 281.43617,75.351599 v 1.586857 h -13.02156 q 0.20224,1.960235 1.41572,2.940353 1.21348,0.980118 3.39152,0.980118 1.75799,0 3.59376,-0.513395 1.85134,-0.528953 3.79602,-1.586857 v 4.293848 q -1.9758,0.746756 -3.95159,1.120135 -1.97579,0.388935 -3.95159,0.388935 -4.72945,0 -7.35866,-2.395843 -2.61364,-2.4114 -2.61364,-6.751921 0,-4.262734 2.56697,-6.705249 2.58253,-2.442516 7.09419,-2.442516 4.10716,0 6.56523,2.473631 2.47363,2.47363 2.47363,6.611904 z m -5.72513,-1.851333 q 0,-1.586857 -0.93345,-2.551417 -0.91789,-0.980118 -2.4114,-0.980118 -1.61797,0 -2.6292,0.917888 -1.01124,0.90233 -1.26015,2.613647 z"
style="font-weight:bold;-inkscape-font-specification:'sans-serif Bold'"
id="path6153" />
<path
d="m 293.46206,76.269487 q -1.74244,0 -2.62921,0.591182 -0.87121,0.591182 -0.87121,1.742431 0,1.057905 0.70008,1.664645 0.71564,0.591182 1.97579,0.591182 1.5713,0 2.64476,-1.120135 1.07347,-1.135692 1.07347,-2.831451 v -0.637854 z m 8.50991,-2.100252 v 9.941193 h -5.61623 v -2.582532 q -1.12014,1.586857 -2.52031,2.318056 -1.40016,0.715641 -3.40707,0.715641 -2.70699,0 -4.40275,-1.5713 -1.6802,-1.586857 -1.6802,-4.107159 0,-3.064812 2.10025,-4.496095 2.11581,-1.431283 6.62746,-1.431283 h 3.28262 v -0.435608 q 0,-1.322381 -1.04235,-1.92912 -1.04235,-0.622297 -3.2515,-0.622297 -1.78911,0 -3.32929,0.357821 -1.54019,0.35782 -2.86257,1.073462 v -4.247176 q 1.78911,-0.435608 3.59377,-0.653412 1.80466,-0.233362 3.60932,-0.233362 4.7139,0 6.79859,1.866891 2.10026,1.851333 2.10026,6.03628 z"
style="font-weight:bold;-inkscape-font-specification:'sans-serif Bold'"
id="path6155" />
<path
d="m 313.23554,61.738855 v 4.94726 h 5.74069 v 3.9827 h -5.74069 v 7.389776 q 0,1.213479 0.48228,1.649086 0.48228,0.420051 1.91356,0.420051 h 2.86256 v 3.9827 h -4.77612 q -3.29818,0 -4.68279,-1.369053 -1.36905,-1.384611 -1.36905,-4.682784 v -7.389776 h -2.76922 v -3.9827 h 2.76922 v -4.94726 z"
style="font-weight:bold;-inkscape-font-specification:'sans-serif Bold'"
id="path6157" />
<path
d="m 339.7765,75.351599 v 1.586857 h -13.02156 q 0.20225,1.960235 1.41573,2.940353 1.21347,0.980118 3.39151,0.980118 1.75799,0 3.59377,-0.513395 1.85133,-0.528953 3.79601,-1.586857 v 4.293848 q -1.97579,0.746756 -3.95159,1.120135 -1.97579,0.388935 -3.95158,0.388935 -4.72946,0 -7.35866,-2.395843 -2.61365,-2.4114 -2.61365,-6.751921 0,-4.262734 2.56698,-6.705249 2.58253,-2.442516 7.09418,-2.442516 4.10716,0 6.56523,2.473631 2.47363,2.47363 2.47363,6.611904 z m -5.72513,-1.851333 q 0,-1.586857 -0.93344,-2.551417 -0.91789,-0.980118 -2.4114,-0.980118 -1.61798,0 -2.62921,0.917888 -1.01123,0.90233 -1.26015,2.613647 z"
style="font-weight:bold;-inkscape-font-specification:'sans-serif Bold'"
id="path6159" />
<path
d="m 356.93633,71.431129 q -0.7312,-0.342264 -1.46239,-0.497838 -0.71565,-0.171131 -1.44685,-0.171131 -2.14692,0 -3.31373,1.38461 -1.15125,1.369053 -1.15125,3.936028 v 8.02763 h -5.56955 V 66.686115 h 5.56955 v 2.862566 q 1.07347,-1.711317 2.45808,-2.489188 1.40017,-0.793429 3.34484,-0.793429 0.28004,0 0.60674,0.03111 0.32671,0.01556 0.94901,0.09334 z"
style="font-weight:bold;-inkscape-font-specification:'sans-serif Bold'"
id="path6161" />
</g>
<g
aria-label="group"
id="text4663-3-0"
style="font-size:31.8616px;line-height:1.25;word-spacing:0px;fill:#333333;stroke-width:0.796539"
transform="matrix(0.55292293,0.33424007,-0.33424007,0.55292293,233.7745,-127.39689)">
<path
d="m 419.67876,105.48598 q -1.15124,1.52462 -2.53586,2.24027 -1.38461,0.71564 -3.20482,0.71564 -3.18928,0 -5.27397,-2.50475 -2.08469,-2.5203 -2.08469,-6.409656 0,-3.904913 2.08469,-6.394101 2.08469,-2.504745 5.27397,-2.504745 1.82021,0 3.20482,0.715642 1.38462,0.715641 2.53586,2.255826 v -2.582532 h 5.60068 V 106.6839 q 0,4.2005 -2.66032,6.40966 -2.64476,2.22471 -7.68537,2.22471 -1.63353,0 -3.15816,-0.24892 -1.52462,-0.24892 -3.06481,-0.76231 v -4.34053 q 1.4624,0.84011 2.86257,1.2446 1.40017,0.42005 2.81589,0.42005 2.73811,0 4.01382,-1.19792 1.2757,-1.19792 1.2757,-3.74934 z m -3.67155,-10.843527 q -1.72687,0 -2.69143,1.275709 -0.96456,1.275709 -0.96456,3.609322 0,2.395846 0.93344,3.640436 0.93345,1.22904 2.72255,1.22904 1.74243,0 2.70699,-1.27571 0.96456,-1.27571 0.96456,-3.593766 0,-2.333613 -0.96456,-3.609322 -0.96456,-1.275709 -2.70699,-1.275709 z"
style="font-weight:bold;-inkscape-font-specification:'sans-serif Bold'"
id="path6179" />
<path
d="m 443.57496,95.762588 q -0.73119,-0.342264 -1.46239,-0.497838 -0.71564,-0.171131 -1.44684,-0.171131 -2.14693,0 -3.31373,1.38461 -1.15125,1.369053 -1.15125,3.936031 v 8.02763 h -5.56956 V 91.017574 h 5.56956 v 2.862566 q 1.07346,-1.711317 2.45807,-2.489188 1.40017,-0.793428 3.34485,-0.793428 0.28003,0 0.60673,0.03111 0.32671,0.01556 0.94901,0.09334 z"
style="font-weight:bold;-inkscape-font-specification:'sans-serif Bold'"
id="path6181" />
<path
d="m 454.63629,94.580224 q -1.85133,0 -2.83145,1.337938 -0.96456,1.322381 -0.96456,3.827126 0,2.504742 0.96456,3.842682 0.98012,1.32238 2.83145,1.32238 1.82022,0 2.78478,-1.32238 0.96456,-1.33794 0.96456,-3.842682 0,-2.504745 -0.96456,-3.827126 -0.96456,-1.337938 -2.78478,-1.337938 z m 0,-3.9827 q 4.4961,0 7.0164,2.426957 2.53586,2.426958 2.53586,6.720807 0,4.293852 -2.53586,6.720802 -2.5203,2.42696 -7.0164,2.42696 -4.51165,0 -7.06307,-2.42696 -2.53586,-2.42695 -2.53586,-6.720802 0,-4.293849 2.53586,-6.720807 2.55142,-2.426957 7.06307,-2.426957 z"
style="font-weight:bold;-inkscape-font-specification:'sans-serif Bold'"
id="path6183" />
<path
d="M 468.04679,101.65885 V 91.017574 h 5.60067 v 1.742431 q 0,1.415726 -0.0156,3.56265 -0.0155,2.131367 -0.0155,2.847008 0,2.100257 0.1089,3.033697 0.1089,0.91789 0.37338,1.33794 0.34226,0.54451 0.88677,0.8401 0.56007,0.29559 1.27571,0.29559 1.74243,0 2.7381,-1.33794 0.99568,-1.33794 0.99568,-3.718222 v -8.603254 h 5.56956 v 17.424316 h -5.56956 v -2.52031 q -1.26015,1.52463 -2.67588,2.25583 -1.40016,0.71564 -3.09592,0.71564 -3.01814,0 -4.605,-1.85133 -1.5713,-1.85133 -1.5713,-5.38287 z"
style="font-weight:bold;-inkscape-font-specification:'sans-serif Bold'"
id="path6185" />
<path
d="m 496.48576,105.92158 v 9.14777 H 490.9162 V 91.017574 h 5.56956 v 2.551417 q 1.15125,-1.524627 2.55142,-2.240269 1.40017,-0.731198 3.22038,-0.731198 3.22039,0 5.28953,2.566974 2.06913,2.551417 2.06913,6.58079 0,4.029372 -2.06913,6.596342 -2.06914,2.55142 -5.28953,2.55142 -1.82021,0 -3.22038,-0.71564 -1.40017,-0.7312 -2.55142,-2.25583 z m 3.70267,-11.279127 q -1.78911,0 -2.75367,1.322381 -0.949,1.306824 -0.949,3.780454 0,2.473632 0.949,3.796012 0.96456,1.30682 2.75367,1.30682 1.7891,0 2.72255,-1.30682 0.949,-1.30682 0.949,-3.796012 0,-2.489188 -0.949,-3.796011 -0.93345,-1.306824 -2.72255,-1.306824 z"
style="font-weight:bold;-inkscape-font-specification:'sans-serif Bold'"
id="path6187" />
</g>
<g
aria-label="group"
id="text4663-3-0-3"
style="font-size:31.8616px;line-height:1.25;word-spacing:0px;fill:#333333;stroke-width:0.796539"
transform="matrix(0.52627573,-0.37479867,0.37479867,0.52627573,104.65103,233.46386)"
inkscape:transform-center-x="-26.36445"
inkscape:transform-center-y="26.367634">
<path
d="m 419.51537,248.08791 q -1.15125,1.52463 -2.53586,2.24027 -1.38461,0.71564 -3.20483,0.71564 -3.18927,0 -5.27396,-2.50474 -2.0847,-2.5203 -2.0847,-6.40966 0,-3.90491 2.0847,-6.3941 2.08469,-2.50475 5.27396,-2.50475 1.82022,0 3.20483,0.71565 1.38461,0.71564 2.53586,2.25582 v -2.58253 h 5.60068 v 15.66632 q 0,4.20051 -2.66032,6.40966 -2.64477,2.22471 -7.68537,2.22471 -1.63353,0 -3.15816,-0.24891 -1.52462,-0.24892 -3.06481,-0.76232 v -4.34052 q 1.4624,0.8401 2.86257,1.24459 1.40016,0.42005 2.81589,0.42005 2.73811,0 4.01382,-1.19792 1.2757,-1.19792 1.2757,-3.74934 z m -3.67155,-10.84352 q -1.72687,0 -2.69143,1.27571 -0.96456,1.27571 -0.96456,3.60932 0,2.39584 0.93344,3.64044 0.93345,1.22903 2.72255,1.22903 1.74243,0 2.70699,-1.27571 0.96456,-1.2757 0.96456,-3.59376 0,-2.33361 -0.96456,-3.60932 -0.96456,-1.27571 -2.70699,-1.27571 z"
style="font-weight:bold;-inkscape-font-specification:'sans-serif Bold'"
id="path6190" />
<path
d="m 443.41157,238.36452 q -0.7312,-0.34226 -1.46239,-0.49783 -0.71565,-0.17114 -1.44684,-0.17114 -2.14693,0 -3.31374,1.38462 -1.15124,1.36905 -1.15124,3.93602 v 8.02763 h -5.56956 v -17.42431 h 5.56956 v 2.86257 q 1.07346,-1.71132 2.45807,-2.48919 1.40017,-0.79343 3.34484,-0.79343 0.28004,0 0.60674,0.0311 0.32671,0.0156 0.94901,0.0933 z"
style="font-weight:bold;-inkscape-font-specification:'sans-serif Bold'"
id="path6192" />
<path
d="m 454.4729,237.18216 q -1.85133,0 -2.83145,1.33794 -0.96456,1.32238 -0.96456,3.82712 0,2.50475 0.96456,3.84269 0.98012,1.32238 2.83145,1.32238 1.82022,0 2.78478,-1.32238 0.96456,-1.33794 0.96456,-3.84269 0,-2.50474 -0.96456,-3.82712 -0.96456,-1.33794 -2.78478,-1.33794 z m 0,-3.9827 q 4.49609,0 7.0164,2.42696 2.53586,2.42696 2.53586,6.7208 0,4.29385 -2.53586,6.72081 -2.52031,2.42696 -7.0164,2.42696 -4.51165,0 -7.06307,-2.42696 -2.53586,-2.42696 -2.53586,-6.72081 0,-4.29384 2.53586,-6.7208 2.55142,-2.42696 7.06307,-2.42696 z"
style="font-weight:bold;-inkscape-font-specification:'sans-serif Bold'"
id="path6194" />
<path
d="m 467.8834,244.26079 v -10.64128 h 5.60067 v 1.74243 q 0,1.41573 -0.0156,3.56265 -0.0155,2.13137 -0.0155,2.84701 0,2.10025 0.1089,3.0337 0.1089,0.91788 0.37338,1.33794 0.34226,0.5445 0.88677,0.8401 0.56007,0.29559 1.27571,0.29559 1.74243,0 2.7381,-1.33794 0.99568,-1.33794 0.99568,-3.71823 v -8.60325 h 5.56956 v 17.42431 h -5.56956 v -2.5203 q -1.26015,1.52463 -2.67588,2.25583 -1.40017,0.71564 -3.09592,0.71564 -3.01814,0 -4.605,-1.85133 -1.5713,-1.85134 -1.5713,-5.38287 z"
style="font-weight:bold;-inkscape-font-specification:'sans-serif Bold'"
id="path6196" />
<path
d="m 496.32237,248.52352 v 9.14777 h -5.56956 v -24.05178 h 5.56956 v 2.55142 q 1.15125,-1.52463 2.55142,-2.24027 1.40016,-0.7312 3.22038,-0.7312 3.22039,0 5.28953,2.56697 2.06913,2.55142 2.06913,6.58079 0,4.02938 -2.06913,6.59635 -2.06914,2.55142 -5.28953,2.55142 -1.82022,0 -3.22038,-0.71564 -1.40017,-0.7312 -2.55142,-2.25583 z m 3.70267,-11.27913 q -1.78911,0 -2.75367,1.32238 -0.949,1.30682 -0.949,3.78045 0,2.47363 0.949,3.79602 0.96456,1.30682 2.75367,1.30682 1.7891,0 2.72254,-1.30682 0.94901,-1.30683 0.94901,-3.79602 0,-2.48918 -0.94901,-3.79601 -0.93344,-1.30682 -2.72254,-1.30682 z"
style="font-weight:bold;-inkscape-font-specification:'sans-serif Bold'"
id="path6198" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 28 KiB

View File

@ -312,7 +312,7 @@ There are some types of categories in which only one morphism between two object
Composition
---
One of the few or maybe even the only requirement for a structure to be called a category is that *two morphisms can make a third*, or in other words, that morphisms are *composable* --- given two successive arrows with appropriate type signature, we can draw a third one that is equivalent to the consecutive application of the other two.
The most important requirement for a structure to be called a category is that *two morphisms can make a third*, or in other words, that morphisms are *composable* --- given two successive arrows with appropriate type signature, we can draw a third one that is equivalent to the consecutive application of the other two.
![Composition of morphisms](../02_category/composition.svg)
@ -338,7 +338,6 @@ A structure must have an identity morphism for each object in order for it to be
**Question:** What is the identity morphism in the category of sets?
The law of associativity
---
@ -389,7 +388,8 @@ Addendum: Why are categories like that?
===
*Why* are categories defined by those two laws and not some other two (or one, three, four etc.). laws? From one standpoint, the answer to that seems obvious --- we study categories because they *work*, I mean, look at how many applications are there.
But at the same time category theory is an abstract theory, so everything about it is kinda arbitrary: you can remove a law --- and you get another theory that looks similar to category theory (although it might actually turn out to be quite different in practice (due to a phenomenon called "emergence")). Or you add one more law and you get a yet another theory, so if this specific set of laws works better than any other, then this fact demands an explanation. Not a *mathematical* explanation (e.g. we cannot prove that this theory is better than some other one), but an explanation nevertheless. What follows is *my attempt* to provide such an explanation, regarding the laws of *identity* and *associativity*.
But at the same time category theory is an abstract theory, so everything about it is kinda arbitrary: you can remove a law --- and you get another theory that looks similar to category theory (although it might actually turn out to be quite different in practice (due to a phenomenon called "emergence")). Or you add one more law and you get a yet another theory, so if this specific set of laws works better than any other, then this fact demands an explanation. Not a *mathematical* explanation (e.g. we cannot prove that this theory is better than some other one), but an explanation nevertheless. What follows is *my* attempt to provide such an explanation, regarding the laws of *identity* and *associativity*.
Identity and isomorphisms
===

View File

@ -20,13 +20,13 @@ Objects are overrated
Objects are all around us, everything we "see", both literary (in real life), or metaphorically (in mathematics), can be viewed as an object. Because of this, we might be inclined to think, as many other people do, that the key to understanding the world is understanding *what objects are*. This is what set theory does, from one standpoint --- the main (we may say the only) atomic concept in set theory is a concept of a set. When mathematicians say that "everything is a set", they are saying that *all objects can be represented by sets* (and morphisms can be represented by sets as well).
However, there is another way to look at things. What is an object, when viewed by itself? Can we study an object in isolation and will there anything left to study about it, once it is detached from its environment? Asking such questions might lead us to suspect that, although what we *see* when we look at the world are the objects, it's *functions* that are the real key to understanding it.
However, there is another way to look at things. What is an object, when viewed by itself? Can we study an object in isolation and will there anything left to study about it, once it is detached from its environment? And, as Theseus once asked, if a given object undergoes a process to get all of it's part replaced, is it still the same object?
When we think hard about everyday objects we realize that each of them has a specific *function* or functions without which, it would not be itself. Is a lamp that doesn't glow still a lamp? Is there food that is non-edible (or an edible item that isn't food)? And this is even more valid for mathematical objects, which, without the functions that go between them, are not objects at all, for example, in logic, we say there exist an object such that so and so (existential qualifiers).
Asking such questions might lead us to suspect that, although what we *see* when we look at the world are the objects, it's *functions* that are the real key to understanding it.
So instead of thinking about objects that just happen to have some morphisms between them, we might take the opposite view and say *that objects are only interesting as sources and targets of morphisms.*
When we think hard about everyday objects we realize that each of them has a specific *function* or functions without which, it would not be itself. Is a lamp that doesn't glow still a lamp? Is there food that is non-edible (or an edible item that isn't food)? And this is even more valid for mathematical objects, which, without the functions that go between them, are not objects at all. In logic, for example, we specify objects using existential quantifiers i.e. we say there exist an object such that so and so. So instead of thinking about objects that just happen to have some morphisms between them, we might take the opposite view and say *that objects are only interesting as sources and targets of morphisms.*
This view is deeply engrained in category theory. For example, when we say that a given property defines an object *up to a unique isomorphism* what we mean is exactly this --- that if there are two or more objects that are isomorphic to one another and have exactly the same morphisms from/to all other objects in the category, then these objects are, for all intends and purposes, equivalent. And the key to understanding how this works are natural transformations.
Although old, (dating back to Heraclitus) this view has been largely unexplored, both in the realm of philosophy, and that of mathematics. But it is deeply engrained in category theory. For example, when we say that a given property defines an object *up to a unique isomorphism* what we mean is exactly this --- that if there are two or more objects that are isomorphic to one another and have exactly the same morphisms from/to all other objects in the category (have the same *functions* in the category), then these objects are, for all intends and purposes, equivalent. And the key to understanding how this works are natural transformations.
Equivalence of categories
===

1
build Normal file
View File

@ -0,0 +1 @@
sudo apt-get install com.github.babluboy.bookworm

View File

@ -174,3 +174,4 @@ signifier
TODO
operandi
mathy
Tanenbaum

View File

@ -19,14 +19,18 @@ The book serves as chapter 0 going through the gist of the material covered by o
Praise
===
> "The range of applications for category theory is immense, and visually conveying meaning through illustration is an indispensable skill for organizational and technical work. Unfortunately, the foundations of category theory, despite much of their utility and simplicity being on par with Venn Diagrams, are locked behind resources that assume far too much academic background.
> Category Theory Illustrated is the best introduction to Category Theory Ive ever seen. It is highly visual, full of useful examples and is extremely clearly written. I highly recommend giving it a try.
[Vitaly Kurin](https://twitter.com/y0b1byte) Machine Learning Research Scientist at Isomorphic Labs
> The range of applications for category theory is immense, and visually conveying meaning through illustration is an indispensable skill for organizational and technical work. Unfortunately, the foundations of category theory, despite much of their utility and simplicity being on par with Venn Diagrams, are locked behind resources that assume far too much academic background.
>
>Should category theory be considered for this academic purpose or any work wherein clear thinking and explanations are valued, beginner-appropriate resources are essential. There is no book on category theory that makes its abstractions so tangible as "Category Theory Illustrated" does. I recommend it for programmers, managers, organizers, designers, or anyone else who values the structure and clarity of information, processes, and relationships."
>Should category theory be considered for this academic purpose or any work wherein clear thinking and explanations are valued, beginner-appropriate resources are essential. There is no book on category theory that makes its abstractions so tangible as "Category Theory Illustrated" does. I recommend it for programmers, managers, organizers, designers, or anyone else who values the structure and clarity of information, processes, and relationships.
[Evan Burchard](https://www.oreilly.com/pub/au/7124), Author of "The Web Game Developer's Cookbook" and "Refactoring JavaScript"
> "The clarity, consistency and elegance of diagrams in 'Category Theory Illustrated' has helped us demystify and explain in simple terms a topic often feared."
> The clarity, consistency and elegance of diagrams in 'Category Theory Illustrated' has helped us demystify and explain in simple terms a topic often feared.
[Gonzalo Casas](https://gnz.io/), Software developer and lecturer at ETH Zurich