coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: kirang <kirang AT comp.nus.edu.sg>
- To: coq-club AT inria.fr
- Cc: Qinshi Wang <qinshiw AT cs.princeton.edu>
- Subject: Re: [Coq-Club] Interesting uses of Second order theorems in Coq proofs
- Date: Fri, 10 Jun 2022 07:09:46 +0100
- Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=kirang AT comp.nus.edu.sg; spf=Pass smtp.mailfrom=kirang AT comp.nus.edu.sg; spf=None smtp.helo=postmaster AT mailgw0.comp.nus.edu.sg
- Ironport-data: A9a23:IqgxuKMVTL3BPnTvrR1zkcFynXyQoLVcMsEvi/4bfWQNrUp20jYFz 2AbC2CDOvuDNGD3eNF2bo2+/B9Tu5DUzdJnHHM5pCpnJ55ogZqcVI7Bdi8cHAvLc5adFBo/h yk6QoOdRCzhZiaE/n9BCpC48T8kk/vgqoPUUIYoAAgoLeNfYHpn2EsLd9IR2NYy24DnWlvV4 LsenuWGULOb824sWo4rw/nbwP9flKyaVOQw4zTSzdgS1LPvvyF94KA3fcldHFOkKmVgJdNWc s6YpF2PEsw1yD92Yj+tuu6TnkTn2dc+NyDW4pZdc/DKbhSvOkXe345jXMfwZ3u7hB22tdx98 o1it6eXUBkOE5+Tk+UYYgRXRnQW0a1uoNcrIFC6uM2XwFKeNXDrxu0oClwte4AU56BsDgmi9 9RBc29LN0vZwbLqhujjIgVvrpxLwM3DP4IFs3dv5TreCO5gR43YBajG+JlD01/cg+gXQ62OP pNBMlKDajzgMzF3B30cMqs0o8mrmkPzSn4f8VS88P9fD2/7ll0vj+e0a7I5YOeiTsJM202cu 2ju5HX8GhhcNdqFyDPD/GjEuwPUtXOnHdhKUra/8+YshkCIgGEfFVsNWjNXvMVVlGaBcd5TE RQ7+BEJtLYV2X70Rdj4bgC39SvsUgEnZ/JcFOgz6Qeow6XS4hqECmVsctKnQIB63CPRbWB2v mJlj+8FFhQ26+XEGBpx4p/N9WjtZ3NNRYMXTXZcJTbp9eU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8hFThwBtjZljMTSicWizOFbsiVow258zF2qcb3+eriWQbm74+CQ7VINtAn9xeziKaFf +me4UQxYS5fzY8JzGTUxaI32VcTjy5xL3+mFrEY8yjQV+TdlrIRFBFaIyJ/Oc1U7r4tiwlAP cmI77G9nrV8j/MzFxJETQm4wZ7vPJdQZTHhcgmfVyPpfPycKDbGwt/6e/a5QLxU16BPsgGo/ C2cCwnlNyiCkD/gU1auN/tNhWeVJk872sn1fxBzBGzkVN+jZAe8NYo9jjwsyLs7rnjNMHZaN yVnNU5Bs/uL4mkL55c3U3wE9XdjIeSezmyB6PLEL58NrfZxKiF9luZV/yx8wLxQ9GdCWeczl SfP6MVh6QLD8KHH2n9sVxxArSxOjYSAsBB5OKnXwZJHXG7N4BMH6Wj44/EirNxgEpvpprsWx 9TS0rn8em8qGzP8+MIdA8fLcISMN385dxz0A3jZABZDVjH5bQk3aGRWl/SKsHuItd43poWqg 5VcE9dm
- Ironport-sdr: e2hJHymOYXjFHFfrjZYiBzV2JxRtliSmeIC6OaLCGXYAF0TQy2Enb8z1BEr7Baydi7yUa5talj VxZDsaQYcPimdP3s15Q6mCaMLGbUuOZ9lZwa66MqpU+R9rjk6VmHStBzlKbyrN3nDQ7hPQK6Xk +BjBHMF7Gk2nKxLtxu6TOK4yUiFBb/gYOzY7SvfWea1HT0pSY9eBInHxJc8I69HMGR17oWL0tV mRw4WvbkpxUTgeAsG8GM5RlTcqI6XbdRj1DcxkDE/m9/XovVhJORDu1oN2dJYDMN3AXqtN7H0w rX7D2XfImbIN6h2oi4g6ZB4B
Hi Qinshi,
Thanks for the suggestion, yes that seems like a nice example of a small self-contained example of second order property used in Coq scripts.
Thanks,
Kiran.
On 2022-06-09 19:03, Qinshi Wang wrote:
- External Email -
I know a class of second-order properties more general than induction
principles. There is a kind of types called (generic) container types.
A container type is (Container : Type -> Type) that the type parameter
is only used in strictly positive positions. For example, lists, trees
and association lists (with the index type fixed and the content type
as parameter) are container types. A more sophisticated example is
that we can define a generic value type to represent values of
programming languages, including basic values, lists and structs. The
type of basic value can be a parameter, so the value type is a
container type.
In order to define relations between containers, we define a Forall
relation whose type is (Forall : forall A B (P : A -> B -> Prop),
Container A -> Container B -> Prop). Forall is defined as the two
containers have the same structure and each pair of corresponding
elements satisfies P. For example, Coq.Lists.List.Forall2 is the
Forall relation for lists. For each particular relation on interest,
we parametrize Forall with a particular P. In order to prove lemmas
about these relations, we prove a bunch of general second-order
lemmas, for example,
Forall2_impl:
forall {A B : Type} (P Q : A -> B -> Prop),
(forall (a : A) (b : B), P a b -> Q a b) ->
forall (l1 : list A) (l2 : list B), Forall2 P l1 l2 -> Forall2 Q l1
l2
Forall2_refl :
forall {A : Type} (f : A -> A -> Prop),
(forall x : A, f x x) -> forall v : list A, Forall2 f v v
Forall2_sym :
forall {A B : Type} (f : A -> B -> Prop) (g : B -> A -> Prop),
(forall (a : A) (b : B), f a b -> g b a) ->
forall (v1 : list A) (v2 : list B), Forall2 f v1 v2 -> Forall2 g v2
v1
Forall2_trans :
forall {A B C : Type} (f : A -> B -> Prop) (g : B -> C -> Prop) (h :
A -> C -> Prop),
rel_trans f g h ->
forall (v1 : list A) (v2 : list B) (v3 : list C),
Forall2 f v1 v2 -> Forall2 g v2 v3 -> Forall2 h v1 v3
Using these general lemmas, the task of proving lemmas about Forall
relations is reduced to proving lemmas about pointwise relations.
Thanks,
Qinshi
On Thu, Jun 9, 2022 at 12:14 AM kirang <kirang AT comp.nus.edu.sg> wrote:
Hi Coq Club,
For various reasons, I'm currently doing a light survey of examples
of
interesting uses of second order properties/lemmas in Coq proof
scripts.
Currently, the main examples I've found in the wild have mostly been
using various induction principles for custom datatypes and the such
(found through searching Github/using Coq's search mechanism).
I've seemingly exhausted searching through Github for now and so I
thought I might reach out to the magnanimous wisdom and experience
of
the Coq club community in this search.
Do you have any interesting examples of other classes of second
order
properties (i.e other than induction principles) you have seen/used
in
your own proofs?
Thanks,
Kiran.
- [Coq-Club] Interesting uses of Second order theorems in Coq proofs, kirang, 06/09/2022
- Re: [Coq-Club] Interesting uses of Second order theorems in Coq proofs, Qinshi Wang, 06/09/2022
- Re: [Coq-Club] Interesting uses of Second order theorems in Coq proofs, kirang, 06/10/2022
- Re: [Coq-Club] Interesting uses of Second order theorems in Coq proofs, roux cody, 06/09/2022
- Re: [Coq-Club] Interesting uses of Second order theorems in Coq proofs, Lawrence Dunn, 06/09/2022
- Re: [Coq-Club] Interesting uses of Second order theorems in Coq proofs, Castéran Pierre, 06/09/2022
- Re: [Coq-Club] Interesting uses of Second order theorems in Coq proofs, kirang, 06/10/2022
- Re: [Coq-Club] Interesting uses of Second order theorems in Coq proofs, Ralf Jung, 06/11/2022
- Re: [Coq-Club] Interesting uses of Second order theorems in Coq proofs, Qinshi Wang, 06/11/2022
- Re: [Coq-Club] Interesting uses of Second order theorems in Coq proofs, Ralf Jung, 06/11/2022
- Re: [Coq-Club] Interesting uses of Second order theorems in Coq proofs, kirang, 06/10/2022
- Re: [Coq-Club] Interesting uses of Second order theorems in Coq proofs, Castéran Pierre, 06/09/2022
- Re: [Coq-Club] Interesting uses of Second order theorems in Coq proofs, Lawrence Dunn, 06/09/2022
- Re: [Coq-Club] Interesting uses of Second order theorems in Coq proofs, kirang, 06/10/2022
- Re: [Coq-Club] Interesting uses of Second order theorems in Coq proofs, Steve Zdancewic, 06/10/2022
- Re: [Coq-Club] Interesting uses of Second order theorems in Coq proofs, Sylvain Boulmé, 06/10/2022
- Re: [Coq-Club] Interesting uses of Second order theorems in Coq proofs, Steve Zdancewic, 06/10/2022
- Re: [Coq-Club] Interesting uses of Second order theorems in Coq proofs, Ken Kubota, 06/10/2022
- Re: [Coq-Club] Interesting uses of Second order theorems in Coq proofs, Qinshi Wang, 06/09/2022
Archive powered by MHonArc 2.6.19+.