Documentation

Init.Data.Range.Basic

structure Std.Range :
  • start : Nat
  • stop : Nat
  • step : Nat
  • step_pos : 0 < self.step
Instances For
    Equations

    The number of elements in the range.

    Equations
    • r.size = (r.stop - r.start + r.step - 1) / r.step
    Instances For
      @[inline]
      def Std.Range.forIn' {m : Type u_1 → Type u_2} {β : Type u_1} [Monad m] (range : Std.Range) (init : β) (f : (i : Nat) → i rangeβm (ForInStep β)) :
      m β
      Equations
      Instances For
        @[irreducible, specialize #[]]
        def Std.Range.forIn'.loop {m : Type u_1 → Type u_2} {β : Type u_1} [Monad m] (range : Std.Range) (f : (i : Nat) → i rangeβm (ForInStep β)) (b : β) (i : Nat) (hs : (i - range.start) % range.step = 0) (hl : range.start i := by omega) :
        m β
        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          @[inline]
          def Std.Range.forM {m : Type u_1 → Type u_2} [Monad m] (range : Std.Range) (f : Natm PUnit) :
          Equations
          Instances For
            @[irreducible, specialize #[]]
            def Std.Range.forM.loop {m : Type u_1 → Type u_2} [Monad m] (range : Std.Range) (f : Natm PUnit) (i : Nat) :
            Equations
            Instances For
              instance Std.Range.instForMNat {m : Type u_1 → Type u_2} :
              Equations
              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                Equations
                • One or more equations did not get rendered due to their size.
                Instances For
                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For
                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For
                      theorem Membership.mem.upper {i : Nat} {r : Std.Range} (h : i r) :
                      i < r.stop
                      theorem Membership.mem.lower {i : Nat} {r : Std.Range} (h : i r) :
                      r.start i
                      theorem Membership.mem.step {i : Nat} {r : Std.Range} (h : i r) :
                      (i - r.start) % r.step = 0
                      theorem Membership.get_elem_helper {i n : Nat} {r : Std.Range} (h₁ : i r) (h₂ : r.stop = n) :
                      i < n