Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 1fd5195

Browse files
committed
chore(data/equiv/mul_add): review (#2874)
* make `mul_aut` and `add_aut` reducible to get `coe_fn` * add some `coe_*` lemmas
1 parent 7c7e866 commit 1fd5195

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

src/data/equiv/mul_add.lean

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,8 @@ h.to_add_monoid_hom.map_sub x y
182182
@[to_additive "The group of additive automorphisms."]
183183
def mul_aut (M : Type*) [has_mul M] := M ≃* M
184184

185+
attribute [reducible] mul_aut add_aut
186+
185187
namespace mul_aut
186188

187189
variables (M) [has_mul M]
@@ -200,6 +202,9 @@ intros; ext; try { refl }; apply equiv.left_inv
200202

201203
instance : inhabited (mul_aut M) := ⟨1
202204

205+
@[simp] lemma coe_mul (e₁ e₂ : mul_aut M) : ⇑(e₁ * e₂) = e₁ ∘ e₂ := rfl
206+
@[simp] lemma coe_one : ⇑(1 : mul_aut M) = id := rfl
207+
203208
/-- Monoid hom from the group of multiplicative automorphisms to the group of permutations. -/
204209
def to_perm : mul_aut M →* equiv.perm M :=
205210
by refine_struct { to_fun := mul_equiv.to_equiv }; intros; refl
@@ -224,6 +229,9 @@ intros; ext; try { refl }; apply equiv.left_inv
224229

225230
instance : inhabited (add_aut A) := ⟨1
226231

232+
@[simp] lemma coe_mul (e₁ e₂ : add_aut A) : ⇑(e₁ * e₂) = e₁ ∘ e₂ := rfl
233+
@[simp] lemma coe_one : ⇑(1 : add_aut A) = id := rfl
234+
227235
/-- Monoid hom from the group of multiplicative automorphisms to the group of permutations. -/
228236
def to_perm : add_aut A →* equiv.perm A :=
229237
by refine_struct { to_fun := add_equiv.to_equiv }; intros; refl
@@ -265,13 +273,27 @@ protected def mul_left (a : G) : perm G :=
265273
left_inv := assume x, show a⁻¹ * (a * x) = x, from inv_mul_cancel_left a x,
266274
right_inv := assume x, show a * (a⁻¹ * x) = x, from mul_inv_cancel_left a x }
267275

276+
@[simp, to_additive]
277+
lemma coe_mul_left (a : G) : ⇑(equiv.mul_left a) = (*) a := rfl
278+
279+
@[simp, to_additive]
280+
lemma mul_left_symm (a : G) : (equiv.mul_left a).symm = equiv.mul_left a⁻¹ :=
281+
ext $ λ x, rfl
282+
268283
@[to_additive]
269284
protected def mul_right (a : G) : perm G :=
270285
{ to_fun := λx, x * a,
271286
inv_fun := λx, x * a⁻¹,
272287
left_inv := assume x, show (x * a) * a⁻¹ = x, from mul_inv_cancel_right x a,
273288
right_inv := assume x, show (x * a⁻¹) * a = x, from inv_mul_cancel_right x a }
274289

290+
@[simp, to_additive]
291+
lemma coe_mul_right (a : G) : ⇑(equiv.mul_right a) = λ x, x * a := rfl
292+
293+
@[simp, to_additive]
294+
lemma mul_right_symm (a : G) : (equiv.mul_right a).symm = equiv.mul_right a⁻¹ :=
295+
ext $ λ x, rfl
296+
275297
variable (G)
276298

277299
@[to_additive]
@@ -281,6 +303,14 @@ protected def inv : perm G :=
281303
left_inv := assume a, inv_inv a,
282304
right_inv := assume a, inv_inv a }
283305

306+
variable {G}
307+
308+
@[simp, to_additive]
309+
lemma coe_inv : ⇑(equiv.inv G) = has_inv.inv := rfl
310+
311+
@[simp, to_additive]
312+
lemma inv_symm : (equiv.inv G).symm = equiv.inv G := rfl
313+
284314
end group
285315

286316
section point_reflection

0 commit comments

Comments
 (0)