Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(SetTheory/Cardinal/Arithmetic): miscellaneous cardinality lemmas #18933

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 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
3 changes: 3 additions & 0 deletions Mathlib/SetTheory/Cardinal/Arithmetic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,9 @@ theorem add_mk_eq_max {α β : Type u} [Infinite α] : #α + #β = max #α #β :
theorem add_mk_eq_max' {α β : Type u} [Infinite β] : #α + #β = max #α #β :=
add_eq_max' (aleph0_le_mk β)

theorem add_mk_eq_self {α : Type*} [Infinite α] : #α + #α = #α := by
simp

theorem add_le_max (a b : Cardinal) : a + b ≤ max (max a b) ℵ₀ := by
rcases le_or_lt ℵ₀ a with ha | ha
· rw [add_eq_max ha]
Expand Down
19 changes: 19 additions & 0 deletions Mathlib/SetTheory/Cardinal/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -2025,6 +2025,17 @@ theorem mk_preimage_of_injective_of_subset_range (f : α → β) (s : Set β) (h
(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]

@[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 _ _ ↦ ⟨⟩

@[simp]
theorem mk_preimage_equiv (f : α ≃ β) (s : Set β) : #(f ⁻¹' s) = #s := by
simpa using mk_preimage_equiv_lift f s

theorem mk_preimage_of_injective (f : α → β) (s : Set β) (h : Injective f) :
#(f ⁻¹' s) ≤ #s := by
rw [← lift_id #(↑(f ⁻¹' s)), ← lift_id #(↑s)]
Expand Down Expand Up @@ -2054,6 +2065,14 @@ theorem le_mk_iff_exists_subset {c : Cardinal} {α : Type u} {s : Set α} :
rw [le_mk_iff_exists_set, ← Subtype.exists_set_subtype]
apply exists_congr; intro t; rw [mk_image_eq]; apply Subtype.val_injective

@[simp]
theorem mk_range_inl : #(range (@Sum.inl α β)) = #α :=
vihdzp marked this conversation as resolved.
Show resolved Hide resolved
(Equiv.Set.rangeInl α β).cardinal_eq

@[simp]
theorem mk_range_inr : #(range (@Sum.inr α β)) = #β :=
(Equiv.Set.rangeInr α β).cardinal_eq

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]

Expand Down