Lecture 1: Introduction
Introduction
PaulAndré Melliès (mellies at irif.fr)
Mathematics of programming languages ⟶ can we develop a mathematical theory of programms ? (like theortical physics for instance)
It started during the 40’s:

at the beginning: huge machines
 difference hardware/software: by degrees, software became separated from hardware to abstract
 computer VS calculator (at the beginning): a computer can compute + remember a little so as to start the next calculation with this remainder VS a calculator: just calculate without remembering anything
 +: you can control a computer, not a calculator
 in the 40’s: women were the programmers, gluing pieces of prgramming together
 in the 60’s: idea of programming langugaes with procedures ⟶ programs can call one another, compose, etc… ⟹ higherorder functionals: functions that can take functions as an input and output andother function
Ex of a functional:
a program can call a procedure
⟶ Ch. Starchey
Ex: a sequential program:
how to implement it?
 lefttoright algorithm
 righttoleft algorithm
Game semantics of the program:
NB: subscripts are meant to indicate the order of execution
in practice: the values $5$ and $7$ are put on the stack
Problem: the order of execution looks like computation, but it can be turned into a mathematical function (it’s whole point of programming languages): with continuations.
Continuations: in order to male a difference between lefttoright and righttoleft, the cartesian product $ℕ × ℕ$ ⟹ a mathematical completion of $ℕ$ can do the trick:
Let us fix a type $\bot$ (thought of as $false$)
Maybe now:
the order of execution can be thought of as a function
In constructive logic:
but
It’s the case in classical logic: there’s a long history of retrieving the computable content of classical logic.
$callcc$: invented in Lisp as a hack to recover the current continuation ⟶ so as to come back to where I was.
⟹ it implements the reasoning by contradiction
graph {
l[label="logics proofs"]; lam[label ="lambdacalculus"];
programming 
l, lam;
l  lam;
}
Back to $¬¬ℕ × ¬¬ℕ ⟶ ¬¬ℕ$:
Ex:
Dirac function: There is a relationship between the $¬¬ℕ$ and distributions on $ℕ$.
that is:

$k$: seen as a function waiting for a natural number, which is then mapped to what will come next (ex: $X$ contains of the possible configurations of the program afterwards)
 we always do that in our daily routine: we try to guess what will happen after a given action (“what will he say if I do that?”)
Similarly:
Partial evaluation: if I build an optimized interpreter, in which I plug a program, so that I get a compiled as an output.
We turned an automatatheoretic algorithm into a $λ$term. This approach can be very successfully generalized.
Another example: how to “blur” databases so that one cannot access all of personal information ⟶ monadic approach / $λ$calculusrelated
Mnemoid: a set with a 01 (hidden) register.
Category theory
 A graph:

 a set of vertices $V$
 a set of edges $E$
 two functions $source, target: E ⟶ V$ (often written $\partial_0, \partial_1$)
 A (small) category:

a graph of objects (vertices) and arrows/morphisms (edges) equipped with a composition $\circ$, and an identity arrow $1_A$ for each object $A$ such that:
 Associativity of the composition: (w \circ v) \circ u = w \circ (v \circ u)
 Identity law: u \circ id_A = id_A \circ u = u
If the sets of objects and arrows are replaced by classes: general definition.
NB: you can see the graph $A \overset{u}{⟶} B \overset{v}{⟶} C \overset{w}{⟶} D$ can be seen as a 3simplex, with the composition arrows.
Associativity canonically fills 3dimensionally between the two sides $(w \circ v) \circ u$ and $w \circ (v \circ u)$
Beautiful view: the algebra is the art of filling holes.
Examples of categories
 Preorder category: Categories where there exists at most one arrow between two objects: every preorder define such a category, and reciprocally (provided that the category is small): such small categories are posets
 preorder: a set equipped with a reflexive and transitive binary relation $≤$
 all the cycles are isomorphisms
Categories generalize the notion of order: very important, since many concepts of order theory can be lifted to category theory.
The notion of greatest lower bound is such a concept ⟶ it’s the product of objects.
Cartesian product of two sets is also a product in the category $Set$.
(cf. the “category theory” section of my L3 report internship)
 Cartesian product of $A, B : \vert 𝒞 \vert$:

it is an object $A×B$ and two (projection) maps $π_1: A × B ⟶ A, π_2: A × B ⟶ B$ such that for every object $C$ and maps $f: C ⟶ A, g: C ⟶ B$, there exists a unique map $h: C ⟶ A × B$ such that \begin{cases} π_1 \circ h = f \\ π_2 \circ h = g \end{cases}
 Categories where there exists at most one object: every preorder define such a category: it’s a poset
Leave a Comment