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

49 declarations. Mathlib docs · Source

def Finite.equivFin E1 #

(α : Type u_3) → [Finite α] → α ≃ Fin (Nat.card α)

There is (noncomputably) an equivalence between a finite type α and Fin (Nat.card α).

def Finite.equivFinOfCardEq E1 #

{α : Type u_1} → [Finite α] → {n : ℕ} → Nat.card α = n → α ≃ Fin n

Similar to Finite.equivFin but with control over the term used for the cardinality.

theorem Nat.card_eq E0 #

∀ (α : Type u_3), Nat.card α = if x : Finite α then Fintype.card α else 0

theorem Finite.card_pos_iff E0 #

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

theorem Finite.card_pos E1 #

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

theorem Finite.card_eq E0 #

∀ {α : Type u_1} {β : Type u_2} [Finite α] [Finite β], Nat.card α = Nat.card β ↔ Nonempty (α ≃ β)

theorem Finite.card_le_one_iff_subsingleton E1 #

∀ {α : Type u_1} [Finite α], Nat.card α ≤ 1 ↔ Subsingleton α

theorem Finite.one_lt_card_iff_nontrivial E1 #

∀ {α : Type u_1} [Finite α], 1 < Nat.card α ↔ Nontrivial α

theorem Finite.one_lt_card E1 #

∀ {α : Type u_1} [Finite α] [h : Nontrivial α], 1 < Nat.card α

theorem Finite.card_option E0 #

∀ {α : Type u_1} [Finite α], Nat.card (Option α) = Nat.card α + 1

theorem Finite.card_le_of_embedding E1 #

∀ {α : Type u_1} {β : Type u_2} [Finite β] (f : α ↪ β), Nat.card α ≤ Nat.card β

theorem Finite.card_eq_zero_iff E0 #

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

theorem Finite.card_le_of_injective' E1 #

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

If f is injective, then Nat.card α ≤ Nat.card β. We must also assume Nat.card β = 0 → Nat.card α = 0 since Nat.card is defined to be 0 for infinite types.

theorem Finite.card_le_of_embedding' E1 #

∀ {α : Type u_1} {β : Type u_2} (f : α ↪ β), (Nat.card β = 0 → Nat.card α = 0) → Nat.card α ≤ Nat.card β

If f is an embedding, then Nat.card α ≤ Nat.card β. We must also assume Nat.card β = 0 → Nat.card α = 0 since Nat.card is defined to be 0 for infinite types.

theorem Finite.card_le_of_surjective' E1 #

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

If f is surjective, then Nat.card β ≤ Nat.card α. We must also assume Nat.card α = 0 → Nat.card β = 0 since Nat.card is defined to be 0 for infinite types.

theorem Finite.card_eq_zero_of_surjective E1 #

∀ {α : Type u_1} {β : Type u_2} {f : α → β}, Function.Surjective f → Nat.card β = 0 → Nat.card α = 0

NB: Nat.card is defined to be 0 for infinite types.

theorem Finite.card_eq_zero_of_injective E1 #

∀ {α : Type u_1} {β : Type u_2} [Nonempty α] {f : α → β}, Function.Injective f → Nat.card α = 0 → Nat.card β = 0

NB: Nat.card is defined to be 0 for infinite types.

theorem Finite.card_eq_zero_of_embedding E1 #

∀ {α : Type u_1} {β : Type u_2} [Nonempty α] (f : α ↪ β), Nat.card α = 0 → Nat.card β = 0

NB: Nat.card is defined to be 0 for infinite types.

theorem Finite.card_image_le E1 #

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

theorem Finite.card_range_le E1 #

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

theorem Finite.card_subtype_le E1 #

∀ {α : Type u_1} [Finite α] (p : α → Prop), Nat.card { x // p x } ≤ Nat.card α

theorem Finite.card_subtype_lt E1 #

∀ {α : Type u_1} [Finite α] {p : α → Prop} {x : α}, ¬p x → Nat.card { x // p x } < Nat.card α

theorem Finite.induction_subsingleton_or_nontrivial E1 #

∀ {P : Type u_3 → Prop} (α : Type u_3) [Finite α],
  (∀ (α : Type u_3) [Finite α] [Subsingleton α], P α) →
    (∀ (α : Type u_3) [Finite α] [Nontrivial α], (∀ (β : Type u_3) [Finite β], Nat.card β < Nat.card α → P β) → P α) →
      P α

A custom induction principle for finite types, by strong induction on Nat.card: the base case is a subsingleton type, and the induction step is for nontrivial types, where one can assume the hypothesis for all types of smaller cardinality.

theorem ENat.card_eq_coe_natCard E1 #

∀ (α : Type u_3) [Finite α], ENat.card α = ↑(Nat.card α)

theorem Set.card_union_le E1 #

∀ {α : Type u_1} (s t : Set α), Nat.card ↑(s ∪ t) ≤ Nat.card ↑s + Nat.card ↑t

theorem Set.Finite.card_lt_card E1 #

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

theorem Set.ecard_le_ecard E1 #

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

theorem Set.Finite.ecard_lt_ecard E1 #

∀ {α : Type u_1} {s t : Set α}, s.Finite → s ⊂ t → ENat.card ↑s < ENat.card ↑t

theorem Set.Finite.card_strictMonoOn E1 #

∀ {α : Type u_1}, StrictMonoOn (Nat.card ∘ Set.Elem) (Set.ofPred Set.Finite)

theorem Set.Finite.ecard_strictMonoOn E1 #

∀ {α : Type u_1}, StrictMonoOn (ENat.card ∘ Set.Elem) (Set.ofPred Set.Finite)

theorem Set.Finite.equiv_image_eq_iff_subset E1 #

∀ {α : Type u_1} {s : Set α} (e : α ≃ α), s.Finite → (⇑e '' s = s ↔ ⇑e '' s ⊆ s)

theorem Set.card_strictMono E1 #

∀ {α : Type u_1} [Finite α], StrictMono (Nat.card ∘ Set.Elem)

theorem Set.ecard_strictMono E1 #

∀ {α : Type u_1} [Finite α], StrictMono (ENat.card ∘ Set.Elem)

theorem Finset.card_le_encard E1 #

∀ {α : Type u_1} {s : Finset α} {s' : Set α}, (∀ a ∈ s, a ∈ s') → ↑s.card ≤ s'.encard

theorem Finset.card_le_ncard E1 #

∀ {α : Type u_1} {s : Finset α} {s' : Set α}, s'.Finite → (∀ a ∈ s, a ∈ s') → s.card ≤ s'.ncard

theorem Finset.card_le_enatCard E1 #

∀ {α : Type u_1} (s : Finset α), ↑s.card ≤ ENat.card α

theorem Finset.card_le_natCard E1 #

∀ {α : Type u_1} (s : Finset α) [Finite α], s.card ≤ Nat.card α

theorem Multiset.ncard_ofPred_mem E1 #

∀ {α : Type u_1} {m : Multiset α} [inst : DecidableEq α], {a | a ∈ m}.ncard = m.dedup.card

theorem Multiset.encard_ofPred_mem E1 #

∀ {α : Type u_1} {m : Multiset α} [inst : DecidableEq α], {a | a ∈ m}.encard = ↑m.dedup.card

theorem Multiset.Nodup.card_le_encard E1 #

∀ {α : Type u_1} {m : Multiset α} {s : Set α}, m.Nodup → (∀ a ∈ m, a ∈ s) → ↑m.card ≤ s.encard

theorem Multiset.Nodup.card_le_ncard E1 #

∀ {α : Type u_1} {m : Multiset α} {s : Set α}, m.Nodup → s.Finite → (∀ a ∈ m, a ∈ s) → m.card ≤ s.ncard

theorem Multiset.Nodup.card_le_enatCard E1 #

∀ {α : Type u_1} {m : Multiset α}, m.Nodup → ↑m.card ≤ ENat.card α

theorem Multiset.Nodup.card_le_natCard E1 #

∀ {α : Type u_1} {m : Multiset α}, m.Nodup → ∀ [Finite α], m.card ≤ Nat.card α

theorem List.ncard_ofPred_mem E1 #

∀ {α : Type u_1} {l : List α} [inst : DecidableEq α], {a | a ∈ l}.ncard = l.dedup.length

theorem List.encard_ofPred_mem E1 #

∀ {α : Type u_1} {l : List α} [inst : DecidableEq α], {a | a ∈ l}.encard = ↑l.dedup.length

theorem List.Nodup.length_le_encard E1 #

∀ {α : Type u_1} {l : List α} {s : Set α}, l.Nodup → (∀ a ∈ l, a ∈ s) → ↑l.length ≤ s.encard

theorem List.Nodup.length_le_ncard E1 #

∀ {α : Type u_1} {l : List α} {s : Set α}, l.Nodup → s.Finite → (∀ a ∈ l, a ∈ s) → l.length ≤ s.ncard

theorem List.Nodup.length_le_enatCard E1 #

∀ {α : Type u_1} {l : List α}, l.Nodup → ↑l.length ≤ ENat.card α

theorem List.Nodup.length_le_natCard E1 #

∀ {α : Type u_1} {l : List α}, l.Nodup → ∀ [Finite α], l.length ≤ Nat.card α