coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Xavier Leroy <xavier.leroy AT inria.fr>
- To: coq-club AT inria.fr
- Subject: Re: [Coq-Club] Hints needed for two SF exercises
- Date: Thu, 21 Aug 2014 17:00:58 +0200
On 20/08/2014 12:07, John Wiegley wrote:
> The second is "pigeonhole_principle". With or without LEM I run into the
> same
> problem: a goal of n < m in a context of n < S m, which is clearly
> unprovable.
> If induction on l1 is the right way to start this proof, what is the next
> creative step?
Hint: you need to use the lemma "appears_in_app_split" that SF asks
you to prove just before. (How convenient!)
> Theorem pigeonhole_principle: forall (X:Type) (l1 l2:list X),
> (forall x, appears_in x l1 -> appears_in x l2)
> -> length l2 < length l1
> -> repeats l1.
More detailed hint: in the case l1 = x :: l1', when you need to use
the induction hypothesis, decompose l2 as l2' ++ x :: l2'' and
use the ind. hyp. with l2 = l2' ++ l2''.
Hope this helps,
- Xavier Leroy
- [Coq-Club] Hints needed for two SF exercises, John Wiegley, 08/20/2014
- Re: [Coq-Club] Hints needed for two SF exercises, Ilya Sergey, 08/20/2014
- RE: [Coq-Club] Hints needed for two SF exercises, Soegtrop, Michael, 08/20/2014
- Re: [Coq-Club] Hints needed for two SF exercises, John Wiegley, 08/20/2014
- Re: [Coq-Club] Hints needed for two SF exercises, Daniel Schepler, 08/20/2014
- Re: [Coq-Club] Hints needed for two SF exercises, Basile Clement, 08/20/2014
- Re: [Coq-Club] Hints needed for two SF exercises, Xavier Leroy, 08/21/2014
- Re: [Coq-Club] Hints needed for two SF exercises, John Wiegley, 08/22/2014
- Re: [Coq-Club] Hints needed for two SF exercises, Daniel Schepler, 08/22/2014
- Re: [Coq-Club] Hints needed for two SF exercises, John Wiegley, 08/22/2014
Archive powered by MHonArc 2.6.18.