Documentation

Mathlib.Order.TypeTags

Order-related type synonyms #

In this file we define WithBot, WithTop, ENat, and PNat. The definitions were moved to this file without any theory so that, e.g., Data/Countable/Basic can prove Countable ENat without exploding its imports.

def WithBot (α : Type u_2) :
Type u_2

Attach to a type.

Equations
Instances For
    instance WithBot.instRepr {α : Type u_1} [Repr α] :
    Equations
    @[match_pattern]
    def WithBot.some {α : Type u_1} :
    αWithBot α

    The canonical map from α into WithBot α

    Equations
    • WithBot.some = some
    Instances For
      instance WithBot.coe {α : Type u_1} :
      Coe α (WithBot α)
      Equations
      • WithBot.coe = { coe := WithBot.some }
      instance WithBot.bot {α : Type u_1} :
      Equations
      • WithBot.bot = { bot := none }
      instance WithBot.inhabited {α : Type u_1} :
      Equations
      • WithBot.inhabited = { default := }
      def WithBot.recBotCoe {α : Type u_1} {C : WithBot αSort u_2} (bot : C ) (coe : (a : α) → C a) (n : WithBot α) :
      C n

      Recursor for WithBot using the preferred forms and ↑a.

      Equations
      Instances For
        @[simp]
        theorem WithBot.recBotCoe_bot {α : Type u_1} {C : WithBot αSort u_2} (d : C ) (f : (a : α) → C a) :
        @[simp]
        theorem WithBot.recBotCoe_coe {α : Type u_1} {C : WithBot αSort u_2} (d : C ) (f : (a : α) → C a) (x : α) :
        WithBot.recBotCoe d f x = f x
        def WithTop (α : Type u_2) :
        Type u_2

        Attach to a type.

        Equations
        Instances For
          instance WithTop.instRepr {α : Type u_1} [Repr α] :
          Equations
          @[match_pattern]
          def WithTop.some {α : Type u_1} :
          αWithTop α

          The canonical map from α into WithTop α

          Equations
          • WithTop.some = some
          Instances For
            instance WithTop.coeTC {α : Type u_1} :
            CoeTC α (WithTop α)
            Equations
            • WithTop.coeTC = { coe := WithTop.some }
            instance WithTop.top {α : Type u_1} :
            Equations
            • WithTop.top = { top := none }
            instance WithTop.inhabited {α : Type u_1} :
            Equations
            • WithTop.inhabited = { default := }
            def WithTop.recTopCoe {α : Type u_1} {C : WithTop αSort u_2} (top : C ) (coe : (a : α) → C a) (n : WithTop α) :
            C n

            Recursor for WithTop using the preferred forms and ↑a.

            Equations
            Instances For
              @[simp]
              theorem WithTop.recTopCoe_top {α : Type u_1} {C : WithTop αSort u_2} (d : C ) (f : (a : α) → C a) :
              @[simp]
              theorem WithTop.recTopCoe_coe {α : Type u_1} {C : WithTop αSort u_2} (d : C ) (f : (a : α) → C a) (x : α) :
              WithTop.recTopCoe d f x = f x
              def ENat :

              Extended natural numbers ℕ∞ = WithTop.

              Equations
              Instances For

                Extended natural numbers ℕ∞ = WithTop.

                Equations
                Instances For
                  Equations
                  def ENat.recTopCoe {C : ℕ∞Sort u_2} (top : C ) (coe : (a : ) → C a) (n : ℕ∞) :
                  C n

                  Recursor for ENat using the preferred forms and ↑a.

                  Equations
                  Instances For
                    @[simp]
                    theorem ENat.recTopCoe_top {C : ℕ∞Sort u_2} (d : C ) (f : (a : ) → C a) :
                    @[simp]
                    theorem ENat.recTopCoe_coe {C : ℕ∞Sort u_2} (d : C ) (f : (a : ) → C a) (x : ) :
                    ENat.recTopCoe d f x = f x
                    def PNat :

                    ℕ+ is the type of positive natural numbers. It is defined as a subtype, and the VM representation of ℕ+ is the same as because the proof is not stored.

                    Equations
                    Instances For

                      ℕ+ is the type of positive natural numbers. It is defined as a subtype, and the VM representation of ℕ+ is the same as because the proof is not stored.

                      Equations
                      Instances For
                        def PNat.val :
                        ℕ+

                        The underlying natural number

                        Equations
                        Instances For
                          Equations
                          Equations