# Understanding “Divides” aka “|” as used logic

What are the rules for using the divides operator aka "$\mid$"? Is it false to say $2\mid5$ since $5/2$ = $2.5$ and $2.5\notin\mathbb{Z}$? Or does my question imply a misunderstanding?

I am seeing this for the first time in the 6.042J, Lecture 2: Induction on MIT OCW.

Thanks for the help.

That's correct. We use the divide operator to denote the following:

We say for two integers $a$, $b$, that $a$ divides $b$ (or $a|b$) if $b = ka$ for some integer $k$.

To say that $a\ \mid\ b$, or "a divides b", is to say that $r = 0$ in the division algorithm: $$b = qa + r.$$

• in this example, q is quotient and r is for remainder? – user2068060 Jul 25 '13 at 18:22
• @user2068060 Yes, exactly. – Emily Jul 25 '13 at 18:23

You're right $2|5$ is a false statement. Here are some true statements using |, see if you can see why they are true:

$$a|b\wedge b|c\Longrightarrow a|c\\\{n|ab\Longrightarrow n|a \vee n|b\}\Longleftrightarrow \text{n is prime}$$

• is the second one the definition of a prime? Since if n divides both a and b, then it is divisible by something other than itself and 1? Also, did I read that right "n divides ab, implies n divides a or n divides b if and only if n is a prime"? – user2068060 Jul 25 '13 at 18:32
• @user2068060: That is exactly right! – Jared Jul 25 '13 at 18:38

$n\mid m$ means that $n$ divides $m$; $2\mid5$ is false since it leaves a remainder of $1$, thus $2\nmid5$. ($x\nmid y$ stands for that $x$ does not divide $y$)

More examples:

$2\mid6$ since remainder when $6$ is divided by $2$ is zero.

$3\mid 9^n+27n, \forall n\in\mathbb{N}$ (which means that forall $n$ that's a natural number)

• is there any reason to use the divides symbol with the strike through rather than the negation symbol before it, other than preference? Or is the way you have "2∤5" preferable to using "¬(2|5)" due to simplicity? – user2068060 Jul 25 '13 at 18:36
• I guess, it's more like a ... personal preference? I do think though that $2\nmid5$ is simpler – user67258 Jul 25 '13 at 18:40

The rule says that if $a\mid b$, then $b = k \cdot a$ for some integer $k$. Since $2.5\notin\mathbb{Z}$, $2\nmid5$.

• k>=1 is interesting here. Thus (2|0) is false? As is (2|-6)? – user2068060 Jul 25 '13 at 18:24
• Sorry, that was a typo (don't know what I was thinking!). Have corrected the answer. – dotslash Jul 25 '13 at 18:45