Skip to content

Commit cadd914

Browse files
committed
feat: a cofinal set has a cofinal subset of order type (cof α).ord (leanprover-community#39789)
1 parent eda72c2 commit cadd914

4 files changed

Lines changed: 38 additions & 20 deletions

File tree

Mathlib/SetTheory/Cardinal/Aleph.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ theorem ord_preAleph (o : Ordinal) : (preAleph o).ord = preOmega o := by
303303

304304
@[simp]
305305
theorem _root_.Ordinal.type_lt_cardinal : typeLT Cardinal = Ordinal.univ.{u, u + 1} := by
306-
simpa using preAleph.symm.toRelIsoLT.ordinal_type_eq
306+
simpa using preAleph.symm.ordinalType_congr
307307

308308
@[deprecated (since := "2026-03-20")] alias type_cardinal := type_lt_cardinal
309309

Mathlib/SetTheory/Cardinal/Cofinality/Basic.lean

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ theorem le_cof_iff {c : Cardinal} : c ≤ cof α ↔ ∀ s : Set α, IsCofinal s
4848
@[deprecated (since := "2026-02-18")] alias le_cof := le_cof_iff
4949

5050
variable (α) in
51+
/-- Every well-order has a cofinal subset of cardinal `cof α`. -/
5152
theorem exists_cof_eq : ∃ s : Set α, IsCofinal s ∧ #s = cof α := by
5253
obtain ⟨s, hs⟩ := ciInf_mem fun s : {s : Set α // IsCofinal s} ↦ #s
5354
exact ⟨s.1, s.2, hs⟩
@@ -133,6 +134,9 @@ theorem cof_congr_of_strictMono {f : α → γ} (hf : StrictMono f) (hf' : IsCof
133134
cof α = cof γ := by
134135
simpa using lift_cof_congr_of_strictMono hf hf'
135136

137+
theorem cof_eq_of_isCofinal {s : Set α} (hs : IsCofinal s) : cof s = cof α :=
138+
cof_congr_of_strictMono (Subtype.strictMono_coe _) (by simpa)
139+
136140
@[simp]
137141
theorem cof_lt_aleph0_iff : cof α < ℵ₀ ↔ cof α ≤ 1 := by
138142
refine ⟨fun h ↦ ?_, (lt_of_le_of_lt · one_lt_aleph0)⟩

Mathlib/SetTheory/Cardinal/Cofinality/Ordinal.lean

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,9 @@ theorem cof_omega0 : cof ω = ℵ₀ :=
151151

152152
@[deprecated (since := "2026-02-18")] alias cof_eq_one_iff_is_succ := cof_eq_one_iff
153153

154-
theorem exists_ord_cof_eq (α : Type*) [LinearOrder α] [WellFoundedLT α] :
154+
variable (α) in
155+
/-- Every well-order has a cofinal subset of order type `(cof α).ord`. -/
156+
theorem exists_ord_cof_eq [LinearOrder α] [WellFoundedLT α] :
155157
∃ s : Set α, IsCofinal s ∧ typeLT s = (Order.cof α).ord := by
156158
obtain ⟨s, hs, hs'⟩ := exists_cof_eq α
157159
obtain ⟨r, hr, hr'⟩ := exists_ord_eq s
@@ -168,16 +170,21 @@ theorem exists_ord_cof_eq (α : Type*) [LinearOrder α] [WellFoundedLT α] :
168170

169171
@[deprecated (since := "2026-05-25")] alias ord_cof_eq := exists_ord_cof_eq
170172

173+
/-- Every cofinal set has a cofinal subset of order type `(cof α).ord`. -/
174+
theorem exists_ord_cof_eq_of_isCofinal [LinearOrder α] [WellFoundedLT α]
175+
{s : Set α} (hs : IsCofinal s) : ∃ t ⊆ s, IsCofinal t ∧ typeLT t = (Order.cof α).ord := by
176+
obtain ⟨t, ht, ht'⟩ := exists_ord_cof_eq s
177+
rw [cof_eq_of_isCofinal hs] at ht'
178+
refine ⟨t, ?_, hs.trans ht, ?_⟩
179+
· simp
180+
· rw [← ht']
181+
exact ((Subtype.strictMono_coe _).strictMonoOn _).orderIso.ordinalType_congr.symm
182+
171183
@[simp]
172184
theorem _root_.Order.cof_ord_cof (α : Type*) [LinearOrder α] [WellFoundedLT α] :
173185
(Order.cof α).ord.cof = Order.cof α := by
174186
obtain ⟨s, hs, hs'⟩ := exists_ord_cof_eq α
175-
rw [← hs', cof_type]
176-
apply le_antisymm
177-
· rw [← card_ord (Order.cof α), ← hs', card_type]
178-
exact cof_le_cardinalMk s
179-
· rw [le_cof_iff]
180-
exact fun t ht ↦ (cof_le (hs.trans ht)).trans_eq (mk_image_eq Subtype.val_injective)
187+
rw [← hs', cof_type, cof_eq_of_isCofinal hs]
181188

182189
@[simp]
183190
theorem cof_ord_cof (o : Ordinal) : o.cof.ord.cof = o.cof := by

Mathlib/SetTheory/Ordinal/Basic.lean

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -165,12 +165,19 @@ theorem type_eq {α β} {r : α → α → Prop} {s : β → β → Prop} [IsWel
165165
type r = type s ↔ Nonempty (r ≃r s) :=
166166
Quotient.eq'
167167

168-
theorem _root_.RelIso.ordinal_type_eq {α β} {r : α → α → Prop} {s : β → β → Prop} [IsWellOrder α r]
169-
[IsWellOrder β s] (h : r ≃r s) : type r = type s :=
168+
theorem _root_.RelIso.ordinalType_congr {α β} {r : α → α → Prop} {s : β → β → Prop}
169+
[IsWellOrder α r] [IsWellOrder β s] (h : r ≃r s) : type r = type s :=
170170
type_eq.2 ⟨h⟩
171171

172+
@[deprecated (since := "2026-05-25")]
173+
alias _root_.RelIso.ordinal_type_eq := RelIso.ordinalType_congr
174+
175+
theorem _root_.OrderIso.ordinalType_congr {α β} [LinearOrder α] [LinearOrder β]
176+
[WellFoundedLT α] [WellFoundedLT β] (h : α ≃o β) : typeLT α = typeLT β :=
177+
h.toRelIsoLT.ordinalType_congr
178+
172179
theorem type_eq_zero_of_empty (r) [IsWellOrder α r] [IsEmpty α] : type r = 0 :=
173-
(RelIso.relIsoOfIsEmpty r _).ordinal_type_eq
180+
(RelIso.relIsoOfIsEmpty r _).ordinalType_congr
174181

175182
@[simp]
176183
theorem type_eq_zero_iff_isEmpty [IsWellOrder α r] : type r = 0 ↔ IsEmpty α := by
@@ -191,7 +198,7 @@ theorem type_empty : type (@emptyRelation Empty) = 0 :=
191198

192199
theorem type_eq_one_of_unique (r) [IsWellOrder α r] [Nonempty α] [Subsingleton α] : type r = 1 := by
193200
cases nonempty_unique α
194-
exact (RelIso.ofUniqueOfIrrefl r _).ordinal_type_eq
201+
exact (RelIso.ofUniqueOfIrrefl r _).ordinalType_congr
195202

196203
@[simp]
197204
theorem type_eq_one_iff_unique [IsWellOrder α r] : type r = 1 ↔ Nonempty (Unique α) :=
@@ -410,7 +417,7 @@ def typein (r : α → α → Prop) [IsWellOrder α r] : @PrincipalSeg α Ordina
410417
exact (PrincipalSeg.ofElement _ _).ordinal_type_lt
411418
· refine inductionOn a ?_
412419
rintro β s wo ⟨g⟩
413-
exact ⟨_, g.subrelIso.ordinal_type_eq
420+
exact ⟨_, g.subrelIso.ordinalType_congr
414421

415422
@[simp]
416423
theorem type_subrel (r : α → α → Prop) [IsWellOrder α r] (a : α) :
@@ -431,7 +438,7 @@ theorem typein_lt_self {o : Ordinal} (i : o.ToType) : typein (α := o.ToType) (
431438
@[simp]
432439
theorem typein_top {α β} {r : α → α → Prop} {s : β → β → Prop}
433440
[IsWellOrder α r] [IsWellOrder β s] (f : r ≺i s) : typein s f.top = type r :=
434-
f.subrelIso.ordinal_type_eq
441+
f.subrelIso.ordinalType_congr
435442

436443
@[simp]
437444
theorem typein_lt_typein (r : α → α → Prop) [IsWellOrder α r] {a b : α} :
@@ -658,12 +665,12 @@ theorem type_lt_ulift [LinearOrder α] [WellFoundedLT α] :
658665
theorem _root_.RelIso.ordinal_lift_type_eq {r : α → α → Prop} {s : β → β → Prop}
659666
[IsWellOrder α r] [IsWellOrder β s] (f : r ≃r s) : lift.{v} (type r) = lift.{u} (type s) :=
660667
((RelIso.preimage Equiv.ulift r).trans <|
661-
f.trans (RelIso.preimage Equiv.ulift s).symm).ordinal_type_eq
668+
f.trans (RelIso.preimage Equiv.ulift s).symm).ordinalType_congr
662669

663670
@[simp]
664671
theorem type_preimage {α β : Type u} (r : α → α → Prop) [IsWellOrder α r] (f : β ≃ α) :
665672
type (f ⁻¹'o r) = type r :=
666-
(RelIso.preimage f r).ordinal_type_eq
673+
(RelIso.preimage f r).ordinalType_congr
667674

668675
@[simp]
669676
theorem type_lift_preimage (r : α → α → Prop) [IsWellOrder α r]
@@ -829,11 +836,11 @@ the addition, together with properties of the other operations, are proved in
829836
every element of `o₁` is smaller than every element of `o₂`. -/
830837
instance add : Add Ordinal.{u} :=
831838
fun o₁ o₂ => Quotient.liftOn₂ o₁ o₂ (fun ⟨_, r, _⟩ ⟨_, s, _⟩ => type (Sum.Lex r s))
832-
fun _ _ _ _ ⟨f⟩ ⟨g⟩ => (RelIso.sumLexCongr f g).ordinal_type_eq
839+
fun _ _ _ _ ⟨f⟩ ⟨g⟩ => (RelIso.sumLexCongr f g).ordinalType_congr
833840

834841
instance addMonoidWithOne : AddMonoidWithOne Ordinal.{u} where
835-
zero_add o := inductionOn o fun α _ _ => (RelIso.emptySumLex _ _).ordinal_type_eq
836-
add_zero o := inductionOn o fun α _ _ => (RelIso.sumLexEmpty _ _).ordinal_type_eq
842+
zero_add o := inductionOn o fun α _ _ => (RelIso.emptySumLex _ _).ordinalType_congr
843+
add_zero o := inductionOn o fun α _ _ => (RelIso.sumLexEmpty _ _).ordinalType_congr
837844
add_assoc o₁ o₂ o₃ :=
838845
Quotient.inductionOn₃ o₁ o₂ o₃ fun _ _ _ ↦ Quot.sound ⟨⟨sumAssoc .., by simp⟩⟩
839846
nsmul := nsmulRec
@@ -875,7 +882,7 @@ instance existsAddOfLE : ExistsAddOfLE Ordinal where
875882
exists_add_of_le {a b} := by
876883
refine inductionOn₂ a b fun α r _ β s _ ⟨f⟩ ↦ ?_
877884
obtain ⟨γ, t, _, ⟨g⟩⟩ := f.exists_sum_relIso
878-
exact ⟨type t, g.ordinal_type_eq.symm⟩
885+
exact ⟨type t, g.ordinalType_congr.symm⟩
879886

880887
instance canonicallyOrderedAdd : CanonicallyOrderedAdd Ordinal where
881888
le_add_self a b := by simpa using add_le_add_left bot_le a

0 commit comments

Comments
 (0)