Zulip Chat Archive

Stream: Is there code for X?

Topic: negation on module as linear map


Kevin Buzzard (Aug 26 2024 at 15:17):

I can't find this:

import Mathlib.Algebra.Module.LinearMap.Basic

def LinearMap.neg (R : Type*) [Ring R] (A : Type*) [AddCommGroup A] [Module R A] : A →ₗ[R] A where
  toFun := ()
  map_add' := neg_add
  map_smul' r a := (smul_neg r a).symm

Do we not have it? Do we not want it for some reason? Have I named it correctly?

Ruben Van de Velde (Aug 26 2024 at 15:21):

import Mathlib.Algebra.Module.LinearMap.Basic

def LinearMap.neg (R : Type*) [Ring R] (A : Type*) [AddCommGroup A] [Module R A] : A →ₗ[R] A :=
  -LinearMap.id

theorem LinearMap.neg_apply' (R : Type*) [Ring R] (A : Type*) [AddCommGroup A] [Module R A] (x : A) :
    LinearMap.neg R A x = -x := rfl

Eric Wieser (Aug 26 2024 at 15:26):

docs#LinearEquiv.neg

Ruben Van de Velde (Aug 26 2024 at 15:46):

Or that!

Kevin Buzzard (Aug 26 2024 at 16:07):

Thanks both!


Last updated: May 02 2025 at 03:31 UTC