Agda code for Lecture IV.