Zulip Chat Archive

Stream: Is there code for X?

Topic: unique Z-module structure on any AddCommGroup


Kenny Lau (Jun 10 2025 at 22:08):

instance uniqueIntModule (R : Type u) [AddCommGroup R] : Unique (Module  R) :=
  ⟨⟨inferInstance, fun m  Module.ext <| funext₂ <| fun n x  Int.induction_on n
    ((m.zero_smul _).trans (zero_smul ..).symm)
    (fun n ih  (m.add_smul ..).trans <| (congr_arg₂ (· + ·) ih (m.one_smul _)).trans <|
      by rw [SMul.smul_eq_hSMul, add_one_zsmul])
    (fun n ih  (m.add_smul ..).trans <| (congr_arg₂ (· + ·) ih (neg_one_smul _ _)).trans <|
      by rw [SMul.smul_eq_hSMul, sub_one_zsmul])

Kenny Lau (Jun 10 2025 at 22:08):

oh wait, it is AddCommGroup.uniqueIntModule lol with the same name

Kenny Lau (Jun 10 2025 at 22:08):

it's not an instance because:

/-- All `ℤ`-module structures are equal. Not an instance since in mathlib all `AddCommGroup`
should normally have exactly one `ℤ`-module structure by design. -/

Kenny Lau (Jun 10 2025 at 22:10):

hmm according to the logic of the doc, maybe I'm having an XY-problem!

Kenny Lau (Jun 10 2025 at 22:19):

moved to #Is there code for X? > failed to synthesize `CommRing (R ⊗[ℤ] Localization M)`


Last updated: Dec 20 2025 at 21:32 UTC