-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMultiplicacion_por_cero.lean
92 lines (72 loc) · 2.37 KB
/
Multiplicacion_por_cero.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
-- Multiplicacion_por_cero.lean
-- Si R es un anillo y a ∈ R, entonces a.0 = 0
-- José A. Alonso Jiménez <https://jaalonso.github.io>
-- Sevilla, 3-agosto-2023
-- ---------------------------------------------------------------------
-- ---------------------------------------------------------------------
-- Demostrar que si R es un anillo y a ∈ R, entonces
-- a * 0 = 0
-- ----------------------------------------------------------------------
-- Demostración en lenguaje natural
-- ================================
-- Basta aplicar la propiedad cancelativa a
-- a.0 + a.0 = a.0 + 0
-- que se demuestra mediante la siguiente cadena de igualdades
-- a.0 + a.0 = a.(0 + 0) [por la distributiva]
-- = a.0 [por suma con cero]
-- = a.0 + 0 [por suma con cero]
-- Demostraciones con Lean4
-- ========================
import Mathlib.Algebra.Ring.Defs
import Mathlib.Tactic
variable {R : Type _} [Ring R]
variable (a : R)
-- 1ª demostración
-- ===============
example : a * 0 = 0 :=
by
have h : a * 0 + a * 0 = a * 0 + 0 :=
calc a * 0 + a * 0 = a * (0 + 0) := by rw [mul_add a 0 0]
_ = a * 0 := by rw [add_zero 0]
_ = a * 0 + 0 := by rw [add_zero (a * 0)]
rw [add_left_cancel h]
-- 2ª demostración
-- ===============
example : a * 0 = 0 :=
by
have h : a * 0 + a * 0 = a * 0 + 0 :=
calc a * 0 + a * 0 = a * (0 + 0) := by rw [← mul_add]
_ = a * 0 := by rw [add_zero]
_ = a * 0 + 0 := by rw [add_zero]
rw [add_left_cancel h]
-- 3ª demostración
-- ===============
example : a * 0 = 0 :=
by
have h : a * 0 + a * 0 = a * 0 + 0 :=
by rw [← mul_add, add_zero, add_zero]
rw [add_left_cancel h]
-- 4ª demostración
-- ===============
example : a * 0 = 0 :=
by
have : a * 0 + a * 0 = a * 0 + 0 :=
calc a * 0 + a * 0 = a * (0 + 0) := by simp
_ = a * 0 := by simp
_ = a * 0 + 0 := by simp
simp
-- 5ª demostración
-- ===============
example : a * 0 = 0 :=
mul_zero a
-- 6ª demostración
-- ===============
example : a * 0 = 0 :=
by simp
-- Lemas usados
-- ============
-- variable (b c : R)
-- #check (add_left_cancel : a + b = a + c → b = c)
-- #check (add_zero a : a + 0 = a)
-- #check (mul_add a b c : a * (b + c) = a * b + a * c)
-- #check (mul_zero a : a * 0 = 0)