What is an immersion of schemes? Understanding Hartshorne's Theorem II.7.6 Essentially, theorem II.7.6 of Hartshorne proves that a line bundle $\mathscr{L}$ is ample if and only if $\mathscr{L}^{\otimes n}$ is very ample for some $n$. My confusion is mostly about the definition of an immersion used in the proof.
In the first part, we assume $\mathscr{L}^n$ on a noetherian $A$-scheme $X$ is very ample and we use the fact that $X \cong U \subseteq Z \subseteq \mathbb{P}^m_A$ where the first inclusion is an open immersion and the second is a closed immersion. This definition is essential because we require that a coherent sheaf on $X$ extends to all of $Z$. This theorem (exercise II.5.15) is about extending a coherent sheaf from an open subset so the fact that the first inclusion is an open immersion is essential.
Later in the proof, he shows that $\mathscr{L}^n$ is very ample by showing that it gives rise to a morphism $X \to \mathbb{P}^N_k$ which factors into $X \to \bigcup_{i = 1}^l U_i \to \mathbb{P}^N_k$ where $U_i$ are open subsets of some $\mathbb{P}^N_A$ and the first map is a closed immersion.
What is going on here? It seems that there are different definitions of an immersion being used here. Are they used interchangeably or is this a mistake of Hartshorne's? I am very confused because it seems that two different(non-equivalent) definitions are being used in the same proof.
I will also add that Hartshorne defines an immersion $X \to Z$ to be a map which induces an isomorphism of '$X$ with an open subscheme of a closed subscheme of $Z$.'
Thank you for any help!
 A: As I mentioned in the comments, Hartshorne's immersions are open immersions followed by closed immersions, which is different from the immersions of EGA, which are closed immersions followed by open immersions.
The scenario you have here is that you have an immersion in the sense of EGA and would like to show that it's an immersion in the sense of Hartshorne. This can be done in the case that either the map is quasi-compact, or the source is reduced: either will let you compute the scheme-theoretic image locally on the target (see here for some discussion).
If you satisfy either of these hypotheses, then you can factor your immersion $i:X\to Y$ as $X\to \operatorname{im}(i) \to Y$, where $\operatorname{im}(i)$ is the scheme theoretic image, which by the above result is set-theoreticaly the closure of $i(X)$. $X\to\operatorname{im}(i)$ is topologically an open immersion, so it suffices to check that the map on stalks is an isomorphism. We may see this directly  from the fact that the scheme-theoretic image can be computed locally. From the factorization of $i$ as a closed immersion followed by an open immersion, $\mathcal{O}_{Y,x}\to\mathcal{O}_{X,x}$ is a quotient map. This map also factors as $$\mathcal{O}_{Y,x}\to\mathcal{O}_{\operatorname{im}(i),x}\to\mathcal{O}_{X,x}$$ and if the second map is not an isomorphism, it must be a nontrivial quotient map. If this is true, there is a smaller closed subscheme through which $i$ factors, in contradiction to the definition of the scheme-theoretic image as the smallest such closed subscheme. So we've prodcued the required factorization.
Finally, since $X$ in your problem is noetherian, any map out of it is quasi-compact because every subset of a noetherian topological space is quasi-compact. So you can swap the orders of immersions to your heart's content in this setting.
