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 / V01. The language of Mathlib

Mathlib.Logic.Equiv.Finset

19 declarations. Mathlib docs · Source

Encodable and Denumerable instances for Finset

theorem Denumerable.lower'.match_1.congr_eq_1 E1 #

∀ (motive : List ℕ → ℕ → Sort u_1) (x : List ℕ) (x_1 : ℕ) (h_1 : (x : ℕ) → motive [] x)
  (h_2 : (m : ℕ) → (l : List ℕ) → (n : ℕ) → motive (m :: l) n) (x_2 : ℕ),
  x = [] →
    x_1 = x_2 →
      (match x, x_1 with
        | [], x => h_1 x
        | m :: l, n => h_2 m l n) ≍
        h_1 x_2

theorem Denumerable.lower'.match_1.congr_eq_2 E1 #

∀ (motive : List ℕ → ℕ → Sort u_1) (x : List ℕ) (x_1 : ℕ) (h_1 : (x : ℕ) → motive [] x)
  (h_2 : (m : ℕ) → (l : List ℕ) → (n : ℕ) → motive (m :: l) n) (m : ℕ) (l : List ℕ) (n : ℕ),
  x = m :: l →
    x_1 = n →
      (match x, x_1 with
        | [], x => h_1 x
        | m :: l, n => h_2 m l n) ≍
        h_2 m l n

instance Finset.encodable E0 #

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

If α is encodable, then so is Finset α.

def Encodable.sortedUniv E1 #

(α : Type u_1) → [Fintype α] → [Encodable α] → List α

The elements of a Fintype as a sorted list.

theorem Encodable.mem_sortedUniv E0 #

∀ {α : Type u_1} [inst : Fintype α] [inst_1 : Encodable α] (x : α), x ∈ Encodable.sortedUniv α

theorem Encodable.length_sortedUniv E0 #

∀ (α : Type u_1) [inst : Fintype α] [inst_1 : Encodable α], (Encodable.sortedUniv α).length = Fintype.card α

theorem Encodable.sortedUniv_nodup E0 #

∀ (α : Type u_1) [inst : Fintype α] [inst_1 : Encodable α], (Encodable.sortedUniv α).Nodup

theorem Encodable.sortedUniv_toFinset E0 #

∀ (α : Type u_1) [inst : Fintype α] [inst_1 : Encodable α] [inst_2 : DecidableEq α],
  (Encodable.sortedUniv α).toFinset = Finset.univ

def Encodable.fintypeEquivFin E1 #

{α : Type u_1} → [inst : Fintype α] → [Encodable α] → α ≃ Fin (Fintype.card α)

An encodable Fintype is equivalent to the same size Fin.

def Denumerable.lower' E1 #

List ℕ → ℕ → List ℕ

Outputs the list of differences minus one of the input list, that is lower' [a₁, a₂, a₃, ...] n = [a₁ - n, a₂ - a₁ - 1, a₃ - a₂ - 1, ...].

def Denumerable.raise' E1 #

List ℕ → ℕ → List ℕ

Outputs the list of partial sums plus one of the input list, that is raise [a₁, a₂, a₃, ...] n = [n + a₁, n + a₁ + a₂ + 1, n + a₁ + a₂ + a₃ + 2, ...]. Adding one each time ensures the elements are distinct.

theorem Denumerable.lower_raise' E1 #

∀ (l : List ℕ) (n : ℕ), Denumerable.lower' (Denumerable.raise' l n) n = l

theorem Denumerable.raise_lower' E1 #

∀ {l : List ℕ} {n : ℕ}, (∀ m ∈ l, n ≤ m) → l.SortedLT → Denumerable.raise' (Denumerable.lower' l n) n = l

theorem Denumerable.isChain_raise' E1 #

∀ (l : List ℕ) (n : ℕ), List.IsChain (fun x1 x2 ↦ x1 < x2) (Denumerable.raise' l n)

theorem Denumerable.isChain_cons_raise' E1 #

∀ (l : List ℕ) (m : ℕ), List.IsChain (fun x1 x2 ↦ x1 < x2) (m :: Denumerable.raise' l (m + 1))

theorem Denumerable.isChain_cons_raise'_of_lt E1 #

∀ (l : List ℕ) {m n : ℕ}, m < n → List.IsChain (fun x1 x2 ↦ x1 < x2) (m :: Denumerable.raise' l n)

theorem Denumerable.raise'_sorted E1 #

∀ (l : List ℕ) (n : ℕ), (Denumerable.raise' l n).SortedLT

raise' l n is a strictly increasing sequence.

def Denumerable.raise'Finset E1 #

List ℕ → ℕ → Finset ℕ

Makes raise' l n into a finset. Elements are distinct thanks to raise'_sorted.

instance Denumerable.finset E0 #

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

If α is denumerable, then so is Finset α. Warning: this is not the same encoding as used in Finset.encodable.