coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: John Wiegley <johnw AT newartisans.com>
- To: coq-club AT inria.fr
- Subject: Re: [Coq-Club] Question about a lemma concerning vectors
- Date: Mon, 10 Nov 2014 12:36:47 -0600
- Organization: New Artisans LLC
>>>>> John Wiegley
>>>>> <johnw AT newartisans.com>
>>>>> writes:
> The problem seems to be that I need to relate three different things in
> lock-step: v, k and j. I've tried induction on all three, and also n, but
> each direction leaves me with a branch where it asks to prove something that
> doesn't make sense.
I was able to complete the proof today, after sleeping on it:
Lemma vnth_replace_neq : forall n (v : Vec n) (k j : fin n) (z : A),
k != j -> vnth (replace v k z) j = vnth v j.
Proof.
move=> n v k j z.
elim/vec_ind: v => // [x|sz x xs IHxs] in k j *.
by move: (fin1_eq k j) => /eqP ? /eqP ?.
elim/@fin_ind: k; elim/@fin_ind: j;
try by elim: sz => // in xs IHxs *.
move=> ? ? _ ? ? _ Hneg.
rewrite replace_consn !vnth_consn IHxs; first by [].
exact: Hneg.
Qed.
Thanks for all your help, this is a much nicer direction to move in than the
previous vector representation.
John
- [Coq-Club] Question about a lemma concerning vectors, John Wiegley, 11/09/2014
- Re: [Coq-Club] Question about a lemma concerning vectors, Cedric Auger, 11/09/2014
- Re: [Coq-Club] Question about a lemma concerning vectors, John Wiegley, 11/09/2014
- Re: [Coq-Club] Question about a lemma concerning vectors, Adam Chlipala, 11/09/2014
- Re: [Coq-Club] Question about a lemma concerning vectors, John Wiegley, 11/10/2014
- Re: [Coq-Club] Question about a lemma concerning vectors, John Wiegley, 11/10/2014
- Re: [Coq-Club] Question about a lemma concerning vectors, Emilio Jesús Gallego Arias, 11/10/2014
- Re: [Coq-Club] Question about a lemma concerning vectors, Cedric Auger, 11/10/2014
- Re: [Coq-Club] Question about a lemma concerning vectors, Cedric Auger, 11/10/2014
- Re: [Coq-Club] Question about a lemma concerning vectors, John Wiegley, 11/10/2014
- Re: [Coq-Club] Question about a lemma concerning vectors, Emilio Jesús Gallego Arias, 11/10/2014
- Re: [Coq-Club] Question about a lemma concerning vectors, John Wiegley, 11/11/2014
- Re: [Coq-Club] Question about a lemma concerning vectors, Emilio Jesús Gallego Arias, 11/10/2014
- Re: [Coq-Club] Question about a lemma concerning vectors, John Wiegley, 11/10/2014
- Re: [Coq-Club] Question about a lemma concerning vectors, John Wiegley, 11/09/2014
- Re: [Coq-Club] Question about a lemma concerning vectors, Emilio Jesús Gallego Arias, 11/09/2014
- Re: [Coq-Club] Question about a lemma concerning vectors, Frédéric Blanqui, 11/12/2014
- Re: [Coq-Club] Question about a lemma concerning vectors, Cedric Auger, 11/09/2014
Archive powered by MHonArc 2.6.18.