Category Theory III for Programmers (Part 1 & 2)

The most interesting “Category Theory” (范畴论) for Programmers course III by Dr. Bartosz Milewski , a follow-up of last year’s course II.


  1. Fundamental of Category Theory: Functor, Natural Transformation, etc. (Course II Series)
  2. (Nice to have) : Basic Haskell Functional Programming Language. (Quick Haskell Tutorial)

1.1: Overview Part 1

Category Theory (CT) = Summary of ALL Mathematics

Functional Programming = Application of CT

Philosophical Background:

  • Math originated 3,000 years ago in Geometry by Greek Euclid with Axioms and deductive (演译) Proof-driven Logic.
  • Geometry = Geo (Earth) + Metry (Measurement).
  • Math evolved from 2-dimensional Euclidean Geometry through 17 CE French Descartes’s Cartesian Geometry using the 13CE Arabic invention “Algebra” in Equations of n dimensions: (x_1, x_2,..., x_n) , (y_1, y_2,..., y_n)
  • Use of Algebra: 1) Evaluation of algebraic equations (in CT: “Functor”) ; 2) Manipulation. eg. Substitution (in CT : “Monad” ), Container (in CT: “Endo-Functor” ), Algebraic Operations (in CT: “Pure, Return, Binding” ).
  • Lawvere Theories: unified all definitions of Monoids (from Set to CT)
  • Free Monoid = “List” (in Programming). Eg. Concatenation of Lists = new List (Composition, Associative Law) ; Empty List (Unit Law).
  • Advance of Math in 21CE comes back to Geometry in new Math branches like Algebraic Geometry, Algebraic Topology, etc.

Note: The only 2 existing human Languages invented were derived from forms & shapes (images) of the mother Earth & Nature:

  1. Ancient Greek Geometry (3000 years) ;
  2. Ancient Chinese Pictogram Characters (象形汉字, 3000 years 商朝. 甲骨文 ) .

1.1: Overview Part 2

Keypoints: (just a ‘helicopter’ view of the whole course syllabus)

  • Calculus: infinite Product, infinite Sum (co-Product), End, co-End.
  • Kan-extensions
  • Geometry in “Abstract” aka Topology: “Topos”
  • Enriched Category : (2-category) Analogy : complex number makes Trigonometry easy; same does Enriched Category.
  • Groupoid => “HTT” : Homotopic Type Theory

2.1 String Diagrams (Part 1)

Composing Natural Transformations (Vertical & Horizontal): \alpha \; \beta (assumed naturality)


1. Download BM’s book “Category Theory for Programmers” :


困扰了人类358年 费马大定理 Fermat’s Last Theorem


  1. Fermat’s Last Theorem (FLT): \boxed {x^{n} +y^{n} = z^{n} \; \; \forall n >2 }
  2. Pierre de Fermat (France 1637 AD): FLT Conjecture or Prank ?
  3. Euler (n= 3)
  4. Taniyama(谷山)-Shimura(志村)-(André) Weil Conjecture (now Theorem)
    Modular Form = Elliptic Curve
  5. Galois Group Symmetry
  6. Andrew Wiles (UK Cambridge 1994):
    (Modular Form = Elliptic Curve) <=> FLT (q.e.d.)


1. Do not confuse Prof Andrew Wiles (proved FLT) with (French/American) Prof André Weil (Founder of Bourbaki School of Modern Math in POST-WW2 universities worldwide).

2. When Shimura heard that FLT was proved finally by Andrew Wiles using his Conjecture (Theorem), he was very calm, said, “I told you so”.

3. There is another “Fermat’s Little Theorem” used in computer cryptography.

4. The journey of proving FLT in 358 years by all great mathematicians worldwide had created many new math tools and Number theories (eg. “Ideals” in Ring Theory, etc).

Quora : How likely is it that a mathematics student can’t solve IMO problems?

How likely is it that a mathematics student can’t solve IMO problems?

Is there a fear of embarrassment in being a math Ph.D. who can’t solve problems that high-school students can? by Cornelius Goh