Skip to content

Commit

Permalink
feat(group_theory/subgroup/basic): Add map_is_commutative and `coma…
Browse files Browse the repository at this point in the history
…p_injective_is_commutative` (#16109)

This PR adds `map_is_commutative` and `comap_injective_is_commutative`.
  • Loading branch information
tb65536 committed Aug 23, 2022
1 parent fadfe79 commit 62ac221
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/group_theory/subgroup/basic.lean
Expand Up @@ -1828,6 +1828,25 @@ instance is_commutative.comm_group [h : H.is_commutative] : comm_group H :=
instance center.is_commutative : (center G).is_commutative :=
⟨⟨λ a b, subtype.ext (b.2 a)⟩⟩

@[to_additive] instance map_is_commutative {G' : Type*} [group G'] (f : G →* G')
[H.is_commutative] : (H.map f).is_commutative :=
⟨⟨begin
rintros ⟨-, a, ha, rfl⟩ ⟨-, b, hb, rfl⟩,
rw [subtype.ext_iff, coe_mul, coe_mul, subtype.coe_mk, subtype.coe_mk, ←map_mul, ←map_mul],
exact congr_arg f (subtype.ext_iff.mp (mul_comm ⟨a, ha⟩ ⟨b, hb⟩)),
end⟩⟩

@[to_additive] lemma comap_injective_is_commutative {G' : Type*} [group G'] {f : G' →* G}
(hf : function.injective f) [H.is_commutative] : (H.comap f).is_commutative :=
⟨⟨λ a b, subtype.ext begin
have := mul_comm (⟨f a, a.2⟩ : H) (⟨f b, b.2⟩ : H),
rwa [subtype.ext_iff, coe_mul, coe_mul, coe_mk, coe_mk, ←map_mul, ←map_mul, hf.eq_iff] at this,
end⟩⟩

@[to_additive] instance subgroup_of_is_commutative [H.is_commutative] :
(H.subgroup_of K).is_commutative :=
H.comap_injective_is_commutative subtype.coe_injective

end subgroup

namespace group
Expand Down

0 comments on commit 62ac221

Please sign in to comment.