2.9. Consequences of these new results
The results above are the first theorems that we have seen in this chapter of the form "if some equation is true, then some other equation is also true";
results like commutativity and associativity of addition and multiplication were of the form "this equation is always true", and hence logically simpler.
Let's prove some other results of the form "if some equation is true, then some other equation is also true",
using Peano's last two axioms S(x)=S(y)\implies x=y and S(x)\neq 0.
Theorem 18
Say x, y and n are natural numbers.
-
If
x+n=y+nthenx=y(the cancellation property for addition); -
If
x+n=n, thenx=0.
Proof
-
Fix
xandy, and let's do induction onn. More precisely, we letP_ndenote the statement "ifx+n=y+nthenx=y" and we proveP_nfor alln, by induction.The base case is easy: if
x+0=y+0thenx=ybecausex+0=xandy+0=yby definition of addition. For the inductive step, we assume "ifx+k=y+kthenx=y" and we have to prove "ifx+S(k)=y+S(k)thenx=y". So let's assumex+S(k)=y+S(k); by definition of addition we deduceS(x+k)=S(y+k). By injectivity ofS(Peano's second extra axiom, which we proved above) we deducex+k=y+k. And finally by our inductive hypothesis we concludex=y. -
Setting
y=0in the previous part givesx+n=0+n\implies x=0, and because we know0+n=nwe're done.
Lemma add_right_cancel
"Addition is cancellative"
Given: {x y n : ℕ}
Assume:
Conclusion: x + n = y + n → x = y
Proof:
x:ℕy:ℕ⊢ x + 0 = y + 0 ⇒ x = yx:ℕy:ℕ⊢ ∀ (k : ℕ), (x + k = y + k ⇒ x = y) ⇒ x + succ k = y + succ k ⇒ x = y
x:ℕy:ℕ⊢ x + 0 = y + 0 ⇒ x = y x:ℕy:ℕh:x + 0 = y + 0⊢ x = y
Calc
x = x + 0 All goals completed! 🐙 All goals completed! 🐙
_ = y + 0 from h
_ = y All goals completed! 🐙 All goals completed! 🐙
x:ℕy:ℕ⊢ ∀ (k : ℕ), (x + k = y + k ⇒ x = y) ⇒ x + succ k = y + succ k ⇒ x = y x:ℕy:ℕk:ℕ⊢ (x + k = y + k ⇒ x = y) ⇒ x + succ k = y + succ k ⇒ x = y
x:ℕy:ℕk:ℕIH:x + k = y + k ⇒ x = y⊢ x + succ k = y + succ k ⇒ x = y
x:ℕy:ℕk:ℕIH:x + k = y + k ⇒ x = yh1:x + succ k = y + succ k⊢ x = y
Fact h2 : succ (x + k) = succ (y + k) by
Calc
succ (x + k) = x + succ k All goals completed! 🐙 All goals completed! 🐙
_ = y + succ k from h1
_ = succ (y + k) All goals completed! 🐙 All goals completed! 🐙
x:ℕy:ℕk:ℕIH:x + k = y + k ⇒ x = yh1:x + succ k = y + succ kh2:succ (x + k) = succ (y + k)h3:x + k = y + k⊢ x = y
All goals completed! 🐙
QEDLemma add_left_eq_self
"Only zero leaves a number unchanged when added"
Given: {x n : ℕ}
Assume: (h : x + n = n)
Conclusion: x = 0
Proof:
Fact h' : x + n = 0 + n by
All goals completed! 🐙
All goals completed! 🐙
QEDTheorem 19
Suppose x and y are natural numbers and x+y=0.
Then x=y=0.
Proof
Let's first prove that y=0.
We showed in Theorem 17 that y was either 0 or a successor.
If y=0 then we are done.
Otherwise we must have y=S(n) for some natural number n.
In this case 0=x+y=x+S(n)=S(x+n),
but on the other hand, from Peano's first extra axiom, 0\ne S(x+n).
This is a contradiction!
So the y=S(n) case is ruled out.
We deduce that y=0, and hence x+0=0 which implies that x=0 by definition of addition.
Lemma add_left_eq_zero
"If x + y = 0 then y = 0"
Given: {x y : ℕ}
Assume: (h : x + y = 0)
Conclusion: y = 0
Proof:
x:ℕy:ℕh:x + y = 0hy₀:y = 0 ∨ ∃ n, y = succ n⊢ y = 0
x:ℕy:ℕh:x + y = 0hy₀:y = 0 ∨ ∃ n, y = succ n⊢ y = 0 ⇒ y = 0x:ℕy:ℕh:x + y = 0hy₀:y = 0 ∨ ∃ n, y = succ n⊢ (∃ n, y = succ n) ⇒ y = 0
x:ℕy:ℕh:x + y = 0hy₀:y = 0 ∨ ∃ n, y = succ n⊢ y = 0 ⇒ y = 0 x:ℕy:ℕh:x + y = 0hy₀:y = 0 ∨ ∃ n, y = succ nhy:y = 0⊢ y = 0
All goals completed! 🐙
x:ℕy:ℕh:x + y = 0hy₀:y = 0 ∨ ∃ n, y = succ n⊢ (∃ n, y = succ n) ⇒ y = 0 x:ℕy:ℕh:x + y = 0hy₀:y = 0 ∨ ∃ n, y = succ nhy:∃ n, y = succ n⊢ y = 0
x:ℕy:ℕh:x + y = 0hy₀:y = 0 ∨ ∃ n, y = succ nhy:∃ n, y = succ nn:ℕhyn:y = succ n⊢ y = 0
Fact hxn : 0 = succ (x + n) by
Calc
0 = x + y from h
_ = x + succ n from hyn
_ = succ (x + n) All goals completed! 🐙 All goals completed! 🐙
x:ℕy:ℕh:x + y = 0hy₀:y = 0 ∨ ∃ n, y = succ nhy:∃ n, y = succ nn:ℕhyn:y = succ nhxn:0 = succ (x + n)hxn':0 ≠ succ (x + n)⊢ y = 0
All goals completed! 🐙
QEDLemma add_right_eq_zero
"If x + y = 0 then x = 0"
Given: {x y : ℕ}
Assume: (h : x + y = 0)
Conclusion: x = 0
Proof:
x:ℕy:ℕh:x + y = 0hy:y = 0⊢ x = 0
Calc
x = x + 0 All goals completed! 🐙 All goals completed! 🐙
_ = x + y from hy
_ = 0 from h
QED