Equations
- instFintypeSum α β = { elems := Finset.univ.disjSum Finset.univ, complete := ⋯ }
@[simp]
theorem
Fintype.card_sum
{α : Type u_1}
{β : Type u_2}
[Fintype α]
[Fintype β]
:
Fintype.card (α ⊕ β) = Fintype.card α + Fintype.card β
If the subtype of all-but-one elements is a Fintype
then the type itself is a Fintype
.
Equations
- fintypeOfFintypeNe a x✝ = Fintype.ofBijective (Sum.elim Subtype.val Subtype.val) ⋯
Instances For
theorem
image_subtype_ne_univ_eq_image_erase
{α : Type u_1}
{β : Type u_2}
[Fintype α]
[DecidableEq β]
(k : β)
(b : α → β)
:
Finset.image (fun (i : { a : α // b a ≠ k }) => b ↑i) Finset.univ = (Finset.image b Finset.univ).erase k
theorem
image_subtype_univ_ssubset_image_univ
{α : Type u_1}
{β : Type u_2}
[Fintype α]
[DecidableEq β]
(k : β)
(b : α → β)
(hk : k ∈ Finset.image b Finset.univ)
(p : β → Prop)
[DecidablePred p]
(hp : ¬p k)
:
Finset.image (fun (i : { a : α // p (b a) }) => b ↑i) Finset.univ ⊂ Finset.image b Finset.univ
theorem
Finset.exists_equiv_extend_of_card_eq
{α : Type u_1}
{β : Type u_2}
[Fintype α]
[DecidableEq β]
{t : Finset β}
(hαt : Fintype.card α = t.card)
{s : Finset α}
{f : α → β}
(hfst : Finset.image f s ⊆ t)
(hfs : Set.InjOn f ↑s)
:
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
{α : Type u_1}
{β : Type u_2}
[Fintype α]
{t : Finset β}
(hαt : Fintype.card α = t.card)
{s : Set α}
{f : α → β}
(hfst : Set.MapsTo f s ↑t)
(hfs : Set.InjOn f s)
:
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
{α : Type u_1}
(p q : α → Prop)
[Fintype { x : α // p x }]
[Fintype { x : α // q x }]
[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
{α : Type u_1}
(p q : α → Prop)
(h : Disjoint p q)
[Fintype { x : α // p x }]
[Fintype { x : α // q x }]
[Fintype { x : α // p x ∨ q x }]
:
Fintype.card { x : α // p x ∨ q x } = Fintype.card { x : α // p x } + Fintype.card { x : α // q x }