Spivak's Calculus on Manifolds - Statement of Lemma 2-10 is incorrect? In Spivak's Calculus on Manifolds, there is a Lemma 2-10 that is later used to prove the Inverse Function Theorem.

Lemma 2-10 : Let $A \subset \mathbb{R}^n$ be a rectangle and let $f : A \to \mathbb{R}^n$ be continuously differentiable. If there is a number $M$ such that
  $| D_j f^i (x) | \leq M$ for all $x$ in the interior of $A$, then
  $$
|f(x)-f(y)| \leq n^2 M |x-y|
$$
  for all $x,y \in A$.

To prove this lemma, we first write
$$
f^i(y)-f^i(x) = \sum_{j=1}^n (f^i(y^1,\dots,y^j,x^{j+1},\dots,x^n) - f^i(y^1,\dots,y^{j-1},x^j,\dots,x^n)).
$$
Applying the mean-value theorem, we get
$$
f^i(y^1,\dots,y^j,x^{j+1},\dots,x^n) - f^i(y^1,\dots,y^{j-1},x^j,\dots,x^n) = (y^j - x^j) \cdot D_j f^i(z_{ij})
$$
for some $z_{ij}$. Then, Spivak uses the hypothesis in the lemma to say that the right hand side has absolute value less than or equal to $M \cdot |y^j - x^j|$.
But strictly speaking we cannot use this hypothesis yet, because it is possible that both $x$ and $y$ are boundary points such that $z_{ij}$ is also a boundary point. For example, $A \subset \mathbb{R}^2$ could be $[0,1]\times[0,1]$ and $x$ and $y$ could be $(0,0)$ and $(1,0)$, respectively. Then
$$
f^i(1,0) - f^i(0,0) = (f^i(1,0) - f^i(0,0)) + (f^i(1,0)-f^i(1,0))\\
\Rightarrow f^i(1,0) - f^i(0,0) = (1-0) \cdot D_1 f^i (z_{i1})
$$
where $z_{i1}$ lies on the $x$-axis and so is a boundary point of $A$.
So, the lemma should be stated more accurately as follows:

Lemma 2-10 : Let $A \subset \mathbb{R}^n$ be a rectangle and let $f : A \to \mathbb{R}^n$ be continuously differentiable. If there is a number $M$ such that
  $| D_j f^i (x) | \leq M$ for all $x$ in $A$, then
  $$
|f(x)-f(y)| \leq n^2 M |x-y|
$$
  for all $x,y \in A$.

The same proof as earlier should work, provided $z_{ij}$ is appropriately chosen from $A \cup \text{boundary $A$}$.
Note: Spivak has defined a function $f : A \subset \mathbb{R}^n \to \mathbb{R}^m$ to be differentiable, where $A$ is any subset, if $f$ can be extended to a differentiable function on some open set containing $A$.
I would like to know whether my reasoning is accurate. Thank you in advance.
EDIT: @rogerl has clarified my original question in the comments below. I would like to add another question though: is it necessary that $f$ be continuously differentiable? Can't it just be differentiable?
To apply the Mean Value Theorem on an interval $[a,b]$ we only require that the function be continuous on $[a,b]$ and differentiable on $(a,b)$. The proof does not seem to require continuity of the derivative.
The proof continues as follows:
$$
|f^i (y) - f^i (x)| \leq \sum_{j=1}^n |y^j - x^j | \cdot M \leq nM |y - x|
$$
since each $|y^j - x^j| < |y-x|$. Finally
$$
|f(y) - f(x)| \leq \sum_{i=1}^n |f^i (y) - f^i (x)| \leq n^2 M |y - x|.
$$
 A: Note: this is just an elaboration of the comments above by @rogerl and @MarianoSuárez-Álvarez

Since we are taking $f$ to be continuously differentiable, we can use the continuity of the partial derivatives of the component functions, $D_jf^i$, to extend the condition $$|D_jf^i(x)| \leq M\quad \forall\ x \in \operatorname{interior} A$$ to all $x \in \operatorname{boundary} A$ as well. So, there is no problem in assuming that the above condition holds only for $x$ in the interior of the rectangle $A$.
Regarding the second question, if we relax the conditions on $f$ to just differentiability on $A$ instead of continuous differentiability, then we first prove the lemma for all $x,y \in \operatorname{interior} A$. Then, we use the continuity of $f$ to extend the condition $$|f(x)-f(y)| \leq n^2 M|x-y|\quad \forall\ x,y \in \operatorname{interior} A$$
to all $x,y \in \operatorname{boundary} 
A$. So, the answer is, yes, it is possible to relax the conditions on $f$; however, Spivak is not interested in minimal smoothness hypotheses and he will usually assume all the functions are smooth unless otherwise specified.
