The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V34. The tactics of Mathlib

Mathlib.Tactic.Positivity.Finset

4 declarations. Mathlib docs · Source

def Mathlib.Meta.Positivity.evalFinsetCard E1 #

Mathlib.Meta.Positivity.PositivityExt

Extension for Finset.card. #s is positive if s is nonempty.

It calls Mathlib.Meta.proveFinsetNonempty to attempt proving that the finset is nonempty.

def Mathlib.Meta.Positivity.evalFintypeCard E1 #

Mathlib.Meta.Positivity.PositivityExt

Extension for Fintype.card. Fintype.card α is positive if α is nonempty.

def Mathlib.Meta.Positivity.evalFinsetDens E1 #

Mathlib.Meta.Positivity.PositivityExt

Extension for Finset.dens. s.dens is positive if s is nonempty.

It calls Mathlib.Meta.proveFinsetNonempty to attempt proving that the finset is nonempty.

def Mathlib.Meta.Positivity.evalFinsetSum E1 #

Mathlib.Meta.Positivity.PositivityExt

The positivity extension which proves that ∑ a ∈ s, f a is nonnegative if f is, and positive if either each f i is and s is nonempty, or some f a is where a ∈ s is an assumption.

TODO: The following example does not work

example (s : Finset ℕ) (f : ℕ → ℤ) (hf : ∀ n, 0 ≤ f n) : 0 ≤ s.sum f := by positivity

because compareHyp can't look for assumptions behind binders.