Documentation

Trestle.Upstream.IndexType

@[inline]
def Fin.pair {m n : } (x : Fin m) (y : Fin n) :
Fin (m * n)
Equations
Instances For
    @[inline]
    def Fin.pair_left {m n : } :
    Fin (m * n)Fin m
    Equations
    Instances For
      @[inline]
      def Fin.pair_right {m n : } :
      Fin (m * n)Fin n
      Equations
      Instances For
        @[simp]
        theorem Fin.pair_left_pair {m n : } (x : Fin m) (y : Fin n) :
        (x.pair y).pair_left = x
        @[simp]
        theorem Fin.pair_right_pair {m n : } (x : Fin m) (y : Fin n) :
        (x.pair y).pair_right = y
        @[simp]
        theorem Fin.pair_left_right {m n : } (p : Fin (m * n)) :
        theorem Fin.pair_succ_left {m n : } (x : Fin m) (y : Fin n) :
        (x.succ.pair y) = (x.pair y) + n
        theorem Fin.pair_ge_left {m n : } (x : Fin m) (y : Fin n) :
        (x.pair y) x * n

        Index Types #

        Index types are types which can serve as the index into a sequence. Every index type is in bijection with Fin n.

        N.B. this is equivalent to [Fintype] in mathlib, but [Fintype] has many instances with very bad computational complexity.

        class Trestle.IndexType (ι : Type u) :
        Instances
          @[simp]
          theorem Trestle.IndexType.toFin_fromFin {ι : Type u_1} [IndexType ι] [LawfulIndexType ι] (i : Fin (card ι)) :
          @[simp]
          theorem Trestle.IndexType.fromFin_toFin {ι : Type u_1} [IndexType ι] [LawfulIndexType ι] (x : ι) :
          @[simp]
          theorem Trestle.IndexType.toFin_inj {ι : Type u_1} [IndexType ι] [LawfulIndexType ι] (i j : ι) :
          toFin i = toFin j i = j
          @[simp]
          theorem Trestle.IndexType.fromFin_inj {ι : Type u_1} [IndexType ι] [LawfulIndexType ι] (i j : Fin (card ι)) :
          Equations
          Instances For
            theorem Trestle.IndexType.toFin_eq_iff {ι : Type u_1} [IndexType ι] [LawfulIndexType ι] (x y : ι) :
            toFin x = toFin y x = y
            @[simp]
            @[simp]
            theorem Trestle.IndexType.getElem_toList_univ {α : Type u_1} [IndexType α] [LawfulIndexType α] (i : ) (h : i < (toList α).length) :
            (toList α)[i] = fromFin i,
            @[simp]
            theorem Trestle.IndexType.mem_toList_univ {α : Type u_1} [IndexType α] [LawfulIndexType α] (x : α) :
            x toList α

            Transport over equivalence #

            def Trestle.IndexType.ofEquiv {ι' : Type u_1} {ι : Type u_2} [IndexType ι'] (f : ι' ι) :
            Equations
            Instances For
              def Trestle.IndexType.ofEquivLawful {ι' : Type u_1} {ι : Type u_2} [I' : IndexType ι'] [LI' : LawfulIndexType ι'] (f : ι' ι) :
              Equations
              • =
              Instances For

                Unit #

                Equations

                Fin n #

                Equations

                Product #

                instance Trestle.IndexType.instProd {α : Type u} [IndexType α] {β : Type v} [IndexType β] :
                IndexType (α × β)
                Equations
                • One or more equations did not get rendered due to their size.

                Sigma #

                Sum #

                instance Trestle.IndexType.instSum {α : Type u} [IndexType α] {β : Type v} [IndexType β] :
                IndexType (α β)
                Equations
                • One or more equations did not get rendered due to their size.

                Generic inductives #

                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