doc-next-gen

Mathlib.SetTheory.Cardinal.Basic

Module docstring

{"# Basic results on cardinal numbers

We provide a collection of basic results on cardinal numbers, in particular focussing on finite/countable/small types and sets.

Main definitions

  • Cardinal.powerlt a b or a ^< b is defined as the supremum of a ^ c for c < b.

References

Tags

cardinal number, cardinal arithmetic, cardinal exponentiation, aleph, Cantor's theorem, König's theorem, Konig's theorem ","### Lifting cardinals to a higher universe ","### Basic cardinals ","### Order properties ","### Small sets of cardinals ","### Bounds on suprema ","### Properties about the cast from ","### Properties about aleph0 ","### Cardinalities of basic sets and types ","### powerlt operation "}

Cardinal.mk_preimage_down theorem
{s : Set α} : #(ULift.down.{v} ⁻¹' s) = lift.{v} (#s)
Full source
@[simp]
lemma mk_preimage_down {s : Set α} : #(ULift.down.{v} ⁻¹' s) = lift.{v} (#s) := by
  rw [← mk_uLift, Cardinal.eq]
  constructor
  let f : ULift.downULift.down ⁻¹' sULift s := fun x ↦ ULift.up (restrictPreimage s ULift.down x)
  have : Function.Bijective f :=
    ULift.up_bijective.comp (restrictPreimage_bijective _ (ULift.down_bijective))
  exact Equiv.ofBijective f this
Cardinality of Preimage under Down Function Equals Lifted Cardinality
Informal description
For any set $s$ of elements of type $\alpha$, the cardinality of the preimage of $s$ under the function $\mathrm{ULift.down} : \mathrm{ULift}\,\alpha \to \alpha$ is equal to the lift of the cardinality of $s$ to a higher universe. In symbols: $$\#(\mathrm{ULift.down}^{-1}(s)) = \mathrm{lift}(\#s)$$
Cardinal.lift_mk_shrink theorem
(α : Type u) [Small.{v} α] : Cardinal.lift.{max u w} #(Shrink.{v} α) = Cardinal.lift.{max v w} #α
Full source
theorem lift_mk_shrink (α : Type u) [Small.{v} α] :
    Cardinal.lift.{max u w} #(Shrink.{v} α) = Cardinal.lift.{max v w}  :=
  lift_mk_eq.2 ⟨(equivShrink α).symm⟩
Equality of Lifted Cardinalities for Small Types and Their Models
Informal description
For any type $\alpha$ in universe $u$ that is $v$-small, the lift of the cardinality of its model `Shrink.{v} α` in universe $\max(u,w)$ is equal to the lift of the cardinality of $\alpha$ in universe $\max(v,w)$. In symbols: $$\text{lift}_{\max(u,w)} \#(\text{Shrink}_{\v} \alpha) = \text{lift}_{\max(v,w)} \#\alpha$$
Cardinal.lift_mk_shrink' theorem
(α : Type u) [Small.{v} α] : Cardinal.lift.{u} #(Shrink.{v} α) = Cardinal.lift.{v} #α
Full source
@[simp]
theorem lift_mk_shrink' (α : Type u) [Small.{v} α] :
    Cardinal.lift.{u} #(Shrink.{v} α) = Cardinal.lift.{v}  :=
  lift_mk_shrink.{u, v, 0} α
Equality of Lifted Cardinalities for Small Types and Their Models (Universe-Specific Version)
Informal description
For any type $\alpha$ in universe $u$ that is $v$-small, the lift of the cardinality of its model $\mathrm{Shrink}_v \alpha$ in universe $u$ is equal to the lift of the cardinality of $\alpha$ in universe $v$. In symbols: $$\mathrm{lift}_u \#(\mathrm{Shrink}_v \alpha) = \mathrm{lift}_v \#\alpha$$
Cardinal.lift_mk_shrink'' theorem
(α : Type max u v) [Small.{v} α] : Cardinal.lift.{u} #(Shrink.{v} α) = #α
Full source
@[simp]
theorem lift_mk_shrink'' (α : Type max u v) [Small.{v} α] :
    Cardinal.lift.{u} #(Shrink.{v} α) =  := by
  rw [← lift_umax, lift_mk_shrink.{max u v, v, 0} α, ← lift_umax, lift_id]
Equality of Lifted Shrink Cardinality and Original Cardinality for Small Types in $\max(u,v)$
Informal description
For any type $\alpha$ in the universe $\max(u,v)$ that is $v$-small, the lift of the cardinality of its model $\mathrm{Shrink}_v \alpha$ in universe $u$ is equal to the cardinality of $\alpha$. In symbols: $$\mathrm{lift}_u \#(\mathrm{Shrink}_v \alpha) = \#\alpha$$
Cardinal.prod_eq_of_fintype theorem
{α : Type u} [h : Fintype α] (f : α → Cardinal.{v}) : prod f = Cardinal.lift.{u} (∏ i, f i)
Full source
theorem prod_eq_of_fintype {α : Type u} [h : Fintype α] (f : α → CardinalCardinal.{v}) :
    prod f = Cardinal.lift.{u} (∏ i, f i) := by
  revert f
  refine Fintype.induction_empty_option ?_ ?_ ?_ α (h_fintype := h)
  · intro α β hβ e h f
    letI := Fintype.ofEquiv β e.symm
    rw [← e.prod_comp f, ← h]
    exact mk_congr (e.piCongrLeft _).symm
  · intro f
    rw [Fintype.univ_pempty, Finset.prod_empty, lift_one, Cardinal.prod, mk_eq_one]
  · intro α hα h f
    rw [Cardinal.prod, mk_congr Equiv.piOptionEquivProd, mk_prod, lift_umaxlift_umax.{v, u}, mk_out, ←
        Cardinal.prod, lift_prod, Fintype.prod_option, lift_mul, ← h fun a => f (some a)]
    simp only [lift_id]
Product of Cardinals over Finite Type Equals Lifted Finite Product
Informal description
For any finite type $\alpha$ and any family of cardinal numbers $\{f(i)\}_{i \in \alpha}$, the product cardinal $\prod_{i \in \alpha} f(i)$ is equal to the lift of the finite product $\prod_{i \in \alpha} f(i)$ to the universe of $\alpha$. In other words: \[ \prod_{i \in \alpha} f(i) = \text{lift}_{u} \left( \prod_{i \in \alpha} f(i) \right), \] where $\text{lift}_{u}$ denotes the universe lifting operation for cardinals.
Cardinal.le_one_iff_subsingleton theorem
{α : Type u} : #α ≤ 1 ↔ Subsingleton α
Full source
theorem le_one_iff_subsingleton {α : Type u} : #α ≤ 1 ↔ Subsingleton α :=
  ⟨fun ⟨f⟩ => ⟨fun _ _ => f.injective (Subsingleton.elim _ _)⟩, fun ⟨h⟩ =>
    ⟨fun _ => ULift.up 0, fun _ _ _ => h _ _⟩⟩
Cardinality $\leq 1$ iff Type is a Subsingleton
Informal description
For any type $\alpha$, the cardinality of $\alpha$ is less than or equal to $1$ if and only if $\alpha$ is a subsingleton (i.e., any two elements of $\alpha$ are equal).
Cardinal.one_lt_iff_nontrivial theorem
{α : Type u} : 1 < #α ↔ Nontrivial α
Full source
theorem one_lt_iff_nontrivial {α : Type u} : 1 < #α ↔ Nontrivial α := by
  rw [← not_le, le_one_iff_subsingleton, ← not_nontrivial_iff_subsingleton, Classical.not_not]
Cardinality Greater Than One iff Nontrivial Type
Informal description
For any type $\alpha$, the cardinality of $\alpha$ is greater than $1$ if and only if $\alpha$ is a nontrivial type (i.e., it contains at least two distinct elements).
Cardinal.sInf_eq_zero_iff theorem
{s : Set Cardinal} : sInf s = 0 ↔ s = ∅ ∨ ∃ a ∈ s, a = 0
Full source
lemma sInf_eq_zero_iff {s : Set Cardinal} : sInfsInf s = 0 ↔ s = ∅ ∨ ∃ a ∈ s, a = 0 := by
  refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
  · rcases s.eq_empty_or_nonempty with rfl | hne
    · exact Or.inl rfl
    · exact Or.inr ⟨sInf s, csInf_mem hne, h⟩
  · rcases h with rfl | ⟨a, ha, rfl⟩
    · exact Cardinal.sInf_empty
    · exact eq_bot_iff.2 (csInf_le' ha)
Infimum of Set of Cardinals is Zero iff Empty or Contains Zero
Informal description
For any set $s$ of cardinal numbers, the infimum of $s$ is equal to zero if and only if either $s$ is the empty set or there exists a cardinal number $a \in s$ such that $a = 0$.
Cardinal.iInf_eq_zero_iff theorem
{ι : Sort*} {f : ι → Cardinal} : (⨅ i, f i) = 0 ↔ IsEmpty ι ∨ ∃ i, f i = 0
Full source
lemma iInf_eq_zero_iff {ι : Sort*} {f : ι → Cardinal} :
    (⨅ i, f i) = 0 ↔ IsEmpty ι ∨ ∃ i, f i = 0 := by
  simp [iInf, sInf_eq_zero_iff]
Infimum of Cardinals is Zero if and only if Index is Empty or Contains Zero
Informal description
For any indexed family of cardinal numbers $f : \iota \to \text{Cardinal}$, the infimum $\bigsqcap_{i} f(i)$ equals zero if and only if either the index type $\iota$ is empty or there exists some index $i$ such that $f(i) = 0$.
Cardinal.iSup_of_empty theorem
{ι} (f : ι → Cardinal) [IsEmpty ι] : iSup f = 0
Full source
/-- A variant of `ciSup_of_empty` but with `0` on the RHS for convenience -/
protected theorem iSup_of_empty {ι} (f : ι → Cardinal) [IsEmpty ι] : iSup f = 0 :=
  ciSup_of_empty f
Supremum over Empty Index Set Equals Zero Cardinal
Informal description
For any index type $\iota$ that is empty and any function $f : \iota \to \text{Cardinal}$, the supremum of $f$ over $\iota$ is equal to the zero cardinal, i.e., $\bigsqcup_{i \in \iota} f(i) = 0$.
Cardinal.lift_sInf theorem
(s : Set Cardinal) : lift.{u, v} (sInf s) = sInf (lift.{u, v} '' s)
Full source
@[simp]
theorem lift_sInf (s : Set Cardinal) : lift.{u, v} (sInf s) = sInf (liftlift.{u, v}lift.{u, v} '' s) := by
  rcases eq_empty_or_nonempty s with (rfl | hs)
  · simp
  · exact lift_monotone.map_csInf hs
Lift Preserves Infimum of Cardinals: $\text{lift}(\inf s) = \inf (\text{lift}'' s)$
Informal description
For any set $s$ of cardinal numbers, the lift of the infimum of $s$ is equal to the infimum of the image of $s$ under the lift operation. That is, \[ \text{lift}(\inf s) = \inf (\text{lift}'' s). \]
Cardinal.lift_iInf theorem
{ι} (f : ι → Cardinal) : lift.{u, v} (iInf f) = ⨅ i, lift.{u, v} (f i)
Full source
@[simp]
theorem lift_iInf {ι} (f : ι → Cardinal) : lift.{u, v} (iInf f) = ⨅ i, lift.{u, v} (f i) := by
  unfold iInf
  convert lift_sInf (range f)
  simp_rw [← comp_apply (f := lift), range_comp]
Lift Preserves Indexed Infimum of Cardinals: $\text{lift}(\inf_i f(i)) = \inf_i \text{lift}(f(i))$
Informal description
For any indexed family of cardinal numbers $f : \iota \to \text{Cardinal}$, the lift of the infimum of $f$ is equal to the infimum of the lifts of each $f(i)$. That is, \[ \text{lift}(\bigsqcap_i f(i)) = \bigsqcap_i \text{lift}(f(i)). \]
Cardinal.small_Iic instance
(a : Cardinal.{u}) : Small.{u} (Iic a)
Full source
instance small_Iic (a : CardinalCardinal.{u}) : Small.{u} (Iic a) := by
  rw [← mk_out a]
  apply @small_of_surjective (Set a.out) (Iic #a.out) _ fun x => ⟨#x, mk_set_le x⟩
  rintro ⟨x, hx⟩
  simpa using le_mk_iff_exists_set.1 hx
Smallness of the Set of Cardinals Below a Given Cardinal
Informal description
For any cardinal number $a$ in universe $u$, the set of cardinals less than or equal to $a$ (denoted $\mathrm{Iic}\, a$) is $u$-small. That is, there exists a type in $\mathrm{Type}\, u$ that is in bijection with the set $\{c \mid c \leq a\}$.
Cardinal.small_Iio instance
(a : Cardinal.{u}) : Small.{u} (Iio a)
Full source
instance small_Iio (a : CardinalCardinal.{u}) : Small.{u} (Iio a) := small_subset Iio_subset_Iic_self
Smallness of the Set of Cardinals Below a Strictly Given Cardinal
Informal description
For any cardinal number $a$ in universe $u$, the set of cardinals less than $a$ (denoted $(-\infty, a)$) is $u$-small. That is, there exists a type in $\mathrm{Type}\, u$ that is in bijection with the set $\{c \mid c < a\}$.
Cardinal.small_Icc instance
(a b : Cardinal.{u}) : Small.{u} (Icc a b)
Full source
instance small_Icc (a b : CardinalCardinal.{u}) : Small.{u} (Icc a b) := small_subset Icc_subset_Iic_self
Smallness of the Closed Interval of Cardinals
Informal description
For any two cardinal numbers $a$ and $b$ in universe $u$, the set of cardinals between $a$ and $b$ (inclusive) is $u$-small. That is, the closed interval $[a, b]$ in the order of cardinals is small.
Cardinal.small_Ico instance
(a b : Cardinal.{u}) : Small.{u} (Ico a b)
Full source
instance small_Ico (a b : CardinalCardinal.{u}) : Small.{u} (Ico a b) := small_subset Ico_subset_Iio_self
Smallness of the Left-Closed Right-Open Interval of Cardinals
Informal description
For any two cardinal numbers $a$ and $b$ in universe $u$, the left-closed right-open interval $[a, b)$ of cardinals is $u$-small. That is, there exists a type in $\mathrm{Type}\, u$ that is in bijection with the set $\{c \mid a \leq c < b\}$.
Cardinal.small_Ioc instance
(a b : Cardinal.{u}) : Small.{u} (Ioc a b)
Full source
instance small_Ioc (a b : CardinalCardinal.{u}) : Small.{u} (Ioc a b) := small_subset Ioc_subset_Iic_self
Smallness of the Left-Open Right-Closed Interval of Cardinals
Informal description
For any two cardinal numbers $a$ and $b$ in universe $u$, the left-open right-closed interval $(a, b]$ of cardinals is $u$-small. That is, there exists a type in $\mathrm{Type}\, u$ that is in bijection with the set $\{c \mid a < c \leq b\}$.
Cardinal.small_Ioo instance
(a b : Cardinal.{u}) : Small.{u} (Ioo a b)
Full source
instance small_Ioo (a b : CardinalCardinal.{u}) : Small.{u} (Ioo a b) := small_subset Ioo_subset_Iio_self
Smallness of the Open Interval of Cardinals
Informal description
For any two cardinal numbers $a$ and $b$ in universe $u$, the open interval $(a, b)$ of cardinals is $u$-small. That is, there exists a type in $\mathrm{Type}\, u$ that is in bijection with the set $\{c \mid a < c < b\}$.
Cardinal.bddAbove_iff_small theorem
{s : Set Cardinal.{u}} : BddAbove s ↔ Small.{u} s
Full source
/-- A set of cardinals is bounded above iff it's small, i.e. it corresponds to a usual ZFC set. -/
theorem bddAbove_iff_small {s : Set CardinalCardinal.{u}} : BddAboveBddAbove s ↔ Small.{u} s :=
  ⟨fun ⟨a, ha⟩ => @small_subset _ (Iic a) s (fun _ h => ha h) _, by
    rintro ⟨ι, ⟨e⟩⟩
    use sum.{u, u} fun x ↦ e.symm x
    intro a ha
    simpa using le_sum (fun x ↦ e.symm x) (e ⟨a, ha⟩)⟩
Boundedness of a Set of Cardinals is Equivalent to Smallness
Informal description
For any set $s$ of cardinal numbers in a universe level $u$, the set $s$ is bounded above if and only if it is small (i.e., there exists a bijection between $s$ and a type in the universe level $u$).
Cardinal.bddAbove_of_small theorem
(s : Set Cardinal.{u}) [h : Small.{u} s] : BddAbove s
Full source
theorem bddAbove_of_small (s : Set CardinalCardinal.{u}) [h : Small.{u} s] : BddAbove s :=
  bddAbove_iff_small.2 h
Small Sets of Cardinals are Bounded Above
Informal description
For any set $s$ of cardinal numbers in a universe level $u$, if $s$ is small (i.e., there exists a bijection between $s$ and a type in the universe level $u$), then $s$ is bounded above.
Cardinal.bddAbove_range theorem
{ι : Type*} [Small.{u} ι] (f : ι → Cardinal.{u}) : BddAbove (Set.range f)
Full source
theorem bddAbove_range {ι : Type*} [Small.{u} ι] (f : ι → CardinalCardinal.{u}) : BddAbove (Set.range f) :=
  bddAbove_of_small _
Range of a Small-Type-Valued Function into Cardinals is Bounded Above
Informal description
For any type $\iota$ that is small (i.e., equivalent to a type in universe level $u$) and any function $f : \iota \to \kappa$ where $\kappa$ is a cardinal number in universe level $u$, the range of $f$ is bounded above in the order of cardinals.
Cardinal.bddAbove_image theorem
(f : Cardinal.{u} → Cardinal.{max u v}) {s : Set Cardinal.{u}} (hs : BddAbove s) : BddAbove (f '' s)
Full source
theorem bddAbove_image (f : CardinalCardinal.{u}CardinalCardinal.{max u v}) {s : Set CardinalCardinal.{u}}
    (hs : BddAbove s) : BddAbove (f '' s) := by
  rw [bddAbove_iff_small] at hs ⊢
  exact small_lift _
Boundedness of Images of Bounded Sets of Cardinals
Informal description
For any function $f$ from cardinal numbers in universe level $u$ to cardinal numbers in universe level $\max(u,v)$, and any set $s$ of cardinals in universe level $u$ that is bounded above, the image $f(s)$ is also bounded above.
Cardinal.bddAbove_range_comp theorem
{ι : Type u} {f : ι → Cardinal.{v}} (hf : BddAbove (range f)) (g : Cardinal.{v} → Cardinal.{max v w}) : BddAbove (range (g ∘ f))
Full source
theorem bddAbove_range_comp {ι : Type u} {f : ι → CardinalCardinal.{v}} (hf : BddAbove (range f))
    (g : CardinalCardinal.{v}CardinalCardinal.{max v w}) : BddAbove (range (g ∘ f)) := by
  rw [range_comp]
  exact bddAbove_image g hf
Boundedness of Range under Composition of Cardinal Functions
Informal description
Let $\iota$ be a type in universe level $u$, and let $f : \iota \to \kappa$ be a function from $\iota$ to cardinal numbers in universe level $v$. If the range of $f$ is bounded above, then for any function $g : \kappa \to \lambda$ from cardinals in universe level $v$ to cardinals in universe level $\max(v,w)$, the range of the composition $g \circ f$ is also bounded above.
not_small_cardinal theorem
: ¬Small.{u} Cardinal.{max u v}
Full source
/-- The type of cardinals in universe `u` is not `Small.{u}`. This is a version of the Burali-Forti
paradox. -/
theorem _root_.not_small_cardinal : ¬ Small.{u} Cardinal.{max u v} := by
  intro h
  have := small_lift.{_, v} CardinalCardinal.{max u v}
  rw [← small_univ_iff, ← bddAbove_iff_small] at this
  exact not_bddAbove_univ this
Burali-Forti Paradox for Cardinals: The Type of Cardinals is Not Small
Informal description
The type of cardinal numbers in a universe level `max u v` is not small in universe level `u$. This is a version of the Burali-Forti paradox, showing that the collection of all cardinals cannot be a set in any universe level.
Cardinal.sum_le_iSup_lift theorem
{ι : Type u} (f : ι → Cardinal.{max u v}) : sum f ≤ Cardinal.lift #ι * iSup f
Full source
theorem sum_le_iSup_lift {ι : Type u}
    (f : ι → CardinalCardinal.{max u v}) : sum f ≤ Cardinal.lift  * iSup f := by
  rw [← (iSup f).lift_id, ← lift_umax, lift_umaxlift_umax.{max u v, u}, ← sum_const]
  exact sum_le_sum _ _ (le_ciSup <| bddAbove_of_small _)
Sum of Cardinals Bounded by Product of Lifted Cardinality and Supremum
Informal description
For any type $\iota$ in universe $u$ and any family of cardinal numbers $f : \iota \to \text{Cardinal}_{\max(u,v)}$, the sum of the cardinals $f(i)$ over all $i \in \iota$ is less than or equal to the product of the lifted cardinality of $\iota$ (to universe $\max(u,v)$) and the supremum of the family $f$. In symbols: $$\sum_{i \in \iota} f(i) \leq \text{lift}_{\max(u,v)}(\#\iota) \cdot \sup_{i \in \iota} f(i)$$
Cardinal.sum_le_iSup theorem
{ι : Type u} (f : ι → Cardinal.{u}) : sum f ≤ #ι * iSup f
Full source
theorem sum_le_iSup {ι : Type u} (f : ι → CardinalCardinal.{u}) : sum f ≤  * iSup f := by
  rw [← lift_id ]
  exact sum_le_iSup_lift f
Sum of Cardinals Bounded by Product of Cardinality and Supremum
Informal description
For any type $\iota$ in universe $u$ and any family of cardinal numbers $f : \iota \to \text{Cardinal}_{u}$, the sum of the cardinals $f(i)$ over all $i \in \iota$ is less than or equal to the product of the cardinality of $\iota$ and the supremum of the family $f$. In symbols: $$\sum_{i \in \iota} f(i) \leq \#\iota \cdot \sup_{i \in \iota} f(i)$$
Cardinal.lift_sSup theorem
{s : Set Cardinal} (hs : BddAbove s) : lift.{u} (sSup s) = sSup (lift.{u} '' s)
Full source
/-- The lift of a supremum is the supremum of the lifts. -/
theorem lift_sSup {s : Set Cardinal} (hs : BddAbove s) :
    lift.{u} (sSup s) = sSup (liftlift.{u}lift.{u} '' s) := by
  apply ((le_csSup_iff' (bddAbove_image.{_,u} _ hs)).2 fun c hc => _).antisymm (csSup_le' _)
  · intro c hc
    by_contra h
    obtain ⟨d, rfl⟩ := Cardinal.mem_range_lift_of_le (not_le.1 h).le
    simp_rw [lift_le] at h hc
    rw [csSup_le_iff' hs] at h
    exact h fun a ha => lift_le.1 <| hc (mem_image_of_mem _ ha)
  · rintro i ⟨j, hj, rfl⟩
    exact lift_le.2 (le_csSup hs hj)
Lift of Supremum Equals Supremum of Lifts for Bounded Sets of Cardinals
Informal description
Let $s$ be a set of cardinal numbers (in some universe) that is bounded above. Then the lift of the supremum of $s$ is equal to the supremum of the lifts of the elements of $s$. In symbols: \[ \text{lift}(\sup s) = \sup \{\text{lift}(c) \mid c \in s\} \]
Cardinal.lift_iSup theorem
{ι : Type v} {f : ι → Cardinal.{w}} (hf : BddAbove (range f)) : lift.{u} (iSup f) = ⨆ i, lift.{u} (f i)
Full source
/-- The lift of a supremum is the supremum of the lifts. -/
theorem lift_iSup {ι : Type v} {f : ι → CardinalCardinal.{w}} (hf : BddAbove (range f)) :
    lift.{u} (iSup f) = ⨆ i, lift.{u} (f i) := by
  rw [iSup, iSup, lift_sSup hf, ← range_comp]
  simp [Function.comp_def]
Lift of Supremum Equals Supremum of Lifts for Bounded Families of Cardinals
Informal description
Let $\iota$ be a type and $f : \iota \to \text{Cardinal}$ be a function such that the range of $f$ is bounded above. Then the lift of the supremum of $f$ is equal to the supremum of the lifts of the values of $f$. In symbols: \[ \text{lift}\left(\bigsqcup_{i \in \iota} f(i)\right) = \bigsqcup_{i \in \iota} \text{lift}(f(i)) \]
Cardinal.lift_iSup_le theorem
{ι : Type v} {f : ι → Cardinal.{w}} {t : Cardinal} (hf : BddAbove (range f)) (w : ∀ i, lift.{u} (f i) ≤ t) : lift.{u} (iSup f) ≤ t
Full source
/-- To prove that the lift of a supremum is bounded by some cardinal `t`,
it suffices to show that the lift of each cardinal is bounded by `t`. -/
theorem lift_iSup_le {ι : Type v} {f : ι → CardinalCardinal.{w}} {t : Cardinal} (hf : BddAbove (range f))
    (w : ∀ i, lift.{u} (f i) ≤ t) : lift.{u} (iSup f) ≤ t := by
  rw [lift_iSup hf]
  exact ciSup_le' w
Boundedness of Lifted Supremum of Cardinals
Informal description
Let $\iota$ be a type and $f : \iota \to \text{Cardinal}$ be a function such that the range of $f$ is bounded above. If for every $i \in \iota$, the lift of $f(i)$ is bounded above by some cardinal $t$, then the lift of the supremum of $f$ is also bounded above by $t$. In symbols: \[ \text{lift}\left(\bigsqcup_{i \in \iota} f(i)\right) \leq t \]
Cardinal.lift_iSup_le_iff theorem
{ι : Type v} {f : ι → Cardinal.{w}} (hf : BddAbove (range f)) {t : Cardinal} : lift.{u} (iSup f) ≤ t ↔ ∀ i, lift.{u} (f i) ≤ t
Full source
@[simp]
theorem lift_iSup_le_iff {ι : Type v} {f : ι → CardinalCardinal.{w}} (hf : BddAbove (range f))
    {t : Cardinal} : liftlift.{u} (iSup f) ≤ t ↔ ∀ i, lift.{u} (f i) ≤ t := by
  rw [lift_iSup hf]
  exact ciSup_le_iff' (bddAbove_range_comp.{_,_,u} hf _)
Characterization of Lifted Supremum Bound for Bounded Families of Cardinals
Informal description
Let $\iota$ be a type and $f : \iota \to \text{Cardinal}$ be a function such that the range of $f$ is bounded above. For any cardinal $t$, the lift of the supremum of $f$ is less than or equal to $t$ if and only if for every $i \in \iota$, the lift of $f(i)$ is less than or equal to $t$. In symbols: \[ \text{lift}\left(\bigsqcup_{i \in \iota} f(i)\right) \leq t \leftrightarrow \forall i \in \iota, \text{lift}(f(i)) \leq t. \]
Cardinal.lift_iSup_le_lift_iSup theorem
{ι : Type v} {ι' : Type v'} {f : ι → Cardinal.{w}} {f' : ι' → Cardinal.{w'}} (hf : BddAbove (range f)) (hf' : BddAbove (range f')) {g : ι → ι'} (h : ∀ i, lift.{w'} (f i) ≤ lift.{w} (f' (g i))) : lift.{w'} (iSup f) ≤ lift.{w} (iSup f')
Full source
/-- To prove an inequality between the lifts to a common universe of two different supremums,
it suffices to show that the lift of each cardinal from the smaller supremum
if bounded by the lift of some cardinal from the larger supremum.
-/
theorem lift_iSup_le_lift_iSup {ι : Type v} {ι' : Type v'} {f : ι → CardinalCardinal.{w}}
    {f' : ι' → CardinalCardinal.{w'}} (hf : BddAbove (range f)) (hf' : BddAbove (range f')) {g : ι → ι'}
    (h : ∀ i, lift.{w'} (f i) ≤ lift.{w} (f' (g i))) : lift.{w'} (iSup f) ≤ lift.{w} (iSup f') := by
  rw [lift_iSup hf, lift_iSup hf']
  exact ciSup_mono' (bddAbove_range_comp.{_,_,w} hf' _) fun i => ⟨_, h i⟩
Comparison of Lifted Suprema of Bounded Cardinal Families
Informal description
Let $\iota$ and $\iota'$ be types, and let $f : \iota \to \text{Cardinal}$ and $f' : \iota' \to \text{Cardinal}$ be functions such that the ranges of $f$ and $f'$ are bounded above. If there exists a function $g : \iota \to \iota'$ such that for every $i \in \iota$, the lift of $f(i)$ is less than or equal to the lift of $f'(g(i))$, then the lift of the supremum of $f$ is less than or equal to the lift of the supremum of $f'$. In symbols: \[ \text{lift}\left(\bigsqcup_{i \in \iota} f(i)\right) \leq \text{lift}\left(\bigsqcup_{i' \in \iota'} f'(i')\right). \]
Cardinal.lift_iSup_le_lift_iSup' theorem
{ι : Type v} {ι' : Type v'} {f : ι → Cardinal.{v}} {f' : ι' → Cardinal.{v'}} (hf : BddAbove (range f)) (hf' : BddAbove (range f')) (g : ι → ι') (h : ∀ i, lift.{v'} (f i) ≤ lift.{v} (f' (g i))) : lift.{v'} (iSup f) ≤ lift.{v} (iSup f')
Full source
/-- A variant of `lift_iSup_le_lift_iSup` with universes specialized via `w = v` and `w' = v'`.
This is sometimes necessary to avoid universe unification issues. -/
theorem lift_iSup_le_lift_iSup' {ι : Type v} {ι' : Type v'} {f : ι → CardinalCardinal.{v}}
    {f' : ι' → CardinalCardinal.{v'}} (hf : BddAbove (range f)) (hf' : BddAbove (range f')) (g : ι → ι')
    (h : ∀ i, lift.{v'} (f i) ≤ lift.{v} (f' (g i))) : lift.{v'} (iSup f) ≤ lift.{v} (iSup f') :=
  lift_iSup_le_lift_iSup hf hf' h
Comparison of Lifted Suprema of Bounded Cardinal Families (Specialized Universe Variant)
Informal description
Let $\iota$ and $\iota'$ be types, and let $f : \iota \to \text{Cardinal}$ and $f' : \iota' \to \text{Cardinal}$ be functions such that the ranges of $f$ and $f'$ are bounded above. If there exists a function $g : \iota \to \iota'$ such that for every $i \in \iota$, the lift of $f(i)$ is less than or equal to the lift of $f'(g(i))$, then the lift of the supremum of $f$ is less than or equal to the lift of the supremum of $f'$. In symbols: \[ \text{lift}\left(\bigsqcup_{i \in \iota} f(i)\right) \leq \text{lift}\left(\bigsqcup_{i' \in \iota'} f'(i')\right). \]
Cardinal.mk_finset_of_fintype theorem
[Fintype α] : #(Finset α) = 2 ^ Fintype.card α
Full source
theorem mk_finset_of_fintype [Fintype α] : #(Finset α) = 2 ^ Fintype.card α := by
  simp [Pow.pow]
Cardinality of Finite Subsets: $\#(\text{Finset } \alpha) = 2^{\#\alpha}$
Informal description
For any finite type $\alpha$, the cardinality of the set of all finite subsets of $\alpha$ is equal to $2$ raised to the power of the cardinality of $\alpha$, i.e., $\#(\text{Finset } \alpha) = 2^{\#\alpha}$.
Cardinal.nat_succ theorem
(n : ℕ) : (n.succ : Cardinal) = succ ↑n
Full source
@[norm_cast]
theorem nat_succ (n : ) : (n.succ : Cardinal) = succ ↑n := by
  rw [Nat.cast_succ]
  refine (add_one_le_succ _).antisymm (succ_le_of_lt ?_)
  rw [← Nat.cast_succ]
  exact Nat.cast_lt.2 (Nat.lt_succ_self _)
Successor of Natural Number as Cardinal: $(n+1 : \text{Cardinal}) = \text{succ}(n)$
Informal description
For any natural number $n$, the cardinal number corresponding to its successor $n+1$ is equal to the successor of the cardinal number corresponding to $n$. That is, $(n+1 : \text{Cardinal}) = \text{succ}(n : \text{Cardinal})$.
Cardinal.succ_natCast theorem
(n : ℕ) : Order.succ (n : Cardinal) = n + 1
Full source
lemma succ_natCast (n : ) : Order.succ (n : Cardinal) = n + 1 := by
  rw [← Cardinal.nat_succ]
  norm_cast
Successor of Natural Number Cardinal Equals $n + 1$
Informal description
For any natural number $n$, the successor of the cardinal number corresponding to $n$ is equal to the cardinal number corresponding to $n + 1$, i.e., $\text{succ}(n) = n + 1$ in the type of cardinal numbers.
Cardinal.two_le_iff_one_lt theorem
{c : Cardinal} : 2 ≤ c ↔ 1 < c
Full source
lemma two_le_iff_one_lt {c : Cardinal} : 2 ≤ c ↔ 1 < c := by
  convert natCast_add_one_le_iff
  norm_cast
Inequality between Two and One in Cardinal Numbers: $2 \leq c \leftrightarrow 1 < c$
Informal description
For any cardinal number $c$, the inequality $2 \leq c$ holds if and only if $1 < c$.
Cardinal.succ_zero theorem
: succ (0 : Cardinal) = 1
Full source
@[simp]
theorem succ_zero : succ (0 : Cardinal) = 1 := by norm_cast
Successor of Zero Cardinal is One
Informal description
The successor of the zero cardinal is equal to the one cardinal, i.e., $\text{succ}(0) = 1$.
Cardinal.one_lt_two theorem
: (1 : Cardinal) < 2
Full source
theorem one_lt_two : (1 : Cardinal) < 2 := by norm_cast
$1 < 2$ in Cardinal Numbers
Informal description
The cardinal number $1$ is strictly less than the cardinal number $2$.
Cardinal.exists_finset_le_card theorem
(α : Type*) (n : ℕ) (h : n ≤ #α) : ∃ s : Finset α, n ≤ s.card
Full source
theorem exists_finset_le_card (α : Type*) (n : ) (h : n ≤ ) :
    ∃ s : Finset α, n ≤ s.card := by
  obtain hα|hα := finite_or_infinite α
  · let hα := Fintype.ofFinite α
    use Finset.univ
    simpa only [mk_fintype, Nat.cast_le] using h
  · obtain ⟨s, hs⟩ := Infinite.exists_subset_card_eq α n
    exact ⟨s, hs.ge⟩
Existence of Finite Subset with Given Lower Bound on Cardinality
Informal description
For any type $\alpha$ and natural number $n$ such that $n \leq \#\alpha$ (the cardinality of $\alpha$), there exists a finite subset $s$ of $\alpha$ whose cardinality is at least $n$.
Cardinal.card_le_of theorem
{α : Type u} {n : ℕ} (H : ∀ s : Finset α, s.card ≤ n) : #α ≤ n
Full source
theorem card_le_of {α : Type u} {n : } (H : ∀ s : Finset α, s.card ≤ n) :  ≤ n := by
  contrapose! H
  apply exists_finset_le_card α (n+1)
  simpa only [nat_succ, succ_le_iff] using H
Cardinality Bound via Finite Subsets: $\#\alpha \leq n$
Informal description
For any type $\alpha$ and natural number $n$, if every finite subset $s$ of $\alpha$ has cardinality at most $n$, then the cardinality of $\alpha$ is at most $n$.
Cardinal.cantor' theorem
(a) {b : Cardinal} (hb : 1 < b) : a < b ^ a
Full source
theorem cantor' (a) {b : Cardinal} (hb : 1 < b) : a < b ^ a := by
  rw [← succ_le_iff, (by norm_cast : succ (1 : Cardinal) = 2)] at hb
  exact (cantor a).trans_le (power_le_power_right hb)
Cantor's Theorem for Cardinal Exponentiation: $a < b^a$ when $1 < b$
Informal description
For any cardinal number $a$ and any cardinal number $b$ with $1 < b$, we have $a < b^a$.
Cardinal.one_le_iff_pos theorem
{c : Cardinal} : 1 ≤ c ↔ 0 < c
Full source
theorem one_le_iff_pos {c : Cardinal} : 1 ≤ c ↔ 0 < c := by
  rw [← succ_zero, succ_le_iff]
Characterization of Nonzero Cardinals: $1 \leq c \leftrightarrow 0 < c$
Informal description
For any cardinal number $c$, the inequality $1 \leq c$ holds if and only if $0 < c$.
Cardinal.lt_one_iff_zero theorem
{c : Cardinal} : c < 1 ↔ c = 0
Full source
@[simp]
theorem lt_one_iff_zero {c : Cardinal} : c < 1 ↔ c = 0 := by
  simpa using lt_succ_bot_iff (a := c)
Characterization of Zero Cardinal: $c < 1 \leftrightarrow c = 0$
Informal description
For any cardinal number $c$, the inequality $c < 1$ holds if and only if $c = 0$.
Cardinal.one_lt_aleph0 theorem
: 1 < ℵ₀
Full source
@[simp]
theorem one_lt_aleph0 : 1 < ℵ₀ := by simpa using nat_lt_aleph0 1
Inequality of Cardinals: $1 < \aleph_0$
Informal description
The cardinal number $1$ (representing the cardinality of a singleton set) is strictly less than $\aleph_0$ (the cardinality of the set of natural numbers).
Cardinal.one_le_aleph0 theorem
: 1 ≤ ℵ₀
Full source
@[simp]
theorem one_le_aleph0 : 1 ≤ ℵ₀ :=
  one_lt_aleph0.le
Inequality of Cardinals: $1 \leq \aleph_0$
Informal description
The cardinal number $1$ (representing the cardinality of a singleton set) is less than or equal to $\aleph_0$ (the cardinality of the set of natural numbers).
Cardinal.lt_aleph0 theorem
{c : Cardinal} : c < ℵ₀ ↔ ∃ n : ℕ, c = n
Full source
theorem lt_aleph0 {c : Cardinal} : c < ℵ₀ ↔ ∃ n : ℕ, c = n :=
  ⟨fun h => by
    rcases lt_lift_iff.1 h with ⟨c, h', rfl⟩
    rcases le_mk_iff_exists_set.1 h'.1 with ⟨S, rfl⟩
    suffices S.Finite by
      lift S to Finset ℕ using this
      simp
    contrapose! h'
    haveI := Infinite.to_subtype h'
    exact ⟨Infinite.natEmbedding S⟩, fun ⟨_, e⟩ => e.symm ▸ nat_lt_aleph0 _⟩
Characterization of cardinals below $\aleph_0$ as natural numbers
Informal description
A cardinal number $c$ is strictly less than $\aleph_0$ if and only if there exists a natural number $n$ such that $c = n$.
Cardinal.succ_eq_of_lt_aleph0 theorem
{c : Cardinal} (h : c < ℵ₀) : Order.succ c = c + 1
Full source
lemma succ_eq_of_lt_aleph0 {c : Cardinal} (h : c < ℵ₀) : Order.succ c = c + 1 := by
  obtain ⟨n, hn⟩ := Cardinal.lt_aleph0.mp h
  rw [hn, succ_natCast]
Successor of Finite Cardinal Equals Its Successor in Natural Numbers
Informal description
For any cardinal number $c$ such that $c < \aleph_0$, the successor of $c$ is equal to $c + 1$.
Cardinal.aleph0_le theorem
{c : Cardinal} : ℵ₀ ≤ c ↔ ∀ n : ℕ, ↑n ≤ c
Full source
theorem aleph0_le {c : Cardinal} : ℵ₀ℵ₀ ≤ c ↔ ∀ n : ℕ, ↑n ≤ c :=
  ⟨fun h _ => (nat_lt_aleph0 _).le.trans h, fun h =>
    le_of_not_lt fun hn => by
      rcases lt_aleph0.1 hn with ⟨n, rfl⟩
      exact (Nat.lt_succ_self _).not_le (Nat.cast_le.1 (h (n + 1)))⟩
$\aleph_0 \leq c$ iff all natural numbers embed into $c$
Informal description
For any cardinal number $c$, the inequality $\aleph_0 \leq c$ holds if and only if for every natural number $n$, the cardinality of $n$ is less than or equal to $c$.
Cardinal.isSuccPrelimit_aleph0 theorem
: IsSuccPrelimit ℵ₀
Full source
theorem isSuccPrelimit_aleph0 : IsSuccPrelimit ℵ₀ :=
  isSuccPrelimit_of_succ_lt fun a ha => by
    rcases lt_aleph0.1 ha with ⟨n, rfl⟩
    rw [← nat_succ]
    apply nat_lt_aleph0
$\aleph_0$ is a successor pre-limit cardinal
Informal description
The cardinal $\aleph_0$ is a successor pre-limit element in the order of cardinal numbers. That is, there does not exist any cardinal $c$ such that $c$ is covered by $\aleph_0$ (i.e., there is no $c$ with $c \lessdot \aleph_0$).
Cardinal.isSuccLimit_aleph0 theorem
: IsSuccLimit ℵ₀
Full source
theorem isSuccLimit_aleph0 : IsSuccLimit ℵ₀ := by
  rw [Cardinal.isSuccLimit_iff]
  exact ⟨aleph0_ne_zero, isSuccPrelimit_aleph0⟩
$\aleph_0$ is a successor limit cardinal
Informal description
The cardinal number $\aleph_0$ is a successor limit in the order of cardinal numbers, meaning it is not minimal and does not cover any other cardinal (i.e., there is no cardinal $c$ such that $c$ is an immediate predecessor of $\aleph_0$).
Cardinal.not_isSuccLimit_natCast theorem
: (n : ℕ) → ¬IsSuccLimit (n : Cardinal.{u})
Full source
lemma not_isSuccLimit_natCast : (n : ) → ¬ IsSuccLimit (n : Cardinal.{u})
  | 0, e => e.1 isMin_bot
  | Nat.succ n, e => Order.not_isSuccPrelimit_succ _ (nat_succ n ▸ e.2)
Natural Number Cardinals are Not Successor Limits
Informal description
For any natural number $n$, the cardinal number $n$ is not a successor limit. That is, $n$ is either minimal or has an immediate predecessor in the order of cardinal numbers.
Cardinal.exists_eq_natCast_of_iSup_eq theorem
{ι : Type u} [Nonempty ι] (f : ι → Cardinal.{v}) (hf : BddAbove (range f)) (n : ℕ) (h : ⨆ i, f i = n) : ∃ i, f i = n
Full source
lemma exists_eq_natCast_of_iSup_eq {ι : Type u} [Nonempty ι] (f : ι → CardinalCardinal.{v})
    (hf : BddAbove (range f)) (n : ) (h : ⨆ i, f i = n) : ∃ i, f i = n :=
  exists_eq_of_iSup_eq_of_not_isSuccLimit.{u, v} f hf (not_isSuccLimit_natCast n) h
Supremum of Bounded Cardinal Sequence Equals Natural Number Implies Attainment
Informal description
Let $\iota$ be a nonempty type and $f : \iota \to \text{Cardinal}$ be a function whose range is bounded above. If the supremum of $f$ equals a natural number $n$ (viewed as a cardinal), then there exists an index $i \in \iota$ such that $f(i) = n$.
Cardinal.range_natCast theorem
: range ((↑) : ℕ → Cardinal) = Iio ℵ₀
Full source
@[simp]
theorem range_natCast : range ((↑) : Cardinal) = Iio ℵ₀ :=
  ext fun x => by simp only [mem_Iio, mem_range, eq_comm, lt_aleph0]
Range of Natural Number Cardinals Equals Cardinals Below Aleph-Null
Informal description
The range of the canonical embedding from the natural numbers to cardinal numbers is equal to the set of all cardinals strictly less than $\aleph_0$. In other words, $\{n \mid n \in \mathbb{N}\} = \{c \mid c < \aleph_0\}$ where $n$ is interpreted as a cardinal number.
Cardinal.mk_eq_nat_iff theorem
{α : Type u} {n : ℕ} : #α = n ↔ Nonempty (α ≃ Fin n)
Full source
theorem mk_eq_nat_iff {α : Type u} {n : } : #α = n ↔ Nonempty (α ≃ Fin n) := by
  rw [← lift_mk_fin, ← lift_uzero #α, lift_mk_eq']
Cardinality Equals Natural Number iff Bijection with Finite Type
Informal description
For any type $\alpha$ and natural number $n$, the cardinality of $\alpha$ equals $n$ if and only if there exists a bijection between $\alpha$ and the finite type $\text{Fin}(n)$ (the type with $n$ elements).
Cardinal.lt_aleph0_iff_fintype theorem
{α : Type u} : #α < ℵ₀ ↔ Nonempty (Fintype α)
Full source
theorem lt_aleph0_iff_fintype {α : Type u} : #α < ℵ₀ ↔ Nonempty (Fintype α) :=
  lt_aleph0_iff_finite.trans (finite_iff_nonempty_fintype _)
Finite Enumeration Characterization via Cardinality Below Aleph-null
Informal description
For any type $\alpha$, the cardinality $\#\alpha$ is strictly less than $\aleph_0$ if and only if there exists a finite enumeration of the elements of $\alpha$ (i.e., $\alpha$ has a `Fintype` instance).
Cardinal.lt_aleph0_of_finite theorem
(α : Type u) [Finite α] : #α < ℵ₀
Full source
theorem lt_aleph0_of_finite (α : Type u) [Finite α] :  < ℵ₀ :=
  lt_aleph0_iff_finite.2 ‹_›
Finite Types Have Cardinality Below Aleph-null
Informal description
For any finite type $\alpha$, the cardinality of $\alpha$ is strictly less than $\aleph_0$, i.e., $\#\alpha < \aleph_0$.
Cardinal.lt_aleph0_iff_subtype_finite theorem
{p : α → Prop} : #{ x // p x } < ℵ₀ ↔ {x | p x}.Finite
Full source
@[simp]
theorem lt_aleph0_iff_subtype_finite {p : α → Prop} : #{ x // p x }#{ x // p x } < ℵ₀ ↔ { x | p x }.Finite :=
  lt_aleph0_iff_set_finite
Subtype Cardinality Below Aleph-null iff Finite Set
Informal description
For any predicate $p : \alpha \to \text{Prop}$, the cardinality of the subtype $\{x \mid p x\}$ is strictly less than $\aleph_0$ if and only if the set $\{x \mid p x\}$ is finite.
Cardinal.mk_le_aleph0 theorem
[Countable α] : #α ≤ ℵ₀
Full source
@[simp]
theorem mk_le_aleph0 [Countable α] : ℵ₀ :=
  mk_le_aleph0_iff.mpr ‹_›
Countable Types Have Cardinality Bounded by Aleph-null
Informal description
For any countable type $\alpha$, the cardinality of $\alpha$ is less than or equal to $\aleph_0$, i.e., $\#\alpha \leq \aleph_0$.
Cardinal.le_aleph0_iff_set_countable theorem
{s : Set α} : #s ≤ ℵ₀ ↔ s.Countable
Full source
theorem le_aleph0_iff_set_countable {s : Set α} : #s#s ≤ ℵ₀ ↔ s.Countable := mk_le_aleph0_iff
Cardinality Bound $\leq\aleph_0$ iff Countable Set
Informal description
For any set $s$ of elements of type $\alpha$, the cardinality of $s$ is less than or equal to $\aleph_0$ if and only if $s$ is countable.
Cardinal.le_aleph0_iff_subtype_countable theorem
{p : α → Prop} : #{ x // p x } ≤ ℵ₀ ↔ {x | p x}.Countable
Full source
@[simp]
theorem le_aleph0_iff_subtype_countable {p : α → Prop} :
    #{ x // p x }#{ x // p x } ≤ ℵ₀ ↔ { x | p x }.Countable :=
  le_aleph0_iff_set_countable
Subtype Cardinality Bound $\leq\aleph_0$ iff Predicate's Set is Countable
Informal description
For any predicate $p : \alpha \to \text{Prop}$, the cardinality of the subtype $\{x \mid p x\}$ is less than or equal to $\aleph_0$ if and only if the set $\{x \mid p x\}$ is countable.
Cardinal.aleph0_lt_mk theorem
[Uncountable α] : ℵ₀ < #α
Full source
@[simp]
theorem aleph0_lt_mk [Uncountable α] : ℵ₀ <  :=
  aleph0_lt_mk_iff.mpr ‹_›
$\aleph_0$ is less than the cardinality of any uncountable type
Informal description
For any uncountable type $\alpha$, the cardinality $\#\alpha$ is strictly greater than $\aleph_0$.
Cardinal.add_lt_aleph0 theorem
{a b : Cardinal} (ha : a < ℵ₀) (hb : b < ℵ₀) : a + b < ℵ₀
Full source
theorem add_lt_aleph0 {a b : Cardinal} (ha : a < ℵ₀) (hb : b < ℵ₀) : a + b < ℵ₀ :=
  match a, b, lt_aleph0.1 ha, lt_aleph0.1 hb with
  | _, _, ⟨m, rfl⟩, ⟨n, rfl⟩ => by rw [← Nat.cast_add]; apply nat_lt_aleph0
Sum of Finite Cardinals is Finite ($a + b < \aleph_0$ when $a, b < \aleph_0$)
Informal description
For any two cardinal numbers $a$ and $b$ such that $a < \aleph_0$ and $b < \aleph_0$, their sum satisfies $a + b < \aleph_0$.
Cardinal.add_lt_aleph0_iff theorem
{a b : Cardinal} : a + b < ℵ₀ ↔ a < ℵ₀ ∧ b < ℵ₀
Full source
theorem add_lt_aleph0_iff {a b : Cardinal} : a + b < ℵ₀ ↔ a < ℵ₀ ∧ b < ℵ₀ :=
  ⟨fun h => ⟨(self_le_add_right _ _).trans_lt h, (self_le_add_left _ _).trans_lt h⟩,
   fun ⟨h1, h2⟩ => add_lt_aleph0 h1 h2⟩
Sum of Cardinals is Finite iff Both Cardinals are Finite ($a + b < \aleph_0 \leftrightarrow a < \aleph_0 \land b < \aleph_0$)
Informal description
For any two cardinal numbers $a$ and $b$, the sum $a + b$ is strictly less than $\aleph_0$ if and only if both $a$ and $b$ are strictly less than $\aleph_0$.
Cardinal.aleph0_le_add_iff theorem
{a b : Cardinal} : ℵ₀ ≤ a + b ↔ ℵ₀ ≤ a ∨ ℵ₀ ≤ b
Full source
theorem aleph0_le_add_iff {a b : Cardinal} : ℵ₀ℵ₀ ≤ a + b ↔ ℵ₀ ≤ a ∨ ℵ₀ ≤ b := by
  simp only [← not_lt, add_lt_aleph0_iff, not_and_or]
$\aleph_0 \leq a + b$ iff $\aleph_0 \leq a$ or $\aleph_0 \leq b$
Informal description
For any two cardinal numbers $a$ and $b$, the sum $a + b$ is at least $\aleph_0$ if and only if at least one of $a$ or $b$ is at least $\aleph_0$.
Cardinal.nsmul_lt_aleph0_iff theorem
{n : ℕ} {a : Cardinal} : n • a < ℵ₀ ↔ n = 0 ∨ a < ℵ₀
Full source
/-- See also `Cardinal.nsmul_lt_aleph0_iff_of_ne_zero` if you already have `n ≠ 0`. -/
theorem nsmul_lt_aleph0_iff {n : } {a : Cardinal} : n • a < ℵ₀ ↔ n = 0 ∨ a < ℵ₀ := by
  cases n with
  | zero => simpa using nat_lt_aleph0 0
  | succ n =>
      simp only [Nat.succ_ne_zero, false_or]
      induction' n with n ih
      · simp
      rw [succ_nsmul, add_lt_aleph0_iff, ih, and_self_iff]
Finite scalar multiple condition: $n \cdot a < \aleph_0 \leftrightarrow n = 0 \lor a < \aleph_0$
Informal description
For any natural number $n$ and any cardinal number $a$, the scalar multiple $n \cdot a$ is strictly less than $\aleph_0$ if and only if either $n = 0$ or $a < \aleph_0$.
Cardinal.nsmul_lt_aleph0_iff_of_ne_zero theorem
{n : ℕ} {a : Cardinal} (h : n ≠ 0) : n • a < ℵ₀ ↔ a < ℵ₀
Full source
/-- See also `Cardinal.nsmul_lt_aleph0_iff` for a hypothesis-free version. -/
theorem nsmul_lt_aleph0_iff_of_ne_zero {n : } {a : Cardinal} (h : n ≠ 0) : n • a < ℵ₀ ↔ a < ℵ₀ :=
  nsmul_lt_aleph0_iff.trans <| or_iff_right h
Finite scalar multiple condition for nonzero $n$: $n \cdot a < \aleph_0 \leftrightarrow a < \aleph_0$
Informal description
For any natural number $n \neq 0$ and any cardinal number $a$, the scalar multiple $n \cdot a$ is strictly less than $\aleph_0$ if and only if $a$ is strictly less than $\aleph_0$.
Cardinal.mul_lt_aleph0 theorem
{a b : Cardinal} (ha : a < ℵ₀) (hb : b < ℵ₀) : a * b < ℵ₀
Full source
theorem mul_lt_aleph0 {a b : Cardinal} (ha : a < ℵ₀) (hb : b < ℵ₀) : a * b < ℵ₀ :=
  match a, b, lt_aleph0.1 ha, lt_aleph0.1 hb with
  | _, _, ⟨m, rfl⟩, ⟨n, rfl⟩ => by rw [← Nat.cast_mul]; apply nat_lt_aleph0
Product of Finite Cardinals is Finite
Informal description
For any two cardinal numbers $a$ and $b$ such that $a < \aleph_0$ and $b < \aleph_0$, their product $a \times b$ is also strictly less than $\aleph_0$.
Cardinal.mul_lt_aleph0_iff theorem
{a b : Cardinal} : a * b < ℵ₀ ↔ a = 0 ∨ b = 0 ∨ a < ℵ₀ ∧ b < ℵ₀
Full source
theorem mul_lt_aleph0_iff {a b : Cardinal} : a * b < ℵ₀ ↔ a = 0 ∨ b = 0 ∨ a < ℵ₀ ∧ b < ℵ₀ := by
  refine ⟨fun h => ?_, ?_⟩
  · by_cases ha : a = 0
    · exact Or.inl ha
    right
    by_cases hb : b = 0
    · exact Or.inl hb
    right
    rw [← Ne, ← one_le_iff_ne_zero] at ha hb
    constructor
    · rw [← mul_one a]
      exact (mul_le_mul' le_rfl hb).trans_lt h
    · rw [← one_mul b]
      exact (mul_le_mul' ha le_rfl).trans_lt h
  rintro (rfl | rfl | ⟨ha, hb⟩) <;> simp only [*, mul_lt_aleph0, aleph0_pos, zero_mul, mul_zero]
Product of Cardinals is Less Than Aleph-Null if and only if Factors are Zero or Finite
Informal description
For any two cardinal numbers $a$ and $b$, the product $a \times b$ is strictly less than $\aleph_0$ if and only if either $a = 0$, or $b = 0$, or both $a < \aleph_0$ and $b < \aleph_0$.
Cardinal.aleph0_le_mul_iff theorem
{a b : Cardinal} : ℵ₀ ≤ a * b ↔ a ≠ 0 ∧ b ≠ 0 ∧ (ℵ₀ ≤ a ∨ ℵ₀ ≤ b)
Full source
/-- See also `Cardinal.aleph0_le_mul_iff`. -/
theorem aleph0_le_mul_iff {a b : Cardinal} : ℵ₀ℵ₀ ≤ a * b ↔ a ≠ 0 ∧ b ≠ 0 ∧ (ℵ₀ ≤ a ∨ ℵ₀ ≤ b) := by
  let h := (@mul_lt_aleph0_iff a b).not
  rwa [not_lt, not_or, not_or, not_and_or, not_lt, not_lt] at h
$\aleph_0 \leq a \cdot b$ iff $a$ and $b$ are nonzero and at least one is $\geq \aleph_0$
Informal description
For any two cardinal numbers $a$ and $b$, the product $a \cdot b$ is greater than or equal to $\aleph_0$ if and only if both $a$ and $b$ are nonzero and at least one of them is greater than or equal to $\aleph_0$. That is, \[ \aleph_0 \leq a \cdot b \leftrightarrow a \neq 0 \land b \neq 0 \land (\aleph_0 \leq a \lor \aleph_0 \leq b). \]
Cardinal.aleph0_le_mul_iff' theorem
{a b : Cardinal.{u}} : ℵ₀ ≤ a * b ↔ a ≠ 0 ∧ ℵ₀ ≤ b ∨ ℵ₀ ≤ a ∧ b ≠ 0
Full source
/-- See also `Cardinal.aleph0_le_mul_iff'`. -/
theorem aleph0_le_mul_iff' {a b : CardinalCardinal.{u}} : ℵ₀ℵ₀ ≤ a * b ↔ a ≠ 0 ∧ ℵ₀ ≤ b ∨ ℵ₀ ≤ a ∧ b ≠ 0 := by
  have : ∀ {a : CardinalCardinal.{u}}, ℵ₀ ≤ a → a ≠ 0 := fun a => ne_bot_of_le_ne_bot aleph0_ne_zero a
  simp only [aleph0_le_mul_iff, and_or_left, and_iff_right_of_imp this, @and_left_comm (a ≠ 0)]
  simp only [and_comm, or_comm]
$\aleph_0 \leq a \cdot b$ iff (nonzero $a$ and $\aleph_0 \leq b$) or ($\aleph_0 \leq a$ and nonzero $b$)
Informal description
For any two cardinal numbers $a$ and $b$, the inequality $\aleph_0 \leq a \cdot b$ holds if and only if either ($a \neq 0$ and $\aleph_0 \leq b$) or ($\aleph_0 \leq a$ and $b \neq 0$).
Cardinal.mul_lt_aleph0_iff_of_ne_zero theorem
{a b : Cardinal} (ha : a ≠ 0) (hb : b ≠ 0) : a * b < ℵ₀ ↔ a < ℵ₀ ∧ b < ℵ₀
Full source
theorem mul_lt_aleph0_iff_of_ne_zero {a b : Cardinal} (ha : a ≠ 0) (hb : b ≠ 0) :
    a * b < ℵ₀ ↔ a < ℵ₀ ∧ b < ℵ₀ := by simp [mul_lt_aleph0_iff, ha, hb]
Product of Nonzero Cardinals is Less Than $\aleph_0$ iff Both Factors Are
Informal description
For any nonzero cardinal numbers $a$ and $b$, the product $a \cdot b$ is strictly less than $\aleph_0$ if and only if both $a$ and $b$ are strictly less than $\aleph_0$.
Cardinal.power_lt_aleph0 theorem
{a b : Cardinal} (ha : a < ℵ₀) (hb : b < ℵ₀) : a ^ b < ℵ₀
Full source
theorem power_lt_aleph0 {a b : Cardinal} (ha : a < ℵ₀) (hb : b < ℵ₀) : a ^ b < ℵ₀ :=
  match a, b, lt_aleph0.1 ha, lt_aleph0.1 hb with
  | _, _, ⟨m, rfl⟩, ⟨n, rfl⟩ => by rw [power_natCast, ← Nat.cast_pow]; apply nat_lt_aleph0
Exponentiation of Finite Cardinals is Finite: $a^b < \aleph_0$ for $a, b < \aleph_0$
Informal description
For any cardinal numbers $a$ and $b$ such that $a < \aleph_0$ and $b < \aleph_0$, the cardinal exponentiation $a^b$ is also strictly less than $\aleph_0$.
Cardinal.aleph0_le_mk_iff theorem
: ℵ₀ ≤ #α ↔ Infinite α
Full source
lemma aleph0_le_mk_iff : ℵ₀ℵ₀ ≤ #α ↔ Infinite α := infinite_iff.symm
Aleph-null Bound Characterization: $\aleph_0 \leq \#\alpha \leftrightarrow \text{Infinite}(\alpha)$
Informal description
For any type $\alpha$, the cardinality $\#\alpha$ is at least $\aleph_0$ if and only if $\alpha$ is infinite.
Cardinal.mk_lt_aleph0_iff theorem
: #α < ℵ₀ ↔ Finite α
Full source
lemma mk_lt_aleph0_iff : #α < ℵ₀ ↔ Finite α := by simp [← not_le, aleph0_le_mk_iff]
Finite Types Have Cardinality Below Aleph-null
Informal description
For any type $\alpha$, the cardinality $\#\alpha$ is strictly less than $\aleph_0$ if and only if $\alpha$ is finite.
Cardinal.mk_lt_aleph0 theorem
[Finite α] : #α < ℵ₀
Full source
@[simp] lemma mk_lt_aleph0 [Finite α] :  < ℵ₀ := mk_lt_aleph0_iff.2 ‹_›
Finite Types Have Cardinality Below Aleph-null
Informal description
For any finite type $\alpha$, the cardinality $\#\alpha$ is strictly less than $\aleph_0$.
Cardinal.aleph0_le_mk theorem
(α : Type u) [Infinite α] : ℵ₀ ≤ #α
Full source
@[simp]
theorem aleph0_le_mk (α : Type u) [Infinite α] : ℵ₀ :=
  infinite_iff.1 ‹_›
Infinite Types Have Cardinality At Least Aleph-null
Informal description
For any infinite type $\alpha$, the cardinality of $\alpha$ is at least $\aleph_0$, i.e., $\aleph_0 \leq \#\alpha$.
Cardinal.mk_eq_aleph0 theorem
(α : Type*) [Countable α] [Infinite α] : #α = ℵ₀
Full source
@[simp]
theorem mk_eq_aleph0 (α : Type*) [Countable α] [Infinite α] :  = ℵ₀ :=
  mk_le_aleph0.antisymm <| aleph0_le_mk _
Cardinality of Countable Infinite Types Equals Aleph-null
Informal description
For any countable and infinite type $\alpha$, the cardinality of $\alpha$ equals $\aleph_0$, i.e., $\#\alpha = \aleph_0$.
Cardinal.denumerable_iff theorem
{α : Type u} : Nonempty (Denumerable α) ↔ #α = ℵ₀
Full source
theorem denumerable_iff {α : Type u} : NonemptyNonempty (Denumerable α) ↔ #α = ℵ₀ :=
  ⟨fun ⟨h⟩ => mk_congr ((@Denumerable.eqv α h).trans Equiv.ulift.symm), fun h => by
    obtain ⟨f⟩ := Quotient.exact h
    exact ⟨Denumerable.mk' <| f.trans Equiv.ulift⟩⟩
Denumerability Criterion: $\alpha$ is denumerable if and only if $\#\alpha = \aleph_0$
Informal description
For any type $\alpha$, there exists a denumerable structure on $\alpha$ if and only if the cardinality of $\alpha$ equals $\aleph_0$, i.e., $\#\alpha = \aleph_0$.
Cardinal.mk_denumerable theorem
(α : Type u) [Denumerable α] : #α = ℵ₀
Full source
theorem mk_denumerable (α : Type u) [Denumerable α] :  = ℵ₀ :=
  denumerable_iff.1 ⟨‹_›⟩
Cardinality of Denumerable Types Equals Aleph-null
Informal description
For any denumerable type $\alpha$, the cardinality of $\alpha$ is equal to $\aleph_0$, i.e., $\#\alpha = \aleph_0$.
Set.countable_infinite_iff_nonempty_denumerable theorem
{α : Type*} {s : Set α} : s.Countable ∧ s.Infinite ↔ Nonempty (Denumerable s)
Full source
theorem _root_.Set.countable_infinite_iff_nonempty_denumerable {α : Type*} {s : Set α} :
    s.Countable ∧ s.Infinites.Countable ∧ s.Infinite ↔ Nonempty (Denumerable s) := by
  rw [nonempty_denumerable_iff, ← Set.infinite_coe_iff, countable_coe_iff]
Denumerability Criterion for Sets: $s$ is denumerable if and only if it is countable and infinite
Informal description
For any set $s$ of type $\alpha$, the set $s$ is both countable and infinite if and only if there exists a denumerable structure on $s$.
Cardinal.aleph0_add_aleph0 theorem
: ℵ₀ + ℵ₀ = ℵ₀
Full source
@[simp]
theorem aleph0_add_aleph0 : ℵ₀ + ℵ₀ = ℵ₀ :=
  mk_denumerable _
Sum of Aleph-null with Itself Equals Aleph-null: $\aleph_0 + \aleph_0 = \aleph_0$
Informal description
The sum of two aleph-null cardinals is equal to aleph-null, i.e., $\aleph_0 + \aleph_0 = \aleph_0$.
Cardinal.aleph0_mul_aleph0 theorem
: ℵ₀ * ℵ₀ = ℵ₀
Full source
theorem aleph0_mul_aleph0 : ℵ₀ * ℵ₀ = ℵ₀ :=
  mk_denumerable _
Product of Aleph-null with Itself: $\aleph_0 \times \aleph_0 = \aleph_0$
Informal description
The product of $\aleph_0$ with itself equals $\aleph_0$, i.e., $\aleph_0 \times \aleph_0 = \aleph_0$.
Cardinal.nat_mul_aleph0 theorem
{n : ℕ} (hn : n ≠ 0) : ↑n * ℵ₀ = ℵ₀
Full source
@[simp]
theorem nat_mul_aleph0 {n : } (hn : n ≠ 0) : ↑n * ℵ₀ = ℵ₀ :=
  le_antisymm (lift_mk_fin n ▸ mk_le_aleph0) <|
    le_mul_of_one_le_left (zero_le _) <| by
      rwa [← Nat.cast_one, Nat.cast_le, Nat.one_le_iff_ne_zero]
Product of Nonzero Natural Number with Aleph-null Equals Aleph-null: $n \cdot \aleph_0 = \aleph_0$
Informal description
For any nonzero natural number $n$, the product of $n$ (as a cardinal number) and $\aleph_0$ is equal to $\aleph_0$, i.e., $n \cdot \aleph_0 = \aleph_0$.
Cardinal.aleph0_mul_nat theorem
{n : ℕ} (hn : n ≠ 0) : ℵ₀ * n = ℵ₀
Full source
@[simp]
theorem aleph0_mul_nat {n : } (hn : n ≠ 0) : ℵ₀ * n = ℵ₀ := by rw [mul_comm, nat_mul_aleph0 hn]
Product of Aleph-null and Nonzero Natural Number Equals Aleph-null: $\aleph_0 \cdot n = \aleph_0$
Informal description
For any nonzero natural number $n$, the product of the cardinal $\aleph_0$ and $n$ (as a cardinal number) is equal to $\aleph_0$, i.e., $\aleph_0 \cdot n = \aleph_0$.
Cardinal.ofNat_mul_aleph0 theorem
{n : ℕ} [Nat.AtLeastTwo n] : ofNat(n) * ℵ₀ = ℵ₀
Full source
@[simp]
theorem ofNat_mul_aleph0 {n : } [Nat.AtLeastTwo n] : ofNat(n) * ℵ₀ = ℵ₀ :=
  nat_mul_aleph0 (NeZero.ne n)
Product of Natural Number (≥2) with Aleph-null Equals Aleph-null: $n \cdot \aleph_0 = \aleph_0$
Informal description
For any natural number $n \geq 2$, the product of $n$ (as a cardinal number) and $\aleph_0$ is equal to $\aleph_0$, i.e., $n \cdot \aleph_0 = \aleph_0$.
Cardinal.aleph0_mul_ofNat theorem
{n : ℕ} [Nat.AtLeastTwo n] : ℵ₀ * ofNat(n) = ℵ₀
Full source
@[simp]
theorem aleph0_mul_ofNat {n : } [Nat.AtLeastTwo n] : ℵ₀ * ofNat(n) = ℵ₀ :=
  aleph0_mul_nat (NeZero.ne n)
$\aleph_0 \cdot n = \aleph_0$ for $n \geq 2$
Informal description
For any natural number $n \geq 2$, the product of the cardinal $\aleph_0$ and $n$ (as a cardinal number) is equal to $\aleph_0$, i.e., $\aleph_0 \cdot n = \aleph_0$.
Cardinal.add_le_aleph0 theorem
{c₁ c₂ : Cardinal} : c₁ + c₂ ≤ ℵ₀ ↔ c₁ ≤ ℵ₀ ∧ c₂ ≤ ℵ₀
Full source
@[simp]
theorem add_le_aleph0 {c₁ c₂ : Cardinal} : c₁ + c₂ ≤ ℵ₀ ↔ c₁ ≤ ℵ₀ ∧ c₂ ≤ ℵ₀ :=
  ⟨fun h => ⟨le_self_add.trans h, le_add_self.trans h⟩, fun h =>
    aleph0_add_aleph0 ▸ add_le_add h.1 h.2⟩
Sum of Cardinals Bounded by Aleph-null: $c_1 + c_2 \leq \aleph_0 \leftrightarrow c_1 \leq \aleph_0 \land c_2 \leq \aleph_0$
Informal description
For any two cardinal numbers $c_1$ and $c_2$, the sum $c_1 + c_2$ is less than or equal to $\aleph_0$ if and only if both $c_1 \leq \aleph_0$ and $c_2 \leq \aleph_0$.
Cardinal.nat_add_aleph0 theorem
(n : ℕ) : ↑n + ℵ₀ = ℵ₀
Full source
@[simp]
theorem nat_add_aleph0 (n : ) : ↑n + ℵ₀ = ℵ₀ := by rw [add_comm, aleph0_add_nat]
$\aleph_0$ Absorbs Natural Numbers in Addition: $n + \aleph_0 = \aleph_0$
Informal description
For any natural number $n$, the sum of the cardinal number corresponding to $n$ and $\aleph_0$ equals $\aleph_0$, i.e., $n + \aleph_0 = \aleph_0$.
Cardinal.ofNat_add_aleph0 theorem
{n : ℕ} [Nat.AtLeastTwo n] : ofNat(n) + ℵ₀ = ℵ₀
Full source
@[simp]
theorem ofNat_add_aleph0 {n : } [Nat.AtLeastTwo n] : ofNat(n) + ℵ₀ = ℵ₀ :=
  nat_add_aleph0 n
$\aleph_0$ Absorbs Natural Numbers $\geq 2$ in Addition: $n + \aleph_0 = \aleph_0$
Informal description
For any natural number $n \geq 2$, the sum of the cardinal number corresponding to $n$ and $\aleph_0$ equals $\aleph_0$, i.e., $n + \aleph_0 = \aleph_0$.
Cardinal.aleph0_add_ofNat theorem
{n : ℕ} [Nat.AtLeastTwo n] : ℵ₀ + ofNat(n) = ℵ₀
Full source
@[simp]
theorem aleph0_add_ofNat {n : } [Nat.AtLeastTwo n] : ℵ₀ + ofNat(n) = ℵ₀ :=
  aleph0_add_nat n
$\aleph_0$ Absorbs Natural Numbers $\geq 2$ in Addition
Informal description
For any natural number $n \geq 2$, the sum of the cardinal $\aleph_0$ and the cardinal corresponding to $n$ equals $\aleph_0$, i.e., $\aleph_0 + n = \aleph_0$.
Cardinal.mk_int theorem
: #ℤ = ℵ₀
Full source
theorem mk_int : #ℤ = ℵ₀ :=
  mk_denumerable 
Cardinality of Integers Equals Aleph-Null
Informal description
The cardinality of the set of integers $\mathbb{Z}$ is equal to $\aleph_0$, i.e., $\#\mathbb{Z} = \aleph_0$.
Cardinal.mk_pnat theorem
: #ℕ+ = ℵ₀
Full source
theorem mk_pnat : #ℕ+ = ℵ₀ :=
  mk_denumerable ℕ+
Cardinality of Positive Natural Numbers Equals Aleph-Null
Informal description
The cardinality of the set of positive natural numbers $\mathbb{N}^+$ is equal to $\aleph_0$, i.e., $|\mathbb{N}^+| = \aleph_0$.
Cardinal.mk_additive theorem
: #(Additive α) = #α
Full source
@[simp] theorem mk_additive : #(Additive α) =  := rfl
Cardinality Preservation under Additive Construction
Informal description
For any type $\alpha$, the cardinality of the additive version of $\alpha$ (denoted $\#(\text{Additive } \alpha)$) is equal to the cardinality of $\alpha$ itself (denoted $\#\alpha$).
Cardinal.mk_multiplicative theorem
: #(Multiplicative α) = #α
Full source
@[simp] theorem mk_multiplicative : #(Multiplicative α) =  := rfl
Cardinality Preservation under Multiplicative Construction
Informal description
For any type $\alpha$, the cardinality of the multiplicative version of $\alpha$ (denoted $\#(\text{Multiplicative } \alpha)$) is equal to the cardinality of $\alpha$ itself (denoted $\#\alpha$).
Cardinal.mk_mulOpposite theorem
: #(MulOpposite α) = #α
Full source
@[to_additive (attr := simp)] theorem mk_mulOpposite : #(MulOpposite α) =  :=
  mk_congr MulOpposite.opEquiv.symm
Cardinality Equality Between Type and Its Multiplicative Opposite
Informal description
For any type $\alpha$, the cardinality of its multiplicative opposite $\alpha^\text{op}$ is equal to the cardinality of $\alpha$, i.e., $\#(\alpha^\text{op}) = \#\alpha$.
Cardinal.mk_singleton theorem
{α : Type u} (x : α) : #({ x } : Set α) = 1
Full source
theorem mk_singleton {α : Type u} (x : α) : #({x} : Set α) = 1 :=
  mk_eq_one _
Cardinality of Singleton Sets is One
Informal description
For any type $\alpha$ and any element $x \in \alpha$, the cardinality of the singleton set $\{x\}$ is equal to $1$, i.e., $\#\{x\} = 1$.
Cardinal.mk_vector theorem
(α : Type u) (n : ℕ) : #(List.Vector α n) = #α ^ n
Full source
@[simp]
theorem mk_vector (α : Type u) (n : ) : #(List.Vector α n) =  ^ n :=
  (mk_congr (Equiv.vectorEquivFin α n)).trans <| by simp
Cardinality of Vector Type: $\#(\text{Vector}_n(\alpha)) = (\#\alpha)^n$
Informal description
For any type $\alpha$ and natural number $n$, the cardinality of the type of vectors (lists of fixed length $n$) over $\alpha$ is equal to the cardinality of $\alpha$ raised to the power of $n$, i.e., \[ \#(\text{Vector}_n(\alpha)) = (\#\alpha)^n. \]
Cardinal.mk_list_eq_sum_pow theorem
(α : Type u) : #(List α) = sum fun n : ℕ => #α ^ n
Full source
theorem mk_list_eq_sum_pow (α : Type u) : #(List α) = sum fun n :  =>  ^ n :=
  calc
    #(List α) = #(Σn, List.Vector α n) := mk_congr (Equiv.sigmaFiberEquiv List.length).symm
    _ = sum fun n :  =>  ^ n := by simp
Cardinality of Lists as Sum of Powers: $\#(\text{List}(\alpha)) = \sum_{n} (\#\alpha)^n$
Informal description
For any type $\alpha$, the cardinality of the type of lists over $\alpha$ is equal to the sum of the cardinalities of $\alpha$ raised to the power of $n$ for all natural numbers $n$, i.e., \[ \#(\text{List}(\alpha)) = \sum_{n \in \mathbb{N}} (\#\alpha)^n. \]
Cardinal.mk_quot_le theorem
{α : Type u} {r : α → α → Prop} : #(Quot r) ≤ #α
Full source
theorem mk_quot_le {α : Type u} {r : α → α → Prop} : #(Quot r) :=
  mk_le_of_surjective Quot.exists_rep
Cardinality Bound for Quotient Types
Informal description
For any type $\alpha$ and any binary relation $r$ on $\alpha$, the cardinality of the quotient type $\mathrm{Quot}\,r$ is less than or equal to the cardinality of $\alpha$, i.e., $\#(\mathrm{Quot}\,r) \leq \#\alpha$.
Cardinal.mk_quotient_le theorem
{α : Type u} {s : Setoid α} : #(Quotient s) ≤ #α
Full source
theorem mk_quotient_le {α : Type u} {s : Setoid α} : #(Quotient s) :=
  mk_quot_le
Cardinality Bound for Quotient Types Under Setoid Relation
Informal description
For any type $\alpha$ and any setoid $s$ on $\alpha$, the cardinality of the quotient type $\mathrm{Quotient}\,s$ is less than or equal to the cardinality of $\alpha$, i.e., $\#(\mathrm{Quotient}\,s) \leq \#\alpha$.
Cardinal.mk_subtype_le_of_subset theorem
{α : Type u} {p q : α → Prop} (h : ∀ ⦃x⦄, p x → q x) : #(Subtype p) ≤ #(Subtype q)
Full source
theorem mk_subtype_le_of_subset {α : Type u} {p q : α → Prop} (h : ∀ ⦃x⦄, p x → q x) :
    #(Subtype p)#(Subtype q) :=
  ⟨Embedding.subtypeMap (Embedding.refl α) h⟩
Cardinality Comparison of Subtypes Under Implication
Informal description
For any type $\alpha$ and predicates $p, q$ on $\alpha$, if $p(x)$ implies $q(x)$ for all $x \in \alpha$, then the cardinality of the subtype $\{x \in \alpha \mid p(x)\}$ is less than or equal to the cardinality of the subtype $\{x \in \alpha \mid q(x)\}$.
Cardinal.mk_emptyCollection theorem
(α : Type u) : #(∅ : Set α) = 0
Full source
theorem mk_emptyCollection (α : Type u) : #(∅ : Set α) = 0 :=
  mk_eq_zero _
Cardinality of Empty Set is Zero
Informal description
For any type $\alpha$, the cardinality of the empty set $\emptyset$ (as a subset of $\alpha$) is equal to $0$.
Cardinal.mk_emptyCollection_iff theorem
{α : Type u} {s : Set α} : #s = 0 ↔ s = ∅
Full source
theorem mk_emptyCollection_iff {α : Type u} {s : Set α} : #s#s = 0 ↔ s = ∅ := by
  constructor
  · intro h
    rw [mk_eq_zero_iff] at h
    exact eq_empty_iff_forall_not_mem.2 fun x hx => h.elim' ⟨x, hx⟩
  · rintro rfl
    exact mk_emptyCollection _
Cardinality Zero Characterization: $\#s = 0 \leftrightarrow s = \emptyset$
Informal description
For any type $\alpha$ and any subset $s$ of $\alpha$, the cardinality of $s$ is zero if and only if $s$ is the empty set.
Cardinal.mk_univ theorem
{α : Type u} : #(@univ α) = #α
Full source
@[simp]
theorem mk_univ {α : Type u} : #(@univ α) =  :=
  mk_congr (Equiv.Set.univ α)
Cardinality of Universal Set Equals Cardinality of Type
Informal description
For any type $\alpha$, the cardinality of the universal set (containing all elements of $\alpha$) is equal to the cardinality of $\alpha$ itself, i.e., $\#(\text{univ } \alpha) = \#\alpha$.
Cardinal.mk_setProd theorem
{α β : Type u} (s : Set α) (t : Set β) : #(s ×ˢ t) = #s * #t
Full source
@[simp] lemma mk_setProd {α β : Type u} (s : Set α) (t : Set β) : #(s ×ˢ t) = #s * #t := by
  rw [mul_def, mk_congr (Equiv.Set.prod ..)]
Cardinality of Cartesian Product of Sets Equals Product of Cardinalities
Informal description
For any sets $s \subseteq \alpha$ and $t \subseteq \beta$, the cardinality of their Cartesian product $s \times t$ is equal to the product of their cardinalities, i.e., $\#(s \times t) = \#s \cdot \#t$.
Cardinal.mk_image_le theorem
{α β : Type u} {f : α → β} {s : Set α} : #(f '' s) ≤ #s
Full source
theorem mk_image_le {α β : Type u} {f : α → β} {s : Set α} : #(f '' s)#s :=
  mk_le_of_surjective surjective_onto_image
Cardinality of Image is Bounded by Cardinality of Domain
Informal description
For any function $f : \alpha \to \beta$ and any subset $s \subseteq \alpha$, the cardinality of the image $f(s)$ is less than or equal to the cardinality of $s$, i.e., $\#(f(s)) \leq \#s$.
Cardinal.mk_image2_le theorem
{α β γ : Type u} {f : α → β → γ} {s : Set α} {t : Set β} : #(image2 f s t) ≤ #s * #t
Full source
lemma mk_image2_le {α β γ : Type u} {f : α → β → γ} {s : Set α} {t : Set β} :
    #(image2 f s t)#s * #t := by
  rw [← image_uncurry_prod, ← mk_setProd]
  exact mk_image_le
Cardinality Bound for Binary Image: $\#(\text{image2}(f, s, t)) \leq \#s \cdot \#t$
Informal description
For any types $\alpha$, $\beta$, and $\gamma$, any binary function $f : \alpha \to \beta \to \gamma$, and any subsets $s \subseteq \alpha$ and $t \subseteq \beta$, the cardinality of the image $\text{image2}(f, s, t)$ is less than or equal to the product of the cardinalities of $s$ and $t$, i.e., $$\#\{f(a, b) \mid a \in s, b \in t\} \leq \#s \cdot \#t.$$
Cardinal.mk_image_le_lift theorem
{α : Type u} {β : Type v} {f : α → β} {s : Set α} : lift.{u} #(f '' s) ≤ lift.{v} #s
Full source
theorem mk_image_le_lift {α : Type u} {β : Type v} {f : α → β} {s : Set α} :
    lift.{u} #(f '' s)lift.{v} #s :=
  lift_mk_le.{0}.mpr ⟨Embedding.ofSurjective _ surjective_onto_image⟩
Lifted Cardinality Inequality for Images: $\mathrm{lift}(\#f(s)) \leq \mathrm{lift}(\#s)$
Informal description
For any function $f : \alpha \to \beta$ and any subset $s \subseteq \alpha$, the cardinality of the image $f(s)$ lifted to the universe $\max(u,v)$ is less than or equal to the cardinality of $s$ lifted to the same universe. In symbols: $$\mathrm{lift}_{u}(\#(f(s))) \leq \mathrm{lift}_{v}(\#s)$$
Cardinal.mk_range_le theorem
{α β : Type u} {f : α → β} : #(range f) ≤ #α
Full source
theorem mk_range_le {α β : Type u} {f : α → β} : #(range f) :=
  mk_le_of_surjective surjective_onto_range
Cardinality of Range is Bounded by Domain Cardinality
Informal description
For any function $f : \alpha \to \beta$, the cardinality of the range of $f$ is less than or equal to the cardinality of $\alpha$, i.e., $\#(\mathrm{range}\, f) \leq \#\alpha$.
Cardinal.mk_range_le_lift theorem
{α : Type u} {β : Type v} {f : α → β} : lift.{u} #(range f) ≤ lift.{v} #α
Full source
theorem mk_range_le_lift {α : Type u} {β : Type v} {f : α → β} :
    lift.{u} #(range f)lift.{v}  :=
  lift_mk_le.{0}.mpr ⟨Embedding.ofSurjective _ surjective_onto_range⟩
Lifted Cardinality Bound: $\text{lift}_u(\#(\text{range}\, f)) \leq \text{lift}_v(\#\alpha)$
Informal description
For any function $f : \alpha \to \beta$ between types $\alpha$ (in universe $u$) and $\beta$ (in universe $v$), the cardinality of the range of $f$ lifted to universe $u$ is less than or equal to the cardinality of $\alpha$ lifted to universe $v$. In symbols: $$\text{lift}_u(\#(\text{range}\, f)) \leq \text{lift}_v(\#\alpha)$$
Cardinal.mk_range_eq theorem
(f : α → β) (h : Injective f) : #(range f) = #α
Full source
theorem mk_range_eq (f : α → β) (h : Injective f) : #(range f) =  :=
  mk_congr (Equiv.ofInjective f h).symm
Cardinality of Range Equals Domain for Injective Functions
Informal description
For any injective function $f : \alpha \to \beta$, the cardinality of the range of $f$ equals the cardinality of $\alpha$, i.e., $\#(\mathrm{range}\, f) = \#\alpha$.
Cardinal.mk_range_eq_lift theorem
{α : Type u} {β : Type v} {f : α → β} (hf : Injective f) : lift.{max u w} #(range f) = lift.{max v w} #α
Full source
theorem mk_range_eq_lift {α : Type u} {β : Type v} {f : α → β} (hf : Injective f) :
    lift.{max u w} #(range f) = lift.{max v w}  :=
  lift_mk_eq.{v,u,w}.mpr ⟨(Equiv.ofInjective f hf).symm⟩
Equality of Lifted Cardinalities for Injective Function Range
Informal description
For any injective function $f \colon \alpha \to \beta$ between types $\alpha$ (in universe $u$) and $\beta$ (in universe $v$), the lifted cardinality of the range of $f$ equals the lifted cardinality of $\alpha$, when both are lifted to universe $\max(u, v, w)$. In symbols: $$\text{lift}_{\max(u,w)} \#(\text{range}\, f) = \text{lift}_{\max(v,w)} \#\alpha$$
Cardinal.mk_range_eq_of_injective theorem
{α : Type u} {β : Type v} {f : α → β} (hf : Injective f) : lift.{u} #(range f) = lift.{v} #α
Full source
theorem mk_range_eq_of_injective {α : Type u} {β : Type v} {f : α → β} (hf : Injective f) :
    lift.{u} #(range f) = lift.{v}  :=
  lift_mk_eq'.mpr ⟨(Equiv.ofInjective f hf).symm⟩
Equality of Lifted Cardinalities for Injective Function Range
Informal description
For any injective function $f \colon \alpha \to \beta$ between types $\alpha$ (in universe $u$) and $\beta$ (in universe $v$), the lifted cardinality of the range of $f$ equals the lifted cardinality of $\alpha$. That is, $$\text{lift}_u \#(\text{range}\, f) = \text{lift}_v \#\alpha.$$
Cardinal.lift_mk_le_lift_mk_of_injective theorem
{α : Type u} {β : Type v} {f : α → β} (hf : Injective f) : Cardinal.lift.{v} (#α) ≤ Cardinal.lift.{u} (#β)
Full source
lemma lift_mk_le_lift_mk_of_injective {α : Type u} {β : Type v} {f : α → β} (hf : Injective f) :
    Cardinal.lift.{v} () ≤ Cardinal.lift.{u} () := by
  rw [← Cardinal.mk_range_eq_of_injective hf]
  exact Cardinal.lift_le.2 (Cardinal.mk_set_le _)
Lifted Cardinality Inequality for Injective Functions: $\text{lift}_v \#\alpha \leq \text{lift}_u \#\beta$
Informal description
For any injective function $f \colon \alpha \to \beta$ between types $\alpha$ (in universe $u$) and $\beta$ (in universe $v$), the lifted cardinality of $\alpha$ is less than or equal to the lifted cardinality of $\beta$. That is, $$\text{lift}_v \#\alpha \leq \text{lift}_u \#\beta.$$
Cardinal.lift_mk_le_lift_mk_of_surjective theorem
{α : Type u} {β : Type v} {f : α → β} (hf : Surjective f) : Cardinal.lift.{u} (#β) ≤ Cardinal.lift.{v} (#α)
Full source
lemma lift_mk_le_lift_mk_of_surjective {α : Type u} {β : Type v} {f : α → β} (hf : Surjective f) :
    Cardinal.lift.{u} () ≤ Cardinal.lift.{v} () :=
  lift_mk_le_lift_mk_of_injective (injective_surjInv hf)
Lifted Cardinality Inequality for Surjective Functions: $\text{lift}_u \#\beta \leq \text{lift}_v \#\alpha$
Informal description
For any surjective function $f \colon \alpha \to \beta$ between types $\alpha$ (in universe $u$) and $\beta$ (in universe $v$), the lifted cardinality of $\beta$ is less than or equal to the lifted cardinality of $\alpha$. That is, $$\text{lift}_u \#\beta \leq \text{lift}_v \#\alpha.$$
Cardinal.mk_image_eq_of_injOn theorem
{α β : Type u} (f : α → β) (s : Set α) (h : InjOn f s) : #(f '' s) = #s
Full source
theorem mk_image_eq_of_injOn {α β : Type u} (f : α → β) (s : Set α) (h : InjOn f s) :
    #(f '' s) = #s :=
  mk_congr (Equiv.Set.imageOfInjOn f s h).symm
Cardinality of Image under Injective Function: $\#(f(s)) = \#s$
Informal description
For any function $f : \alpha \to \beta$ and any subset $s \subseteq \alpha$, if $f$ is injective on $s$, then the cardinality of the image $f(s)$ is equal to the cardinality of $s$, i.e., $\#(f(s)) = \#s$.
Cardinal.mk_image_eq_of_injOn_lift theorem
{α : Type u} {β : Type v} (f : α → β) (s : Set α) (h : InjOn f s) : lift.{u} #(f '' s) = lift.{v} #s
Full source
theorem mk_image_eq_of_injOn_lift {α : Type u} {β : Type v} (f : α → β) (s : Set α)
    (h : InjOn f s) : lift.{u} #(f '' s) = lift.{v} #s :=
  lift_mk_eq.{v, u, 0}.mpr ⟨(Equiv.Set.imageOfInjOn f s h).symm⟩
Lifted Cardinality Preservation under Injective-on-Set Image: $\text{lift}_{u} \#(f(s)) = \text{lift}_{v} \#s$
Informal description
For any function $f \colon \alpha \to \beta$ and any subset $s \subseteq \alpha$, if $f$ is injective on $s$, then the lifted cardinality of the image $f(s)$ in universe $\max(u, v)$ equals the lifted cardinality of $s$ in the same universe. That is, $\text{lift}_{u} \#(f(s)) = \text{lift}_{v} \#s$.
Cardinal.mk_image_eq theorem
{α β : Type u} {f : α → β} {s : Set α} (hf : Injective f) : #(f '' s) = #s
Full source
theorem mk_image_eq {α β : Type u} {f : α → β} {s : Set α} (hf : Injective f) : #(f '' s) = #s :=
  mk_image_eq_of_injOn _ _ hf.injOn
Cardinality Preservation under Injective Image: $\#(f(s)) = \#s$
Informal description
For any injective function $f : \alpha \to \beta$ and any subset $s \subseteq \alpha$, the cardinality of the image $f(s)$ equals the cardinality of $s$, i.e., $\#(f(s)) = \#s$.
Cardinal.mk_image_eq_lift theorem
{α : Type u} {β : Type v} (f : α → β) (s : Set α) (h : Injective f) : lift.{u} #(f '' s) = lift.{v} #s
Full source
theorem mk_image_eq_lift {α : Type u} {β : Type v} (f : α → β) (s : Set α) (h : Injective f) :
    lift.{u} #(f '' s) = lift.{v} #s :=
  mk_image_eq_of_injOn_lift _ _ h.injOn
Lifted Cardinality Preservation under Injective Image: $\text{lift}_{u} \#(f(s)) = \text{lift}_{v} \#s$
Informal description
For any function $f \colon \alpha \to \beta$ that is injective, and any subset $s \subseteq \alpha$, the lifted cardinality of the image $f(s)$ in universe $\max(u, v)$ equals the lifted cardinality of $s$ in the same universe. That is, $\text{lift}_{u} \#(f(s)) = \text{lift}_{v} \#s$.
Cardinal.mk_image_embedding_lift theorem
{β : Type v} (f : α ↪ β) (s : Set α) : lift.{u} #(f '' s) = lift.{v} #s
Full source
@[simp]
theorem mk_image_embedding_lift {β : Type v} (f : α ↪ β) (s : Set α) :
    lift.{u} #(f '' s) = lift.{v} #s :=
  mk_image_eq_lift _ _ f.injective
Lifted Cardinality Preservation under Injective Embedding: $\text{lift}_u \#(f(s)) = \text{lift}_v \#s$
Informal description
For any injective function embedding $f \colon \alpha \hookrightarrow \beta$ and any subset $s \subseteq \alpha$, the lifted cardinality of the image $f(s)$ in universe $\max(u, v)$ equals the lifted cardinality of $s$ in the same universe. That is, \[ \text{lift}_u \#(f(s)) = \text{lift}_v \#s. \]
Cardinal.mk_image_embedding theorem
(f : α ↪ β) (s : Set α) : #(f '' s) = #s
Full source
@[simp]
theorem mk_image_embedding (f : α ↪ β) (s : Set α) : #(f '' s) = #s := by
  simpa using mk_image_embedding_lift f s
Cardinality Preservation under Injective Embedding: $\#(f(s)) = \#s$
Informal description
For any injective function embedding $f \colon \alpha \hookrightarrow \beta$ and any subset $s \subseteq \alpha$, the cardinality of the image $f(s)$ equals the cardinality of $s$. That is, \[ \#(f(s)) = \#s. \]
Cardinal.mk_iUnion_le_sum_mk theorem
{α ι : Type u} {f : ι → Set α} : #(⋃ i, f i) ≤ sum fun i => #(f i)
Full source
theorem mk_iUnion_le_sum_mk {α ι : Type u} {f : ι → Set α} : #(⋃ i, f i)sum fun i => #(f i) :=
  calc
    #(⋃ i, f i)#(Σi, f i) := mk_le_of_surjective (Set.sigmaToiUnion_surjective f)
    _ = sum fun i => #(f i) := mk_sigma _
Cardinality of Union Bounded by Sum of Cardinalities
Informal description
For any indexed family of sets $(f_i)_{i \in \iota}$ in a type $\alpha$, the cardinality of their union $\bigcup_{i} f_i$ is less than or equal to the sum of the cardinalities of the individual sets $f_i$. That is, \[ \#\left(\bigcup_{i} f_i\right) \leq \sum_{i} \#(f_i). \]
Cardinal.mk_iUnion_le_sum_mk_lift theorem
{α : Type u} {ι : Type v} {f : ι → Set α} : lift.{v} #(⋃ i, f i) ≤ sum fun i => #(f i)
Full source
theorem mk_iUnion_le_sum_mk_lift {α : Type u} {ι : Type v} {f : ι → Set α} :
    lift.{v} #(⋃ i, f i)sum fun i => #(f i) :=
  calc
    lift.{v} #(⋃ i, f i)#(Σi, f i) :=
      mk_le_of_surjective <| ULift.up_surjective.comp (Set.sigmaToiUnion_surjective f)
    _ = sum fun i => #(f i) := mk_sigma _
Cardinality of Union is Bounded by Sum of Cardinalities (Lifted Version)
Informal description
For any family of sets $(f_i)_{i \in \iota}$ indexed by a type $\iota$ over a type $\alpha$, the cardinality of the union $\bigcup_i f_i$ lifted to a higher universe is less than or equal to the sum of the cardinalities of the individual sets $f_i$. That is, $\#(\bigcup_i f_i) \leq \sum_{i \in \iota} \#(f_i)$, where the cardinalities are considered in appropriate universes.
Cardinal.mk_iUnion_eq_sum_mk theorem
{α ι : Type u} {f : ι → Set α} (h : Pairwise (Disjoint on f)) : #(⋃ i, f i) = sum fun i => #(f i)
Full source
theorem mk_iUnion_eq_sum_mk {α ι : Type u} {f : ι → Set α}
    (h : Pairwise (DisjointDisjoint on f)) : #(⋃ i, f i) = sum fun i => #(f i) :=
  calc
    #(⋃ i, f i) = #(Σi, f i) := mk_congr (Set.unionEqSigmaOfDisjoint h)
    _ = sum fun i => #(f i) := mk_sigma _
Cardinality of Union Equals Sum of Cardinalities for Pairwise Disjoint Sets
Informal description
For any indexed family of sets $(f_i)_{i \in \iota}$ in a type $\alpha$, if the sets are pairwise disjoint (i.e., $f_i \cap f_j = \emptyset$ for all $i \neq j$), then the cardinality of their union $\bigcup_{i} f_i$ equals the sum of the cardinalities of the individual sets $f_i$. That is, \[ \#\left(\bigcup_{i} f_i\right) = \sum_{i} \#(f_i). \]
Cardinal.mk_iUnion_eq_sum_mk_lift theorem
{α : Type u} {ι : Type v} {f : ι → Set α} (h : Pairwise (Disjoint on f)) : lift.{v} #(⋃ i, f i) = sum fun i => #(f i)
Full source
theorem mk_iUnion_eq_sum_mk_lift {α : Type u} {ι : Type v} {f : ι → Set α}
    (h : Pairwise (DisjointDisjoint on f)) :
    lift.{v} #(⋃ i, f i) = sum fun i => #(f i) :=
  calc
    lift.{v} #(⋃ i, f i) = #(Σi, f i) :=
      mk_congr <| .trans Equiv.ulift (Set.unionEqSigmaOfDisjoint h)
    _ = sum fun i => #(f i) := mk_sigma _
Cardinality of Union Equals Sum of Cardinalities for Pairwise Disjoint Sets (Lifted Version)
Informal description
For any family of pairwise disjoint sets $(f_i)_{i \in \iota}$ indexed by a type $\iota$ over a type $\alpha$, the cardinality of the union $\bigcup_i f_i$ (lifted to a higher universe) equals the sum of the cardinalities of the individual sets $f_i$. That is, \[ \#\left(\bigcup_i f_i\right) = \sum_{i \in \iota} \#(f_i), \] where the cardinalities are considered in appropriate universes.
Cardinal.mk_iUnion_le theorem
{α ι : Type u} (f : ι → Set α) : #(⋃ i, f i) ≤ #ι * ⨆ i, #(f i)
Full source
theorem mk_iUnion_le {α ι : Type u} (f : ι → Set α) : #(⋃ i, f i) * ⨆ i, #(f i) :=
  mk_iUnion_le_sum_mk.trans (sum_le_iSup _)
Cardinality of Union Bounded by Product of Index Cardinality and Supremum of Cardinalities
Informal description
For any type $\alpha$ and any indexed family of sets $f : \iota \to \text{Set } \alpha$, the cardinality of the union $\bigcup_{i \in \iota} f(i)$ is bounded by the product of the cardinality of $\iota$ and the supremum of the cardinalities of the sets $f(i)$. In symbols: $$\#\left(\bigcup_{i \in \iota} f(i)\right) \leq \#\iota \cdot \sup_{i \in \iota} \#(f(i))$$
Cardinal.mk_iUnion_le_lift theorem
{α : Type u} {ι : Type v} (f : ι → Set α) : lift.{v} #(⋃ i, f i) ≤ lift.{u} #ι * ⨆ i, lift.{v} #(f i)
Full source
theorem mk_iUnion_le_lift {α : Type u} {ι : Type v} (f : ι → Set α) :
    lift.{v} #(⋃ i, f i)lift.{u}  * ⨆ i, lift.{v} #(f i) := by
  refine mk_iUnion_le_sum_mk_lift.trans <| Eq.trans_le ?_ (sum_le_iSup_lift _)
  rw [← lift_sum, lift_id'lift_id'.{_,u}]
Cardinality of Union Bounded by Product of Index Cardinality and Supremum of Cardinalities (Lifted Version)
Informal description
For any family of sets $\{f_i\}_{i \in \iota}$ indexed by a type $\iota$ over a type $\alpha$, the cardinality of the union $\bigcup_{i} f_i$ (lifted to an appropriate universe) is bounded by the product of the cardinality of $\iota$ (lifted to an appropriate universe) and the supremum of the cardinalities of the sets $f_i$ (lifted to an appropriate universe). In symbols: $$\#\left(\bigcup_{i} f_i\right) \leq \#\iota \cdot \sup_{i} \#(f_i)$$ where all cardinalities are considered in their appropriate lifted universes.
Cardinal.mk_sUnion_le theorem
{α : Type u} (A : Set (Set α)) : #(⋃₀ A) ≤ #A * ⨆ s : A, #s
Full source
theorem mk_sUnion_le {α : Type u} (A : Set (Set α)) : #(⋃₀ A)#A * ⨆ s : A, #s := by
  rw [sUnion_eq_iUnion]
  apply mk_iUnion_le
Cardinality Bound for Union of a Set of Sets
Informal description
For any type $\alpha$ and any collection of sets $A$ in $\alpha$, the cardinality of the union $\bigcup_{s \in A} s$ is bounded by the product of the cardinality of $A$ and the supremum of the cardinalities of the sets in $A$. In symbols: $$\#\left(\bigcup_{s \in A} s\right) \leq \#A \cdot \sup_{s \in A} \#s$$
Cardinal.mk_biUnion_le theorem
{ι α : Type u} (A : ι → Set α) (s : Set ι) : #(⋃ x ∈ s, A x) ≤ #s * ⨆ x : s, #(A x.1)
Full source
theorem mk_biUnion_le {ι α : Type u} (A : ι → Set α) (s : Set ι) :
    #(⋃ x ∈ s, A x)#s * ⨆ x : s, #(A x.1) := by
  rw [biUnion_eq_iUnion]
  apply mk_iUnion_le
Cardinality Bound for Bounded Union of Sets
Informal description
For any types $\iota$ and $\alpha$, given a family of sets $A : \iota \to \text{Set } \alpha$ and a subset $s \subseteq \iota$, the cardinality of the bounded union $\bigcup_{x \in s} A(x)$ is bounded by the product of the cardinality of $s$ and the supremum of the cardinalities of the sets $A(x)$ for $x \in s$. In symbols: $$\#\left(\bigcup_{x \in s} A(x)\right) \leq \#s \cdot \sup_{x \in s} \#(A(x))$$
Cardinal.mk_biUnion_le_lift theorem
{α : Type u} {ι : Type v} (A : ι → Set α) (s : Set ι) : lift.{v} #(⋃ x ∈ s, A x) ≤ lift.{u} #s * ⨆ x : s, lift.{v} #(A x.1)
Full source
theorem mk_biUnion_le_lift {α : Type u} {ι : Type v} (A : ι → Set α) (s : Set ι) :
    lift.{v} #(⋃ x ∈ s, A x)lift.{u} #s * ⨆ x : s, lift.{v} #(A x.1) := by
  rw [biUnion_eq_iUnion]
  apply mk_iUnion_le_lift
Cardinality Bound for Bounded Union of Sets (Lifted Version)
Informal description
For any family of sets $\{A_i\}_{i \in \iota}$ indexed by a type $\iota$ over a type $\alpha$, and any subset $s \subseteq \iota$, the cardinality of the bounded union $\bigcup_{x \in s} A_x$ (lifted to an appropriate universe) is bounded by the product of the cardinality of $s$ (lifted to an appropriate universe) and the supremum of the cardinalities of the sets $A_x$ for $x \in s$ (lifted to an appropriate universe). In symbols: $$\#\left(\bigcup_{x \in s} A_x\right) \leq \#s \cdot \sup_{x \in s} \#(A_x)$$ where all cardinalities are considered in their appropriate lifted universes.
Cardinal.finset_card_lt_aleph0 theorem
(s : Finset α) : #(↑s : Set α) < ℵ₀
Full source
theorem finset_card_lt_aleph0 (s : Finset α) : #(↑s : Set α) < ℵ₀ :=
  lt_aleph0_of_finite _
Finite Sets Have Cardinality Below $\aleph_0$
Informal description
For any finite set $s$ of type $\alpha$ (represented as a `Finset`), the cardinality of the underlying set of $s$ is strictly less than $\aleph_0$, i.e., $\#s < \aleph_0$.
Cardinal.mk_set_eq_nat_iff_finset theorem
{α} {s : Set α} {n : ℕ} : #s = n ↔ ∃ t : Finset α, (t : Set α) = s ∧ t.card = n
Full source
theorem mk_set_eq_nat_iff_finset {α} {s : Set α} {n : } :
    #s#s = n ↔ ∃ t : Finset α, (t : Set α) = s ∧ t.card = n := by
  constructor
  · intro h
    lift s to Finset α using lt_aleph0_iff_set_finite.1 (h.symmnat_lt_aleph0 n)
    simpa using h
  · rintro ⟨t, rfl, rfl⟩
    exact mk_coe_finset
Cardinality of Set Equals Natural Number if and only if Set is Finite and Has Given Cardinality
Informal description
For any set $s$ over a type $\alpha$ and any natural number $n$, the cardinality of $s$ equals $n$ if and only if there exists a finset $t$ such that the underlying set of $t$ is equal to $s$ and the cardinality of $t$ is $n$.
Cardinal.mk_eq_nat_iff_finset theorem
{n : ℕ} : #α = n ↔ ∃ t : Finset α, (t : Set α) = univ ∧ t.card = n
Full source
theorem mk_eq_nat_iff_finset {n : } :
    #α = n ↔ ∃ t : Finset α, (t : Set α) = univ ∧ t.card = n := by
  rw [← mk_univ, mk_set_eq_nat_iff_finset]
Cardinality of Type Equals Natural Number if and only if Type is Finite with Given Cardinality
Informal description
For any type $\alpha$ and natural number $n$, the cardinality of $\alpha$ equals $n$ if and only if there exists a finite set $t$ (represented as a `Finset`) such that the underlying set of $t$ is the universal set of $\alpha$ and the cardinality of $t$ is $n$. In other words, $\#\alpha = n \leftrightarrow \exists t \subseteq \alpha \text{ finite}, t = \text{univ } \alpha \land |t| = n$.
Cardinal.mk_eq_nat_iff_fintype theorem
{n : ℕ} : #α = n ↔ ∃ h : Fintype α, @Fintype.card α h = n
Full source
theorem mk_eq_nat_iff_fintype {n : } : #α = n ↔ ∃ h : Fintype α, @Fintype.card α h = n := by
  rw [mk_eq_nat_iff_finset]
  constructor
  · rintro ⟨t, ht, hn⟩
    exact ⟨⟨t, eq_univ_iff_forall.1 ht⟩, hn⟩
  · rintro ⟨⟨t, ht⟩, hn⟩
    exact ⟨t, eq_univ_iff_forall.2 ht, hn⟩
Finite Type Cardinality Characterization: $\#\alpha = n \leftrightarrow \alpha$ is finite with $n$ elements
Informal description
For any type $\alpha$ and natural number $n$, the cardinality of $\alpha$ equals $n$ if and only if $\alpha$ is finite and has exactly $n$ elements. In other words, $\#\alpha = n \leftrightarrow \alpha$ is a finite type with cardinality $n$.
Cardinal.mk_union_add_mk_inter theorem
{α : Type u} {S T : Set α} : #(S ∪ T : Set α) + #(S ∩ T : Set α) = #S + #T
Full source
theorem mk_union_add_mk_inter {α : Type u} {S T : Set α} :
    #(S ∪ T : Set α) + #(S ∩ T : Set α) = #S + #T := by
  classical
  exact Quot.sound ⟨Equiv.Set.unionSumInter S T⟩
Cardinality Identity for Union and Intersection: $|S \cup T| + |S \cap T| = |S| + |T|$
Informal description
For any type $\alpha$ and any two sets $S, T \subseteq \alpha$, the sum of the cardinalities of their union and intersection equals the sum of their individual cardinalities, i.e., $$|S \cup T| + |S \cap T| = |S| + |T|.$$
Cardinal.mk_union_le theorem
{α : Type u} (S T : Set α) : #(S ∪ T : Set α) ≤ #S + #T
Full source
/-- The cardinality of a union is at most the sum of the cardinalities
of the two sets. -/
theorem mk_union_le {α : Type u} (S T : Set α) : #(S ∪ T : Set α)#S + #T :=
  @mk_union_add_mk_inter α S T ▸ self_le_add_right #(S ∪ T : Set α) #(S ∩ T : Set α)
Union Cardinality Bound: $|S \cup T| \leq |S| + |T|$
Informal description
For any type $\alpha$ and any two sets $S, T \subseteq \alpha$, the cardinality of their union is at most the sum of their individual cardinalities, i.e., $$|S \cup T| \leq |S| + |T|.$$
Cardinal.mk_union_of_disjoint theorem
{α : Type u} {S T : Set α} (H : Disjoint S T) : #(S ∪ T : Set α) = #S + #T
Full source
theorem mk_union_of_disjoint {α : Type u} {S T : Set α} (H : Disjoint S T) :
    #(S ∪ T : Set α) = #S + #T := by
  classical
  exact Quot.sound ⟨Equiv.Set.union H⟩
Cardinality of Union of Disjoint Sets: $|S \cup T| = |S| + |T|$
Informal description
For any type $\alpha$ and any two disjoint sets $S, T \subseteq \alpha$, the cardinality of their union equals the sum of their individual cardinalities, i.e., $$|S \cup T| = |S| + |T|.$$
Cardinal.mk_insert theorem
{α : Type u} {s : Set α} {a : α} (h : a ∉ s) : #(insert a s : Set α) = #s + 1
Full source
theorem mk_insert {α : Type u} {s : Set α} {a : α} (h : a ∉ s) :
    #(insert a s : Set α) = #s + 1 := by
  rw [← union_singleton, mk_union_of_disjoint, mk_singleton]
  simpa
Cardinality of Insertion: $|s \cup \{a\}| = |s| + 1$ when $a \notin s$
Informal description
For any type $\alpha$, set $s \subseteq \alpha$, and element $a \in \alpha$ such that $a \notin s$, the cardinality of the set obtained by inserting $a$ into $s$ equals the cardinality of $s$ plus one, i.e., $$|\{a\} \cup s| = |s| + 1.$$
Cardinal.mk_insert_le theorem
{α : Type u} {s : Set α} {a : α} : #(insert a s : Set α) ≤ #s + 1
Full source
theorem mk_insert_le {α : Type u} {s : Set α} {a : α} : #(insert a s : Set α)#s + 1 := by
  by_cases h : a ∈ s
  · simp only [insert_eq_of_mem h, self_le_add_right]
  · rw [mk_insert h]
Upper Bound on Cardinality of Inserted Set: $|s \cup \{a\}| \leq |s| + 1$
Informal description
For any type $\alpha$, set $s \subseteq \alpha$, and element $a \in \alpha$, the cardinality of the set obtained by inserting $a$ into $s$ is less than or equal to the cardinality of $s$ plus one, i.e., $$|\{a\} \cup s| \leq |s| + 1.$$
Cardinal.mk_sum_compl theorem
{α} (s : Set α) : #s + #(sᶜ : Set α) = #α
Full source
theorem mk_sum_compl {α} (s : Set α) : #s + #(sᶜ : Set α) =  := by
  classical
  exact mk_congr (Equiv.Set.sumCompl s)
Cardinality Sum of Set and Complement: $\#s + \#s^c = \#\alpha$
Informal description
For any type $\alpha$ and subset $s \subseteq \alpha$, the sum of the cardinalities of $s$ and its complement $s^c$ equals the cardinality of $\alpha$, i.e., $\#s + \#s^c = \#\alpha$.
Cardinal.mk_le_mk_of_subset theorem
{α} {s t : Set α} (h : s ⊆ t) : #s ≤ #t
Full source
theorem mk_le_mk_of_subset {α} {s t : Set α} (h : s ⊆ t) : #s#t :=
  ⟨Set.embeddingOfSubset s t h⟩
Monotonicity of Cardinality under Subset Inclusion
Informal description
For any type $\alpha$ and subsets $s, t \subseteq \alpha$, if $s$ is a subset of $t$ (i.e., $s \subseteq t$), then the cardinality of $s$ is less than or equal to the cardinality of $t$, i.e., $\#s \leq \#t$.
Cardinal.mk_le_iff_forall_finset_subset_card_le theorem
{α : Type u} {n : ℕ} {t : Set α} : #t ≤ n ↔ ∀ s : Finset α, (s : Set α) ⊆ t → s.card ≤ n
Full source
theorem mk_le_iff_forall_finset_subset_card_le {α : Type u} {n : } {t : Set α} :
    #t#t ≤ n ↔ ∀ s : Finset α, (s : Set α) ⊆ t → s.card ≤ n := by
  refine ⟨fun H s hs ↦ by simpa using (mk_le_mk_of_subset hs).trans H, fun H ↦ ?_⟩
  apply card_le_of (fun s ↦ ?_)
  classical
  let u : Finset α := s.image Subtype.val
  have : u.card = s.card := Finset.card_image_of_injOn Subtype.coe_injective.injOn
  rw [← this]
  apply H
  simp only [u, Finset.coe_image, image_subset_iff, Subtype.coe_preimage_self, subset_univ]
Cardinality Bound via Finite Subsets: $\#t \leq n \leftrightarrow \forall s \subseteq_{\text{fin}} t, |s| \leq n$
Informal description
For any type $\alpha$, natural number $n$, and subset $t \subseteq \alpha$, the cardinality of $t$ is at most $n$ if and only if every finite subset $s \subseteq t$ has cardinality at most $n$.
Cardinal.mk_subtype_mono theorem
{p q : α → Prop} (h : ∀ x, p x → q x) : #{ x // p x } ≤ #{ x // q x }
Full source
theorem mk_subtype_mono {p q : α → Prop} (h : ∀ x, p x → q x) :
    #{ x // p x }#{ x // q x } :=
  ⟨embeddingOfSubset _ _ h⟩
Monotonicity of Cardinality under Subtype Inclusion
Informal description
For any type $\alpha$ and predicates $p, q : \alpha \to \mathrm{Prop}$ such that for all $x \in \alpha$, $p(x)$ implies $q(x)$, the cardinality of the subtype $\{x \in \alpha \mid p(x)\}$ is less than or equal to the cardinality of the subtype $\{x \in \alpha \mid q(x)\}$.
Cardinal.le_mk_diff_add_mk theorem
(S T : Set α) : #S ≤ #(S \ T : Set α) + #T
Full source
theorem le_mk_diff_add_mk (S T : Set α) : #S#(S \ T : Set α) + #T :=
  (mk_le_mk_of_subset <| subset_diff_union _ _).trans <| mk_union_le _ _
Cardinality Bound via Set Difference and Union: $|S| \leq |S \setminus T| + |T|$
Informal description
For any type $\alpha$ and sets $S, T \subseteq \alpha$, the cardinality of $S$ is at most the sum of the cardinalities of the set difference $S \setminus T$ and the set $T$, i.e., $$|S| \leq |S \setminus T| + |T|.$$
Cardinal.mk_diff_add_mk theorem
{S T : Set α} (h : T ⊆ S) : #(S \ T : Set α) + #T = #S
Full source
theorem mk_diff_add_mk {S T : Set α} (h : T ⊆ S) : #(S \ T : Set α) + #T = #S := by
  refine (mk_union_of_disjoint <| ?_).symm.trans <| by rw [diff_union_of_subset h]
  exact disjoint_sdiff_self_left
Cardinality Decomposition via Set Difference: $|S \setminus T| + |T| = |S|$ when $T \subseteq S$
Informal description
For any type $\alpha$ and any sets $S, T \subseteq \alpha$ such that $T \subseteq S$, the sum of the cardinalities of the set difference $S \setminus T$ and the set $T$ equals the cardinality of $S$, i.e., $$|S \setminus T| + |T| = |S|.$$
Cardinal.mk_union_le_aleph0 theorem
{α} {P Q : Set α} : #(P ∪ Q : Set α) ≤ ℵ₀ ↔ #P ≤ ℵ₀ ∧ #Q ≤ ℵ₀
Full source
theorem mk_union_le_aleph0 {α} {P Q : Set α} :
    #(P ∪ Q : Set α)#(P ∪ Q : Set α) ≤ ℵ₀ ↔ #P ≤ ℵ₀ ∧ #Q ≤ ℵ₀ := by
  simp only [le_aleph0_iff_subtype_countable, mem_union, setOf_mem_eq, Set.union_def,
    ← countable_union]
Union of Sets is Countable if and only if Both Sets are Countable
Informal description
For any type $\alpha$ and sets $P, Q \subseteq \alpha$, the union $P \cup Q$ has cardinality at most $\aleph_0$ if and only if both $P$ and $Q$ individually have cardinality at most $\aleph_0$.
Cardinal.mk_sep theorem
(s : Set α) (t : α → Prop) : #({x ∈ s | t x} : Set α) = #{x : s | t x.1}
Full source
theorem mk_sep (s : Set α) (t : α → Prop) : #({ x ∈ s | t x } : Set α) = #{ x : s | t x.1 } :=
  mk_congr (Equiv.Set.sep s t)
Cardinality of Separated Set Equals Cardinality of Subtype
Informal description
For any set $s$ over a type $\alpha$ and any predicate $t$ on $\alpha$, the cardinality of the separated set $\{x \in s \mid t(x)\}$ is equal to the cardinality of the subtype $\{x : s \mid t(x.1)\}$ of elements of $s$ satisfying $t$.
Cardinal.mk_preimage_of_injective_lift theorem
{α : Type u} {β : Type v} (f : α → β) (s : Set β) (h : Injective f) : lift.{v} #(f ⁻¹' s) ≤ lift.{u} #s
Full source
theorem mk_preimage_of_injective_lift {α : Type u} {β : Type v} (f : α → β) (s : Set β)
    (h : Injective f) : lift.{v} #(f ⁻¹' s)lift.{u} #s := by
  rw [lift_mk_le.{0}]
  -- Porting note: Needed to insert `mem_preimage.mp` below
  use Subtype.coind (fun x => f x.1) fun x => mem_preimage.mp x.2
  apply Subtype.coind_injective; exact h.comp Subtype.val_injective
Lifted Cardinality Inequality for Preimages under Injective Functions
Informal description
Let $f \colon \alpha \to \beta$ be an injective function and $s \subseteq \beta$ a subset. Then the cardinality of the preimage $f^{-1}(s)$, lifted to a higher universe, is less than or equal to the cardinality of $s$, also lifted to a higher universe. In symbols: $$\mathrm{lift}(\#f^{-1}(s)) \leq \mathrm{lift}(\#s)$$
Cardinal.mk_preimage_of_subset_range_lift theorem
{α : Type u} {β : Type v} (f : α → β) (s : Set β) (h : s ⊆ range f) : lift.{u} #s ≤ lift.{v} #(f ⁻¹' s)
Full source
theorem mk_preimage_of_subset_range_lift {α : Type u} {β : Type v} (f : α → β) (s : Set β)
    (h : s ⊆ range f) : lift.{u} #slift.{v} #(f ⁻¹' s) := by
  rw [← image_preimage_eq_iff] at h
  nth_rewrite 1 [← h]
  apply mk_image_le_lift
Lifted Cardinality Comparison for Preimages of Subsets in Range: $\mathrm{lift}(\#s) \leq \mathrm{lift}(\#f^{-1}(s))$
Informal description
For any function $f \colon \alpha \to \beta$ and any subset $s \subseteq \beta$ that is contained in the range of $f$, the cardinality of $s$ lifted to universe $\max(u,v)$ is less than or equal to the cardinality of the preimage $f^{-1}(s)$ lifted to the same universe. In symbols: $$\mathrm{lift}(\#s) \leq \mathrm{lift}(\#f^{-1}(s))$$
Cardinal.mk_preimage_of_injective_of_subset_range_lift theorem
{β : Type v} (f : α → β) (s : Set β) (h : Injective f) (h2 : s ⊆ range f) : lift.{v} #(f ⁻¹' s) = lift.{u} #s
Full source
theorem mk_preimage_of_injective_of_subset_range_lift {β : Type v} (f : α → β) (s : Set β)
    (h : Injective f) (h2 : s ⊆ range f) : lift.{v} #(f ⁻¹' s) = lift.{u} #s :=
  le_antisymm (mk_preimage_of_injective_lift f s h) (mk_preimage_of_subset_range_lift f s h2)
Lifted Cardinality Equality for Preimages under Injective Functions with Range Condition
Informal description
Let $f \colon \alpha \to \beta$ be an injective function and $s \subseteq \beta$ a subset contained in the range of $f$. Then the cardinality of the preimage $f^{-1}(s)$, lifted to a higher universe, is equal to the cardinality of $s$, also lifted to a higher universe. In symbols: $$\mathrm{lift}(\#f^{-1}(s)) = \mathrm{lift}(\#s)$$
Cardinal.mk_preimage_of_injective_of_subset_range theorem
(f : α → β) (s : Set β) (h : Injective f) (h2 : s ⊆ range f) : #(f ⁻¹' s) = #s
Full source
theorem mk_preimage_of_injective_of_subset_range (f : α → β) (s : Set β) (h : Injective f)
    (h2 : s ⊆ range f) : #(f ⁻¹' s) = #s := by
  convert mk_preimage_of_injective_of_subset_range_lift.{u, u} f s h h2 using 1 <;> rw [lift_id]
Cardinality Equality for Preimages under Injective Functions with Range Condition
Informal description
Let $f \colon \alpha \to \beta$ be an injective function and $s \subseteq \beta$ a subset contained in the range of $f$. Then the cardinality of the preimage $f^{-1}(s)$ equals the cardinality of $s$, i.e., $$\#f^{-1}(s) = \#s.$$
Cardinal.mk_preimage_equiv_lift theorem
{β : Type v} (f : α ≃ β) (s : Set β) : lift.{v} #(f ⁻¹' s) = lift.{u} #s
Full source
@[simp]
theorem mk_preimage_equiv_lift {β : Type v} (f : α ≃ β) (s : Set β) :
    lift.{v} #(f ⁻¹' s) = lift.{u} #s := by
  apply mk_preimage_of_injective_of_subset_range_lift _ _ f.injective
  rw [f.range_eq_univ]
  exact fun _ _ ↦ ⟨⟩
Lifted Cardinality Preservation under Equivalence Preimages
Informal description
For any equivalence $f \colon \alpha \simeq \beta$ between types $\alpha$ and $\beta$, and any subset $s \subseteq \beta$, the cardinality of the preimage $f^{-1}(s)$, when lifted to a higher universe, is equal to the cardinality of $s$, also lifted to a higher universe. In symbols: $$\mathrm{lift}(\#f^{-1}(s)) = \mathrm{lift}(\#s)$$
Cardinal.mk_preimage_equiv theorem
(f : α ≃ β) (s : Set β) : #(f ⁻¹' s) = #s
Full source
@[simp]
theorem mk_preimage_equiv (f : α ≃ β) (s : Set β) : #(f ⁻¹' s) = #s := by
  simpa using mk_preimage_equiv_lift f s
Cardinality Preservation under Bijective Preimages: $\#f^{-1}(s) = \#s$
Informal description
For any bijection $f \colon \alpha \simeq \beta$ between types $\alpha$ and $\beta$, and any subset $s \subseteq \beta$, the cardinality of the preimage $f^{-1}(s)$ equals the cardinality of $s$, i.e., $$\#f^{-1}(s) = \#s.$$
Cardinal.mk_preimage_of_injective theorem
(f : α → β) (s : Set β) (h : Injective f) : #(f ⁻¹' s) ≤ #s
Full source
theorem mk_preimage_of_injective (f : α → β) (s : Set β) (h : Injective f) :
    #(f ⁻¹' s)#s := by
  rw [← lift_id #(↑(f ⁻¹' s)), ← lift_id #(↑s)]
  exact mk_preimage_of_injective_lift f s h
Cardinality Inequality for Preimages under Injective Functions
Informal description
For any injective function $f \colon \alpha \to \beta$ and any subset $s \subseteq \beta$, the cardinality of the preimage $f^{-1}(s)$ is less than or equal to the cardinality of $s$, i.e., $\#f^{-1}(s) \leq \#s$.
Cardinal.mk_preimage_of_subset_range theorem
(f : α → β) (s : Set β) (h : s ⊆ range f) : #s ≤ #(f ⁻¹' s)
Full source
theorem mk_preimage_of_subset_range (f : α → β) (s : Set β) (h : s ⊆ range f) :
    #s#(f ⁻¹' s) := by
  rw [← lift_id #(↑(f ⁻¹' s)), ← lift_id #(↑s)]
  exact mk_preimage_of_subset_range_lift f s h
Cardinality Comparison for Preimages of Subsets in Range: $\#s \leq \#f^{-1}(s)$
Informal description
For any function $f \colon \alpha \to \beta$ and any subset $s \subseteq \beta$ contained in the range of $f$, the cardinality of $s$ is less than or equal to the cardinality of its preimage under $f$, i.e., $\#s \leq \#f^{-1}(s)$.
Cardinal.mk_subset_ge_of_subset_image_lift theorem
{α : Type u} {β : Type v} (f : α → β) {s : Set α} {t : Set β} (h : t ⊆ f '' s) : lift.{u} #t ≤ lift.{v} #({x ∈ s | f x ∈ t} : Set α)
Full source
theorem mk_subset_ge_of_subset_image_lift {α : Type u} {β : Type v} (f : α → β) {s : Set α}
    {t : Set β} (h : t ⊆ f '' s) : lift.{u} #tlift.{v} #({ x ∈ s | f x ∈ t } : Set α) := by
  rw [image_eq_range] at h
  convert mk_preimage_of_subset_range_lift _ _ h using 1
  rw [mk_sep]
  rfl
Lifted Cardinality Comparison for Subsets of Images: $\mathrm{lift}(\#t) \leq \mathrm{lift}(\#\{x \in s \mid f(x) \in t\})$
Informal description
For any function $f \colon \alpha \to \beta$ between types $\alpha$ and $\beta$, and any subsets $s \subseteq \alpha$ and $t \subseteq \beta$ such that $t$ is contained in the image $f(s)$, the cardinality of $t$ lifted to universe $\max(u,v)$ is less than or equal to the cardinality of the subset $\{x \in s \mid f(x) \in t\}$ lifted to the same universe. In symbols: $$\mathrm{lift}(\#t) \leq \mathrm{lift}(\#\{x \in s \mid f(x) \in t\})$$
Cardinal.mk_subset_ge_of_subset_image theorem
(f : α → β) {s : Set α} {t : Set β} (h : t ⊆ f '' s) : #t ≤ #({x ∈ s | f x ∈ t} : Set α)
Full source
theorem mk_subset_ge_of_subset_image (f : α → β) {s : Set α} {t : Set β} (h : t ⊆ f '' s) :
    #t#({ x ∈ s | f x ∈ t } : Set α) := by
  rw [image_eq_range] at h
  convert mk_preimage_of_subset_range _ _ h using 1
  rw [mk_sep]
  rfl
Cardinality Comparison for Subsets of Images: $\#t \leq \#\{x \in s \mid f(x) \in t\}$
Informal description
For any function $f \colon \alpha \to \beta$ between types $\alpha$ and $\beta$, and any subsets $s \subseteq \alpha$ and $t \subseteq \beta$ such that $t$ is contained in the image $f(s)$, the cardinality of $t$ is less than or equal to the cardinality of the subset $\{x \in s \mid f(x) \in t\}$. In symbols: $$\#t \leq \#\{x \in s \mid f(x) \in t\}$$
Cardinal.le_mk_iff_exists_subset theorem
{c : Cardinal} {α : Type u} {s : Set α} : c ≤ #s ↔ ∃ p : Set α, p ⊆ s ∧ #p = c
Full source
theorem le_mk_iff_exists_subset {c : Cardinal} {α : Type u} {s : Set α} :
    c ≤ #s ↔ ∃ p : Set α, p ⊆ s ∧ #p = c := by
  rw [le_mk_iff_exists_set, ← Subtype.exists_set_subtype]
  apply exists_congr; intro t; rw [mk_image_eq]; apply Subtype.val_injective
Cardinality Comparison via Subsets: $c \leq \#s \leftrightarrow \exists p \subseteq s, \#p = c$
Informal description
For any cardinal number $c$ and any set $s$ of type $\alpha$, the inequality $c \leq \#s$ holds if and only if there exists a subset $p \subseteq s$ such that the cardinality of $p$ equals $c$.
Cardinal.mk_range_inl theorem
{α : Type u} {β : Type v} : #(range (@Sum.inl α β)) = lift.{v} #α
Full source
@[simp]
theorem mk_range_inl {α : Type u} {β : Type v} : #(range (@Sum.inl α β)) = lift.{v}  := by
  rw [← lift_id'.{u, v} #_, (Equiv.Set.rangeInl α β).lift_cardinal_eq, lift_umaxlift_umax.{u, v}]
Cardinality of Range of Left Inclusion Equals Lifted Cardinality of Left Type
Informal description
For any types $\alpha$ (in universe $u$) and $\beta$ (in universe $v$), the cardinality of the range of the left inclusion map $\text{Sum.inl} : \alpha \to \alpha \oplus \beta$ is equal to the lift of the cardinality of $\alpha$ to universe $v$, i.e., $\#(\text{range}(\text{Sum.inl})) = \text{lift}_v(\#\alpha)$.
Cardinal.mk_range_inr theorem
{α : Type u} {β : Type v} : #(range (@Sum.inr α β)) = lift.{u} #β
Full source
@[simp]
theorem mk_range_inr {α : Type u} {β : Type v} : #(range (@Sum.inr α β)) = lift.{u}  := by
  rw [← lift_id'.{v, u} #_, (Equiv.Set.rangeInr α β).lift_cardinal_eq, lift_umaxlift_umax.{v, u}]
Cardinality of Range of Right Inclusion Equals Lifted Cardinality of Codomain
Informal description
For any types $\alpha$ in universe $u$ and $\beta$ in universe $v$, the cardinality of the range of the right inclusion function $\text{Sum.inr} : \beta \to \alpha \oplus \beta$ is equal to the lift of the cardinality of $\beta$ to universe $u$, i.e., $\#(\text{range } \text{Sum.inr}) = \text{lift}_u(\#\beta)$.
Cardinal.two_le_iff theorem
: (2 : Cardinal) ≤ #α ↔ ∃ x y : α, x ≠ y
Full source
theorem two_le_iff : (2 : Cardinal) ≤ #α ↔ ∃ x y : α, x ≠ y := by
  rw [← Nat.cast_two, nat_succ, succ_le_iff, Nat.cast_one, one_lt_iff_nontrivial, nontrivial_iff]
Cardinality At Least Two Characterization: $\#\alpha \geq 2 \leftrightarrow \exists x \neq y$
Informal description
For any type $\alpha$, the cardinality of $\alpha$ is at least 2 if and only if there exist two distinct elements $x, y \in \alpha$ such that $x \neq y$.
Cardinal.two_le_iff' theorem
(x : α) : (2 : Cardinal) ≤ #α ↔ ∃ y : α, y ≠ x
Full source
theorem two_le_iff' (x : α) : (2 : Cardinal) ≤ #α ↔ ∃ y : α, y ≠ x := by
  rw [two_le_iff, ← nontrivial_iff, nontrivial_iff_exists_ne x]
Cardinality At Least Two Characterization via Distinct Element: $\#\alpha \geq 2 \leftrightarrow \exists y \neq x$
Informal description
For any type $\alpha$ and any element $x \in \alpha$, the cardinality of $\alpha$ is at least 2 if and only if there exists an element $y \in \alpha$ distinct from $x$.
Cardinal.mk_eq_two_iff theorem
: #α = 2 ↔ ∃ x y : α, x ≠ y ∧ ({ x, y } : Set α) = univ
Full source
theorem mk_eq_two_iff : #α = 2 ↔ ∃ x y : α, x ≠ y ∧ ({x, y} : Set α) = univ := by
  classical
  simp only [← @Nat.cast_two Cardinal, mk_eq_nat_iff_finset, Finset.card_eq_two]
  constructor
  · rintro ⟨t, ht, x, y, hne, rfl⟩
    exact ⟨x, y, hne, by simpa using ht⟩
  · rintro ⟨x, y, hne, h⟩
    exact ⟨{x, y}, by simpa using h, x, y, hne, rfl⟩
Cardinality Two Characterization: $\#\alpha = 2 \leftrightarrow \exists x \neq y, \{x, y\} = \text{univ}$
Informal description
For any type $\alpha$, the cardinality of $\alpha$ is equal to 2 if and only if there exist two distinct elements $x, y \in \alpha$ such that the set $\{x, y\}$ is equal to the universal set on $\alpha$.
Cardinal.mk_eq_two_iff' theorem
(x : α) : #α = 2 ↔ ∃! y, y ≠ x
Full source
theorem mk_eq_two_iff' (x : α) : #α = 2 ↔ ∃! y, y ≠ x := by
  rw [mk_eq_two_iff]; constructor
  · rintro ⟨a, b, hne, h⟩
    simp only [eq_univ_iff_forall, mem_insert_iff, mem_singleton_iff] at h
    rcases h x with (rfl | rfl)
    exacts [⟨b, hne.symm, fun z => (h z).resolve_left⟩, ⟨a, hne, fun z => (h z).resolve_right⟩]
  · rintro ⟨y, hne, hy⟩
    exact ⟨x, y, hne.symm, eq_univ_of_forall fun z => or_iff_not_imp_left.2 (hy z)⟩
Characterization of Cardinality Two via Unique Distinct Element: $\#\alpha = 2 \leftrightarrow \exists! y \neq x$
Informal description
For any type $\alpha$ and any element $x \in \alpha$, the cardinality of $\alpha$ is equal to 2 if and only if there exists a unique element $y \in \alpha$ such that $y \neq x$.
Cardinal.exists_not_mem_of_length_lt theorem
{α : Type*} (l : List α) (h : ↑l.length < #α) : ∃ z : α, z ∉ l
Full source
theorem exists_not_mem_of_length_lt {α : Type*} (l : List α) (h : ↑l.length < ) :
    ∃ z : α, z ∉ l := by
  classical
  contrapose! h
  calc
     = #(Set.univ : Set α) := mk_univ.symm
    _ ≤ #l.toFinset := mk_le_mk_of_subset fun x _ => List.mem_toFinset.mpr (h x)
    _ = l.toFinset.card := Cardinal.mk_coe_finset
    _ ≤ l.length := Nat.cast_le.mpr (List.toFinset_card_le l)
Existence of Element Outside List When Cardinality Exceeds Length
Informal description
For any type $\alpha$ and any list $l$ of elements of $\alpha$, if the length of $l$ (as a cardinal number) is strictly less than the cardinality of $\alpha$, then there exists an element $z \in \alpha$ that is not in the list $l$.
Cardinal.three_le theorem
{α : Type*} (h : 3 ≤ #α) (x : α) (y : α) : ∃ z : α, z ≠ x ∧ z ≠ y
Full source
theorem three_le {α : Type*} (h : 3 ≤ ) (x : α) (y : α) : ∃ z : α, z ≠ x ∧ z ≠ y := by
  have : ↑(3 : ) ≤  := by simpa using h
  have : ↑(2 : ) <  := by rwa [← succ_le_iff, ← Cardinal.nat_succ]
  have := exists_not_mem_of_length_lt [x, y] this
  simpa [not_or] using this
Existence of Third Distinct Element in Types with Cardinality ≥ 3
Informal description
For any type $\alpha$ with cardinality at least 3, and for any two distinct elements $x, y \in \alpha$, there exists a third element $z \in \alpha$ distinct from both $x$ and $y$.
Cardinal.term_^<_ definition
: Lean.TrailingParserDescr✝
Full source
@[inherit_doc]
infixl:80 " ^< " => powerlt
Cardinal power operation for cardinals less than b
Informal description
The notation `a ^< b` represents the cardinal power operation `powerlt a b`, defined as the supremum of `a ^ c` for all cardinals `c < b`.
Cardinal.le_powerlt theorem
{b c : Cardinal.{u}} (a) (h : c < b) : (a ^ c) ≤ a ^< b
Full source
theorem le_powerlt {b c : CardinalCardinal.{u}} (a) (h : c < b) : (a^c) ≤ a ^< b := by
  refine le_ciSup (f := fun y : Iio b => a ^ (y : Cardinal)) ?_ ⟨c, h⟩
  rw [← image_eq_range]
  exact bddAbove_image.{u, u} _ bddAbove_Iio
Inequality for Cardinal Exponentiation: $a^c \leq a^{
Informal description
For any cardinal numbers $a$, $b$, and $c$ in the same universe, if $c < b$, then the cardinal exponentiation $a^c$ is less than or equal to the supremum of $a^x$ for all $x < b$, denoted as $a^{
Cardinal.powerlt_le_powerlt_left theorem
{a b c : Cardinal} (h : b ≤ c) : a ^< b ≤ a ^< c
Full source
theorem powerlt_le_powerlt_left {a b c : Cardinal} (h : b ≤ c) : a ^< ba ^< c :=
  powerlt_le.2 fun _ hx => le_powerlt a <| hx.trans_le h
Monotonicity of $a^{
Informal description
For any cardinal numbers $a$, $b$, and $c$, if $b \leq c$, then the supremum of $a^x$ for all $x < b$ is less than or equal to the supremum of $a^x$ for all $x < c$. In other words, $a^{
Cardinal.powerlt_mono_left theorem
(a) : Monotone fun c => a ^< c
Full source
theorem powerlt_mono_left (a) : Monotone fun c => a ^< c := fun _ _ => powerlt_le_powerlt_left
Monotonicity of $a^{
Informal description
For any cardinal number $a$, the function $c \mapsto a^{
Cardinal.powerlt_succ theorem
{a b : Cardinal} (h : a ≠ 0) : a ^< succ b = a ^ b
Full source
theorem powerlt_succ {a b : Cardinal} (h : a ≠ 0) : a ^< succ b = a ^ b :=
  (powerlt_le.2 fun _ h' => power_le_power_left h <| le_of_lt_succ h').antisymm <|
    le_powerlt a (lt_succ b)
Supremum of $a^c$ for $c < \text{succ}(b)$ equals $a^b$ for nonzero $a$
Informal description
For any nonzero cardinal number $a$ and any cardinal number $b$, the supremum of $a^c$ for all $c < \text{succ}(b)$ equals $a^b$, i.e., $a^{<\text{succ}(b)} = a^b$.
Cardinal.powerlt_min theorem
{a b c : Cardinal} : a ^< min b c = min (a ^< b) (a ^< c)
Full source
theorem powerlt_min {a b c : Cardinal} : a ^< min b c = min (a ^< b) (a ^< c) :=
  (powerlt_mono_left a).map_min
Minimum Preservation of Cardinal Exponentiation: $a^{<\min(b,c)} = \min(a^{
Informal description
For any cardinal numbers $a$, $b$, and $c$, the operation $a^{<\min(b,c)}$ equals the minimum of $a^{
Cardinal.powerlt_max theorem
{a b c : Cardinal} : a ^< max b c = max (a ^< b) (a ^< c)
Full source
theorem powerlt_max {a b c : Cardinal} : a ^< max b c = max (a ^< b) (a ^< c) :=
  (powerlt_mono_left a).map_max
Maximality of Cardinal Exponentiation: $a^{<\max(b,c)} = \max(a^{
Informal description
For any cardinal numbers $a$, $b$, and $c$, the operation $a^{<\max(b,c)}$ equals the maximum of $a^{