-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
{"dg-publish":true,"permalink":"/category/category/","noteIcon":"","created":"2024-07-27T13:37:26.045+08:00","updated":"2024-07-27T14:11:21.991+08:00"} | ||
--- | ||
|
||
#Catagory | ||
- A **category** consists of objects and arrows (morphisms). Arrows can be composed, and the composition is associative. Every object has an identity arrow that serves as a unit under composition. | ||
- Category theory is extreme in the sense that it actively discourages us from looking inside the objects. An object in category theory is an abstract nebulous entity. | ||
- Category theory is about composing arrows. But not any two arrows can be composed. The target object of one arrow must be the same as the source object of the next arrow. | ||
|
||
|
||
- [Category Wikipedia](https://en.wikipedia.org/wiki/Category_(mathematics) "Category (mathematics)") | ||
- [CPSC 617: Category Theory for Computer Science](http://pages.cpsc.ucalgary.ca/~robin/class/617/webnotes.html) | ||
- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
{"dg-publish":true,"permalink":"/category/composition/","noteIcon":"","created":"2024-07-27T13:21:47.175+08:00","updated":"2024-07-27T13:25:43.249+08:00"} | ||
--- | ||
|
||
#Catagory | ||
There are two extremely important properties that the composition in any category must satisfy. | ||
1. Composition is associative | ||
```haskell | ||
f :: A -> B | ||
g :: B -> C | ||
h :: C -> D | ||
h . (g . f) == (h . g) . f == h . g . f | ||
``` | ||
2. For every object $A$ there is an arrow which is a unit of composition. This arrow loops from the object to itself. | ||
```ocaml | ||
let id x = x | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
{"dg-publish":true,"permalink":"/category/monoid/","noteIcon":"","created":"2024-07-27T17:24:41.011+08:00","updated":"2024-07-27T17:27:13.257+08:00"} | ||
--- | ||
|
||
#Catagory | ||
In abstract algebra, a branch of mathematics, a monoid is **a set equipped with an associative binary operation and an identity element**. | ||
|
||
A monoid is a single object category. In fact the name monoid comes from Greek *mono*, which means single. | ||
|
||
Every monoid can be described as a single object category with a set of morphisms that follow appropriate rules of composition. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
{"dg-publish":true,"permalink":"/category/morphisms/","noteIcon":"","created":"2024-07-27T13:10:52.265+08:00","updated":"2024-07-27T13:37:29.144+08:00"} | ||
--- | ||
|
||
#Catagory | ||
Morphisms and [objects](https://en.wikipedia.org/wiki/Object_(category_theory) "Object (category theory)") are constituents of a [[Category/Category\|Category]]. Morphisms, also called _maps_ or _arrows_, relate two objects called the _source_ and the _target_ of the morphism. | ||
|
||
A morphism is a map between two objects in an abstract [category](https://mathworld.wolfram.com/Category.html). | ||
1. A general morphism is called a [homomorphism](https://mathworld.wolfram.com/Homomorphism.html) | ||
2. A morphism ![f:Y->X|100](https://mathworld.wolfram.com/images/equations/Morphism/Inline1.svg) in a [category](https://mathworld.wolfram.com/Category.html) is a [monomorphism](https://mathworld.wolfram.com/Monomorphism.html) if, for any two morphisms ![u,v:Z->Y|100](https://mathworld.wolfram.com/images/equations/Morphism/Inline2.svg), ![fu=fv|100](https://mathworld.wolfram.com/images/equations/Morphism/Inline3.svg) implies that ![u=v|50](https://mathworld.wolfram.com/images/equations/Morphism/Inline4.svg) | ||
3. A morphism ![f:Y->X|100](https://mathworld.wolfram.com/images/equations/Morphism/Inline5.svg) in a [category](https://mathworld.wolfram.com/Category.html) is an [epimorphism](https://mathworld.wolfram.com/Epimorphism.html) if, for any two morphisms ![u,v:X->Z|100](https://mathworld.wolfram.com/images/equations/Morphism/Inline6.svg), ![uf=vf|100](https://mathworld.wolfram.com/images/equations/Morphism/Inline7.svg) implies ![u=v|50](https://mathworld.wolfram.com/images/equations/Morphism/Inline8.svg) | ||
4. A bijective morphism is called an [isomorphism](https://mathworld.wolfram.com/Isomorphism.html) (if there is an isomorphism between two objects, then we say they are isomorphic), | ||
5. A surjective morphism from an object to itself is called an [endomorphism](https://mathworld.wolfram.com/Endomorphism.html), and | ||
6. An [isomorphism](https://mathworld.wolfram.com/Isomorphism.html) between an object and itself is called an [automorphism](https://mathworld.wolfram.com/Automorphism.html). |
10 changes: 10 additions & 0 deletions
10
src/site/notes/Category/Operational and Denotational Semantics.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
{"dg-publish":true,"permalink":"/category/operational-and-denotational-semantics/","noteIcon":"","created":"2024-07-27T14:33:58.783+08:00","updated":"2024-07-27T14:37:38.701+08:00"} | ||
--- | ||
|
||
#Catagory #Semantics | ||
There are formal tools for describing the semantics of a language but, because of their complexity, they are mostly used with simplified academic languages, not real-life programming behemoths. | ||
|
||
If we give the semantics of a language in terms of a mathematical model we speak of *mathematical or denotational semantics*. If the semantics is in terms of a (virtual) computing machine, we speak of *operational semantics*. Both are two different and important ways of explicating the meaning of a programming language. | ||
|
||
- [Operational and Denotational Semantics](https://hackmd.io/@alexhkurz/Hkf6BTL6P#Introduction-to-Semantics) |