Zulip Chat Archive

Stream: new members

Topic: Sum over range


Violeta Hernández (Nov 22 2024 at 00:59):

What's the preferred Mathlib form for summing a sequence over 0, 1, ..., n - 1? Is it ∑ k : Fin n, _, ∑ k ∈ range n, _, or something else?

Kevin Buzzard (Nov 22 2024 at 06:17):

Does _ want to eat a natural, an integer, a rational, a term of type Fin n,...?

Violeta Hernández (Nov 22 2024 at 06:18):

Something in an arbitrary field

Violeta Hernández (Nov 22 2024 at 06:19):

I figured that since I wanted to use docs#geom_sum_eq I'd be better off using the second form

Kevin Buzzard (Nov 22 2024 at 06:20):

It's also far more fiddly to do induction with the first form

Zhang Qinchuan (Nov 22 2024 at 06:21):

Personally, I prefer Finset.range since Nat is easier to handle compared to Fin n.


Last updated: May 02 2025 at 03:31 UTC