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: In a ring, sets act on submodules #7140

Closed
wants to merge 47 commits into from

Conversation

jjaassoonn
Copy link
Collaborator

If $M$ is an $R$-module, $N$ a submodule and $S$ a subset of $R$. Then we can define $S \cdot N$ to be the smallest submodule containing all $s \cdot n$ where $s \in S$ and $n \in N$


Open in Gitpod

@jjaassoonn jjaassoonn added t-algebra Algebra (groups, rings, fields etc) awaiting-review The author would like community review of the PR awaiting-CI labels Sep 13, 2023
@alreadydone
Copy link
Contributor

I think in locale Pointwise this is even a MulAction.

@jjaassoonn
Copy link
Collaborator Author

I think in locale Pointwise this is even a MulAction.

It is a distributive multicative action! Thanks for pointing this out.

@alreadydone
Copy link
Contributor

alreadydone commented Sep 15, 2023

It is a distributive multicative action! Thanks for pointing this out.

Thanks for confirming! If Set R were a Semiring I think we can also show it's a Module, but it's not (distributivity doesn't hold). So we have to wait until we generalize the typeclass assumptions of Module for that.

@eric-wieser
Copy link
Member

! If Set R were a Semiring

It is when using the SetSemiring alias

@eric-wieser
Copy link
Member

I think we might already have a Module (Ideal R) (Submodule R M) instance; is this new instance the same a that one composed with Ideal.span?

@alreadydone
Copy link
Contributor

alreadydone commented Sep 16, 2023

It is when using the SetSemiring alias

That's using union as addition, not pointwise addition inherited from addition on R.

I think we might already have a Module (Ideal R) (Submodule R M) instance; is this new instance the same a that one composed with Ideal.span?

I think yes (and loogle found Submodule.moduleSubmodule). (Should we restrict to CommSemiring?)

@jjaassoonn
Copy link
Collaborator Author

It is when using the SetSemiring alias

That's using union as addition, not pointwise addition inherited from addition on R.

I think we might already have a Module (Ideal R) (Submodule R M) instance; is this new instance the same a that one composed with Ideal.span?

I think yes (and loogle found Submodule.moduleSubmodule). (Should we restrict to CommSemiring?)

Should I re-implement this in terms of span composing with soul then?

@eric-wieser
Copy link
Member

I suspect this has the same problem as you remarked about for the case of non-commutative rings R

@eric-wieser
Copy link
Member

Do you actually care about the non-commutative case?

@jjaassoonn
Copy link
Collaborator Author

jjaassoonn commented Sep 16, 2023

Do you actually care about the non-commutative case?

No,not really. But we should have it work for noncomm cases in case other people care about them right?

@jjaassoonn
Copy link
Collaborator Author

If these lemmas are already in the Submodule namespace, maybe we don't need to repeat submodule in the lemma name?

submodule has been removed from all names

Let `s ⊆ R` be a set and `N ≤ M` be a submodule, then `s • N` is the smallest submodule containing
all `r • n` where `r ∈ s` and `n ∈ N`.
-/
protected def pointwiseSetSMul : SMul (Set R) (Submodule R M) where
Copy link
Member

Choose a reason for hiding this comment

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

This generalizes to

Suggested change
protected def pointwiseSetSMul : SMul (Set R) (Submodule R M) where
protected def pointwiseSetSMul : SMul (Set S) (Submodule R M) where

right? How may of the other results also generalize for free?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

What is S here? Is it another ring of which M is a module?

Copy link
Member

Choose a reason for hiding this comment

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

Yes; or more generally, a monoid for which it is a distribMulAction.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Everything upto induction principal should work mutatis mutandis. My hunch is that if we further assume [SMulCommClass R S M] then everything should work?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

So the generalized principal is this

variable {s N} in
@[elab_as_elim]
lemma set_smul_inductionOn {motive : (x : M) → (_ : x ∈ s • N) → Prop}
    (x : M)
    (hx : x ∈ s • N)
    (smul₀ : ∀ ⦃r : S⦄ ⦃n : M⦄ (mem₁ : r ∈ s) (mem₂ : n ∈ N),
      motive (r • n) (mem_set_smul_of_mem_mem mem₁ mem₂))
    (smul₁ : ∀ (r : R) ⦃m : M⦄ (mem : m ∈ s • N) ,
      motive m mem → motive (r • m) (Submodule.smul_mem _ r mem)) --
    (add : ∀ ⦃m₁ m₂ : M⦄ (mem₁: m₁ ∈ s • N) (mem₂ : m₂ ∈ s • N),
      motive m₁ mem₁ → motive m₂ mem₂ → motive (m₁ + m₂) (Submodule.add_mem _ mem₁ mem₂))
    (zero : motive 0 (Submodule.zero_mem _)) :
    motive x hx :=
  let ⟨_, h⟩ := set_smul_le s N
    { carrier := { m | ∃ (mem : m ∈ s • N), motive m mem },
      zero_mem' := ⟨Submodule.zero_mem _, zero⟩
      add_mem' := fun ⟨mem, h⟩ ⟨mem', h'⟩ ↦ ⟨_, add mem mem' h h'⟩
      smul_mem' := fun r x ⟨mem, h⟩ ↦ ⟨_, smul₁ r mem h⟩ }
    (fun _ _ mem mem' ↦ ⟨mem_set_smul_of_mem_mem mem mem', smul₀ mem mem'⟩) hx
  h

But to change the next lemma

lemma set_smul_eq_map [SMulCommClass R R N] [Module S N]  [SMulCommClass S R N] :
    s • N =
    Submodule.map
      (N.subtype.comp (Finsupp.lsum R <| DistribMulAction.toLinearMap _ _))
      (Finsupp.supported N R s) := by

I need N to be both a R-submodule and S-submodule, so I included [Module S N], can I somehow say this module structure is restricted from [Module S M], or should I just I added some assumption like \forall s \in S, n \in N, s \bu n \in N

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Is perhaps Subbimodule relevant?

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 I would just leave this one ungeneralized

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In 7d37123 and eecb383, the generalization has been done. Things that are not generalized were left some comments explaining why they can't or won't be generalized

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

If we generalize so that r • N makes sense for all r : S, then Submodule.singleton_set_smul
and Submodule.singleton_set_smul can be generalized as well. We can prove x ∈ ({r} : Set S) • N ↔ ∃ (m : M), m ∈ N ∧ x = r • m but we can't say ({r} : Set R) • N = r • N

@erdOne
Copy link
Member

erdOne commented Dec 26, 2023

LGTM modulo the minor comment above
maintainer merge

Copy link

🚀 Pull request has been placed on the maintainer queue by erdOne.

Co-authored-by: Johan Commelin <johan@commelin.net>
Copy link
Member

@jcommelin jcommelin left a comment

Choose a reason for hiding this comment

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

bors merge

@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added ready-to-merge This PR has been sent to bors. and removed awaiting-review The author would like community review of the PR labels Dec 27, 2023
mathlib-bors bot pushed a commit that referenced this pull request Dec 27, 2023
If $M$ is an $R$-module, $N$ a submodule and $S$ a subset of $R$. Then we can define $S \cdot N$ to be the smallest submodule containing all $s \cdot n$ where $s \in S$ and $n \in N$



Co-authored-by: Johan Commelin <johan@commelin.net>
Co-authored-by: Mario Carneiro <di.gama@gmail.com>
@mathlib-bors
Copy link

mathlib-bors bot commented Dec 27, 2023

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title feat: In a ring, sets act on submodules [Merged by Bors] - feat: In a ring, sets act on submodules Dec 27, 2023
@mathlib-bors mathlib-bors bot closed this Dec 27, 2023
@mathlib-bors mathlib-bors bot deleted the zjj/set_smul_submodule branch December 27, 2023 06:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge This PR has been sent to bors. t-algebra Algebra (groups, rings, fields etc)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants