Zulip Chat Archive

Stream: new members

Topic: vector mem


Horatiu Cheval (Mar 11 2021 at 12:59):

How can I write a ∈ t with a : α and t : vector α n? Should I define myself a has_mem instance for vector or can I somehow use the instance for list, since vector is a subtype of it?

Anne Baanen (Mar 11 2021 at 13:05):

Both ways would work, either define the has_mem α (vector α n) instance, or write a ∈ (t : list α).

Anne Baanen (Mar 11 2021 at 13:07):

Hmm, there isn't a coercion from vector to list, apparently.

Anne Baanen (Mar 11 2021 at 13:07):

So you would have to write:

example {α : Type*} {n : } (a : α) (t : vector α n) : Prop := a  t.1

Horatiu Cheval (Mar 11 2021 at 13:13):

Thanks!


Last updated: Dec 20 2023 at 11:08 UTC