Skip to content

Commit 3c12551

Browse files
committed
feat(SetTheory/Cardinal/Arithmetic): miscellaneous cardinality lemmas (leanprover-community#18933)
1 parent 0f18102 commit 3c12551

File tree

2 files changed

+37
-1
lines changed

2 files changed

+37
-1
lines changed

Mathlib/SetTheory/Cardinal/Arithmetic.lean

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,9 @@ theorem add_mk_eq_max {α β : Type u} [Infinite α] : #α + #β = max #α #β :
260260
theorem add_mk_eq_max' {α β : Type u} [Infinite β] : #α + #β = max #α #β :=
261261
add_eq_max' (aleph0_le_mk β)
262262

263+
theorem add_mk_eq_self {α : Type*} [Infinite α] : #α + #α = #α := by
264+
simp
265+
263266
theorem add_le_max (a b : Cardinal) : a + b ≤ max (max a b) ℵ₀ := by
264267
rcases le_or_lt ℵ₀ a with ha | ha
265268
· rw [add_eq_max ha]

Mathlib/SetTheory/Cardinal/Basic.lean

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,11 @@ we provide this statement separately so you don't have to solve the specializati
246246
theorem lift_mk_eq' {α : Type u} {β : Type v} : lift.{v} #α = lift.{u} #β ↔ Nonempty (α ≃ β) :=
247247
lift_mk_eq.{u, v, 0}
248248

249+
theorem mk_congr_lift {α : Type u} {β : Type v} (e : α ≃ β) : lift.{v} #α = lift.{u} #β :=
250+
lift_mk_eq'.2 ⟨e⟩
251+
252+
alias _root_.Equiv.lift_cardinal_eq := mk_congr_lift
253+
249254
-- Porting note: simpNF is not happy with universe levels.
250255
@[simp, nolint simpNF]
251256
theorem lift_mk_shrink (α : Type u) [Small.{v} α] :
@@ -1876,6 +1881,15 @@ theorem mk_image_eq_lift {α : Type u} {β : Type v} (f : α → β) (s : Set α
18761881
lift.{u} #(f '' s) = lift.{v} #s :=
18771882
mk_image_eq_of_injOn_lift _ _ h.injOn
18781883

1884+
@[simp]
1885+
theorem mk_image_embedding_lift {β : Type v} (f : α ↪ β) (s : Set α) :
1886+
lift.{u} #(f '' s) = lift.{v} #s :=
1887+
mk_image_eq_lift _ _ f.injective
1888+
1889+
@[simp]
1890+
theorem mk_image_embedding (f : α ↪ β) (s : Set α) : #(f '' s) = #s := by
1891+
simpa using mk_image_embedding_lift f s
1892+
18791893
theorem mk_iUnion_le_sum_mk {α ι : Type u} {f : ι → Set α} : #(⋃ i, f i) ≤ sum fun i => #(f i) :=
18801894
calc
18811895
#(⋃ i, f i) ≤ #(Σi, f i) := mk_le_of_surjective (Set.sigmaToiUnion_surjective f)
@@ -2035,6 +2049,17 @@ theorem mk_preimage_of_injective_of_subset_range (f : α → β) (s : Set β) (h
20352049
(h2 : s ⊆ range f) : #(f ⁻¹' s) = #s := by
20362050
convert mk_preimage_of_injective_of_subset_range_lift.{u, u} f s h h2 using 1 <;> rw [lift_id]
20372051

2052+
@[simp]
2053+
theorem mk_preimage_equiv_lift {β : Type v} (f : α ≃ β) (s : Set β) :
2054+
lift.{v} #(f ⁻¹' s) = lift.{u} #s := by
2055+
apply mk_preimage_of_injective_of_subset_range_lift _ _ f.injective
2056+
rw [f.range_eq_univ]
2057+
exact fun _ _ ↦ ⟨⟩
2058+
2059+
@[simp]
2060+
theorem mk_preimage_equiv (f : α ≃ β) (s : Set β) : #(f ⁻¹' s) = #s := by
2061+
simpa using mk_preimage_equiv_lift f s
2062+
20382063
theorem mk_preimage_of_injective (f : α → β) (s : Set β) (h : Injective f) :
20392064
#(f ⁻¹' s) ≤ #s := by
20402065
rw [← lift_id #(↑(f ⁻¹' s)), ← lift_id #(↑s)]
@@ -2064,6 +2089,14 @@ theorem le_mk_iff_exists_subset {c : Cardinal} {α : Type u} {s : Set α} :
20642089
rw [le_mk_iff_exists_set, ← Subtype.exists_set_subtype]
20652090
apply exists_congr; intro t; rw [mk_image_eq]; apply Subtype.val_injective
20662091

2092+
@[simp]
2093+
theorem mk_range_inl {α : Type u} {β : Type v} : #(range (@Sum.inl α β)) = lift.{v} #α := by
2094+
rw [← lift_id'.{u, v} #_, (Equiv.Set.rangeInl α β).lift_cardinal_eq, lift_umax.{u, v}]
2095+
2096+
@[simp]
2097+
theorem mk_range_inr {α : Type u} {β : Type v} : #(range (@Sum.inr α β)) = lift.{u} #β := by
2098+
rw [← lift_id'.{v, u} #_, (Equiv.Set.rangeInr α β).lift_cardinal_eq, lift_umax.{v, u}]
2099+
20672100
theorem two_le_iff : (2 : Cardinal) ≤ #α ↔ ∃ x y : α, x ≠ y := by
20682101
rw [← Nat.cast_two, nat_succ, succ_le_iff, Nat.cast_one, one_lt_iff_nontrivial, nontrivial_iff]
20692102

@@ -2171,4 +2204,4 @@ end Cardinal
21712204

21722205
-- end Tactic
21732206

2174-
set_option linter.style.longFile 2200
2207+
set_option linter.style.longFile 2400

0 commit comments

Comments
 (0)