Documentation

Mathlib.Data.Set.Enumerate

Set enumeration #

This file allows enumeration of sets given a choice function. The definition does not assume sel actually is a choice function, i.e. sel s ∈ s and sel s = none ↔ s = ∅. These assumptions are added to the lemmas needing them.

def Set.enumerate {α : Type u_1} (sel : 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.

Equations
Instances For
    theorem Set.enumerate_eq_none_of_sel {α : Type u_1} (sel : Set αOption α) {s : Set α} (h : sel s = none) {n : } :
    Set.enumerate sel s n = none
    theorem Set.enumerate_eq_none {α : Type u_1} (sel : Set αOption α) {s : Set α} {n₁ : } {n₂ : } :
    Set.enumerate sel s n₁ = nonen₁ n₂Set.enumerate sel s n₂ = none
    theorem Set.enumerate_mem {α : Type u_1} (sel : Set αOption α) (h_sel : ∀ (s : Set α) (a : α), sel s = some aa s) {s : Set α} {n : } {a : α} :
    Set.enumerate sel s n = some aa s
    theorem Set.enumerate_inj {α : Type u_1} (sel : Set αOption α) {n₁ : } {n₂ : } {a : α} {s : Set α} (h_sel : ∀ (s : Set α) (a : α), sel s = some aa s) (h₁ : Set.enumerate sel s n₁ = some a) (h₂ : Set.enumerate sel s n₂ = some a) :
    n₁ = n₂