coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Siddharth Bhat <siddu.druid AT gmail.com>
- To: ikdc <ikdc AT mit.edu>
- Cc: coq-club AT inria.fr
- Subject: Re: [Coq-Club] Type for finite set of naturals [1..N]?
- Date: Wed, 10 Jan 2018 06:55:45 +0000
- Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=siddu.druid AT gmail.com; spf=Pass smtp.mailfrom=siddu.druid AT gmail.com; spf=None smtp.helo=postmaster AT mail-qt0-f182.google.com
- Ironport-phdr: 9a23:mkj7/xQjhmwdyDJ7cf2xm4DHDdpsv+yvbD5Q0YIujvd0So/mwa69ZRaN2/xhgRfzUJnB7Loc0qyK6/mmATRIyK3CmUhKSIZLWR4BhJdetC0bK+nBN3fGKuX3ZTcxBsVIWQwt1Xi6NU9IBJS2PAWK8TW94jEIBxrwKxd+KPjrFY7OlcS30P2594HObwlSizexfa5+IA+qoQnNq8IbnZZsJqEtxxXTv3BGYf5WxWRmJVKSmxbz+MK994N9/ipTpvws6ddOXb31cKokQ7NYCi8mM30u683wqRbDVwqP6WACXWgQjxFFHhLK7BD+Xpf2ryv6qu9w0zSUMMHqUbw5Xymp4qF2QxHqlSgHLSY0/27ZisNyjKxVrhGvqQFhzYHIe4yaLuZyc7nHcN8GWWZMXMBcXDFBDIOmaIsPCvIMM/tZr4bgulQOrQGxBROwBOPv1zRFm3/20rcm0+88FgzGxw0gEM8Tv3TJttn6Kb0SUf20zKbV1jjDYPZW1i386IjMaBwuvfaMXbdpfMfX1EIhFBvFg02OpYD5Oz6ZzOcAvmiB4+Z+SO6iinQrpxxyrzSxwMonl5PHiZgPyl/e8CV02IY1KsO8SE58edOkFYFftyCeN4dvW8MiX31ktD80yrEbupO3YjIGyJsgxx7YZPyHd5aH7gj/W+aWJDd0nHNleLShiBau6UWs1PHwW82u3FtJridJiMfAum0M2hDJ98SKSeVx8l+k2TmV1gDT7u9EIVozlareM5Mh2b8wmYcOvkTeBCP5hV/2jLKXdko54eWo5OHnba/npp+YLYN7lgb+MqE2lsylHes4KhQOX3Sc+emkyLLj+lT5TKxWgf0yj6nWq4vXJd8bp668Gw9ayJwv6xe5Dze80dQXh2MLLFxfeEHPs4+8OlLCK7isDPSziHypkSstyvzbaO7PGJLIe0PCnLvhdKxh6wZ2yAMvhYRE5p5YF/cNOu/yVmf+sdXZClkyNAnikLWvM8l0yo5LATHHOaSeKq6H6VI=
Thank you, that does help.
How does the set notation work? I haven't seen that before, that is cool.
Is there some place that uses Fin in some trivial way? Eg. Establishes a bijection with [1..n]? If not, I suppose I can stumble through :)
Thanks
Siddharth
On Wed 10 Jan, 2018, 11:36 ikdc, <ikdc AT mit.edu> wrote:
On 01/10/2018 12:58 AM, Siddharth Bhat wrote:
> Hello all, I'm looking for a type that encodes the fact that its
> inhabitants are naturals from 1 to N.
>
> I believe Fin is the type I am looking for? I'm not sure what Fin
> represents, exactly. Does Fin act as a witness for the *entire interval*
> [1..n]? Or can it witness some k \in [1..n]?
>
> Ideally. There would be a type (forall n : nat), "T n" whose inhabitants
> can be put in bijection with [1..n]
>
> Thanks
> Siddharth
>
Fin N is indeed such a type. The two constructors represent the following:
- Fin (N + 1) has one element for each element of Fin N
- as well as one extra element
Hopefully that explains its definition.
I believe it is isomorphic to the type { n : nat | n < N } (or
alternatively { n : nat | 0 < n /\ n <= N }) which may be easier to work
with depending on what you're trying to do.
ikdc
--
Sending this from my phone, please excuse any typos!
- [Coq-Club] Type for finite set of naturals [1..N]?, Siddharth Bhat, 01/10/2018
- Re: [Coq-Club] Type for finite set of naturals [1..N]?, ikdc, 01/10/2018
- Re: [Coq-Club] Type for finite set of naturals [1..N]?, Siddharth Bhat, 01/10/2018
- Re: [Coq-Club] Type for finite set of naturals [1..N]?, karsar, 01/10/2018
- Re: [Coq-Club] Type for finite set of naturals [1..N]?, Dominique Larchey-Wendling, 01/10/2018
- Re: [Coq-Club] Type for finite set of naturals [1..N]?, Siddharth Bhat, 01/10/2018
- Re: [Coq-Club] Type for finite set of naturals [1..N]?, ikdc, 01/10/2018
Archive powered by MHonArc 2.6.18.