# $a$ is not equal to $b$. How to express it in predicate logic notation

Suppose I have an Excel (or a csv) file with 2 columns: $a$ and $b$.

For each row I would like to forbid the following: $a\neq b$.

So for instance in row 1 I cannot have $a=3$ and $b=3$. However, the question is not how to implement it in Excel. The question is how to use the correct math notation to express this constraint.

Let's suppose the type of a and b are integers.

I don't understand how to formulate such a restriction using predicate logic math notation.

Here are all possible permutations assuming $a\neq b \leftrightarrow b\neq a$:

$\forall a\thinspace\exists b\,\left(a\neq b\right)$

$\forall b\thinspace\exists a\,\left(a\neq b\right)$

$\exists a\thinspace\forall b\,\left(a\neq b\right)$

$\exists b\thinspace\forall a\,\left(a\neq b\right)$

$\exists a\thinspace\exists b\,\left(a\neq b\right)$

$\forall a\thinspace\forall b\,\left(a\neq b\right)$

I have the feeling only the 2 following proposition are correct. Am I right?

$\forall a\thinspace\exists b\,\left(a\neq b\right)$

$\forall b\thinspace\exists a\,\left(a\neq b\right)$

• What you've got doesn't make much sense, as $a$ and $b$ don't make any reference to the row they are in, which is critical here. – vadim123 Jan 10 '17 at 1:03
• I think the relevant question here is : why do you want to do that? It might give you the answer you really want. – Patrick Da Silva Jan 10 '17 at 1:06
• @vadim123 In my notation I assume that $a$ and $b$ are supposed to be in the same row. If my assumption is wrong, how how can I express my problem? – S12000 Jan 10 '17 at 1:09
• @PatrickDaSilva for two reasons: 1 for a homework. 2 getting an answer to that question should help me to increase my understanding of predicate-logic. – S12000 Jan 10 '17 at 1:11
• Why are you presupposing that there should be quantifiers on either/both $a$ and $b$? And what thing are you trying to express? If you want to say "the value in A3 and the value in B3 are distinct," and the names of these are $a$ and $b$, you write $a \ne b$. It's silly to write "for all $a$ and for some $b$, $a \ne b$, because you have actual single values for each of $a$ and $b$. Perhaps you can tell us the homework problem, rather than asking us to help you go down the wrong path in solving it. – John Hughes Jan 10 '17 at 1:24

The correct way is not to quantify over $A$ or $B$. The columns $A$ and $B$ are fixed; they are not varying over a domain. What is varying is the row, so we need to quantify over the rows. Let $N$ denote the set of rows. Then what you are trying to express is $$\forall n\in N, An\neq Bn$$
• @timbo in excel, you refer to (for example) the element in the 3rd row of column A as "A3" (no subscript). Since the original question is asking about something in excel, I presume this is why the answer writes "$An$" instead of "$A_n$." – Stahl Jan 10 '17 at 2:22
• @vadim123, thanks for the answer. Just a question. Would it be possible to declare $A$ and $B$ before the constraint $A_n \neq B_n$ ? – S12000 Jan 10 '17 at 12:19