Finite Cardinality Functions #
Main Definitions #
Nat.card α
is the cardinality ofα
as a natural number. Ifα
is infinite,Nat.card α = 0
.PartENat.card α
is the cardinality ofα
as an extended natural number (usingPart ℕ
). Ifα
is infinite,PartENat.card α = ⊤
.
Nat.card α
is the cardinality of α
as a natural number.
If α
is infinite, Nat.card α = 0
.
Equations
- Nat.card α = Cardinal.toNat (Cardinal.mk α)
Instances For
@[simp]
theorem
Nat.card_eq_card_toFinset
{α : Type u_1}
(s : Set α)
[Fintype ↑s]
:
Nat.card ↑s = (Set.toFinset s).card
theorem
Nat.card_eq_card_finite_toFinset
{α : Type u_1}
{s : Set α}
(hs : Set.Finite s)
:
Nat.card ↑s = (Set.Finite.toFinset hs).card
theorem
Nat.card_le_card_of_injective
{α : Type u}
{β : Type v}
[Finite β]
(f : α → β)
(hf : Function.Injective f)
:
theorem
Nat.card_le_card_of_surjective
{α : Type u}
{β : Type v}
[Finite α]
(f : α → β)
(hf : Function.Surjective f)
:
theorem
Nat.card_eq_of_bijective
{α : Type u_1}
{β : Type u_2}
(f : α → β)
(hf : Function.Bijective f)
:
theorem
Nat.card_pi
{α : Type u_1}
{β : α → Type u_3}
[Fintype α]
:
Nat.card ((a : α) → β a) = Finset.prod Finset.univ fun (a : α) => Nat.card (β a)
PartENat.card α
is the cardinality of α
as an extended natural number.
If α
is infinite, PartENat.card α = ⊤
.
Equations
Instances For
@[simp]
theorem
PartENat.card_eq_coe_fintype_card
{α : Type u_1}
[Fintype α]
:
PartENat.card α = ↑(Fintype.card α)
@[simp]
@[simp]
theorem
PartENat.card_sum
(α : Type u_3)
(β : Type u_4)
:
PartENat.card (α ⊕ β) = PartENat.card α + PartENat.card β
@[simp]
theorem
PartENat.card_image_of_injOn
{α : Type u}
{β : Type v}
{f : α → β}
{s : Set α}
(h : Set.InjOn f s)
:
PartENat.card ↑(f '' s) = PartENat.card ↑s
theorem
PartENat.card_image_of_injective
{α : Type u}
{β : Type v}
(f : α → β)
(s : Set α)
(h : Function.Injective f)
:
PartENat.card ↑(f '' s) = PartENat.card ↑s
@[simp]
theorem
Cardinal.natCast_le_toPartENat_iff
{n : ℕ}
{c : Cardinal.{u_3}}
:
↑n ≤ Cardinal.toPartENat c ↔ ↑n ≤ c
@[simp]
theorem
Cardinal.toPartENat_le_natCast_iff
{c : Cardinal.{u_3}}
{n : ℕ}
:
Cardinal.toPartENat c ≤ ↑n ↔ c ≤ ↑n
@[simp]
theorem
Cardinal.natCast_eq_toPartENat_iff
{n : ℕ}
{c : Cardinal.{u_3}}
:
↑n = Cardinal.toPartENat c ↔ ↑n = c
@[simp]
theorem
Cardinal.toPartENat_eq_natCast_iff
{c : Cardinal.{u_3}}
{n : ℕ}
:
Cardinal.toPartENat c = ↑n ↔ c = ↑n
@[simp]
theorem
Cardinal.natCast_lt_toPartENat_iff
{n : ℕ}
{c : Cardinal.{u_3}}
:
↑n < Cardinal.toPartENat c ↔ ↑n < c
@[simp]
theorem
Cardinal.toPartENat_lt_natCast_iff
{n : ℕ}
{c : Cardinal.{u_3}}
:
Cardinal.toPartENat c < ↑n ↔ c < ↑n