# Definition of quasi-projective morphism, and closed immersions and open immersions “commute”

This is a question about another question here. I thought I would make this a separate question since the one there is four years old so I figured it is a long shot trying to get a response, plus this seems to be an issue that turns up everywhere.

I am wondering about the definition of quasi-projective morphism of schemes, and the equivalence of several definitions I have seen. I will use the following definition for projective.

A morphism $f: X \longrightarrow Y$ of schemes is said to be projective if there is some $n$ so that $f$ factors via a closed immersion $i$ followed by canonical projection, $$X \stackrel{i}{\longrightarrow} \mathbb{P}^{n}_{Y} \longrightarrow \hspace{-0.5cm}\rightarrow Y.$$

Hartshorne (pg 103) then defines a quasi-projective morphism as one which factors via an open immersion followed by a projective morphism. In the question I linked above, it is claimed that in the case mentioned there, that a closed immersion followed by an open immersion can be written as an open immersion followed by a closed one. My question is under what conditions can that happen? It seems like a fairly special result.

Hartshorne claims that his definition is equivalent to a different definition given in EGA in terms of ample bundles, which is a formalism I am not as familiar with yet. I was wondering if there is a nice set of conditions under which one can say that Hartshorne's definition is equivalent to the following "definition"

A morphism $f: X \longrightarrow Y$ of schemes is said to be quasi-projective if there is some $m$ so that $f$ factors via an immersion $j$ followed by the canonical projection, $$X \stackrel{j}{\longrightarrow} \mathbb{P}^{m}_{Y} \longrightarrow \hspace{-0.5cm}\rightarrow Y.$$