Skip to content
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions Mathlib/SetTheory/Cardinal/Arithmetic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -664,19 +664,31 @@ theorem mk_list_eq_mk (α : Type u) [Infinite α] : #(List α) = #α :=
theorem mk_list_eq_aleph0 (α : Type u) [Countable α] [Nonempty α] : #(List α) = ℵ₀ :=
mk_le_aleph0.antisymm (aleph0_le_mk _)

theorem mk_list_eq_max_mk_aleph0 (α : Type u) [Nonempty α] : #(List α) = max #α ℵ₀ := by
theorem mk_list_eq_max (α : Type u) [Nonempty α] : #(List α) = max ℵ₀ #α := by
cases finite_or_infinite α
· rw [mk_list_eq_aleph0, eq_comm, max_eq_right]
· rw [mk_list_eq_aleph0, eq_comm, max_eq_left]
exact mk_le_aleph0
· rw [mk_list_eq_mk, eq_comm, max_eq_left]
· rw [mk_list_eq_mk, eq_comm, max_eq_right]
exact aleph0_le_mk α

-- TODO: standardize whether we write `max ℵ₀ x` or `max x ℵ₀`.
theorem mk_list_eq_max_mk_aleph0 (α : Type u) [Nonempty α] : #(List α) = max #α ℵ₀ := by
rw [mk_list_eq_max, max_comm]

theorem sum_pow_eq_max_aleph0 {x : Cardinal} (h : x ≠ 0) : sum (fun n ↦ x ^ n) = max ℵ₀ x := by
have := nonempty_out h
conv_lhs => rw [← x.mk_out, ← mk_list_eq_sum_pow, mk_list_eq_max, mk_out]

theorem mk_list_le_max (α : Type u) : #(List α) ≤ max ℵ₀ #α := by
cases finite_or_infinite α
· exact mk_le_aleph0.trans (le_max_left _ _)
· rw [mk_list_eq_mk]
apply le_max_right

theorem sum_pow_le_max_aleph0 (x : Cardinal) : sum (fun n ↦ x ^ n) ≤ max ℵ₀ x := by
rw [← x.mk_out, ← mk_list_eq_sum_pow]
exact mk_list_le_max _

@[simp]
theorem mk_finset_of_infinite (α : Type u) [Infinite α] : #(Finset α) = #α := by
classical
Expand Down
7 changes: 5 additions & 2 deletions Mathlib/SetTheory/Cardinal/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -618,10 +618,13 @@ theorem mk_singleton {α : Type u} (x : α) : #({x} : Set α) = 1 :=
theorem mk_vector (α : Type u) (n : ℕ) : #(List.Vector α n) = #α ^ n :=
(mk_congr (Equiv.vectorEquivFin α n)).trans <| by simp

theorem mk_list_eq_sum_pow (α : Type u) : #(List α) = sum fun n : ℕ => #α ^ n :=
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
_ = sum fun n ↦ #α ^ n := by simp

theorem sum_pow_zero : sum (fun n ↦ (0 : Cardinal) ^ n) = 1 := by
Comment thread
vihdzp marked this conversation as resolved.
Outdated
rw [← mk_eq_zero (α := PEmpty), ← mk_list_eq_sum_pow, mk_eq_one]

theorem mk_quot_le {α : Type u} {r : α → α → Prop} : #(Quot r) ≤ #α :=
mk_le_of_surjective Quot.exists_rep
Expand Down
3 changes: 3 additions & 0 deletions Mathlib/SetTheory/Cardinal/Defs.lean
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,9 @@ theorem mk_ne_zero_iff {α : Type u} : #α ≠ 0 ↔ Nonempty α :=
theorem mk_ne_zero (α : Type u) [Nonempty α] : #α ≠ 0 :=
mk_ne_zero_iff.2 ‹_›

theorem nonempty_out {x : Cardinal} (h : x ≠ 0) : Nonempty x.out := by
rwa [← mk_ne_zero_iff, mk_out]

instance : One Cardinal.{u} :=
-- `PUnit` might be more canonical, but this is convenient for defeq with natCast
⟨lift #(Fin 1)⟩
Expand Down