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.Set.Enumerate

7 declarations. Mathlib docs · Source

theorem Set.enumerate.match_1.congr_eq_2 E1 #

∀ {α : Type u_1} (motive : Set α → ℕ → Sort u_2) (x : Set α) (x_1 : ℕ) (h_1 : (s : Set α) → motive s 0)
  (h_2 : (s : Set α) → (n : ℕ) → motive s n.succ) (s : Set α) (n : ℕ),
  x = s →
    x_1 = n.succ →
      (match x, x_1 with
        | s, 0 => h_1 s
        | s, n.succ => h_2 s n) ≍
        h_2 s n

theorem Set.enumerate.match_1.congr_eq_1 E1 #

∀ {α : Type u_1} (motive : Set α → ℕ → Sort u_2) (x : Set α) (x_1 : ℕ) (h_1 : (s : Set α) → motive s 0)
  (h_2 : (s : Set α) → (n : ℕ) → motive s n.succ) (s : Set α),
  x = s →
    x_1 = 0 →
      (match x, x_1 with
        | s, 0 => h_1 s
        | s, n.succ => h_2 s n) ≍
        h_1 s

def Set.enumerate E1 #

{α : Type u_1} → (Set α → Option α) → Set α → ℕ → Option α

Given a choice function sel, enumerates the elements of a set in the order a 0 = sel s, a 1 = sel (s \ {a 0}), a 2 = sel (s \ {a 0, a 1}), ... and stops when sel (s \ {a 0, ..., a n}) = none. Note that we don't require sel to be a choice function.

theorem Set.enumerate_eq_none_of_sel E1 #

∀ {α : Type u_1} (sel : Set α → Option α) {s : Set α}, sel s = none → ∀ {n : ℕ}, Set.enumerate sel s n = none

theorem Set.enumerate_eq_none E1 #

∀ {α : Type u_1} (sel : Set α → Option α) {s : Set α} {n₁ n₂ : ℕ},
  Set.enumerate sel s n₁ = none → n₁ ≤ n₂ → Set.enumerate sel s n₂ = none

theorem Set.enumerate_mem E1 #

∀ {α : Type u_1} (sel : Set α → Option α),
  (∀ (s : Set α) (a : α), sel s = some a → a ∈ s) →
    ∀ {s : Set α} {n : ℕ} {a : α}, Set.enumerate sel s n = some a → a ∈ s

theorem Set.enumerate_inj E1 #

∀ {α : Type u_1} (sel : Set α → Option α) {n₁ n₂ : ℕ} {a : α} {s : Set α},
  (∀ (s : Set α) (a : α), sel s = some a → a ∈ s) →
    Set.enumerate sel s n₁ = some a → Set.enumerate sel s n₂ = some a → n₁ = n₂