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

18 declarations. Mathlib docs · Source

instance instFintypeSum E0 #

(α : Type u) → (β : Type v) → [Fintype α] → [Fintype β] → Fintype (α ⊕ β)

theorem Finset.toLeft_eq_univ E1 #

∀ {α : Type u_3} {β : Type u_4} [inst : Fintype α] {u : Finset (α ⊕ β)},
  u.toLeft = Finset.univ ↔ Finset.map Function.Embedding.inl Finset.univ ⊆ u

theorem Finset.toRight_eq_empty E1 #

∀ {α : Type u_3} {β : Type u_4} [inst : Fintype α] {u : Finset (α ⊕ β)},
  u.toRight = ∅ ↔ u ⊆ Finset.map Function.Embedding.inl Finset.univ

theorem Finset.toRight_eq_univ E1 #

∀ {α : Type u_3} {β : Type u_4} [inst : Fintype β] {u : Finset (α ⊕ β)},
  u.toRight = Finset.univ ↔ Finset.map Function.Embedding.inr Finset.univ ⊆ u

theorem Finset.toLeft_eq_empty E1 #

∀ {α : Type u_3} {β : Type u_4} [inst : Fintype β] {u : Finset (α ⊕ β)},
  u.toLeft = ∅ ↔ u ⊆ Finset.map Function.Embedding.inr Finset.univ

theorem Finset.univ_disjSum_univ E0 #

∀ {α : Type u_3} {β : Type u_4} [inst : Fintype α] [inst_1 : Fintype β], Finset.univ.disjSum Finset.univ = Finset.univ

theorem Finset.toLeft_univ E0 #

∀ {α : Type u_3} {β : Type u_4} [inst : Fintype α] [inst_1 : Fintype β], Finset.univ.toLeft = Finset.univ

theorem Finset.toRight_univ E0 #

∀ {α : Type u_3} {β : Type u_4} [inst : Fintype α] [inst_1 : Fintype β], Finset.univ.toRight = Finset.univ

theorem Fintype.card_sum E0 #

∀ {α : Type u_1} {β : Type u_2} [inst : Fintype α] [inst_1 : Fintype β],
  Fintype.card (α ⊕ β) = Fintype.card α + Fintype.card β

def fintypeOfFintypeNe E1 #

{α : Type u_1} → (a : α) → Fintype { b // b ≠ a } → Fintype α

If the subtype of all-but-one elements is a Fintype then the type itself is a Fintype.

theorem image_subtype_ne_univ_eq_image_erase E1 #

∀ {α : Type u_1} {β : Type u_2} [inst : Fintype α] [inst_1 : DecidableEq β] (k : β) (b : α → β),
  Finset.image (fun i ↦ b ↑i) Finset.univ = (Finset.image b Finset.univ).erase k

theorem image_subtype_univ_ssubset_image_univ E1 #

∀ {α : Type u_1} {β : Type u_2} [inst : Fintype α] [inst_1 : DecidableEq β] (k : β) (b : α → β),
  k ∈ Finset.image b Finset.univ →
    ∀ (p : β → Prop) [inst_2 : DecidablePred p],
      ¬p k → Finset.image (fun i ↦ b ↑i) Finset.univ ⊂ Finset.image b Finset.univ

theorem Finset.exists_equiv_extend_of_card_eq E0 #

∀ {α : Type u_1} {β : Type u_2} [inst : Fintype α] [inst_1 : DecidableEq β] {t : Finset β},
  Fintype.card α = t.card →
    ∀ {s : Finset α} {f : α → β}, Finset.image f s ⊆ t → Set.InjOn f ↑s → ∃ g, ∀ i ∈ s, ↑(g i) = f i

Any injection from a finset s in a fintype α to a finset t of the same cardinality as α can be extended to a bijection between α and t.

theorem Set.MapsTo.exists_equiv_extend_of_card_eq E0 #

∀ {α : Type u_1} {β : Type u_2} [inst : Fintype α] {t : Finset β},
  Fintype.card α = t.card → ∀ {s : Set α} {f : α → β}, Set.MapsTo f s ↑t → Set.InjOn f s → ∃ g, ∀ i ∈ s, ↑(g i) = f i

Any injection from a set s in a fintype α to a finset t of the same cardinality as α can be extended to a bijection between α and t.

theorem Fintype.card_subtype_or E1 #

∀ {α : Type u_1} (p q : α → Prop) [inst : Fintype { x // p x }] [inst_1 : Fintype { x // q x }]
  [inst_2 : Fintype { x // p x ∨ q x }],
  Fintype.card { x // p x ∨ q x } ≤ Fintype.card { x // p x } + Fintype.card { x // q x }

theorem Fintype.card_subtype_or_disjoint E1 #

∀ {α : Type u_1} (p q : α → Prop),
  Disjoint p q →
    ∀ [inst : Fintype { x // p x }] [inst_1 : Fintype { x // q x }] [inst_2 : Fintype { x // p x ∨ q x }],
      Fintype.card { x // p x ∨ q x } = Fintype.card { x // p x } + Fintype.card { x // q x }

theorem Fintype.card_subtype_eq_or_eq_of_ne E1 #

∀ {α : Type u_3} [inst : Fintype α] [inst_1 : DecidableEq α] {a b : α}, a ≠ b → Fintype.card { c // c = a ∨ c = b } = 2

theorem infinite_sum E0 #

∀ {α : Type u_1} {β : Type u_2}, Infinite (α ⊕ β) ↔ Infinite α ∨ Infinite β