Documentation

Init.Data.Range.Polymorphic.PRange

structure Std.Rcc (α : Type u) :

A range of elements of α with closed lower and upper bounds.

a...=b is the range of all values greater than or equal to a : α and less than or equal to b : α. This is notation for Rcc.mk a b.

  • lower : α

    The lower bound of the range. lower is included in the range.

  • upper : α

    The upper bound of the range. upper is included in the range.

Instances For
    def Std.instDecidableEqRcc.decEq {α✝ : Type u_1} [DecidableEq α✝] (x✝ x✝¹ : Rcc α✝) :
    Decidable (x✝ = x✝¹)
    Equations
    Instances For
      @[implicit_reducible]
      instance Std.instDecidableEqRcc {α✝ : Type u_1} [DecidableEq α✝] :
      Equations
      structure Std.Rco (α : Type u) :

      A range of elements of α with a closed lower bound and an open upper bound.

      a...b or a...<b is the range of all values greater than or equal to a : α and less than b : α. This is notation for Rco.mk a b.

      • lower : α

        The lower bound of the range. lower is included in the range.

      • upper : α

        The upper bound of the range. upper is not included in the range.

      Instances For
        def Std.instDecidableEqRco.decEq {α✝ : Type u_1} [DecidableEq α✝] (x✝ x✝¹ : Rco α✝) :
        Decidable (x✝ = x✝¹)
        Equations
        Instances For
          @[implicit_reducible]
          instance Std.instDecidableEqRco {α✝ : Type u_1} [DecidableEq α✝] :
          Equations
          structure Std.Rci (α : Type u) :

          An upward-unbounded range of elements of α with a closed lower bound.

          a...* is the range of all values greater than or equal to a : α. This is notation for Rci.mk a.

          • lower : α

            The lower bound of the range. lower is included in the range.

          Instances For
            def Std.instDecidableEqRci.decEq {α✝ : Type u_1} [DecidableEq α✝] (x✝ x✝¹ : Rci α✝) :
            Decidable (x✝ = x✝¹)
            Equations
            Instances For
              @[implicit_reducible]
              instance Std.instDecidableEqRci {α✝ : Type u_1} [DecidableEq α✝] :
              Equations
              structure Std.Roc (α : Type u) :

              A range of elements of α with an open lower bound and a closed upper bound.

              a<...=b is the range of all values greater than a : α and less than or equal to b : α. This is notation for Roc.mk a b.

              • lower : α

                The lower bound of the range. lower is not included in the range.

              • upper : α

                The upper bound of the range. upper is included in the range.

              Instances For
                def Std.instDecidableEqRoc.decEq {α✝ : Type u_1} [DecidableEq α✝] (x✝ x✝¹ : Roc α✝) :
                Decidable (x✝ = x✝¹)
                Equations
                Instances For
                  @[implicit_reducible]
                  instance Std.instDecidableEqRoc {α✝ : Type u_1} [DecidableEq α✝] :
                  Equations
                  structure Std.Roo (α : Type u) :

                  A range of elements of α with an open lower and upper bounds.

                  a<...b or a<...<b is the range of all values greater than a : α and less than b : α. This is notation for Roo.mk a b.

                  • lower : α

                    The lower bound of the range. lower is not included in the range.

                  • upper : α

                    The upper bound of the range. upper is not included in the range.

                  Instances For
                    @[implicit_reducible]
                    instance Std.instDecidableEqRoo {α✝ : Type u_1} [DecidableEq α✝] :
                    Equations
                    def Std.instDecidableEqRoo.decEq {α✝ : Type u_1} [DecidableEq α✝] (x✝ x✝¹ : Roo α✝) :
                    Decidable (x✝ = x✝¹)
                    Equations
                    Instances For
                      structure Std.Roi (α : Type u) :

                      An upward-unbounded range of elements of α with an open lower bound.

                      a<...* is the range of all values greater than a : α. This is notation for Roi.mk a.

                      • lower : α

                        The lower bound of the range. lower is not included in the range.

                      Instances For
                        @[implicit_reducible]
                        instance Std.instDecidableEqRoi {α✝ : Type u_1} [DecidableEq α✝] :
                        Equations
                        def Std.instDecidableEqRoi.decEq {α✝ : Type u_1} [DecidableEq α✝] (x✝ x✝¹ : Roi α✝) :
                        Decidable (x✝ = x✝¹)
                        Equations
                        Instances For
                          structure Std.Ric (α : Type u) :

                          A downward-unbounded range of elements of α with a closed upper bound.

                          *...=b is the range of all values less than or equal to b : α. This is notation for Ric.mk b.

                          • upper : α

                            The upper bound of the range. upper is included in the range.

                          Instances For
                            @[implicit_reducible]
                            instance Std.instDecidableEqRic {α✝ : Type u_1} [DecidableEq α✝] :
                            Equations
                            def Std.instDecidableEqRic.decEq {α✝ : Type u_1} [DecidableEq α✝] (x✝ x✝¹ : Ric α✝) :
                            Decidable (x✝ = x✝¹)
                            Equations
                            Instances For
                              structure Std.Rio (α : Type u) :

                              A downward-unbounded range of elements of α with an open upper bound.

                              *...b or *...<b is the range of all values less than b : α. This is notation for Rio.mk b.

                              • upper : α

                                The upper bound of the range. upper is not included in the range.

                              Instances For
                                @[implicit_reducible]
                                instance Std.instDecidableEqRio {α✝ : Type u_1} [DecidableEq α✝] :
                                Equations
                                def Std.instDecidableEqRio.decEq {α✝ : Type u_1} [DecidableEq α✝] (x✝ x✝¹ : Rio α✝) :
                                Decidable (x✝ = x✝¹)
                                Equations
                                Instances For
                                  structure Std.Rii (α : Type u) :

                                  A full range of all elements of α. Its only inhabitant is the range *...*, which is notation for Rii.mk.

                                    Instances For
                                      @[implicit_reducible]
                                      instance Std.instDecidableEqRii {α✝ : Type u_1} [DecidableEq α✝] :
                                      Equations
                                      def Std.instDecidableEqRii.decEq {α✝ : Type u_1} [DecidableEq α✝] (x✝ x✝¹ : Rii α✝) :
                                      Decidable (x✝ = x✝¹)
                                      Equations
                                      Instances For

                                        a...* is the range of elements greater than or equal to a. See also Std.Rci.

                                        Equations
                                        Instances For

                                          *...* is the range that is unbounded in both directions. See also Std.Rii.

                                          Equations
                                          Instances For

                                            a<...* is the range of elements greater than a. See also Std.Roi.

                                            Equations
                                            Instances For

                                              a...<b is the range of elements greater than or equal to a and less than b. See also Std.Rco.

                                              Equations
                                              Instances For

                                                a...b is the range of elements greater than or equal to a and less than b. See also Std.Rco.

                                                Equations
                                                Instances For

                                                  *...<b is the range of elements less than b. See also Std.Rio.

                                                  Equations
                                                  Instances For

                                                    *...b is the range of elements less than b. See also Std.Rio.

                                                    Equations
                                                    Instances For

                                                      a<...<b is the range of elements greater than a and less than b. See also Std.Roo.

                                                      Equations
                                                      Instances For

                                                        a<...b is the range of elements greater than a and less than b. See also Std.Roo.

                                                        Equations
                                                        Instances For

                                                          a...=b is the range of elements greater than or equal to a and less than or equal to b. See also Std.Rcc.

                                                          Equations
                                                          Instances For

                                                            *...=b is the range of elements less than or equal to b. See also Std.Ric.

                                                            Equations
                                                            Instances For

                                                              a<...=b is the range of elements greater than a and less than or equal to b. See also Std.Roc.

                                                              Equations
                                                              Instances For

                                                                This type class ensures that right-closed ranges (i.e., for bounds a and b, a...=b, a<...=b and *...=b) are always finite. This is a prerequisite for many functions and instances, such as Rcc.toList or ForIn'.

                                                                • finite (init hi : α) : (n : Nat), (PRange.succMany? n init).elim True fun (x : α) => ¬x hi

                                                                  For every pair of elements init and hi, there exists a chain of successors that results in an element that either has no successors or is greater than hi.

                                                                Instances

                                                                  This type class ensures that right-open ranges (i.e., for bounds a and b, a...b, a<...b and *...b) are always finite. This is a prerequisite for many functions and instances, such as Rco.toList or ForIn'.

                                                                  • finite (init hi : α) : (n : Nat), (PRange.succMany? n init).elim True fun (x : α) => ¬x < hi

                                                                    For every pair of elements init and hi, there exists a chain of successors that results in an element that either has no successors or is greater than hi.

                                                                  Instances

                                                                    This type class ensures that right-unbounded ranges (i.e., for a bound a, a...*, a<...* and *...*) are always finite. This is a prerequisite for many functions and instances, such as Rci.toList or ForIn'.

                                                                    • finite (init : α) : (n : Nat), PRange.succMany? n init = none

                                                                      For every elements init, there exists a chain of successors that results in an element that has no successors.

                                                                    Instances
                                                                      @[implicit_reducible]
                                                                      instance Std.Rcc.instMembershipOfLE {α : Type u} [LE α] :
                                                                      Membership α (Rcc α)
                                                                      Equations
                                                                      @[implicit_reducible]
                                                                      instance Std.Rcc.instDecidableMemOfDecidableLE {α : Type u} {r : Rcc α} {a : α} [LE α] [DecidableLE α] :
                                                                      Equations
                                                                      @[implicit_reducible]
                                                                      instance Std.Rco.instMembershipOfLEOfLT {α : Type u} [LE α] [LT α] :
                                                                      Membership α (Rco α)
                                                                      Equations
                                                                      @[implicit_reducible]
                                                                      instance Std.Rci.instMembershipOfLE {α : Type u} [LE α] :
                                                                      Membership α (Rci α)
                                                                      Equations
                                                                      @[implicit_reducible]
                                                                      instance Std.Rci.instDecidableMemOfDecidableLE {α : Type u} {r : Rci α} {a : α} [LE α] [DecidableLE α] :
                                                                      Equations
                                                                      @[implicit_reducible]
                                                                      instance Std.Roc.instMembershipOfLEOfLT {α : Type u} [LE α] [LT α] :
                                                                      Membership α (Roc α)
                                                                      Equations
                                                                      @[implicit_reducible]
                                                                      instance Std.Roo.instMembershipOfLT {α : Type u} [LT α] :
                                                                      Membership α (Roo α)
                                                                      Equations
                                                                      @[implicit_reducible]
                                                                      instance Std.Roo.instDecidableMemOfDecidableLT {α : Type u} {r : Roo α} {a : α} [LT α] [DecidableLT α] :
                                                                      Equations
                                                                      @[implicit_reducible]
                                                                      instance Std.Roi.instMembershipOfLT {α : Type u} [LT α] :
                                                                      Membership α (Roi α)
                                                                      Equations
                                                                      @[implicit_reducible]
                                                                      instance Std.Roi.instDecidableMemOfDecidableLT {α : Type u} {r : Roi α} {a : α} [LT α] [DecidableLT α] :
                                                                      Equations
                                                                      @[implicit_reducible]
                                                                      instance Std.Ric.instMembershipOfLE {α : Type u} [LE α] :
                                                                      Membership α (Ric α)
                                                                      Equations
                                                                      @[implicit_reducible]
                                                                      instance Std.Ric.instDecidableMemOfDecidableLE {α : Type u} {r : Ric α} {a : α} [LE α] [DecidableLE α] :
                                                                      Equations
                                                                      @[implicit_reducible]
                                                                      instance Std.Rio.instMembershipOfLT {α : Type u} [LT α] :
                                                                      Membership α (Rio α)
                                                                      Equations
                                                                      @[implicit_reducible]
                                                                      instance Std.Rio.instDecidableMemOfDecidableLT {α : Type u} {r : Rio α} {a : α} [LT α] [DecidableLT α] :
                                                                      Equations
                                                                      @[implicit_reducible]
                                                                      instance Std.Rii.instMembership {α : Type u} :
                                                                      Membership α (Rii α)
                                                                      Equations
                                                                      @[implicit_reducible]
                                                                      instance Std.Rii.instDecidableMem {α : Type u} {r : Rii α} {a : α} :
                                                                      Equations

                                                                      This type class allows taking the intersection of a closed range with a left-closed right-open range, resulting in another left-closed right-open range.

                                                                      • intersection : Rcc αRco αRco α

                                                                        The intersection operator.

                                                                      Instances

                                                                        This type class ensures that the intersection according to Rcc.HasRcoIntersection of two ranges contains exactly those elements that are contained in both ranges.

                                                                        Instances

                                                                          This type class allows taking the intersection of two left-closed right-open ranges, resulting in another left-closed right-open range.

                                                                          • intersection : Rco αRco αRco α

                                                                            The intersection operator.

                                                                          Instances

                                                                            This type class ensures that the intersection according to Rco.HasRcoIntersection of two ranges contains exactly those elements that are contained in both ranges.

                                                                            Instances

                                                                              This type class allows taking the intersection of a left-closed right-unbounded range with a left-closed right-open range, resulting in another left-closed right-open range.

                                                                              • intersection : Rci αRco αRco α

                                                                                The intersection operator.

                                                                              Instances

                                                                                This type class ensures that the intersection according to Rci.HasRcoIntersection of two ranges contains exactly those elements that are contained in both ranges.

                                                                                Instances

                                                                                  This type class allows taking the intersection of a left-open right-closed range with a left-closed right-open range, resulting in another left-closed right-open range.

                                                                                  • intersection : Roc αRco αRco α

                                                                                    The intersection operator.

                                                                                  Instances

                                                                                    This type class ensures that the intersection according to Roc.HasRcoIntersection of two ranges contains exactly those elements that are contained in both ranges.

                                                                                    Instances

                                                                                      This type class allows taking the intersection of an open range with a left-closed right-open range, resulting in another left-closed right-open range.

                                                                                      • intersection : Roo αRco αRco α

                                                                                        The intersection operator.

                                                                                      Instances

                                                                                        This type class ensures that the intersection according to Roo.HasRcoIntersection of two ranges contains exactly those elements that are contained in both ranges.

                                                                                        Instances

                                                                                          This type class allows taking the intersection of a left-open right-unbounded range with a left-closed right-open range, resulting in another left-closed right-open range.

                                                                                          • intersection : Roi αRco αRco α

                                                                                            The intersection operator.

                                                                                          Instances

                                                                                            This type class ensures that the intersection according to Roi.HasRcoIntersection of two ranges contains exactly those elements that are contained in both ranges.

                                                                                            Instances

                                                                                              This type class allows taking the intersection of a left-unbounded right-closed range with a left-closed right-open range, resulting in another left-closed right-open range.

                                                                                              • intersection : Ric αRco αRco α

                                                                                                The intersection operator.

                                                                                              Instances

                                                                                                This type class ensures that the intersection according to Ric.HasRcoIntersection of two ranges contains exactly those elements that are contained in both ranges.

                                                                                                Instances

                                                                                                  This type class allows taking the intersection of a left-unbounded right-open range with a left-closed right-open range, resulting in another left-closed right-open range.

                                                                                                  • intersection : Rio αRco αRco α

                                                                                                    The intersection operator.

                                                                                                  Instances

                                                                                                    This type class ensures that the intersection according to Rio.HasRcoIntersection of two ranges contains exactly those elements that are contained in both ranges.

                                                                                                    Instances