@@ -358,28 +358,29 @@ injective_of_increasing r (<) (typein r) (λ x y, (typein_lt_typein r).2)
358
358
{a b} : typein r a = typein r b ↔ a = b :=
359
359
(typein_injective r).eq_iff
360
360
361
+ /-- Principal segment version of the `typein` function, embedding a well order into
362
+ ordinals as a principal segment. -/
363
+ def typein.principal_seg (r : α → α → Prop ) [is_well_order α r] :
364
+ r ≺i ((<) : ordinal → ordinal → Prop ) :=
365
+ ⟨⟨⟨typein r, typein_injective r⟩, λ a b, typein_lt_typein r⟩, type r,
366
+ λ o, ⟨typein_surj r, λ ⟨a, h⟩, h ▸ typein_lt_type r a⟩⟩
367
+
368
+ @[simp] theorem typein.principal_seg_coe (r : α → α → Prop ) [is_well_order α r] :
369
+ (typein.principal_seg r : α → ordinal) = typein r := rfl
370
+
361
371
/-! ### Enumerating elements in a well-order with ordinals. -/
362
372
363
373
/-- `enum r o h` is the `o`-th element of `α` ordered by `r`.
364
374
That is, `enum` maps an initial segment of the ordinals, those
365
375
less than the order type of `r`, to the elements of `α`. -/
366
- def enum (r : α → α → Prop ) [is_well_order α r] (o) : o < type r → α :=
367
- quot.rec_on o (λ ⟨β, s, _⟩ h, (classical.choice h).top) $
368
- λ ⟨β, s, _⟩ ⟨γ, t, _⟩ ⟨h⟩, begin
369
- resetI, refine funext (λ (H₂ : type t < type r), _),
370
- have H₁ : type s < type r, {rwa type_eq.2 ⟨h⟩},
371
- have : ∀ {o e} (H : o < type r), @@eq.rec
372
- (λ (o : ordinal), o < type r → α)
373
- (λ (h : type s < type r), (classical.choice h).top)
374
- e H = (classical.choice H₁).top, {intros, subst e},
375
- exact (this H₂).trans (principal_seg.top_eq h
376
- (classical.choice H₁) (classical.choice H₂))
377
- end
376
+ def enum (r : α → α → Prop ) [is_well_order α r] (o) (h : o < type r) : α :=
377
+ (typein.principal_seg r).subrel_iso ⟨o, h⟩
378
378
379
379
theorem enum_type {α β} {r : α → α → Prop } {s : β → β → Prop }
380
380
[is_well_order α r] [is_well_order β s] (f : s ≺i r)
381
381
{h : type s < type r} : enum r (type s) h = f.top :=
382
- principal_seg.top_eq (rel_iso.refl _) _ _
382
+ (typein.principal_seg r).injective $
383
+ ((typein.principal_seg r).apply_subrel_iso _).trans (typein_top _).symm
383
384
384
385
@[simp] theorem enum_typein (r : α → α → Prop ) [is_well_order α r] (a : α) :
385
386
enum r (typein r a) (typein_lt_type r a) = a :=
@@ -412,13 +413,8 @@ lemma rel_iso_enum {α β : Type u} {r : α → α → Prop} {s : β → β →
412
413
rel_iso_enum' _ _ _ _
413
414
414
415
theorem lt_wf : @well_founded ordinal (<) :=
415
- ⟨λ a, induction_on a $ λ α r wo, by exactI
416
- suffices ∀ a, acc (<) (typein r a), from
417
- ⟨_, λ o h, let ⟨a, e⟩ := typein_surj r h in e ▸ this a⟩,
418
- λ a, acc.rec_on (wo.wf.apply a) $ λ x H IH, ⟨_, λ o h, begin
419
- rcases typein_surj r (lt_trans h (typein_lt_type r _)) with ⟨b, rfl⟩,
420
- exact IH _ ((typein_lt_typein r).1 h)
421
- end ⟩⟩
416
+ well_founded_iff_well_founded_subrel.mpr $ λ a, induction_on a $ λ α r wo, by exactI
417
+ rel_hom_class.well_founded (typein.principal_seg r).subrel_iso wo.wf
422
418
423
419
instance : has_well_founded ordinal := ⟨(<), lt_wf⟩
424
420
@@ -428,18 +424,6 @@ lemma induction {p : ordinal.{u} → Prop} (i : ordinal.{u})
428
424
(h : ∀ j, (∀ k, k < j → p k) → p j) : p i :=
429
425
lt_wf.induction i h
430
426
431
- /-- Principal segment version of the `typein` function, embedding a well order into
432
- ordinals as a principal segment. -/
433
- def typein.principal_seg {α : Type u} (r : α → α → Prop ) [is_well_order α r] :
434
- @principal_seg α ordinal.{u} r (<) :=
435
- ⟨rel_embedding.of_monotone (typein r)
436
- (λ a b, (typein_lt_typein r).2 ), type r, λ b,
437
- ⟨λ h, ⟨enum r _ h, typein_enum r h⟩,
438
- λ ⟨a, e⟩, e ▸ typein_lt_type _ _⟩⟩
439
-
440
- @[simp] theorem typein.principal_seg_coe (r : α → α → Prop ) [is_well_order α r] :
441
- (typein.principal_seg r : α → ordinal) = typein r := rfl
442
-
443
427
/-! ### Cardinality of ordinals -/
444
428
445
429
/-- The cardinal of an ordinal is the cardinality of any type on which a relation with that order
@@ -820,21 +804,13 @@ by { rw [←enum_typein (<) a, enum_le_enum', ←lt_succ_iff], apply typein_lt_s
820
804
821
805
@[simp] theorem enum_inj {r : α → α → Prop } [is_well_order α r] {o₁ o₂ : ordinal} (h₁ : o₁ < type r)
822
806
(h₂ : o₂ < type r) : enum r o₁ h₁ = enum r o₂ h₂ ↔ o₁ = o₂ :=
823
- ⟨λ h, begin
824
- by_contra hne,
825
- cases lt_or_gt_of_ne hne with hlt hlt;
826
- apply (is_well_order.is_irrefl r).1 ,
827
- { rwa [←@enum_lt_enum α r _ o₁ o₂ h₁ h₂, h] at hlt },
828
- { change _ < _ at hlt, rwa [←@enum_lt_enum α r _ o₂ o₁ h₂ h₁, h] at hlt }
829
- end , λ h, by simp_rw h⟩
807
+ (typein.principal_seg r).subrel_iso.injective.eq_iff.trans subtype.mk_eq_mk
830
808
831
809
/-- A well order `r` is order isomorphic to the set of ordinals smaller than `type r`. -/
832
810
@[simps] def enum_iso (r : α → α → Prop ) [is_well_order α r] : subrel (<) (< type r) ≃r r :=
833
811
{ to_fun := λ x, enum r x.1 x.2 ,
834
812
inv_fun := λ x, ⟨typein r x, typein_lt_type r x⟩,
835
- left_inv := λ ⟨o, h⟩, subtype.ext_val (typein_enum _ _),
836
- right_inv := λ h, enum_typein _ _,
837
- map_rel_iff' := by { rintros ⟨a, _⟩ ⟨b, _⟩, apply enum_lt_enum } }
813
+ ..(typein.principal_seg r).subrel_iso }
838
814
839
815
/-- The order isomorphism between ordinals less than `o` and `o.out.α`. -/
840
816
@[simps] noncomputable def enum_iso_out (o : ordinal) : set.Iio o ≃o o.out.α :=
0 commit comments