# Lecture 8:

Teacher: Paul-André Melliès


### Church encoding of trees

Encoded in $λ$-calculus as

a: o × o → o \qquad b: o → o \qquad c: o

So that the following is the expected tree: $a(c,a(b(c,a(⋯))))$

NB: with $S: o → o$ and $0: o$: Church numerals

A ⟼ D_A: \text{ domain of cliques}

$!A$ is the coherence space of finite cliques with

u \sim_{!A} v ⟺ u ↑ v \text{ in } D_A \\ ⟺ ∃ w ∈ D_A; \quad u, v ⊆ w

(i.e. the union is still a clique)

## Comonoids

### Monoids

u ∈ A\\ \lbrace \star \rbrace = 1 \overset{u}{⟶} A\\ A^0 \overset{u}{⟶} A\\ A^2 \overset{m}{⟶} A

And coherence diagrams: associativity square, unit law triangles.

### Comonoids

A monoid in the opposite category (which is still monoidal).

1 \overset{e}{⟵} A \overset{d}{⟶} A ⊗ A

And the dual coherence diagrams.

Commutative comonoid:

when $A \overset{d}{⟶} A ⊗ A \overset{γ_{A,A}}{⟶} A⊗ A = A \overset{d}{⟶} A ⊗ A$

(cf. picture)

Claim: every object of the form $!A$ is a comonoid.

!A \overset{d_A}{⟶} !A ⊗ !A

$d_A$ clique of

!A ⊸ (!A ⊗ !A)
d_A = \lbrace u ⊸ (v ⊗ w) \; \mid \; u,v,w ∈ \vert !A \vert \text{ such that } u = v ∪ w\rbrace

NB: Seen from the output to the input, $d_A$ is a partial function which maps coherent pairs of finite cliques $(v,w)$ to their union $u = (v,w)$ (recall that two cliques are coherent when their union is a finite clique).

Let’s show that it is a clique: suppose that $u ⊸ (v ⊗ w), u’ ⊸ (v’ ⊗ w’) ∈ d_A$.

If $u \sim_A u’$, then $u ∪ u’$ is a finite clique which contains $v,v’,w,w’$. Hence $v ∪ v’$ and $w ∪ w’$ are finite cliques.

Suppose that $v ⊗ w = v’ ⊗ w’$. Then $u = v ∪ w = v’ ∪ w’ = u’$, hence $u \sim_{(!A)^⊥} u’$.

cf. picture

NB: Stability has to do with causality

Similarly, we have a weakening map/co-unit:

!A \overset{e_A}{⟶} 1
\begin{xy} \xymatrix{ !A \ar[r]^{d_A} \ar[d]_{ d_A } & !A \ar[d]^{ d_A ⊗ !A } \\ !A \ar[r]_{!A ⊗ d_A} & !A } \end{xy}

In LL, $⊗$ is a conjunction but we do not have

A ⟶ A ⊗ A

in general.

So we pick a class of formulas $!A$ equipped with a diagonal map $!A \overset{d_A}{⟶} !A ⊗ !A$.

a comonoid in the category of endofunctors

Kleisli category:

same objects, but morphisms from $A$ to $B$ are morphisms from $TA$ to $B$ in the original category.

What’s the intuition?

A stable function $f: D_A ⟶ D_B$ is the same thing as a clique of $!A ⊸ B$ (defined as $\Tr f$), hence the same thing as a morphism $f: \; !A ⟶ B$ in the category $Coh$ (vs: linear functions ⟺ maps $A ⟶ B$ in $Coh$)

For example,

ε_A ≝ \lbrace \lbrace a \rbrace ⊸ a \; \mid \; a ∈ \vert A \vert\rbrace\, : \; !A ⟶ A
!(A \& B) \; ≃ \; !A ⊗ !B

The Kleisli category $(Coh_!, \&, ⊤)$ is cartesian closed.

Tags:

Updated: