1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| The HELM team. *)
8 (* ||A|| http://helm.cs.unibo.it *)
10 (* \ / This file is distributed under the terms of the *)
11 (* v GNU General Public License Version 2 *)
13 (**************************************************************************)
15 (* This file was automatically generated: do not edit *********************)
17 set "baseuri" "cic:/matita/CoRN-Decl/tactics/DiffTactics2".
21 (* $Id: DiffTactics2.v,v 1.1.1.1 2004/02/05 16:25:45 lionelm Exp $ *)
25 include "ftc/Differentiability.ma".
28 Section Automatizing_Continuity
31 alias id "a" = "cic:/CoRN/tactics/DiffTactics2/Automatizing_Continuity/a.var".
33 alias id "b" = "cic:/CoRN/tactics/DiffTactics2/Automatizing_Continuity/b.var".
35 inline "cic:/CoRN/tactics/DiffTactics2/cont_function.ind".
37 inline "cic:/CoRN/tactics/DiffTactics2/cont_to_pfunct.con".
39 inline "cic:/CoRN/tactics/DiffTactics2/continuous_cont.con".
42 End Automatizing_Continuity
46 Ltac pfunct_to_cont a b f :=
48 | ([-C-]?X3) => constr:(cconst a b X3)
49 | FId => constr:(cid a b)
51 let t1 := pfunct_to_cont a b X3 with t2 := pfunct_to_cont a b X4 in
52 constr:(cplus a b t1 t2)
54 let t1 := pfunct_to_cont a b X3 in
57 let t1 := pfunct_to_cont a b X3 with t2 := pfunct_to_cont a b X4 in
58 constr:(cminus a b t1 t2)
60 let t1 := pfunct_to_cont a b X3 with t2 := pfunct_to_cont a b X4 in
61 constr:(cmult a b t1 t2)
63 let t := pfunct_to_cont a b X4 in
64 constr:(cscalmult a b X3 t)
66 let t1 := pfunct_to_cont a b X3 in
67 constr:(cnth a b t1 X4)
68 | (FAbs ?X3) => let t1 := pfunct_to_cont a b X3 in
73 | Hab:_,H:(Continuous_I (a:=a) (b:=b) ?X1 t) |- _ =>
74 constr:(hyp_c a b X1 t H)
75 | H:(Derivative_I (a:=a) (b:=b) ?X1 t ?X4) |- _ =>
76 constr:(hyp_d a b X1 t X4 H)
77 | H:(Derivative_I (a:=a) (b:=b) ?X1 ?X4 t) |- _ =>
78 constr:(hyp_d' a b X1 X4 t H)
79 | H:(Diffble_I (a:=a) (b:=b) ?X1 t) |- _ =>
80 constr:(hyp_diff a b X1 t H)
88 | |- (Continuous_I (a:=?X1) (b:=?X2) ?X4 ?X3) =>
89 let r := pfunct_to_cont X1 X2 X3 in
92 (apply Continuous_I_wd with (cont_to_pfunct a b r);
93 [ unfold cont_to_pfunct in |- * | apply continuous_cont ])
98 Section Automatizing_Derivatives
101 alias id "a" = "cic:/CoRN/tactics/DiffTactics2/Automatizing_Derivatives/a.var".
103 alias id "b" = "cic:/CoRN/tactics/DiffTactics2/Automatizing_Derivatives/b.var".
105 inline "cic:/CoRN/tactics/DiffTactics2/deriv_function.ind".
107 inline "cic:/CoRN/tactics/DiffTactics2/deriv_to_pfunct.con".
109 inline "cic:/CoRN/tactics/DiffTactics2/deriv_deriv.con".
111 inline "cic:/CoRN/tactics/DiffTactics2/deriv_restr.con".
113 inline "cic:/CoRN/tactics/DiffTactics2/diffble_restr.con".
116 End Automatizing_Derivatives
120 Ltac pfunct_to_restr a b f :=
122 | ([-C-]?X3) => constr:(const a b X3)
123 | FId => constr:(id a b)
125 let t1 := pfunct_to_restr a b X3 with t2 := pfunct_to_restr a b X4 in
126 constr:(rplus a b t1 t2)
128 let t1 := pfunct_to_restr a b X3 in
131 let t1 := pfunct_to_restr a b X3 with t2 := pfunct_to_restr a b X4 in
132 constr:(rminus a b t1 t2)
134 let t1 := pfunct_to_restr a b X3 with t2 := pfunct_to_restr a b X4 in
135 constr:(rmult a b t1 t2)
137 let t := pfunct_to_restr a b X4 in
138 constr:(rscalmult a b X3 t)
140 let t1 := pfunct_to_restr a b X3 in
141 constr:(rnth a b t1 X4)
143 let t := constr:X3 in
145 | H:(Derivative_I (a:=a) (b:=b) ?X1 t ?X4) |- _ =>
146 constr:(hyp a b X1 t X4 H)
147 | H:(Diffble_I (a:=a) (b:=b) ?X1 t) |- _ => constr:(
156 | |- (Derivative_I (a:=?X1) (b:=?X2) _ ?X3 ?X4) =>
157 let r := pfunct_to_restr X1 X2 X3 in
158 (apply Derivative_I_wdl with (deriv_to_pfunct X1 X2 r);
159 [ unfold deriv_to_pfunct in |- *
160 | apply Derivative_I_wdr with (deriv_deriv X1 X2 r);
161 [ unfold deriv_deriv, deriv_to_pfunct in |- *
162 | apply deriv_restr ] ])
167 Ltac Differentiate :=
169 | |- (Diffble_I (a:=?X1) (b:=?X2) _ ?X3) =>
170 let r := pfunct_to_restr X1 X2 X3 in
171 (apply Diffble_I_wd with (deriv_to_pfunct X1 X2 r);
172 [ apply diffble_restr | unfold deriv_deriv, deriv_to_pfunct in |- * ])
177 Ltac derivative_of f :=
179 | ([-C-]?X3) => constr:([-C-]ZeroR)
180 | FId => constr:([-C-]OneR)
182 let t1 := derivative_of X3 with t2 := derivative_of X4 in
184 | ({--}?X3) => let t1 := derivative_of X3 in
187 let t1 := derivative_of X3 with t2 := derivative_of X4 in
190 let t1 := derivative_of X3
191 with t2 := derivative_of X4
193 with t4 := constr:X4 in
194 constr:(t3{*}t2{+}t1{*}t4)
196 let t1 := derivative_of X4 with t2 := constr:X3 in
198 | (?X3{^}0) => constr:([-C-]ZeroR)
200 let t1 := derivative_of X3 with t2 := constr:X3 with t3 := constr:X4 in
201 constr:(nring _ (S t3){**}(t1{*}t2{^}t3))
203 let t1 := derivative_of X3 with t2 := constr:X3 in
204 constr:({--}(t1{/}t2{*}t2))
206 let t1 := derivative_of X3
207 with t2 := derivative_of X4
209 with t4 := constr:X4 in
210 constr:((t1{*}t4{-}t3{*}t2){/}t4{*}t4)
212 let t1 := derivative_of X3
213 with t2 := derivative_of X4
214 with t3 := constr:X3 in
215 constr:((t3[o]t2){*}t1)
217 let t := constr:X3 in
219 | H:(Derivative_I (b:=t) ?X4) |- _ =>
220 let t1 := constr:X4 in
227 Ltac Deriv_I_substR :=
229 | |- (Derivative_I _ ?X1 _) =>
230 let t := derivative_of X1 in
231 apply Derivative_I_wdr with t