Skip to content

Latest commit

 

History

History
200 lines (136 loc) · 7.67 KB

summary.org

File metadata and controls

200 lines (136 loc) · 7.67 KB

My Takeaways

Computational Trinitarianism

How programming is mathematics, and perhaps more importantly; how mathematics is programming. Don’t take my word for it, see: Robert Harper.

Science offers the boldest metaphysics of the age. It is a thoroughly human construct, driven by the faith that if we dream, press to discover, explain, and dream again, thereby plunging repeatedly into new terrain, the world will somehow come clearer and we will grasp the true strangeness of the universe. And the strangeness will all prove to be connected, and make sense. – E. O. Wilson (1929-2021)

Everything I’ve seen so far and how it all makes sense.

Effects and arrows

It all started with a look at the representation of computational effects in Haskell this led to the modelling of partial functions f : A ⇀ B and thus to the Kleisli arrow f : A → T(B) for some monad T and thence to the understanding of monad as the thing that enables composition of Kleisli arrows.

See: A more formal view of Kleisli category

Free structure

Is a way of making one mathematical object look like another, subject to a minimalistic principle that the “dressing” required to make the embedding work are such that the laws governing the desired structure are only those that are required by that structure and the “dressing” be as simple as possible (no baggage or superflous decoration). Nice.

A more formal defintion of this is to be found in the fundamental ideas of homomorphism and initial and terminal objects of Category theory.

See: Notes on category theory

Group-like structures

This is the zoo of algebraic structures we may encounter, or whose properties/laws we may wish to leverage; with varying burdens of proof.

StructureTotality[1]AssociativityIdentityInverseCommutativity
Semigroupoid
Small category
Groupoid
Magma
Quasigroup
Unital magma
Semigroup
Loop
Monoid
Group
Commutative monoid
Abelian group

[1] Totality here is equivalent to the closure axiom.

A powerful technique of mathematics and programming is that of re-use; If we can show that our structure or object conforms to a well understood abstractions as above, we can inherit the relevant theorems and proofs with impunity. We may even get free as in beer along with free as in freedom!

Monads categorically via. Kleisli compostion

See: Taming of effects in Haskell

Also see this presentation of the categorical perspective and a good way to think about monads:

Monads made difficult - Stephen Diehl

Monoidal category

Also known as a tensor category for reasons that will be apparent.

See: Intro to the categorical approach

A monoid in a monoidal category has:

objectM
unite : I -> M
multiplicationm : M ⊗ M -> M

such that:

m ∘ (id_M ⊗ e) = u_l m ∘ (e ⊗ id_M) = u_r m ∘ (id_M ⊗ m) = m ∘ (m ⊗ id_M) ∘ α

Where:

u_l : M ⊗ I -> M and u_r : I ⊗ M -> M

are the identity isomorphisms for the monoidal category, and

α : M ⊗ (M ⊗ M) -> (M ⊗ M) ⊗ M

is part of the associativity isomorphism of the category.

So, hopefully the connection is clear: we’ve generalized the carrier set to a carrier object, generalized the operations to morphisms in a category, and equational laws are promoted to being equations about composition of morphisms. – See: Haksell Wiki on Free Structure

Monads as monoids

A monad can be cast as a class of monoid objects. Given a category $\mathcal{C}$ we invoke the monoidial category $\mathcal{C^C}$ as above.

objects are endofunctorsF : C -> C
morphismsnatural transformations betwen functors
tensor product is compositionF ⊗ G = F ∘ G
identity is the identity functorI

Via specialisation to a monad we have:

an endofunctorM : C -> C
natural transformationη : I -> M
natural transformationμ : M ∘ M -> M

So monad is a monoid in the category of endofunctors.

See also: The categorical perspective

The Free monad

There are two aspects to this construction:

  1. The ability to compose effectful computations via Kleisli arrows and monadic actions.

    See: Modelling effects

  2. To encode a program as a tree of computational actions restricted in effect by stronly typed co-products.

    See: Data Types a la Carte

WIP Algebraic Theories

WIP Non-monadic effects

Some stuff on arrows/applicatives hidden in here

WIP Domain specfic languages

Some eDSL stuff hideen in here

WIP Trinitarianism

./trinity.png

References

Homotopy Type Theory

Proposed as a new foundations for mathematics. Homotopy Type Theory (HoTT) represents the primary trinitarian research direction; seeking to unify ideas from Intuitionistic (Per-Martin Löf) type theory, algebraic topology and higher categories.

A : Type

Proof theoreticallyA is a proposition
Type theoreticallyA is a construction or program
Geometrically or categoricallyA is a space

Agda and Dependent Type Theory

I have been learning Agda and there’s a whole bunch of (Per-Martin Löf) type theory and intuitionistic logic to report on. Watch this space.