diff --git a/.gitignore b/.gitignore
index 4cb0bc4..bcf5ce1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
*.swp
*.un~
+_site
diff --git a/.jekyll-metadata b/.jekyll-metadata
deleted file mode 100644
index 28e3205..0000000
Binary files a/.jekyll-metadata and /dev/null differ
diff --git a/Gemfile b/Gemfile
new file mode 100644
index 0000000..37f5eaa
--- /dev/null
+++ b/Gemfile
@@ -0,0 +1,2 @@
+source 'https://rubygems.org'
+gem 'github-pages', group: :jekyll_plugins
diff --git a/Gemfile.lock b/Gemfile.lock
new file mode 100644
index 0000000..7731d89
--- /dev/null
+++ b/Gemfile.lock
@@ -0,0 +1,261 @@
+GEM
+ remote: https://rubygems.org/
+ specs:
+ activesupport (6.0.3.4)
+ concurrent-ruby (~> 1.0, >= 1.0.2)
+ i18n (>= 0.7, < 2)
+ minitest (~> 5.1)
+ tzinfo (~> 1.1)
+ zeitwerk (~> 2.2, >= 2.2.2)
+ addressable (2.7.0)
+ public_suffix (>= 2.0.2, < 5.0)
+ coffee-script (2.4.1)
+ coffee-script-source
+ execjs
+ coffee-script-source (1.11.1)
+ colorator (1.1.0)
+ commonmarker (0.17.13)
+ ruby-enum (~> 0.5)
+ concurrent-ruby (1.1.7)
+ dnsruby (1.61.5)
+ simpleidn (~> 0.1)
+ em-websocket (0.5.2)
+ eventmachine (>= 0.12.9)
+ http_parser.rb (~> 0.6.0)
+ ethon (0.12.0)
+ ffi (>= 1.3.0)
+ eventmachine (1.2.7)
+ execjs (2.7.0)
+ faraday (1.3.0)
+ faraday-net_http (~> 1.0)
+ multipart-post (>= 1.2, < 3)
+ ruby2_keywords
+ faraday-net_http (1.0.1)
+ ffi (1.14.2)
+ forwardable-extended (2.6.0)
+ gemoji (3.0.1)
+ github-pages (209)
+ github-pages-health-check (= 1.16.1)
+ jekyll (= 3.9.0)
+ jekyll-avatar (= 0.7.0)
+ jekyll-coffeescript (= 1.1.1)
+ jekyll-commonmark-ghpages (= 0.1.6)
+ jekyll-default-layout (= 0.1.4)
+ jekyll-feed (= 0.15.1)
+ jekyll-gist (= 1.5.0)
+ jekyll-github-metadata (= 2.13.0)
+ jekyll-mentions (= 1.6.0)
+ jekyll-optional-front-matter (= 0.3.2)
+ jekyll-paginate (= 1.1.0)
+ jekyll-readme-index (= 0.3.0)
+ jekyll-redirect-from (= 0.16.0)
+ jekyll-relative-links (= 0.6.1)
+ jekyll-remote-theme (= 0.4.2)
+ jekyll-sass-converter (= 1.5.2)
+ jekyll-seo-tag (= 2.6.1)
+ jekyll-sitemap (= 1.4.0)
+ jekyll-swiss (= 1.0.0)
+ jekyll-theme-architect (= 0.1.1)
+ jekyll-theme-cayman (= 0.1.1)
+ jekyll-theme-dinky (= 0.1.1)
+ jekyll-theme-hacker (= 0.1.2)
+ jekyll-theme-leap-day (= 0.1.1)
+ jekyll-theme-merlot (= 0.1.1)
+ jekyll-theme-midnight (= 0.1.1)
+ jekyll-theme-minimal (= 0.1.1)
+ jekyll-theme-modernist (= 0.1.1)
+ jekyll-theme-primer (= 0.5.4)
+ jekyll-theme-slate (= 0.1.1)
+ jekyll-theme-tactile (= 0.1.1)
+ jekyll-theme-time-machine (= 0.1.1)
+ jekyll-titles-from-headings (= 0.5.3)
+ jemoji (= 0.12.0)
+ kramdown (= 2.3.0)
+ kramdown-parser-gfm (= 1.1.0)
+ liquid (= 4.0.3)
+ mercenary (~> 0.3)
+ minima (= 2.5.1)
+ nokogiri (>= 1.10.4, < 2.0)
+ rouge (= 3.23.0)
+ terminal-table (~> 1.4)
+ github-pages-health-check (1.16.1)
+ addressable (~> 2.3)
+ dnsruby (~> 1.60)
+ octokit (~> 4.0)
+ public_suffix (~> 3.0)
+ typhoeus (~> 1.3)
+ html-pipeline (2.14.0)
+ activesupport (>= 2)
+ nokogiri (>= 1.4)
+ http_parser.rb (0.6.0)
+ i18n (0.9.5)
+ concurrent-ruby (~> 1.0)
+ jekyll (3.9.0)
+ addressable (~> 2.4)
+ colorator (~> 1.0)
+ em-websocket (~> 0.5)
+ i18n (~> 0.7)
+ jekyll-sass-converter (~> 1.0)
+ jekyll-watch (~> 2.0)
+ kramdown (>= 1.17, < 3)
+ liquid (~> 4.0)
+ mercenary (~> 0.3.3)
+ pathutil (~> 0.9)
+ rouge (>= 1.7, < 4)
+ safe_yaml (~> 1.0)
+ jekyll-avatar (0.7.0)
+ jekyll (>= 3.0, < 5.0)
+ jekyll-coffeescript (1.1.1)
+ coffee-script (~> 2.2)
+ coffee-script-source (~> 1.11.1)
+ jekyll-commonmark (1.3.1)
+ commonmarker (~> 0.14)
+ jekyll (>= 3.7, < 5.0)
+ jekyll-commonmark-ghpages (0.1.6)
+ commonmarker (~> 0.17.6)
+ jekyll-commonmark (~> 1.2)
+ rouge (>= 2.0, < 4.0)
+ jekyll-default-layout (0.1.4)
+ jekyll (~> 3.0)
+ jekyll-feed (0.15.1)
+ jekyll (>= 3.7, < 5.0)
+ jekyll-gist (1.5.0)
+ octokit (~> 4.2)
+ jekyll-github-metadata (2.13.0)
+ jekyll (>= 3.4, < 5.0)
+ octokit (~> 4.0, != 4.4.0)
+ jekyll-mentions (1.6.0)
+ html-pipeline (~> 2.3)
+ jekyll (>= 3.7, < 5.0)
+ jekyll-optional-front-matter (0.3.2)
+ jekyll (>= 3.0, < 5.0)
+ jekyll-paginate (1.1.0)
+ jekyll-readme-index (0.3.0)
+ jekyll (>= 3.0, < 5.0)
+ jekyll-redirect-from (0.16.0)
+ jekyll (>= 3.3, < 5.0)
+ jekyll-relative-links (0.6.1)
+ jekyll (>= 3.3, < 5.0)
+ jekyll-remote-theme (0.4.2)
+ addressable (~> 2.0)
+ jekyll (>= 3.5, < 5.0)
+ jekyll-sass-converter (>= 1.0, <= 3.0.0, != 2.0.0)
+ rubyzip (>= 1.3.0, < 3.0)
+ jekyll-sass-converter (1.5.2)
+ sass (~> 3.4)
+ jekyll-seo-tag (2.6.1)
+ jekyll (>= 3.3, < 5.0)
+ jekyll-sitemap (1.4.0)
+ jekyll (>= 3.7, < 5.0)
+ jekyll-swiss (1.0.0)
+ jekyll-theme-architect (0.1.1)
+ jekyll (~> 3.5)
+ jekyll-seo-tag (~> 2.0)
+ jekyll-theme-cayman (0.1.1)
+ jekyll (~> 3.5)
+ jekyll-seo-tag (~> 2.0)
+ jekyll-theme-dinky (0.1.1)
+ jekyll (~> 3.5)
+ jekyll-seo-tag (~> 2.0)
+ jekyll-theme-hacker (0.1.2)
+ jekyll (> 3.5, < 5.0)
+ jekyll-seo-tag (~> 2.0)
+ jekyll-theme-leap-day (0.1.1)
+ jekyll (~> 3.5)
+ jekyll-seo-tag (~> 2.0)
+ jekyll-theme-merlot (0.1.1)
+ jekyll (~> 3.5)
+ jekyll-seo-tag (~> 2.0)
+ jekyll-theme-midnight (0.1.1)
+ jekyll (~> 3.5)
+ jekyll-seo-tag (~> 2.0)
+ jekyll-theme-minimal (0.1.1)
+ jekyll (~> 3.5)
+ jekyll-seo-tag (~> 2.0)
+ jekyll-theme-modernist (0.1.1)
+ jekyll (~> 3.5)
+ jekyll-seo-tag (~> 2.0)
+ jekyll-theme-primer (0.5.4)
+ jekyll (> 3.5, < 5.0)
+ jekyll-github-metadata (~> 2.9)
+ jekyll-seo-tag (~> 2.0)
+ jekyll-theme-slate (0.1.1)
+ jekyll (~> 3.5)
+ jekyll-seo-tag (~> 2.0)
+ jekyll-theme-tactile (0.1.1)
+ jekyll (~> 3.5)
+ jekyll-seo-tag (~> 2.0)
+ jekyll-theme-time-machine (0.1.1)
+ jekyll (~> 3.5)
+ jekyll-seo-tag (~> 2.0)
+ jekyll-titles-from-headings (0.5.3)
+ jekyll (>= 3.3, < 5.0)
+ jekyll-watch (2.2.1)
+ listen (~> 3.0)
+ jemoji (0.12.0)
+ gemoji (~> 3.0)
+ html-pipeline (~> 2.2)
+ jekyll (>= 3.0, < 5.0)
+ kramdown (2.3.0)
+ rexml
+ kramdown-parser-gfm (1.1.0)
+ kramdown (~> 2.0)
+ liquid (4.0.3)
+ listen (3.4.0)
+ rb-fsevent (~> 0.10, >= 0.10.3)
+ rb-inotify (~> 0.9, >= 0.9.10)
+ mercenary (0.3.6)
+ mini_portile2 (2.5.0)
+ minima (2.5.1)
+ jekyll (>= 3.5, < 5.0)
+ jekyll-feed (~> 0.9)
+ jekyll-seo-tag (~> 2.1)
+ minitest (5.14.3)
+ multipart-post (2.1.1)
+ nokogiri (1.11.1)
+ mini_portile2 (~> 2.5.0)
+ racc (~> 1.4)
+ octokit (4.20.0)
+ faraday (>= 0.9)
+ sawyer (~> 0.8.0, >= 0.5.3)
+ pathutil (0.16.2)
+ forwardable-extended (~> 2.6)
+ public_suffix (3.1.1)
+ racc (1.5.2)
+ rb-fsevent (0.10.4)
+ rb-inotify (0.10.1)
+ ffi (~> 1.0)
+ rexml (3.2.4)
+ rouge (3.23.0)
+ ruby-enum (0.8.0)
+ i18n
+ ruby2_keywords (0.0.2)
+ rubyzip (2.3.0)
+ safe_yaml (1.0.5)
+ sass (3.7.4)
+ sawyer (0.8.2)
+ addressable (>= 2.3.5)
+ faraday (> 0.8, < 2.0)
+ simpleidn (0.2.1)
+ unf (~> 0.1.4)
+ terminal-table (1.8.0)
+ unicode-display_width (~> 1.1, >= 1.1.1)
+ thread_safe (0.3.6)
+ typhoeus (1.4.0)
+ ethon (>= 0.9.0)
+ tzinfo (1.2.9)
+ thread_safe (~> 0.1)
+ unf (0.1.4)
+ unf_ext
+ unf_ext (0.0.7.7)
+ unicode-display_width (1.7.0)
+ zeitwerk (2.4.2)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ github-pages
+
+BUNDLED WITH
+ 2.1.4
diff --git a/_chapters/01_set.md b/_chapters/01_set.md
index 909daf7..9c7483e 100644
--- a/_chapters/01_set.md
+++ b/_chapters/01_set.md
@@ -68,7 +68,7 @@ Of course if one is a valid answer, so can be zero. If we want a set of all *bla
Note that a set is defined only by the items it contains, which means that there is no difference between the set that contains zero *balls* and the set that contains zero *numbers*, for instance. In other words, the empty set is *unique* set, which makes it a very special one. Formally, the empty set is marked with the symbol **∅** (so **B = W = ∅**).
-The empty set is a special one, for example, it is a subset of every other set (mathematically speaking, **∀ A | A ⊆ ∅**)
+The empty set is a special one, for example, it is a subset of every other set (mathematically speaking, **∀ A \| A ⊆ ∅**)
We will encounter the empty set again.
@@ -105,11 +105,12 @@ The question "How far are we from New York?" is a function with a domain the set
**Question:** Some people might say that the codomain of this function is bigger than it should be. How would you refine it?
The question "Who is my father?" is a function whose domain is the set of all people in the world.
-Question: What is the codomain of this function?
+
+**Question:** What is the codomain of this function?
Note that the question "Who is my child?" is *NOT* a straightforward function, because a person can have no children, or can have multiple children. We will learn to represent such questions as functions later.
-Question: Do all functions that we drew at the beginning *express* something? Do you think that a function should express something in order to be valid?
+**Question:** Do all functions that we drew at the beginning *express* something? Do you think that a function should express something in order to be valid?
The Identity Function
---
@@ -135,11 +136,11 @@ There is a unique function from the empty set to any other set.
![Function with empty set](function_empty.svg)
-Question: Is this really valid? Why? Check the definition.
+**Question:** Is this really valid? Why? Check the definition.
Note that this statement is also a result from the one saying that there is a function between a Subset and a Set, and the one that says that the empty set is a subset of any other set.
-Question: What about the other way around. Are there functions with the empty set as a codomain as opposed to a domain?
+**Question:** What about the other way around. Are there functions with the empty set as a codomain as opposed to a domain?
Functions and Singleton Sets
---
@@ -336,5 +337,5 @@ Following the logic from the last paragraph, each statement about something that
*Question:* Try to come up with a good example that shows how a statement that demonstrates the isomorphism between singleton sets (I obviously couldn't). Consider that all of people and objects are sharing one and the same universe.
-*Task:* Think of two singleton sets, and try to pinpoint the relation that they have.
+**Task:** Think of two singleton sets, and try to pinpoint the relation that they have.
diff --git a/_chapters/02_category.md b/_chapters/02_category.md
index 08f91cf..859ef17 100644
--- a/_chapters/02_category.md
+++ b/_chapters/02_category.md
@@ -11,7 +11,7 @@ In this chapter we will continue with set theory and at the same time we will st
Products
===
-In the previous chapter, we needed a way to make a set that is a composite of other sets that we already have. For example when we discussed mathematical functions, we couldn't define **+** and **-** functions, because we only knew about functions that take one argument. When we talked about programming, we talked about the primitive types, `Char` and `Number`, and we mentioned that most of the types are composite types. So how do we construct those?
+In the previous chapter, we needed a way to make a set that is a composite of other sets that we already have. For example, when we discussed mathematical functions, we couldn't define **+** and **-** functions, because we only knew about functions that take one argument. When we talked about programming, we talked about the primitive types, `Char` and `Number`, and we mentioned that most of the types are composite types. So how do we construct those?
The simplest composite type, of the sets **B**, which contains **b**'s and the set**Y**, which contains **y**'s is the the *product* or **B** and **Y**.
@@ -30,7 +30,7 @@ Products as Objects
We established that in programming sets resemble types and functions resemble functions. Products, in this case, are like stripped-out *classes* (also called *records* or *structs*). The composite sets (the ones which form the product) are just the class's fields (also called *members*). The functions for accessing them are like what programmers call *getter methods*.
-For example the famous OOP example of `Person` class with `name` and `age` fields is nothing more than a product of the set of strings, and the sets of numbers (we still haven't defined strings and lists in terms of set theory but we will get to that). Objects with more than two values can be expressed as products the composites of which are themselves products.
+For example, the famous OOP example of `Person` class with `name` and `age` fields is nothing more than a product of the set of strings, and the sets of numbers (we still haven't defined strings and lists in terms of set theory but we will get to that). Objects with more than two values can be expressed as products the composites of which are themselves products.
Using Products to Define Numeric Operations
---
@@ -110,7 +110,7 @@ Notice that the when a given object is an element of both sets, then it appears
Defining Sums in Terms of Sets
---
-Simply put, a sum of two sets is a set that contains all elements from the first set and all elements from the second one. But, as with the product, it is not so straightforward to represent sums in terms of sets. For example if two sets can have the same element as a member, their sum will have that element twice which is not permitted, because a set cannot contain the same element twice.
+Simply put, a sum of two sets is a set that contains all elements from the first set and all elements from the second one. But, as with the product, it is not so straightforward to represent sums in terms of sets. For example, if two sets can have the same element as a member, their sum will have that element twice which is not permitted, because a set cannot contain the same element twice.
As with the product, the solution is to put some extra structure.
@@ -126,7 +126,7 @@ But again, this distinction is only rellevant only when the two sets have common
Defining Sums in Terms of Functions
---
-You might already suspect, the interesting part is expressing the sum of two sets using functions. To do that we have to go back to the conceptual part of the definition. We said that sums express an **OR** relation between two things. A simple property of every **OR** relation is that if something is an **A** that something is also an **A OR B** (and the same is valid if it is **B**). For example if I am *a man*, I am also *a man OR a woman*. This is what **OR** means, right?
+You might already suspect, the interesting part is expressing the sum of two sets using functions. To do that we have to go back to the conceptual part of the definition. We said that sums express an **OR** relation between two things. A simple property of every **OR** relation is that if something is an **A** that something is also an **A OR B** (and the same is valid if it is **B**). For example, if I am *a man*, I am also *a man OR a woman*. This is what **OR** means, right?
This relationship can be expressed as a function. Two functions actually - one for each set that takes part in the relation.
@@ -143,7 +143,7 @@ You might already notice that this definition is pretty similar to the previous
All these sets are, express relationships which are more vague than the simple sum and therefore given any such set there would exist a function from the sum to it.
-For exaple, there exist a trivial function between the set **Y | B ** and the set **Y | B | R**.
+For example, there exist a trivial function between the set **Y \| B** and the set **Y \| B \| R**.
![Coproduct, external diagram](coproduct_morphisms.svg)
@@ -200,13 +200,10 @@ One remark before we go - the last paragraphs I sound as if I'm *comparing* cate
Perhaps that notion would be somewhat correct if category and set theory were meant to describe *concrete* phenomena, in the way that the theory of relativity and the theory of quantum mechanics in physics. Concrete theories are conceived mainly as *descriptions* of the world, and as such it makes sense for them to be connected to one another in some sort of hierarchy. Abstract theories, like category theory and set theory, on the other hand, are more like languages for expressing such descriptions. They still can be connected, and are connected in more than one way, but there is no inherent hierarchy between the two and therefore arguing over which of the two is more basic, or more general, is just a chicken-and-egg problem, as you would see in the next chapter.
-Defining Categories
+Defining Categories (again)
===
-Every category theory guide (including mine) starts by talking about set theory. However, looking back, I really don't know why that is the case - surely most other books that focus around a specific subject don't start by introducing an entirely different subject. Perhaps the set-first approach is the best way to introduce people to categories. or perhaps using sets to introduce categories is just one of the things that people just do, simply because everyone else does it. But one thing is for sure - we don't need to study sets in order to understand categories. So in this chapter I would like to start over and talk about categories as a first concept. So pretend like it's a new book:
-
-Starting over with categories
-===
+Every category theory guide (including mine) starts by talking about set theory, however looking back I really don't know why that is the case - most books that focus around a given subject don't start by introducing an entirely different subject. Perhaps the set-first approach is the best way to introduce people to categories. Or perhaps using sets to introduce categories is just one of the things that people just do because everyone else does it. But one thing is for sure - we don't need to study sets in order to understand categories. So now I would like to start over and talk about categories as a first concept. So pretend like it's a new book.
So, a category is a collection of objects (things) where the "things" can be anything you want. Consider, for example, these ~~colourful~~ grey balls:
@@ -231,7 +228,7 @@ Why is that is pretty obvious if we go back to set theory for a second (OK, mayb
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.
+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.
![Composition of morphisms](composition.svg)
@@ -274,7 +271,7 @@ This formula is true if and only if this diagram commutes.
Given that all our category-theoretic diagrams commute, we can say, in such cases, that the formula and the diagram are equivalent.
-This formula (and the diagram) is the definition of a property called **associativity**. Being associative is required for functional composition to really be called functional composition (and for a category to really be called category), if only because it is required for us to be able to draw diagrams of a category's objects and morphisms, as diagrams can only represent associative structures (if the diagram above does not commute it would be super weird).
+This formula (and the diagram) is the definition of a property called **associativity**. Being associative is required for functional composition to really be called functional composition (and for a category to really be called category). It is also required for our diagrams to work, as diagrams can only represent associative structures (imagine if the diagram above does not commute - it would be super weird).
Associativity is not just about diagrams, for example when we express relations using formulas, associativity just means that brackets don't matter, in our formulas (as evidenced by the definition **(h • g) • f = h • (g • f)**). And it is not only about categories either, it is a property of many other operations on other types of objects as well e.g. if we look at numbers, we can see that the multiplication operation is associative e.g. **(1 . 2) . 3 = 1 . (2 . 3)**. While division is not **(1 / 2) / 3 = 1 / (2 / 3)**.
@@ -286,16 +283,15 @@ Ancient mathematicians invented the number zero that, although useless by itself
![The identity morphism (but can also be any other morphism)](identity.svg)
-It's important to mark this morphism, because there can be (let's add the very important (and also very boring) reminder) many morphisms that go from one object to the same object, many of which actually do stuff. For example mathematics deals with a multitude of functions that have the set of numbers as domain and codomain, such as **negate**, **square**, **add one**, and are not at all the identity morphism.
+It's important to mark this morphism, because there can be (let's add the very important (and also very boring) reminder) many morphisms that go from one object to the same object, many of which actually do stuff. For example, mathematics deals with a multitude of functions that have the set of numbers as domain and codomain, such as **negate**, **square**, **add one**, and are not at all the identity morphism.
**Question:** What is the identity morphism in the category of sets?
-Why do we need to define a morphism that does nothing?
Isomorphisms
---
-Once we have the concept of identity morphism defined we can have a category-theoretic definition of an isomoprhism (which is important, because the concept of an isomorphism is very important for cathegory theory): An isomorphism between two objects (**A** and **B**) consists of two morphisms - (**A → B**. and **B → A**) such that their compositions are equivalent to the identity functions of the respective objects.
+Why do we need to define a morphism that does nothing? It's because morphisms are the basic building blocks of our language and we need this one to be able to speak properly. For example, once we have the concept of identity morphism defined we can have a category-theoretic definition of an *isomoprhism* (which is important, because the concept of an isomorphism is very important for cathegory theory): An isomorphism between two objects (**A** and **B**) consists of two morphisms - (**A → B**. and **B → A**) such that their compositions are equivalent to the identity functions of the respective objects.
Here is how this looks when expressed using a formulas:
diff --git a/_chapters/02_category/product.svg.2021_01_02_19_36_26.1.svg b/_chapters/02_category/product.svg.2021_01_02_19_36_26.1.svg
new file mode 100644
index 0000000..b0c6fd0
--- /dev/null
+++ b/_chapters/02_category/product.svg.2021_01_02_19_36_26.1.svg
@@ -0,0 +1,337 @@
+
+
diff --git a/_chapters/03_monoid.md b/_chapters/03_monoid.md
index 29f99c3..5563ddd 100644
--- a/_chapters/03_monoid.md
+++ b/_chapters/03_monoid.md
@@ -50,7 +50,6 @@ To keep the suspense alive, let's see some simpler monoids before we dwelve into
Basic monoids
===
-
Monoids from numbers
---
@@ -103,40 +102,206 @@ In general, we use monoids and related structures as a way to model how a set of
Other monoid-like objects
===
-Monoid operations obey only one law - they are associative (two, if you count the existence of the identity element). In some cases we come across operations that also obey other rules that are also interesting. Imposing more (or less) rules to the way in which actions are combinded results in the definition of other monoid-like structures.
+Monoid operations obey two laws - they are associative and there is an identity element. In some cases we come across operations that also obey other laws that are also interesting. Imposing more (or less) rules to the way in which actions are combinded results in the definition of other monoid-like structures.
-Commutative monoids
+Commutative (abelian) monoids
---
-Looking at the monoid laws and the examples we gave so far, we observe that all of them obey one more rule (law) which we didn't specify, namely that the order in which the operations are applied is irrelevant to the end result.
+Looking at the monoid laws and the examples we gave so far, we observe that all of them obey one more rule (law) which we didn't specify - the order in which the operations are applied is irrelevant to the end result.
![Commutative monoid operation](monoid_commutative.svg)
Such operations (ones for which combining a given set of objects yields the same result no matter which one is first and which one is second) are called *commutative* operations. Monoids with operations that are commutative are called *commutative monoids*.
-As we said, addition is commutative as well - it does not matter whether if I have given you 1 apple and then 2 more, or if I have given you 2 first and then 1 more i.e. **x + y = y + x**.
+As we said, addition is commutative as well - it does not matter whether if I have given you 1 apple and then 2 more, or if I have given you 2 first and then 1 more.
![Commutative monoid operation](addition_commutative.svg)
-All monoids that we examined so far are also *commutative*, and we will see some non-commutative ones later.
+All monoids that we examined so far are also *commutative*, but we will see some non-commutative ones later.
Groups
---
- A group is just a monoid in which each element has what is called an "inverse" element where the element and its inverse cancel each other out when applied one after the other, in other words , **forall x, there must exist x' such that x • x' = i** ( where **i** is the identity element).
+ A group is a monoid in which each element has what is called an "inverse" element where the element and its inverse cancel each other out when applied one after the other, in other words , **forall x, there must exist x' such that x • x' = i** ( where **i** is the identity element).
-If we view *monoids* as a means of modelling the effect of applying a set of (associative) actions, we use *groups* to model the eeffects of actions are also *reversible*.
+If we view *monoids* as a means of modelling the effect of applying a set of (associative) actions, we use *groups* to model the effects of actions are also *reversible*.
-An nice example of a group can be found in the realm of numbers (really, numbers are a nice example of almost all properties) - it is the set of integers under addition, where the inverse of each number is its opposite number. The above formula, then, becomes **x + (-x) = 0**
+An nice example of a group can be found in the realm of numbers (really, numbers are a nice example of almost all laws) - it is the set of integers under addition, where the inverse of each number is its opposite number (positive numbers' inverse are negatives and vice versa). The above formula, then, becomes **x + (-x) = 0**
-The study of groups is a field that is much bigger than the theory of monoids (and perhaps bigger than category theory itself). And it all started with the what are now called the "symmetry groups" which we will look into with more details.
+The study of groups is a field that is much bigger than the theory of monoids (and perhaps bigger than category theory itself).
+
+And it all started with the what are now called the "symmetry groups" which we will look into in more detail.
Summary
---
-Here are the algebraic structures that we have seen so far and the laws that they obey.
+
+The algebraic structures that we saw can be summarized based on the laws that define them in this table.
| | Semigroups | Monoids | Groups |
|---| --- | --- |
|Associativity| X | X | X |
|Identity| | X | X |
|Invertability | | | X |
+
+Symmetry groups
+===
+
+An interesting kinds of groups/monoids are the groups of *symmetries* of geometric figures. Given some geometric figure, a symmetry is an action after which the figure is not displaced (e.g. it can fit into the same mold that it fit before the action was applied).
+
+We won't use the balls this time, as they have just one position just one action - the identity action (which is it's own reverse by the way). So let's take this triangle (which for our purposes, is the same as any other triangle).
+
+![A triangle](symmetry_group.svg)
+
+Groups of rotations
+---
+
+Let's first review the group of ways in which we can rotate our triangle i.e. its *rotation group*. A geometric figure can be rotated without displacement in positions equal to the number of its sides, so for our triangle there are 3 positions.
+
+![The group of rotations in a triangle](symmetry_rotation.svg)
+
+Connecting the dots (or the triangles in this case) shows us that there are just two possible actions that get us from any state to any other one - a *120-degree rotation* (i.e. flipping the triangle one time) and a *240-degree rotation* (i.e. flipping it two times (or equivalently, flipping it once, but in the opposite direction)). Adding the identity action of 0-degree rotation makes up for 3 actions in total.
+
+![The group of rotations in a triangle](symmetry_rotation_actions.svg)
+
+Cyclic groups/monoids
+---
+
+Ennumerating all the rotations of a more complex geometrical figure looks quite messy at first.
+
+![The group of rotations in a more complex figure](symmetry_rotation_square.svg)
+
+But it's much simpler to grasp if we notice the following: although our group has many actions, and there are more still for figures with more sides (if I am not mistaken, the number of actions is equal to the number of the sides), all of those actions can be reduced to the repetitive application of just the simplest action, (the 120-degree rotation for triangles and the 30-degree rotation for octagons). Let's make up a symbol for this rotation.
+
+![The group of rotations in a triangle](symmetry_rotation_cyclic.svg)
+
+Groups and monoids that have this "main" action (called a "generator") which when applied enough times can get you to any state that which is *cyclic groups*. All rotation groups are cyclic groups. Another example of a cyclic groups is, yes, the integers under addition. Here we can use **+1** or **-1** as generators.
+
+![The group of numbers under addition](numbers_cyclic.svg)
+
+Wait, how can this be a cyclic group when there are no cycles? This is because the integers are an *infinite* cyclic group.
+
+An example of a finite number-based cycle group are the integers in *modular arithmetic* (sometimes called "clock arithmetic). Modular arithmetic's operation is based on a number called the modulus of an arithmetic (let's take **12** for example). In it, each number is mapped to the *remainder of the integer addition of that number and the modulus*.
+
+For example: **1 modulo 12 = 1** (because 1/12 = 0 with 1 remainder) **2 modulo 12 = 2** etc.
+
+but **13 modulo 12 = 1** (13/12 = 1 with 1 remainder) **14 modulo 12 = 2**, **15 modulo 12 = 3** etc.
+
+In effect numbers "wrap around" upon reaching the modulus.
+
+Here is a group representation of modular arithmetic with modulus 3.
+
+![The group of numbers under addition](numbers_modular.svg)
+
+Here are a couple of interesting facts about cyclic groups.
+
+1 All cyclic groups that the same number of elements (or of the *same order*) are isomorphic to each other i.e. they are the same group. For example, the group of rotations of the triangle is isomorphic to the integers under the addition with modulo 3. This group is called **Z3**.
+
+![The group of numbers under addition](symmetry_modular.svg)
+
+2 All cyclic groups are *commutative* (or "abelian" as they are also called). There are, however abelian groups that are not cyclic, but, as we shall see below, the concepts of cyclic groups and of abelian groups are deeply related.
+
+**Task:** Prove that there are no other groups with 3 objects, other than **Z3**.
+
+The smallest groups
+---
+
+Like with sets, the concept of an isomorphism in group theory allows us to identify common groups, like the smallest groups.
+
+The smallest group is just the trivial group **Z1** that has just one object and no morphisms.
+
+![The smallest group](trivial_group.svg)
+
+The smallest non-trivial group is the group **Z2** that has two objects and one morphism that goes between them.
+
+![The smallest non-trivial group](smallest_group.svg)
+
+**Z2** is also known as the *boolean group*, due to the fact that it is isomorphic to the **{ True, False }** set.
+
+Group products
+---
+
+Given any two groups we can create a third group, called their *product group*, comprised of all possible pairs of elements from the two groups and of the sum of all their actions.
+
+To demonstrate how, let's take the following two groups (which, having just two elements and one operation, are both isomorphic to **Z2**) - the first one is based on the vertical reflection of a figure and the second, just the horizontal reflection.
+
+![Two trivial groups](groups_product.svg)
+
+We get set of elements of the new group by making *the cartesian product* of the set of the elements of the first group and the set of the element of the second one.
+
+![Two trivial groups](groups_product_four.svg)
+
+The *actions* of the product group are comprised of the actions of the first group, combided with the actions of the second one, where each action is applied only on the element that is a member of it's corresponding group leaving the other element unchanged.
+
+![Klein four](klein_four_as_product.svg)
+
+The result of our particular operation is called the **Klein four-group** and is the simplest *abelian non-cyclic* group.
+
+Another way to present the Klein-four group is the *group of symmetries of a non-square rectangle*.
+
+![Klein four](klein_four.svg)
+
+Task: prove that the two representations are isomorphic.
+
+The Klein-four groups is *non-cyclic* because there are not one, but two main actions - vertical and horizontal spin. It is *abelian*, because the ordering of the actions still does not matter for the end results - this is because the actions do not interfere with one another.
+
+Fundamental theory of Finite Abelian groups
+---
+
+We already saw one way to create non-cyclic abelian groups - by creating a product of two or more cyclic groups. All product groups (except the ones that feature the trivial group) would necessarily be non-cyclic, and they would also be abelian. The fundamental theory of finite abelian groups is a result that tells us that this is the only way to produce non-cyclic abelian groups.
+
+> All abelian groups are either cyclic or products of cyclic groups.
+
+And this is how the two concepts are related.
+
+Groups of rotations and reflections
+---
+
+Now let's see a non-commutative group - the group of rotations *and reflections* of a given geometrical figure. It is the same as the last one, but here besides the rotation action that we already saw (and its composite actions), we have the action of flipping the figure vertically, an operation which results in its mirror image:
+
+![Reflection of a triangle](reflection.svg)
+
+Those two operations and their composite results in a group called **Dih3** that is not abelian (and is furthermore the *smallest* non-abelian group).
+
+![The group of rotations and reflections in a triangle](symmetry_reflection.svg)
+
+**Task:** Prove that this group is indeed not abelian.
+
+**Question:** Besides having two main actions, what is the defining factor that makes this and any other group non-abelian?
+
+
+
+Monoids as Categories
+===
+
+We began by defining a monoid as a set of composable objects, but as we saw, those objects can be also seen as actions e.g. the red ball in our color-blending monoid can be seen as the action of adding the color red to the mix, as the number **2** in the monoid of addition can be seen as the function **+2**. And actions are basically functions, so perhaps there is a way to model monoids using set theory.
+
+So let's consider the monoid/group **Z3** again.
+
+![The group of rotations in a triangle - group notation](symmetry_rotation_actions.svg)
+
+We can see that it is composed of a set of three elements and an equal number of functions between that set and itself, where we have a function to go from any element to any other one.
+
+![The group of rotations in a triangle - set notation](symmetry_rotation_functions.svg)
+
+And those functions obviously compose, as all functions do (combining each two functions makes up a third one)
+
+![The group of rotations in a triangle - set notation](symmetry_rotation_set.svg)
+
+And we do have the identity function itself too, so monoids indeed form a category.
+
+![The group of rotations in a triangle - categorical notation](symmetry_rotation_external.svg)
+
+But wait, we said that sets in set theory correspond to objects in category theory. So if a monoid is based on just one set, then the corresponding category would have just one object and therefore it is better represented as just one point from which all arrows come and to which they go (this representation would also show (correctly) that all morphisms in the category compose with one another).
+
+![The group of rotations in a triangle - categorical notation](symmetry_rotation_category.svg)
+
+The intuition behind this representation is encompassed by the requirement of **closure** that monoid and group operations have - it is the law that applying the operation on any two elements of the set of elements that form the monoid always results in a element that is also a member of the set e.g. no matter how do you flip a triangle, you'd still get a triangle.
+
+| | Categories | Monoids | Groups
+|---| --- | --- |
+|Associativity| X | X | X |
+|Identity| X | X | X |
+|Invertability | | | X |
+|Closure | | X | X |
+
+When we view a monoid as a category, this law says that all morphisms in the category should be from one object to itself - a monoid, any monoid, can be seen as a category with one object (and a a various amount of morphisms).
diff --git a/_chapters/03_monoid/balls.svg b/_chapters/03_monoid/balls.svg
index cf2e738..f8e0f2f 100644
--- a/_chapters/03_monoid/balls.svg
+++ b/_chapters/03_monoid/balls.svg
@@ -39,12 +39,13 @@
id="namedview3399"
showgrid="false"
inkscape:zoom="2.3349572"
- inkscape:cx="297.64999"
- inkscape:cy="115.55631"
+ inkscape:cx="214.13668"
+ inkscape:cy="81.29444"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="0"
- inkscape:current-layer="svg3397" />
+ inkscape:current-layer="svg3397"
+ inkscape:document-rotation="0" />
+
diff --git a/_chapters/03_monoid/balls_associativity.svg b/_chapters/03_monoid/balls_associativity.svg
index 3c7b76b..7538ecb 100644
--- a/_chapters/03_monoid/balls_associativity.svg
+++ b/_chapters/03_monoid/balls_associativity.svg
@@ -22,7 +22,7 @@
image/svg+xml
-
+
@@ -92,7 +92,7 @@
cy="34.313828"
r="21.732838"
id="circle274-5"
- style="stroke-width:5.30069;stroke-miterlimit:10" />
+ style="stroke-width:5.29889764;stroke-miterlimit:10;stroke-dasharray:none" />
+
diff --git a/_chapters/03_monoid/groups_product_four.svg b/_chapters/03_monoid/groups_product_four.svg
new file mode 100644
index 0000000..b8fd2de
--- /dev/null
+++ b/_chapters/03_monoid/groups_product_four.svg
@@ -0,0 +1,542 @@
+
+
diff --git a/_chapters/03_monoid/groups_product_four.svg.2021_01_02_19_36_26.0.svg b/_chapters/03_monoid/groups_product_four.svg.2021_01_02_19_36_26.0.svg
new file mode 100644
index 0000000..b87c10a
--- /dev/null
+++ b/_chapters/03_monoid/groups_product_four.svg.2021_01_02_19_36_26.0.svg
@@ -0,0 +1,523 @@
+
+
diff --git a/_chapters/03_monoid/klein_four.svg b/_chapters/03_monoid/klein_four.svg
new file mode 100644
index 0000000..723aead
--- /dev/null
+++ b/_chapters/03_monoid/klein_four.svg
@@ -0,0 +1,449 @@
+
+
diff --git a/_chapters/03_monoid/klein_four_as_product.svg b/_chapters/03_monoid/klein_four_as_product.svg
new file mode 100644
index 0000000..4f4352a
--- /dev/null
+++ b/_chapters/03_monoid/klein_four_as_product.svg
@@ -0,0 +1,614 @@
+
+
diff --git a/_chapters/03_monoid/numbers_cyclic.svg b/_chapters/03_monoid/numbers_cyclic.svg
new file mode 100644
index 0000000..624b1c8
--- /dev/null
+++ b/_chapters/03_monoid/numbers_cyclic.svg
@@ -0,0 +1,502 @@
+
+
diff --git a/_chapters/03_monoid/numbers_modular.svg b/_chapters/03_monoid/numbers_modular.svg
new file mode 100644
index 0000000..64ca52f
--- /dev/null
+++ b/_chapters/03_monoid/numbers_modular.svg
@@ -0,0 +1,225 @@
+
+
diff --git a/_chapters/03_monoid/reflection.svg b/_chapters/03_monoid/reflection.svg
new file mode 100644
index 0000000..89e6848
--- /dev/null
+++ b/_chapters/03_monoid/reflection.svg
@@ -0,0 +1,272 @@
+
+
diff --git a/_chapters/03_monoid/smallest_group.svg b/_chapters/03_monoid/smallest_group.svg
new file mode 100644
index 0000000..0ea4fbd
--- /dev/null
+++ b/_chapters/03_monoid/smallest_group.svg
@@ -0,0 +1,170 @@
+
+
diff --git a/_chapters/03_monoid/symmetry_group.svg b/_chapters/03_monoid/symmetry_group.svg
new file mode 100644
index 0000000..54f8d75
--- /dev/null
+++ b/_chapters/03_monoid/symmetry_group.svg
@@ -0,0 +1,77 @@
+
+
diff --git a/_chapters/03_monoid/symmetry_modular.svg b/_chapters/03_monoid/symmetry_modular.svg
new file mode 100644
index 0000000..14920cb
--- /dev/null
+++ b/_chapters/03_monoid/symmetry_modular.svg
@@ -0,0 +1,430 @@
+
+
diff --git a/_chapters/03_monoid/symmetry_reflection.svg b/_chapters/03_monoid/symmetry_reflection.svg
new file mode 100644
index 0000000..4feccf1
--- /dev/null
+++ b/_chapters/03_monoid/symmetry_reflection.svg
@@ -0,0 +1,849 @@
+
+
diff --git a/_chapters/03_monoid/symmetry_rotation.svg b/_chapters/03_monoid/symmetry_rotation.svg
new file mode 100644
index 0000000..568fb1d
--- /dev/null
+++ b/_chapters/03_monoid/symmetry_rotation.svg
@@ -0,0 +1,151 @@
+
+
diff --git a/_chapters/03_monoid/symmetry_rotation_actions.svg b/_chapters/03_monoid/symmetry_rotation_actions.svg
new file mode 100644
index 0000000..a2e4e1b
--- /dev/null
+++ b/_chapters/03_monoid/symmetry_rotation_actions.svg
@@ -0,0 +1,420 @@
+
+
diff --git a/_chapters/03_monoid/symmetry_rotation_category.svg b/_chapters/03_monoid/symmetry_rotation_category.svg
new file mode 100644
index 0000000..313ac29
--- /dev/null
+++ b/_chapters/03_monoid/symmetry_rotation_category.svg
@@ -0,0 +1,180 @@
+
+
diff --git a/_chapters/03_monoid/symmetry_rotation_cyclic.svg b/_chapters/03_monoid/symmetry_rotation_cyclic.svg
new file mode 100644
index 0000000..8f30617
--- /dev/null
+++ b/_chapters/03_monoid/symmetry_rotation_cyclic.svg
@@ -0,0 +1,1135 @@
+
+
diff --git a/_chapters/03_monoid/symmetry_rotation_external.svg b/_chapters/03_monoid/symmetry_rotation_external.svg
new file mode 100644
index 0000000..2349409
--- /dev/null
+++ b/_chapters/03_monoid/symmetry_rotation_external.svg
@@ -0,0 +1,159 @@
+
+
diff --git a/_chapters/03_monoid/symmetry_rotation_functions.svg b/_chapters/03_monoid/symmetry_rotation_functions.svg
new file mode 100644
index 0000000..72d6a04
--- /dev/null
+++ b/_chapters/03_monoid/symmetry_rotation_functions.svg
@@ -0,0 +1,938 @@
+
+
diff --git a/_chapters/03_monoid/symmetry_rotation_group.svg b/_chapters/03_monoid/symmetry_rotation_group.svg
new file mode 100644
index 0000000..19835d3
--- /dev/null
+++ b/_chapters/03_monoid/symmetry_rotation_group.svg
@@ -0,0 +1,267 @@
+
+
diff --git a/_chapters/03_monoid/symmetry_rotation_set.svg b/_chapters/03_monoid/symmetry_rotation_set.svg
new file mode 100644
index 0000000..3991586
--- /dev/null
+++ b/_chapters/03_monoid/symmetry_rotation_set.svg
@@ -0,0 +1,596 @@
+
+
diff --git a/_chapters/03_monoid/symmetry_rotation_square.svg b/_chapters/03_monoid/symmetry_rotation_square.svg
new file mode 100644
index 0000000..f7ab162
--- /dev/null
+++ b/_chapters/03_monoid/symmetry_rotation_square.svg
@@ -0,0 +1,1173 @@
+
+
diff --git a/_chapters/03_monoid/trivial_group.svg b/_chapters/03_monoid/trivial_group.svg
new file mode 100644
index 0000000..3045154
--- /dev/null
+++ b/_chapters/03_monoid/trivial_group.svg
@@ -0,0 +1,82 @@
+
+
diff --git a/_layouts/default.html b/_layouts/default.html
index ea6dd9a..6b12542 100644
--- a/_layouts/default.html
+++ b/_layouts/default.html
@@ -39,6 +39,21 @@
-->
+