Artin gluing is a fundamental construction in locale theory and topos theory. The original example is the way in which a topological space or locale $X$ may be glued together from an open subspace $i \colon U \hookrightarrow X$ and its closed complement $j \colon K \hookrightarrow X$. The analogous construction for toposes gives the sheaf topos $Sh(X)$ via a gluing together of $Sh(U)$ and $Sh(K)$, and applies more generally to give a sense of how to put two toposes together so that one becomes an open subtopos and the other a closed subtopos of the gluing.
Let us consider first the case of topological spaces. Let $X$ be a topological space, $i \colon U \hookrightarrow X$ an open subspace, and $j \colon K \hookrightarrow X$ the complementary closed subspace. Let $O(X)$ denote the topology of $X$. There is an injective map
that is a map of frames. The general problem is to characterize the image of this map: in terms of structure pertaining to $O(U)$ and $O(K)$, which pairs $(W, W')$ of relatively open sets in $U$ and $K$ “glue together” to form an open set $W \cup W'$ in $X$?
Let $int_X: P(X) \to P(X)$ denote the interior operation, assigning to a subset of $X$ its interior; this is a left exact comonad on $P(X)$. (Indeed, topologies on the set $X$ are in natural bijection with left exact comonads on $P(X)$.) Our problem is to understand when the inclusion
obtains. Since $W \in O(U)$ is already open when considered as a subset of $X$, this condition boils down to the condition that
A necessary and sufficient condition for (1) is that the inclusion $W' \hookrightarrow int_X(W \cup K)$ obtains.
The necessity is clear since $W' \subseteq K$. The sufficiency is equivalent to having an inclusion
Since $W'$ is relatively open in the subspace $K$, we may write $W' = K \cap V$ for some $V \in O(X)$, and so we must check that there is an inclusion
or in other words, using distributivity and the fact that $int_X$ preserves intersections, an inclusion
But this is clear, since we have
and
where to derive the last equation, we use the fact that $W \in O(U)$ and $V$ are open in $X$.
The operation
is the right adjoint $i_\ast$ to $i^\ast: O(X) \to O(U)$.
This is well-known. Indeed, for $V \in O(X)$ we have
but the last condition is equivalent to having $U \cap V \subseteq W$ in $P(X)$, or to $i^\ast(V) = U \cap V \subseteq W$ in $O(X)$.
Summarizing, the gluing condition (1) above (for $W' \in O(K)$, $W \in O(U)$) translates into saying that there is an inclusion
where $i^\ast, j^\ast$ are restriction maps and $i^\ast \dashv i_\ast$. For future reference, observe that the operator $j^\ast i_\ast: O(U) \to O(K)$ is left exact.
We can turn all this around. Suppose $U$ and $K$ are topological spaces, and suppose $f: O(U) \to O(K)$ is left exact. Then we can manufacture a space $X$ which contains $U$ as an open subspace and $K$ as its closed complement, and (letting $i$, $j$ being the inclusions as above) such that $f = j^\ast i_\ast$. The open sets of $X$ may be identified with pairs $(W, W') \in O(U) \times O(K)$ such that $W' \subseteq f(W)$; here we are thinking of $(W, W')$ as a stand-in for $W \cup W'$. In particular, open sets $W$ of $U$ give open sets $(W, \emptyset)$ of $X$, while open sets $W'$ of $K$ also give open sets $U \cup W'$ of $X$.
The development given above generalizes readily to the context of locales. Thus, let $X$ be a locale, with corresponding frame denoted by $O(X)$. Each element $U \in O(X)$ gives rise to two distinct frames:
The frame whose elements are algebras (fixed points) of the left exact idempotent monad $U \vee - \colon O(X) \to O(X)$. The corresponding locale is the closed sublocale $\neg U$ (more exactly, the frame surjection $O(X) \to Alg(U \vee -)$ is identified with a sublocale $\neg U \to X$).
The frame whose elements are algebras of the left exact idempotent monad $U \Rightarrow - \colon O(X) \to O(X)$. (NB: for topological spaces, this is $U \Rightarrow V = int_X(V \cup \neg U)$. This is isomorphic as a frame (but not as a subset of $O(X)$) to the principal ideal of $O(X)$ generated by $U$, which is more obviously the topology of $U$.) The sublocale corresponding to the frame surjection $O(X) \to Alg(U \Rightarrow -)$ is the open sublocale corresponding to $U$.
Put $K = \neg U$, and let $i^\ast: O(X) \to O(U)$, $j^\ast: O(X) \to O(K)$ be the frame maps corresponding to the open and closed sublocales attached to $U$, with right adjoints $i_\ast$, $j_\ast$. Again we have a left exact functor
Observe that this gives rise to a left exact comonad
whose coalgebras are pairs $(W, W')$ such that $W' \leq f(W)$. The coalgebra category forms a frame.
The frame map $\langle i^\ast, j^\ast \rangle \colon O(X) \to O(U) \times O(K)$ is identified with the comonadic functor attached to the comonad (2). In particular, $O(X)$ can be recovered from $O(U)$, $O(K)$, and the comonad (2).
Since $O(U + K) \cong O(U) \times O(K)$, we can think of the frame map $\langle i^\ast, j^\ast \rangle$ as giving a localic surjection $U + K \to X$.
Again, we can turn all this around and say that given any two locales $U$, $K$ and a left exact functor
we can manufacture a locale $X$ whose frame $O(X)$ is the category of coalgebras for the comonad
so that $U$ is naturally identified with an open sublocale of $X$, $K$ with the corresponding closed sublocale, and with a localic surjection $U + K \to X$. This is the (Artin) gluing construction for $f$.
Now suppose given toposes $E$, $E'$ and a left exact functor $\Phi \colon E \to E'$. There is an induced left exact comonad
whose category of coalgebras is again (by a basic theorem of topos theory; see for instance here) a topos, called the Artin gluing construction for $\Phi$, denoted $\mathbf{Gl}(\Phi)$.
Objects of $\mathbf{Gl}(\Phi)$ are triples $(e, e', f \colon e' \to \Phi(e))$. A morphism from $(e_0, e_0^', f_0)$ to $(e_1, e_1^', f_1)$ consists of a pair of maps $g \colon e_0 \to e_1$, $g': e_0^' \to e_1^'$ which respects the maps $f_0, f_1$ (in the sense of an evident commutative square). In other words, the Artin gluing is just the comma category $E' \downarrow \Phi$.
On the other hand, if $E$ is a topos and $U\in E$ is a subterminal object, then it generates two subtoposes that are complements in the lattice of subtoposes, namely, an open subtopos whose reflector is $(-)^U$, and a closed subtopos whose reflector is the pushout $A\mapsto A +_{A\times U} U$. If $E=Sh(X)$ is the topos of sheaves on a locale, then $U$ corresponds to an element of $O(X)$, hence an open sublocale with complement $K$ (say), and the open subtopos can be identified with $Sh(U)$ and the closed one with $Sh(K)$.
Returning to the general case, let us denote the geometric embedding of the open subtopos by $i\colon E_U \hookrightarrow E$ and that of the closed subtopos by $j\colon E_{\neg U}\hookrightarrow E$. Then we have a composite functor, sometimes called the fringe functor,
which is left exact.
Let $U$ be a subterminal object of a topos $E$, as above. Then the left exact left adjoint
is canonically identified with the comonadic gluing construction $\mathbf{Gl}(j^\ast i_\ast) \to E_U \times E_{\neg U}$. In particular, $E$ can be recovered from $E_U$, $E_{\neg U}$, and the functor $j^* i_*$.
For a proof, see A4.5.6 in the Elephant.
Once again, the import of this theorem may be turned around. If $f \colon E \to F$ is any left exact functor, then the projection
is easily identified with a logical functor $\mathbf{Gl}(f) \to \mathbf{Gl}(f)/X$ where $X$ is the subterminal object $(1, 0, 0 \to f(1))$. This realizes $E$ as an open subtopos of $\mathbf{Gl}(f)$. On the other hand, for the same subterminal object $X \hookrightarrow 1$, the corresponding classifying map
induces a Lawvere-Tierney topology $j$ given by
Then, the category of sheaves $Sh(j)$, or more exactly the left exact left adjoint $\mathbf{Gl}(f) \to Sh(j)$ to the category of sheaves, is naturally identified with the projection
thus realizing $F$ as equivalent to the closed subtopos (Elephant, A.4.5, pp. 205-206) attached to the subterminal object $X$.
The sheaves in $\mathbf{Gl}(f)$ corresponding to the open resp. closed subtoposes can be described explicitly. Recall that the objects of $\mathbf{Gl}(f)$ have the form $(X, Y, u:Y\to f(X))$: then the open copy of $E$ corresponds to the subcategory on those objects $(X, Y, u:Y\to f(X))$ with $u$ an isomorphism in $F$ and the closed copy of $F$ to the subcategory with objects $(X, Y, u:Y\to f(X))$ such that $X\simeq 1$ in $E$.
The open subtopos corresponding to $E$ is dense in $\mathbf{Gl}(f)$ precisely if $f:E\to F$ preserves the initial object since $(0,0,0\to f(0))$ is the initial object in $\mathbf{Gl}(f)$ and $0\to f(0)$ is an isomorphism precisely if $f$ preserves $0$.
To summarize: given a left exact $f:E\to F$ we get a closed inclusion of $F$ into $\mathbf{Gl}(f)$ with
and an open inclusion of $E$ with a further left adjoint:
Since $i:\ast\hookrightarrow E$ is left exact where $\ast$ is the degenerate topos with one identity morphism, every topos $E$ is trivially a result of Artin gluing: $E\simeq E\downarrow i$.
Of course, more interesting examples of the gluing construction abound as well. Here are a few:
Let $E$ be an (elementary, not necessarily Grothendieck) topos, and let $\hom(1, -): E \to Set$ represent the terminal object $1$ – this of course is left exact. The gluing construction $\mathbf{Gl}(\hom(1, -))$ is called the scone (Sierpinski cone), or the Freyd cover, of $E$.
If $E$ is a Grothendieck topos and $\Delta \colon Set \to E$ is the (essentially unique) left exact left adjoint, then we have a gluing construction $E \downarrow \Delta$. This gluing may be regarded as the result of attaching a generic open point to $E$.
A concrete instance of the constructions in both the preceding examples is the Sierpinski topos $Set^{\to}$ corresponding e.g. to $Set\downarrow id_{Set}$: its objects are functions $X\to Y$ between sets $X,Y$ and the closed copy of $Set$ sits on the objects of the form $X\to 1$ and the open copy on the objects $X\overset{\simeq}{\to}Y$.
Artin gluing for toposes carries over in some slight extra generality, replacing left exact functors $f$ by pullback-preserving functors.
Artin gluing applies also to other doctrines: regular categories, pretoposes, quasitoposes, etc. See (Carboni-Johnstone) and (Johnstone-Lack-Sobocinski).
M. Artin, A. Grothendieck, J. L. Verdier, Théorie des Topos et Cohomologie Etale des Schémas (SGA4), LNM 269 Springer Heidelberg 1972. (exposé IV, sect. 9; in particular: sect. 9.5)
Gavin Wraith, Artin Glueing , JPAA 4 (1974) pp.345-358.
Aurelio Carboni, Peter Johnstone, Connected limits, familial representability and Artin glueing , Mathematical Structures in Computer Science 5 (1995) pp.441-459. (pdf)
Aurelio Carboni, Peter Johnstone, Corrigenda to ‘Connected limits…’ , Mathematical Structures in Computer Science 14 (2004) pp.185-187.
Peter Johnstone, Topos Theory , Academic Press New York 1977 (Dover reprint 2014). (section 4.2, pp.107-112)
Peter Johnstone, Sketches of an Elephant , Oxford UP 2002. (sec. A2.1.12, pp.82-84; A4.5.6, p.208)
Peter Johnstone, Steve Lack, Pawel Sobocinski, Quasitoposes, Quasiadhesive Categories and Artin Glueing , pp.312-326 in LNCS 4624 Springer Heidelberg 2007. (preprint)
M. Jibladze, Lower Bagdomain as a Glueing , Proc. A. Razmadze Math. Inst. 118 (1998) pp.33-41. (pdf)
A. Kock, T. Plewe, Glueing analysis for complemented subtoposes , TAC 2 (1996) pp.100-112. (pdf)
J. C. Mitchell, A. Scedrov, Notes on sconing and relators , Springer LNCS 702 (1993) pp.352-378. (ps-draft)