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.Fintype.Fin

15 declarations and 1 deprecated aliases. Mathlib docs · Source

theorem Fin.map_valEmbedding_univ E0 #

∀ {n : ℕ}, Finset.map Fin.valEmbedding Finset.univ = Finset.Iio n

theorem Fin.Ioi_zero_eq_map E0 #

∀ {n : ℕ}, Finset.Ioi 0 = Finset.map (Fin.succEmb n) Finset.univ

theorem Fin.Iio_last_eq_map E0 #

∀ {n : ℕ}, Finset.Iio (Fin.last n) = Finset.map Fin.castSuccEmb Finset.univ

theorem Fin.Ioi_succ E1 #

∀ {n : ℕ} (i : Fin n), Finset.Ioi i.succ = Finset.map (Fin.succEmb n) (Finset.Ioi i)

theorem Fin.Iio_castSucc E1 #

∀ {n : ℕ} (i : Fin n), Finset.Iio i.castSucc = Finset.map Fin.castSuccEmb (Finset.Iio i)

theorem Fin.card_filter_val_lt E1 #

∀ {n m : ℕ}, {i | ↑i < m}.card = min n m

theorem Fin.card_filter_univ_succ E1 #

∀ {n : ℕ} (p : Fin (n + 1) → Prop) [inst : DecidablePred p],
  {x | p x}.card = if p 0 then {x | p x.succ}.card + 1 else {x | p x.succ}.card

theorem Fin.card_filter_univ_succ' E1 #

∀ {n : ℕ} (p : Fin (n + 1) → Prop) [inst : DecidablePred p],
  {x | p x}.card = (if p 0 then 1 else 0) + {x | p x.succ}.card

theorem List.Vector.countP_toList E1 #

∀ {α : Type u_1} {n : ℕ} (p : α → Bool) (v : List.Vector α n), List.countP p v.toList = {i | p (v.get i) = true}.card

theorem List.Vector.count_toList E1 #

∀ {α : Type u_1} {n : ℕ} [inst : DecidableEq α] (a : α) (v : List.Vector α n),
  List.count a v.toList = {i | v.get i = a}.card

theorem Fin.lt_card_filter_univ_iff_apply_of_imp E1 #

∀ {n : ℕ} {j : Fin n} (p : Fin n → Prop) [inst : DecidablePred p],
  (∀ (i j : Fin n), j ≤ i → p i → p j) → (↑j < {i | p i}.card ↔ p j)

Given a "downward-closed" predicate p on Fin n (which could be spelt Antitone p), then p holds for more than j elements iff it holds for p itself.

theorem Finset.image_fin_univ E1 #

∀ {n : ℕ}, Finset.image Fin.val Finset.univ = Finset.range n

theorem Finset.sup_fin_univ E0 #

∀ {α : Type u_1} [inst : SemilatticeSup α] [inst_1 : OrderBot α] {n : ℕ} (f : ℕ → α),
  (Finset.univ.sup fun n_1 ↦ f ↑n_1) = (Finset.range n).sup f

theorem List.countP_ofFn E0 #

∀ {α : Type u_1} {n : ℕ} (f : Fin n → α) (p : α → Bool), List.countP p (List.ofFn f) = {i | p (f i) = true}.card

theorem List.count_ofFn E0 #

∀ {α : Type u_1} {n : ℕ} [inst : DecidableEq α] (f : Fin n → α) (a : α), List.count a (List.ofFn f) = {i | f i = a}.card

Deprecated aliases

NameNew nameSince
Fin.card_filter_univ_eq_vector_get_eq_countList.Vector.count_toList2026-10-19