blob: 7bd34978721f4aede8ce3eb11d9ac6e67dce0d83 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
(***********************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
(* <O___,, * INRIA-Rocquencourt & LRI-CNRS-Orsay *)
(* \VV/ *************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
(***********************************************************************)
(* $id$ *)
Require Export Eqdep_dec.
(* Congruence lemma *)
Theorem Congr_nodep: (A,B:Type)(f,g:A->B)(x,y:A)f==g->x==y->(f x)==(g y).
Intros A B f g x y eq1 eq2;Rewrite eq1;Rewrite eq2;Reflexivity.
Defined.
Theorem Congr_dep:
(A:Type; P:(A->Type); f,g:((a:A)(P a)); x:A)f==g->(f x)==(g x).
Intros A P f g x e;Rewrite e;Reflexivity.
Defined.
(* Basic application : try to prove that goal is equal to one hypothesis *)
Lemma convert_goal : (A,B:Prop)B->(A==B)->A.
Intros A B H E;Rewrite E;Assumption.
Save.
Tactic Definition CCsolve :=
Match Context With
[ H: ?1 |- ?2] ->
(Assert (?2==?1);[CC|
Match Reverse Context With
[ H: ?1;Heq: (?2==?1)|- ?2] ->(Rewrite Heq;Exact H)]).
|