Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit b7808a9

Browse files
committed
chore(set_theory/ordinal_arithmetic): Golf lsub_typein and blsub_id (#12203)
1 parent b4d007f commit b7808a9

File tree

1 file changed

+52
-55
lines changed

1 file changed

+52
-55
lines changed

src/set_theory/ordinal_arithmetic.lean

Lines changed: 52 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1138,29 +1138,6 @@ theorem bsup_eq_of_brange_eq {o o'} {f : Π a < o, ordinal} {g : Π a < o', ordi
11381138
(h : brange o f = brange o' g) : bsup.{u (max v w)} o f = bsup.{v (max u w)} o' g :=
11391139
(bsup_le_of_brange_subset h.le).antisymm (bsup_le_of_brange_subset.{v u w} h.ge)
11401140

1141-
theorem bsup_id_limit {o} (ho : ∀ a < o, succ a < o) : bsup.{u u} o (λ x _, x) = o :=
1142-
le_antisymm (bsup_le.2 (λ i hi, hi.le))
1143-
(not_lt.1 (λ h, (lt_bsup_of_limit.{u u} (λ _ _ _ _, id) ho _ h).false))
1144-
1145-
theorem bsup_id_succ (o) : bsup.{u u} (succ o) (λ x _, x) = o :=
1146-
le_antisymm (bsup_le.2 $ (λ o, lt_succ.1)) (le_bsup _ o (lt_succ_self o))
1147-
1148-
theorem is_normal.bsup_eq {f} (H : is_normal f) {o : ordinal} (h : is_limit o) :
1149-
bsup.{u} o (λ x _, f x) = f o :=
1150-
by { rw [←is_normal.bsup.{u u} H (λ x _, x) h.1, bsup_id_limit h.2] }
1151-
1152-
theorem is_normal.eq_iff_zero_and_succ {f : ordinal.{u} → ordinal.{u}} (hf : is_normal f) {g}
1153-
(hg : is_normal g) : f = g ↔ (f 0 = g 0 ∧ ∀ a : ordinal, f a = g a → f a.succ = g a.succ) :=
1154-
⟨λ h, by simp [h], λ ⟨h₁, h₂⟩, funext (λ a, begin
1155-
apply a.limit_rec_on,
1156-
assumption',
1157-
intros o ho H,
1158-
rw [←is_normal.bsup_eq.{u u} hf ho, ←is_normal.bsup_eq.{u u} hg ho],
1159-
congr,
1160-
ext b hb,
1161-
exact H b hb
1162-
end)⟩
1163-
11641141
/-- The least strict upper bound of a family of ordinals. -/
11651142
def lsub {ι} (f : ι → ordinal) : ordinal :=
11661143
sup (ordinal.succ ∘ f)
@@ -1246,6 +1223,27 @@ theorem lsub_eq_of_range_eq {ι ι'} {f : ι → ordinal} {g : ι' → ordinal}
12461223
theorem lsub_nmem_range {ι} (f : ι → ordinal) : lsub f ∉ set.range f :=
12471224
λ ⟨i, h⟩, h.not_lt (lt_lsub f i)
12481225

1226+
@[simp] theorem lsub_typein (o : ordinal) : lsub.{u u} (typein o.out.r) = o :=
1227+
(lsub_le.{u u}.2 typein_lt_self).antisymm begin
1228+
by_contra' h,
1229+
nth_rewrite 0 ←type_out o at h,
1230+
simpa [typein_enum] using lt_lsub.{u u} (typein o.out.r) (enum o.out.r _ h)
1231+
end
1232+
1233+
theorem sup_typein_limit {o : ordinal} (ho : ∀ a, a < o → succ a < o) :
1234+
sup.{u u} (typein o.out.r) = o :=
1235+
by rw (sup_eq_lsub_iff_succ.{u u} (typein o.out.r)).2; rwa lsub_typein o
1236+
1237+
@[simp] theorem sup_typein_succ {o : ordinal} : sup.{u u} (typein o.succ.out.r) = o :=
1238+
begin
1239+
cases sup_eq_lsub_or_sup_succ_eq_lsub.{u u} (typein o.succ.out.r) with h h,
1240+
{ rw sup_eq_lsub_iff_succ at h,
1241+
simp only [lsub_typein] at h,
1242+
exact (h o (lt_succ_self o)).false.elim },
1243+
rw [←succ_inj, h],
1244+
apply lsub_typein
1245+
end
1246+
12491247
/-- The bounded least strict upper bound of a family of ordinals. -/
12501248
def blsub (o : ordinal.{u}) (f : Π a < o, ordinal.{max u v}) : ordinal.{max u v} :=
12511249
o.bsup (λ a ha, (f a ha).succ)
@@ -1334,14 +1332,14 @@ by rw [blsub_le, lsub_le]; exact
13341332
theorem blsub_const {o : ordinal} (ho : o ≠ 0) (a : ordinal) : blsub.{u v} o (λ _ _, a) = a + 1 :=
13351333
bsup_const.{u v} ho a.succ
13361334

1337-
theorem blsub_id (o) : blsub.{u u} o (λ x _, x) = o :=
1338-
begin
1339-
apply le_antisymm,
1340-
{ rw blsub_le,
1341-
exact λ _, id },
1342-
by_contra' h,
1343-
exact (lt_blsub.{u u} (λ x _, x) _ h).false
1344-
end
1335+
@[simp] theorem blsub_id : ∀ o, blsub.{u u} o (λ x _, x) = o :=
1336+
lsub_typein
1337+
1338+
theorem bsup_id_limit {o} : (∀ a < o, succ a < o) → bsup.{u u} o (λ x _, x) = o :=
1339+
sup_typein_limit
1340+
1341+
@[simp] theorem bsup_id_succ (o) : bsup.{u u} (succ o) (λ x _, x) = o :=
1342+
sup_typein_succ
13451343

13461344
theorem blsub_le_of_brange_subset {o o'} {f : Π a < o, ordinal} {g : Π a < o', ordinal}
13471345
(h : brange o f ⊆ brange o' g) : blsub.{u (max v w)} o f ≤ blsub.{v (max u w)} o' g :=
@@ -1356,30 +1354,6 @@ theorem blsub_eq_of_brange_eq {o o'} {f : Π a < o, ordinal} {g : Π a < o', ord
13561354
blsub.{u (max v w)} o f = blsub.{v (max u w)} o' g :=
13571355
(blsub_le_of_brange_subset h.le).antisymm (blsub_le_of_brange_subset.{v u w} h.ge)
13581356

1359-
theorem is_normal.blsub_eq {f} (H : is_normal f) {o : ordinal} (h : is_limit o) :
1360-
blsub.{u} o (λ x _, f x) = f o :=
1361-
begin
1362-
rw ←H.bsup_eq h,
1363-
exact ((bsup_eq_blsub_iff_lt_bsup _).2 (λ a ha, (H.1 a).trans_le (le_bsup _ _ (h.2 a ha)))).symm
1364-
end
1365-
1366-
theorem lsub_typein (o : ordinal) : lsub.{u u} (typein o.out.r) = o :=
1367-
by { have := blsub_id o, rwa blsub_eq_lsub at this }
1368-
1369-
theorem sup_typein_limit {o : ordinal} (ho : ∀ a, a < o → succ a < o) :
1370-
sup.{u u} (typein o.out.r) = o :=
1371-
by rw (sup_eq_lsub_iff_succ.{u u} (typein o.out.r)).2; rwa lsub_typein o
1372-
1373-
theorem sup_typein_succ (o : ordinal) : sup.{u u} (typein o.succ.out.r) = o :=
1374-
begin
1375-
cases sup_eq_lsub_or_sup_succ_eq_lsub.{u u} (typein o.succ.out.r) with h h,
1376-
{ rw sup_eq_lsub_iff_succ at h,
1377-
simp only [lsub_typein] at h,
1378-
exact (h o (lt_succ_self o)).false.elim },
1379-
rw [←succ_inj, h],
1380-
exact lsub_typein _
1381-
end
1382-
13831357
theorem bsup_comp {o o' : ordinal} {f : Π a < o, ordinal}
13841358
(hf : ∀ {i j} (hi) (hj), i ≤ j → f i hi ≤ f j hj) {g : Π a < o', ordinal} (hg : blsub o' g = o) :
13851359
bsup o' (λ a ha, f (g a ha) (by { rw ←hg, apply lt_blsub })) = bsup o f :=
@@ -1397,6 +1371,29 @@ theorem blsub_comp {o o' : ordinal} {f : Π a < o, ordinal}
13971371
blsub o' (λ a ha, f (g a ha) (by { rw ←hg, apply lt_blsub })) = blsub o f :=
13981372
@bsup_comp o _ (λ a ha, (f a ha).succ) (λ i j _ _ h, succ_le_succ.2 (hf _ _ h)) g hg
13991373

1374+
theorem is_normal.bsup_eq {f} (H : is_normal f) {o : ordinal} (h : is_limit o) :
1375+
bsup.{u} o (λ x _, f x) = f o :=
1376+
by { rw [←is_normal.bsup.{u u} H (λ x _, x) h.1, bsup_id_limit h.2] }
1377+
1378+
theorem is_normal.eq_iff_zero_and_succ {f : ordinal.{u} → ordinal.{u}} (hf : is_normal f) {g}
1379+
(hg : is_normal g) : f = g ↔ (f 0 = g 0 ∧ ∀ a : ordinal, f a = g a → f a.succ = g a.succ) :=
1380+
⟨λ h, by simp [h], λ ⟨h₁, h₂⟩, funext (λ a, begin
1381+
apply a.limit_rec_on,
1382+
assumption',
1383+
intros o ho H,
1384+
rw [←is_normal.bsup_eq.{u u} hf ho, ←is_normal.bsup_eq.{u u} hg ho],
1385+
congr,
1386+
ext b hb,
1387+
exact H b hb
1388+
end)⟩
1389+
1390+
theorem is_normal.blsub_eq {f} (H : is_normal f) {o : ordinal} (h : is_limit o) :
1391+
blsub.{u} o (λ x _, f x) = f o :=
1392+
begin
1393+
rw ←H.bsup_eq h,
1394+
exact ((bsup_eq_blsub_iff_lt_bsup _).2 (λ a ha, (H.1 a).trans_le (le_bsup _ _ (h.2 a ha)))).symm
1395+
end
1396+
14001397
end ordinal
14011398

14021399
/-! ### Results about injectivity and surjectivity -/

0 commit comments

Comments
 (0)