@@ -7,6 +7,7 @@ import Mathlib.Algebra.BigOperators.Finsupp
7
7
import Mathlib.Algebra.Group.Action.Basic
8
8
import Mathlib.Algebra.Module.Basic
9
9
import Mathlib.Algebra.Regular.SMul
10
+ import Mathlib.Data.Finsupp.SMulWithZero
10
11
import Mathlib.Data.Rat.BigOperators
11
12
12
13
/-!
@@ -1285,25 +1286,11 @@ end
1285
1286
1286
1287
section
1287
1288
1288
- instance smulZeroClass [Zero M] [SMulZeroClass R M] : SMulZeroClass R (α →₀ M) where
1289
- smul a v := v.mapRange (a • ·) (smul_zero _)
1290
- smul_zero a := by
1291
- ext
1292
- apply smul_zero
1293
-
1294
1289
/-!
1295
1290
Throughout this section, some `Monoid` and `Semiring` arguments are specified with `{}` instead of
1296
1291
`[]`. See note [implicit instance arguments].
1297
1292
-/
1298
1293
1299
- @[simp, norm_cast]
1300
- theorem coe_smul [Zero M] [SMulZeroClass R M] (b : R) (v : α →₀ M) : ⇑(b • v) = b • ⇑v :=
1301
- rfl
1302
-
1303
- theorem smul_apply [Zero M] [SMulZeroClass R M] (b : R) (v : α →₀ M) (a : α) :
1304
- (b • v) a = b • v a :=
1305
- rfl
1306
-
1307
1294
theorem _root_.IsSMulRegular.finsupp [Zero M] [SMulZeroClass R M] {k : R}
1308
1295
(hk : IsSMulRegular M k) : IsSMulRegular (α →₀ M) k :=
1309
1296
fun _ _ h => ext fun i => hk (DFunLike.congr_fun h i)
@@ -1314,46 +1301,21 @@ instance faithfulSMul [Nonempty α] [Zero M] [SMulZeroClass R M] [FaithfulSMul R
1314
1301
let ⟨a⟩ := ‹Nonempty α›
1315
1302
eq_of_smul_eq_smul fun m : M => by simpa using DFunLike.congr_fun (h (single a m)) a
1316
1303
1317
- instance instSMulWithZero [Zero R] [Zero M] [SMulWithZero R M] : SMulWithZero R (α →₀ M) where
1318
- zero_smul f := by ext i; exact zero_smul _ _
1319
-
1320
1304
variable (α M)
1321
1305
1322
- instance distribSMul [AddZeroClass M] [DistribSMul R M] : DistribSMul R (α →₀ M) where
1323
- smul := (· • ·)
1324
- smul_add _ _ _ := ext fun _ => smul_add _ _ _
1325
- smul_zero _ := ext fun _ => smul_zero _
1326
-
1327
1306
instance distribMulAction [Monoid R] [AddMonoid M] [DistribMulAction R M] :
1328
1307
DistribMulAction R (α →₀ M) :=
1329
1308
{ Finsupp.distribSMul _ _ with
1330
1309
one_smul := fun x => ext fun y => one_smul R (x y)
1331
1310
mul_smul := fun r s x => ext fun y => mul_smul r s (x y) }
1332
1311
1333
- instance isScalarTower [Zero M] [SMulZeroClass R M] [SMulZeroClass S M] [SMul R S]
1334
- [IsScalarTower R S M] : IsScalarTower R S (α →₀ M) where
1335
- smul_assoc _ _ _ := ext fun _ => smul_assoc _ _ _
1336
-
1337
- instance smulCommClass [Zero M] [SMulZeroClass R M] [SMulZeroClass S M] [SMulCommClass R S M] :
1338
- SMulCommClass R S (α →₀ M) where
1339
- smul_comm _ _ _ := ext fun _ => smul_comm _ _ _
1340
-
1341
- instance isCentralScalar [Zero M] [SMulZeroClass R M] [SMulZeroClass Rᵐᵒᵖ M] [IsCentralScalar R M] :
1342
- IsCentralScalar R (α →₀ M) where
1343
- op_smul_eq_smul _ _ := ext fun _ => op_smul_eq_smul _ _
1344
-
1345
1312
instance module [Semiring R] [AddCommMonoid M] [Module R M] : Module R (α →₀ M) :=
1346
1313
{ toDistribMulAction := Finsupp.distribMulAction α M
1347
1314
zero_smul := fun _ => ext fun _ => zero_smul _ _
1348
1315
add_smul := fun _ _ _ => ext fun _ => add_smul _ _ _ }
1349
1316
1350
1317
variable {α M}
1351
1318
1352
- theorem support_smul [AddMonoid M] [SMulZeroClass R M] {b : R} {g : α →₀ M} :
1353
- (b • g).support ⊆ g.support := fun a => by
1354
- simp only [smul_apply, mem_support_iff, Ne]
1355
- exact mt fun h => h.symm ▸ smul_zero _
1356
-
1357
1319
@[simp]
1358
1320
theorem support_smul_eq [Semiring R] [AddCommMonoid M] [Module R M] [NoZeroSMulDivisors R M] {b : R}
1359
1321
(hb : b ≠ 0 ) {g : α →₀ M} : (b • g).support = g.support :=
@@ -1376,25 +1338,11 @@ theorem mapDomain_smul {_ : Monoid R} [AddCommMonoid M] [DistribMulAction R M] {
1376
1338
(v : α →₀ M) : mapDomain f (b • v) = b • mapDomain f v :=
1377
1339
mapDomain_mapRange _ _ _ _ (smul_add b)
1378
1340
1379
- @[simp]
1380
- theorem smul_single [Zero M] [SMulZeroClass R M] (c : R) (a : α) (b : M) :
1381
- c • Finsupp.single a b = Finsupp.single a (c • b) :=
1382
- mapRange_single
1383
-
1384
1341
-- Porting note: removed `simp` because `simpNF` can prove it.
1385
1342
theorem smul_single' {_ : Semiring R} (c : R) (a : α) (b : R) :
1386
1343
c • Finsupp.single a b = Finsupp.single a (c * b) :=
1387
1344
smul_single _ _ _
1388
1345
1389
- theorem mapRange_smul {_ : Monoid R} [AddMonoid M] [DistribMulAction R M] [AddMonoid N]
1390
- [DistribMulAction R N] {f : M → N} {hf : f 0 = 0 } (c : R) (v : α →₀ M)
1391
- (hsmul : ∀ x, f (c • x) = c • f x) : mapRange f hf (c • v) = c • mapRange f hf v := by
1392
- erw [← mapRange_comp]
1393
- · have : f ∘ (c • ·) = (c • ·) ∘ f := funext hsmul
1394
- simp_rw [this]
1395
- apply mapRange_comp
1396
- simp only [Function.comp_apply, smul_zero, hf]
1397
-
1398
1346
theorem smul_single_one [Semiring R] (a : α) (b : R) : b • single a (1 : R) = single a b := by
1399
1347
rw [smul_single, smul_eq_mul, mul_one]
1400
1348
@@ -1701,4 +1649,4 @@ end Sigma
1701
1649
1702
1650
end Finsupp
1703
1651
1704
- set_option linter.style.longFile 1900
1652
+ set_option linter.style.longFile 1700
0 commit comments