Skip to content

Commit 9531107

Browse files
committed
chore: no_expose various Ordinal definitions (#34729)
These all have convoluted definitions that are better characterized by their API, or (in the case of `Ordinal.ToType`) are defined through choice and have no useful definitional equalities.
1 parent 51e3dd3 commit 9531107

File tree

3 files changed

+15
-10
lines changed

3 files changed

+15
-10
lines changed

Mathlib/SetTheory/Cardinal/Cofinality.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ theorem cof_eq_sInf_lsub (o : Ordinal.{u}) : cof o =
253253
sInf { a : Cardinal | ∃ (ι : Type u) (f : ι → Ordinal), lsub.{u, u} f = o ∧ #ι = a } := by
254254
refine le_antisymm (le_csInf (cof_lsub_def_nonempty o) ?_) (csInf_le' ?_)
255255
· rintro a ⟨ι, f, hf, rfl⟩
256-
rw [← type_toType o]
256+
rw [← type_toType o, cof_type]
257257
refine
258258
(cof_le fun a => ?_).trans
259259
(@mk_le_of_injective _ _

Mathlib/SetTheory/Ordinal/Basic.lean

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def Ordinal : Type (u + 1) :=
106106
Quotient Ordinal.isEquivalent
107107

108108
/-- A "canonical" type order-isomorphic to the ordinal `o`, living in the same universe. This is
109-
defined through the axiom of choice.
109+
defined through the axiom of choice; in particular, it has no useful def-eqs, and it is not exposed.
110110
111111
Use this over `Iio o` only when it is paramount to have a `Type u` rather than a `Type (u + 1)`,
112112
and convert using
@@ -116,23 +116,26 @@ Ordinal.ToType.mk : Iio o → o.ToType
116116
Ordinal.ToType.toOrd : o.ToType → Iio o
117117
```
118118
-/
119+
@[no_expose]
119120
def Ordinal.ToType (o : Ordinal.{u}) : Type u :=
120121
o.out.α
121122

122123
@[deprecated (since := "2025-12-04")]
123124
alias Ordinal.toType := Ordinal.ToType
124125

125-
instance hasWellFounded_toType (o : Ordinal) : WellFoundedRelation o.ToType :=
126-
⟨o.out.r, o.out.wo.wf⟩
127-
126+
@[no_expose]
128127
instance linearOrder_toType (o : Ordinal) : LinearOrder o.ToType :=
129128
@IsWellOrder.linearOrder _ o.out.r o.out.wo
130129

131130
instance wellFoundedLT_toType (o : Ordinal) : WellFoundedLT o.ToType :=
132131
o.out.wo.toIsWellFounded
133132

133+
instance hasWellFounded_toType (o : Ordinal) : WellFoundedRelation o.ToType :=
134+
WellFoundedLT.toWellFoundedRelation
135+
134136
namespace Ordinal
135137

138+
@[no_expose]
136139
noncomputable instance (o : Ordinal) : SuccOrder o.ToType :=
137140
.ofLinearWellFoundedLT _
138141

@@ -1077,6 +1080,7 @@ theorem mk_toType (o : Ordinal) : #o.ToType = o.card :=
10771080

10781081
/-- The ordinal corresponding to a cardinal `c` is the least ordinal
10791082
whose cardinal is `c`. For the order-embedding version, see `ord.order_embedding`. -/
1083+
@[no_expose]
10801084
def ord (c : Cardinal) : Ordinal :=
10811085
Quot.liftOn c (fun α : Type u => ⨅ r : { r // IsWellOrder α r }, @type α r.1 r.2) <| by
10821086
rintro α β ⟨f⟩
@@ -1085,8 +1089,10 @@ def ord (c : Cardinal) : Ordinal :=
10851089
refine ⟨⟨_, RelIso.IsWellOrder.preimage r ?_⟩, type_preimage _ _⟩
10861090
exacts [f.symm, f]
10871091

1088-
theorem ord_eq_Inf (α : Type u) : ord #α = ⨅ r : { r // IsWellOrder α r }, @type α r.1 r.2 :=
1089-
rfl
1092+
theorem ord_eq_iInf (α : Type u) : ord #α = ⨅ r : { r // IsWellOrder α r }, @type α r.1 r.2 :=
1093+
(rfl)
1094+
1095+
@[deprecated (since := "2026-03-15")] alias ord_eq_Inf := ord_eq_iInf
10901096

10911097
/-- There exists a well-order on `α` whose order type is exactly `ord #α`. -/
10921098
theorem ord_eq (α) : ∃ (r : α → α → Prop) (wo : IsWellOrder α r), ord #α = @type α r wo :=

Mathlib/SetTheory/Ordinal/Exponential.lean

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@ related by the lemma `Ordinal.opow_le_iff_le_log : b ^ c ≤ x ↔ c ≤ log b x
1515
`b`, `c`.
1616
-/
1717

18-
@[expose] public section
19-
20-
noncomputable section
18+
public noncomputable section
2119

2220
open Function Set Equiv Order
2321
open scoped Cardinal Ordinal
@@ -29,6 +27,7 @@ namespace Ordinal
2927
/-- The ordinal exponential, defined by transfinite recursion.
3028
3129
We call this `opow` in theorems in order to disambiguate from other exponentials. -/
30+
@[no_expose]
3231
instance instPow : Pow Ordinal Ordinal :=
3332
fun a b ↦ if a = 0 then 1 - b else
3433
limitRecOn b 1 (fun _ x ↦ x * a) fun o _ f ↦ ⨆ x : Iio o, f x.1 x.2

0 commit comments

Comments
 (0)