Skip to content

Commit be8ff44

Browse files
committed
feat(SetTheory/Cardinal): formulas for sum (fun n : ℕ ↦ x ^ n) (#32645)
1 parent 062f71b commit be8ff44

File tree

3 files changed

+23
-5
lines changed

3 files changed

+23
-5
lines changed

Mathlib/SetTheory/Cardinal/Arithmetic.lean

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -664,19 +664,31 @@ theorem mk_list_eq_mk (α : Type u) [Infinite α] : #(List α) = #α :=
664664
theorem mk_list_eq_aleph0 (α : Type u) [Countable α] [Nonempty α] : #(List α) = ℵ₀ :=
665665
mk_le_aleph0.antisymm (aleph0_le_mk _)
666666

667-
theorem mk_list_eq_max_mk_aleph0 (α : Type u) [Nonempty α] : #(List α) = max #α ℵ₀ := by
667+
theorem mk_list_eq_max (α : Type u) [Nonempty α] : #(List α) = max ℵ₀ #α := by
668668
cases finite_or_infinite α
669-
· rw [mk_list_eq_aleph0, eq_comm, max_eq_right]
669+
· rw [mk_list_eq_aleph0, eq_comm, max_eq_left]
670670
exact mk_le_aleph0
671-
· rw [mk_list_eq_mk, eq_comm, max_eq_left]
671+
· rw [mk_list_eq_mk, eq_comm, max_eq_right]
672672
exact aleph0_le_mk α
673673

674+
-- TODO: standardize whether we write `max ℵ₀ x` or `max x ℵ₀`.
675+
theorem mk_list_eq_max_mk_aleph0 (α : Type u) [Nonempty α] : #(List α) = max #α ℵ₀ := by
676+
rw [mk_list_eq_max, max_comm]
677+
678+
theorem sum_pow_eq_max_aleph0 {x : Cardinal} (h : x ≠ 0) : sum (fun n ↦ x ^ n) = max ℵ₀ x := by
679+
have := nonempty_out h
680+
conv_lhs => rw [← x.mk_out, ← mk_list_eq_sum_pow, mk_list_eq_max, mk_out]
681+
674682
theorem mk_list_le_max (α : Type u) : #(List α) ≤ max ℵ₀ #α := by
675683
cases finite_or_infinite α
676684
· exact mk_le_aleph0.trans (le_max_left _ _)
677685
· rw [mk_list_eq_mk]
678686
apply le_max_right
679687

688+
theorem sum_pow_le_max_aleph0 (x : Cardinal) : sum (fun n ↦ x ^ n) ≤ max ℵ₀ x := by
689+
rw [← x.mk_out, ← mk_list_eq_sum_pow]
690+
exact mk_list_le_max _
691+
680692
@[simp]
681693
theorem mk_finset_of_infinite (α : Type u) [Infinite α] : #(Finset α) = #α := by
682694
classical

Mathlib/SetTheory/Cardinal/Basic.lean

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -615,10 +615,13 @@ theorem mk_singleton {α : Type u} (x : α) : #({x} : Set α) = 1 :=
615615
theorem mk_vector (α : Type u) (n : ℕ) : #(List.Vector α n) = #α ^ n :=
616616
(mk_congr (Equiv.vectorEquivFin α n)).trans <| by simp
617617

618-
theorem mk_list_eq_sum_pow (α : Type u) : #(List α) = sum fun n : ℕ => #α ^ n :=
618+
theorem mk_list_eq_sum_pow (α : Type u) : #(List α) = sum fun n #α ^ n :=
619619
calc
620620
#(List α) = #(Σ n, List.Vector α n) := mk_congr (Equiv.sigmaFiberEquiv List.length).symm
621-
_ = sum fun n : ℕ => #α ^ n := by simp
621+
_ = sum fun n ↦ #α ^ n := by simp
622+
623+
theorem sum_zero_pow : sum (fun n ↦ (0 : Cardinal) ^ n) = 1 := by
624+
rw [← mk_eq_zero (α := PEmpty), ← mk_list_eq_sum_pow, mk_eq_one]
622625

623626
theorem mk_quot_le {α : Type u} {r : α → α → Prop} : #(Quot r) ≤ #α :=
624627
mk_le_of_surjective Quot.exists_rep

Mathlib/SetTheory/Cardinal/Defs.lean

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,9 @@ theorem mk_ne_zero_iff {α : Type u} : #α ≠ 0 ↔ Nonempty α :=
229229
theorem mk_ne_zero (α : Type u) [Nonempty α] : #α ≠ 0 :=
230230
mk_ne_zero_iff.2 ‹_›
231231

232+
theorem nonempty_out {x : Cardinal} (h : x ≠ 0) : Nonempty x.out := by
233+
rwa [← mk_ne_zero_iff, mk_out]
234+
232235
instance : One Cardinal.{u} :=
233236
-- `PUnit` might be more canonical, but this is convenient for defeq with natCast
234237
⟨lift #(Fin 1)⟩

0 commit comments

Comments
 (0)