]> matita.cs.unibo.it Git - helm.git/blob - matita/contribs/CoRN-Decl/tactics/DiffTactics2.ma
tagged 0.5.0-rc1
[helm.git] / matita / contribs / CoRN-Decl / tactics / DiffTactics2.ma
1 (**************************************************************************)
2 (*       ___                                                              *)
3 (*      ||M||                                                             *)
4 (*      ||A||       A project by Andrea Asperti                           *)
5 (*      ||T||                                                             *)
6 (*      ||I||       Developers:                                           *)
7 (*      ||T||         The HELM team.                                      *)
8 (*      ||A||         http://helm.cs.unibo.it                             *)
9 (*      \   /                                                             *)
10 (*       \ /        This file is distributed under the terms of the       *)
11 (*        v         GNU General Public License Version 2                  *)
12 (*                                                                        *)
13 (**************************************************************************)
14
15 (* This file was automatically generated: do not edit *********************)
16
17 set "baseuri" "cic:/matita/CoRN-Decl/tactics/DiffTactics2".
18
19 include "CoRN.ma".
20
21 (* $Id: DiffTactics2.v,v 1.1.1.1 2004/02/05 16:25:45 lionelm Exp $ *)
22
23 (* begin hide *)
24
25 include "ftc/Differentiability.ma".
26
27 (* UNEXPORTED
28 Section Automatizing_Continuity
29 *)
30
31 alias id "a" = "cic:/CoRN/tactics/DiffTactics2/Automatizing_Continuity/a.var".
32
33 alias id "b" = "cic:/CoRN/tactics/DiffTactics2/Automatizing_Continuity/b.var".
34
35 inline "cic:/CoRN/tactics/DiffTactics2/cont_function.ind".
36
37 inline "cic:/CoRN/tactics/DiffTactics2/cont_to_pfunct.con".
38
39 inline "cic:/CoRN/tactics/DiffTactics2/continuous_cont.con".
40
41 (* UNEXPORTED
42 End Automatizing_Continuity
43 *)
44
45 (* UNEXPORTED
46 Ltac pfunct_to_cont a b f :=
47   match constr:f with
48   | ([-C-]?X3) => constr:(cconst a b X3)
49   | FId => constr:(cid a b)
50   | (?X3{+}?X4) =>
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)
53   | ({--}?X3) =>
54       let t1 := pfunct_to_cont a b X3 in
55       constr:(cinv a b t1)
56   | (?X3{-}?X4) =>
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)
59   | (?X3{*}?X4) =>
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)
62   | (?X3{**}?X4) =>
63       let t := pfunct_to_cont a b X4 in
64       constr:(cscalmult a b X3 t)
65   | (?X3{^}?X4) =>
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
69                   constr:(cabs a b t1)
70   | ?X3 =>
71       let t := constr:X3 in
72       match goal with
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)
81       end
82   end.
83 *)
84
85 (* UNEXPORTED
86 Ltac New_Contin :=
87   match goal with
88   |  |- (Continuous_I (a:=?X1) (b:=?X2) ?X4 ?X3) =>
89       let r := pfunct_to_cont X1 X2 X3 in
90       let a := constr:X1 in
91       let b := constr:X2 in
92       (apply Continuous_I_wd with (cont_to_pfunct a b r);
93         [ unfold cont_to_pfunct in |- * | apply continuous_cont ])
94   end.
95 *)
96
97 (* UNEXPORTED
98 Section Automatizing_Derivatives
99 *)
100
101 alias id "a" = "cic:/CoRN/tactics/DiffTactics2/Automatizing_Derivatives/a.var".
102
103 alias id "b" = "cic:/CoRN/tactics/DiffTactics2/Automatizing_Derivatives/b.var".
104
105 inline "cic:/CoRN/tactics/DiffTactics2/deriv_function.ind".
106
107 inline "cic:/CoRN/tactics/DiffTactics2/deriv_to_pfunct.con".
108
109 inline "cic:/CoRN/tactics/DiffTactics2/deriv_deriv.con".
110
111 inline "cic:/CoRN/tactics/DiffTactics2/deriv_restr.con".
112
113 inline "cic:/CoRN/tactics/DiffTactics2/diffble_restr.con".
114
115 (* UNEXPORTED
116 End Automatizing_Derivatives
117 *)
118
119 (* UNEXPORTED
120 Ltac pfunct_to_restr a b f :=
121   match constr:f with
122   | ([-C-]?X3) => constr:(const a b X3)
123   | FId => constr:(id a b)
124   | (?X3{+}?X4) =>
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)
127   | ({--}?X3) =>
128       let t1 := pfunct_to_restr a b X3 in
129       constr:(rinv a b t1)
130   | (?X3{-}?X4) =>
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)
133   | (?X3{*}?X4) =>
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)
136   | (?X3{**}?X4) =>
137       let t := pfunct_to_restr a b X4 in
138       constr:(rscalmult a b X3 t)
139   | (?X3{^}?X4) =>
140       let t1 := pfunct_to_restr a b X3 in
141       constr:(rnth a b t1 X4)
142   | ?X3 =>
143       let t := constr:X3 in
144       match goal with
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:(
148       hyp' a b X1 t H)
149       end
150   end.
151 *)
152
153 (* UNEXPORTED
154 Ltac New_Deriv :=
155   match goal with
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 ] ])
163   end.
164 *)
165
166 (* UNEXPORTED
167 Ltac Differentiate :=
168   match goal with
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 |- * ])
173   end.
174 *)
175
176 (* UNEXPORTED
177 Ltac derivative_of f :=
178   match constr:f with
179   | ([-C-]?X3) => constr:([-C-]ZeroR)
180   | FId => constr:([-C-]OneR)
181   | (?X3{+}?X4) =>
182       let t1 := derivative_of X3 with t2 := derivative_of X4 in
183       constr:(t1{+}t2)
184   | ({--}?X3) => let t1 := derivative_of X3 in
185                  constr:({--}t1)
186   | (?X3{-}?X4) =>
187       let t1 := derivative_of X3 with t2 := derivative_of X4 in
188       constr:(t1{-}t2)
189   | (?X3{*}?X4) =>
190       let t1 := derivative_of X3
191       with t2 := derivative_of X4
192       with t3 := constr:X3
193       with t4 := constr:X4 in
194       constr:(t3{*}t2{+}t1{*}t4)
195   | (?X3{**}?X4) =>
196       let t1 := derivative_of X4 with t2 := constr:X3 in
197       constr:(t2{**}t1)
198   | (?X3{^}0) => constr:([-C-]ZeroR)
199   | (?X3{^}S ?X4) =>
200       let t1 := derivative_of X3 with t2 := constr:X3 with t3 := constr:X4 in
201       constr:(nring _ (S t3){**}(t1{*}t2{^}t3))
202   | ({1/}?X3) =>
203       let t1 := derivative_of X3 with t2 := constr:X3 in
204       constr:({--}(t1{/}t2{*}t2))
205   | (?X3{/}?X4) =>
206       let t1 := derivative_of X3
207       with t2 := derivative_of X4
208       with t3 := constr:X3
209       with t4 := constr:X4 in
210       constr:((t1{*}t4{-}t3{*}t2){/}t4{*}t4)
211   | (?X3[o]?X4) =>
212       let t1 := derivative_of X3
213       with t2 := derivative_of X4
214       with t3 := constr:X3 in
215       constr:((t3[o]t2){*}t1)
216   | ?X3 =>
217       let t := constr:X3 in
218       match goal with
219       | H:(Derivative_I (b:=t) ?X4) |- _ =>
220           let t1 := constr:X4 in
221           constr:t1
222       end
223   end.
224 *)
225
226 (* UNEXPORTED
227 Ltac Deriv_I_substR :=
228   match goal with
229   |  |- (Derivative_I _ ?X1 _) =>
230       let t := derivative_of X1 in
231       apply Derivative_I_wdr with t
232   end.
233 *)
234
235 (* end hide *)
236