HepLean Documentation

Mathlib.SetTheory.Ordinal.Basic

Ordinals #

Ordinals are defined as equivalences of well-ordered sets under order isomorphism. They are endowed with a total order, where an ordinal is smaller than another one if it embeds into it as an initial segment (or, equivalently, in any way). This total order is well founded.

Main definitions #

A conditionally complete linear order with bot structure is registered on ordinals, where is 0, the ordinal corresponding to the empty type, and Inf is the minimum for nonempty sets and 0 for the empty set by convention.

Notations #

Definition of ordinals #

structure WellOrder :
Type (u + 1)

Bundled structure registering a well order on a type. Ordinals will be defined as a quotient of this type.

  • α : Type u

    The underlying type of the order.

  • r : selfselfProp

    The underlying relation of the order.

  • wo : IsWellOrder self self.r

    The proposition that r is a well-ordering for α.

Instances For
    Equations
    @[deprecated]
    theorem WellOrder.eta (o : WellOrder) :
    { α := o, r := o.r, wo := } = o

    Equivalence relation on well orders on arbitrary types in universe u, given by order isomorphism.

    Equations
    • One or more equations did not get rendered due to their size.
    def Ordinal :
    Type (u + 1)

    Ordinal.{u} is the type of well orders in Type u, up to order isomorphism.

    Equations
    Instances For

      A "canonical" type order-isomorphic to the ordinal o, living in the same universe. This is defined through the axiom of choice.

      Use this over Iio o only when it is paramount to have a Type u rather than a Type (u + 1).

      Equations
      Instances For
        Equations
        Equations
        • =

        Basic properties of the order type #

        def Ordinal.type {α : Type u} (r : ααProp) [wo : IsWellOrder α r] :

        The order type of a well order is an ordinal.

        Equations
        Instances For
          Equations
          Equations
          @[deprecated]
          theorem Ordinal.type_def' (w : WellOrder) :
          w = Ordinal.type w.r

          Avoid using Quotient.mk to construct an Ordinal directly

          @[deprecated]
          theorem Ordinal.type_def {α : Type u} (r : ααProp) [wo : IsWellOrder α r] :
          { α := α, r := r, wo := wo } = Ordinal.type r

          Avoid using Quotient.mk to construct an Ordinal directly

          @[simp]
          theorem Ordinal.type_toType (o : Ordinal.{u_1}) :
          (Ordinal.type fun (x1 x2 : o.toType) => x1 < x2) = o
          @[deprecated Ordinal.type_toType]
          theorem Ordinal.type_lt (o : Ordinal.{u_1}) :
          (Ordinal.type fun (x1 x2 : o.toType) => x1 < x2) = o
          @[deprecated Ordinal.type_toType]
          theorem Ordinal.type_eq {α β : Type u_1} {r : ααProp} {s : ββProp} [IsWellOrder α r] [IsWellOrder β s] :
          theorem RelIso.ordinal_type_eq {α β : Type u_1} {r : ααProp} {s : ββProp} [IsWellOrder α r] [IsWellOrder β s] (h : r ≃r s) :
          theorem Ordinal.type_eq_zero_of_empty {α : Type u} (r : ααProp) [IsWellOrder α r] [IsEmpty α] :
          @[simp]
          theorem Ordinal.type_eq_zero_iff_isEmpty {α : Type u} {r : ααProp} [IsWellOrder α r] :
          theorem Ordinal.type_ne_zero_iff_nonempty {α : Type u} {r : ααProp} [IsWellOrder α r] :
          theorem Ordinal.type_ne_zero_of_nonempty {α : Type u} (r : ααProp) [IsWellOrder α r] [h : Nonempty α] :
          theorem Ordinal.type_pEmpty :
          Ordinal.type EmptyRelation = 0
          theorem Ordinal.type_empty :
          Ordinal.type EmptyRelation = 0
          theorem Ordinal.type_eq_one_of_unique {α : Type u} (r : ααProp) [IsWellOrder α r] [Nonempty α] [Subsingleton α] :
          @[simp]
          theorem Ordinal.type_eq_one_iff_unique {α : Type u} {r : ααProp} [IsWellOrder α r] :
          theorem Ordinal.type_pUnit :
          Ordinal.type EmptyRelation = 1
          theorem Ordinal.type_unit :
          Ordinal.type EmptyRelation = 1
          @[deprecated Ordinal.toType_empty_iff_eq_zero]

          Alias of Ordinal.toType_empty_iff_eq_zero.

          @[deprecated Ordinal.toType_empty_iff_eq_zero]
          theorem Ordinal.eq_zero_of_out_empty (o : Ordinal.{u_1}) [h : IsEmpty o.toType] :
          o = 0
          @[deprecated Ordinal.toType_nonempty_iff_ne_zero]

          Alias of Ordinal.toType_nonempty_iff_ne_zero.

          @[deprecated Ordinal.toType_nonempty_iff_ne_zero]
          theorem Ordinal.ne_zero_of_out_nonempty (o : Ordinal.{u_1}) [h : Nonempty o.toType] :
          o 0
          theorem Ordinal.inductionOn {C : Ordinal.{u_1}Prop} (o : Ordinal.{u_1}) (H : ∀ (α : Type u_1) (r : ααProp) [inst : IsWellOrder α r], C (Ordinal.type r)) :
          C o
          theorem Ordinal.inductionOn₂ {C : Ordinal.{u_1}Ordinal.{u_2}Prop} (o₁ : Ordinal.{u_1}) (o₂ : Ordinal.{u_2}) (H : ∀ (α : Type u_1) (r : ααProp) [inst : IsWellOrder α r] (β : Type u_2) (s : ββProp) [inst_1 : IsWellOrder β s], C (Ordinal.type r) (Ordinal.type s)) :
          C o₁ o₂
          theorem Ordinal.inductionOn₃ {C : Ordinal.{u_1}Ordinal.{u_2}Ordinal.{u_3}Prop} (o₁ : Ordinal.{u_1}) (o₂ : Ordinal.{u_2}) (o₃ : Ordinal.{u_3}) (H : ∀ (α : Type u_1) (r : ααProp) [inst : IsWellOrder α r] (β : Type u_2) (s : ββProp) [inst_1 : IsWellOrder β s] (γ : Type u_3) (t : γγProp) [inst_2 : IsWellOrder γ t], C (Ordinal.type r) (Ordinal.type s) (Ordinal.type t)) :
          C o₁ o₂ o₃

          The order on ordinals #

          For Ordinal:

          • less-equal is defined such that well orders r and s satisfy type rtype s if there exists a function embedding r as an initial segment of s.
          • less-than is defined such that well orders r and s satisfy type r < type s if there exists a function embedding r as a principal segment of s.

          Note that most of the relevant results on initial and principal segments are proved in the Order.InitialSeg file.

          Equations
          Equations
          • One or more equations did not get rendered due to their size.
          theorem InitialSeg.ordinal_type_le {α β : Type u_1} {r : ααProp} {s : ββProp} [IsWellOrder α r] [IsWellOrder β s] (h : r ≼i s) :
          theorem RelEmbedding.ordinal_type_le {α β : Type u_1} {r : ααProp} {s : ββProp} [IsWellOrder α r] [IsWellOrder β s] (h : r ↪r s) :
          theorem PrincipalSeg.ordinal_type_lt {α β : Type u_1} {r : ααProp} {s : ββProp} [IsWellOrder α r] [IsWellOrder β s] (h : r ≺i s) :
          @[simp]
          theorem Ordinal.zero_le (o : Ordinal.{u_1}) :
          0 o
          @[simp]
          @[simp]
          theorem Ordinal.le_zero {o : Ordinal.{u_1}} :
          o 0 o = 0
          theorem Ordinal.type_le_iff {α β : Type u_1} {r : ααProp} {s : ββProp} [IsWellOrder α r] [IsWellOrder β s] :
          theorem Ordinal.type_le_iff' {α β : Type u_1} {r : ααProp} {s : ββProp} [IsWellOrder α r] [IsWellOrder β s] :
          theorem Ordinal.type_lt_iff {α β : Type u_1} {r : ααProp} {s : ββProp} [IsWellOrder α r] [IsWellOrder β s] :
          def Ordinal.initialSegToType {α β : Ordinal.{u_1}} (h : α β) :
          (fun (x1 x2 : α.toType) => x1 < x2) ≼i fun (x1 x2 : β.toType) => x1 < x2

          Given two ordinals α ≤ β, then initialSegToType α β is the initial segment embedding of α.toType into β.toType.

          Equations
          Instances For
            @[deprecated Ordinal.initialSegToType]
            def Ordinal.initialSegOut {α β : Ordinal.{u_1}} (h : α β) :
            (fun (x1 x2 : α.toType) => x1 < x2) ≼i fun (x1 x2 : β.toType) => x1 < x2

            Alias of Ordinal.initialSegToType.


            Given two ordinals α ≤ β, then initialSegToType α β is the initial segment embedding of α.toType into β.toType.

            Equations
            Instances For
              def Ordinal.principalSegToType {α β : Ordinal.{u_1}} (h : α < β) :
              (fun (x1 x2 : α.toType) => x1 < x2) ≺i fun (x1 x2 : β.toType) => x1 < x2

              Given two ordinals α < β, then principalSegToType α β is the principal segment embedding of α.toType into β.toType.

              Equations
              Instances For
                @[deprecated Ordinal.principalSegToType]
                def Ordinal.principalSegOut {α β : Ordinal.{u_1}} (h : α < β) :
                (fun (x1 x2 : α.toType) => x1 < x2) ≺i fun (x1 x2 : β.toType) => x1 < x2

                Alias of Ordinal.principalSegToType.


                Given two ordinals α < β, then principalSegToType α β is the principal segment embedding of α.toType into β.toType.

                Equations
                Instances For

                  Enumerating elements in a well-order with ordinals #

                  def Ordinal.typein {α : Type u} (r : ααProp) [IsWellOrder α r] :
                  r ≺i fun (x1 x2 : Ordinal.{u}) => x1 < x2

                  The order type of an element inside a well order.

                  This is registered as a principal segment embedding into the ordinals, with top type r.

                  Equations
                  Instances For
                    @[deprecated Ordinal.typein]
                    def Ordinal.typein.principalSeg {α : Type u} (r : ααProp) [IsWellOrder α r] :
                    r ≺i fun (x1 x2 : Ordinal.{u}) => x1 < x2

                    Alias of Ordinal.typein.


                    The order type of an element inside a well order.

                    This is registered as a principal segment embedding into the ordinals, with top type r.

                    Equations
                    Instances For
                      @[deprecated]
                      theorem Ordinal.typein.principalSeg_coe {α : Type u} (r : ααProp) [IsWellOrder α r] :
                      (Ordinal.typein.principalSeg r).toRelEmbedding = (Ordinal.typein r).toRelEmbedding
                      @[simp]
                      theorem Ordinal.type_subrel {α : Type u} (r : ααProp) [IsWellOrder α r] (a : α) :
                      Ordinal.type (Subrel r {b : α | r b a}) = (Ordinal.typein r).toRelEmbedding a
                      @[simp]
                      theorem Ordinal.top_typein {α : Type u} (r : ααProp) [IsWellOrder α r] :
                      theorem Ordinal.typein_lt_type {α : Type u} (r : ααProp) [IsWellOrder α r] (a : α) :
                      (Ordinal.typein r).toRelEmbedding a < Ordinal.type r
                      theorem Ordinal.typein_lt_self {o : Ordinal.{u_1}} (i : o.toType) :
                      (Ordinal.typein fun (x1 x2 : o.toType) => x1 < x2).toRelEmbedding i < o
                      @[simp]
                      theorem Ordinal.typein_top {α β : Type u_1} {r : ααProp} {s : ββProp} [IsWellOrder α r] [IsWellOrder β s] (f : r ≺i s) :
                      (Ordinal.typein s).toRelEmbedding f.top = Ordinal.type r
                      @[simp]
                      theorem Ordinal.typein_lt_typein {α : Type u} (r : ααProp) [IsWellOrder α r] {a b : α} :
                      (Ordinal.typein r).toRelEmbedding a < (Ordinal.typein r).toRelEmbedding b r a b
                      @[simp]
                      theorem Ordinal.typein_le_typein {α : Type u} (r : ααProp) [IsWellOrder α r] {a b : α} :
                      (Ordinal.typein r).toRelEmbedding a (Ordinal.typein r).toRelEmbedding b ¬r b a
                      theorem Ordinal.typein_injective {α : Type u} (r : ααProp) [IsWellOrder α r] :
                      Function.Injective (Ordinal.typein r).toRelEmbedding
                      theorem Ordinal.typein_inj {α : Type u} (r : ααProp) [IsWellOrder α r] {a b : α} :
                      (Ordinal.typein r).toRelEmbedding a = (Ordinal.typein r).toRelEmbedding b a = b
                      theorem Ordinal.mem_range_typein_iff {α : Type u} (r : ααProp) [IsWellOrder α r] {o : Ordinal.{u}} :
                      o Set.range (Ordinal.typein r).toRelEmbedding o < Ordinal.type r
                      theorem Ordinal.typein_surj {α : Type u} (r : ααProp) [IsWellOrder α r] {o : Ordinal.{u}} (h : o < Ordinal.type r) :
                      o Set.range (Ordinal.typein r).toRelEmbedding
                      theorem Ordinal.typein_surjOn {α : Type u} (r : ααProp) [IsWellOrder α r] :
                      Set.SurjOn (⇑(Ordinal.typein r).toRelEmbedding) Set.univ (Set.Iio (Ordinal.type r))
                      def Ordinal.enum {α : Type u} (r : ααProp) [IsWellOrder α r] :
                      Subrel (fun (x1 x2 : Ordinal.{u}) => x1 < x2) {o : Ordinal.{u} | o < Ordinal.type r} ≃r r

                      A well order r is order-isomorphic to the set of ordinals smaller than type r. enum r ⟨o, h⟩ is the o-th element of α ordered by r.

                      That is, enum maps an initial segment of the ordinals, those less than the order type of r, to the elements of α.

                      Equations
                      Instances For
                        @[simp]
                        theorem Ordinal.enum_symm_apply_coe {α : Type u} (r : ααProp) [IsWellOrder α r] (a✝ : α) :
                        ((Ordinal.enum r).symm a✝) = (Ordinal.typein r).toRelEmbedding a✝
                        @[simp]
                        theorem Ordinal.typein_enum {α : Type u} (r : ααProp) [IsWellOrder α r] {o : Ordinal.{u}} (h : o < Ordinal.type r) :
                        (Ordinal.typein r).toRelEmbedding ((Ordinal.enum r) o, h) = o
                        theorem Ordinal.enum_type {α β : Type u_1} {r : ααProp} {s : ββProp} [IsWellOrder α r] [IsWellOrder β s] (f : s ≺i r) {h : Ordinal.type s < Ordinal.type r} :
                        (Ordinal.enum r) Ordinal.type s, h = f.top
                        @[simp]
                        theorem Ordinal.enum_typein {α : Type u} (r : ααProp) [IsWellOrder α r] (a : α) :
                        (Ordinal.enum r) (Ordinal.typein r).toRelEmbedding a, = a
                        theorem Ordinal.enum_lt_enum {α : Type u} {r : ααProp} [IsWellOrder α r] {o₁ o₂ : { o : Ordinal.{u} // o < Ordinal.type r }} :
                        r ((Ordinal.enum r) o₁) ((Ordinal.enum r) o₂) o₁ < o₂
                        theorem Ordinal.enum_le_enum {α : Type u} (r : ααProp) [IsWellOrder α r] {o₁ o₂ : { o : Ordinal.{u} // o < Ordinal.type r }} :
                        ¬r ((Ordinal.enum r) o₁) ((Ordinal.enum r) o₂) o₂ o₁
                        @[simp]
                        theorem Ordinal.enum_le_enum' (a : Ordinal.{u_1}) {o₁ o₂ : { o : Ordinal.{u_1} // o < Ordinal.type fun (x1 x2 : a.toType) => x1 < x2 }} :
                        (Ordinal.enum fun (x1 x2 : a.toType) => x1 < x2) o₁ (Ordinal.enum fun (x1 x2 : a.toType) => x1 < x2) o₂ o₁ o₂
                        theorem Ordinal.enum_inj {α : Type u} {r : ααProp} [IsWellOrder α r] {o₁ o₂ : { o : Ordinal.{u} // o < Ordinal.type r }} :
                        (Ordinal.enum r) o₁ = (Ordinal.enum r) o₂ o₁ = o₂
                        theorem Ordinal.enum_zero_le {α : Type u} {r : ααProp} [IsWellOrder α r] (h0 : 0 < Ordinal.type r) (a : α) :
                        ¬r a ((Ordinal.enum r) 0, h0)
                        theorem Ordinal.enum_zero_le' {o : Ordinal.{u_1}} (h0 : 0 < o) (a : o.toType) :
                        (Ordinal.enum fun (x1 x2 : o.toType) => x1 < x2) 0, a
                        theorem Ordinal.relIso_enum' {α β : Type u} {r : ααProp} {s : ββProp} [IsWellOrder α r] [IsWellOrder β s] (f : r ≃r s) (o : Ordinal.{u}) (hr : o < Ordinal.type r) (hs : o < Ordinal.type s) :
                        f ((Ordinal.enum r) o, hr) = (Ordinal.enum s) o, hs
                        theorem Ordinal.relIso_enum {α β : Type u} {r : ααProp} {s : ββProp} [IsWellOrder α r] [IsWellOrder β s] (f : r ≃r s) (o : Ordinal.{u}) (hr : o < Ordinal.type r) :
                        f ((Ordinal.enum r) o, hr) = (Ordinal.enum s) o,
                        noncomputable def Ordinal.enumIsoToType (o : Ordinal.{u_1}) :
                        (Set.Iio o) ≃o o.toType

                        The order isomorphism between ordinals less than o and o.toType.

                        Equations
                        • One or more equations did not get rendered due to their size.
                        Instances For
                          theorem Ordinal.enumIsoToType_symm_apply_coe (o : Ordinal.{u_1}) (x : o.toType) :
                          ((RelIso.symm o.enumIsoToType) x) = (Ordinal.typein fun (x1 x2 : o.toType) => x1 < x2).toRelEmbedding x
                          theorem Ordinal.enumIsoToType_apply (o : Ordinal.{u_1}) (x : (Set.Iio o)) :
                          o.enumIsoToType x = (Ordinal.enum fun (x1 x2 : o.toType) => x1 < x2) x,
                          @[deprecated Ordinal.enumIsoToType]
                          def Ordinal.enumIsoOut (o : Ordinal.{u_1}) :
                          (Set.Iio o) ≃o o.toType

                          Alias of Ordinal.enumIsoToType.


                          The order isomorphism between ordinals less than o and o.toType.

                          Equations
                          Instances For
                            Equations
                            • =
                            Equations
                            • =
                            Equations
                            • =
                            Equations
                            • =
                            Equations
                            • =
                            Equations
                            • =
                            def Ordinal.toTypeOrderBotOfPos {o : Ordinal.{u_1}} (ho : 0 < o) :
                            OrderBot o.toType

                            o.toType is an OrderBot whenever 0 < o.

                            Equations
                            Instances For
                              @[deprecated Ordinal.toTypeOrderBotOfPos]
                              def Ordinal.outOrderBotOfPos {o : Ordinal.{u_1}} (ho : 0 < o) :
                              OrderBot o.toType

                              Alias of Ordinal.toTypeOrderBotOfPos.


                              o.toType is an OrderBot whenever 0 < o.

                              Equations
                              Instances For
                                theorem Ordinal.enum_zero_eq_bot {o : Ordinal.{u_1}} (ho : 0 < o) :
                                (Ordinal.enum fun (x1 x2 : o.toType) => x1 < x2) 0, = let_fun H := Ordinal.toTypeOrderBotOfPos ho;
                                theorem Ordinal.lt_wf :
                                WellFounded fun (x1 x2 : Ordinal.{u_1}) => x1 < x2
                                theorem Ordinal.induction {p : Ordinal.{u}Prop} (i : Ordinal.{u}) (h : ∀ (j : Ordinal.{u}), (∀ k < j, p k)p j) :
                                p i

                                Reformulation of well founded induction on ordinals as a lemma that works with the induction tactic, as in induction i using Ordinal.induction with | h i IH => ?_.

                                theorem Ordinal.typein_apply {α β : Type u_1} {r : ααProp} {s : ββProp} [IsWellOrder α r] [IsWellOrder β s] (f : r ≼i s) (a : α) :
                                (Ordinal.typein s).toRelEmbedding (f a) = (Ordinal.typein r).toRelEmbedding a

                                Cardinality of ordinals #

                                The cardinal of an ordinal is the cardinality of any type on which a relation with that order type is defined.

                                Equations
                                Instances For
                                  @[simp]
                                  theorem Ordinal.card_type {α : Type u} (r : ααProp) [IsWellOrder α r] :
                                  @[simp]
                                  theorem Ordinal.card_typein {α : Type u} {r : ααProp} [IsWellOrder α r] (x : α) :
                                  Cardinal.mk { y : α // r y x } = ((Ordinal.typein r).toRelEmbedding x).card
                                  theorem Ordinal.card_le_card {o₁ o₂ : Ordinal.{u_1}} :
                                  o₁ o₂o₁.card o₂.card

                                  Lifting ordinals to a higher universe #

                                  The universe lift operation for ordinals, which embeds Ordinal.{u} as a proper initial segment of Ordinal.{v} for v > u. For the initial segment version, see liftInitialSeg.

                                  Equations
                                  Instances For
                                    @[simp]
                                    theorem Ordinal.type_uLift {α : Type u} (r : ααProp) [IsWellOrder α r] :
                                    theorem RelIso.ordinal_lift_type_eq {α : Type u} {β : Type v} {r : ααProp} {s : ββProp} [IsWellOrder α r] [IsWellOrder β s] (f : r ≃r s) :
                                    @[simp]
                                    theorem Ordinal.type_preimage {α β : Type u} (r : ααProp) [IsWellOrder α r] (f : β α) :
                                    @[simp]
                                    theorem Ordinal.type_lift_preimage {α : Type u} {β : Type v} (r : ααProp) [IsWellOrder α r] (f : β α) :
                                    @[deprecated Ordinal.type_lift_preimage_aux]
                                    theorem Ordinal.type_lift_preimage_aux {α : Type u} {β : Type v} (r : ααProp) [IsWellOrder α r] (f : β α) :
                                    Ordinal.lift.{u, v} (Ordinal.type fun (x y : β) => r (f x) (f y)) = Ordinal.lift.{v, u} (Ordinal.type r)

                                    lift.{max u v, u} equals lift.{v, u}.

                                    Unfortunately, the simp lemma doesn't seem to work.

                                    @[deprecated Ordinal.lift_umax]

                                    lift.{max v u, u} equals lift.{v, u}.

                                    Unfortunately, the simp lemma doesn't seem to work.

                                    An ordinal lifted to a lower or equal universe equals itself.

                                    Unfortunately, the simp lemma doesn't work.

                                    @[simp]

                                    An ordinal lifted to the same universe equals itself.

                                    @[simp]

                                    An ordinal lifted to the zero universe equals itself.

                                    theorem Ordinal.lift_type_le {α : Type u} {β : Type v} {r : ααProp} {s : ββProp} [IsWellOrder α r] [IsWellOrder β s] :
                                    theorem Ordinal.lift_type_eq {α : Type u} {β : Type v} {r : ααProp} {s : ββProp} [IsWellOrder α r] [IsWellOrder β s] :
                                    theorem Ordinal.lift_type_lt {α : Type u} {β : Type v} {r : ααProp} {s : ββProp} [IsWellOrder α r] [IsWellOrder β s] :
                                    @[simp]
                                    theorem Ordinal.lift_typein_top {α : Type u} {β : Type v} {r : ααProp} {s : ββProp} [IsWellOrder α r] [IsWellOrder β s] (f : r ≺i s) :
                                    def Ordinal.liftInitialSeg :
                                    (fun (x1 x2 : Ordinal.{v}) => x1 < x2) ≼i fun (x1 x2 : Ordinal.{max u v} ) => x1 < x2

                                    Initial segment version of the lift operation on ordinals, embedding Ordinal.{u} in Ordinal.{v} as an initial segment when u ≤ v.

                                    Equations
                                    Instances For
                                      @[deprecated Ordinal.liftInitialSeg]
                                      def Ordinal.lift.initialSeg :
                                      (fun (x1 x2 : Ordinal.{v}) => x1 < x2) ≼i fun (x1 x2 : Ordinal.{max u v} ) => x1 < x2

                                      Alias of Ordinal.liftInitialSeg.


                                      Initial segment version of the lift operation on ordinals, embedding Ordinal.{u} in Ordinal.{v} as an initial segment when u ≤ v.

                                      Equations
                                      Instances For
                                        @[deprecated Ordinal.liftInitialSeg_coe]
                                        @[deprecated Ordinal.mem_range_lift_of_le]

                                        The first infinite ordinal ω #

                                        ω is the first infinite ordinal, defined as the order type of .

                                        Equations
                                        Instances For

                                          ω is the first infinite ordinal, defined as the order type of .

                                          Equations
                                          Instances For
                                            @[simp]
                                            theorem Ordinal.type_nat_lt :
                                            (Ordinal.type fun (x1 x2 : ) => x1 < x2) = Ordinal.omega0

                                            Note that the presence of this lemma makes simp [omega0] form a loop.

                                            Definition and first properties of addition on ordinals #

                                            In this paragraph, we introduce the addition on ordinals, and prove just enough properties to deduce that the order on ordinals is total (and therefore well-founded). Further properties of the addition, together with properties of the other operations, are proved in Mathlib/SetTheory/Ordinal/Arithmetic.lean.

                                            o₁ + o₂ is the order on the disjoint union of o₁ and o₂ obtained by declaring that every element of o₁ is smaller than every element of o₂.

                                            Equations
                                            • One or more equations did not get rendered due to their size.
                                            @[simp]
                                            theorem Ordinal.card_add (o₁ o₂ : Ordinal.{u_1}) :
                                            (o₁ + o₂).card = o₁.card + o₂.card
                                            @[simp]
                                            theorem Ordinal.type_sum_lex {α β : Type u} (r : ααProp) (s : ββProp) [IsWellOrder α r] [IsWellOrder β s] :
                                            @[simp]
                                            theorem Ordinal.card_nat (n : ) :
                                            (↑n).card = n
                                            @[simp]
                                            theorem Ordinal.card_ofNat (n : ) [n.AtLeastTwo] :
                                            @[simp]
                                            theorem Ordinal.max_eq_zero {a b : Ordinal.{u_1}} :
                                            a b = 0 a = 0 b = 0
                                            @[simp]

                                            Successor order properties #

                                            @[simp]
                                            @[simp]
                                            theorem Ordinal.add_succ (o₁ o₂ : Ordinal.{u_1}) :
                                            o₁ + Order.succ o₂ = Order.succ (o₁ + o₂)
                                            @[deprecated Order.one_le_iff_pos]
                                            @[simp]
                                            theorem Ordinal.le_one_iff {a : Ordinal.{u_1}} :
                                            a 1 a = 0 a = 1
                                            @[simp]
                                            theorem Ordinal.card_succ (o : Ordinal.{u_1}) :
                                            (Order.succ o).card = o.card + 1
                                            theorem Ordinal.natCast_succ (n : ) :
                                            n.succ = Order.succ n
                                            @[deprecated Ordinal.natCast_succ]
                                            theorem Ordinal.nat_cast_succ (n : ) :
                                            n.succ = Order.succ n

                                            Alias of Ordinal.natCast_succ.

                                            theorem Ordinal.one_toType_eq (x : Ordinal.toType 1) :
                                            x = (Ordinal.enum fun (x1 x2 : Ordinal.toType 1) => x1 < x2) 0,
                                            @[deprecated Ordinal.one_toType_eq]
                                            theorem Ordinal.one_out_eq (x : Ordinal.toType 1) :
                                            x = (Ordinal.enum fun (x1 x2 : Ordinal.toType 1) => x1 < x2) 0,

                                            Alias of Ordinal.one_toType_eq.

                                            Extra properties of typein and enum #

                                            @[simp]
                                            theorem Ordinal.typein_one_toType (x : Ordinal.toType 1) :
                                            (Ordinal.typein fun (x1 x2 : Ordinal.toType 1) => x1 < x2).toRelEmbedding x = 0
                                            @[deprecated Ordinal.typein_one_toType]
                                            theorem Ordinal.typein_one_out (x : Ordinal.toType 1) :
                                            (Ordinal.typein fun (x1 x2 : Ordinal.toType 1) => x1 < x2).toRelEmbedding x = 0

                                            Alias of Ordinal.typein_one_toType.

                                            theorem Ordinal.typein_le_typein' (o : Ordinal.{u_1}) {x y : o.toType} :
                                            (Ordinal.typein fun (x1 x2 : o.toType) => x1 < x2).toRelEmbedding x (Ordinal.typein fun (x1 x2 : o.toType) => x1 < x2).toRelEmbedding y x y
                                            theorem Ordinal.le_enum_succ {o : Ordinal.{u_1}} (a : (Order.succ o).toType) :
                                            a (Ordinal.enum fun (x1 x2 : (Order.succ o).toType) => x1 < x2) o,

                                            Universal ordinal #

                                            univ.{u v} is the order type of the ordinals of Type u as a member of Ordinal.{v} (when u < v). It is an inaccessible cardinal.

                                            Equations
                                            Instances For
                                              def Ordinal.liftPrincipalSeg :
                                              (fun (x1 x2 : Ordinal.{u}) => x1 < x2) ≺i fun (x1 x2 : Ordinal.{max (u + 1) v} ) => x1 < x2

                                              Principal segment version of the lift operation on ordinals, embedding Ordinal.{u} in Ordinal.{v} as a principal segment when u < v.

                                              Equations
                                              Instances For
                                                @[deprecated Ordinal.liftPrincipalSeg]
                                                def Ordinal.lift.principalSeg :
                                                (fun (x1 x2 : Ordinal.{u}) => x1 < x2) ≺i fun (x1 x2 : Ordinal.{max (u + 1) v} ) => x1 < x2

                                                Alias of Ordinal.liftPrincipalSeg.


                                                Principal segment version of the lift operation on ordinals, embedding Ordinal.{u} in Ordinal.{v} as a principal segment when u < v.

                                                Equations
                                                Instances For
                                                  @[deprecated Ordinal.liftPrincipalSeg_coe]
                                                  @[deprecated Ordinal.liftPrincipalSeg_top]
                                                  @[deprecated Ordinal.liftPrincipalSeg_top]

                                                  Representing a cardinal with an ordinal #

                                                  @[simp]
                                                  theorem Cardinal.mk_toType (o : Ordinal.{u_1}) :
                                                  Cardinal.mk o.toType = o.card
                                                  @[deprecated Cardinal.mk_toType]
                                                  theorem Cardinal.mk_ordinal_out (o : Ordinal.{u_1}) :
                                                  Cardinal.mk o.toType = o.card

                                                  Alias of Cardinal.mk_toType.

                                                  The ordinal corresponding to a cardinal c is the least ordinal whose cardinal is c. For the order-embedding version, see ord.order_embedding.

                                                  Equations
                                                  Instances For
                                                    theorem Cardinal.ord_eq_Inf (α : Type u) :
                                                    (Cardinal.mk α).ord = ⨅ (r : { r : ααProp // IsWellOrder α r }), Ordinal.type r
                                                    theorem Cardinal.ord_eq (α : Type u_1) :
                                                    ∃ (r : ααProp) (wo : IsWellOrder α r), (Cardinal.mk α).ord = Ordinal.type r
                                                    theorem Cardinal.ord_le_type {α : Type u} (r : ααProp) [h : IsWellOrder α r] :
                                                    theorem Cardinal.ord_le {c : Cardinal.{u_1}} {o : Ordinal.{u_1}} :
                                                    c.ord o c o.card
                                                    theorem Cardinal.lt_ord {c : Cardinal.{u_1}} {o : Ordinal.{u_1}} :
                                                    o < c.ord o.card < c
                                                    @[simp]
                                                    theorem Cardinal.card_ord (c : Cardinal.{u_1}) :
                                                    c.ord.card = c
                                                    theorem Cardinal.ord_card_le (o : Ordinal.{u_1}) :
                                                    o.card.ord o
                                                    theorem Cardinal.card_le_of_le_ord {o : Ordinal.{u_1}} {c : Cardinal.{u_1}} (ho : o c.ord) :
                                                    o.card c

                                                    A variation on Cardinal.lt_ord using : If o is no greater than the initial ordinal of cardinality c, then its cardinal is no greater than c.

                                                    The converse, however, is false (for instance, o = ω+1 and c = ℵ₀).

                                                    @[simp]
                                                    theorem Cardinal.ord_le_ord {c₁ c₂ : Cardinal.{u_1}} :
                                                    c₁.ord c₂.ord c₁ c₂
                                                    @[simp]
                                                    theorem Cardinal.ord_lt_ord {c₁ c₂ : Cardinal.{u_1}} :
                                                    c₁.ord < c₂.ord c₁ < c₂
                                                    @[simp]
                                                    theorem Cardinal.ord_nat (n : ) :
                                                    (↑n).ord = n
                                                    @[simp]
                                                    theorem Cardinal.ord_ofNat (n : ) [n.AtLeastTwo] :
                                                    @[deprecated Cardinal.mk_ord_toType]
                                                    theorem Cardinal.mk_ord_out (c : Cardinal.{u_1}) :
                                                    Cardinal.mk c.ord.toType = c

                                                    Alias of Cardinal.mk_ord_toType.

                                                    theorem Cardinal.card_typein_lt {α : Type u} (r : ααProp) [IsWellOrder α r] (x : α) (h : (Cardinal.mk α).ord = Ordinal.type r) :
                                                    ((Ordinal.typein r).toRelEmbedding x).card < Cardinal.mk α
                                                    theorem Cardinal.card_typein_toType_lt (c : Cardinal.{u_1}) (x : c.ord.toType) :
                                                    ((Ordinal.typein fun (x1 x2 : c.ord.toType) => x1 < x2).toRelEmbedding x).card < c
                                                    @[deprecated Cardinal.card_typein_toType_lt]
                                                    theorem Cardinal.card_typein_out_lt (c : Cardinal.{u_1}) (x : c.ord.toType) :
                                                    ((Ordinal.typein fun (x1 x2 : c.ord.toType) => x1 < x2).toRelEmbedding x).card < c

                                                    Alias of Cardinal.card_typein_toType_lt.

                                                    theorem Cardinal.mk_Iio_ord_toType {c : Cardinal.{u_1}} (i : c.ord.toType) :
                                                    @[deprecated Cardinal.mk_Iio_ord_toType]
                                                    theorem Cardinal.mk_Iio_ord_out_α {c : Cardinal.{u_1}} (i : c.ord.toType) :

                                                    Alias of Cardinal.mk_Iio_ord_toType.

                                                    @[simp]
                                                    theorem Cardinal.ord_inj {a b : Cardinal.{u_1}} :
                                                    a.ord = b.ord a = b
                                                    @[simp]
                                                    theorem Cardinal.ord_eq_zero {a : Cardinal.{u_1}} :
                                                    a.ord = 0 a = 0
                                                    @[simp]
                                                    theorem Cardinal.ord_eq_one {a : Cardinal.{u_1}} :
                                                    a.ord = 1 a = 1

                                                    The ordinal corresponding to a cardinal c is the least ordinal whose cardinal is c. This is the order-embedding version. For the regular function, see ord.

                                                    Equations
                                                    Instances For

                                                      The cardinal univ is the cardinality of ordinal univ, or equivalently the cardinal of Ordinal.{u}, or Cardinal.{u}, as an element of Cardinal.{v} (when u < v).

                                                      Equations
                                                      Instances For
                                                        @[simp]
                                                        theorem Ordinal.nat_le_card {o : Ordinal.{u_1}} {n : } :
                                                        n o.card n o
                                                        @[simp]
                                                        theorem Ordinal.one_le_card {o : Ordinal.{u_1}} :
                                                        1 o.card 1 o
                                                        @[simp]
                                                        theorem Ordinal.ofNat_le_card {o : Ordinal.{u_1}} {n : } [n.AtLeastTwo] :
                                                        @[simp]
                                                        theorem Ordinal.nat_lt_card {o : Ordinal.{u_1}} {n : } :
                                                        n < o.card n < o
                                                        @[simp]
                                                        theorem Ordinal.zero_lt_card {o : Ordinal.{u_1}} :
                                                        0 < o.card 0 < o
                                                        @[simp]
                                                        theorem Ordinal.one_lt_card {o : Ordinal.{u_1}} :
                                                        1 < o.card 1 < o
                                                        @[simp]
                                                        theorem Ordinal.ofNat_lt_card {o : Ordinal.{u_1}} {n : } [n.AtLeastTwo] :
                                                        @[simp]
                                                        theorem Ordinal.card_lt_nat {o : Ordinal.{u_1}} {n : } :
                                                        o.card < n o < n
                                                        @[simp]
                                                        theorem Ordinal.card_lt_ofNat {o : Ordinal.{u_1}} {n : } [n.AtLeastTwo] :
                                                        @[simp]
                                                        theorem Ordinal.card_le_nat {o : Ordinal.{u_1}} {n : } :
                                                        o.card n o n
                                                        @[simp]
                                                        theorem Ordinal.card_le_one {o : Ordinal.{u_1}} :
                                                        o.card 1 o 1
                                                        @[simp]
                                                        theorem Ordinal.card_le_ofNat {o : Ordinal.{u_1}} {n : } [n.AtLeastTwo] :
                                                        @[simp]
                                                        theorem Ordinal.card_eq_nat {o : Ordinal.{u_1}} {n : } :
                                                        o.card = n o = n
                                                        @[simp]
                                                        theorem Ordinal.card_eq_zero {o : Ordinal.{u_1}} :
                                                        o.card = 0 o = 0
                                                        @[simp]
                                                        theorem Ordinal.card_eq_one {o : Ordinal.{u_1}} :
                                                        o.card = 1 o = 1
                                                        @[deprecated Ordinal.mem_range_lift_of_card_le]
                                                        @[simp]
                                                        theorem Ordinal.card_eq_ofNat {o : Ordinal.{u_1}} {n : } [n.AtLeastTwo] :
                                                        @[simp]
                                                        theorem Ordinal.type_fintype {α : Type u} (r : ααProp) [IsWellOrder α r] [Fintype α] :
                                                        theorem Ordinal.type_fin (n : ) :
                                                        (Ordinal.type fun (x1 x2 : Fin n) => x1 < x2) = n

                                                        Sorted lists #

                                                        theorem List.Sorted.lt_ord_of_lt {α : Type u} [LinearOrder α] [WellFoundedLT α] {l m : List α} {o : Ordinal.{u}} (hl : List.Sorted (fun (x1 x2 : α) => x1 > x2) l) (hm : List.Sorted (fun (x1 x2 : α) => x1 > x2) m) (hmltl : m < l) (hlt : il, (Ordinal.typein fun (x1 x2 : α) => x1 < x2).toRelEmbedding i < o) (i : α) :
                                                        i m(Ordinal.typein fun (x1 x2 : α) => x1 < x2).toRelEmbedding i < o