Skip to Content.
Sympa Menu

ssreflect - Re: [ssreflect] Finfun and positivity requirements

Subject: Ssreflect Users Discussion List

List archive

Re: [ssreflect] Finfun and positivity requirements


Chronological Thread 
  • From: Assia Mahboubi <>
  • To:
  • Subject: Re: [ssreflect] Finfun and positivity requirements
  • Date: Thu, 21 Feb 2019 15:18:59 +0100
  • Autocrypt: ; keydata= xsFNBFRwdNcBEACayG+RJjOUz7A9KI4UJZQ4rF53F/QbuWsVwxs+HnFaMHlGA+dyL41hOe14 B+4w50e2jHy6KaBKLP4HFVZpJKpWQsxRmP6vREpbHziF1aNNgoQAER1iriqOiNNTZG8Nbvre ve4BwVHBmbblDvqfXvHdBh35KG//kwYCwAz2g05FWNKe7OZhrQ0wjsdh9p9rSm9mSgL4jFIH 7FxpFw3I20jr+qlTXUyFHLXVjFZnxhznOGa8Kwp3o+UfkjRNUd8bBEbz+jtz1XHTbmDbQRrt msUNozyryiu2mWMt26fJZbSrk6fR/IV/y0XoTe6Uz0o2GtnjeXmCFxe7DwZtwVrina90+MuY okXmKVmv0JVlP3ic1m+GDdF0RNTh0r9w666YUmhebjgwR/3I7uc2JLHJCM9LulnQWx6aVJhH WsELeu5hLXgf9judAtZxUc8aZx7l8I4C2UDRbdSBqQTW1zhxdb6B0TCCuiNUqCISXG6xKAqm 9PsU6Ohb7rIal/yDmy4or/IclxRXx9W8WOxJxTZZt43GyK/1hS43UP6fI//V5cVAOilzOLlc iCdWtlHL4xv+gboSAAH7W1GoZyhpGKb0L3U/BhO8tkTtSPQx9d/GflmHxNBiQeccVAtEYIy4 knIrCuetxksGyZ72E9fXE62tJhwoxlCg6JvOEZAEXzHxbVfywwARAQABzShBc3NpYSBNYWhi b3ViaSA8QXNzaWEuTWFoYm91YmlAaW5yaWEuZnI+wsF+BBMBAgAoBQJUcHTXAhsjBQkJZgGA BgsJCAcDAgYVCAIJCgsEFgIDAQIeAQIXgAAKCRBWO2266JVxsV95D/0bWtsjZ1vjuZYkqR0r WVIs2/G7yYMZ24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4W9J2K7CWzNT7c5n/sBbS5OJsGOW66hck7VAhHVsFjxz Wmmy2C2pIx5w3iJzrzGJlI+anaK/XxJowM5td2faiNZ5wWfVj5lkCJeEqRyAT3INz+5zPsin yQ1vU44JU6C4kjsYBhQ+2YnorrWp2ceRqg483gPYdB/d1DPjOt8j4pIqh2vbhkIo+V56owdt /yerQY1Ykn7zLJ3k/jstdXDF7fXQyFrPMpDnvzG0Gyd79jKNW6M+Hf+1wn2Y/j4YDyMAEQEA AcLBZQQYAQIADwUCVHB01wIbDAUJCWYBgAAKCRBWO2266JVxsWnED/sHj5v9vOCvf3jvzqfz qOrBIuku8M6sRPZcZWtfsXote6l8G3cso6qpNzf7LJmEqfBe4kOMwglgs0Q3osYAr7i6Fjid Qbfbx973gorst7tVek7t7i/s+HOsqW29qocNCa0uysinWjlruC/GaLbCWpcRFPWIcMyc9pCR GiHxUhqVIutwD2K0uTIjQDZzISKkZG+hsUedvlm4tS3gmRNWjg4G2xISgyJ0/AAzkP8O7riY jWZ7B1ih0WkKccBYq5BHs/JkKYuIfYww2DxlFuVbWxyi6yLulu3w4J9gNOBzRzBm2S3hggAX FUq1QHdMrTECoSQ/KioDUgcBJ1mqM53r8AgoTUBdKU8OEriGeusNvmOBA++SjQibdQTaNsqS A6m1uCcyIhvmcGHIecS80z5BftC9hEfzGTVepBwF71Qdj1UyrNkouVdRn2tlFsTF72RgMdfl Q4C15ux51RmUL9hGDYoDHFXS2TxV+0keqRsUBN7WKY7ZscTVzoeeLekr98foMXL6cECPCzQ6 d4rv+2mL8653OOcpm3KkZQy7fnmdoqo97RIzOaVo56RvI97zu7w2to4bERdRphZwwMJDv8KE AJq/P7Wp/STs2XD6wnPjGLLFikTvE/ujE5NSS5KVM3M9TdfdYO5gOQ2itiT3DU7J5Wionw4A jk5NNWijOhe6shDkUQ==
  • Openpgp: preference=signencrypt

Dear Joshua,

I am afraid I do not have a satisfactory answer to provide...

With your first version

> Inductive TstF :=
> | TBase : nat -> TstF
> | TF : (T -> TstF) -> TstF.

there is indeed little hope to obtain an eqType up to extensionality in
CIC without extra axiom, due to the arrow type in the argument of the TF
constructor.

It is certainly a pity that Coq is not able to detect that a definition
like:

> Inductive TstF' :=
> | TBase' : nat -> TstF'
> | TF' : {ffun T -> TstF'} -> TstF'.

is harmless. But I am afraid that a discussion on a the possible
improvements of the (so-called positivity) condition for the
well-formedness of inductive types would be more appropriate elsewhere,
e.g. on the CoqClub mailing list.

Here is the only thing I could come up with: working with the less
specific type

Inductive TstF_aux :=
| TBase_aux : nat -> TstF_aux
| TF_aux : seq TstF_aux -> TstF_aux.


and recover the corresponding function TF : T -> TstF attached to an
inner node using something like:

TF (s : seq TstF) : T -> TstF := fun t => nth (TBase 0) s (enum_rank t).

Type TstF_aux can be easily endowed with eq/choice/countType structures
using for instance an encoding to GenTree.tree (as indicted in the
header of the choice.v library).

A predicate discriminating well-formed trees (with sequences of the
appropriate size) might be necessary. In which case, a subType could be
used to transport again the eq/choice/countType structructures.

Best wishes,

assia


Le 15/02/2019 à 20:00, Joshua Gancher a écrit :
> Hi all,
>
> Consider the below datatype, where T is a finType:
>
> Inductive TstF :=
>   | TBase : nat -> TstF
>   | TF : (T -> TstF) -> TstF.
>
> I would like to leverage the finType structure of T in order to give a
> choiceType structure to TstF (up to extensionality of the function in
> TF). Thus I want to do something like: 
>
> Inductive TstF' :=
>   | TBase' : nat -> TstF'
>   | TF' : {ffun T -> TstF'} -> TstF'.
>
> However, the above does not go through, since it violates the strict
> positivity requirement in Coq. (Indeed, replacing {ffun T -> TstF'} with
> something like {xs : list TstF' | P xs} where P is a pred also violates
> the same requirement.)
>
> Has anybody thought of a workaround for this issue? 
>
> Thanks,
> Joshua Gancher



Archive powered by MHonArc 2.6.18.

Top of Page