coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Gert Smolka <smolka AT ps.uni-saarland.de>
- To: coq-club AT inria.fr
- Subject: Re: [Coq-Club] Dependent typing puzzle, constructor injectivity
- Date: Sat, 13 Feb 2021 14:21:09 +0100
- Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=smolka AT ps.uni-saarland.de; spf=Pass smtp.mailfrom=smolka AT ps.uni-saarland.de; spf=None smtp.helo=postmaster AT thyone.hiz-saarland.de
- Ironport-phdr: 9a23:QmcOgxeHfr1YLmeVZDYYjuYJlGMj4u6mDksu8pMizoh2WeGdxcS+ZB7h7PlgxGXEQZ/co6odzbaP4ua+AydesN6oizMrSNR0TRgLiMEbzUQLIfWuLgnFFsPsdDEwB89YVVVorDmROElRH9viNRWJ+iXhpTEdFQ/iOgVrO+/7BpDdj9it1+C15pbffxhEiCCybL9vKBi6twTcutcZjYZjLqs61wfErGZPd+lK321jOEidnwz75se+/Z5j9zpftvc8/MNeUqv0Yro1Q6VAADspL2466svrtQLeTQSU/XsTTn8WkhtTDAfb6hzxQ4r8vTH7tup53ymaINH2QLUpUjms86tnVBnlgzoBOjUk8m/Yl9Zwgbpbrh29qBJwzJPabo+bNPRgfKzTftQUSHFdXsZIUixNHoO8Y5cNAucHIO1Wr5P9p1wLrRamBAejGvnvyiNVjXHr2K061OAhEQLc0wc9GN8Oq3HUrNLxNKcRS++417HIzS7ZY/NL3zf96ZHEcgs7rv6WR7JwddDeyU8yGA/fk1qft5XoMjWI3esCr2aV9fBvVf6zi2E5sQFxpCCiytoshITNhowY1l7J+ThnzYs6ONG1Vkp2bNq5HJZUqi2XOYR7T90+T212tyg21KEKtYK7ciUF1Zkr2x7SZv+af4WO/xntV/6RLC9liH9rd7+znRK//Em6xuD+TMW4zlhHojRdntTIuH0BzQHf58yER/dn4Eus2SiD2xrO5uxEJU05k7fQJYQ7zb4qjJUTtFzOHi/ol0Xyi6+bblkk+uio6uTgZLXpuIWQN491igD/K6gugdawDv4iMggKRWeb//mz2Kf+8kLnWLlKj/s2nbfFsJ3COMgWqKG0DxVR34si8RqyDS2q3MoWkHUZNF5FfQiIj4ntO1HAOvD4CvK/jky3kDduwPDGOr7hDY/WI3jbi7ftZ6t960hdyAYq1tBQ/YhbCqsFIP3pXE/+qcbUAQInPACs2eboFM191p8CWWKIGqKWLKTSsUaR6u0zJ+mMeZQatS3mK/kl4v7ulWU2lUUcfamvx5sXaWq3Eu5oI0WDMjLQhYIKFn5PtQ4jRsTrjkeDWHhdfSWcRaU5sx42Ep7uNoLEQoOkyOia2SC/HZR+fnsAF1aNVGzhfp+AUvEALi6fdJwy2gcYXKSsHtdynSqlsxX3nuI+f7jkvxYAvJem7+BboujalBU87ztxVZzPy3rLUmd123gBTiUy1aZz50BwmA7ajfpIxsdAHNkW3MtnFx8gPMSEnfRhTc30W0fad96TTF+gTpOqDGNpF49j85o1e094Xu6aoFXD0i6tWeNHi7yaA5o5tKLdzT3qLs9nz3/A2O8tggt+Tw==
I could not let loose, this stuff is addictive.
Luckily I found a solution before it ruined my weekend.
See below.
Anyway, I would be thankful for pointers where these
kinds of things are explained.
Enjoy your weekend,
Gert
Fact DPI_nat :
forall (p: nat -> Type) n a b, existT p n a = existT p n b -> a = b.
Proof.
(* Follows with Coq.Logic.Eqdep_dec.UIP_refl_nat *)
Admitted.
Inductive K (x: nat) : nat -> Type :=
| K1: K x (S x)
| K2: forall y z, K x y -> K y z -> K x z.
Fact K2_injective x y z a b a' b':
K2 x z y a b = K2 x z y a' b' -> (a,b) = (a',b').
Proof.
intros e.
pose (p y z := prod (K x z) (K z y)).
pose (q y := sigT (p y)).
apply (DPI_nat (p y) z).
apply (DPI_nat q y).
pose (f:= fun c: K x y =>
match c return sigT q with
| K1 _ => existT q y (existT (p y) z (a,b))
| K2 _ z y a b => existT q y (existT (p y) z (a,b))
end).
apply (f_equal f e).
Qed.
> On 13. Feb 2021, at 12:35, Gert Smolka <smolka AT ps.uni-saarland.de> wrote:
>
> I would like to prove
>
> Inductive K (x: nat) : nat -> Type :=
> | K1: K x (S x)
> | K2: forall y z, K x y -> K y z -> K x z.
>
> Fact K2_injective x y z a b a' b':
> K2 x y z a b = K2 x y z a' b' -> (a,b) = (a',b').
>
> by hand in a way that is similar to the proof generated
> by the dependent elimination tactic of the Equations package.
> Does someone have a hand proof bringing across the essential ideas?
>
> Thanks in advance,
> Gert
>
> PS. I have a simple proof exploiting the "semantic” fact (K x y -> x < y),
> but so far I failed in finding a "regular” proof using only routine
> techniques.
>
- [Coq-Club] Dependent typing puzzle, constructor injectivity, Gert Smolka, 02/13/2021
- Re: [Coq-Club] Dependent typing puzzle, constructor injectivity, Gert Smolka, 02/13/2021
- Re: [Coq-Club] Dependent typing puzzle, constructor injectivity, Kenji Maillard, 02/13/2021
- Re: [Coq-Club] Dependent typing puzzle, constructor injectivity, Dominique Larchey-Wendling, 02/13/2021
- Re: [Coq-Club] Dependent typing puzzle, constructor injectivity, Gert Smolka, 02/14/2021
- Re: [Coq-Club] Dependent typing puzzle, constructor injectivity, Dominique Larchey-Wendling, 02/14/2021
- Re: [Coq-Club] Dependent typing puzzle, constructor injectivity, Gert Smolka, 02/14/2021
- Re: [Coq-Club] Dependent typing puzzle, constructor injectivity, Dominique Larchey-Wendling, 02/14/2021
- Re: [Coq-Club] Dependent typing puzzle, constructor injectivity, Gert Smolka, 02/14/2021
- Re: [Coq-Club] Dependent typing puzzle, constructor injectivity, Gert Smolka, 02/14/2021
- Re: [Coq-Club] Dependent typing puzzle, constructor injectivity, Dominique Larchey-Wendling, 02/14/2021
- Re: [Coq-Club] Dependent typing puzzle, constructor injectivity, Gert Smolka, 02/14/2021
- Message not available
- Re: [Coq-Club] Dependent typing puzzle, constructor injectivity, Gert Smolka, 02/14/2021
- Re: [Coq-Club] Dependent typing puzzle, constructor injectivity, Gert Smolka, 02/13/2021
- Re: [Coq-Club] Dependent typing puzzle, constructor injectivity, Jeremy Dawson, 02/14/2021
Archive powered by MHonArc 2.6.19+.