instance
HVector.decidableEq
{α : Type u_3}
{A : α → Type u_1}
[(a : α) → DecidableEq (A a)]
{l : List α}
:
DecidableEq (HVector A l)
def
HVector.map
{α : Type u_3}
{A : α → Type u_1}
{B : α → Type u_2}
(f : (a : α) → A a → B a)
{l : List α}
:
Equations
- HVector.map f HVector.nil = HVector.nil
- HVector.map f (a::ₕas) = (f t a::ₕHVector.map f as)
Instances For
def
HVector.map'
{α : Type u_5}
{β : Type u_6}
{A : α → Type u_3}
{B : β → Type u_4}
(f' : α → β)
(f : (a : α) → A a → B (f' a))
{l : List α}
:
An alternative to map
which also maps a function over the index list
Equations
- HVector.map' f' f HVector.nil = HVector.nil
- HVector.map' f' f (a::ₕas) = (f t a::ₕHVector.map' f' f as)
Instances For
def
HVector.foldl
{α : Type u_4}
{A : α → Type u_1}
{B : Type u_3}
(f : (a : α) → B → A a → B)
{l : List α}
:
B → HVector A l → B
Equations
- HVector.foldl f x HVector.nil = x
- HVector.foldl f x (a::ₕas) = HVector.foldl f (f t x a) as
Instances For
To be used as an auto-tactic to prove that the index of getN is within bounds
Equations
- HVector.tacticHvector_get_elem_tactic = Lean.ParserDescr.node `HVector.tacticHvector_get_elem_tactic 1024 (Lean.ParserDescr.nonReservedSymbol "hvector_get_elem_tactic" false)
Instances For
@[reducible, inline]
abbrev
HVector.getN
{α : Type u_3}
{A : α → Type u_1}
{as : List α}
(x : HVector A as)
(i : Nat)
(hi : autoParam (i < as.length) _auto✝)
:
A (as.get ⟨i, hi⟩)
x.getN i
indexes into a HVector
with a Nat
.
Note that we cannot define a proper instance of GetElem
for HVector
,
since GetElem
requires us to specify a type elem
such that xs[i] : elem
,
but elem
is not allowed to depend on the concrete index i
.
Thus, GetElem
does not properly support heterogeneous container types like HVector
Equations
- x.getN i hi = x.get ⟨i, hi⟩
Instances For
Equations
- HVector.ToTupleType A [] = PUnit
- HVector.ToTupleType A [a] = A a
- HVector.ToTupleType A (a :: as) = (A a × HVector.ToTupleType A as)
Instances For
def
HVector.toTuple
{α : Type u_3}
{A : α → Type u_1}
{as : List α}
:
HVector A as → HVector.ToTupleType A as
Turns a HVector A [a₁, a₂, ..., aₙ]
into a tuple (A a₁) × (A a₂) × ... × (A aₙ)
Equations
Instances For
theorem
HVector.map_map
{α : Type u_6}
{A : α → Type u_3}
{B : α → Type u_4}
{C : α → Type u_5}
{l : List α}
(t : HVector A l)
(f : (a : α) → A a → B a)
(g : (a : α) → B a → C a)
:
HVector.map g (HVector.map f t) = HVector.map (fun (a : α) (v : A a) => g a (f a v)) t
Equations
- One or more equations did not get rendered due to their size.