File: Mathlib/SetTheory/Cardinal/Finite.lean

full_name: Nat.card
code: /-- `Nat.card α` is the cardinality of `α` as a natural number.
  If `α` is infinite, `Nat.card α = 0`. -/
protected def card (α : Type*) : ℕ 
goal: ℕ

full_name: Nat.card_eq_fintype_card
code: @[simp]
theorem card_eq_fintype_card [Fintype α] : Nat.card α = Fintype.card α 
goal: Nat.card α = Fintype.card α

full_name: Fintype.card_eq_nat_card
code: /-- 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 _root_.Fintype.card_eq_nat_card {_ : Fintype α} : Fintype.card α = Nat.card α 
goal: ∀ {x : Fintype α}, Fintype.card α = Nat.card α

full_name: Nat.card_eq_finsetCard
code: lemma card_eq_finsetCard (s : Finset α) : Nat.card s = s.card 
goal: Nat.card { x // x ∈ s } = s.card

full_name: Nat.card_eq_card_toFinset
code: lemma card_eq_card_toFinset (s : Set α) [Fintype s] : Nat.card s = s.toFinset.card 
goal: Nat.card ↑s = s.toFinset.card

full_name: Nat.card_eq_card_finite_toFinset
code: lemma card_eq_card_finite_toFinset {s : Set α} (hs : s.Finite) : Nat.card s = hs.toFinset.card 
goal: Nat.card ↑s = hs.toFinset.card

full_name: Nat.card_of_isEmpty
code: @[simp] theorem card_of_isEmpty [IsEmpty α] : Nat.card α = 0 
goal: Nat.card α = 0

full_name: Nat.card_eq_zero_of_infinite
code: @[simp] lemma card_eq_zero_of_infinite [Infinite α] : Nat.card α = 0 
goal: Nat.card α = 0

full_name: Set.Infinite.card_eq_zero
code: lemma _root_.Set.Infinite.card_eq_zero {s : Set α} (hs : s.Infinite) : Nat.card s = 0 
goal: Nat.card ↑s = 0

full_name: Nat.card_eq_zero
code: lemma card_eq_zero : Nat.card α = 0 ↔ IsEmpty α ∨ Infinite α 
goal: Nat.card α = 0 ↔ IsEmpty α ∨ Infinite α

full_name: Nat.card_ne_zero
code: lemma card_ne_zero : Nat.card α ≠ 0 ↔ Nonempty α ∧ Finite α 
goal: Nat.card α ≠ 0 ↔ Nonempty α ∧ Finite α

full_name: Nat.card_pos_iff
code: lemma card_pos_iff : 0 < Nat.card α ↔ Nonempty α ∧ Finite α 
goal: 0 < Nat.card α ↔ Nonempty α ∧ Finite α

full_name: Nat.card_pos
code: @[simp] lemma card_pos [Nonempty α] [Finite α] : 0 < Nat.card α 
goal: 0 < Nat.card α

full_name: Nat.finite_of_card_ne_zero
code: theorem finite_of_card_ne_zero (h : Nat.card α ≠ 0) : Finite α 
goal: Finite α

full_name: Nat.card_congr
code: theorem card_congr (f : α ≃ β) : Nat.card α = Nat.card β 
goal: Nat.card α = Nat.card β

full_name: Nat.card_le_card_of_injective
code: lemma card_le_card_of_injective {α : Type u} {β : Type v} [Finite β] (f : α → β)
    (hf : Injective f) : Nat.card α ≤ Nat.card β 
goal: Nat.card α ≤ Nat.card β

full_name: Nat.card_le_card_of_surjective
code: lemma card_le_card_of_surjective {α : Type u} {β : Type v} [Finite α] (f : α → β)
    (hf : Surjective f) : Nat.card β ≤ Nat.card α 
goal: Nat.card β ≤ Nat.card α

full_name: Nat.card_eq_of_bijective
code: theorem card_eq_of_bijective (f : α → β) (hf : Function.Bijective f) : Nat.card α = Nat.card β 
goal: Nat.card α = Nat.card β

full_name: Nat.bijective_iff_injective_and_card
code: protected theorem bijective_iff_injective_and_card [Finite β] (f : α → β) :
    Bijective f ↔ Injective f ∧ Nat.card α = Nat.card β 
goal: Function.Bijective f ↔ Function.Injective f ∧ Nat.card α = Nat.card β

full_name: Nat.bijective_iff_surjective_and_card
code: protected theorem bijective_iff_surjective_and_card [Finite α] (f : α → β) :
    Bijective f ↔ Surjective f ∧ Nat.card α = Nat.card β 
goal: Function.Bijective f ↔ Function.Surjective f ∧ Nat.card α = Nat.card β

full_name: Function.Injective.bijective_of_nat_card_le
code: theorem _root_.Function.Injective.bijective_of_nat_card_le [Finite β] {f : α → β}
    (inj : Injective f) (hc : Nat.card β ≤ Nat.card α) : Bijective f 
goal: Function.Bijective f

full_name: Function.Surjective.bijective_of_nat_card_le
code: theorem _root_.Function.Surjective.bijective_of_nat_card_le [Finite α] {f : α → β}
    (surj : Surjective f) (hc : Nat.card α ≤ Nat.card β) : Bijective f 
goal: Function.Bijective f

full_name: Nat.card_eq_of_equiv_fin
code: theorem card_eq_of_equiv_fin {α : Type*} {n : ℕ} (f : α ≃ Fin n) : Nat.card α = n 
goal: Nat.card α = n

full_name: Nat.card_mono
code: lemma card_mono (ht : t.Finite) (h : s ⊆ t) : Nat.card s ≤ Nat.card t 
goal: Nat.card ↑s ≤ Nat.card ↑t

full_name: Nat.card_image_le
code: lemma card_image_le {f : α → β} (hs : s.Finite) : Nat.card (f '' s) ≤ Nat.card s 
goal: Nat.card ↑(f '' s) ≤ Nat.card ↑s

full_name: Nat.card_image_of_injOn
code: lemma card_image_of_injOn {f : α → β} (hf : s.InjOn f) : Nat.card (f '' s) = Nat.card s 
goal: Nat.card ↑(f '' s) = Nat.card ↑s

full_name: Nat.card_image_of_injective
code: lemma card_image_of_injective {f : α → β} (hf : Injective f) (s : Set α) :
    Nat.card (f '' s) = Nat.card s 
goal: Nat.card ↑(f '' s) = Nat.card ↑s

full_name: Nat.card_image_equiv
code: lemma card_image_equiv (e : α ≃ β) : Nat.card (e '' s) = Nat.card s 
goal: Nat.card ↑(⇑e '' s) = Nat.card ↑s

full_name: Nat.card_preimage_of_injOn
code: lemma card_preimage_of_injOn {f : α → β} {s : Set β} (hf : (f ⁻¹' s).InjOn f) (hsf : s ⊆ range f) :
    Nat.card (f ⁻¹' s) = Nat.card s 
goal: Nat.card ↑(f ⁻¹' s) = Nat.card ↑s

full_name: Nat.card_preimage_of_injective
code: lemma card_preimage_of_injective {f : α → β} {s : Set β} (hf : Injective f) (hsf : s ⊆ range f) :
    Nat.card (f ⁻¹' s) = Nat.card s 
goal: Nat.card ↑(f ⁻¹' s) = Nat.card ↑s

full_name: Nat.equivFinOfCardPos
code: /-- 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`. -/
def equivFinOfCardPos {α : Type*} (h : Nat.card α ≠ 0) : α ≃ Fin (Nat.card α) 
goal: α ≃ Fin (Nat.card α)

full_name: Nat.card_of_subsingleton
code: theorem card_of_subsingleton (a : α) [Subsingleton α] : Nat.card α = 1 
goal: Nat.card α = 1

full_name: Nat.card_unique
code: theorem card_unique [Unique α] : Nat.card α = 1 
goal: Nat.card α = 1

full_name: Nat.card_eq_one_iff_unique
code: theorem card_eq_one_iff_unique : Nat.card α = 1 ↔ Subsingleton α ∧ Nonempty α 
goal: Nat.card α = 1 ↔ Subsingleton α ∧ Nonempty α

full_name: Nat.card_eq_one_iff_exists
code: theorem card_eq_one_iff_exists : Nat.card α = 1 ↔ ∃ x : α, ∀ y : α, y = x 
goal: Nat.card α = 1 ↔ ∃ x, ∀ (y : α), y = x

full_name: Nat.card_eq_two_iff
code: theorem card_eq_two_iff : Nat.card α = 2 ↔ ∃ x y : α, x ≠ y ∧ {x, y} = @Set.univ α 
goal: Nat.card α = 2 ↔ ∃ x y, x ≠ y ∧ {x, y} = Set.univ

full_name: Nat.card_eq_two_iff'
code: theorem card_eq_two_iff' (x : α) : Nat.card α = 2 ↔ ∃! y, y ≠ x 
goal: Nat.card α = 2 ↔ ∃! y, y ≠ x

full_name: Nat.card_sum
code: @[simp]
theorem card_sum [Finite α] [Finite β] : Nat.card (α ⊕ β) = Nat.card α + Nat.card β 
goal: Nat.card (α ⊕ β) = Nat.card α + Nat.card β

full_name: Nat.card_prod
code: @[simp]
theorem card_prod (α β : Type*) : Nat.card (α × β) = Nat.card α * Nat.card β 
goal: Nat.card (α × β) = Nat.card α * Nat.card β

full_name: Nat.card_ulift
code: @[simp]
theorem card_ulift (α : Type*) : Nat.card (ULift α) = Nat.card α 
goal: Nat.card (ULift.{u_4, u_3} α) = Nat.card α

full_name: Nat.card_plift
code: @[simp]
theorem card_plift (α : Type*) : Nat.card (PLift α) = Nat.card α 
goal: Nat.card (PLift α) = Nat.card α

full_name: Nat.card_pi
code: theorem card_pi {β : α → Type*} [Fintype α] : Nat.card (∀ a, β a) = ∏ a, Nat.card (β a) 
goal: Nat.card ((a : α) → β a) = ∏ a : α, Nat.card (β a)

full_name: Nat.card_fun
code: theorem card_fun [Finite α] : Nat.card (α → β) = Nat.card β ^ Nat.card α 
goal: Nat.card (α → β) = Nat.card β ^ Nat.card α

full_name: Nat.card_zmod
code: @[simp]
theorem card_zmod (n : ℕ) : Nat.card (ZMod n) = n 
goal: Nat.card (ZMod n) = n

full_name: Set.card_singleton_prod
code: lemma card_singleton_prod (a : α) (t : Set β) : Nat.card ({a} ×ˢ t) = Nat.card t 
goal: Nat.card ↑({a} ×ˢ t) = Nat.card ↑t

full_name: Set.card_prod_singleton
code: lemma card_prod_singleton (s : Set α) (b : β) : Nat.card (s ×ˢ {b}) = Nat.card s 
goal: Nat.card ↑(s ×ˢ {b}) = Nat.card ↑s

full_name: PartENat.card
code: /-- `PartENat.card α` is the cardinality of `α` as an extended natural number.
  If `α` is infinite, `PartENat.card α = ⊤`. -/
def card (α : Type*) : PartENat 
goal: PartENat

full_name: PartENat.card_eq_coe_fintype_card
code: @[simp]
theorem card_eq_coe_fintype_card [Fintype α] : card α = Fintype.card α 
goal: PartENat.card α = ↑(Fintype.card α)

full_name: PartENat.card_eq_top_of_infinite
code: @[simp]
theorem card_eq_top_of_infinite [Infinite α] : card α = ⊤ 
goal: PartENat.card α = ⊤

full_name: PartENat.card_sum
code: @[simp]
theorem card_sum (α β : Type*) :
    PartENat.card (α ⊕ β) = PartENat.card α + PartENat.card β 
goal: PartENat.card (α ⊕ β) = PartENat.card α + PartENat.card β

full_name: PartENat.card_congr
code: theorem card_congr {α : Type*} {β : Type*} (f : α ≃ β) : PartENat.card α = PartENat.card β 
goal: PartENat.card α = PartENat.card β

full_name: PartENat.card_ulift
code: @[simp] lemma card_ulift (α : Type*) : card (ULift α) = card α 
goal: PartENat.card (ULift.{u_4, u_3} α) = PartENat.card α

full_name: PartENat.card_plift
code: @[simp] lemma card_plift (α : Type*) : card (PLift α) = card α 
goal: PartENat.card (PLift α) = PartENat.card α

full_name: PartENat.card_image_of_injOn
code: theorem card_image_of_injOn {α : Type u} {β : Type v} {f : α → β} {s : Set α} (h : Set.InjOn f s) :
    card (f '' s) = card s 
goal: PartENat.card ↑(f '' s) = PartENat.card ↑s

full_name: PartENat.card_image_of_injective
code: theorem card_image_of_injective {α : Type u} {β : Type v} (f : α → β) (s : Set α)
    (h : Function.Injective f) : card (f '' s) = card s 
goal: PartENat.card ↑(f '' s) = PartENat.card ↑s

full_name: Cardinal.natCast_le_toPartENat_iff
code: @[simp]
theorem _root_.Cardinal.natCast_le_toPartENat_iff {n : ℕ} {c : Cardinal} :
    ↑n ≤ toPartENat c ↔ ↑n ≤ c 
goal: ↑n ≤ Cardinal.toPartENat c ↔ ↑n ≤ c

full_name: Cardinal.toPartENat_le_natCast_iff
code: @[simp]
theorem _root_.Cardinal.toPartENat_le_natCast_iff {c : Cardinal} {n : ℕ} :
    toPartENat c ≤ n ↔ c ≤ n 
goal: Cardinal.toPartENat c ≤ ↑n ↔ c ≤ ↑n

full_name: Cardinal.natCast_eq_toPartENat_iff
code: @[simp]
theorem _root_.Cardinal.natCast_eq_toPartENat_iff {n : ℕ} {c : Cardinal} :
    ↑n = toPartENat c ↔ ↑n = c 
goal: ↑n = Cardinal.toPartENat c ↔ ↑n = c

full_name: Cardinal.toPartENat_eq_natCast_iff
code: @[simp]
theorem _root_.Cardinal.toPartENat_eq_natCast_iff {c : Cardinal} {n : ℕ} :
    Cardinal.toPartENat c = n ↔ c = n 
goal: Cardinal.toPartENat c = ↑n ↔ c = ↑n

full_name: Cardinal.natCast_lt_toPartENat_iff
code: @[simp]
theorem _root_.Cardinal.natCast_lt_toPartENat_iff {n : ℕ} {c : Cardinal} :
    ↑n < toPartENat c ↔ ↑n < c 
goal: ↑n < Cardinal.toPartENat c ↔ ↑n < c

full_name: Cardinal.toPartENat_lt_natCast_iff
code: @[simp]
theorem _root_.Cardinal.toPartENat_lt_natCast_iff {n : ℕ} {c : Cardinal} :
    toPartENat c < ↑n ↔ c < ↑n 
goal: Cardinal.toPartENat c < ↑n ↔ c < ↑n

full_name: PartENat.card_eq_zero_iff_empty
code: theorem card_eq_zero_iff_empty (α : Type*) : card α = 0 ↔ IsEmpty α 
goal: PartENat.card α = 0 ↔ IsEmpty α

full_name: PartENat.card_le_one_iff_subsingleton
code: theorem card_le_one_iff_subsingleton (α : Type*) : card α ≤ 1 ↔ Subsingleton α 
goal: PartENat.card α ≤ 1 ↔ Subsingleton α

full_name: PartENat.one_lt_card_iff_nontrivial
code: theorem one_lt_card_iff_nontrivial (α : Type*) : 1 < card α ↔ Nontrivial α 
goal: 1 < PartENat.card α ↔ Nontrivial α