# mathlibdocumentation

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 for all a₁, a₂ ∈ s. This is mostly useful when the codomain of f is ℕ or ℤ (or more generally a successor order).

## TODO #

ℕ can be replaced by any succ_order + conditionally_complete_monoid, but we don't have the latter yet.

def set.equitable_on {α : Type u_1} {β : Type u_2} [has_le β] [has_add β] [has_one β] (s : set α) (f : α → β) :
Prop

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

Equations
@[simp]
theorem set.equitable_on_empty {α : Type u_1} {β : Type u_2} [has_le β] [has_add β] [has_one β] (f : α → β) :
theorem set.equitable_on_iff_exists_le_le_add_one {α : Type u_1} {s : set α} {f : α → } :
s.equitable_on f ∃ (b : ), ∀ (a : α), a sb f a f a b + 1
theorem set.equitable_on_iff_exists_image_subset_Icc {α : Type u_1} {s : set α} {f : α → } :
s.equitable_on f ∃ (b : ), f '' s (b + 1)
theorem set.equitable_on_iff_exists_eq_eq_add_one {α : Type u_1} {s : set α} {f : α → } :
s.equitable_on f ∃ (b : ), ∀ (a : α), a sf a = b f a = b + 1
theorem set.subsingleton.equitable_on {α : Type u_1} {β : Type u_2} {s : set α} (hs : s.subsingleton) (f : α → β) :
theorem set.equitable_on_singleton {α : Type u_1} {β : Type u_2} (a : α) (f : α → β) :
theorem finset.equitable_on_iff_le_le_add_one {α : Type u_1} {s : finset α} {f : α → } :
∀ (a : α), a ss.sum (λ (i : α), f i) / s.card f a f a s.sum (λ (i : α), f i) / s.card + 1
theorem finset.equitable_on.le {α : Type u_1} {s : finset α} {f : α → } {a : α} (h : s.equitable_on f) (ha : a s) :
s.sum (λ (i : α), f i) / s.card f a
theorem finset.equitable_on.le_add_one {α : Type u_1} {s : finset α} {f : α → } {a : α} (h : s.equitable_on f) (ha : a s) :
f a s.sum (λ (i : α), f i) / s.card + 1
theorem finset.equitable_on_iff {α : Type u_1} {s : finset α} {f : α → } :
∀ (a : α), a sf a = s.sum (λ (i : α), f i) / s.card f a = s.sum (λ (i : α), f i) / s.card + 1