Analogy between metric space completion and algebraic closure I've noticed some similarities between the story of completing a metric space and taking algebraic closure of a field. My question is whether these two stories can be generalized.
Metric space
Fix a metric space $(X, d_X)$. Consider isometries from it to other metric spaces (i.e. the under category).


*

*Every isometry $(X, d_X) \to (Y, d_Y)$ is continuous and injective.

*Given isometry $\varphi : (X, d_X) \to (Y, d_Y)$, say the closure is the map $\overline{\varphi} : (X, d_X) \to \left(\overline{\varphi(X)}, d_Y|_{\overline{\varphi(X)}}\right)$.

*Taking closure (2) is idempotent.

*Say isometry $\varphi : (X, d_X) \to (Y, d_Y)$ is "dense" if $\varphi = \overline{\varphi}$ (2) (i.e. the range is dense in the codomain).

*Say $(Z,d_Z)$ is "complete" if every Cauchy sequence converges.

*If isometry $(X, d_X) \to (Y, d_Y)$ is dense (4) and isometry $(X, d_X) \to (Z, d_Z)$ has complete codomain (5) then there is an isometry $(Y, d_Y) \to (Z, d_Z)$ making the diagram commute (i.e. a morphism in the under category).

*Say isometry $(X, d_X) \to (Y, d_Y)$ is a "completion" if it is dense (4) and has complete domain (5).

*Given isometry $\varphi: (X, d_X) \to (Z, d_Z)$ with complete codomain (5), we can take its closure $\overline{\varphi}$ (2) to get a completion (7).


Field
Fix a base field $F$. Consider homomorphisms from it to other fields (i.e. the under category).


*

*Every field homomorphism $F \to K$ is injective.

*Given homomorphism $i : F \to K$, say the closure is the map $\bar{i} : F \to \text{integral closure of $i(F)$ in $K$}$.

*Taking closure (2) is idempotent.

*Say homomorphism $i : F \to K$ is "algebraic" if $i = \overline{i}$ (2) (i.e. every element of $K$ is algebraic over $F$).

*Say $L$ is "algebraically closed" if every non-constant polynomial over $L$ has a root in $L$.

*If $F \to K$ is algebraic (4) and $F \to L$ has algebraically closed domain (5) then there is a homomorphism $K \to L$ making the diagram commute (i.e. a morphism in the under category).

*Say $F \to K$ is an "algebraic closure" if it is algebraic (4) and the codomain is algebraically closed (5).

*Given homomorphism $F \to L$ with algebraically closed codomain (5), we can take its closure (2) to get an algebraic closure (7).


My thoughts
The maps in the metric space scenario are unique while the maps in the field scenario are highly non-unique. So reflective subcategory might be able to deal with the first one but not the second one; if we consider finite separable extensions then Galois category might be able to deal with the second one but certainly not the first one. However, I do not know much about Galois categories.
 A: Here are some thoughts about common generalizations.  First let $e$ be an object of a category $C$.


*

*$e$ is initial if for every object $x\in C$ there is a unique morphism $e\to x$.

*$e$ is weakly initial if for every object $x\in C$ there exists a (not necessarily unique) morphism $e\to x$.

*$e$ is Galois-initial if it is weakly initial, and in addition for any two parallel morphisms $f,g:e\to x$ there is a unique morphism $h:e\to e$ with $f h = g$.  (It follows that $h$ is an isomorphism, since we also have a unique $k$ with $g k = f$, and uniqueness gives $h k = k h = 1_e$.)


I just made up the term "Galois-initial"; suggestions for a better name (or even better, literature references) are welcome.  In the terminology of these slides a Galois initial object is a "poly-initial object" that is a singleton set.  Clearly every initial object is Galois initial.
Now let $D\hookrightarrow C$ be a subcategory.


*

*$D$ is reflective in $C$ if for every $x\in C$ the comma category $(x\downarrow D)$ has an initial object.

*$D$ is weakly reflective in $C$ if for every $x\in C$ the comma category $(x\downarrow D)$ has a weakly initial object.

*$D$ is Galois-reflective in $C$ if for every $x\in C$ the comma category $(x\downarrow D)$ has a Galois initial object.


Of course as you say, your first example exhibits complete metric spaces as a reflective subcategory of all metric spaces.  I believe your second example exhibits algebraically closed fields as a Galois-reflective subcategory of all fields.  Thus, since every reflection is in particular a Galois-reflection, both are examples of Galois-reflections (hence a fortiori both examples of weak reflections).
This definition describes the relationship between the two categories, but not the common situation of "closure inside an ambient object".  I believe that can be described in terms of an orthogonal factorization system $(E,M)$.  In your first example, $E$ is the dense inclusions and $M$ is the closed inclusions, while in your second example $E$ is the algebraic extensions and $M$ is the integrally closed ones.
In a category with a terminal object, every orthogonal factorization system induces a reflective subcategory consisting of those objects $x$ for which $x\to 1$ lies in $M$, with the $(E,M)$-factorization of $x\to 1$ providing the reflection; but your categories don't have terminal objects!  Instead we can do something like define an object $x$ to be $E$-injective if for any $E$-morphism $f:u\to v$ and any morphism $g:u\to x$ there is an extension $h:v\to x$ with $h f = g$.  Note that this is your points (6), and that if there is a terminal object these are precisely the objects such that $x\to 1$ lies in $M$.
Lemma: If all morphisms are mono, then every morphism with $E$-injective domain lies in $M$.
Proof: Given $x\to y$ with $x$ being $E$-injective, factor it as $x\to z\to y$ with $x\to z$ in $E$ and $z\to y$ in $M$.  Then $E$-injectivity supplies a retraction $z\to x$, which is an isomorphism since it is is mono; thus $x\to y$ is isomorphic to $z\to y$ and hence also in $M$.  $\Box$
Theorem: If all morphisms are mono and every object $x$ admits an $E$-morphism $\eta_x: x\to \hat{x}$ where $\hat{x}$ is $E$-injective, then the $E$-injective objects are Galois-reflective.
Proof: Suppose $f,g:\hat{x}\to y$ are morphisms with $f \eta_x = g \eta_x$, where $y$ is also $E$-injective.  By the lemma, they are both in $M$.  Then the unique lifting property in the commutative square $f \eta_x = g \eta_x$ gives $h:\hat{x}\to\hat{x}$ with $h \eta_x = \eta_x$ and $f h = g$, which is exactly what we wanted.  $\Box$
Note that an $E$-morphism to an $E$-injective is your points (7).  Finally, if $y$ is an $E$-injective and $z\to y$ lies in $M$, then $z$ is also $E$-injective. Thus if $x\to y$ is a morphism with $y$ an $E$-injective, then by $(E,M)$-factoring it we obtain an $E$-morphism from $x$ to an $E$-injective; this is your points (8).
