-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAlgorithmWorld.lean
More file actions
46 lines (35 loc) · 925 Bytes
/
AlgorithmWorld.lean
File metadata and controls
46 lines (35 loc) · 925 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import NaturalNumberGame.Basic
open Natural
variable (a b c d e f g h : Natural)
-- 1
example : a + (b + c) = b + (a + c) := by
rw [add_left_comm]
-- 2
example : (a + b) + (c + d) = ((a + c) + d) + b := by
repeat rw [add_assoc]
rw [add_comm d b]
rw [add_left_comm c b]
/- # simp -/
-- 3
example : (d + f) + (h + (a + c)) + (g + e + b) = a + b + c + d + e + f + g + h := by
simp only [add_assoc, add_left_comm, add_comm]
-- 4
example : (d + f) + (h + (a + c)) + (g + e + b) = a + b + c + d + e + f + g + h := by
simp_add
-- 5
example (h : succ a = succ b) : a = b := by
apply succ_inj
exact h
/- # trivial -/
-- 6
example : succ a ≠ zero := by apply succ_ne_zero
/- # contrapose -/
-- 7
example (h : a ≠ b) : succ a ≠ succ b := by
apply succ_ne_succ
exact h
/- # decide -/
-- 8
example : (two * ten) + (two * ten) = (four * ten) := by decide
-- 9
example : two + two ≠ five := by decide