Let's say we have the expression


Which means "for all values of π‘Ž and 𝑏 in the set of integers, if π‘Žπ‘₯ equals 𝑏π‘₯ then π‘Ž must equal 𝑏."

For example, if 4Γ—6=4Γ—6, then 4=4.

However, this does not apply to 0.

For example, 7Γ—0=6Γ—0, but 6β‰ 0.

Is there a way to add to the previous expression a term that says "as long as x doesn't equal 0"?

  • 2
    $\begingroup$ Yes, then we write $\forall a,b\in \Bbb Z$ and for all $x\neq 0$ we have that $ax=bx$ implies $a=b$ by cancelling. $\endgroup$ May 31 at 16:13
  • 1
    $\begingroup$ There are a few ways to do this; in your example, you could instead say $\forall a,b\in\mathbb{Z}, ax=bx\implies (a=b\lor x=0)$ (where $\lor$ is read as "or"), or equivalently $\forall a,b\in\mathbb{Z}, ax=bx\land x\neq0\implies a=b$ (where $\land$ is read as "and"). $\endgroup$
    – Charlie
    May 31 at 16:15
  • $\begingroup$ "a term that says "as long as a or b doesn't equal 0"? Be careful, you want to cancel $x$, which should be nonzero. You don't have to assume anything else on $a$ and $b$. $\endgroup$ May 31 at 16:20
  • $\begingroup$ @DietrichBurde Ah, you're right. Sorry, I meant to say as long as x doesn't equal 0. Thank you for pointing that out! $\endgroup$ May 31 at 16:22
  • 1
    $\begingroup$ @ryang Ah, I see! Thank you for clearing this up! :D $\endgroup$ May 31 at 16:26

2 Answers 2


There is no formal symbol for this. Even if there were, words are usually easier on your reader than formality. So write

If $x \ne 0$ then $ax= bx \implies a =b $.

You could write

$ax= bx \implies a =b $ provided $ x \ne 0$.

but that might make your reader hesitate and wonder until they finished the sentence. It's kinder to state the condition first.

The Ruby programming language has an unless keyword that can follow the statement it references, so you could code something like

you can cancel x unless x is 0
  • $\begingroup$ $\forall \{ a, b, x \} \in \mathbb{R} \wedge x \neq 0, a x = b x \implies a = b.$ $\endgroup$ May 31 at 16:44
  • $\begingroup$ @DavidG.Stork That's correct, of course, but much harder to read than the same thing written out mostly in English. $\endgroup$ May 31 at 16:46
  • $\begingroup$ Or: $βˆ€π‘Ž{,}𝑏{,}x{∈}\mathbb R\;(x\ne0\land π‘Žπ‘₯=𝑏π‘₯βŸΉπ‘Ž=𝑏).$ @DavidG.Stork $\endgroup$
    – ryang
    May 31 at 16:55
  • $\begingroup$ Btw, do "as long as" and "provided that" both simply mean "if", or are there exceptions? Some online dictionaries claim that "as long as" mean "only if", but then again they anyway seem to variously think that "only if" means "if" or sometimes "iff". $\endgroup$
    – ryang
    May 31 at 16:57
  • $\begingroup$ @ryang Yes, but see my response to David Stork. This is all part of my campaign to convince students that "prove it" does not mean "write it using formal logic". $\endgroup$ May 31 at 16:58

You could use "as long as $x$ does not equal $0$" like so:

With $\forall x \neq 0$ at the end:

$βˆ€a,b\in\mathbb{Z}:ax=bx\implies a=b, \forall x \neq 0$

or with $\forall x\in\mathbb{Z}^*$ at the end:

$βˆ€a,b\in\mathbb{Z}:ax=bx\implies a=b, \forall x\in\mathbb{Z}^*$

or with $\forall x\in\mathbb{Z}^*$ at the beggining:

$βˆ€a,b\in\mathbb{Z} \wedge \forall x\in\mathbb{Z}^*:ax=bx\implies a=b$


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .