Documentation

Trestle.Upstream.ToStd

@[simp]
theorem Bool.bnot_eq_bnot (a b : Bool) :
(!a) = !b ↔ a = b
@[simp]
theorem Bool.eq_true_iff_eq_true (a b : Bool) :
(a = true ↔ b = true) ↔ a = b
@[simp]
theorem Bool.eq_false_iff_eq_false (a b : Bool) :
(a = false ↔ b = false) ↔ a = b
theorem Bool.bnot_eq (a b : Bool) :
(!a) = b ↔ ¬a = b
theorem Bool.eq_bnot (a b : Bool) :
a = !b ↔ ¬a = b

Int

theorem Int.eq_zero_of_lt_neg_iff_lt (i : Int) :
(0 < -i ↔ 0 < i) → i = 0
def List.enum' {α : Type u_1} (L : List α) :
List (Fin L.length × α)
Equations
Instances For
    def List.enum'.go {α : Type u_1} (L rest : List α) (i : Nat) (h : i + rest.length = L.length) :
    List (Fin L.length × α)
    Equations
    Instances For
      def Fin.pred? {n : Nat} :
      Fin n → Option (Fin n)
      Equations
      Instances For
        def Fin.predCast {n : Nat} :
        Fin n → Option (Fin n.pred)

        if i > 0, then i-1, else none

        Equations
        Instances For
          def Fin.castPred' {n : Nat} (i : Fin n) :

          if i < Fin.last n then i, else none

          Equations
          Instances For
            def Fin.succ? {n : Nat} :
            Fin n → Option (Fin n)
            Equations
            Instances For
              theorem Fin.foldl_induction {α : Sort u_1} (n : Nat) (f : α → Fin n → α) (init : α) (P : α → Fin (n + 1) → Prop) (hInit : P init 0) (hSucc : ∀ (a : α) (i : Fin n), P a ⟨↑i, ⋯⟩ → P (f a i) ⟨↑i + 1, ⋯⟩) :
              P (foldl n f init) ⟨n, ⋯⟩
              @[irreducible]
              theorem Fin.foldl_induction.loop {α : Sort u_1} (n : Nat) (f : α → Fin n → α) (P : α → Fin (n + 1) → Prop) (hSucc : ∀ (a : α) (i : Fin n), P a ⟨↑i, ⋯⟩ → P (f a i) ⟨↑i + 1, ⋯⟩) (x : α) (i : Fin (n + 1)) (h : P x i) :
              P (foldl.loop n f x ↑i) ⟨n, ⋯⟩
              theorem Fin.foldl_induction' {α : Sort u_1} (n : Nat) (f : α → Fin n → α) (init : α) (P : α → Prop) (hInit : P init) (hSucc : ∀ (a : α) (i : Fin n), P a → P (f a i)) :
              P (foldl n f init)
              theorem Fin.foldl_of_comm {α : Sort u_1} (n : Nat) (f : α → Fin n → α) (init : α) (i : Fin n) (H : ∀ (acc : α) (i₁ i₂ : Fin n), f (f acc i₁) i₂ = f (f acc i₂) i₁) :
              ∃ (acc : α), foldl n f init = f acc i
              def Function.iterate {α : Sort u_1} (f : α → α) :
              Nat → α → α
              Equations
              Instances For

                Array

                def Array.pop? {α : Type u_1} (A : Array α) :
                Option (Array α × α)
                Equations
                Instances For
                  @[simp]
                  theorem Array.size_pop? {α✝ : Type u_1} {A' : Array α✝} {a : α✝} {A : Array α✝} :
                  A.pop? = some (A', a) → A'.size + 1 = A.size
                  def Array.maxBy {α : Type u_1} {β : Type u_2} (f : α → β) [Max β] (A : Array α) :
                  Equations
                  Instances For
                    theorem Array.mkArray_succ_eq_singleton_append {α : Type u_1} (n : Nat) (a : α) :
                    replicate (n + 1) a = #[a] ++ replicate n a
                    @[simp]
                    theorem Array.foldl_cons {β : Type u_1} {α : Type u_2} (f : β → α → β) (init : β) (a : α) (as : List α) :
                    foldl f init { toList := a :: as } = foldl f (f init a) { toList := as }
                    theorem Array.ofFn_getElem {α : Type u_1} (A : Array α) :
                    (ofFn fun (x : Fin A.size) => A[x]) = A

                    List

                    theorem List.Sublist.sizeOf_le {α : Type u_1} [SizeOf α] {L₁ L₂ : List α} :
                    L₁.Sublist L₂ → sizeOf L₁ ≤ sizeOf L₂
                    def List.distinct {α : Type u_1} [DecidableEq α] (L : List α) :
                    List α
                    Equations
                    Instances For
                      def List.isDistinct {α : Type u_1} [BEq α] :
                      List α → Bool
                      Equations
                      Instances For
                        def List.fins (n : Nat) :
                        List (Fin n)
                        Equations
                        Instances For
                          def List.fins.finsAux (n i : Nat) :
                          i ≤ n → List (Fin n) → List (Fin n)
                          Equations
                          Instances For
                            @[simp]
                            theorem List.length_fins (n : Nat) :
                            (fins n).length = n
                            @[simp]
                            theorem List.fins_zero :
                            @[simp]
                            theorem List.get_fins {n : Nat} (i : Fin (fins n).length) :
                            (fins n).get i = ⟨↑i, ⋯⟩
                            @[simp]
                            theorem List.get_fins' {n i : Nat} (hi : i < n) :
                            (fins n).get ⟨i, ⋯⟩ = ⟨i, hi⟩
                            @[simp]
                            theorem List.mem_fins {n : Nat} (x : Fin n) :
                            x ∈ fins n
                            def TaskIO (α : Type) :
                            Equations
                            Instances For
                              Equations
                              • One or more equations did not get rendered due to their size.
                              Equations
                              def TaskIO.wait {α : Type} (task : TaskIO α) :
                              IO α
                              Equations
                              Instances For
                                Equations
                                • One or more equations did not get rendered due to their size.
                                def TaskIO.par {σ : Type u_1} {α : Type u_2} {β : Type} [ForIn IO σ α] (xs : σ) (f : α → TaskIO β) :
                                Equations
                                • One or more equations did not get rendered due to their size.
                                Instances For
                                  def TaskIO.parUnit {σ : Type u_1} {α : Type u_2} [ForIn IO σ α] (xs : σ) (f : α → TaskIO Unit) :
                                  Equations
                                  Instances For
                                    def TaskIO.parTasks {σ : Type u_1} {α : Type u_2} {β : Type} [ForIn IO σ α] (xs : σ) (f : α → IO β) :
                                    Equations
                                    Instances For
                                      def TaskIO.parTasksUnit {σ : Type u_1} {α : Type u_2} [ForIn IO σ α] (xs : σ) (f : α → IO Unit) :
                                      Equations
                                      Instances For
                                        def Option.forIn {m : Type u_1 → Type u_2} {α : Type u_3} {β : Type u_1} [Monad m] (o : Option α) (b : β) (f : α → β → m (ForInStep β)) :
                                        m β
                                        Equations
                                        Instances For
                                          instance instForInOption_trestle {m : Type u_1 → Type u_2} {α : Type u_3} :
                                          ForIn m (Option α) α
                                          Equations
                                          def IO.timeMs {α : Type} (prog : IO α) :
                                          IO (Nat × α)
                                          Equations
                                          Instances For
                                            Equations
                                            def randFin (n : Nat) (_h : n > 0) :
                                            IO (Fin n)
                                            Equations
                                            • One or more equations did not get rendered due to their size.
                                            Instances For
                                              def IO.randPerm {α : Type} (L : List α) :
                                              IO (List α)
                                              Equations
                                              Instances For
                                                def IO.randPerm.randPermTR {α : Type} (L acc : List α) (n : Nat) :
                                                IO (List α)
                                                Equations
                                                Instances For
                                                  @[simp]
                                                  theorem List.sizeOf_filter {α : Type u_1} [SizeOf α] (f : α → Bool) (L : List α) :
                                                  theorem List.sizeOf_filter_lt_of_ne {α : Type u_1} [SizeOf α] (f : α → Bool) (L : List α) (h : filter f L ≠ L) :
                                                  def List.subtypeSize {α : Type u_1} [SizeOf α] (L : List α) :
                                                  List { a : α // sizeOf a < sizeOf L }
                                                  Equations
                                                  Instances For
                                                    unsafe def Array.subtypeSizeUnsafe {α : Type u_1} [SizeOf α] (A : Array α) :
                                                    Array { a : α // sizeOf a < sizeOf A }
                                                    Equations
                                                    Instances For
                                                      @[implemented_by Array.subtypeSizeUnsafe]
                                                      def Array.subtypeSize {α : Type u_1} [SizeOf α] (A : Array α) :
                                                      Array { a : α // sizeOf a < sizeOf A }
                                                      Equations
                                                      Instances For
                                                        def List.forPairsM {m : Type u_1 → Type u_2} {α : Type u_3} [Monad m] (f : α → α → m PUnit) :
                                                        List α → m PUnit

                                                        Like forDiagM, but only runs f e e' (not f e e).

                                                        Equations
                                                        Instances For
                                                          @[inline]
                                                          def Option.expectSome {ε : Type u_1} {α : Type u_2} (err : Unit → ε) :
                                                          Option α → Except ε α
                                                          Equations
                                                          Instances For
                                                            structure NonemptyList (α : Type u_1) :
                                                            Type u_1
                                                            Instances For
                                                              @[inline]
                                                              def List.expectNonempty {ε : Type u_1} {α : Type u_2} (err : Unit → ε) :
                                                              List α → Except ε (NonemptyList α)
                                                              Equations
                                                              Instances For
                                                                def PrinterM (α : Type) :
                                                                Equations
                                                                Instances For
                                                                  Equations
                                                                  Instances For
                                                                    Equations
                                                                    Instances For
                                                                      @[simp]
                                                                      theorem Array.ofFn_data {n : Nat} {α : Type u_1} (f : Fin n → α) :