I have been working on exercises from "A first Course in Logic" by S. Hedman. Exercise 2.3 (d) asks to find a first-order sentence $\varphi$ having the set of perfect squares as a finite spectrum. But I am not sure whether or not my understanding of concepts of model and spectrum is correct.
My solution is:
$\varphi = (\exists x)((x^2 = b) \wedge (\forall y)(y\leq b))$, i.e., there is $x$ such that $x^2 = b$ and for all $y$, $y$ is less than or equal to a constant $b$. Hence, any set of positive integer numbers, with the maximal element that is a perfect square, models this sentence. For example, $\{1\}, \{1,2,3,4\}, \{1,\ldots, 9\}$ and so on.
Could someone confirm my solution (am I on the right track)? Or am I missing something?
Outline: We use a rather rich language based on the predicate calculus with equality, There are two unary predicate symbols, $P$, where $P(x)$ should be thought of as saying that $x$ is a point, and $E$, where $E(x)$ should be thought of as saying that $x$ is a (directed) edge. Then there is a ternary predicate symbol $S$, where $S(x,y,z)$ should be interpreted as meaning that $z$ is the edge going from $x$ to $y$. We now describe the axioms in informal language that should not be difficult, if one wishes, to turn into formal language.
$1.$ Everything is a point or an edge, and nothing can be both a point and an edge.
$2.$ $S(x,y,z)$ implies that $x$ and $y$ are points and $z$ is an edge.
$3.$ We can never have $S(x,x,z)$.
$4.$ For any $z$ there is a unique $x$ and $y$ such that $S(x,y,z)$.
$5.$ For any $x$ and $y$, with $x\ne y$, there is a unique $z$ such that $S(x,y,z)$.
Let $\varphi$ be the conjunction of the set of axioms described above.
Now let $M$ be a finite model of this set of axioms, and let $q$ be the cardinality of the set of elements of (the underlying set of) $M$ that satisfy (the interpretation of) the predicate symbol $P$. Then the number of elements of $M$ that satisfy $E$ is $q(q-1)$, so $M$ has cardinality $q+q(q-1)=q^2$. And it is clear that for every positive integer $q$ there is a model of cardinality $q^2$.