Since adjoint functors are the deepest concept in the course so far, I'll need to keep explaining them before they sink in. There are a lot of technical issues we need to discuss, but you may want to study examples first. We started looking at some examples [last time](https://forum.azimuthproject.org/discussion/2264/lecture-48-chapter-3-adjoint-functors/p1). We need to see more, and think about them harder. But I can't resist getting to the punchline: the application to databases. I'm hoping that seeing the big picture will help you understand how all the pieces fit together. In [Lecture 41](https://forum.azimuthproject.org/discussion/2230/lecture-41-chapter-3-composing-functors/p1) we saw a trick for getting new databases from old. Remember, a **database schema** is just a category \$$\mathcal{C}\$$. A **database built using this schema** is a functor $F : \mathcal{C} \to \mathbf{Set} .$ If we also have a functor \$$G: \mathcal{D} \to \mathcal{C}\$$, we can take \$$F\$$ and compose it with \$$G\$$ to get a functor $F \circ G : \mathcal{D} \to \mathbf{Set} .$ But this is just a database built using the schema \$$\mathcal{D}\$$! So that's a pretty obvious trick for turning databases built using the schema \$$\mathcal{C}\$$ into databases built using the schema \$$\mathcal{D}\$$. But often we want to reverse this procedure, and turn databases built using \$$\mathcal{D}\$$ into databases built using \$$\mathcal{C}\$$. There turn out to be two ways to reverse this procedure: one using a left adjoint, and one using a right adjoint. Remember, the point of adjoints is to reverse computations Let me sketch the idea, which is really slick. There's actually a _category_ whose objects are databases built using the schema \$$\mathcal{C}\$$, or in other words, functors \$$F : \mathcal{C} \to \mathbf{Set} \$$. It's the functor category $\mathbf{Set}^{\mathcal{C}} .$ This is why I introduced functor categories in [Lecture 45](https://forum.azimuthproject.org/discussion/2249/lecture-45-chapter-3-composing-natural-transformations/p1)! Similarly, there's a functor category $\mathbf{Set}^{\mathcal{D}}$ whose objects are databases built using the schema \$$\mathcal{D}\$$. But we've just seen that composing with \$$G: \mathcal{D} \to \mathcal{C}\$$ takes functors \$$F : \mathcal{C} \to \mathbf{Set} \$$ and gives functors \$$F \circ G : \mathcal{D} \to \mathbf{Set} \$$. In fact - this takes some work to check - this gives a functor $\textrm{composing with } G : \mathbf{Set}^{\mathcal{C}} \to \mathbf{Set}^{\mathcal{D}} .$ And here's the cool part: _this functor always has both a left adjoint and a right adjoint!_ These are ways to turn databases built using \$$\mathcal{D}\$$ into databases built using \$$\mathcal{C}\$$. These adjoints, by the way, are called **[Kan extensions](https://en.wikipedia.org/wiki/Kan_extension)**. The left adjoint is called the **left Kan extension along \$$G\$$**, and it's denoted $\mathrm{Lan}(G) : \mathbf{Set}^{\mathcal{D}} \to \mathbf{Set}^{\mathcal{C}}$ where 'Lan' is a weird abbreviation of 'left Kan'. The right adjoint is called the **right Kan extension along \$$G\$$**, and it's denoted $\mathrm{Ran}(G) : \mathbf{Set}^{\mathcal{D}} \to \mathbf{Set}^{\mathcal{C}}.$ Okay, that's a lot of abstraction! Next time we need to look at some examples. In fact you've already seen some examples, [last time](https://forum.azimuthproject.org/discussion/2264/lecture-48-chapter-3-adjoint-functors/p1). You just need to see that they _are_ examples. I'll explain this next time. But just for those of you who like a challenge: **Puzzle 154.** Which of the functors in the example and puzzles from [last time](https://forum.azimuthproject.org/discussion/2264/lecture-48-chapter-3-adjoint-functors/p1) last time are of the form $\textrm{composing with } G : \mathbf{Set}^{\mathcal{C}} \to \mathbf{Set}^{\mathcal{D}} ?$ Which are left or right adjoints of functors of this form? Okay, maybe this is too ['meta'](https://en.wikipedia.org/wiki/Meta): it's a puzzle about puzzles! But if you're taking a course on category theory, maybe you like 'meta'. **[To read other lectures go here.](http://www.azimuthproject.org/azimuth/show/Applied+Category+Theory#Chapter_3)**