Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] nth element of a vector

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] nth element of a vector


Chronological Thread 
  • From: Talia Ringer <tringer AT cs.washington.edu>
  • To: Coq-Club <coq-club AT inria.fr>
  • Subject: Re: [Coq-Club] nth element of a vector
  • Date: Wed, 20 May 2020 10:36:29 -0700
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=tringer AT cs.washington.edu; spf=Pass smtp.mailfrom=tringer AT cs.washington.edu; spf=None smtp.helo=postmaster AT mail-wr1-f51.google.com
  • Ironport-phdr: 9a23:Re9isxI7qJBuh6CE19mcpTZWNBhigK39O0sv0rFitYgeI/7xwZ3uMQTl6Ol3ixeRBMOHsq8C0rKH+Pm5AyQp2tWoiDg6aptCVhsI2409vjcLJ4q7M3D9N+PgdCcgHc5PBxdP9nC/NlVJSo6lPwWB6nK94iQPFRrhKAF7Ovr6GpLIj8Swyuu+54Dfbx9HiTagYb5+Ngi6oRnVu8UZnIduN7g9wQbVr3VVfOhb2XlmLk+JkRbm4cew8p9j8yBOtP8k6sVNT6b0cbkmQLJBFDgpPHw768PttRnYUAuA/WAcXXkMkhpJGAfK8hf3VYrsvyTgt+p93C6aPdDqTb0xRD+v4btnRAPuhSwaMTMy7WPZhdFqjK9Drx2hqR5wzY7abo+WKfRwYL/ScMgASmZdRMtcTTBNDp++YoYJEuEPPfxYr474p1YWsxWxHw2sBOL1xTRVmnH23Ks60+s/HgHcwQctGM4OsG7VrNXzO6cdT/q1wbLUwjXYdf9X1y3y6JPIchAgp/GMUq5wcc3XyUU1CQzKk0iQpJXjMjiI2esDr3KV4PB8VeKzlWEnsQdxryCxy8ooloTEh4MYxkza+ShkxIs7KsG0RUBmbdOmDZZdtSOXOoRqT84sXW1luyk3x7IYtJO7YSQG1Zoqyh3dZvGadYWD/xztVOGUIThihXJlfqqyhxmz8Ui8yu38S9K73ExWoSpCl9nArmoN2ALO5ceaS/t94l2t1iqI1wDW7OxPPEM6lbLDJpI/3rI9koAfvEfDEyPshkn6krKael8k9+S17ensf6/oqYWGN4BujwHzKqQuldK7AeQ/KgUOWnKU+eW41LH680z5WqhGguQ4kqTZrZzWP8sbpqm+Aw9a1oYs9QyzACuh0NQdhXUHLVRFdwybj4XxJV3CPPT1Ae28jlmsijtn2e7KMqD7DpjNM3TPiLLhcqx8605Yxgoz19df55dMB7EdOvLzW0nxtNPGAR8jKAG73/3nBM9z14wEQmKPAq6ZMKXdsV+U4eIvJfOAa5EItzbgM/Ql/eLhjWclmV8BeqmkxYcYaHehHvh/P0qZZWfsjcwaHGcRvgs+SfTqh0eYXT5SYXayRaM86SshBIKoF4eQDryq1ZeGxWKQGoBcLjRNDUnJGnP1fa2FXe0NYWScOJkyvCYDUO2dQosg3FmUtQn1xqAvevbO+ysXuIjL38Mz+OTIlRA0+iBzCYKQ33zbHDI8pX8BWzJjhPM3mkd60FrWifEl0cwdLsRa4rZyail/NZPYyLYnWdX7WwaEYc3QDVj7G5OpBjY+St93yNgLMR4kR4eSyyvb1i/vOIc70qSRDcVloKnHmWf4PMZ8zXna069nglU7EJMWZD+Ww5Vn/g2WPLbn1kCQlqKkb6MZhX+f/3zF0mOVvEBeXxJ3V+PIUW1NP0Y=

On Wed, May 20, 2020 at 05:29:19PM +0200, Dominique Larchey-Wendling wrote:
> Quick fix ... project your vector into a list ;-)
>

Interessting, do you know any function that does that for me?

You can get between list T and sigT (vector T) freely, or otherwise between { l : list T & length l = n } and vector T n. I have a tool called DEVOID that ports proofs between types like these including lists and vectors. It can probably just spit out the thing you want for you if you want to use it directly. But if that feels too heavy-weight for you, you can just use the conversion functions it generates automatically:

https://www.reddit.com/r/dependent_types/comments/g8v59q/coq_applying_a_proof_on_lists_to_a_proof_on/fov7w1t/?context=3

If you want a particular function or proof over vectors from one over lists I can generate it, but I'm a bit busy so it won't be immediate. I'm hoping to port the entire list library at some point. The process looks like this. Note how to get functions and proofs over vectors of a particular length, rather than over sigT (vector T), you need not only a list function but also its length.

On Wed, May 20, 2020 at 9:16 AM Fritjof Bornebusch <fritjof AT uni-bremen.de> wrote:
On Wed, May 20, 2020 at 05:29:19PM +0200, Dominique Larchey-Wendling wrote:
> Quick fix ... project your vector into a list ;-)
>

Interessting, do you know any function that does that for me?

>
> ----- Mail original -----
> > De: "Fritjof Bornebusch" <fritjof AT uni-bremen.de>
> > À: "coq-club" <coq-club AT inria.fr>
> > Envoyé: Mercredi 20 Mai 2020 17:15:33
> > Objet: [Coq-Club] nth element of a vector
>
> > Hi there,
> >
> > I'm looking for a function that iterates over a vector -
> > https://coq.inria.fr/library/Coq.Vectors.Vector.html - and returns
> > the Zth element, like the nth element of a list.
> >
> > The library function only dealy with the Fin.t type, but I need Z.
> > Does anyone has a suggestion or hint?
> >
> > Best Regards,
> > --f.



Archive powered by MHonArc 2.6.19+.

Top of Page