coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Pierre Casteran <pierre.casteran AT labri.fr>
- To: qgxu AT mail.shu.edu.cn
- Cc: coq-club AT inria.fr
- Subject: Re: [Coq-Club] usage of eq_ind
- Date: Thu, 27 May 2010 14:29:54 +0200
Hi, Le 27/05/2010 13:32, qgxu AT mail.shu.edu.cn a └crit :
Ok. The type of eq_sym is the following : Check eq_sym. eq_sym : forall (A : Type) (x y : A), x = y -> y = x (Note that Coq's Standard Library already has sym_eq (in Init.Logic)
In an interactive proof of eq_sym , the simplest way is to get a goal : H : x = y ----------- y = x then rewrite <- H. You can also apply explicitely eq_ind, but rewrite is more usual. Goal forall (A : Type) (x y : A), x = y -> y = x. intros A x y H. pattern y. (* puts the goal under the form (P y) *) apply (eq_ind x);trivial. Qed. i.e. In eq_ind, the argument "A" is implicit (just check it by typing "About eq_ind" About eq_ind. eq_ind : forall (A : Type) (x : A) (P : A -> Prop), P x -> forall y : A, x = y -> P y Argument A is implicit So if you consider the term eq_ind x (fun z => z=x) (refl_equal x) y h. the correspondance is A <-> A (A implicit in eq_ind) x <-> x P <->fun z => z = x P x <-> (fun z => z = x) x (reduces to x = x ) y <-> y x = y <-> x = y P y <-> (fun z => z = x) y (reduces to y = x ) So the term "eq_ind x (fun z => z = x) (refl_equal x) y h" has type "y=x" Again, this job is done by "rewrite" Hope it helps, Pierre ... |
- [Coq-Club] usage of eq_ind, qgxu
- Re: [Coq-Club] usage of eq_ind, Adam Chlipala
- Re: [Coq-Club] usage of eq_ind, Pierre Casteran
- 指鹸: Re: [Coq-Club] usage of eq_ind,
俯伯忽
- Re: 指鹸: Re: [Coq-Club] usage of eq_ind, Pierre Casteran
- Re: 紊: Re: [Coq-Club] usage of eq_ind, Roman Beslik
Archive powered by MhonArc 2.6.16.