mk lemmas #
@[simp]
theorem
Vector.indexOf?_mk
{α : Type u_1}
{n : Nat}
[BEq α]
(a : Array α)
(h : a.size = n)
(x : α)
:
{ toArray := a, size_toArray := h }.indexOf? x = Option.map (Fin.cast h) (a.indexOf? x)
@[deprecated Vector.set_mk (since := "2024-11-25")]
theorem
Vector.setN_mk
{α : Type u_1}
{n : Nat}
(a : Array α)
(h : a.size = n)
(i : Nat)
(x : α)
(w : i < n)
:
{ toArray := a, size_toArray := h }.set i x w = { toArray := a.set i x ⋯, size_toArray := ⋯ }
Alias of Vector.set_mk
.
@[deprecated Vector.swap_mk (since := "2024-11-25")]
theorem
Vector.swapN_mk
{α : Type u_1}
{n : Nat}
(a : Array α)
(h : a.size = n)
(i j : Nat)
(hi : j < n)
(hj : i < n)
:
{ toArray := a, size_toArray := h }.swap i j hj hi = { toArray := a.swap i j ⋯ ⋯, size_toArray := ⋯ }
Alias of Vector.swap_mk
.
@[deprecated Vector.swapAt_mk (since := "2024-11-25")]
theorem
Vector.swapAtN_mk
{α : Type u_1}
{n : Nat}
(a : Array α)
(h : a.size = n)
(i : Nat)
(x : α)
(hi : i < n)
:
{ toArray := a, size_toArray := h }.swapAt i x hi = ((a.swapAt i x ⋯).fst, { toArray := (a.swapAt i x ⋯).snd, size_toArray := ⋯ })
Alias of Vector.swapAt_mk
.
@[simp]
toArray lemmas #
@[simp]
@[simp]
theorem
Vector.toArray_mkEmpty
{α : Type u_1}
(cap : Nat)
:
(mkEmpty cap).toArray = Array.mkEmpty cap
@[simp]
theorem
Vector.toArray_ofFn
{n : Nat}
{α : Type u_1}
(f : Fin n → α)
:
(ofFn f).toArray = Array.ofFn f
@[deprecated Vector.toArray_setIfInBounds (since := "2024-11-25")]
theorem
Vector.toArray_setD
{α : Type u_1}
{n : Nat}
(a : Vector α n)
(i : Nat)
(x : α)
:
(a.setIfInBounds i x).toArray = a.setIfInBounds i x
Alias of Vector.toArray_setIfInBounds
.
@[deprecated Vector.toArray_set (since := "2024-11-25")]
theorem
Vector.toArray_setN
{α : Type u_1}
{n : Nat}
(a : Vector α n)
(i : Nat)
(x : α)
(h : i < n)
:
(a.set i x h).toArray = a.set i x ⋯
Alias of Vector.toArray_set
.
@[deprecated Vector.toArray_swapIfInBounds (since := "2024-11-25")]
theorem
Vector.toArray_swap!
{α : Type u_1}
{n : Nat}
(a : Vector α n)
(i j : Nat)
:
(a.swapIfInBounds i j).toArray = a.swapIfInBounds i j
Alias of Vector.toArray_swapIfInBounds
.
@[deprecated Vector.toArray_swap (since := "2024-11-25")]
theorem
Vector.toArray_swapN
{α : Type u_1}
{n : Nat}
(a : Vector α n)
(i j : Nat)
(hi : j < n)
(hj : i < n)
:
(a.swap i j hj hi).toArray = a.swap i j ⋯ ⋯
Alias of Vector.toArray_swap
.
@[deprecated Vector.toArray_swapAt (since := "2024-11-25")]
theorem
Vector.toArray_swapAtN
{α : Type u_1}
{n : Nat}
(a : Vector α n)
(i : Nat)
(x : α)
(h : i < n)
:
((a.swapAt i x h).fst, (a.swapAt i x h).snd.toArray) = ((a.swapAt i x ⋯).fst, (a.swapAt i x ⋯).snd)
Alias of Vector.toArray_swapAt
.
toList lemmas #
getElem lemmas #
@[simp]
theorem
Vector.getElem_pop'
{α : Type u_1}
{n : Nat}
(v : Vector α (n + 1))
(i : Nat)
(h : i < n + 1 - 1)
:
v.pop[i] = v[i]
Variant of getElem_pop
that will sometimes fire when getElem_pop
gets stuck because of
defeq issues in the implicit size argument.
empty lemmas #
Decidable quantifiers. #
instance
Vector.instDecidableForallVectorZero
{α : Type u_1}
(P : Vector α 0 → Prop)
[Decidable (P { toArray := #[], size_toArray := ⋯ })]
:
instance
Vector.instDecidableForallVectorSucc
{α : Type u_1}
{n : Nat}
(P : Vector α (n + 1) → Prop)
[Decidable (∀ (x : α) (v : Vector α n), P (push x v))]
:
Equations
- Vector.instDecidableForallVectorSucc P = decidable_of_iff' (∀ (x : α) (v : Vector α n), P (Vector.push x v)) ⋯
instance
Vector.instDecidableExistsVectorZero
{α : Type u_1}
(P : Vector α 0 → Prop)
[Decidable (P { toArray := #[], size_toArray := ⋯ })]
:
Equations
- Vector.instDecidableExistsVectorZero P = decidable_of_iff (¬∀ (v : Vector α 0), ¬P v) ⋯