Hartshorne Definition Question

I have a question from Algebraic Geometry by Robin Hartshorne. Here is a proof in the textbook:

Theorem. Let be a variety and be an affine variety. Let be the coordinate functions on . A map of sets is a morphism if and only if is a regular function on for each .

Proof

If is a morphism then the are regular functions. This is by the definition of a morphism.

Suppose the are regular. Let be any polynomial. Then is also regular on . Now because the closed sets of are defined by the vanishing of polynomial functions and because regular functions are continuous, takes closed sets to closed sets. So is continuous. Recall that regular functions on open subsets of are locally quotients of polynomials. Hence is regular where is a regular function on any open subset of . Therefore is a morphism.

There is no definition for the -th coordinate function given in this textbook. I looked in Ideals, Varieties, and Algorithms and it gives the following definition:

Definition

(i) Given a polynomial , we let denote the polynomial function in represented by .

(ii) Each variable gives a polynomial function whose value at a point is the -th coordinate of . We call the -th coordinate function on .

Is this the same definition that Hartshorne is using? If it is different, what is the correct definition? Thanks.