@@ -19,14 +19,20 @@ in `Algebra.Group.Defs`.
19
19
To get equality of `npow` etc, we define a monoid homomorphism between two monoid structures on the
20
20
same type, then apply lemmas like `MonoidHom.map_div`, `MonoidHom.map_pow` etc.
21
21
22
+ To refer to the `*` operator of a particular instance `i`, we use
23
+ `(letI := i; HMul.hMul : M → M → M)` instead of `i.mul` (which elaborates to `Mul.mul`), as the
24
+ former uses `HMul.hMul` which is the canonical spelling.
25
+
22
26
## Tags
23
27
monoid, group, extensionality
24
28
-/
25
29
26
30
universe u
27
31
28
32
@[to_additive (attr := ext)]
29
- theorem Monoid.ext {M : Type u} ⦃m₁ m₂ : Monoid M⦄ (h_mul : m₁.mul = m₂.mul) : m₁ = m₂ := by
33
+ theorem Monoid.ext {M : Type u} ⦃m₁ m₂ : Monoid M⦄
34
+ (h_mul : (letI := m₁; HMul.hMul : M → M → M) = (letI := m₂; HMul.hMul : M → M → M)) :
35
+ m₁ = m₂ := by
30
36
have : m₁.toMulOneClass = m₂.toMulOneClass := MulOneClass.ext h_mul
31
37
have h₁ : m₁.one = m₂.one := congr_arg (·.one) (this)
32
38
let f : @MonoidHom M M m₁.toMulOneClass m₂.toMulOneClass :=
@@ -50,7 +56,8 @@ theorem CommMonoid.toMonoid_injective {M : Type u} :
50
56
#align add_comm_monoid.to_add_monoid_injective AddCommMonoid.toAddMonoid_injective
51
57
52
58
@[to_additive (attr := ext)]
53
- theorem CommMonoid.ext {M : Type *} ⦃m₁ m₂ : CommMonoid M⦄ (h_mul : m₁.mul = m₂.mul) : m₁ = m₂ :=
59
+ theorem CommMonoid.ext {M : Type *} ⦃m₁ m₂ : CommMonoid M⦄
60
+ (h_mul : (letI := m₁; HMul.hMul : M → M → M) = (letI := m₂; HMul.hMul : M → M → M)) : m₁ = m₂ :=
54
61
CommMonoid.toMonoid_injective <| Monoid.ext h_mul
55
62
#align comm_monoid.ext CommMonoid.ext
56
63
#align add_comm_monoid.ext AddCommMonoid.ext
@@ -64,7 +71,8 @@ theorem LeftCancelMonoid.toMonoid_injective {M : Type u} :
64
71
#align add_left_cancel_monoid.to_add_monoid_injective AddLeftCancelMonoid.toAddMonoid_injective
65
72
66
73
@[to_additive (attr := ext)]
67
- theorem LeftCancelMonoid.ext {M : Type u} ⦃m₁ m₂ : LeftCancelMonoid M⦄ (h_mul : m₁.mul = m₂.mul) :
74
+ theorem LeftCancelMonoid.ext {M : Type u} ⦃m₁ m₂ : LeftCancelMonoid M⦄
75
+ (h_mul : (letI := m₁; HMul.hMul : M → M → M) = (letI := m₂; HMul.hMul : M → M → M)) :
68
76
m₁ = m₂ :=
69
77
LeftCancelMonoid.toMonoid_injective <| Monoid.ext h_mul
70
78
#align left_cancel_monoid.ext LeftCancelMonoid.ext
@@ -79,7 +87,8 @@ theorem RightCancelMonoid.toMonoid_injective {M : Type u} :
79
87
#align add_right_cancel_monoid.to_add_monoid_injective AddRightCancelMonoid.toAddMonoid_injective
80
88
81
89
@[to_additive (attr := ext)]
82
- theorem RightCancelMonoid.ext {M : Type u} ⦃m₁ m₂ : RightCancelMonoid M⦄ (h_mul : m₁.mul = m₂.mul) :
90
+ theorem RightCancelMonoid.ext {M : Type u} ⦃m₁ m₂ : RightCancelMonoid M⦄
91
+ (h_mul : (letI := m₁; HMul.hMul : M → M → M) = (letI := m₂; HMul.hMul : M → M → M)) :
83
92
m₁ = m₂ :=
84
93
RightCancelMonoid.toMonoid_injective <| Monoid.ext h_mul
85
94
#align right_cancel_monoid.ext RightCancelMonoid.ext
@@ -94,7 +103,8 @@ theorem CancelMonoid.toLeftCancelMonoid_injective {M : Type u} :
94
103
#align add_cancel_monoid.to_left_cancel_add_monoid_injective AddCancelMonoid.toAddLeftCancelMonoid_injective
95
104
96
105
@[to_additive (attr := ext)]
97
- theorem CancelMonoid.ext {M : Type *} ⦃m₁ m₂ : CancelMonoid M⦄ (h_mul : m₁.mul = m₂.mul) :
106
+ theorem CancelMonoid.ext {M : Type *} ⦃m₁ m₂ : CancelMonoid M⦄
107
+ (h_mul : (letI := m₁; HMul.hMul : M → M → M) = (letI := m₂; HMul.hMul : M → M → M)) :
98
108
m₁ = m₂ :=
99
109
CancelMonoid.toLeftCancelMonoid_injective <| LeftCancelMonoid.ext h_mul
100
110
#align cancel_monoid.ext CancelMonoid.ext
@@ -111,15 +121,17 @@ theorem CancelCommMonoid.toCommMonoid_injective {M : Type u} :
111
121
#align add_cancel_comm_monoid.to_add_comm_monoid_injective AddCancelCommMonoid.toAddCommMonoid_injective
112
122
113
123
@[to_additive (attr := ext)]
114
- theorem CancelCommMonoid.ext {M : Type *} ⦃m₁ m₂ : CancelCommMonoid M⦄ (h_mul : m₁.mul = m₂.mul) :
124
+ theorem CancelCommMonoid.ext {M : Type *} ⦃m₁ m₂ : CancelCommMonoid M⦄
125
+ (h_mul : (letI := m₁; HMul.hMul : M → M → M) = (letI := m₂; HMul.hMul : M → M → M)) :
115
126
m₁ = m₂ :=
116
127
CancelCommMonoid.toCommMonoid_injective <| CommMonoid.ext h_mul
117
128
#align cancel_comm_monoid.ext CancelCommMonoid.ext
118
129
#align add_cancel_comm_monoid.ext AddCancelCommMonoid.ext
119
130
120
131
@[to_additive (attr := ext)]
121
- theorem DivInvMonoid.ext {M : Type *} ⦃m₁ m₂ : DivInvMonoid M⦄ (h_mul : m₁.mul = m₂.mul)
122
- (h_inv : m₁.inv = m₂.inv) : m₁ = m₂ := by
132
+ theorem DivInvMonoid.ext {M : Type *} ⦃m₁ m₂ : DivInvMonoid M⦄
133
+ (h_mul : (letI := m₁; HMul.hMul : M → M → M) = (letI := m₂; HMul.hMul : M → M → M))
134
+ (h_inv : (letI := m₁; Inv.inv : M → M) = (letI := m₂; Inv.inv : M → M)) : m₁ = m₂ := by
123
135
have h_mon := Monoid.ext h_mul
124
136
have h₁ : m₁.one = m₂.one := congr_arg (·.one) h_mon
125
137
let f : @MonoidHom M M m₁.toMulOneClass m₂.toMulOneClass :=
0 commit comments