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 / V31. Set theory

Mathlib.SetTheory.Cardinal.Finite

87 declarations. Mathlib docs · Source

def Nat.card E1 #

Type u_3 → ℕ

Nat.card α is the cardinality of α as a natural number. If α is infinite, Nat.card α = 0.

theorem Cardinal.toNat_mk E0 #

∀ (α : Type u_3), Cardinal.toNat (Cardinal.mk α) = Nat.card α

theorem Nat.card_eq_fintype_card E0 #

∀ {α : Type u_1} [inst : Fintype α], Nat.card α = Fintype.card α

theorem Fintype.card_eq_nat_card E1 #

∀ {α : Type u_1} {x : Fintype α}, Fintype.card α = Nat.card α

Because this theorem takes Fintype α as a non-instance argument, it can be used in particular when Fintype.card ends up with different instance than the one found by inference

theorem Nat.card_eq_finsetCard E1 #

∀ {α : Type u_1} (s : Finset α), Nat.card ↥s = s.card

theorem Nat.card_eq_card_toFinset E1 #

∀ {α : Type u_1} (s : Set α) [inst : Fintype ↑s], Nat.card ↑s = s.toFinset.card

theorem Nat.card_eq_card_finite_toFinset E1 #

∀ {α : Type u_1} {s : Set α} (hs : s.Finite), Nat.card ↑s = hs.toFinset.card

theorem Nat.subtype_card E1 #

∀ {α : Type u_1} {p : α → Prop} (s : Finset α), (∀ (x : α), x ∈ s ↔ p x) → Nat.card { x // p x } = s.card

theorem Nat.card_of_isEmpty E0 #

∀ {α : Type u_1} [IsEmpty α], Nat.card α = 0

theorem Nat.card_eq_zero_of_infinite E0 #

∀ {α : Type u_1} [Infinite α], Nat.card α = 0

theorem Nat.cast_card E1 #

∀ {α : Type u_1} [Finite α], ↑(Nat.card α) = Cardinal.mk α

theorem Set.Infinite.card_eq_zero E1 #

∀ {α : Type u_1} {s : Set α}, s.Infinite → Nat.card ↑s = 0

theorem Nat.card_eq_zero E1 #

∀ {α : Type u_1}, Nat.card α = 0 ↔ IsEmpty α ∨ Infinite α

theorem Nat.card_ne_zero E1 #

∀ {α : Type u_1}, Nat.card α ≠ 0 ↔ Nonempty α ∧ Finite α

theorem Nat.card_pos_iff E0 #

∀ {α : Type u_1}, 0 < Nat.card α ↔ Nonempty α ∧ Finite α

theorem Nat.card_pos E0 #

∀ {α : Type u_1} [Nonempty α] [Finite α], 0 < Nat.card α

instance Nat.instNeZeroCardOfNonemptyOfFinite E0 #

∀ {α : Type u_1} [Nonempty α] [Finite α], NeZero (Nat.card α)

theorem Nat.finite_of_card_ne_zero E1 #

∀ {α : Type u_1}, Nat.card α ≠ 0 → Finite α

theorem Nat.card_congr E1 #

∀ {α : Type u_1} {β : Type u_2} (f : α ≃ β), Nat.card α = Nat.card β

theorem Nat.card_le_card_of_injective E1 #

∀ {α : Type u} {β : Type v} [Finite β] (f : α → β), Function.Injective f → Nat.card α ≤ Nat.card β

theorem Nat.card_le_card_of_surjective E1 #

∀ {α : Type u} {β : Type v} [Finite α] (f : α → β), Function.Surjective f → Nat.card β ≤ Nat.card α

theorem Nat.card_eq_of_bijective E1 #

∀ {α : Type u_1} {β : Type u_2} (f : α → β), Function.Bijective f → Nat.card α = Nat.card β

theorem Nat.bijective_iff_injective_and_card E1 #

∀ {α : Type u_1} {β : Type u_2} [Finite β] (f : α → β),
  Function.Bijective f ↔ Function.Injective f ∧ Nat.card α = Nat.card β

theorem Nat.bijective_iff_surjective_and_card E1 #

∀ {α : Type u_1} {β : Type u_2} [Finite α] (f : α → β),
  Function.Bijective f ↔ Function.Surjective f ∧ Nat.card α = Nat.card β

theorem Function.Injective.bijective_of_nat_card_le E1 #

∀ {α : Type u_1} {β : Type u_2} [Finite β] {f : α → β},
  Function.Injective f → Nat.card β ≤ Nat.card α → Function.Bijective f

theorem Function.Surjective.bijective_of_nat_card_le E1 #

∀ {α : Type u_1} {β : Type u_2} [Finite α] {f : α → β},
  Function.Surjective f → Nat.card α ≤ Nat.card β → Function.Bijective f

theorem Nat.card_eq_of_equiv_fin E1 #

∀ {α : Type u_3} {n : ℕ} (f : α ≃ Fin n), Nat.card α = n

theorem Nat.card_fin E1 #

∀ (n : ℕ), Nat.card (Fin n) = n

theorem Nat.card_mono E1 #

∀ {α : Type u_1} {s t : Set α}, t.Finite → s ⊆ t → Nat.card ↑s ≤ Nat.card ↑t

theorem Nat.card_image_le E1 #

∀ {α : Type u_1} {β : Type u_2} {s : Set α} {f : α → β}, s.Finite → Nat.card ↑(f '' s) ≤ Nat.card ↑s

theorem Nat.card_image_of_injOn E1 #

∀ {α : Type u_1} {β : Type u_2} {s : Set α} {f : α → β}, Set.InjOn f s → Nat.card ↑(f '' s) = Nat.card ↑s

theorem Nat.card_image_of_injective E1 #

∀ {α : Type u_1} {β : Type u_2} {f : α → β}, Function.Injective f → ∀ (s : Set α), Nat.card ↑(f '' s) = Nat.card ↑s

theorem Nat.card_image_equiv E1 #

∀ {α : Type u_1} {β : Type u_2} {s : Set α} (e : α ≃ β), Nat.card ↑(⇑e '' s) = Nat.card ↑s

theorem Nat.card_preimage_of_injOn E1 #

∀ {α : Type u_1} {β : Type u_2} {f : α → β} {s : Set β},
  Set.InjOn f (f ⁻¹' s) → s ⊆ Set.range f → Nat.card ↑(f ⁻¹' s) = Nat.card ↑s

theorem Nat.card_preimage_of_injective E1 #

∀ {α : Type u_1} {β : Type u_2} {f : α → β} {s : Set β},
  Function.Injective f → s ⊆ Set.range f → Nat.card ↑(f ⁻¹' s) = Nat.card ↑s

theorem Nat.card_univ E1 #

∀ {α : Type u_1}, Nat.card ↑Set.univ = Nat.card α

theorem Nat.card_range_of_injective E1 #

∀ {α : Type u_1} {β : Type u_2} {f : α → β}, Function.Injective f → Nat.card ↑(Set.range f) = Nat.card α

def Nat.equivFinOfCardPos E1 #

{α : Type u_3} → Nat.card α ≠ 0 → α ≃ Fin (Nat.card α)

If the cardinality is positive, that means it is a finite type, so there is an equivalence between α and Fin (Nat.card α). See also Finite.equivFin.

theorem Nat.card_of_subsingleton E1 #

∀ {α : Type u_1} (a : α) [Subsingleton α], Nat.card α = 1

theorem Nat.card_eq_one_iff_unique E1 #

∀ {α : Type u_1}, Nat.card α = 1 ↔ Subsingleton α ∧ Nonempty α

theorem Nat.card_unique E0 #

∀ {α : Type u_1} [Nonempty α] [Subsingleton α], Nat.card α = 1

theorem Nat.card_eq_one_iff_exists E1 #

∀ {α : Type u_1}, Nat.card α = 1 ↔ ∃ x, ∀ (y : α), y = x

theorem Nat.card_eq_two_iff E0 #

∀ {α : Type u_1}, Nat.card α = 2 ↔ ∃ x y, x ≠ y ∧ {x, y} = Set.univ

theorem Nat.card_eq_two_iff' E1 #

∀ {α : Type u_1} (x : α), Nat.card α = 2 ↔ ∃! y, y ≠ x

theorem Nat.card_subtype_true E0 #

∀ {α : Type u_1}, Nat.card { _a // True } = Nat.card α

theorem Nat.card_sum E0 #

∀ {α : Type u_1} {β : Type u_2} [Finite α] [Finite β], Nat.card (α ⊕ β) = Nat.card α + Nat.card β

theorem Nat.card_prod E0 #

∀ (α : Type u_3) (β : Type u_4), Nat.card (α × β) = Nat.card α * Nat.card β

theorem Nat.card_ulift E0 #

∀ (α : Type u_3), Nat.card (ULift.{u_4, u_3} α) = Nat.card α

theorem Nat.card_plift E0 #

∀ (α : Type u_3), Nat.card (PLift α) = Nat.card α

theorem Nat.card_sigma E1 #

∀ {α : Type u_1} {β : α → Type u_3} [inst : Fintype α] [∀ (a : α), Finite (β a)],
  Nat.card (Sigma β) = ∑ a, Nat.card (β a)

theorem Nat.card_pi E1 #

∀ {α : Type u_1} {β : α → Type u_3} [inst : Fintype α], Nat.card ((a : α) → β a) = ∏ a, Nat.card (β a)

theorem Nat.card_fun E1 #

∀ {α : Type u_1} {β : Type u_2} [Finite α], Nat.card (α → β) = Nat.card β ^ Nat.card α

theorem Nat.card_zmod E0 #

∀ (n : ℕ), Nat.card (ZMod n) = n

theorem Set.card_singleton_prod E1 #

∀ {α : Type u_1} {β : Type u_2} (a : α) (t : Set β), Nat.card ↑({a} ×ˢ t) = Nat.card ↑t

theorem Set.card_prod_singleton E1 #

∀ {α : Type u_1} {β : Type u_2} (s : Set α) (b : β), Nat.card ↑(s ×ˢ {b}) = Nat.card ↑s

theorem Set.natCard_pos E1 #

∀ {α : Type u_1} {s : Set α}, s.Finite → (0 < Nat.card ↑s ↔ s.Nonempty)

theorem Set.Nonempty.natCard_pos E1 #

∀ {α : Type u_1} {s : Set α}, s.Finite → s.Nonempty → 0 < Nat.card ↑s

Alias of the reverse direction of Set.natCard_pos.

theorem Set.natCard_graphOn E1 #

∀ {α : Type u_1} {β : Type u_2} (s : Set α) (f : α → β), Nat.card ↑(Set.graphOn f s) = Nat.card ↑s

def ENat.card E1 #

Type u_3 → ℕ∞

ENat.card α is the cardinality of α as an extended natural number. If α is infinite, ENat.card α = ⊤.

theorem ENat.toNat_card E0 #

∀ (α : Type u_3), (ENat.card α).toNat = Nat.card α

theorem Cardinal.toENat_mk E0 #

∀ (α : Type u_3), Cardinal.toENat (Cardinal.mk α) = ENat.card α

theorem ENat.card_eq_coe_fintype_card E0 #

∀ {α : Type u_1} [inst : Fintype α], ENat.card α = ↑(Fintype.card α)

theorem ENat.card_eq_top_of_infinite E0 #

∀ {α : Type u_1} [Infinite α], ENat.card α = ⊤

theorem ENat.card_eq_top E0 #

∀ {α : Type u_1}, ENat.card α = ⊤ ↔ Infinite α

theorem ENat.card_lt_top_of_finite E0 #

∀ {α : Type u_1} [Finite α], ENat.card α < ⊤

theorem ENat.card_lt_top E0 #

∀ {α : Type u_1}, ENat.card α < ⊤ ↔ Finite α

theorem ENat.card_sum E0 #

∀ (α : Type u_3) (β : Type u_4), ENat.card (α ⊕ β) = ENat.card α + ENat.card β

theorem ENat.card_congr E1 #

∀ {α : Type u_3} {β : Type u_4} (f : α ≃ β), ENat.card α = ENat.card β

theorem ENat.card_ulift E0 #

∀ (α : Type u_3), ENat.card (ULift.{u_4, u_3} α) = ENat.card α

theorem ENat.card_plift E0 #

∀ (α : Type u_3), ENat.card (PLift α) = ENat.card α

theorem ENat.card_image_of_injOn E1 #

∀ {α : Type u_3} {β : Type u_4} {f : α → β} {s : Set α}, Set.InjOn f s → ENat.card ↑(f '' s) = ENat.card ↑s

theorem ENat.card_image_of_injective E1 #

∀ {α : Type u_3} {β : Type u_4} (f : α → β) (s : Set α), Function.Injective f → ENat.card ↑(f '' s) = ENat.card ↑s

theorem ENat.card_le_card_of_injective E1 #

∀ {α : Type u_3} {β : Type u_4} {f : α → β}, Function.Injective f → ENat.card α ≤ ENat.card β

theorem ENat.card_eq_zero_iff_empty E1 #

∀ (α : Type u_3), ENat.card α = 0 ↔ IsEmpty α

theorem ENat.card_ne_zero_iff_nonempty E1 #

∀ (α : Type u_3), ENat.card α ≠ 0 ↔ Nonempty α

theorem ENat.card_ne_zero E0 #

∀ {α : Type u_1} [Nonempty α], ENat.card α ≠ 0

theorem ENat.card_pos_iff_nonempty E1 #

∀ (α : Type u_3), 0 < ENat.card α ↔ Nonempty α

theorem ENat.one_le_card_iff_nonempty E1 #

∀ (α : Type u_3), 1 ≤ ENat.card α ↔ Nonempty α

theorem ENat.card_pos E0 #

∀ {α : Type u_1} [Nonempty α], 0 < ENat.card α

theorem ENat.card_le_one_iff_subsingleton E1 #

∀ (α : Type u_3), ENat.card α ≤ 1 ↔ Subsingleton α

theorem ENat.card_le_one E0 #

∀ {α : Type u_1} [Subsingleton α], ENat.card α ≤ 1

theorem ENat.card_eq_one_iff_unique E1 #

∀ {α : Type u_3}, ENat.card α = 1 ↔ Nonempty (Unique α)

theorem ENat.one_lt_card_iff_nontrivial E1 #

∀ (α : Type u_3), 1 < ENat.card α ↔ Nontrivial α

theorem ENat.one_lt_card E0 #

∀ {α : Type u_1} [Nontrivial α], 1 < ENat.card α

theorem ENat.exists_ne_ne_of_three_le E1 #

∀ {α : Type u_1}, 3 ≤ ENat.card α → ∀ (x y : α), ∃ z, z ≠ x ∧ z ≠ y

theorem ENat.card_prod E0 #

∀ (α : Type u_3) (β : Type u_4), ENat.card (α × β) = ENat.card α * ENat.card β

theorem ENat.card_fun E0 #

∀ {α : Type u_3} {β : Type u_4}, ENat.card (α → β) = ENat.card β ^ ENat.card α