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
    instance Array.instMembershipArray {α : Type u_1} :
    Equations
    • Array.instMembershipArray = { 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) :
    @[simp]
    theorem Array.sizeOf_get {α : Type u_1} [SizeOf α] (as : Array α) (i : Fin (Array.size 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