TITLE: Which categories are injective with respect to fully faithful functors?
QUESTION [8 upvotes]: Recall that a poset $K$ is a complete lattice if and only if $K$ is injective with respect to poset embeddings in that sense that for any poset $B$, any embedded subposet $A \subseteq B$, and any order-preserving map $A \to K$, there exists an extension $B \to K$.
I'm wondering what sorts of generalizations or analogs this fact has when passing from posets to categories. Ultimately I'd be interested to know if (co)completeness conditions can be characterized by injectivity, but I'm not sure what the correct question is in this direction, so let's start with something concrete:
Question: Which locally small categories $\mathcal K$ are injective with respect to fully faithful functors $\mathcal A \to \mathcal B$ between small categories?
There is some ambiguity about what "injective" means here. In general, "injective with respect to fully faithful functors" means that given a fully faithful functor $\mathcal A \to \mathcal B$ and a functor $\mathcal A \to \mathcal K$, there exists a functor $\mathcal B \to \mathcal K$ making the requisite diagram commute. But I can think of at least 4 possible meanings of "commute" -- we could ask for the diagram to commute strictly (giving (1) "strict-injectivity"), up to isomorphism (giving (2) "pseudo-injectivity"), or up to a natural transformation (giving (3) "lax-injectivity" or (4) "oplax-injectivity" depending on the direction of the transformation). So really there are at least 4 questions here. I think the most interesting versions are the "strict" and "pseudo" versions, and I suspect the answers in these two cases should be rather close.
Notes:

At any rate, it seems that by duality, the answer can't be "the complete categories" except perhaps in case (3) or (4).

If it makes a difference to change from considering fully faithful functors $\mathcal A \to \mathcal B$ to just considering full replete subcategories $\mathcal A \subseteq \mathcal B$ or something like that, I'd be happy with an answer to any such small variation.

I would also be interested in knowing the answer when considering fully faithful functors between locally small categories, rather than just between small categories.

REPLY [3 votes]: There's a nice answer if we take a slightly stronger notion of "injectivity", namely where we take Kan extensions instead of extensions. I would expect this to coincide in some nice cases with the non-Kan notion of injectivity.
This is a question for which the theory of (co)KZ doctrines is well-suited, in which (co)completeness properties are characterised by the existence of certain extensions. I'll choose to work with KZ doctrines, and thus cocompleteness properties. A good reference is Walker's Distributive laws via admissibility, and the full definitions of the various concepts I make use of below can be found there.
Let $(\mathbb P, \eta)$ be a KZ doctrine on a 2-category $\mathcal K$. An object $X \in \mathcal K$ is $\mathbb P$-cocomplete if for all $g \colon B \to X$, there exists a left extension $\mathrm{lan}_{\eta_B} g$, exhibited by an invertible 2-cell,

such that the left extension respects those defined by the KZ doctrine in an appropriate sense (q.uiver link).
From Marmolejo–Wood's Kan extensions and lax idempotent pseudomonads, we know that the $\mathbb P$-cocomplete objects are equivalently the pseudoalgebras for the pseudomonad $\mathbf P \colon \mathcal K \to \mathcal K$ induced by $(\mathbb P, \eta)$, so that when we take $\mathbf P$ to be a pseudomonad for a cocompletion under a class of weights $\Phi$, then $\mathbb P$-cocompleteness corresponds to admitting all $\Phi$-colimits. In particular, for $\mathbb P$ the small presheaf construction on locally small categories, a $\mathbb P$-cocomplete object is just a small-cocomplete locally small category.
To relate this to your question, we also need to introduce the notion of admissibility for a KZ doctrine. A 1-cell $f \colon A \to B$ is $\mathbb P$-admissible if, for any $h \colon A \to X$ for $X$ a $\mathbb P$-cocomplete object, there exists a left extension $\mathrm{lan}_f h$,

such that the left extension is preserved by $\mathbb P$-cocontinuous 1-cells into any  $\mathbb P$-cocomplete object (q.uiver link).
Crucially, as Walker observes in Remark 25 ibid., a $\mathbb P$-admissible 1-cell is $\mathbb P$-fully faithful (meaning $\mathbf Pf$ is representably fully faithful) if and only if every left extension as in the diagram above is exhibited by an invertible 2-cell.
Taking $\mathbb P$ to be the small presheaf construction, the $\mathbb P$-admissible 1-cells are the functors $f \colon A \to B$ for which $B(f{-}, b)$ is a small presheaf for all $b \in B$. We shall call these small functors. (Ivan Di Liberti mentions several equivalent conditions for a functor to be small in this answer.) The $\mathbb P$-fully faithful 1-cells are precisely the fully faithful functors. So, if a locally small category $X$ is small-cocomplete, every functor $A \to X$ admits a left extension along small functors $A \to B$ (hence $X$ is "Kan lax-injective" with respect to small functors). Furthermore, these left extensions are exhibited by invertible 2-cells precisely for those small functors $A \to B$ that are fully faithful (hence $X$ is "Kan pseudo-injective" with respect to small fully faithful functors).
Conversely, if a locally small category $X$ admits left extensions of functors $A \to X$ along small functors, it in particular admits a left extension along the Yoneda embedding of $A$ (since the unit $\eta$ of a KZ doctrine is $\mathbb P$-admissible), and hence is small-cocomplete. Therefore, the locally small categories that are Kan lax-injective with respect to small functors are precisely the small-cocomplete categories.
One question remains, which regards the case when $X$ is only known to admits left extensions along $\mathbb P$-fully faithful $\mathbb P$-admissible 1-cells. Here, we may restrict our consideration to the fully faithful KZ doctrines, which are those for which the components of the unit $\eta_B \colon B \to \mathbb P B$ are representably fully faithful. In this case, $X$ once again admits extensions along $\eta_B$, and hence is $\mathbb P$-cocomplete. Since the Yoneda embedding is fully faithful, the small presheaf construction is a fully faithful KZ doctrine. Therefore, the locally small categories that are Kan pseudo-injective with respect to small fully faithful functors are precisely the small-cocomplete categories.
(Let me know if something doesn't quite look right – I could well have made a mistake somewhere along the line!)