Zulip Chat Archive

Stream: general

Topic: fin n → α


Reid Barton (Aug 06 2020 at 22:55):

Is there any little library of functions around fin n → α providing a vector-style API?

Reid Barton (Aug 06 2020 at 22:57):

I'm wondering whether it would be worth making a def to use with dot notation, maybe finvec?

Mario Carneiro (Aug 06 2020 at 22:57):

I think so, in data.fin

Reid Barton (Aug 06 2020 at 22:57):

I found array actually exists but it seems extremely unused

Reid Barton (Aug 06 2020 at 22:58):

aha!

Mario Carneiro (Aug 06 2020 at 22:58):

array is special purpose because it is literally an array in the VM

Adam Topaz (Aug 06 2020 at 23:03):

Append is annoying... I've used docs#sum_fin_sum_equiv

Reid Barton (Aug 06 2020 at 23:03):

Yes, I was planning to use that in the implementation

Floris van Doorn (Aug 06 2020 at 23:05):

There is things like docs#fin.tail

Reid Barton (Aug 06 2020 at 23:06):

append is in fact the thing I specifically need the most

Adam Topaz (Aug 06 2020 at 23:06):

@Colter MacDonald and I did some ad-hoc stuff like this here

https://github.com/adamtopaz/UnivAlg/blob/master/src/ftuple.lean

Adam Topaz (Aug 06 2020 at 23:06):

It's not very well integrated with mathlib stuff though

Reid Barton (Aug 06 2020 at 23:06):

but in the generality of the dependently typed case, I would first need to be able to append the type vectors

Reid Barton (Aug 06 2020 at 23:06):

actually doesn't snoc already have this issue, hmm

Reid Barton (Aug 06 2020 at 23:07):

Oh I see, the input to snoc is the whole output type

Reid Barton (Aug 06 2020 at 23:07):

hmm maybe that's a good idea

Adam Topaz (Aug 06 2020 at 23:08):

Oh you want heterogeneous vectors!

Reid Barton (Aug 06 2020 at 23:08):

No, I don't

Reid Barton (Aug 06 2020 at 23:08):

but data.fin has them

Adam Topaz (Aug 06 2020 at 23:08):

Ah ok

Reid Barton (Aug 06 2020 at 23:08):

so I'm not sure what makes sense for mathlib now

Reid Barton (Aug 06 2020 at 23:09):

There's also some stuff in data.matrix.notation

Reid Barton (Aug 06 2020 at 23:09):

which seems to duplicate parts of data.fin except that it's homogeneous

Reid Barton (Aug 06 2020 at 23:11):

oh now I see vec_cons from data.matrix.notation is literally defined as fin.cons

Adam Topaz (Aug 12 2020 at 13:42):

@Reid Barton Did you end up doing anything with these fin n vectors that might end up in mathlib? I need to use a few such functions and don't want to duplicate work.

Reid Barton (Aug 12 2020 at 15:52):

Nothing that's in a usable state yet

Adam Topaz (Aug 12 2020 at 15:52):

Ok, thanks.


Last updated: Dec 20 2023 at 11:08 UTC