I have a question regarding Spivak's definition of a local maximum (or minimum). First, I'll give you his definition, along with a theorem that comes right after it. Then, I'll give my question.
Calculus, 3rd Ed. by Michael Spivak Chapter 11, Page 186:
DEFINITION: Let $f$ be a function, and $A$ a set of numbers contained in the domain of $f$. A point $x$ in $A$ is a local maximum [minimum] point for $f$ on A if there is some $\delta > 0$ such that $x$ is a maximum [minimum] point for $f$ on $A\cap (x-\delta, x+\delta)$.
THEOREM 2: If $f$ is defined on (a,b) and has a local maximum (or minimum) at $x$, and $f$ is differentiable at $x$, then $f^\prime(x) = 0$
Ok, my question is, are we to assume that the set $A$ contains some open interval around $x$?
Let's take the definition just as it's written:
For $f$ we'll use the function $f(x) = x$, which has as its domain $\mathbb{R}$, and is differentiable for all $x$ in this domain.
Define the set $A$ as
$A = \{x:0 \leq x \leq 1\} \cup \{7\}$
Using Spivak's definition, we have a function $f$, and a set of numbers $A$ that's contained in the domain of $f$. If we look at the point $x = 7$, and use $\delta = 10$, then $A\cap (x-\delta, x+\delta)$ is just $A$, right? $f(7) = 7$ is the maximum value of $f$ on $A$, so by THEOREM 2, $f^\prime(7) = 0$, which is obviously not true.
It seems like Spivak forgot to specify that $A$ must contain some interval containing $x$, but maybe I'm missing something simple?
In Theorem 2, when he says "If $f$ is defined on $(a,b)$ and has a local maximum at $x$," is he implying that $x$ is in $(a,b)$ and is the local maximum on $(a,b)$?
I'm not quite sure why he's bothering with the set $A$ at all. It seems like you could say the point $x$ is a local maximum if there exists some $\delta > 0$ such that $x$ is a maximum point for $f$ on $(x-\delta, x+\delta)$, and leave it at that. Why bring $A$ into it? (Probably I'd find out in a few chapters, if not pages!)
I strongly suspect I'm being dumb and I'll regret asking this in about 5 minutes...
No.
The definition works for arbitrary sets of numbers that are contained in the domain of $f$.
In my example, there are 2 local maximums on $A$: $x = 1$ and $x = 7$. There are 2 local minimums: $x = 0$ and $x = 7$.
However, Theorem 2 doesn't apply to any of these points. Theorem 2 applies to a point that is a local maximum [minimum] over an open interval containing that point. We can form an open interval within $A$, but it won't contain any of $A$'s local maximums or minimums.
Theorem 2 can be made less ambiguous with a minor edit:
Theorem 2, revised: If $f$ is defined on (a,b) and has a local maximum (or minimum) on $\bf{(a,b)}$ at $x$, and $f$ is differentiable at $x$, then $f^\prime(x) = 0$
If we do have a point $x_m$ that's a local maximum on an interval $(a,b)$, this means via the definition that there is some $\delta > 0$ such that $x_m$ is a maximum point on the intersection $(a,b) \cap (x_m-\delta, x_m + \delta)$.
Given 2 open intervals that contain the same point, it's easy to show their intersection will be an open interval containing that point. Our local maximum will be a maximum over this new interval.
If $f$ is differentiable at $x_m$, we can show that the limits from above and below force $f^\prime(x_m) = 0$.
(For example, if we define a new $\delta_2 = \min(x_m-a, b-x_m, \delta)$, then $x_m$ will be a maximum point on $(x_m-\delta_2, x_m + \delta_2)$.