Basis Lab

Arguing That It Always Holds

And, Or, and Not

Last timeA Claim You Can Test

Three ways of joining claims, two of which behave as expected and one of which does not. The rules for negating a joined claim are the ones people get wrong in writing and in code.

Claims rarely arrive alone. The order is paid and the stock is available. The

user is an administrator or the document is public. The file does not exist.

Three ways of joining, and only two of them behave the way people expect.

FIG 1The three connectives, every case
ABA and BA or Bnot A
both true11110
A true, B false10010
A false, B true01011
both false00001
One in each column means true and nought means false. The table is the complete definition of the three connectives, in the sense that the truth of a compound claim depends on nothing beyond the truth of its parts, which is why checking all four rows is a sufficient check rather than a sample. The marked cell is the one that catches people. With both parts true, A or B is true, because or means at least one. In speech or often means exactly one, as in tea or coffee, and that habit does not survive contact with mathematics or with any programming language.

The inclusive reading is universal in this field, so the rule is to read every

or as at least one. When exactly one is genuinely meant, it has to be said: one

holds and the other fails.

Negating a joined claim

Here is where intuition stops being reliable.

The claim is that the order is paid and the stock is available. What is the

negation? Not that the order is unpaid and the stock is unavailable, which is

much stronger. The negation is that at least one of them failed: either the

order is unpaid, or the stock is unavailable, or both.

The lesson stops here

2 more paragraphs to go

You have read the opening. The rest of the argument, the problems that check whether it landed, and the lines worth keeping at the end all come with a plan.

The first lesson of every course in the library reads the whole way through, free, so you can see exactly what the rest of them are.

See the planThe contents

This is the reading half

Starting the course gives you your own copy of it. Every idea on every page has problems standing under it, marked with a reason rather than a tick, and any sentence you do not believe can be opened and argued with. None of that can happen on a page nobody owns.

The contents

The rest of this course

  1. 01A Claim You Can Test
  2. 02And, Or, and Notyou are here
  3. 03What an Implication Promisesopening only
  4. 04Every, and At Least Oneopening only
  5. 05Collections and What Is In Themopening only
  6. 06Breaking a Claim With One Caseopening only
  7. 07Proving It for Every Numberopening only
  8. 08What This Buys You in Practiceopening only

Read alongside