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 / V03. Sets, finite structures and big operators

Mathlib.Data.Finset.Interval

23 declarations. Mathlib docs · Source

Intervals of finsets as finsets

This file provides the LocallyFiniteOrder instance for Finset α and calculates the cardinality of finite intervals of finsets.

If s t : Finset α, then Finset.Icc s t is the finset of finsets which include s and are included in t. For example, Finset.Icc {0, 1} {0, 1, 2, 3} = {{0, 1}, {0, 1, 2}, {0, 1, 3}, {0, 1, 2, 3}} and Finset.Icc {0, 1, 2} {0, 1, 3} = {}.

In addition, this file gives characterizations of monotone and strictly monotone functions out of Finset α in terms of Finset.insert

instance Finset.instLocallyFiniteOrder E0 #

{α : Type u_1} → [DecidableEq α] → LocallyFiniteOrder (Finset α)

LocallyFiniteOrder instance for Finset α.

We provide an optimized definition for Finset.Icc (s : Finset α) t, then define the other intervals based on Icc.

We do not define, e.g., Finset.Ico based on Finset.ssubsets, because it would require more code without performance gain.

theorem Finset.Icc_eq_filter_powerset E1 #

∀ {α : Type u_1} [inst : DecidableEq α] (s t : Finset α), Finset.Icc s t = {u ∈ t.powerset | s ⊆ u}

theorem Finset.Ico_eq_filter_ssubsets E1 #

∀ {α : Type u_1} [inst : DecidableEq α] (s t : Finset α), Finset.Ico s t = {u ∈ t.ssubsets | s ⊆ u}

theorem Finset.Ioc_eq_filter_powerset E1 #

∀ {α : Type u_1} [inst : DecidableEq α] (s t : Finset α), Finset.Ioc s t = {u ∈ t.powerset | s ⊂ u}

theorem Finset.Ioo_eq_filter_ssubsets E1 #

∀ {α : Type u_1} [inst : DecidableEq α] (s t : Finset α), Finset.Ioo s t = {u ∈ t.ssubsets | s ⊂ u}

theorem Finset.Iic_eq_powerset E1 #

∀ {α : Type u_1} [inst : DecidableEq α] (s : Finset α), Finset.Iic s = s.powerset

theorem Finset.Iio_eq_ssubsets E1 #

∀ {α : Type u_1} [inst : DecidableEq α] (s : Finset α), Finset.Iio s = s.ssubsets

theorem Finset.Icc_eq_image_powerset E1 #

∀ {α : Type u_1} [inst : DecidableEq α] {s t : Finset α},
  s ⊆ t → Finset.Icc s t = Finset.image (fun x ↦ s ∪ x) (t \ s).powerset

theorem Finset.Ico_eq_image_ssubsets E1 #

∀ {α : Type u_1} [inst : DecidableEq α] {s t : Finset α},
  s ⊆ t → Finset.Ico s t = Finset.image (fun x ↦ s ∪ x) (t \ s).ssubsets

theorem Finset.card_Icc_finset E1 #

∀ {α : Type u_1} [inst : DecidableEq α] {s t : Finset α}, s ⊆ t → (Finset.Icc s t).card = 2 ^ (t.card - s.card)

Cardinality of a non-empty Icc of finsets.

theorem Finset.card_Ico_finset E1 #

∀ {α : Type u_1} [inst : DecidableEq α] {s t : Finset α}, s ⊆ t → (Finset.Ico s t).card = 2 ^ (t.card - s.card) - 1

Cardinality of an Ico of finsets.

theorem Finset.card_Ioc_finset E1 #

∀ {α : Type u_1} [inst : DecidableEq α] {s t : Finset α}, s ⊆ t → (Finset.Ioc s t).card = 2 ^ (t.card - s.card) - 1

Cardinality of an Ioc of finsets.

theorem Finset.card_Ioo_finset E1 #

∀ {α : Type u_1} [inst : DecidableEq α] {s t : Finset α}, s ⊆ t → (Finset.Ioo s t).card = 2 ^ (t.card - s.card) - 2

Cardinality of an Ioo of finsets.

theorem Finset.card_Iic_finset E1 #

∀ {α : Type u_1} [inst : DecidableEq α] {s : Finset α}, (Finset.Iic s).card = 2 ^ s.card

Cardinality of an Iic of finsets.

theorem Finset.card_Iio_finset E1 #

∀ {α : Type u_1} [inst : DecidableEq α] {s : Finset α}, (Finset.Iio s).card = 2 ^ s.card - 1

Cardinality of an Iio of finsets.

theorem Finset.monotone_iff_forall_le_cons E1 #

∀ {α : Type u_1} {β : Type u_2} [inst : Preorder β] {f : Finset α → β},
  Monotone f ↔ ∀ (s : Finset α) ⦃a : α⦄ (ha : a ∉ s), f s ≤ f (Finset.cons a s ha)

A function f from Finset α is monotone if and only if f s ≤ f (cons a s ha) for all s and a ∉ s.

theorem Finset.antitone_iff_forall_cons_le E1 #

∀ {α : Type u_1} {β : Type u_2} [inst : Preorder β] {f : Finset α → β},
  Antitone f ↔ ∀ (s : Finset α) ⦃a : α⦄ (ha : a ∉ s), f (Finset.cons a s ha) ≤ f s

A function f from Finset α is antitone if and only if f (cons a s ha) ≤ f s for all s and a ∉ s.

theorem Finset.strictMono_iff_forall_lt_cons E1 #

∀ {α : Type u_1} {β : Type u_2} [inst : Preorder β] {f : Finset α → β},
  StrictMono f ↔ ∀ (s : Finset α) ⦃a : α⦄ (ha : a ∉ s), f s < f (Finset.cons a s ha)

A function f from Finset α is strictly monotone if and only if f s < f (cons a s ha) for all s and a ∉ s.

theorem Finset.strictAnti_iff_forall_cons_lt E1 #

∀ {α : Type u_1} {β : Type u_2} [inst : Preorder β] {f : Finset α → β},
  StrictAnti f ↔ ∀ (s : Finset α) ⦃a : α⦄ (ha : a ∉ s), f (Finset.cons a s ha) < f s

A function f from Finset α is strictly antitone if and only if f (cons a s ha) < f s for all s and a ∉ s.

theorem Finset.monotone_iff_forall_le_insert E1 #

∀ {α : Type u_1} {β : Type u_2} [inst : Preorder β] {f : Finset α → β} [inst_1 : DecidableEq α],
  Monotone f ↔ ∀ (s : Finset α) ⦃a : α⦄, a ∉ s → f s ≤ f (insert a s)

A function f from Finset α is monotone if and only if f s ≤ f (insert a s) for all s and a ∉ s.

theorem Finset.antitone_iff_forall_insert_le E1 #

∀ {α : Type u_1} {β : Type u_2} [inst : Preorder β] {f : Finset α → β} [inst_1 : DecidableEq α],
  Antitone f ↔ ∀ (s : Finset α) ⦃a : α⦄, a ∉ s → f (insert a s) ≤ f s

A function f from Finset α is antitone if and only if f (insert a s) ≤ f s for all s and a ∉ s.

theorem Finset.strictMono_iff_forall_lt_insert E1 #

∀ {α : Type u_1} {β : Type u_2} [inst : Preorder β] {f : Finset α → β} [inst_1 : DecidableEq α],
  StrictMono f ↔ ∀ (s : Finset α) ⦃a : α⦄, a ∉ s → f s < f (insert a s)

A function f from Finset α is strictly monotone if and only if f s < f (insert a s) for all s and a ∉ s.

theorem Finset.strictAnti_iff_forall_lt_insert E1 #

∀ {α : Type u_1} {β : Type u_2} [inst : Preorder β] {f : Finset α → β} [inst_1 : DecidableEq α],
  StrictAnti f ↔ ∀ (s : Finset α) ⦃a : α⦄, a ∉ s → f (insert a s) < f s

A function f from Finset α is strictly antitone if and only if f (insert a s) < f s for all s and a ∉ s.