Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - feat(algebra/direct_sum/module) : coe and internal #10004

Closed
wants to merge 12 commits into from
22 changes: 20 additions & 2 deletions src/algebra/direct_sum/basic.lean
Expand Up @@ -172,13 +172,18 @@ protected def id (M : Type v) (ι : Type* := punit) [add_comm_monoid M] [unique
right_inv := λ x, to_add_monoid_of _ _ _,
..direct_sum.to_add_monoid (λ _, add_monoid_hom.id M) }

/-- The canonical embedding from `⨁ i, A i` to `M`-/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that this docstring should mention that the A i are submonoids of M.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the suggestion

def add_submonoid_coe {M : Type*} [decidable_eq ι] [add_comm_monoid M]
(A : ι → add_submonoid M) : (⨁ i, A i) →+ M :=
direct_sum.to_add_monoid (λ i, (A i).subtype)

/-- The `direct_sum` formed by a collection of `add_submonoid`s of `M` is said to be internal if the
canonical map `(⨁ i, A i) →+ M` is bijective.

See `direct_sum.add_subgroup_is_internal` for the same statement about `add_subgroup`s. -/
def add_submonoid_is_internal {M : Type*} [decidable_eq ι] [add_comm_monoid M]
(A : ι → add_submonoid M) : Prop :=
function.bijective (direct_sum.to_add_monoid (λ i, (A i).subtype) : (⨁ i, A i) →+ M)
function.bijective (direct_sum.add_submonoid_coe A)

lemma add_submonoid_is_internal.supr_eq_top {M : Type*} [decidable_eq ι] [add_comm_monoid M]
(A : ι → add_submonoid M)
Expand All @@ -188,13 +193,26 @@ begin
exact function.bijective.surjective h,
end

/-- The canonical embedding from `⨁ i, A i` to `M`-/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Idem.

def add_subgroup_coe {M : Type*} [decidable_eq ι] [add_comm_group M]
(A : ι → add_subgroup M) : (⨁ i, A i) →+ M :=
direct_sum.to_add_monoid (λ i, (A i).subtype)

@[simp] lemma add_group_coe_of {M : Type*} [decidable_eq ι] [add_comm_group M]
jjaassoonn marked this conversation as resolved.
Show resolved Hide resolved
(A : ι → add_subgroup M) (i : ι) (x : A i) :
direct_sum.add_subgroup_coe A (direct_sum.of (λ i, A i) i x) = x :=
jjaassoonn marked this conversation as resolved.
Show resolved Hide resolved
begin
eric-wieser marked this conversation as resolved.
Show resolved Hide resolved
rw [direct_sum.add_subgroup_coe, direct_sum.to_add_monoid_of],
simp only [add_subgroup.coe_subtype],
end

/-- The `direct_sum` formed by a collection of `add_subgroup`s of `M` is said to be internal if the
canonical map `(⨁ i, A i) →+ M` is bijective.

See `direct_sum.submodule_is_internal` for the same statement about `submodules`s. -/
def add_subgroup_is_internal {M : Type*} [decidable_eq ι] [add_comm_group M]
(A : ι → add_subgroup M) : Prop :=
function.bijective (direct_sum.to_add_monoid (λ i, (A i).subtype) : (⨁ i, A i) →+ M)
function.bijective (direct_sum.add_subgroup_coe A)

lemma add_subgroup_is_internal.to_add_submonoid
{M : Type*} [decidable_eq ι] [add_comm_group M] (A : ι → add_subgroup M) :
Expand Down
6 changes: 5 additions & 1 deletion src/algebra/direct_sum/module.lean
Expand Up @@ -194,6 +194,10 @@ lemma component.of (i j : ι) (b : M j) :
if h : j = i then eq.rec_on h b else 0 :=
dfinsupp.single_apply

def submodule_coe {R M : Type*} [semiring R] [add_comm_monoid M] [module R M]
(A : ι → submodule R M) : (⨁ i, A i) →ₗ[R] M :=
direct_sum.to_module R ι M (λ i, (A i).subtype)

/-- The `direct_sum` formed by a collection of `submodule`s of `M` is said to be internal if the
canonical map `(⨁ i, A i) →ₗ[R] M` is bijective.

Expand All @@ -202,7 +206,7 @@ For the alternate statement in terms of independence and spanning, see
def submodule_is_internal {R M : Type*}
[semiring R] [add_comm_monoid M] [module R M]
(A : ι → submodule R M) : Prop :=
function.bijective (to_module R ι M (λ i, (A i).subtype))
function.bijective (direct_sum.submodule_coe A)

lemma submodule_is_internal.to_add_submonoid {R M : Type*}
[semiring R] [add_comm_monoid M] [module R M] (A : ι → submodule R M) :
Expand Down