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

Commit 12bd22b

Browse files
PatrickMassotdigama0
authored andcommitted
Group morphisms (#30)
* feat(algebra/group): morphisms and antimorphisms Definitions, image of one and inverses, and computation on a product of more than two elements in big_operators.
1 parent 37c3120 commit 12bd22b

File tree

2 files changed

+81
-0
lines changed

2 files changed

+81
-0
lines changed

algebra/big_operators.lean

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,3 +304,37 @@ finset.induction_on s (by simp [abs_zero]) $
304304
end discrete_linear_ordered_field
305305

306306
end finset
307+
308+
section group
309+
310+
open list
311+
variables [group α] [group β]
312+
313+
lemma mph_prod (f : α → β) (hom : is_group_hom f) (l : list α) :
314+
f (prod l) = prod (map f l) :=
315+
begin
316+
induction l,
317+
case nil :
318+
{ simp[group_hom.one hom] },
319+
case cons : hd tl IH
320+
{ simp,
321+
rw hom,
322+
simp[IH] }
323+
end
324+
325+
lemma anti_mph_prod (f : α → β) (anti_mph : is_group_anti_hom f) (l : list α) :
326+
f (prod l) = prod (map f (reverse l)) :=
327+
begin
328+
induction l,
329+
case nil :
330+
{ simp [group_anti_hom.one anti_mph] },
331+
case cons : hd tl IH
332+
{ simp,
333+
rw anti_mph,
334+
simp[IH] }
335+
end
336+
337+
-- Following lemma could also be proved directly by "by induction l; simp *"
338+
lemma inv_prod (l : list α) : (prod l)⁻¹ = prod (map (λ x, x⁻¹) (reverse l)) :=
339+
anti_mph_prod (λ x, x⁻¹) group_anti_hom.inv_is_group_anti_hom l
340+
end group

algebra/group.lean

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,3 +322,50 @@ theorem sub_le_iff_le_add {a b c : α} : a - c ≤ b ↔ a ≤ b + c :=
322322
by rw [add_comm]; exact ⟨le_add_of_sub_left_le, sub_left_le_of_le_add⟩
323323

324324
end ordered_comm_group
325+
326+
327+
variables { β : Type*} [group α] [group β] {a b : α}
328+
329+
@[simp]
330+
def is_group_hom (f : α → β) : Prop :=
331+
∀ a b : α, f(a*b) = f(a)*f(b)
332+
333+
namespace group_hom
334+
@[simp]
335+
lemma one { f : α → β } (H : is_group_hom f) : f 1 = 1 :=
336+
mul_self_iff_eq_one.1 (eq.symm (
337+
calc f 1 = f (1*1) : by simp
338+
... = (f 1)*(f 1) : by rw[H 1 1]))
339+
340+
@[simp]
341+
lemma inv { f : α → β } (H : is_group_hom f) : (f a)⁻¹ = f (a⁻¹) :=
342+
inv_eq_of_mul_eq_one (
343+
calc (f a) * (f a⁻¹) = f (a * a⁻¹) : by rw[H a a⁻¹]
344+
... = f 1 : by simp
345+
... = 1 : by rw[one H])
346+
347+
end group_hom
348+
349+
@[simp]
350+
def is_group_anti_hom (f : α → β) : Prop :=
351+
∀ a b : α, f(a*b) = f(b)*f(a)
352+
353+
namespace group_anti_hom
354+
@[simp]
355+
lemma one { f : α → β } (H : is_group_anti_hom f) : f 1 = 1 :=
356+
mul_self_iff_eq_one.1 (eq.symm (
357+
calc f 1 = f (1*1) : by simp
358+
... = (f 1)*(f 1) : by rw[H 1 1]))
359+
360+
@[simp]
361+
lemma inv { f : α → β } (H : is_group_anti_hom f) : (f a)⁻¹ = f (a⁻¹) :=
362+
inv_eq_of_mul_eq_one (
363+
calc (f a) * (f a⁻¹) = f (a⁻¹ * a) : by rw[H a⁻¹ a]
364+
... = f 1 : by simp
365+
... = 1 : by rw[one H])
366+
367+
368+
lemma inv_is_group_anti_hom : is_group_anti_hom (λ x : α, x⁻¹) :=
369+
mul_inv_rev
370+
371+
end group_anti_hom

0 commit comments

Comments
 (0)