/unplugged

Open book about math and programming.

Primary LanguageTeX

Isomorphism -- Mathematics of Programming

2023/10

This book introduces the mathematics behind computer programming.

Contents

The book can be downloaded in English (EN). The 1st edition in Chinese (中文) was published in 2023 (中文样章).

  • Preface
  • Chapter 1, Natural numbers. Peano Axiom, list and folding;
  • Chapter 2, Recursion. Euclidean algorithm, Lambda calculus, and Y-combinator;
  • Chapter 3, Symmetry. Group, Ring, and Field. Galois Theory;
  • Chapter 4, Category theory and type system;
  • Chapter 5, Deforest. Build-fold fusion law, optimization, and algorithm deduction;
  • Chapter 6, Infinity. Set theory, Infinity and stream;
  • Chapter 7, Logic paradox, Gödel's incompleteness theorems, and Turing halting problem.
  • Answers to the exercise.

Install

You need TeXLive to build the book in PDF format. We use LuaLaTeX, an extended version of TeX.

Install TeXLive

In Debian/Ubuntu like Linux environment, do NOT install the TeXLive through apt-get. Go to TeXLive official site to download the setup script.

$ wget http://mirror.ctan.org/systems/texlive/tlnet/install-tl.zip
$ unzip install-tl.zip
$ cd install-tl
$ sudo ./install-tl -gui text -repository http://mirror.ctan.org/systems/texlive/tlnet

In Windows, TeXLive provides a gui based installer, in Mac OS X, there's a MacTeX.

Customize font

The default build supports Linux, Mac OS X, and Windows. You can install additional font (like Noto CJK) typesetting (see prelude.sty). Some system fonts, e.g. STKaiti, were moved to /System/Library/AssetsV2/com_apple_MobileAsset_Font7 in Mac OS X from 2022, you need add the path to the local TeXLive configuration:

sudo tlmgr conf texmf OSFONTDIR /System/Library/AssetsV2/com_apple_MobileAsset_Font7

Others

You need the GNU make tool, in Debian/Ubuntu like Linux, it can be installed through the apt-get command:

$ sudo apt-get install build-essential

In Windows, you can use WSL or install MSYS. In Mac OS X, please install the developer tool from this command line:

$ xcode-select --install

Build the PDF book

enter the folder contains the book TeX manuscript, run

$ make

This will generate the pdf files (Run make en to only build the English version; run make force-en to force build the book).

--

LIU Xinyu