Documentation

Init.Data.Array.Mem

structure Array.Mem {α : Type u_1} (a : α) (as : Array α) :

a ∈ as is a predicate which asserts that a is in the array as.

  • val : a as.data
Instances For
    theorem Array.Mem.val {α : Type u_1} {a : α} {as : Array α} (self : Array.Mem a as) :
    a as.data
    instance Array.instMembership {α : Type u_1} :
    Equations
    • Array.instMembership = { mem := fun (a : α) (as : Array α) => Array.Mem a as }
    theorem Array.sizeOf_lt_of_mem {α : Type u_1} {a : α} [SizeOf α] {as : Array α} (h : a as) :
    theorem Array.sizeOf_get {α : Type u_1} [SizeOf α] (as : Array α) (i : Fin as.size) :
    sizeOf (as.get i) < sizeOf as
    @[simp]
    theorem Array.sizeOf_getElem {α : Type u_1} [SizeOf α] (as : Array α) (i : Nat) (h : i < as.size) :
    sizeOf as[i] < sizeOf as

    This tactic, added to the decreasing_trivial toolbox, proves that sizeOf arr[i] < sizeOf arr, which is useful for well founded recursions over a nested inductive like inductive T | mk : Array T → T.

    Equations
    Instances For

      This tactic, added to the decreasing_trivial toolbox, proves that sizeOf a < sizeOf arr provided that a ∈ arr which is useful for well founded recursions over a nested inductive like inductive T | mk : Array T → T.

      Equations
      Instances For