Zulip Chat Archive

Stream: new members

Topic: split sum


Alex Zhang (Jun 09 2021 at 08:42):

How can I split the following sum? (I.e. how to prove hh?)

import algebra.big_operators.basic
import data.real.basic
import data.set.function

open function

open_locale big_operators

lemma test
  (n : ) (x y:   ) (σ : fin n  fin n) (perm: bijective σ): tt :=
begin
  induction n with n ih,
  {simp,},
  have hh:
   (i : fin n.succ), x i * y (n.succ - i - 1)
  =x n * y (σ n) +  (i : fin n), x i * y (n.succ - i - 1),
  {sorry},
end

Kevin Buzzard (Jun 09 2021 at 09:02):

The machinery we have in lean for doing this kind of maths question is all set up for finset.sum over finset.range so if I was faced with that goal I would translate into that language, but if I were faced with that mathematics then I would try and avoid summing over fin n completely

Kevin Buzzard (Jun 09 2021 at 09:04):

If you can express everything in this more idiomatic way then a theorem called something like docs#finset.sum_range_succ should do it

Eric Wieser (Jun 09 2021 at 09:07):

Your statement must be false, because you've assumed y n = y (σ n) for all σ.

Eric Wieser (Jun 09 2021 at 09:08):

Are you missing a second σ somewhere on either the LHS or RHS?

Eric Wieser (Jun 09 2021 at 09:11):

I think the lemma you're after is docs#fin.sum_univ_cast_succ, anyway

Alex Zhang (Jun 09 2021 at 09:12):

I removed y completely now.

Kevin Buzzard (Jun 09 2021 at 09:13):

aah excellent, I didn't know we had the corresponding lemma for sums over fin. Thanks Eric.

Eric Wieser (Jun 09 2021 at 09:15):

In future Alex, can you make a true #mwe? One easy way to do so is write extract_goal at the sorry that you're actually stuck at, and then use that instead:

example {R} [ring R] (n : ) (x :   R)  :
   (i : fin n.succ), x i = x n +  (i : fin n), x i :=
sorry

Alex Zhang (Jun 09 2021 at 09:17):

Thanks for your advice!

Kevin Buzzard (Jun 09 2021 at 09:18):

PS tt is a bool, if you want a Prop there's true

Alex Zhang (Jun 09 2021 at 09:23):

Suppose I want to use the theorem finset.sum_range_succ, but I don't know whether it exits and what its name is. How can I locate it?

Eric Wieser (Jun 09 2021 at 09:47):

library_search

Kevin Buzzard (Jun 09 2021 at 10:25):

Or observe that you're trying to simplify the sum over range (succ n) and so start guessing the name and use ctrl-space to help you look for possible helpful theorems


Last updated: Dec 20 2023 at 11:08 UTC