5.6  Using “There Exists”: Name a Witness

Section 5.5 gave the rule that proves an existential statement: exhibit a witness, and forget it. This section gives the rule that uses one, ∃E. It is the last of the four quantifier rules, and the subtlest, because an existential says that a witness exists without saying which one it is. The rule handles this with a box and a fresh name, as ∀I did, but the name now stands for an object that is not arbitrary, and the side condition keeps it from being treated as if it were. With the rule in hand, the section moves an ∃ past a ∀, and shows exactly where the reverse move breaks down.

5.6.1. Using a witness whose identity is unknown

Chapter 2 proved that if n2 is even then n is even (Theorem 2.1.3). One of the facts it rested on, (E3), says that the square of an odd integer is odd, and it was shown by taking “an integer k with n=2k+1” and computing with it. Chapter 2 noted that naming the k of (E3) lay outside its derivation: it is a quantifier step, whose rule had to wait. Here is the simplest proof with the same step.

If n is even, then n+2 is even. Since n is even, choose an integer k with n=2k. Then n+2=2k+2=2(k+1), so n+2 is even.

The hypothesis is ∃k(n=2⋅k). The proof does not know which integer k is; it does not need to. It gives the unknown witness a name, uses the one fact it has about it, n=2k, and reaches a conclusion, “n+2 is even”, in which the name no longer appears. The witness k+1 of the last step is forgotten by ∃I, as in Section 5.5.

Why is this correct? Two tempting shortcuts show what the proof is careful not to do.

  • It does not name the witness by a term that already means something. From “some integer is even” we may not conclude “3 is even”: the existential does not say that the witness is 3, and, as the warning “∃I runs one way only” of Section 5.5 noted, it cannot be read back as a statement about a named object.
  • It does not let the conclusion mention the name. If it did, the conclusion would be a statement about k, and outside the argument k refers to nothing; the existential promised only that some k works.

So the name must be new, the argument may use only what the existential says about it, and the conclusion must not mention it. Then the argument works for the witness, whichever integer it is, because it never used anything else about it.

5.6.2. The rule of existential elimination

To use “there exists”, give the witness a new name, assume only what the existential says about it, and conclude something that does not mention it.

Definition 5.6.1 (Rules for the Existential Quantifier)
h∃xφ
ix0φ[x0/x]asm, for ∃E
⋮
jχ
kχ∃E h, i–j
iφ[t/x]
k∃xφ∃I i

The rule on the left is ∃E (existential elimination). It cites a line h holding ∃xφ and a flagged box with the name x0, a variable, whose first line is the assumption φ[x0/x] and whose last line j, a line of that box itself, is χ; line h and the box must be available at line k (Definition 1.4.2, with the flagged boxes of Section 5.4). The new line k repeats χ. Side condition, at line k: the name x0 does not appear

  • in χ,
  • in ∃xφ,
  • in any premise, or
  • in any assumption of a box still open at line k.

The rule on the right is ∃I, recalled from Definition 5.5.1: t is any term free for x in φ.

The box of ∃E is the flagged box of Section 5.4 with one difference: it opens with an assumption, φ[x0/x], “x0 is a witness”. The flagged box of ∀I had no assumption, because “let x0 be arbitrary” assumes nothing about x0. The citation “∃E h, i–j” names the line of the existential and the box, as ∨E names its disjunction and its boxes. “Appear” is the word of Section 5.2: written anywhere in the formula, after a quantifier symbol included. In a finished derivation the box’s assumption is printed “asm, for ∃E”; read it as “choose x0 with …”.

In practice, two habits make every clause of the side condition hold: name the witness with a brand-new letter, written nowhere in the derivation so far, and make sure the box’s last line does not mention it. Clauses 3–5 below, the side condition, are the official test, the one a checker runs.

This rule has conditions that matter; read each one.

  1. The assumption. The box assumes φ[x0/x]: the formula of the existential, with the new name in place of x. This is “choose x0 with φ”. It is the only thing the box knows about x0.
  2. The last line. The box ends with χ, a line of the box itself, not of a box inside it, as for ∨E and ∀I. It is “whatever the witness is, χ follows”. The new line k then asserts χ outside the box, where x0 is no longer assumed to be anything.
  3. x0 does not appear in χ. The box shows that χ follows from “x0 is a witness”; if χ mentioned x0, line k would make a claim about a name that, outside the box, is tied to nothing. The subsection “Three ways to break the rule” below shows the damage.
  4. x0 does not appear in a premise or in an assumption of an open box. The name must be new to everything we know at line k. If a premise or an open assumption already said something about x0, the assumption φ[x0/x] would add to it a claim that x0 is the witness, which the existential never made.
  5. x0 does not appear in ∃xφ. The existential must not itself mention the name chosen for its witness. This clause also makes x0 free for x in φ (Section 5.2: a variable that does not appear in φ is free for every variable there), so the assumption φ[x0/x] says of x0 exactly what φ says of x.
  6. “Still open at line k”. The box’s own assumption φ[x0/x] is closed at line k, so it is not among the assumptions checked. This matters: read inside the box, “an open assumption” would include φ[x0/x], which contains x0 whenever x is free in φ, and the rule could then never be applied in the cases that matter.

A first witness: n+2 is even

Here is the proof above as a derivation, over Z, with “n is even” written ∃k(n=2⋅k) and the computation as one line justified “arith” (Section 5.3). The premise is an existential, so its box opens first, aimed at the goal (left); the goal is postponed until a line shows its witness (right).

1∃k(n=2⋅k)
2k0n=2⋅k0asm, for ∃E
⋮
4∃k(n+2=2⋅k)?
5∃k(n+2=2⋅k)?
1∃k(n=2⋅k)
2k0n=2⋅k0asm, for ∃E
3n+2=2⋅(k0+1)arith 2
4∃k(n+2=2⋅k)?
5∃k(n+2=2⋅k)?
1∃k(n=2⋅k)
2k0n=2⋅k0asm, for ∃E
3n+2=2⋅(k0+1)arith 2
4∃k(n+2=2⋅k)∃I 3
5∃k(n+2=2⋅k)∃E 1, 2–4

At line 5, k0 is not in line 4, not in the existential of line 1, which is also the only premise, and no box is open. The derivation and the proof match sentence for sentence:

Line Sentence
1 “Since n is even, …”
box k0, 2 “… choose an integer k with n=2k.”
3 “Then n+2=2k+2=2(k+1), …” (arith)
4 “… so n+2 is even.” (∃I, the witness k+1)
5 (unwritten: the conclusion does not mention k, so the box closes)

Quick check. Could line 5 have been n+2=2⋅(k0+1), closing the box one line earlier?

Solution. No: that line mentions the witness k0, which breaks clause 3. Outside the box k0 names nothing; ∃I must forget it first, as line 4 does.

One box instead of many cases

The long “or” of Section 5.1 shows why the rule has this shape. Over a domain whose elements are named m and n, ∃xP(x) says P(m)∨P(n), and ∨E (Definition 1.6.1) would use it by proving the goal twice, once in each case. The cases look alike, so they can be done once, with a name that could be either.

1P(m)∨P(n)
2∀x(P(x)→Q(f(x)))
3P(m)asm, for ∨E
4P(m)→Q(f(m))∀E 2
5Q(f(m))→E 4, 3
6∃yQ(y)∃I 5
7P(n)asm, for ∨E
8P(n)→Q(f(n))∀E 2
9Q(f(n))→E 8, 7
10∃yQ(y)∃I 9
11∃yQ(y)∨E 1, 3–6, 7–10
1∃xP(x)
2∀x(P(x)→Q(f(x)))
3x0P(x0)asm, for ∃E
4P(x0)→Q(f(x0))∀E 2
5Q(f(x0))→E 4, 3
6∃yQ(y)∃I 5
7∃yQ(y)∃E 1, 3–6

On the left, Section 1.6’s rule over the two named elements; on the right, the same argument by ∃E. Each case box on the left is the box on the right with m or n in place of x0. Because x0 is fresh, one box serves for every element, named or not, and for domains that cannot be listed.

5.6.3. Using an existential: open the box early

When a resource is ∃xφ, the premise-directed step of the search method is to open its ∃E box at once, with a fresh name x0, and to make the box’s last line the current goal. Inside the box, the assumption φ[x0/x] is a new resource, and the name x0 is a new term for later steps to use.

Name the witness early: open the ∃E box as soon as the existential is available, and aim it at the current goal.

Why early? Opening early keeps every resource, since every line available before the box is available inside it; and a box aimed at the current goal can always be closed once the goal is reached, since its name was chosen fresh. What the early box gives is the witness’s name, often exactly the term a postponed ∃ goal is waiting for.

Second readingWhy opening early is safe

And a box aimed at the current goal χ can always be closed once χ is reached: x0 is chosen, when the box opens, to appear in no premise, in no open assumption, not in ∃xφ and not in the current goal χ. The assumptions still open at the line that closes the box are the ones that were open when it opened, so every clause of the side condition holds there. (One caution: a ∀I inside the box needs a flag that does not appear in the new assumption; a flag that is fresh at that point has this property.)

The first result is the derivation that this step writes almost by itself.

Proposition 5.6.1 (Some Distributes Over And, One Way)

∃x(P(x)∧Q(x))⊢∃xP(x)∧∃xQ(x).

Idea. The premise is an existential, so open its box first, with a fresh x0, and aim it at the goal. Inside, the assumption P(x0)∧Q(x0) splits by ∧E, and each half is an instance of one conjunct of the goal, with the witness x0. The goal does not mention x0, so the box closes.

1∃x(P(x)∧Q(x))
2x0P(x0)∧Q(x0)asm, for ∃E
⋮
7∃xP(x)∧∃xQ(x)?
8∃xP(x)∧∃xQ(x)?
1∃x(P(x)∧Q(x))
2x0P(x0)∧Q(x0)asm, for ∃E
3P(x0)∧E 2
4∃xP(x)?
5Q(x0)∧E 2
6∃xQ(x)?
7∃xP(x)∧∃xQ(x)∧I 4, 6
8∃xP(x)∧∃xQ(x)?

Proof. The following is a derivation.

1∃x(P(x)∧Q(x))
2x0P(x0)∧Q(x0)asm, for ∃E
3P(x0)∧E 2
4∃xP(x)∃I 3
5Q(x0)∧E 2
6∃xQ(x)∃I 5
7∃xP(x)∧∃xQ(x)∧I 4, 6
8∃xP(x)∧∃xQ(x)∃E 1, 2–7

Line 2 is the assumption φ[x0/x] for φ=P(x)∧Q(x). Lines 4 and 6 are ∃I with the witness x0. At line 8, x0 does not appear in line 7, in line 1 (which is also the only premise), or in any assumption of an open box (none is open). So line 8 is a correct ∃E, and the derivation has 8 lines.

Notice where the witness went. It was used twice inside the box, as the witness of two different existentials, and then forgotten twice. The conclusion records that something has P and something has Q, and no longer that it is the same thing.

Quick check. Is ∃xP(x)∧∃xQ(x)⊢∃x(P(x)∧Q(x))? Run the search, and say where it stalls.

Solution. The premise splits by ∧E into ∃xP(x) and ∃xQ(x). Opening both boxes early gives the assumptions P(x0) and, for the second box, a different name, Q(y0): the second box is opened while the first is open, so x0 appears in an open assumption and may not be reused. The postponed goal ∃x(P(x)∧Q(x)) needs one term t with P(t)∧Q(t), and the resources speak of two names, with nothing to say that they are equal. The search stalls there. It must: over Z, with P as “even” and Q as “odd”, the premise is true and the conclusion, “some integer is both even and odd”, is false. That is a counter-reading (Section 5.3).

5.6.4. Three ways to break the rule

Each of clauses 3, 4 and 5 can be seen failing, and each failure leads from premises that are true, under the reading given, to a false line. Here is clause 3, beside a correct use of the same premise; the fold after it breaks clauses 4 and 5.

The conclusion clause (3). Over N, “some number exceeds 5” is true. Let the ∃E box end in the line x0>5, which mentions its own witness:

1∃x(x>5)
2x0x0>5asm, for ∃E
3x0>5∃E 1, 2–2
4x0x0>5R 3
5∀x(x>5)∀I 4–4
1∃x(x>5)
2x0x0>5asm, for ∃E
3x0+1>6arith 2
4∃x(x>6)∃I 3
5∃x(x>6)∃E 1, 2–4

Line 3 breaks clause 3. Every other line is legal: in particular line 5 is a correct ∀I, since x0 appears in no premise and in no open assumption (there is none), and not in line 5. Over N the conclusion says that every number exceeds 5, which is false at 0. Once the name leaves its box, it can be generalized over as if it were arbitrary.

On the right, a correct use of the same premise: the box ends in ∃x(x>6), which forgets the witness before the box closes, and the conclusion is true over N.

Diagram. Labels: x_0

A small world in which the premise is true and the line that breaks clause 3 is false. The label “>5” is the one-place predicate x>5 (5 is not a dot); the dashed arrow gives x0 the value 0. The premise is true (at 6); line 3, x0>5, is false; so is line 5 (at 0).

Quick check. In the clause-3 derivation, line 5 is a correct ∀I, yet it is false in the picture. Which line is to blame, and why does a correct step not save the derivation?

Solution. Line 3, which closes the ∃E box with a line that mentions its witness. ∀I is safe only when the last line of its box, here line 4, is true whatever x0 names. Line 4 is copied from line 3, and both are false when x0 names 0. So line 5 inherits the error from line 3; it is not a new one.

Second readingClauses 4 and 5, broken

The premise clause (4). Over N, with P read as “even” and the variable x0 read as 1, both premises below are true: some number is even, and 1 is not even.

1∃xP(x)
2¬P(x0)
3x0P(x0)asm, for ∃E
4⊥¬E 3, 2
5⊥∃E 1, 3–4

Line 5 breaks clause 4: x0 appears in the premise on line 2. The box assumed that x0, which the premise had already described as odd, is the even witness, and derived a contradiction from that assumption, not from the premises.

The existential clause (5). Over Z, with R(x,y) read as “x<y”, the premise below says that every integer has a smaller one: true.

1∀y∃xR(x,y)
2∃xR(x,x0)∀E 1
3x0R(x0,x0)asm, for ∃E
4∃zR(z,z)∃I 3
5∃zR(z,z)∃E 2, 3–4

Line 2 is a legal ∀E at the term x0. Line 5 breaks clause 5: the existential on line 2 is ∃xφ with φ=R(x,x0), and x0 appears in it. The assumption φ[x0/x] on line 3 is R(x0,x0): the box has assumed that the witness smaller than x0 is x0 itself. The conclusion says that some integer is less than itself, which is false. The other clauses hold at line 5: x0 is not in ∃zR(z,z), not in the premise, and no box is open.

Diagram. Labels: x_0

Two small worlds, one per clause: in each, the premises are true and the line that breaks the clause is false. Left, clause 4: the dots 1 and 2, with P (“even”) true at 2 only, and x0 naming 1; both premises, ∃xP(x) and ¬P(x0), are true, and the line ⊥ is false, as always. Right, clause 5: three dots, an arrow from u to v meaning R(u,v); the premise ∀y∃xR(x,y) is true, since every dot has an arrow into it, and the line ∃zR(z,z) is false, since there is no loop.

A fourth illegal pattern, a second witness given a name that an open assumption already uses, is the error of the warning “Two witnesses, one name” below.

Warning. The witness is not arbitrary. The flagged boxes of ∀I and ∃E look alike: both introduce a fresh name. Their names mean opposite things. In a ∀I box, x0 is any object, and what is proved about it holds for all. In an ∃E box, x0 is one particular object, the witness, about which we know φ[x0/x] and nothing else; what is proved about it holds for it alone. From “some integer is even” nothing follows about every integer, and the rules agree:

1∃xP(x)
2x0P(x0)asm, for ∃E
3x0P(x0)R 2
4∀xP(x)∀I 3–3
5∀xP(x)∃E 1, 2–4

Line 4 is blocked: x0 appears in the assumption P(x0) of the ∃E box, which is still open at line 4. That clause of ∀I is what keeps a witness from being generalized over inside its box; clause 3 of ∃E, that x0 not appear in χ, keeps it from leaving the box (the derivation for clause 3 above).

Here are three more derivations, each with an Idea saying why each rule was chosen: two for part (a), one for each direction, and one for part (b).

Example (Derivations with existential elimination)

Show that:

  • (a) ∃x(P(x)∨Q(x))⊣⊢∃xP(x)∨∃xQ(x);
  • (b) ∃xP(x), ∀x(P(x)→¬Q(x))⊢¬∀xQ(x).

Solution.

  • (a) (⊢) Idea. The premise is an existential: open its box first. Inside, the assumption P(x0)∨Q(x0) is a disjunction, and the premise-directed step for ∨ (Section 1.6) opens two cases, each ending in the current goal. In each case one side of the goal has an instance with the witness x0, so ∃I and ∨I finish it.
    1∃x(P(x)∨Q(x))
    2x0P(x0)∨Q(x0)asm, for ∃E
    ⋮
    9∃xP(x)∨∃xQ(x)?
    10∃xP(x)∨∃xQ(x)?
    1∃x(P(x)∨Q(x))
    2x0P(x0)∨Q(x0)asm, for ∃E
    3P(x0)asm, for ∨E
    ⋮
    5∃xP(x)∨∃xQ(x)?
    6Q(x0)asm, for ∨E
    ⋮
    8∃xP(x)∨∃xQ(x)?
    9∃xP(x)∨∃xQ(x)∨E 2, 3–5, 6–8
    10∃xP(x)∨∃xQ(x)?
    1∃x(P(x)∨Q(x))
    2x0P(x0)∨Q(x0)asm, for ∃E
    3P(x0)asm, for ∨E
    4∃xP(x)∃I 3
    5∃xP(x)∨∃xQ(x)∨I 4
    6Q(x0)asm, for ∨E
    7∃xQ(x)∃I 6
    8∃xP(x)∨∃xQ(x)∨I 7
    9∃xP(x)∨∃xQ(x)∨E 2, 3–5, 6–8
    10∃xP(x)∨∃xQ(x)∃E 1, 2–9

    Line 9 is ∨E (Definition 1.6.1), and it is the last line of the ∃E box itself. At line 10, x0 is in neither line 9 nor line 1, and no box is open.

    (⊣) Idea. Now the premise is a disjunction: ∨E first, with two cases, each ending in the goal. In each case the resource is an existential, so its box opens at once, and inside it ∨I and ∃I build the goal.

    1∃xP(x)∨∃xQ(x)
    2∃xP(x)asm, for ∨E
    ⋮
    6∃x(P(x)∨Q(x))?
    7∃xQ(x)asm, for ∨E
    ⋮
    11∃x(P(x)∨Q(x))?
    12∃x(P(x)∨Q(x))∨E 1, 2–6, 7–11
    1∃xP(x)∨∃xQ(x)
    2∃xP(x)asm, for ∨E
    3x0P(x0)asm, for ∃E
    ⋮
    5∃x(P(x)∨Q(x))?
    6∃x(P(x)∨Q(x))∃E 2, 3–5
    7∃xQ(x)asm, for ∨E
    8x0Q(x0)asm, for ∃E
    ⋮
    10∃x(P(x)∨Q(x))?
    11∃x(P(x)∨Q(x))∃E 7, 8–10
    12∃x(P(x)∨Q(x))∨E 1, 2–6, 7–11
    1∃xP(x)∨∃xQ(x)
    2∃xP(x)asm, for ∨E
    3x0P(x0)asm, for ∃E
    4P(x0)∨Q(x0)∨I 3
    5∃x(P(x)∨Q(x))∃I 4
    6∃x(P(x)∨Q(x))∃E 2, 3–5
    7∃xQ(x)asm, for ∨E
    8x0Q(x0)asm, for ∃E
    9P(x0)∨Q(x0)∨I 8
    10∃x(P(x)∨Q(x))∃I 9
    11∃x(P(x)∨Q(x))∃E 7, 8–10
    12∃x(P(x)∨Q(x))∨E 1, 2–6, 7–11

    At line 6, the open assumption is line 2, which does not contain x0; at line 11 it is line 7, which does not either. The name x0 is used in both cases. That is allowed: when the second box opens, the first has closed, and the side condition looks only at the premises, the boxes still open, the existential and the conclusion. Lines 6 and 11 are lines of the two case boxes themselves, as ∨E requires.

    The two derivations mirror each other: ∃E outside and ∨E inside in one, the other way round in the other. Over a domain, both sides say that some element has P or Q. Contrast Proposition 5.6.1, where only one direction holds: ∃ passes through ∨ in both directions and through ∧ in one.

  • (b) Idea. The goal is a negation, so the goal-directed step of Section 2.2 opens a ¬I box on ∀xQ(x) (Definition 2.2.1), with the goal ⊥. Then the premise ∃xP(x) opens its box, aimed at ⊥. Inside, the witness x0 is the term at which to instantiate both universal statements: the premise gives ¬Q(x0), and the assumption gives Q(x0), a clash.
1∃xP(x)
2∀x(P(x)→¬Q(x))
3∀xQ(x)asm, for ¬I
⋮
9⊥?
10¬∀xQ(x)¬I 3–9
1∃xP(x)
2∀x(P(x)→¬Q(x))
3∀xQ(x)asm, for ¬I
4x0P(x0)asm, for ∃E
⋮
8⊥?
9⊥∃E 1, 4–8
10¬∀xQ(x)¬I 3–9
1∃xP(x)
2∀x(P(x)→¬Q(x))
3∀xQ(x)asm, for ¬I
4x0P(x0)asm, for ∃E
5P(x0)→¬Q(x0)∀E 2
6¬Q(x0)→E 5, 4
7Q(x0)∀E 3
8⊥¬E 7, 6
9⊥∃E 1, 4–8
10¬∀xQ(x)¬I 3–9

At line 9, the box of line 3 is still open, so its assumption ∀xQ(x) is checked: x0 does not appear in it. Nor is x0 in ⊥, in line 1, or in line 2. Read over Z with P as “odd” and Q as “divisible by 4”: some integer is odd, no odd integer is divisible by 4, so not every integer is divisible by 4. The witness, whichever odd integer it is, is a counterexample to “every integer is divisible by 4”, and the derivation never needs to know which.

5.6.5. Moving one quantifier past another

Section 5.1 read ∃y∀xφ and ∀x∃yφ as games, and observed that the first gives the second: if one y works for every x, then for every x some y works, namely the same one. Here is that observation as a derivation, with the letters of a two-place predicate. It shows, written out in full, a pattern that later derivations of the chapter use again and again and that later exercises leave more and more of to the reader.

Proposition 5.6.2 (Some-All Gives All-Some)

∃x∀yR(x,y)⊢∀y∃xR(x,y).

Idea. Three moves, read off the goal and the premise.

① Fix. The goal is ∀y: open a flagged box with a fresh y0 (Section 5.4); the new goal is ∃xR(x,y0).

② Obtain. That goal is an existential: postpone it. The premise is an existential: open its box early, with a fresh x0, assuming ∀yR(x0,y), and aim it at the current goal ∃xR(x,y0). Instantiate the assumption at the term the goal mentions, y0: this gives R(x0,y0).

③ Choose. That line is an instance of the postponed goal, with the witness x0: ∃I.

In the Givens/Goal table:

Givens Goal
∃x∀yR(x,y) ∀y∃xR(x,y)
+ the fresh name y0 (fix: ∀I opens a box) ∃xR(x,y0): postponed
+ the witness x0 and ∀yR(x0,y) (obtain: ∃E opens a box) ∃xR(x,y0)
+ R(x0,y0) (∀E at y0) ∃xR(x,y0) ✓ by ∃I, the witness x0 (choose)
1∃x∀yR(x,y)
y0⋮
5∃xR(x,y0)?
6∀y∃xR(x,y)?
1∃x∀yR(x,y)
2y0x0∀yR(x0,y)asm, for ∃E
⋮
4∃xR(x,y0)?
5∃xR(x,y0)∃E 1, 2–4
6∀y∃xR(x,y)?

Before reading on: at the line that closes the ∃E box, check each clause of its side condition. Where could x0 still appear?

Proof. The following is a derivation.

1∃x∀yR(x,y)
2y0x0∀yR(x0,y)asm, for ∃E
3R(x0,y0)∀E 2
4∃xR(x,y0)∃I 3
5∃xR(x,y0)∃E 1, 2–4
6∀y∃xR(x,y)∀I 2–5

Line 2 is the assumption φ[x0/x] for φ=∀yR(x,y). Line 3 is ∀E at y0. Line 4 is ∃I with φ=R(x,y0) and the witness x0, which is free for x since R(x,y0) has no quantifier.

Line 5 closes the ∃E box, whose last line, line 4, is a line of the box itself. Its side condition holds: x0 does not appear in χ=∃xR(x,y0), nor in the existential ∃x∀yR(x,y) of line 1, which is also the only premise; and the one box still open at line 5, the flagged box of y0, has no assumption.

Line 6 closes the flagged box of y0 by ∀I (Definition 5.4.1). That box immediately contains the ∃E box, so its range starts at line 2 (the convention of Section 5.4), and its last line, line 5, is a line of the box itself, the instance (∃xR(x,y))[y0/y]. The name y0 appears neither in the premise nor in line 6, and at line 6 no box is open. This proves the proposition.

The two names played opposite parts. The name y0 is arbitrary: nothing was assumed about it, and line 6 generalizes over it. The name x0 is the witness: line 2 assumed everything the premise says about it, and line 5 forgets it. The witness x0 works for y0 because it works for every y, which line 2 says. This is the shape of a great many proofs in analysis, and it has a name.

Fix, obtain, choose: fix the arbitrary objects of the goal (∀I); obtain witnesses from the hypotheses (∀E and ∃E); choose the goal’s witness from what is now available (∃I).

Nothing in the proof used that the formula is R(x,y): the same six lines derive ∃x∀yφ⊢∀y∃xφ for any formula φ, which is the derivation promised in Section 5.1; the fold checks the substitutions.

Second readingThe swap for any formula

For any formula φ and different variables x and y, with different names x0 and y0, other than x and y, that do not appear in φ, the same six lines derive ∃x∀yφ⊢∀y∃xφ. Line 2 is ∀y(φ[x0/x]). Line 3 is (φ[x0/x])[y0/y], which equals (φ[y0/y])[x0/x], since the two substitutions put fresh names in for two different variables and so do not interfere; so line 4 is ∃I with the formula φ[y0/y] and the witness x0. The fresh names are free for their variables, since neither appears in φ, and the side conditions are checked as before. With the letters x and y exchanged, this is the derivation of ∃y∀xφ to ∀x∃yφ promised in Section 5.1.

Second readingEither nesting works

Either nesting works. The derivation opened the flagged box of y0 first and the ∃E box inside it. The other order is just as good.

1∃x∀yR(x,y)
2x0∀yR(x0,y)asm, for ∃E
3y0R(x0,y0)∀E 2
4∃xR(x,y0)∃I 3
5∀y∃xR(x,y)∀I 3–4
6∀y∃xR(x,y)∃E 1, 2–5

At line 5, y0 appears neither in the premise, nor in the open assumption ∀yR(x0,y) (its y is a bound variable, not y0), nor in line 5. At line 6, x0 is not in line 5, not in line 1, and no box is open. In this order the ∃E box is aimed at the whole goal; in the first, at the goal left inside the flagged box. Both are the search method’s “open the box early”: early relative to the goal that the box must reach.

The converse search stalls at a side condition. Try ∀y∃xR(x,y)⊢∃x∀yR(x,y). The goal is an existential: postpone it; it will need a witness x0 and a line ∀yR(x0,y). The premise is a universal, and to get an existential out of it we must instantiate it at some term. The natural routes then meet a side condition. Here are two of them.

First route: obtain the witness, then try to generalize. Instantiate at a name y0, open the ∃E box on the result, and try to prove ∀yR(x0,y) inside it by ∀I:

1∀y∃xR(x,y)
2∃xR(x,y0)∀E 1
3x0R(x0,y0)asm, for ∃E
4y0R(x0,y0)R 3
5∀yR(x0,y)∀I 4–4
6∃x∀yR(x,y)∃I 5
7∃x∀yR(x,y)∃E 2, 3–6

Line 5 is blocked: y0 appears in the assumption R(x0,y0) of the ∃E box, which is still open. The witness x0 was obtained for y0, and the assumption says so. Choosing a different flag, say z0, does not help: the goal inside its box would be R(x0,z0), and nothing gives it.

Second route: fix first, obtain inside, and carry the witness out. Open the flagged box of y0 first, obtain x0 inside it, and try to close the ∃E box with a line about x0, so that ∀I can then generalize over y0:

1∀y∃xR(x,y)
2y0∃xR(x,y0)∀E 1
3x0R(x0,y0)asm, for ∃E
4R(x0,y0)∃E 2, 3–3
5∀yR(x0,y)∀I 2–4
6∃x∀yR(x,y)∃I 5

Line 4 is blocked: x0 appears in χ=R(x0,y0). Lines 5 and 6 would be legal on their own; the derivation fails only because the witness escaped its box at line 4.

The two blocked lines are the two halves of one fact. The witness x0 is obtained after y0 is fixed, so it may depend on y0; the conclusion asks for an x0 chosen before any y, which may not. This is the dependence that Section 5.1 read off the order of the quantifiers, now visible as the order of the boxes. A stalled search is not a proof that no derivation exists. A counter-reading breaks the claim: two dots 0 and 1, with R(x,y) read as “x differs from y”. Each dot has a dot that differs from it, so the premise is true; no dot differs from both dots, itself included, so the conclusion is false.

Second readingRenaming the bound variable of an existential

Renaming the bound variable of an existential. Section 5.2 promised that a bound variable at the front of a formula may be renamed, and Section 5.4 derived the renaming for ∀ (the fold after Example (Flagged boxes at work)). Here is the derivation for ∃. Let φ be a formula and y, z variables, with z not appearing in φ. Then ∃yφ⊣⊢∃zφ[z/y]. Take a fresh name z0, a variable different from y and z that does not appear in φ, as in Section 5.4. Both directions use one fact about substitution: since z does not appear in φ, each free z of φ[z/y] stands where φ had a free y, and nowhere else, so putting a term t in for those z’s gives φ[t/y]; that is, (φ[z/y])[t/z]=φ[t/y]. (It is a structural induction of the kind in Section 5.2, one clause at a time.)

1∃yφ
2z0φ[z0/y]asm, for ∃E
3∃zφ[z/y]∃I 2
4∃zφ[z/y]∃E 1, 2–3
1∃zφ[z/y]
2z0φ[z0/y]asm, for ∃E
3∃yφ∃I 2
4∃yφ∃E 1, 2–3

In the left derivation, line 3 is ∃I with the formula φ[z/y], the variable z and the witness z0: by the fact, (φ[z/y])[z0/z] is line 2. The witness is free for z, because the quantifiers of φ[z/y] are those of φ, and none of them is on z0. In the right derivation, line 2 is the assumption of the box for the existential ∃zφ[z/y], which is (φ[z/y])[z0/z], that is φ[z0/y] by the fact, and line 3 is ∃I with φ, y and the witness z0, which is free for y since it does not appear in φ. In both, line 4 is a correct ∃E: z0 does not appear in φ, so it is in neither line 1 nor line 3, and no box is open.

So ∃y(y≠x) and ∃z(z≠x) can each be derived from the other, as the recipe of Section 5.2 assumed.

5.6.6. Two witnesses

A proof often obtains several witnesses, one from each existential hypothesis. Each needs its own box and its own name.

Example (The sum of two even integers is even)

Over Z, with “n is even” written ∃k(n=2⋅k), derive ∃k(n=2⋅k), ∃k(m=2⋅k)⊢∃k(n+m=2⋅k).

Solution. Idea. Both premises are existentials: open both boxes early, the second inside the first, with different names k0 and l0. The goal is an existential: postpone it. Inside both boxes the resources are n=2⋅k0 and m=2⋅l0, and arithmetic gives n+m=2⋅(k0+l0), which shows the witness: the compound term k0+l0.

1∃k(n=2⋅k)
2∃k(m=2⋅k)
3k0n=2⋅k0asm, for ∃E
⋮
7∃k(n+m=2⋅k)?
8∃k(n+m=2⋅k)?
1∃k(n=2⋅k)
2∃k(m=2⋅k)
3k0n=2⋅k0asm, for ∃E
4l0m=2⋅l0asm, for ∃E
⋮
6∃k(n+m=2⋅k)?
7∃k(n+m=2⋅k)∃E 2, 4–6
8∃k(n+m=2⋅k)?
1∃k(n=2⋅k)
2∃k(m=2⋅k)
3k0n=2⋅k0asm, for ∃E
4l0m=2⋅l0asm, for ∃E
5n+m=2⋅(k0+l0)arith 3, 4
6∃k(n+m=2⋅k)∃I 5
7∃k(n+m=2⋅k)∃E 2, 4–6
8∃k(n+m=2⋅k)∃E 1, 3–7

Line 5 is one line of arithmetic: from n=2k0 and m=2l0, substituting and factoring gives n+m=2k0+2l0=2(k0+l0). The substitutions are steps of the rule =E, which arrives only in Section 5.7, so here the whole calculation is one line justified “arith”, citing the two lines it uses. Line 6 is ∃I with φ=(n+m=2⋅k) and the witness k0+l0.

At line 7 the only box still open is the outer one, whose assumption is line 3; l0 appears neither in it, nor in the premises on lines 1 and 2 (line 2 is also the existential cited), nor in line 6. At line 8, k0 appears neither in line 7, nor in the premises (line 1 is the existential cited), and no box is open. The derivation has 8 lines. The written proof is three sentences: Choose k with n=2k, and l with m=2l. Then n+m=2(k+l). So n+m is even.

Quick check. Why must the second witness in Example (The sum of two even integers is even) be called l0, and not k0 again? Name the line and the clause of the side condition that a second k0 would break.

Solution. The inner box would then be flagged k0 with the assumption m=2⋅k0, and line 7 would close it by ∃E. At line 7 the outer box is still open, and its assumption n=2⋅k0 (line 3) contains k0. That breaks the clause “x0 does not appear in any assumption of a box still open at line k”. In words: the second witness would be assumed to be the same integer as the first, so n and m would be forced equal, which the premises never said.

5.6.7. A contradiction trapped in a box

An ∃E box may end in ⊥. The contradiction is found inside the box, about the witness, and leaves it as ⊥, which mentions no name. The best-known instance is a theorem of pure logic.

Theorem 5.6.3 (The Barber)

For every two-place predicate symbol R, ⊢¬∃y∀x(R(x,y)↔¬R(x,x)).

Try it first (five minutes): the goal is a negation.

Idea. The goal is a negation: open a ¬I box on the existential, aimed at ⊥. Its assumption is an existential: name the witness early, y0, aiming the ∃E box at the same ⊥. Inside, an attempt that instantiates the universal at some other term t gets R(t,y0)↔¬R(t,t), and nothing clashes with it; the one term that makes both sides speak of the same thing is y0 itself. The instance says that R(y0,y0) holds exactly when it does not, and a statement equivalent to its own negation is contradictory (Lemma 2.4.2).

1∃y∀x(R(x,y)↔¬R(x,x))asm, for ¬I
⋮
10⊥?
11¬∃y∀x(R(x,y)↔¬R(x,x))?
1∃y∀x(R(x,y)↔¬R(x,x))asm, for ¬I
2y0∀x(R(x,y0)↔¬R(x,x))asm, for ∃E
⋮
9⊥?
10⊥∃E 1, 2–9
11¬∃y∀x(R(x,y)↔¬R(x,x))?

Proof. The following is a derivation with no premises.

1∃y∀x(R(x,y)↔¬R(x,x))asm, for ¬I
2y0∀x(R(x,y0)↔¬R(x,x))asm, for ∃E
3R(y0,y0)↔¬R(y0,y0)∀E 2
4R(y0,y0)asm, for ¬I
5¬R(y0,y0)↔E 3, 4
6⊥¬E 4, 5
7¬R(y0,y0)¬I 4–6
8R(y0,y0)↔E 3, 7
9⊥¬E 8, 7
10⊥∃E 1, 2–9
11¬∃y∀x(R(x,y)↔¬R(x,x))¬I 1–10

Lines 4–9 are lines 2–7 of the derivation of Lemma 2.4.2 at the statement R(y0,y0), with line 3 in place of its assumption. At line 10, y0 is not in ⊥, not in the existential of line 1 (its y is bound), and there is no premise; the only open assumption, line 1, does not contain y0. This proves the theorem.

Read R(x,y) as “y shaves x”: nobody shaves exactly those who do not shave themselves. The old puzzle of the barber who does is answered by this theorem: there is no such barber. Read the domain as consisting of sets and R(x,y) as x∈y: no set has as its elements exactly the sets that are not elements of themselves. For sets this is Russell’s theorem, which Sets, Relations, and Cardinality, Section 1.1 proves as a theorem about sets. Neither reading was used in the proof, which holds for every R; the “paradox” is eleven lines of logic, and its conclusion is that something does not exist.

Quick check. In the proof of Theorem 5.6.3, lines 3–9 are all about y0. Why may line 10 close the ∃E box?

Solution. Its last line, ⊥, does not mention y0 (clause 3); y0 appears in no premise and in no open assumption (line 1’s y is bound), and not in the existential of line 1 (clauses 4 and 5).

5.6.8. How this rule looks in a mathematical proof

In a written proof, the ∃E box is announced by “choose”, “let x0 be such a point”, “say n=2k”, “fix such a k”. The assumption of the box is the property in the sentence, and the rest of the paragraph is the inside of the box. The claim the paragraph ends on, usually the clause after the final “so”, must not mention the chosen name, though the computation leading up to it may. If that claim still mentions the name, the paragraph has not finished: a later step must reach a claim without the name before the box can close, often an ∃I that forgets it (as in the example below), or a contradiction ⊥ (as in Example (Derivations with existential elimination) (b)).

Second readingA bounded sequence, rule by rule

Here is an instance from analysis. A sequence (an) is bounded if there is an M with |an|≤M for every n∈N. A proof says:

Since (an) is bounded, choose M with |an|≤M for all n∈N. Then |2an|=2|an|≤2M for all n∈N, so (2an) is bounded.

With the domain R, the sequence as a function symbol a, and the bound on n written out by Definition 5.1.1, the proof is this derivation.

1∃M∀n(n∈N→|an|≤M)
2M0∀n(n∈N→|an|≤M0)asm, for ∃E
3n0n0∈Nasm, for →I
4n0∈N→|an0|≤M0∀E 2
5|an0|≤M0→E 4, 3
6|2⋅an0|≤2⋅M0arith 5
7n0∈N→|2⋅an0|≤2⋅M0→I 3–6
8∀n(n∈N→|2⋅an|≤2⋅M0)∀I 3–7
9∃M∀n(n∈N→|2⋅an|≤M)∃I 8
10∃M∀n(n∈N→|2⋅an|≤M)∃E 1, 2–9

The sentences match the boxes. “Choose M” opens the ∃E box (line 2). “For all n∈N” in the second sentence is the flagged box of n0 with its →I box (lines 3–7, closed by line 8); the arithmetic |2an|=2|an|≤2M is line 6. “So (2an) is bounded” is two steps: ∃I with the witness 2⋅M0 (line 9), which forgets the bound 2M, and the close of the box (line 10). The conclusion mentions neither M0 nor 2⋅M0, as the side condition requires.

Warning. Two witnesses, one name. “Let n and m be even, say n=2k and m=2k” is a common error in parity proofs. It gives two unknown witnesses the same name, and the rest of the proof then uses an equation the premises never gave. For instance it “proves” that the sum of two even integers is divisible by 4:

1∃k(n=2⋅k)
2∃k(m=2⋅k)
3k0n=2⋅k0asm, for ∃E
4k0m=2⋅k0asm, for ∃E
5n+m=4⋅k0arith 3, 4
6∃k(n+m=4⋅k)∃I 5
7∃k(n+m=4⋅k)∃E 2, 4–6
8∃k(n+m=4⋅k)∃E 1, 3–7

Line 7 is blocked: k0 appears in the assumption n=2⋅k0 of the outer box, still open at line 7. With n=2 and m=4, both premises are true and n+m=6 is not divisible by 4.

5.6.9. The four quantifier rules on one card

Example (Instances of ∃E)
The existential The box’s assumption (name) The box’s last line The new line
∃k(m=2⋅k+1) m=2⋅k0+1 (k0) ∃j(m+1=2⋅j) ∃j(m+1=2⋅j)
∃y(R(f(c),y)∧∀zR(y,z)) R(f(c),u0)∧∀zR(u0,z) (u0) ∃yR(y,y) ∃yR(y,y)
∃δ(δ>0∧δ<ε) δ0>0∧δ0<ε (δ0) ε>0 ε>0

Inside each box the last line is reached from the assumption (in the first by arith, m+1=2⋅(k0+1), and ∃I; in the second by ∧E, ∀E at u0 and ∃I; in the third by arith from 0<δ0<ε), and none mentions its name.

Not an instance. From ∃xR(x,c), a box that opens with R(c,x0): the assumption must be φ[x0/x]=R(x0,c); R(c,x0) assumes the witness stands on the other side of c, which the existential never said.

Chapters 1 and 2’s thirteen rules are on the card at the end of Section 3.1. Here are the four quantifier rules, with their side conditions. Section 5.7 collects the whole table, and nothing later depends on the last column.

Rule Shape Side condition You write Lean
∀E ∀xφ ⟹ φ[t/x] t free for x in φ “In particular, for x=t, …”; “applying the hypothesis to t, …” h t (or specialize h t)
∀I box [x0] … φ[x0/x] ⟹ ∀xφ x0 in no premise, in no open assumption, not in ∀xφ “Let x be arbitrary. … Since x was arbitrary, …” intro x
∃I φ[t/x] ⟹ ∃xφ t free for x in φ “Take x=t. Then …”; “2k+1 will do.” use t (or Exists.intro t h)
∃E ∃xφ, box [x0] φ[x0/x] … χ ⟹ χ x0 not in χ, not in ∃xφ, in no premise, in no open assumption “Choose k with n=2k. Then …”; “let x0 be such a point.” obtain (or Exists.elim h)
Second readingChoosing a name

The phrase “choose” is apt and slightly misleading. We do not choose the witness, since we cannot see it; we choose a name for it. A written proof that says “choose k” promises the reader that nothing more about k will be used than the property stated, and that k will be gone by the end of the argument.

Warning (Not allowed: ∃E).

  • “Close the box on a line that mentions its witness”: clause 3 (the pair in “Three ways to break the rule”).
  • “Name the witness with a letter that a premise or an open assumption mentions”: clause 4 (the fold “Clauses 4 and 5, broken”; the warning “Two witnesses, one name”).
  • “Name the witness with a letter that the existential mentions”: clause 5 (the fold “Clauses 4 and 5, broken”).
  • “Open the box with an assumption other than φ[x0/x]”: clause 1 (“Not an instance” in Example (Instances of ∃E)).

The decision chart grows by two rows:

Main symbol As the goal (goal-directed) As an available line (premise-directed)
∀xφ open a flagged box with a brand-new name x0; its last line is φ[x0/x]; close with ∀I instantiate at the term the goal, or another line, names (∀E)
∃xφ postpone; use ∃I once a line shows an instance φ[t/x] open the ∃E box at once, with a brand-new witness name, aimed at the current goal

The connective rows are the table of moves in Section 3.1.

The search method: one more step. With this rule, each of the four quantifier rules has added a step.

  • Premise ∃xφ. Open the ∃E box early, as soon as the existential is available, with a fresh name x0 and the assumption φ[x0/x]; make its last line the current goal, which must not mention x0. Give every new witness a new name.

In the Givens/Goal table, ∃E puts a witness among the Givens, its name and its assumption φ[x0/x], and leaves the goal as it was.

Remark (Looking ahead). A derivation with n existential premises opens n boxes and names n witnesses, one choice per box. Sets, Relations, and Cardinality, Chapter 3 asks when infinitely many witnesses may be chosen at once, and answers with the axiom of choice.

5.6.10. Exercises

A. Check your understanding

Exercise (A1)

These parts are about the proof of Proposition 5.6.2.

  • (a) State ∃E as a schema, with every clause of its side condition.
  • (b) The proof opened the flagged box of y0 first and the ∃E box of x0 inside it. Could they be opened in the other order? If so, does every side condition still hold?
  • (c) Answer the Before reading on prompt of the proof: at line 5, where could x0 still appear, and does it?
  • (d) In the two attempts at the converse, ∀y∃xR(x,y)⊢∃x∀yR(x,y), which line is blocked in each, and by which clause of which rule?
  • (e) Give the idea of the proof in two sentences.

Solution. (a) From ∃xφ on line h and a flagged box with name x0, from the assumption φ[x0/x] on line i to χ on line j, a line of the box itself, write χ on line k, justified “∃E h, i–j”. Side condition at line k: x0 does not appear in χ, in ∃xφ, in any premise, or in any assumption of a box still open at line k.

(b) Yes, either order works. In the other order (the fold “Either nesting works” after the proof), the ∃E box encloses the flagged box. At the ∀I line, y0 appears in no premise, not in the open assumption ∀yR(x0,y), and not in the conclusion; at the ∃E line, x0 is not in ∀y∃xR(x,y), not in the premise, and no box is open.

(c) At line 5, the clauses list four places: χ, which is line 4, ∃xR(x,y0); the existential of line 1, ∃x∀yR(x,y); the premise, which is line 1 again; and the assumptions of boxes open at line 5. The only box open at line 5 is the flagged box of y0, which has no assumption. The name x0 appears in none of these, so line 5 is correct. It does appear in lines 2–4, inside the box, which the side condition allows.

(d) In the first attempt, line 5 (∀I over y0) is blocked by the clause “y0 appears in no assumption of a box still open”, since the ∃E box’s assumption R(x0,y0) contains y0. In the second, line 4 (∃E) is blocked by the clause “x0 does not appear in χ”, since χ=R(x0,y0).

(e) Fix an arbitrary y0 and obtain the witness x0 of the premise, for which R(x0,y) holds for every y, in particular for y0. So x0 is a witness for ∃xR(x,y0), and since y0 was arbitrary, ∀y∃xR(x,y) follows.

Exercise (A2: Drill)

Each part takes a line or two. The parts run from a single step, through a missing line, a justification column and steps to judge, to short derivations. “Clause” means a clause of the reading of Definition 5.6.1.

  • (a) A line h is ∃xP(x). Write the first line of its ∃E box, with the name u0.
  • (b) Line 9 is ∃yQ(y), justified “∃E 3, 4–8”, and line 4 is the assumption P(u0)∧R(u0,c). What is line 3?
  • (c) Justify each line: 1 ∃x(P(x)∧Q(x)), premise; 2 ∀x(Q(x)→R(x)), premise; in a box flagged x0: 3 P(x0)∧Q(x0); 4 Q(x0); 5 Q(x0)→R(x0); 6 R(x0); 7 P(x0); 8 P(x0)∧R(x0); 9 ∃x(P(x)∧R(x)); then, outside the box, 10 ∃x(P(x)∧R(x)).
  • (d) An ∃E box for ∃k(m=2⋅k), named k0, ends in m2=4⋅k02. May it close with that line?
  • (e) The premise is Q(x0). May the box of ∃xP(x) be named x0?
  • (f) Premises ∃xP(x), ∃xQ(x). May both boxes be named x0 if one is inside the other?
  • (g) May two boxes share a name if the first has closed before the second opens?
  • (h) Inside an ∃E box with assumption P(x0), may ∀I generalize over x0?
  • (i) Find the illegal line: 1 ∃xP(x), premise; in a box flagged x0: 2 P(x0), assumption; then 3 P(x0), ∃E 1, 2–2; 4 ∃yP(y), ∃I 3.
  • (j) Derive ∃x(P(x)∧Q(x))⊢∃xQ(x).
  • (k) Derive ∃xP(x), ∀x(P(x)→Q(x))⊢∃xQ(x).
  • (l) Derive ∃x∃yR(x,y)⊢∃y∃xR(x,y).

Solution.

  • (a) The box flagged u0, opening with the assumption P(u0).

  • (b) ∃x(P(x)∧R(x,c)), with any bound letter in place of x (one that does not clash with c or u0).

  • (c) 3 assumption, for ∃E; 4 ∧E 3; 5 ∀E 2 (at x0); 6 →E 5, 4; 7 ∧E 3; 8 ∧I 7, 6; 9 ∃I 8; 10 ∃E 1, 3–9.

  • (d) No, clause 3: the last line mentions k0.

  • (e) No, clause 4: x0 appears in a premise.

  • (f) No, clause 4: the inner box’s name appears in the open assumption P(x0) of the outer one.

  • (g) Yes, as in Example (Derivations with existential elimination) (a), (⊣).

  • (h) No: x0 is in an open assumption, which the second clause of ∀I forbids; the witness is not arbitrary.

  • (i) Line 3, clause 3: its box’s last line mentions x0. (Line 4 would be legal; the conclusion is even derivable, with the ∃I inside the box, but this derivation does not derive it.)

  • (j) In a box flagged x0: 2 P(x0)∧Q(x0), assumption; 3 Q(x0), ∧E 2; 4 ∃xQ(x), ∃I 3; then 5 ∃xQ(x), ∃E 1, 2–4.

  • (k) In a box flagged x0: 3 P(x0), assumption; 4 P(x0)→Q(x0), ∀E 2; 5 Q(x0), →E 4, 3; 6 ∃xQ(x), ∃I 5; then 7 ∃xQ(x), ∃E 1, 3–6.

  • (l) In a box flagged x0: 2 ∃yR(x0,y), assumption; inside it, in a box flagged y0: 3 R(x0,y0), assumption; 4 ∃xR(x,y0), ∃I 3; 5 ∃y∃xR(x,y), ∃I 4; then 6 ∃y∃xR(x,y), ∃E 2, 3–5; and 7, the same line, ∃E 1, 2–6.

B. Practice

Exercise (B1)

Derive ∀x¬(P(x)∧Q(x)), ∃xP(x)⊢∃x¬Q(x). Read the sequent over Z with P as “positive” and Q as “negative”.

Solution. Idea. The premise ∃xP(x) opens its box first, with a witness x0, aimed at the goal. The goal ∃x¬Q(x) is postponed; the witness x0 is the natural candidate, so the new goal inside is ¬Q(x0), a negation: a ¬I box on Q(x0). Inside, P(x0)∧Q(x0) clashes with the first premise at x0.

1∀x¬(P(x)∧Q(x))
2∃xP(x)
3x0P(x0)asm, for ∃E
4Q(x0)asm, for ¬I
5P(x0)∧Q(x0)∧I 3, 4
6¬(P(x0)∧Q(x0))∀E 1
7⊥¬E 5, 6
8¬Q(x0)¬I 4–7
9∃x¬Q(x)∃I 8
10∃x¬Q(x)∃E 2, 3–9

At line 10, x0 is not in line 9, not in line 2, not in either premise, and no box is open. Over Z: no integer is both positive and negative, and some integer is positive, so some integer is not negative. The witness of the conclusion is the positive witness of the premise.

Exercise (B2: Fix, obtain, choose, faded)

Here is a derivation of ∀x∃yR(x,y), ∀x∀y(R(x,y)→Q(y))⊢∀x∃y(R(x,y)∧Q(y)) with its last line missing.

1∀x∃yR(x,y)
2∀x∀y(R(x,y)→Q(y))
3x0∃yR(x0,y)∀E 1
4y0R(x0,y0)asm, for ∃E
5∀y(R(x0,y)→Q(y))∀E 2
6R(x0,y0)→Q(y0)∀E 5
7Q(y0)→E 6, 4
8R(x0,y0)∧Q(y0)∧I 4, 7
9∃y(R(x0,y)∧Q(y))∃I 8
10∃y(R(x0,y)∧Q(y))∃E 3, 4–9

Name the move, then complete it. Then mark which lines are the “fix”, which the “obtain”, and which the “choose”.

Solution. The missing line closes the flagged box of x0 by ∀I; the move is the “fix” of fix, obtain, choose, completed: “since x0 was arbitrary”.

1∀x∃yR(x,y)
2∀x∀y(R(x,y)→Q(y))
3x0∃yR(x0,y)∀E 1
4y0R(x0,y0)asm, for ∃E
5∀y(R(x0,y)→Q(y))∀E 2
6R(x0,y0)→Q(y0)∀E 5
7Q(y0)→E 6, 4
8R(x0,y0)∧Q(y0)∧I 4, 7
9∃y(R(x0,y)∧Q(y))∃I 8
10∃y(R(x0,y)∧Q(y))∃E 3, 4–9
11∀x∃y(R(x,y)∧Q(y))∀I 3–10

Line 11 cites the flagged box 3–10; its last line, line 10, is a line of that box itself and is the instance ψ[x0/x] for ψ=∃y(R(x,y)∧Q(y)). The name x0 appears in neither premise and not in line 11, and at line 11 no box is open. (At line 10, y0 is not in line 9, not in line 3, not in the premises, and the only open box, that of x0, has no assumption.)

The moves: fix is the flagged box of x0 (opened before line 3, closed at line 11); obtain is line 3 (∀E at x0) and the ∃E box of y0 (lines 4–10), with lines 5–7 using the second premise on the witness; choose is line 9, ∃I with the witness y0.

Exercise (B3)

An integer n is odd when n=2k+1 for some integer k. Over Z, derive ∃k(m=2⋅k+1), ∃k(n=2⋅k+1)⊢∃k(m⋅n=2⋅k+1), with one line justified “arith”. Then write the proof as three sentences of prose.

Solution. Idea. As in Example (The sum of two even integers is even): open both boxes early, with different names, and postpone the goal until the arithmetic shows the witness.

1∃k(m=2⋅k+1)
2∃k(n=2⋅k+1)
3k0m=2⋅k0+1asm, for ∃E
4l0n=2⋅l0+1asm, for ∃E
5m⋅n=2⋅(2⋅k0⋅l0+k0+l0)+1arith 3, 4
6∃k(m⋅n=2⋅k+1)∃I 5
7∃k(m⋅n=2⋅k+1)∃E 2, 4–6
8∃k(m⋅n=2⋅k+1)∃E 1, 3–7

Line 5: (2k0+1)(2l0+1)=4k0l0+2k0+2l0+1=2(2k0l0+k0+l0)+1. Line 6 is ∃I with φ=(m⋅n=2⋅k+1) and the witness 2⋅k0⋅l0+k0+l0. At line 7, l0 is in none of line 6, line 2, the premises, and the open assumption on line 3; at line 8, k0 is in none of line 7, line 1, the premises, and no box is open.

In prose: Choose integers k and l with m=2k+1 and n=2l+1. Then mn=4kl+2k+2l+1=2(2kl+k+l)+1. Since 2kl+k+l is an integer, mn is odd.

Exercise (B4: Derive or break)

For each claim, derive it with the rules so far, or break it with a counter-reading.

  • (a) ∃x∀yR(x,y)⊢∃xR(x,x).
  • (b) ∀x∃yR(x,y)⊢∃xR(x,x).
  • (c) ∀x(P(x)→Q(x)), ∃x¬Q(x)⊢∃x¬P(x).
  • (d) ∀x(P(x)→Q(x)), ∃x¬P(x)⊢∃x¬Q(x).
  • (e) ∃xP(f(x))⊢∃yP(y).
  • (f) ∃yP(y)⊢∃xP(f(x)).
  • (g) ∀x(P(x)→∃yR(x,y)), ∃xP(x)⊢∃y∃xR(x,y).

Solution.

  • (a) Derive. Obtain the witness, and instantiate its universal at the witness itself.
    1∃x∀yR(x,y)
    2x0∀yR(x0,y)asm, for ∃E
    3R(x0,x0)∀E 2
    4∃xR(x,x)∃I 3
    5∃xR(x,x)∃E 1, 2–4
  • (b) Break. The domain {0,1}, with R true of the pairs (0,1) and (1,0) only. Each element is related to something, and no element to itself.

  • (c) Derive. The ∃E box opens first, aimed at the goal; inside it, a ¬I box.

    1∀x(P(x)→Q(x))
    2∃x¬Q(x)
    3x0¬Q(x0)asm, for ∃E
    4P(x0)→Q(x0)∀E 1
    5P(x0)asm, for ¬I
    6Q(x0)→E 4, 5
    7⊥¬E 6, 3
    8¬P(x0)¬I 5–7
    9∃x¬P(x)∃I 8
    10∃x¬P(x)∃E 2, 3–9
  • (d) Break. The domain {0,1}, with P true of nothing and Q true of both elements. The first premise holds (no hypothesis P(x) is true), the second holds since ¬P(0), and no element lacks Q.

  • (e) Derive. The witness of the conclusion is the compound term f(x0).

    1∃xP(f(x))
    2x0P(f(x0))asm, for ∃E
    3∃yP(y)∃I 2
    4∃yP(y)∃E 1, 2–3
  • (f) Break. The domain {0,1}, with f sending both elements to 0, and P true of 1 only. Some element has P, and no value of f does.

  • (g) Derive. Two boxes with different names, the second inside the first.

1∀x(P(x)→∃yR(x,y))
2∃xP(x)
3x0P(x0)asm, for ∃E
4P(x0)→∃yR(x0,y)∀E 1
5∃yR(x0,y)→E 4, 3
6y0R(x0,y0)asm, for ∃E
7∃xR(x,y0)∃I 6
8∃y∃xR(x,y)∃I 7
9∃y∃xR(x,y)∃E 5, 6–8
10∃y∃xR(x,y)∃E 2, 3–9

At line 9 the open assumption P(x0) does not contain y0; at line 10 no box is open.

The pairs: (c) and (d) are the contrapositive and its look-alike (denying the antecedent); (e) and (f) are converses; (a) and (b) differ in the order of the quantifiers. Worked examples of these types: Proposition 5.6.1 and its Quick check (a counter-reading); Example (Derivations with existential elimination) (b); Example (The sum of two even integers is even); the two-dot counter-reading of the converse of Proposition 5.6.2.

Marking scheme. (10 points)

  • 1 each: (a), (b), (d), (e), (f), with the derivation or the counter-reading in full.
  • 2: (c), with the ∃E box opened first and aimed at the goal, and ¬P(x0) obtained inside it (by a ¬I box or by MT).
  • 2: (g), with two boxes, different names, closed in the right order.
  • 1: the closing pairing.

Fatal errors (0 for the claim): an ∃E box closed on a line that mentions its witness; a counter-reading in which a premise is false.

C. Going deeper

Exercise (C1)

Derive ∃x∀yR(x,y), ∀x∀y(R(x,y)→R(y,x))⊢∀y∃xR(y,x), and check the side condition of every ∃E and ∀I line. Then give a reading over Z in which both premises are true, and say which integer the derivation’s witness is.

Solution (Hint 1). The shape is the one of Proposition 5.6.2: fix, obtain, choose. Which line does symmetry have to turn round?

Solution (Hint 2). Open a flagged box for y0, and inside it the ∃E box of the first premise, with the assumption ∀yR(x0,y).

Solution. Idea. The goal is ∀y: fix y0. The new goal ∃xR(y0,x) is postponed. The first premise is an existential: obtain x0 with ∀yR(x0,y), and instantiate it at the term the goal mentions, y0: R(x0,y0). The goal needs R(y0,t), with y0 first, so the second premise turns the line round, instantiated at x0 and y0 in that order (read off the line to be turned). Then choose the witness x0.

1∃x∀yR(x,y)
2∀x∀y(R(x,y)→R(y,x))
3y0x0∀yR(x0,y)asm, for ∃E
4R(x0,y0)∀E 3
5∀y(R(x0,y)→R(y,x0))∀E 2
6R(x0,y0)→R(y0,x0)∀E 5
7R(y0,x0)→E 6, 4
8∃xR(y0,x)∃I 7
9∃xR(y0,x)∃E 1, 3–8
10∀y∃xR(y,x)∀I 3–9

Line 9 (∃E): x0 does not appear in χ=∃xR(y0,x), nor in the existential of line 1, nor in either premise; the only box open at line 9 is the flagged box of y0, which has no assumption. Line 8 is a line of the ∃E box itself.

Line 10 (∀I): the flagged box immediately contains the ∃E box, so its range starts at line 3. Its last line, line 9, is a line of the box itself and is (∃xR(y,x))[y0/y]. The name y0 appears in neither premise and not in line 10, and no box is open.

A reading. Over Z, let R(x,y) mean “x⋅y=0”. The second premise holds since x⋅y=y⋅x. The first holds with the witness 0, and only with it: for x≠0, the instance y=1 gives x⋅1=x≠0. The conclusion says that every integer has a partner with product 0, which is true. The derivation’s x0 names the witness of the first premise, so under this reading it can only be 0, and the derivation gives every y the partner 0; the derivation itself never uses which integer it is.

Marking scheme. (10 points) - 2: opens a flagged box for the goal’s ∀y with a fresh name, and postpones the existential. - 2: opens the ∃E box of the first premise with a fresh witness, aimed at the current goal. - 2: instantiates the assumption at y0 and the symmetry premise at x0, y0 in that order, and fires it. - 2: ∃I with the witness x0, inside the ∃E box. - 1: checks the side conditions of the ∃E and ∀I lines clause by clause. - 1: a reading over Z in which both premises hold, with the witness identified (or, if the reading does not determine it, correctly described as whichever witness the first premise has). Fatal errors (0 for the step): an ∃E box closed on a line containing its witness; ∀I over a name in an open assumption; the symmetry premise instantiated in the wrong order and then used as if it fired.

Exercise (C2: Find the error, used later)

Here is a “derivation” of ∃x(P(x)∧Q(x))⊢∃xP(x).

1∃x(P(x)∧Q(x))
2x0P(x0)∧Q(x0)asm, for ∃E
3P(x0)∧E 2
4P(x0)∃E 1, 2–3
5∃xP(x)∃I 4
  • (a) Is the conclusion derivable from the premise? Justify your answer.
  • (b) Does this derivation prove it? If not, name the exact line that fails, the rule, and the clause of its side condition that is broken.
  • (c) Show that the illegal step itself is unsound: use the same step to “derive”, from a premise true over Z, a sentence false over Z.

Solution (Hint 1). For (a), the conclusion is half of the conclusion of a result proved in this section.

Solution (Hint 2). For (c), drop Q: start from the premise ∃xP(x) and take the same illegal step as line 4.

Solution. (a) Yes, the conclusion is derivable: by Proposition 5.6.1 the premise gives ∃xP(x)∧∃xQ(x), and ∧E gives ∃xP(x). Directly, moving the ∃I inside the box repairs the derivation:

1∃x(P(x)∧Q(x))
2x0P(x0)∧Q(x0)asm, for ∃E
3P(x0)∧E 2
4∃xP(x)∃I 3
5∃xP(x)∃E 1, 2–4

At line 5, x0 is not in line 4, not in line 1, and no box is open.

(b) No. Line 4 fails: it is ∃E with χ=P(x0), and x0 appears in χ, which breaks the clause “x0 does not appear in χ” of Definition 5.6.1. The witness has escaped its box. Lines 1–3 are correct, and line 5 would be a correct ∃I if line 4 were a legitimate line. A true conclusion does not make the argument correct: the conclusion is derivable, but not by this derivation.

(c) The same step, from ∃xP(x) alone:

1∃xP(x)
2x0P(x0)asm, for ∃E
3P(x0)∃E 1, 2–2
4x0P(x0)R 3
5∀xP(x)∀I 4–4

Line 3 is the illegal step of line 4 above. Line 4 repeats line 3 into a flagged box, and line 5 is a correct ∀I: x0 appears in no premise, in no open assumption, and not in line 5. Over Z with P as “even”, the premise “some integer is even” is true and the conclusion “every integer is even” is false. So the step from ∃xP(x) to P(x0) can lead from truth to falsehood; it is a counterexample to the step, while the conclusion of the original sequent has no counterexample at all. (This is the same failure as the derivation after Definition 5.6.1 that “proves” every natural number exceeds 5.)

Marking scheme. (10 points) - 2: (a) says the conclusion is derivable and gives a correct derivation or cites Proposition 5.6.1 with ∧E. - 3: (b) names line 4, the rule ∃E, and the clause “x0 not in χ”. - 1: (b) says that the other lines are correct, so the error is in that one line. - 4: (c) gives a derivation that uses the same illegal step and is otherwise legal, with a reading in which the premise is true and the conclusion false. Fatal errors (0 for the step): answering (a) “no” because the derivation is wrong; giving a counterexample to the conclusion of the original sequent (there is none); blaming line 5.

Exercise (C3: The diagonal of a list)

Let A0,A1,A2,… be sets of natural numbers, one for each n∈N, and let D={n∈N:n∉An}.

  • (a) Over the domain N, read R(x,y) as “x∈Ay”. Follow the proof of Theorem 5.6.3 in this reading to show that D is none of the sets Am.
  • (b) Compute D for the list An={k∈N:k>n}, and for the list An={k∈N:k is a multiple of n+1}. In each case, find a number at which D differs from A0, from A1 and from A2.

Solution (Hint). In (a), the existential of line 1 is “some m has D=Am”. What does the definition of D say about every n, when D=Am?

Solution. (a) Suppose D=Am for some m: this is the existential of line 1, with its witness named m (line 2). By the definition of D, for every n: n∈Am exactly when n∉An; that is ∀x(R(x,m)↔¬R(x,x)). At n=m (line 3): m∈Am exactly when m∉Am, which is impossible (lines 4–9). So no m has D=Am.

(b) First list: n>n is false, so n∉An for every n, and D=N. D differs from Am at m: m∈D and m∉Am (0∉A0, 1∉A1, 2∉A2).

Second list: n is a multiple of n+1 only for n=0 (0=0⋅1; for n≥1, 0<n<n+1), so D={1,2,3,…}. A0=N contains 0∉D; A1={0,2,4,…} lacks 1∈D; A2={0,3,6,…} lacks 2∈D.

In both, D and Am differ at the number m itself, as the proof says they must.

Marking scheme. (10 points)

  • 2: the assumption D=Am set up as the witness of an existential.
  • 2: the universal ∀x(R(x,m)↔¬R(x,x)) read off the definition of D.
  • 2: the instance at m and the contradiction.
  • 2: the first list’s D, with the three differences.
  • 2: the second list’s D (the case n=0 justified), with the three differences.

Fatal error (0 for (a)): instantiating at some number other than m.