I'm learning math without a math professor. I need some feedback from community regarding my proof. Book : "Discrete Mathematics with Applications" by Susanna S. Epp, 5th edition. Exercise 17 from page 217. Please verify my proof.
Prove the statement or find a counterexample if the statement is false. For every integer n,
$$\lfloor n/3\rfloor = \frac{n}{3},\;\text{ if }\,n\text{ mod }3=0$$ $$\lfloor n/3\rfloor = \frac{(n-1)}{3},\;\text{ if }\,n\text{ mod }3=1$$ $$\lfloor n/3\rfloor = \frac{(n-2)}{3},\;\text{ if }\,n\text{ mod }3=2$$
In the proof I will use the following definitions:
- The definition of the "floor" operation: For every $x \in \Bbb R $, $ \lfloor x \rfloor = n \iff \exists n \in \Bbb Z, n \le x < n+1 $
- The definition of the "mod" operation: Given any $n \in \Bbb Z $ and $d \in \Bbb Z^+ $: $n\text{ mod }d= r \iff n = dq + r$, where $q \in \Bbb Z, r \in \Bbb Z$, and $0 \le r < d$
Proof. According to the given statement, the proof must contain three cases and each of them must be proved individually.
Case $\mathrm{I}$. $\lfloor n/3 \rfloor = \frac{n}{3}$, if $n\text{ mod }3 = 0$. From (2), $n\text{ mod }3 = 0 \iff \exists q \in \Bbb Z$ and $n = 3q + 0$. From (1), $$\lfloor n/3 \rfloor = \frac{n}{3} \\ \frac{n}{3} \le \frac{n}{3} < \frac{n}{3} + 1 \\ \frac{3q}{3} \le \frac{3q}{3} < \frac{3q}{3} + 1 \\ q \le q < q+1 $$
Case $\mathrm{II}$. $\lfloor n/3 \rfloor = \frac{n-1}{3}$, if $n\text{ mod }3 = 1$. From (2), $n\text{ mod }3 = 1 \iff \exists q \in \Bbb Z$ and $n = 3q + 1$. From (1), $$\lfloor n/3 \rfloor = \frac{n-1}{3} \\ \frac{n-1}{3} \le \frac{n-1}{3} < \frac{n-1}{3} + 1 \\ \frac{3q+1-1}{3} \le \frac{3q+1-1}{3} < \frac{3q+1-1}{3} + 1 \\ q \le q < q+1 $$
Case $\mathrm{III}$. $\lfloor n/3 \rfloor = \frac{n-2}{3}$, if $n\text{ mod }3 = 2$. From (2), $n\text{ mod }3 = 2 \iff \exists q \in \Bbb Z$ and $n = 3q + 2$. From (1), $$\lfloor n/3 \rfloor = \frac{n-2}{3} \\ \frac{n-2}{3} \le \frac{n-2}{3} < \frac{n-2}{3} + 1 \\ \frac{3q+2-2}{3} \le \frac{3q+2-2}{3} < \frac{3q+2-2}{3} + 1 \\ q \le q < q+1 \ \blacksquare $$
solution-verificationquestion to be on topic you must specify precisely which step in the proof you question, and why so. This site is not meant to be an open-ended proof checking machine. – Bill Dubuque Jan 22 '23 at 18:28$$\begin{align} k\ &\le\ n/3\ \iff\ \ 3k\ &\le\ n\ \iff \ \ 3k\ &\ \le n-(n\bmod 3)\ \iff\ \ \ \ k\ &\le (n-(n\bmod 3))/3\[.4em] {\rm so}\ \ \ \lfloor n/3] &= (n-(n\bmod 3))/3 \end{align}\qquad$$ – Bill Dubuque Jan 22 '23 at 18:42