diff --git a/Mathlib/SetTheory/Cardinal/Aleph.lean b/Mathlib/SetTheory/Cardinal/Aleph.lean index bd2e72108ff861..8160be103c4f46 100644 --- a/Mathlib/SetTheory/Cardinal/Aleph.lean +++ b/Mathlib/SetTheory/Cardinal/Aleph.lean @@ -303,7 +303,7 @@ theorem ord_preAleph (o : Ordinal) : (preAleph o).ord = preOmega o := by @[simp] theorem _root_.Ordinal.type_lt_cardinal : typeLT Cardinal = Ordinal.univ.{u, u + 1} := by - simpa using preAleph.symm.toRelIsoLT.ordinal_type_eq + simpa using preAleph.symm.ordinalType_congr @[deprecated (since := "2026-03-20")] alias type_cardinal := type_lt_cardinal diff --git a/Mathlib/SetTheory/Cardinal/Cofinality/Basic.lean b/Mathlib/SetTheory/Cardinal/Cofinality/Basic.lean index 4cbeee18f776f1..7daf0c1328c12e 100644 --- a/Mathlib/SetTheory/Cardinal/Cofinality/Basic.lean +++ b/Mathlib/SetTheory/Cardinal/Cofinality/Basic.lean @@ -48,6 +48,7 @@ theorem le_cof_iff {c : Cardinal} : c ≤ cof α ↔ ∀ s : Set α, IsCofinal s @[deprecated (since := "2026-02-18")] alias le_cof := le_cof_iff variable (α) in +/-- Every well-order has a cofinal subset of cardinal `cof α`. -/ theorem exists_cof_eq : ∃ s : Set α, IsCofinal s ∧ #s = cof α := by obtain ⟨s, hs⟩ := ciInf_mem fun s : {s : Set α // IsCofinal s} ↦ #s exact ⟨s.1, s.2, hs⟩ @@ -133,6 +134,9 @@ theorem cof_congr_of_strictMono {f : α → γ} (hf : StrictMono f) (hf' : IsCof cof α = cof γ := by simpa using lift_cof_congr_of_strictMono hf hf' +theorem cof_eq_of_isCofinal {s : Set α} (hs : IsCofinal s) : cof s = cof α := + cof_congr_of_strictMono (Subtype.strictMono_coe _) (by simpa) + @[simp] theorem cof_lt_aleph0_iff : cof α < ℵ₀ ↔ cof α ≤ 1 := by refine ⟨fun h ↦ ?_, (lt_of_le_of_lt · one_lt_aleph0)⟩ diff --git a/Mathlib/SetTheory/Cardinal/Cofinality/Ordinal.lean b/Mathlib/SetTheory/Cardinal/Cofinality/Ordinal.lean index 19beb23372c63a..fd318305964a26 100644 --- a/Mathlib/SetTheory/Cardinal/Cofinality/Ordinal.lean +++ b/Mathlib/SetTheory/Cardinal/Cofinality/Ordinal.lean @@ -151,7 +151,9 @@ theorem cof_omega0 : cof ω = ℵ₀ := @[deprecated (since := "2026-02-18")] alias cof_eq_one_iff_is_succ := cof_eq_one_iff -theorem exists_ord_cof_eq (α : Type*) [LinearOrder α] [WellFoundedLT α] : +variable (α) in +/-- Every well-order has a cofinal subset of order type `(cof α).ord`. -/ +theorem exists_ord_cof_eq [LinearOrder α] [WellFoundedLT α] : ∃ s : Set α, IsCofinal s ∧ typeLT s = (Order.cof α).ord := by obtain ⟨s, hs, hs'⟩ := exists_cof_eq α obtain ⟨r, hr, hr'⟩ := exists_ord_eq s @@ -168,16 +170,21 @@ theorem exists_ord_cof_eq (α : Type*) [LinearOrder α] [WellFoundedLT α] : @[deprecated (since := "2026-05-25")] alias ord_cof_eq := exists_ord_cof_eq +/-- Every cofinal set has a cofinal subset of order type `(cof α).ord`. -/ +theorem exists_ord_cof_eq_of_isCofinal [LinearOrder α] [WellFoundedLT α] + {s : Set α} (hs : IsCofinal s) : ∃ t ⊆ s, IsCofinal t ∧ typeLT t = (Order.cof α).ord := by + obtain ⟨t, ht, ht'⟩ := exists_ord_cof_eq s + rw [cof_eq_of_isCofinal hs] at ht' + refine ⟨t, ?_, hs.trans ht, ?_⟩ + · simp + · rw [← ht'] + exact ((Subtype.strictMono_coe _).strictMonoOn _).orderIso.ordinalType_congr.symm + @[simp] theorem _root_.Order.cof_ord_cof (α : Type*) [LinearOrder α] [WellFoundedLT α] : (Order.cof α).ord.cof = Order.cof α := by obtain ⟨s, hs, hs'⟩ := exists_ord_cof_eq α - rw [← hs', cof_type] - apply le_antisymm - · rw [← card_ord (Order.cof α), ← hs', card_type] - exact cof_le_cardinalMk s - · rw [le_cof_iff] - exact fun t ht ↦ (cof_le (hs.trans ht)).trans_eq (mk_image_eq Subtype.val_injective) + rw [← hs', cof_type, cof_eq_of_isCofinal hs] @[simp] theorem cof_ord_cof (o : Ordinal) : o.cof.ord.cof = o.cof := by diff --git a/Mathlib/SetTheory/Ordinal/Basic.lean b/Mathlib/SetTheory/Ordinal/Basic.lean index 1b47dfba3da250..c8589910d7c467 100644 --- a/Mathlib/SetTheory/Ordinal/Basic.lean +++ b/Mathlib/SetTheory/Ordinal/Basic.lean @@ -165,12 +165,19 @@ theorem type_eq {α β} {r : α → α → Prop} {s : β → β → Prop} [IsWel type r = type s ↔ Nonempty (r ≃r s) := Quotient.eq' -theorem _root_.RelIso.ordinal_type_eq {α β} {r : α → α → Prop} {s : β → β → Prop} [IsWellOrder α r] - [IsWellOrder β s] (h : r ≃r s) : type r = type s := +theorem _root_.RelIso.ordinalType_congr {α β} {r : α → α → Prop} {s : β → β → Prop} + [IsWellOrder α r] [IsWellOrder β s] (h : r ≃r s) : type r = type s := type_eq.2 ⟨h⟩ +@[deprecated (since := "2026-05-25")] +alias _root_.RelIso.ordinal_type_eq := RelIso.ordinalType_congr + +theorem _root_.OrderIso.ordinalType_congr {α β} [LinearOrder α] [LinearOrder β] + [WellFoundedLT α] [WellFoundedLT β] (h : α ≃o β) : typeLT α = typeLT β := + h.toRelIsoLT.ordinalType_congr + theorem type_eq_zero_of_empty (r) [IsWellOrder α r] [IsEmpty α] : type r = 0 := - (RelIso.relIsoOfIsEmpty r _).ordinal_type_eq + (RelIso.relIsoOfIsEmpty r _).ordinalType_congr @[simp] theorem type_eq_zero_iff_isEmpty [IsWellOrder α r] : type r = 0 ↔ IsEmpty α := by @@ -191,7 +198,7 @@ theorem type_empty : type (@emptyRelation Empty) = 0 := theorem type_eq_one_of_unique (r) [IsWellOrder α r] [Nonempty α] [Subsingleton α] : type r = 1 := by cases nonempty_unique α - exact (RelIso.ofUniqueOfIrrefl r _).ordinal_type_eq + exact (RelIso.ofUniqueOfIrrefl r _).ordinalType_congr @[simp] 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 exact (PrincipalSeg.ofElement _ _).ordinal_type_lt · refine inductionOn a ?_ rintro β s wo ⟨g⟩ - exact ⟨_, g.subrelIso.ordinal_type_eq⟩ + exact ⟨_, g.subrelIso.ordinalType_congr⟩ @[simp] theorem type_subrel (r : α → α → Prop) [IsWellOrder α r] (a : α) : @@ -431,7 +438,7 @@ theorem typein_lt_self {o : Ordinal} (i : o.ToType) : typein (α := o.ToType) ( @[simp] theorem typein_top {α β} {r : α → α → Prop} {s : β → β → Prop} [IsWellOrder α r] [IsWellOrder β s] (f : r ≺i s) : typein s f.top = type r := - f.subrelIso.ordinal_type_eq + f.subrelIso.ordinalType_congr @[simp] theorem typein_lt_typein (r : α → α → Prop) [IsWellOrder α r] {a b : α} : @@ -659,12 +666,12 @@ theorem type_lt_ulift [LinearOrder α] [WellFoundedLT α] : theorem _root_.RelIso.ordinal_lift_type_eq {r : α → α → Prop} {s : β → β → Prop} [IsWellOrder α r] [IsWellOrder β s] (f : r ≃r s) : lift.{v} (type r) = lift.{u} (type s) := ((RelIso.preimage Equiv.ulift r).trans <| - f.trans (RelIso.preimage Equiv.ulift s).symm).ordinal_type_eq + f.trans (RelIso.preimage Equiv.ulift s).symm).ordinalType_congr @[simp] theorem type_preimage {α β : Type u} (r : α → α → Prop) [IsWellOrder α r] (f : β ≃ α) : type (f ⁻¹'o r) = type r := - (RelIso.preimage f r).ordinal_type_eq + (RelIso.preimage f r).ordinalType_congr @[simp] theorem type_lift_preimage (r : α → α → Prop) [IsWellOrder α r] @@ -830,11 +837,11 @@ the addition, together with properties of the other operations, are proved in every element of `o₁` is smaller than every element of `o₂`. -/ instance add : Add Ordinal.{u} := ⟨fun o₁ o₂ => Quotient.liftOn₂ o₁ o₂ (fun ⟨_, r, _⟩ ⟨_, s, _⟩ => type (Sum.Lex r s)) - fun _ _ _ _ ⟨f⟩ ⟨g⟩ => (RelIso.sumLexCongr f g).ordinal_type_eq⟩ + fun _ _ _ _ ⟨f⟩ ⟨g⟩ => (RelIso.sumLexCongr f g).ordinalType_congr⟩ instance addMonoidWithOne : AddMonoidWithOne Ordinal.{u} where - zero_add o := inductionOn o fun α _ _ => (RelIso.emptySumLex _ _).ordinal_type_eq - add_zero o := inductionOn o fun α _ _ => (RelIso.sumLexEmpty _ _).ordinal_type_eq + zero_add o := inductionOn o fun α _ _ => (RelIso.emptySumLex _ _).ordinalType_congr + add_zero o := inductionOn o fun α _ _ => (RelIso.sumLexEmpty _ _).ordinalType_congr add_assoc o₁ o₂ o₃ := Quotient.inductionOn₃ o₁ o₂ o₃ fun _ _ _ ↦ Quot.sound ⟨⟨sumAssoc .., by simp⟩⟩ nsmul := nsmulRec @@ -876,7 +883,7 @@ instance existsAddOfLE : ExistsAddOfLE Ordinal where exists_add_of_le {a b} := by refine inductionOn₂ a b fun α r _ β s _ ⟨f⟩ ↦ ?_ obtain ⟨γ, t, _, ⟨g⟩⟩ := f.exists_sum_relIso - exact ⟨type t, g.ordinal_type_eq.symm⟩ + exact ⟨type t, g.ordinalType_congr.symm⟩ instance canonicallyOrderedAdd : CanonicallyOrderedAdd Ordinal where le_add_self a b := by simpa using add_le_add_left bot_le a