import MyNat.Definition
import MyNat.Inequality -- le_iff_exists_add
import AdvancedAdditionWorld.Level1 -- succ_inj
import AdvancedAdditionWorld.Level9 -- zero_ne_succ
namespace MyNat
open MyNat
Inequality world.
Level 13: not_succ_le_self
Turns out that ¬ P
is by definition P → false
, so you can just
start this one with intro h
if you like.
Lemma : not_succ_le_self
For all naturals a
, succ a
is not at most a
.
theoremnot_succ_le_self (not_succ_le_self: ∀ (a : MyNat), ¬succ a ≤ aa :a: MyNatMyNat) : ¬ (MyNat: Typesuccsucc: MyNat → MyNata ≤a: MyNata) :=a: MyNata: MyNat¬succ a ≤ aa: MyNat
h: succ a ≤ aFalsea: MyNat
h: succ a ≤ aFalsea, c: MyNat
h: a = succ a + c
introFalsea, c: MyNat
h: a = succ a + c
introFalsec: MyNat
h: zero = succ zero + c
intro.zeroFalsec: MyNat
h: zero = succ zero + c
intro.zeroFalsec: MyNat
h: zero = succ (zero + c)
intro.zeroFalsec: MyNat
h: zero = succ (zero + c)
intro.zeroFalsec: MyNat
h: zero = succ (zero + c)
intro.zeroFalseGoals accomplished! 🐙c, d: MyNat
hd: d = succ d + c → False
h: succ d = succ (succ d) + c
intro.succFalsec, d: MyNat
hd: d = succ d + c → False
h: succ d = succ (succ d) + c
intro.succFalsec, d: MyNat
hd: d = succ d + c → False
h: succ d = succ (succ d + c)
intro.succFalsec, d: MyNat
hd: d = succ d + c → False
h: succ d = succ (succ d + c)
intro.succFalsec, d: MyNat
hd: d = succ d + c → False
h: succ d = succ (succ d + c)
intro.succFalsec, d: MyNat
hd: d = succ d + c → False
h: succ d = succ (succ d + c)
intro.succd = succ d + cc, d: MyNat
hd: d = succ d + c → False
h: succ d = succ (succ d + c)
intro.succ.asucc d = succ (succ d + c)Goals accomplished! 🐙
Pro tip:
The conv
tactic allows you to perform targeted rewriting on a goal or hypothesis, by focusing
on particular subexpressions.
conv =>
lhs
rw hc
This is an incantation which rewrites hc
only on the left hand side of the goal.
You didn't need to use conv
in the above proof
but it's a helpful trick when rw
is rewriting too much.
For a deeper discussion on conv
see Conversion Tactic Mode
Next up Level 14