coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Jeremy Dawson <Jeremy.Dawson AT anu.edu.au>
- To: "coq-club AT inria.fr" <coq-club AT inria.fr>
- Subject: Re: [Coq-Club] existT
- Date: Wed, 2 Oct 2019 11:17:23 +0000
- Accept-language: en-US
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=anu.edu.au; dmarc=pass action=none header.from=anu.edu.au; dkim=pass header.d=anu.edu.au; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=k5NcBGZ0rlGUocP/LavubpvxnoutDn1Ns8PqNEzYwN8=; b=eOE4yXMYQSUdiSjKIDrTsHSPxntHX/Aso5/ZkwVQ6zBia4zWk/EnAGYTok3CCvdhKRrRLcd6UwRgI2klIT5SFs8d+DdZ35s6II1ze3TvwE9ay1V37qXr8RbWRezURT39WfDG/9F0xaO4WDuhDBGyjil8xMvaEsoUKxY321emJ0xsBZbDxs4WnFNhWlI/HA2sx0MOAw2TKJpz7PeTNup91bXzt5Fddh5btI7yH8NX03UEB8/kSpcmQbWNmwl2d+iJlfbuZb7w2/yzLeGIfPAcvxUYQYCKgkHKu8r+lDWoB75gIA+wb7olqNTOKaBJKNgkS0nJ3Nq7GNNt/gxUijd1xg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gLOpivDbb7b4ZI5XMt9TeyULqZc34OtOgPg92X3W+tE/Zrp1cPQYamna3QY6Q0q419ik71GcLJgukZVGY9HXm+afgKOR7MZBJCHuJUtji/oASiehgcTxrnbr32LQ4BoI46Uuc9roMZKPXa+WA/0h/7KJ1yXink288PuE018l7VkCxv4rtW2gcTPtAMrjaqEGFCl0N/R80KHBxl4JGXNZQesEGLs6pEtWOJsclEmAHy4PbqMNQ1iaDuGiuDHFn485ROWpeOGTmDOXEqgwjksm4k/19v8t1ht4W1I6PS6giQj3hwK87BQ0Q1mNeEILE0bZbTsoMJZ3jCHnBFJDx3ZIbQ==
- Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=Jeremy.Dawson AT anu.edu.au; spf=Pass smtp.mailfrom=Jeremy.Dawson AT anu.edu.au; spf=Pass smtp.helo=postmaster AT AUS01-ME1-obe.outbound.protection.outlook.com
- Ironport-phdr: 9a23:Loc8hBTTIrnFY4YVQ3qvQOF6btpsv+yvbD5Q0YIujvd0So/mwa6ybBeN2/xhgRfzUJnB7Loc0qyK6vumBTJLusbJmUtBWaQEbwUCh8QSkl5oK+++Imq/EsTXaTcnFt9JTl5v8iLzG0FUHMHjew+a+SXqvnYdFRrlKAV6OPn+FJLMgMSrzeCy/IDYbxlViDanbr5+MRu7oR/eu8QXjodvJKU8wQbVr3VVfOhb2XlmLk+JkRbm4cew8p9j8yBOtP8k6sVNT6b0cbkmQLJBFDgpPHw768PttRnYUAuA/WAcXXkMkhpJGAfK8hf3VYrsvyTgt+p93C6aPdDqTb0xRD+v4btnRAPuhSwaMTMy7WPZhdFqjK9DoByvuQFxw5Labo+WOvpxfKLdcs8VS2VORctRSzdOD5mgY4cTE+YMP+BVpJT9qVsUqhu+ABGhCufxxT9SmHD22K072PkvHw7c0g0gBNUOsHLJp9jyMKkdT/q1w7fNzTTDdf9Y1y3y6YbTchAmp/GBRqh/cczMyUU1CQzKk0iQpZb/MDOIz+kAtXWQ4el4Ve+3hGMrtxt9riWzysoukIXFm4wYx1He+Slk3Io4K8W0RUF/bNK+DZddtDyWO5FrTs4mTWxkojg2xqEatZKjcigF1pcqywLaZvGCcIWE/xLuW/2ULDp4nn1qZa+zihO9/Ee+0eLzSMy530xUoSZYjtbBsG0G2QbJ5cidUPR9+1+s2TaR2ADX7eFJOVw5mqTGJZI937I8j50dv0veEiPvn0X5l7GZel8j+ui19+ToebLmpoKaN4BpkA3+Kr4umsujAesmLgcOQ2mb+eO61LH5+k35XalKjvkxkqnes5DWP9gUpqm8AwNN04Yj7QiwDyu+3dkXgXULNk9JdA6FgoTzJl3DLvH1Ae2ij1iwnjpn3/XGMafgApXJIHjDirDhfbNl5kBY1gUz185Q55dUC70bLvz8QEHwtMffDh8/KAG72eDnCMhn2owARG2PH7WVP7nPsVOQ/OIgP/GMZJMJuDb6M/Uq+/nujWYglVABeampwIAYZWujHvVmJkWZeWDjjs0AEWcMpAo+TfblhEeMUT5JND6OWPd27TYiTYmiEI3rR4a3gbXH0j3xVsldYXkDAVSRG1/pcZ+FUrECcnTBDNVml2kmWKKsTp5p+Rixrwj8g+5FI/DZ/zxemZv8z99zz+TViFc/+SEyBtnLgDLFdH19gm5dH2x+56t4u0Eokg7eg5g9uORREJlo390MUgo+MsKDncVHMIirHyfsJ5KOQlvgRci6CzYsSN5328UJf0t2B9SliFbEwjauBLgW0beMAc5tq/6O7z3KP894jk3++uw5lVB/GJlGM3Dgi6JisQHOVdaQwhep0p2yfKFZ5xbjsWKKzG6ApkZdCVQiWKPYG30Tew3fsIag6w==
Well, thanks. But why is this? I thought constructors are always
injective.
And why does the inversion step produce this assumption involving
existT? I would have expected one subgoal with assumptions saying that
the occurrence of in_dersrec d ds is an instance of in_dersrec1, and
another subgoal with assumptions saying that the occurrence of
in_dersrec d ds is an instance of in_dersrec2, but that isn't what I am
getting - why not?
Thanks
Jeremy
On 1/10/19 7:18 pm, Dominique Larchey-Wendling wrote:
> Hi Jeremy,
>
> Pierre Casteran points you to the right place.
> I just complete the information by telling you
> that the constructor existT is *not* injective
> in its third argument.
>
> This means that from
>
> existT P x tx = existT P y ty
>
> you can deduce x = y (with projT1)
> but you *cannot* deduce tx = ty (in general).
>
> What you can prove is the following:
>
> existT P x tx = existT P y ty -> exists E : x = y, ty = eq_rect x P tx y E.
>
> If the type X on which P : X -> Type has some extra
> properties, like "proof irrelevance on the type of
> equalities over X", or stronger, "decidable equality over X",
> then you can prove
>
> existT P x t1 = existT P x t2 -> t1 = t2
>
> because there is only one proof that x = x
> and this is eq_refl.
>
> See the script below and also welcome to the
> wonderful world of dependent types ;-)
>
> Best
>
> Dominique
>
> ----
>
> Section existT_inj.
>
> Variable (X : Type) (P : X -> Type).
>
> Fact existT_inv x tx y ty :
> existT P x tx = existT P y ty -> exists E : x = y, ty = eq_rect x P
> tx y E.
> Proof.
> inversion 1; exists eq_refl; reflexivity.
> Qed.
>
> Hypothesis eq_X_pirr : forall (x y : X) (E1 E2 : x = y), E1 = E2.
>
> Fact existT_inj2 x t1 t2 :
> existT P x t1 = existT P x t2 -> t1 = t2.
> Proof.
> intros H.
> apply existT_inv in H.
> destruct H as (E & ->).
> rewrite (eq_X_pirr _ _ _ eq_refl).
> simpl; trivial.
> Qed.
>
> End existT_inj.
>
> Check existT_inv.
> Check existT_inj2.
>
> ----- Mail original -----
>> De: "Jeremy Dawson"
>> <Jeremy.Dawson AT anu.edu.au>
>> À: "coq-club"
>> <coq-club AT inria.fr>
>> Envoyé: Mardi 1 Octobre 2019 09:57:05
>> Objet: [Coq-Club] existT
>
>> Hi,
>>
>> I have an inductive definition:
>>
>> Inductive
>> in_dersrec (X : Type) (rules : rlsT X) (prems : X -> Type)
>> (concl : X) (d : derrec rules prems concl)
>> : forall concls : list X, dersrec rules prems concls -> Type :=
>> in_dersrec1 : forall (concls : list X) (ds : dersrec rules prems
>> concls),
>> in_dersrec d (dlCons d ds)
>> | in_dersrec2 : forall (concl' : X) (d' : derrec rules prems concl')
>> (concls : list X) (ds : dersrec rules prems concls),
>> in_dersrec d ds -> in_dersrec d (dlCons d' ds)
>>
>> When I have a goal with
>> X0 : in_dersrec d ds
>> among the assumptions,
>> inversion X0. gives new assumptions
>>
>> ds0 : dersrec rules prems concls
>> H0, H2 : p :: concls = ps
>> H3 : existT (fun x : list X => dersrec rules prems x)
>> (p :: concls) (dlCons d ds0) =
>> existT (fun x : list X => dersrec rules prems x) ps ds
>>
>> What I would expect to get is also
>> dlCons d ds0 = ds
>>
>> Whay do I get this strange assumption?
>>
>> Furthermore, it seems that existT is a constructor for the inductive
>> definition of sigT. That being so, why doesn't injection H3
>> give that the respective arguments of the two occurrences of existT are
>> equal?
>>
>> thanks for any help
>>
>> Jeremy
- [Coq-Club] existT, Jeremy Dawson, 10/01/2019
- Re: [Coq-Club] existT, Pierre Casteran, 10/01/2019
- Re: [Coq-Club] existT, Dominique Larchey-Wendling, 10/01/2019
- Re: [Coq-Club] existT, Jeremy Dawson, 10/02/2019
- Re: [Coq-Club] existT, Dominique Larchey-Wendling, 10/02/2019
- Re: [Coq-Club] existT, Chris Dams, 10/02/2019
- Re: [Coq-Club] existT, Tom de Jong, 10/02/2019
- Re: [Coq-Club] existT, Jeremy Dawson, 10/16/2019
- Re: [Coq-Club] existT, Sylvain Boulmé, 10/16/2019
- Re: [Coq-Club] existT, Laurent Thery, 10/16/2019
- Re: [Coq-Club] existT, Matthieu Sozeau, 10/16/2019
- Re: [Coq-Club] existT, Chris Dams, 10/16/2019
- Re: [Coq-Club] existT, Jeremy Dawson, 10/16/2019
- Re: [Coq-Club] existT, Tom de Jong, 10/02/2019
- Re: [Coq-Club] existT, Chris Dams, 10/02/2019
- Re: [Coq-Club] existT, Dominique Larchey-Wendling, 10/02/2019
- Re: [Coq-Club] existT, Jeremy Dawson, 10/02/2019
Archive powered by MHonArc 2.6.18.