Documentation

Mathlib.Data.Set.Equitable

Equitable functions #

This file defines equitable functions.

A function f is equitable on a set s if f a₁ ≤ f a₂ + 1≤ f a₂ + 1 for all a₁, a₂ ∈ s∈ s. This is mostly useful when the codomain of f is or (or more generally a successor order).

TODO #

can be replaced by any SuccOrder + ConditionallyCompleteMonoid, but we don't have the latter yet.

def Set.EquitableOn {α : Type u_1} {β : Type u_2} [inst : LE β] [inst : Add β] [inst : One β] (s : Set α) (f : αβ) :

A set is equitable if no element value is more than one bigger than another.

Equations
@[simp]
theorem Set.equitableOn_empty {α : Type u_2} {β : Type u_1} [inst : LE β] [inst : Add β] [inst : One β] (f : αβ) :
theorem Set.equitableOn_iff_exists_le_le_add_one {α : Type u_1} {s : Set α} {f : α} :
Set.EquitableOn s f b, ∀ (a : α), a sb f a f a b + 1
theorem Set.equitableOn_iff_exists_image_subset_icc {α : Type u_1} {s : Set α} {f : α} :
Set.EquitableOn s f b, f '' s Set.Icc b (b + 1)
theorem Set.equitableOn_iff_exists_eq_eq_add_one {α : Type u_1} {s : Set α} {f : α} :
Set.EquitableOn s f b, ∀ (a : α), a sf a = b f a = b + 1
theorem Set.Subsingleton.equitableOn {α : Type u_1} {β : Type u_2} [inst : OrderedSemiring β] {s : Set α} (hs : Set.Subsingleton s) (f : αβ) :
theorem Set.equitableOn_singleton {α : Type u_1} {β : Type u_2} [inst : OrderedSemiring β] (a : α) (f : αβ) :
theorem Finset.equitableOn_iff_le_le_add_one {α : Type u_1} {s : Finset α} {f : α} :
Set.EquitableOn (s) f ∀ (a : α), a s(Finset.sum s fun i => f i) / Finset.card s f a f a (Finset.sum s fun i => f i) / Finset.card s + 1
theorem Finset.EquitableOn.le {α : Type u_1} {s : Finset α} {f : α} {a : α} (h : Set.EquitableOn (s) f) (ha : a s) :
(Finset.sum s fun i => f i) / Finset.card s f a
theorem Finset.EquitableOn.le_add_one {α : Type u_1} {s : Finset α} {f : α} {a : α} (h : Set.EquitableOn (s) f) (ha : a s) :
f a (Finset.sum s fun i => f i) / Finset.card s + 1
theorem Finset.equitableOn_iff {α : Type u_1} {s : Finset α} {f : α} :
Set.EquitableOn (s) f ∀ (a : α), a sf a = (Finset.sum s fun i => f i) / Finset.card s f a = (Finset.sum s fun i => f i) / Finset.card s + 1