-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEquivalencia_de_inversos_iguales_al_neutro.lean
123 lines (105 loc) · 2.63 KB
/
Equivalencia_de_inversos_iguales_al_neutro.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
-- Equivalencia_de_inversos_iguales_al_neutro.lean
-- Equivalencia de inversos iguales al neutro
-- José A. Alonso Jiménez <https://jaalonso.github.io>
-- Sevilla, 7-mayo-2024
-- ---------------------------------------------------------------------
-- ---------------------------------------------------------------------
-- Sea M un monoide y a, b ∈ M tales que a * b = 1. Demostrar que a = 1
-- si y sólo si b = 1.
-- ---------------------------------------------------------------------
-- Demostración en lenguaje natural
-- ================================
-- Demostraremos las dos implicaciones.
--
-- (⟹) Supongamos que a = 1. Entonces,
-- b = 1·b [por neutro por la izquierda]
-- = a·b [por supuesto]
-- = 1 [por hipótesis]
--
-- (⟸) Supongamos que b = 1. Entonces,
-- a = a·1 [por neutro por la derecha]
-- = a·b [por supuesto]
-- = 1 [por hipótesis]
-- Demostraciones con Lean4
-- ========================
import Mathlib.Algebra.Group.Basic
variable {M : Type} [Monoid M]
variable {a b : M}
-- 1ª demostración
-- ===============
example
(h : a * b = 1)
: a = 1 ↔ b = 1 :=
by
constructor
. -- ⊢ a = 1 → b = 1
intro a1
-- a1 : a = 1
-- ⊢ b = 1
calc b = 1 * b := (one_mul b).symm
_ = a * b := congrArg (. * b) a1.symm
_ = 1 := h
. -- ⊢ b = 1 → a = 1
intro b1
-- b1 : b = 1
-- ⊢ a = 1
calc a = a * 1 := (mul_one a).symm
_ = a * b := congrArg (a * .) b1.symm
_ = 1 := h
-- 2ª demostración
-- ===============
example
(h : a * b = 1)
: a = 1 ↔ b = 1 :=
by
constructor
. -- ⊢ a = 1 → b = 1
intro a1
-- a1 : a = 1
-- ⊢ b = 1
rw [a1] at h
-- h : 1 * b = 1
rw [one_mul] at h
-- h : b = 1
exact h
. -- ⊢ b = 1 → a = 1
intro b1
-- b1 : b = 1
-- ⊢ a = 1
rw [b1] at h
-- h : a * 1 = 1
rw [mul_one] at h
-- h : a = 1
exact h
-- 3ª demostración
-- ===============
example
(h : a * b = 1)
: a = 1 ↔ b = 1 :=
by
constructor
. -- ⊢ a = 1 → b = 1
rintro rfl
-- h : 1 * b = 1
simpa using h
. -- ⊢ b = 1 → a = 1
rintro rfl
-- h : a * 1 = 1
simpa using h
-- 4ª demostración
-- ===============
example
(h : a * b = 1)
: a = 1 ↔ b = 1 :=
by constructor <;> (rintro rfl; simpa using h)
-- 5ª demostración
-- ===============
example
(h : a * b = 1)
: a = 1 ↔ b = 1 :=
eq_one_iff_eq_one_of_mul_eq_one h
-- Lemas usados
-- ============
-- #check (eq_one_iff_eq_one_of_mul_eq_one : a * b = 1 → (a = 1 ↔ b = 1))
-- #check (mul_one a : a * 1 = a)
-- #check (one_mul a : 1 * a = a)