Documentation

Init.Data.List.BasicAux

def List.get! {α : Type u_1} [inst : Inhabited α] :
List αNatα
Equations
def List.get? {α : Type u_1} :
List αNatOption α
Equations
def List.getD {α : Type u_1} (as : List α) (idx : Nat) (a₀ : α) :
α
Equations
def List.head! {α : Type u_1} [inst : Inhabited α] :
List αα
Equations
def List.head? {α : Type u_1} :
List αOption α
Equations
def List.headD {α : Type u_1} :
List ααα
Equations
  • List.headD _fun_discr _fun_discr = match _fun_discr, _fun_discr with | [], a₀ => a₀ | a :: tail, x => a
def List.head {α : Type u_1} (as : List α) :
as []α
Equations
  • List.head _fun_discr _fun_discr = match _fun_discr, _fun_discr with | a :: tail, x => a
def List.tail! {α : Type u_1} :
List αList α
Equations
def List.tail? {α : Type u_1} :
List αOption (List α)
Equations
def List.tailD {α : Type u_1} :
List αList αList α
Equations
  • List.tailD _fun_discr _fun_discr = match _fun_discr, _fun_discr with | [], as₀ => as₀ | head :: as, x => as
def List.getLast {α : Type u_1} (as : List α) :
as []α
Equations
def List.getLast! {α : Type u_1} [inst : Inhabited α] :
List αα
Equations
def List.getLast? {α : Type u_1} :
List αOption α
Equations
def List.getLastD {α : Type u_1} :
List ααα
Equations
def List.rotateLeft {α : Type u_1} (xs : List α) (n : optParam Nat 1) :
List α
Equations
def List.rotateRight {α : Type u_1} (xs : List α) (n : optParam Nat 1) :
List α
Equations
theorem List.get_append_left {α : Type u_1} {i : Nat} (as : List α) (bs : List α) (h : i < List.length as) {h' : i < List.length (as ++ bs)} :
List.get (as ++ bs) { val := i, isLt := h' } = List.get as { val := i, isLt := h }
theorem List.get_append_right {α : Type u_1} {i : Nat} (as : List α) (bs : List α) (h : ¬i < List.length as) {h' : i < List.length (as ++ bs)} {h'' : i - List.length as < List.length bs} :
List.get (as ++ bs) { val := i, isLt := h' } = List.get bs { val := i - List.length as, isLt := h'' }
theorem List.get_last {α : Type u_1} {a : α} {as : List α} {i : Fin (List.length (as ++ [a]))} (h : ¬i.val < List.length as) :
List.get (as ++ [a]) i = a
theorem List.sizeOf_lt_of_mem {α : Type u_1} {a : α} [inst : SizeOf α] {as : List α} (h : a as) :
theorem List.append_cancel_left {α : Type u_1} {as : List α} {bs : List α} {cs : List α} (h : as ++ bs = as ++ cs) :
bs = cs
theorem List.append_cancel_right {α : Type u_1} {as : List α} {bs : List α} {cs : List α} (h : as ++ bs = cs ++ bs) :
as = cs
@[simp]
theorem List.append_cancel_left_eq {α : Type u_1} (as : List α) (bs : List α) (cs : List α) :
(as ++ bs = as ++ cs) = (bs = cs)
@[simp]
theorem List.append_cancel_right_eq {α : Type u_1} (as : List α) (bs : List α) (cs : List α) :
(as ++ bs = cs ++ bs) = (as = cs)
@[simp]
theorem List.sizeOf_get {α : Type u_1} [inst : SizeOf α] (as : List α) (i : Fin (List.length as)) :
theorem List.le_antisymm {α : Type u_1} [inst : LT α] [s : Antisymm fun a a_1 => ¬a < a_1] {as : List α} {bs : List α} (h₁ : as bs) (h₂ : bs as) :
as = bs
instance List.instAntisymmListLeInstLEList {α : Type u_1} [inst : LT α] [inst : Antisymm fun a a_1 => ¬a < a_1] :
Antisymm fun a a_1 => a a_1
Equations
  • List.instAntisymmListLeInstLEList = { antisymm := (_ : ∀ {a b : List α}, a bb aa = b) }