Zulip Chat Archive

Stream: Is there code for X?

Topic: n • G as a subgroup?


Michael Stoll (Dec 14 2025 at 19:55):

Is there really no better way to write the additive subgroup consisting of all n • g for g : G, where G is a commutative additive group, than

QuotientAddGroup.mk (s := map (nsmulAddMonoidHom (α := G) n) 

?
(For n = 2, there is docs#AddSubgroup.even, but I was unable to find a more general version.)
Ideally, I would want to write n • G (which pretty certainly will not work), or at least n • (⊤ : Subgroup G).

Eric Wieser (Dec 14 2025 at 19:59):

docs#AddSubgroup.zmultiples ?

Aaron Liu (Dec 14 2025 at 19:59):

docs#AddSubgroup.zmultiples

Michael Stoll (Dec 14 2025 at 20:00):

That's not what I want: I want g to vary, with n fixed.

Aaron Liu (Dec 14 2025 at 20:00):

oh

Eric Wieser (Dec 14 2025 at 20:00):

Does n • (⊤ : AddSubgroup G) not work?

Michael Stoll (Dec 14 2025 at 20:01):

import Mathlib

variable {G : Type*} [AddCommGroup G]

#synth SMul  (AddSubgroup G) -- fails

Eric Wieser (Dec 14 2025 at 20:03):

open scoped Pointwise

Aaron Liu (Dec 14 2025 at 20:03):

import Mathlib

variable {G : Type*} [AddCommGroup G]

open scoped Pointwise
#synth SMul  (AddSubgroup G) -- failn't

Eric Wieser (Dec 14 2025 at 20:04):

docs#AddSubgroup.pointwiseMulAction is the instance

Michael Stoll (Dec 14 2025 at 20:18):

And while we are at it, is there a more idiomatic way to state that a s : Set G contains representatives of all cosets than

Set.SurjOn (QuotientAddGroup.mk (s := n  ( : AddSubgroup G))) s )

?
There is the left hand side of docs#AddSubgroup.leftCoset_cover_const_iff_surjOn, but it doesn't appear to be more convenient to use...

Snir Broshi (Dec 14 2025 at 20:41):

cosets of which subgroup?

Michael Stoll (Dec 14 2025 at 20:42):

Cosets of n • G. (But which subgroup should not matter so much...)

Snir Broshi (Dec 14 2025 at 20:58):

s • H = ⊤, where H is the subgroup?

Snir Broshi (Dec 14 2025 at 20:58):

or are you looking for a more faithful translation rather than an equivalent statement

Snir Broshi (Dec 14 2025 at 20:59):

(actually I think I assumed we're using multiplication, so maybe we need +ᵥ instead)

Snir Broshi (Dec 14 2025 at 21:01):

import Mathlib

variable {G : Type*} [AddCommGroup G] (s : Set G) (H : AddSubgroup G)

open scoped Pointwise

def ContainsRepresentativesOfAllCosets : Prop := s +ᵥ (H : Set G) = 
-- or `Set.univ` if `⊤` is weird here

Michael Stoll (Dec 14 2025 at 21:23):

Compare docs#AddSubgroup.leftCoset_cover_const_iff_surjOn ...
I'll see if it looks better.

Richard Copley (Dec 19 2025 at 12:59):

Michael Stoll said:

Compare docs#AddSubgroup.leftCoset_cover_const_iff_surjOn ...
I'll see if it looks better.

leftCoset_cover_const_iff_surjOn is really auxiliary to the main results in the file CosetCover which are, by and large, the ones mentioned the file's docstring.

If anything, it would be nice to eliminate leftCoset_cover_const_iff_surjOn in favour of some more generally useful lemma defined closer to the root of the hierarchy.

I don't know if something like the following would help.

import Mathlib.Data.Setoid.Partition
import Mathlib.GroupTheory.Coset.Basic

open scoped Pointwise

namespace Subgroup

variable {G : Type*} [Group G] (H : Subgroup G)

def leftCosets := { c : Set G |  g : G, c = g  H }

theorem _root_.Setoid.isPartition_leftCosets : Setoid.IsPartition H.leftCosets := by
  constructor
  · rw [leftCosets, Set.notMem_setOf_iff]
    push_neg
    intro g
    use g  1
    exact Set.smul_mem_smul_set H.one_mem
  · intro g
    use g  H
    simp [leftCosets, leftCoset_eq_iff, mem_leftCoset_iff,  QuotientGroup.eq]

end Subgroup

example {G : Type*} [Group G] (H : Subgroup G) : ⋃₀ H.leftCosets = Set.univ :=
  (Setoid.isPartition_leftCosets H).sUnion_eq_univ

Michael Stoll (Dec 19 2025 at 14:20):

I'm now stating the condition that n • G has finite index in G as (nsmulAddMonoidHom (α := G) n).range.FiniteIndex, to avoid the problems mentioned in #mathlib4 > SMul diamond on subsets @ 💬 . It's less nice to read, but easier to work with. (See here.)


Last updated: Dec 20 2025 at 21:32 UTC