Why does the definition of an open subscheme / open immersion of schemes allow for an "extra" isomorphism?

After taking an algebraic geometry course last year, I've been reviewing the material this year, and I remembered something that struck me as odd, but which I'd neglected to ask about at the time:

Hartshorne's definition of an open subscheme and open immersion (p.85):

An open subscheme of a scheme $X$ is a scheme $U$, whose topological space is an open subset of $X$, and whose structure sheaf $\mathcal{O}_U$ is isomorphic to the restriction $\mathcal{O}_X|_U$ of the structure sheaf of $X$. An open immersion is a morphism $f:X\to Y$ which induces an isomorphism of $X$ with an open subscheme of $Y$.

However, many other sources (including Wikipedia) go with an open subscheme being a scheme $Z$ of the form $(U,\mathcal{O}_X|_U)$ where $U\subseteq X$ is an open subset, and then defining an open immersion to be a morphism $f:Y\to X$ that factors through an isomorphism with an open subscheme, i.e. there is an isomorphism of schemes $g:Y\,\stackrel{\sim}{\to} Z$ such that $f=i\circ g$, where $i:Z\to X$ is the inclusion map.

Why make these (quite subtly) more general definitions? Clearly, there is some issue that is addressed by either making the definition of open subscheme, or that of open immersion, contain this "extra" isomorphism. By no means do I treat things that are isomorphic as being "equal", so I understand that this definition is not really equivalent. But surely defining a subgroup of a group $G$ to be "a group $H$ whose underlying set is a subset of $G$ and whose operation is isomorphic to the restriction of the operation of $G$" would sound a bit off?


The definition of open subscheme in Hartshorne is so bad that the first sentence he writes after it is false!
That sentence is: Note that every open subset of a scheme carries a unique structure of open subscheme (Ex.2.2).
This is false: indeed, replacing $\mathcal O_{X|U}$ by an isomorphic sheaf you will get another scheme (albeit isomorphic, of course) and the claimed unicity does not hold..
And you really get other schemes because a scheme is a pair formed by a topological space and a sheaf of rings, not an isomorphism class of sheaves of rings.
So that the collection of subscheme structures on an open subset $U$ of a scheme $X$ would not even be a set with Hartshorne's definition ...

Of course in EGA, Görz-Wedhorn, Qing Liu,... you will find the reasonable definition that an open subscheme of $X$ is an open subset $U\subset X$ endowed with the restricted sheaf $\mathcal O_{X|U}$ , and not some arbitrary sheaf isomorphic to it. There is of course a canonical morphism of schemes $j:U\to X$

Edit: Open immersions Once you have the correct notion of open subscheme, you have no choice for defining an open immersion $Y\to X$. The natural idea is that you want it to be an isomorphism $g:Y \stackrel {\sim}{\to} U $ where $U\subset X$ is an open subscheme. However this has the wrong target, so you just compose it with the canonical morphism $j:U\to X$ mentioned above and you get the required immersion $f=j\circ g:Y\to X$, just as Wikipedia and most other references say.
And, quite satisfactorily, $j:U\to X$ itself is then an open immersion ( take $g=id_U$).

A criterion for being an open immersion: In practice to prove that a morphism $f:Y\to X$ is an open immersion, it suffices to check that:
a) $f$ induces a homeomorphism of $Y$ onto an open subset $U$ of $X$.
b) For all $y\in Y$ the local morphism $f^\ast_y: \mathcal O_{X,f(y)} \to \mathcal O_{Y,y}$ is an isomorphism of local rings.

NB Needless to say, I have an immense admiration for Hartshorne: I'm criticizing a definition in a book, and certainly not that great, friendly mathematician!