Zulip Chat Archive
Stream: mathlib4
Topic: DFinsupp.sum_smul_index missing
Daniel Weber (May 25 2024 at 03:22):
DFinsupp
has some sum_X_index
lemmas, like Finsupp
, for example docs#DFinsupp.sum_add_index (compare to docs#Finsupp.sum_add_index), but the counterpart for docs#Finsupp.sum_smul_index seems to be missing.
Is there some reason for that, or should it be added?
Yury G. Kudryashov (May 25 2024 at 22:06):
My guess: the only reason is that no one needed it up until now.
Yury G. Kudryashov (May 25 2024 at 22:41):
So, please PR it!
Daniel Weber (Nov 30 2024 at 15:18):
Where should this result be placed?
import Mathlib
variable {δ ι γ : Type*} {β : ι → Type*} [DecidableEq ι]
theorem DFinsupp.sum_smul_index [∀ i, AddMonoid (β i)] [Monoid δ] [∀ i, DistribMulAction δ (β i)] [∀ (i) (x : β i), Decidable (x ≠ 0)] [AddCommMonoid γ]
{g : Π₀ i, β i} {b : δ} {h : ∀ i, β i → γ} (h0 : ∀ i, h i 0 = 0) :
(b • g).sum h = g.sum fun i a => h i (b • a) :=
sum_mapRange_index h0
/--
info: [Mathlib.Algebra.DirectSum.Basic,
Mathlib.Data.DFinsupp.Interval,
Mathlib.Data.DFinsupp.Multiset,
Mathlib.LinearAlgebra.DFinsupp]
-/
#guard_msgs in
#find_home DFinsupp.sum_smul_index
Kim Morrison (Dec 03 2024 at 03:38):
How is this pulling in Mathlib.Algebra.DirectSum.Basic
? That seems weird.
Eric Wieser (Dec 03 2024 at 12:54):
It works fine without the import
Eric Wieser (Dec 03 2024 at 12:57):
find_home
still suggests it after replacing the proof with sorry
, and
#eval Lean.Expr.getUsedConstants q(type_of% @DFinsupp.sum_smul_index.{0,0,0,0})
doesn't mention DirectSum
Daniel Weber (Dec 03 2024 at 13:28):
It's probably because it imports both sum and smul
Eric Wieser (Dec 03 2024 at 13:30):
Ah, I think Kim and I were confusing this with min_imports
?
Kim Morrison (Dec 03 2024 at 22:25):
Ah, indeed. If this statement can happily live in Mathlib.LinearAlgebra.DFinsupp
that seems the most natural out of those four.
Eric Wieser (Dec 03 2024 at 22:28):
Arguably we should create Mathlib.Algebra.BigOperators.DFinsupp
for parity with Finsupp
Eric Wieser (Dec 03 2024 at 22:28):
But that could be a follow-up CL.
Last updated: May 02 2025 at 03:31 UTC