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.Pi

40 declarations. Mathlib docs · Source

Fintype instances for pi types

pi

Diagonal

Constructors for Set.Finite

Every constructor here should have a corresponding Fintype instance in the previous section (or in the Fintype module).

The implementation of these constructors ideally should be no more than Set.toFinite, after possibly setting up some Fintype and classical Decidable instances.

theorem Singleton.singleton.hcongr_4 E1 #

∀ (α α' : Type u),
  α = α' →
    ∀ (β β' : Type v),
      β = β' →
        ∀ (self : Singleton α β) (self' : Singleton α' β'), self ≍ self' → ∀ (a : α) (a' : α'), a ≍ a' → {a} ≍ {a'}

theorem Finset.instSetLike.hcongr_1 E1 #

∀ (α α' : Type u_1), α = α' → Finset.instSetLike ≍ Finset.instSetLike

theorem Finset.instSingleton.hcongr_1 E1 #

∀ (α α' : Type u_1), α = α' → Finset.instSingleton ≍ Finset.instSingleton

theorem SetLike.instMembership.hcongr_3 E1 #

∀ (A A' : Type u_1),
  A = A' →
    ∀ (B B' : Type u_2),
      B = B' → ∀ (i : SetLike A B) (i' : SetLike A' B'), i ≍ i' → SetLike.instMembership ≍ SetLike.instMembership

def Fintype.piFinset E1 #

{α : Type u_1} → [DecidableEq α] → [Fintype α] → {δ : α → Type u_4} → ((a : α) → Finset (δ a)) → Finset ((a : α) → δ a)

Given for all a : α a finset t a of δ a, then one can define the finset Fintype.piFinset t of all functions taking values in t a for all a. This is the analogue of Finset.pi where the base finset is univ (but formally they are not the same, as there is an additional condition i ∈ Finset.univ in the Finset.pi definition).

theorem Fintype.mem_piFinset E0 #

∀ {α : Type u_1} [inst : DecidableEq α] [inst_1 : Fintype α] {δ : α → Type u_4} {t : (a : α) → Finset (δ a)}
  {f : (a : α) → δ a}, f ∈ Fintype.piFinset t ↔ ∀ (a : α), f a ∈ t a

theorem Fintype.coe_piFinset E0 #

∀ {α : Type u_1} [inst : DecidableEq α] [inst_1 : Fintype α] {δ : α → Type u_4} (t : (a : α) → Finset (δ a)),
  ↑(Fintype.piFinset t) = Set.univ.pi fun a ↦ ↑(t a)

theorem Fintype.piFinset_subset E1 #

∀ {α : Type u_1} [inst : DecidableEq α] [inst_1 : Fintype α] {δ : α → Type u_4} (t₁ t₂ : (a : α) → Finset (δ a)),
  (∀ (a : α), t₁ a ⊆ t₂ a) → Fintype.piFinset t₁ ⊆ Fintype.piFinset t₂

theorem Fintype.piFinset_eq_empty E0 #

∀ {α : Type u_1} [inst : DecidableEq α] [inst_1 : Fintype α] {γ : α → Type u_3} {s : (a : α) → Finset (γ a)},
  Fintype.piFinset s = ∅ ↔ ∃ i, s i = ∅

theorem Fintype.piFinset_empty E0 #

∀ {α : Type u_1} [inst : DecidableEq α] [inst_1 : Fintype α] {δ : α → Type u_4} [Nonempty α],
  (Fintype.piFinset fun x ↦ ∅) = ∅

theorem Fintype.piFinset_nonempty E0 #

∀ {α : Type u_1} [inst : DecidableEq α] [inst_1 : Fintype α] {γ : α → Type u_3} {s : (a : α) → Finset (γ a)},
  (Fintype.piFinset s).Nonempty ↔ ∀ (a : α), (s a).Nonempty

theorem Fintype.Aesop.piFinset_nonempty_of_forall_nonempty E1 #

∀ {α : Type u_1} [inst : DecidableEq α] [inst_1 : Fintype α] {γ : α → Type u_3} {s : (a : α) → Finset (γ a)},
  (∀ (a : α), (s a).Nonempty) → (Fintype.piFinset s).Nonempty

Alias of the reverse direction of Fintype.piFinset_nonempty.

theorem Finset.Nonempty.piFinset_const E1 #

∀ {β : Type u_2} {ι : Type u_5} [inst : Fintype ι] [inst_1 : DecidableEq ι] {s : Finset β},
  s.Nonempty → (Fintype.piFinset fun x ↦ s).Nonempty

theorem Fintype.piFinset_of_isEmpty E0 #

∀ {α : Type u_1} [inst : DecidableEq α] [inst_1 : Fintype α] {γ : α → Type u_3} [inst_2 : IsEmpty α]
  (s : (a : α) → Finset (γ a)), Fintype.piFinset s = Finset.univ

theorem Fintype.piFinset_singleton E0 #

∀ {α : Type u_1} [inst : DecidableEq α] [inst_1 : Fintype α] {δ : α → Type u_4} (f : (i : α) → δ i),
  (Fintype.piFinset fun i ↦ {f i}) = {f}

theorem Fintype.piFinset_subsingleton E1 #

∀ {α : Type u_1} [inst : DecidableEq α] [inst_1 : Fintype α] {δ : α → Type u_4} {f : (i : α) → Finset (δ i)},
  (∀ (i : α), (↑(f i)).Subsingleton) → (↑(Fintype.piFinset f)).Subsingleton

theorem Fintype.piFinset_disjoint_of_disjoint E1 #

∀ {α : Type u_1} [inst : DecidableEq α] [inst_1 : Fintype α] {δ : α → Type u_4} (t₁ t₂ : (a : α) → Finset (δ a))
  {a : α}, Disjoint (t₁ a) (t₂ a) → Disjoint (Fintype.piFinset t₁) (Fintype.piFinset t₂)

theorem Fintype.piFinset_image E1 #

∀ {α : Type u_1} [inst : DecidableEq α] [inst_1 : Fintype α] {γ : α → Type u_3} {δ : α → Type u_4}
  [inst_2 : (a : α) → DecidableEq (δ a)] (f : (a : α) → γ a → δ a) (s : (a : α) → Finset (γ a)),
  (Fintype.piFinset fun a ↦ Finset.image (f a) (s a)) = Finset.image (fun b a ↦ f a (b a)) (Fintype.piFinset s)

theorem Fintype.eval_image_piFinset_subset E1 #

∀ {α : Type u_1} [inst : DecidableEq α] [inst_1 : Fintype α] {δ : α → Type u_4} (t : (a : α) → Finset (δ a)) (a : α)
  [inst_2 : DecidableEq (δ a)], Finset.image (fun f ↦ f a) (Fintype.piFinset t) ⊆ t a

theorem Fintype.eval_image_piFinset E1 #

∀ {α : Type u_1} [inst : DecidableEq α] [inst_1 : Fintype α] {δ : α → Type u_4} (t : (a : α) → Finset (δ a)) (a : α)
  [inst_2 : DecidableEq (δ a)],
  (∀ (b : α), a ≠ b → (t b).Nonempty) → Finset.image (fun f ↦ f a) (Fintype.piFinset t) = t a

theorem Fintype.eval_image_piFinset_const E1 #

∀ {α : Type u_1} [inst : DecidableEq α] [inst_1 : Fintype α] {β : Type u_5} [inst_2 : DecidableEq β] (t : Finset β)
  (a : α), Finset.image (fun f ↦ f a) (Fintype.piFinset fun _i ↦ t) = t

theorem Fintype.piFinset_inter E1 #

∀ {α : Type u_1} [inst : DecidableEq α] [inst_1 : Fintype α] {δ : α → Type u_4} [inst_2 : (a : α) → DecidableEq (δ a)]
  (s t : (a : α) → Finset (δ a)), (Fintype.piFinset fun i ↦ s i ∩ t i) = Fintype.piFinset s ∩ Fintype.piFinset t

theorem Fintype.filter_piFinset_of_notMem E1 #

∀ {α : Type u_1} [inst : DecidableEq α] [inst_1 : Fintype α] {δ : α → Type u_4} [inst_2 : (a : α) → DecidableEq (δ a)]
  (t : (a : α) → Finset (δ a)) (a : α), ∀ x ∉ t a, {f ∈ Fintype.piFinset t | f a = x} = ∅

theorem Fintype.piFinset_update_eq_filter_piFinset_mem E1 #

∀ {α : Type u_1} [inst : DecidableEq α] [inst_1 : Fintype α] {δ : α → Type u_4} [inst_2 : (a : α) → DecidableEq (δ a)]
  (s : (i : α) → Finset (δ i)) (i : α) {t : Finset (δ i)},
  t ⊆ s i → Fintype.piFinset (Function.update s i t) = {f ∈ Fintype.piFinset s | f i ∈ t}

theorem Fintype.piFinset_update_singleton_eq_filter_piFinset_eq E0 #

∀ {α : Type u_1} [inst : DecidableEq α] [inst_1 : Fintype α] {δ : α → Type u_4} [inst_2 : (a : α) → DecidableEq (δ a)]
  (s : (i : α) → Finset (δ i)) (i : α) {a : δ i},
  a ∈ s i → Fintype.piFinset (Function.update s i {a}) = {f ∈ Fintype.piFinset s | f i = a}

instance Pi.instFintype E0 #

{α : Type u_3} →
  {β : α → Type u_4} → [DecidableEq α] → [Fintype α] → [(a : α) → Fintype (β a)] → Fintype ((a : α) → β a)

A dependent product of fintypes, indexed by a fintype, is a fintype.

theorem Fintype.piFinset_univ E0 #

∀ {α : Type u_3} {β : α → Type u_4} [inst : DecidableEq α] [inst_1 : Fintype α] [inst_2 : (a : α) → Fintype (β a)],
  (Fintype.piFinset fun a ↦ Finset.univ) = Finset.univ

instance Function.Embedding.fintype E0 #

{α : Type u_3} → {β : Type u_4} → [Fintype α] → [Fintype β] → Fintype (α ↪ β)

There are finitely many embeddings between finite types.

This instance used to be computable (using DecidableEq arguments), but it makes things a lot harder to work with here.

instance RelHom.instFintype E0 #

{α : Type u_3} →
  {β : Type u_4} →
    [Fintype α] →
      [Fintype β] →
        [DecidableEq α] →
          {r : α → α → Prop} → {s : β → β → Prop} → [DecidableRel r] → [DecidableRel s] → Fintype (r →r s)

instance RelEmbedding.instFintype E0 #

{α : Type u_3} → {β : Type u_4} → [Fintype α] → [Fintype β] → {r : α → α → Prop} → {s : β → β → Prop} → Fintype (r ↪r s)

theorem Finset.univ_pi_univ E0 #

∀ {α : Type u_3} {β : α → Type u_4} [inst : DecidableEq α] [inst_1 : Fintype α] [inst_2 : (a : α) → Fintype (β a)],
  (Finset.univ.pi fun a ↦ Finset.univ) = Finset.univ

theorem Finset.piFinset_filter_const E1 #

∀ {α : Type u_1} {ι : Type u_3} [inst : DecidableEq (ι → α)] {s : Finset α} [inst_1 : DecidableEq ι]
  [inst_2 : Fintype ι], {f ∈ Fintype.piFinset fun x ↦ s | ∃ a ∈ s, Function.const ι a = f} = s.piDiag ι

theorem Finset.piDiag_subset_piFinset E1 #

∀ {α : Type u_1} {ι : Type u_3} [inst : DecidableEq (ι → α)] {s : Finset α} [inst_1 : DecidableEq ι]
  [inst_2 : Fintype ι], s.piDiag ι ⊆ Fintype.piFinset fun x ↦ s

theorem Set.Finite.pi E1 #

∀ {ι : Type u_3} [Finite ι] {κ : ι → Type u_4} {t : (i : ι) → Set (κ i)},
  (∀ (i : ι), (t i).Finite) → (Set.univ.pi t).Finite

Finite product of finite sets is finite

theorem Set.Finite.pi' E1 #

∀ {ι : Type u_3} [Finite ι] {κ : ι → Type u_4} {t : (i : ι) → Set (κ i)},
  (∀ (i : ι), (t i).Finite) → {f | ∀ (i : ι), f i ∈ t i}.Finite

Finite product of finite sets is finite. Note this is a variant of Set.Finite.pi without the extra i ∈ univ binder.

theorem Set.forall_finite_image_eval_iff E0 #

∀ {δ : Type u_3} [Finite δ] {κ : δ → Type u_4} {s : Set ((d : δ) → κ d)},
  (∀ (d : δ), (Function.eval d '' s).Finite) ↔ s.Finite

theorem Set.iUnion_cons E0 #

∀ {α : Type u_1} {n : ℕ} (f : Fin n → Set α) (s : Set α), Set.iUnion (Fin.cons s f) = s ∪ ⋃ i, f i

theorem Set.iUnion_snoc E0 #

∀ {α : Type u_1} {n : ℕ} (f : Fin n → Set α) (s : Set α), Set.iUnion (Fin.snoc f s) = (⋃ i, f i) ∪ s

theorem Set.iUnion_fin_add_one_eq_iUnion_succ E1 #

∀ {α : Type u_1} {n : ℕ} (f : Fin (n + 1) → Set α), ⋃ i, f i = f 0 ∪ Set.iUnion (f ∘ Fin.succ)

theorem Set.iUnion_fin_add_one_eq_iUnion_castSucc E1 #

∀ {α : Type u_1} {n : ℕ} (f : Fin (n + 1) → Set α), ⋃ i, f i = Set.iUnion (f ∘ Fin.castSucc) ∪ f (Fin.last n)