3

If I have some variable $x$ and I want to show that it takes values from the set of integers $\{1, 2, 3, \dots, n\}$, is it correct to write the following:

$$x \in [1, n]$$

Connor
  • 647
  • 1
    If you use this notation make sure you define it before you actually use it. If you are also using intervals of $\mathbb{Q}$ or $\mathbb{R}$, use something like $[ 1,n ]_{\mathbb{N}}$. – Jay Oct 23 '21 at 14:28

3 Answers3

2

The default notation is that $[1,n]$ is an interval in the set of real numbers: $$[1,n] = \{x \in \mathbb R \mid 1 \le x \le n\} $$ and this includes non-integer numbers such as $x = 1.5$ (assuming $n \ge 2$). So no, that's not correct (unless you explained very carefully and very clearly, in what you are writing, what your intention is for the notation $[1,n]$).

What would be correct is to use the intersection operator $\cap$ and to write $x \in [1,n] \cap \mathbb N$, using the standard notation $\mathbb N$ for the set of natural numbers (a.k.a. the positive integers).

However, it is common notation to literally use the ellipsis in this situation, $$\{1,...,n\} = [1,n] \cap \mathbb N $$ If you used that in your mathematical writing, you would be almost universally understood.

Lee Mosher
  • 120,280
  • Would you use ${1, 2, \dots, n}$ for further clarity, or do you think it's unlikely to be required? Also slightly off topic, why can't I tag you with the @? – Connor Oct 23 '21 at 18:28
  • 1
    Yes, I do like ${1,2,...,n}$ for further clarity. It depends on the emphasis. For example sometimes I like ${1,2,...,n-1,n}$, especially in an induction proof. – Lee Mosher Oct 23 '21 at 21:12
1

Seth Warner, in his "Modern Algebra" (1965) is often criticised for using unconventional and confusing notation, but it is worth noting that in Section 16 he writes:

"An integer interval is any set $[m, n]$ where $m$ and $n$ are natural numbers satisfying $m \le n$."

Hence yes you can is the answer to your question.

However, If I were you I would be careful in my exposition and (the first time using the notation) say "$x \in [1, n]$ where $[1,n]$ denotes the integer interval $\{1, 2, \ldots, n\}$."

Prime Mover
  • 5,005
1

Hint: A commonly used notation is \begin{align*} [n]:=\{1,2,\ldots,n\} \end{align*} This way we can conveniently write \begin{align*} x\in[n] \end{align*} avoiding interval notation.

Markus Scheuer
  • 108,315