forked from leanprover-community/mathlib3
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconv.lean
More file actions
59 lines (50 loc) · 1.17 KB
/
Copy pathconv.lean
File metadata and controls
59 lines (50 loc) · 1.17 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
/-
Copyright (c) 2018 Keeley Hoek. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Keeley Hoek
-/
import tactic.converter.interactive
import tactic.ring
example : 0 + 0 = 0 :=
begin
conv_lhs {erw [add_zero]}
end
example : 0 + 0 = 0 :=
begin
conv_lhs {simp}
end
example : 0 = 0 + 0 :=
begin
conv_rhs {simp}
end
-- Example with ring discharging the goal
example : 22 + 7 * 4 + 3 * 8 = 0 + 7 * 4 + 46 :=
begin
conv { ring, },
end
-- Example with ring failing to discharge, to normalizing the goal
example : (22 + 7 * 4 + 3 * 8 = 0 + 7 * 4 + 47) = (74 = 75) :=
begin
conv { ring, },
end
-- Example with ring discharging the goal
example (x : ℕ) : 22 + 7 * x + 3 * 8 = 0 + 7 * x + 46 :=
begin
conv { ring, },
end
-- Example with ring failing to discharge, to normalizing the goal
example (x : ℕ) : (22 + 7 * x + 3 * 8 = 0 + 7 * x + 46 + 1)
= (7 * x + 46 = 7 * x + 47) :=
begin
conv { ring, },
end
-- norm_num examples:
example : 22 + 7 * 4 + 3 * 8 = 74 :=
begin
conv { norm_num, },
end
example (x : ℕ) : 22 + 7 * x + 3 * 8 = 7 * x + 46 :=
begin
simp [add_comm, add_left_comm],
conv { norm_num, },
end