Skip to content

Commit 2deff08

Browse files
committed
chore(SetTheory/Cardinal/Cofinality): tweak universes of RelIso.cof_eq_lift (#18042)
For `c : Cardinal.{u}`, the simp-normal form of `lift.{max u v} c` is `lift.{v} c`. Also, some drive-by golfing.
1 parent 3fc88df commit 2deff08

1 file changed

Lines changed: 9 additions & 21 deletions

File tree

Mathlib/SetTheory/Cardinal/Cofinality.lean

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -79,21 +79,17 @@ theorem le_cof {r : α → α → Prop} [IsRefl α r] (c : Cardinal) :
7979
end Order
8080

8181
theorem RelIso.cof_le_lift {α : Type u} {β : Type v} {r : α → α → Prop} {s} [IsRefl β s]
82-
(f : r ≃r s) : Cardinal.lift.{max u v} (Order.cof r) ≤
83-
Cardinal.lift.{max u v} (Order.cof s) := by
84-
rw [Order.cof, Order.cof, lift_sInf, lift_sInf,
85-
le_csInf_iff'' ((Order.cof_nonempty s).image _)]
82+
(f : r ≃r s) : Cardinal.lift.{v} (Order.cof r) ≤ Cardinal.lift.{u} (Order.cof s) := by
83+
rw [Order.cof, Order.cof, lift_sInf, lift_sInf, le_csInf_iff'' ((Order.cof_nonempty s).image _)]
8684
rintro - ⟨-, ⟨u, H, rfl⟩, rfl⟩
8785
apply csInf_le'
88-
refine
89-
⟨_, ⟨f.symm '' u, fun a => ?_, rfl⟩,
90-
lift_mk_eq.{u, v, max u v}.2 ⟨(f.symm.toEquiv.image u).symm⟩⟩
86+
refine ⟨_, ⟨f.symm '' u, fun a => ?_, rfl⟩, lift_mk_eq'.2 ⟨(f.symm.toEquiv.image u).symm⟩⟩
9187
rcases H (f a) with ⟨b, hb, hb'⟩
9288
refine ⟨f.symm b, mem_image_of_mem _ hb, f.map_rel_iff.1 ?_⟩
9389
rwa [RelIso.apply_symm_apply]
9490

9591
theorem RelIso.cof_eq_lift {α : Type u} {β : Type v} {r s} [IsRefl α r] [IsRefl β s] (f : r ≃r s) :
96-
Cardinal.lift.{max u v} (Order.cof r) = Cardinal.lift.{max u v} (Order.cof s) :=
92+
Cardinal.lift.{v} (Order.cof r) = Cardinal.lift.{u} (Order.cof s) :=
9793
(RelIso.cof_le_lift f).antisymm (RelIso.cof_le_lift f.symm)
9894

9995
theorem RelIso.cof_le {α β : Type u} {r : α → α → Prop} {s} [IsRefl β s] (f : r ≃r s) :
@@ -124,19 +120,11 @@ namespace Ordinal
124120
`∀ a, ∃ b ∈ S, a ≤ b`. It is defined for all ordinals, but
125121
`cof 0 = 0` and `cof (succ o) = 1`, so it is only really
126122
interesting on limit ordinals (when it is an infinite cardinal). -/
127-
def cof (o : Ordinal.{u}) : Cardinal.{u} :=
128-
o.liftOn (fun a => StrictOrder.cof a.r)
129-
(by
130-
rintro ⟨α, r, wo₁⟩ ⟨β, s, wo₂⟩ ⟨⟨f, hf⟩⟩
131-
haveI := wo₁; haveI := wo₂
132-
dsimp only
133-
apply @RelIso.cof_eq _ _ _ _ ?_ ?_
134-
· constructor
135-
exact @fun a b => not_iff_not.2 hf
136-
· dsimp only [swap]
137-
exact ⟨fun _ => irrefl _⟩
138-
· dsimp only [swap]
139-
exact ⟨fun _ => irrefl _⟩)
123+
def cof (o : Ordinal.{u}) : Cardinal.{u} := by
124+
refine o.liftOn (fun a => StrictOrder.cof a.r) ?_
125+
rintro ⟨α, r, _⟩ ⟨β, s, _⟩ ⟨⟨f, hf⟩⟩
126+
refine @RelIso.cof_eq _ _ _ _ ?_ ?_ ⟨_, not_iff_not.2 hf⟩ <;>
127+
exact ⟨fun _ => irrefl _⟩
140128

141129
theorem cof_type (r : α → α → Prop) [IsWellOrder α r] : (type r).cof = StrictOrder.cof r :=
142130
rfl

0 commit comments

Comments
 (0)