Documentation

Mathlib.Data.Fintype.Fin

The structure of Fintype (Fin n) #

This file contains some basic results about the Fintype instance for Fin, especially properties of Finset.univ : Finset (Fin n).

theorem Fin.map_valEmbedding_univ {n : } :
Finset.map Fin.valEmbedding Finset.univ = Finset.Iio n
@[simp]
theorem Fin.Ioi_zero_eq_map {n : } :
Finset.Ioi 0 = Finset.map (Fin.succEmb n).toEmbedding Finset.univ
@[simp]
theorem Fin.Iio_last_eq_map {n : } :
Finset.Iio (Fin.last n) = Finset.map Fin.castSuccEmb.toEmbedding Finset.univ
@[simp]
theorem Fin.Ioi_succ {n : } (i : Fin n) :
@[simp]
theorem Fin.Iio_castSucc {n : } (i : Fin n) :
Finset.Iio (Fin.castSucc i) = Finset.map Fin.castSuccEmb.toEmbedding (Finset.Iio i)
theorem Fin.card_filter_univ_succ' {n : } (p : Fin (n + 1)Prop) [DecidablePred p] :
(Finset.filter p Finset.univ).card = (if p 0 then 1 else 0) + (Finset.filter (p Fin.succ) Finset.univ).card
theorem Fin.card_filter_univ_succ {n : } (p : Fin (n + 1)Prop) [DecidablePred p] :
(Finset.filter p Finset.univ).card = if p 0 then (Finset.filter (p Fin.succ) Finset.univ).card + 1 else (Finset.filter (p Fin.succ) Finset.univ).card
theorem Fin.card_filter_univ_eq_vector_get_eq_count {α : Type u_1} {n : } [DecidableEq α] (a : α) (v : Vector α n) :
(Finset.filter (fun (i : Fin n) => a = Vector.get v i) Finset.univ).card = List.count a (Vector.toList v)