Zulip Chat Archive

Stream: Is there code for X?

Topic: Finset sum lt iff sum of coerced


Malvin Gattinger (Jan 27 2024 at 21:05):

Is there a theorem like this already in mathlib that I did not find? Or other theorems to for Finset.sum and ofNat?

import Mathlib.Data.Finset.Basic
import Mathlib.Algebra.BigOperators.Order

theorem extracted {X Y : Finset α} {f : α  Nat} :
    Finset.sum X f < Finset.sum Y f
   (Finset.sum X fun x => ((f x) : Int)) < Finset.sum Y fun x => (f x) :=
  by
  sorry

Kevin Buzzard (Jan 27 2024 at 21:42):

import Mathlib.Tactic

variable (α : Type 32)

theorem extracted {X Y : Finset α} {f : α  Nat} :
    Finset.sum X f < Finset.sum Y f
   (Finset.sum X fun x => ((f x) : Int)) < Finset.sum Y fun x => (f x) :=
  by zify

Malvin Gattinger (Jan 28 2024 at 09:09):

Thank you!


Last updated: May 02 2025 at 03:31 UTC