File: Mathlib/Data/FinEnum.lean

full_name: FinEnum
code: /-- `FinEnum α` means that `α` is finite and can be enumerated in some order,
  i.e. `α` has an explicit bijection with `Fin n` for some n. -/
class FinEnum (α : Sort*) where
  /-- `FinEnum.card` is the cardinality of the `FinEnum` -/
  card : ℕ
  /-- `FinEnum.Equiv` states that type `α` is in bijection with `Fin card`,
    the size of the `FinEnum` -/
  equiv : α ≃ Fin card
  [decEq : DecidableEq α]
goal: Sort (max 1 u_1)

full_name: FinEnum.card
code: /-- `FinEnum α` means that `α` is finite and can be enumerated in some order,
  i.e. `α` has an explicit bijection with `Fin n` for some n. -/
class FinEnum (α : Sort*) where
  /-- `FinEnum.card` is the cardinality of the `FinEnum` -/
  card : ℕ
  /-- `FinEnum.Equiv` states that type `α` is in bijection with `Fin card`,
    the size of the `FinEnum` -/
  equiv : α ≃ Fin card
  [decEq : DecidableEq α]
goal: ℕ

full_name: FinEnum.decEq
code: /-- `FinEnum α` means that `α` is finite and can be enumerated in some order,
  i.e. `α` has an explicit bijection with `Fin n` for some n. -/
class FinEnum (α : Sort*) where
  /-- `FinEnum.card` is the cardinality of the `FinEnum` -/
  card : ℕ
  /-- `FinEnum.Equiv` states that type `α` is in bijection with `Fin card`,
    the size of the `FinEnum` -/
  equiv : α ≃ Fin card
  [decEq : DecidableEq α]
goal: DecidableEq α

full_name: FinEnum.equiv
code: /-- `FinEnum α` means that `α` is finite and can be enumerated in some order,
  i.e. `α` has an explicit bijection with `Fin n` for some n. -/
class FinEnum (α : Sort*) where
  /-- `FinEnum.card` is the cardinality of the `FinEnum` -/
  card : ℕ
  /-- `FinEnum.Equiv` states that type `α` is in bijection with `Fin card`,
    the size of the `FinEnum` -/
  equiv : α ≃ Fin card
  [decEq : DecidableEq α]
goal: α ≃ Fin (FinEnum.card α)

full_name: FinEnum.ofEquiv
code: /-- transport a `FinEnum` instance across an equivalence -/
def ofEquiv (α) {β} [FinEnum α] (h : β ≃ α) : FinEnum β 
goal: FinEnum β

full_name: FinEnum.ofNodupList
code: /-- create a `FinEnum` instance from an exhaustive list without duplicates -/
def ofNodupList [DecidableEq α] (xs : List α) (h : ∀ x : α, x ∈ xs) (h' : List.Nodup xs) :
    FinEnum α 
goal: FinEnum α

full_name: FinEnum.ofList
code: /-- create a `FinEnum` instance from an exhaustive list; duplicates are removed -/
def ofList [DecidableEq α] (xs : List α) (h : ∀ x : α, x ∈ xs) : FinEnum α 
goal: FinEnum α

full_name: FinEnum.toList
code: /-- create an exhaustive list of the values of a given type -/
def toList (α) [FinEnum α] : List α 
goal: List α

full_name: FinEnum.mem_toList
code: @[simp]
theorem mem_toList [FinEnum α] (x : α) : x ∈ toList α 
goal: x ∈ FinEnum.toList α

full_name: FinEnum.nodup_toList
code: @[simp]
theorem nodup_toList [FinEnum α] : List.Nodup (toList α) 
goal: (FinEnum.toList α).Nodup

full_name: FinEnum.ofSurjective
code: /-- create a `FinEnum` instance using a surjection -/
def ofSurjective {β} (f : β → α) [DecidableEq α] [FinEnum β] (h : Surjective f) : FinEnum α 
goal: FinEnum α

full_name: FinEnum.ofInjective
code: /-- create a `FinEnum` instance using an injection -/
noncomputable def ofInjective {α β} (f : α → β) [DecidableEq α] [FinEnum β] (h : Injective f) :
    FinEnum α 
goal: FinEnum α

full_name: FinEnum.pempty
code: instance pempty : FinEnum PEmpty 
goal: FinEnum PEmpty.{u_1 + 1}

full_name: FinEnum.empty
code: instance empty : FinEnum Empty 
goal: FinEnum Empty

full_name: FinEnum.punit
code: instance punit : FinEnum PUnit 
goal: FinEnum PUnit.{u_1 + 1}

full_name: FinEnum.prod
code: instance prod {β} [FinEnum α] [FinEnum β] : FinEnum (α × β) 
goal: FinEnum (α × β)

full_name: FinEnum.sum
code: instance sum {β} [FinEnum α] [FinEnum β] : FinEnum (α ⊕ β) 
goal: FinEnum (α ⊕ β)

full_name: FinEnum.fin
code: instance fin {n} : FinEnum (Fin n) 
goal: FinEnum (Fin n)

full_name: FinEnum.Quotient.enum
code: instance Quotient.enum [FinEnum α] (s : Setoid α) [DecidableRel ((· ≈ ·) : α → α → Prop)] :
    FinEnum (Quotient s) 
goal: FinEnum (Quotient s)

full_name: FinEnum.Finset.enum
code: /-- enumerate all finite sets of a given type -/
def Finset.enum [DecidableEq α] : List α → List (Finset α)
  
goal: List α → List (Finset α)

full_name: FinEnum.Finset.mem_enum
code: @[simp]
theorem Finset.mem_enum [DecidableEq α] (s : Finset α) (xs : List α) :
    s ∈ Finset.enum xs ↔ ∀ x ∈ s, x ∈ xs 
goal: s ∈ FinEnum.Finset.enum xs ↔ ∀ x ∈ s, x ∈ xs

full_name: FinEnum.Finset.finEnum
code: instance Finset.finEnum [FinEnum α] : FinEnum (Finset α) 
goal: FinEnum (Finset α)

full_name: FinEnum.Subtype.finEnum
code: instance Subtype.finEnum [FinEnum α] (p : α → Prop) [DecidablePred p] : FinEnum { x // p x } 
goal: FinEnum { x // p x }

full_name: FinEnum.instSigma
code: instance (β : α → Type v) [FinEnum α] [∀ a, FinEnum (β a)] : FinEnum (Sigma β) 
goal: FinEnum (Sigma β)

full_name: FinEnum.PSigma.finEnum
code: instance PSigma.finEnum [FinEnum α] [∀ a, FinEnum (β a)] : FinEnum (Σ'a, β a) 
goal: FinEnum ((a : α) ×' β a)

full_name: FinEnum.PSigma.finEnumPropLeft
code: instance PSigma.finEnumPropLeft {α : Prop} {β : α → Type v} [∀ a, FinEnum (β a)] [Decidable α] :
    FinEnum (Σ'a, β a) 
goal: FinEnum ((a : α) ×' β a)

full_name: FinEnum.PSigma.finEnumPropRight
code: instance PSigma.finEnumPropRight {β : α → Prop} [FinEnum α] [∀ a, Decidable (β a)] :
    FinEnum (Σ'a, β a) 
goal: FinEnum ((a : α) ×' β a)

full_name: FinEnum.PSigma.finEnumPropProp
code: instance PSigma.finEnumPropProp {α : Prop} {β : α → Prop} [Decidable α] [∀ a, Decidable (β a)] :
    FinEnum (Σ'a, β a) 
goal: FinEnum ((a : α) ×' β a)

full_name: FinEnum.instFintype
code: instance (priority := 100) [FinEnum α] : Fintype α 
goal: Fintype α

full_name: List.mem_pi_toList
code: theorem mem_pi_toList (xs : List α)
    (f : ∀ a, a ∈ xs → β a) : f ∈ pi xs fun x => toList (β x) 
goal: f ∈ xs.pi fun x => FinEnum.toList (β x)

full_name: List.Pi.enum
code: /-- enumerate all functions whose domain and range are finitely enumerable -/
def Pi.enum (β : α → Type*) [∀ a, FinEnum (β a)] : List (∀ a, β a) 
goal: List ((a : α) → β a)

full_name: List.Pi.mem_enum
code: theorem Pi.mem_enum (f : ∀ a, β a) :
    f ∈ Pi.enum β 
goal: f ∈ List.Pi.enum β

full_name: List.Pi.finEnum
code: instance Pi.finEnum : FinEnum (∀ a, β a) 
goal: FinEnum ((a : α) → β a)

full_name: List.pfunFinEnum
code: instance pfunFinEnum (p : Prop) [Decidable p] (α : p → Type) [∀ hp, FinEnum (α hp)] :
    FinEnum (∀ hp : p, α hp) 
goal: FinEnum ((hp : p) → α hp)