-
Notifications
You must be signed in to change notification settings - Fork 1
/
zero_mul.lean
63 lines (50 loc) · 1.3 KB
/
zero_mul.lean
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
60
61
62
63
-- ---------------------------------------------------------------------
-- Ejercicio. Demostrar que en los anillos,
-- 0 * a = 0
-- ----------------------------------------------------------------------
import algebra.ring
namespace my_ring
variables {R : Type*} [ring R]
variable (a : R)
-- 1ª demostración
-- ===============
example : 0 * a = 0 :=
begin
have h : 0 * a + 0 * a = 0 * a + 0,
calc 0 * a + 0 * a
= (0 + 0) * a : (add_mul 0 0 a).symm
... = 0 * a : congr_arg (λ x, x * a) (add_zero 0)
... = 0 * a + 0 : self_eq_add_right.mpr rfl,
rw add_left_cancel h
end
-- 2ª demostración
-- ===============
example : 0 * a = 0 :=
begin
have h : 0 * a + 0 * a = 0 * a + 0,
calc 0 * a + 0 * a
= (0 + 0) * a : by rw add_mul
... = 0 * a : by rw add_zero
... = 0 * a + 0 : by rw add_zero,
rw add_left_cancel h
end
-- 3ª demostración
-- ===============
example : 0 * a = 0 :=
begin
have h : 0 * a + 0 * a = 0 * a + 0,
{ rw [←add_mul, add_zero, add_zero] },
rw add_left_cancel h
end
-- 4ª demostración
-- ===============
example : 0 * a = 0 :=
begin
have h : 0 * a + 0 * a = 0 * a + 0,
calc 0 * a + 0 * a
= (0 + 0) * a : by simp
... = 0 * a : by simp
... = 0 * a + 0 : by simp,
simp,
end
end my_ring