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/ftc/PartFunEquality".
21 (* $Id: PartFunEquality.v,v 1.8 2004/04/23 10:00:59 lcf Exp $ *)
23 (*#* printing Feq %\ensuremath{\approx}% #≈# *)
25 include "reals/Intervals.ma".
27 include "tactics/DiffTactics1.ma".
33 (*#* *Equality of Partial Functions
37 In some contexts (namely when quantifying over partial functions) we
38 need to refer explicitly to the subsetoid of elements satisfying a
39 given predicate rather than to the predicate itself. The following
40 definition makes this possible.
43 inline "cic:/CoRN/ftc/PartFunEquality/subset.con".
46 The core of our work will revolve around the following fundamental
47 notion: two functions are equal in a given domain (predicate) iff they
48 coincide on every point of that domain#. #%\footnote{%Notice that,
49 according to our definition of partial function, it is equivalent to
50 prove the equality for every proof or for a specific proof. Typically
51 it is easier to consider a generic case%.}%. This file is concerned
52 with proving the main properties of this equality relation.
55 inline "cic:/CoRN/ftc/PartFunEquality/Feq.con".
58 Notice that, because the quantification over the proofs is universal,
59 we must require explicitly that the predicate be included in the
60 domain of each function; otherwise the basic properties of equality
61 (like, for example, transitivity) would fail to hold#. #%\footnote{%To
62 see this it is enough to realize that the empty function would be
63 equal to every other function in every domain.%}.% The way to
64 circumvent this would be to quantify existentially over the proofs;
65 this, however, would have two major disadvantages: first, proofs of
66 equality would become very cumbersome and clumsy; secondly (and most
67 important), we often need to prove the inclusions from an equality
68 hypothesis, and this definition allows us to do it in a very easy way.
69 Also, the pointwise equality is much nicer to use from this definition
70 than in an existentially quantified one.
78 Section Equality_Results
81 (*#* **Properties of Inclusion
83 We will now prove the main properties of the equality relation.
85 %\begin{convention}% Let [I,R:IR->CProp] and [F,G:PartIR], and denote
86 by [P] and [Q], respectively, the domains of [F] and [G].
90 alias id "I" = "cic:/CoRN/ftc/PartFunEquality/Equality_Results/I.var".
92 alias id "F" = "cic:/CoRN/ftc/PartFunEquality/Equality_Results/F.var".
94 alias id "G" = "cic:/CoRN/ftc/PartFunEquality/Equality_Results/G.var".
98 inline "cic:/CoRN/ftc/PartFunEquality/Equality_Results/P.con" "Equality_Results__".
100 inline "cic:/CoRN/ftc/PartFunEquality/Equality_Results/Q.con" "Equality_Results__".
104 alias id "R" = "cic:/CoRN/ftc/PartFunEquality/Equality_Results/R.var".
107 We start with two lemmas which make it much easier to prove and use
111 inline "cic:/CoRN/ftc/PartFunEquality/eq_imp_Feq.con".
113 inline "cic:/CoRN/ftc/PartFunEquality/Feq_imp_eq.con".
115 inline "cic:/CoRN/ftc/PartFunEquality/included_IR.con".
122 Hint Resolve included_IR : included.
130 If two function coincide on a given subset then they coincide in any smaller subset.
133 inline "cic:/CoRN/ftc/PartFunEquality/included_Feq.con".
140 Section Away_from_Zero
147 (*#* **Away from Zero
149 Before we prove our main results about the equality we have to do some
150 work on division. A function is said to be bounded away from zero in
151 a set if there exists a positive lower bound for the set of absolute
152 values of its image of that set.
154 %\begin{convention}% Let [I : IR->CProp], [F : PartIR] and denote by [P]
159 alias id "I" = "cic:/CoRN/ftc/PartFunEquality/Away_from_Zero/Definitions/I.var".
161 alias id "F" = "cic:/CoRN/ftc/PartFunEquality/Away_from_Zero/Definitions/F.var".
165 inline "cic:/CoRN/ftc/PartFunEquality/Away_from_Zero/Definitions/P.con" "Away_from_Zero__Definitions__".
169 inline "cic:/CoRN/ftc/PartFunEquality/bnd_away_zero.con".
172 If [F] is bounded away from zero in [I] then [F] is necessarily apart from zero in [I]; also this means that [I] is included in the domain of [{1/}F].
177 alias id "Hf" = "cic:/CoRN/ftc/PartFunEquality/Away_from_Zero/Definitions/Hf.var".
181 inline "cic:/CoRN/ftc/PartFunEquality/bnd_imp_ap_zero.con".
183 inline "cic:/CoRN/ftc/PartFunEquality/bnd_imp_inc_recip.con".
185 inline "cic:/CoRN/ftc/PartFunEquality/bnd_imp_inc_div.con".
192 Boundedness away from zero is preserved through restriction of the set.
194 %\begin{convention}% Let [F] be a partial function and [P, Q] be predicates.
198 alias id "F" = "cic:/CoRN/ftc/PartFunEquality/Away_from_Zero/F.var".
200 alias id "P" = "cic:/CoRN/ftc/PartFunEquality/Away_from_Zero/P.var".
202 alias id "Q" = "cic:/CoRN/ftc/PartFunEquality/Away_from_Zero/Q.var".
204 inline "cic:/CoRN/ftc/PartFunEquality/included_imp_bnd.con".
206 inline "cic:/CoRN/ftc/PartFunEquality/FRestr_bnd.con".
209 A function is said to be bounded away from zero everywhere if it is bounded away from zero in every compact subinterval of its domain; a similar definition is made for arbitrary sets, which will be necessary for future work.
212 inline "cic:/CoRN/ftc/PartFunEquality/bnd_away_zero_everywhere.con".
214 inline "cic:/CoRN/ftc/PartFunEquality/bnd_away_zero_in_P.con".
217 An immediate consequence:
220 inline "cic:/CoRN/ftc/PartFunEquality/bnd_in_P_imp_ap_zero.con".
222 inline "cic:/CoRN/ftc/PartFunEquality/FRestr_bnd'.con".
229 Hint Resolve bnd_imp_inc_recip bnd_imp_inc_div: included.
233 Hint Immediate bnd_in_P_imp_ap_zero: included.
236 (*#* ** The [FEQ] tactic
237 This tactic splits a goal of the form [Feq I F G] into the three subgoals
238 [included I (Dom F)], [included I (Dom G)] and [forall x, F x [=] G x]
239 and applies [Included] to the first two and [rational] to the third.
245 Ltac FEQ := apply eq_imp_Feq;
246 [ Included | Included | intros; try (simpl in |- *; rational) ].
252 Section More_on_Equality
255 (*#* **Properties of Equality
257 We are now finally able to prove the main properties of the equality relation. We begin by showing it to be an equivalence relation.
259 %\begin{convention}% Let [I] be a predicate and [F, F', G, G', H] be
264 alias id "I" = "cic:/CoRN/ftc/PartFunEquality/More_on_Equality/I.var".
267 Section Feq_Equivalence
270 alias id "F" = "cic:/CoRN/ftc/PartFunEquality/More_on_Equality/Feq_Equivalence/F.var".
272 alias id "G" = "cic:/CoRN/ftc/PartFunEquality/More_on_Equality/Feq_Equivalence/G.var".
274 alias id "H" = "cic:/CoRN/ftc/PartFunEquality/More_on_Equality/Feq_Equivalence/H.var".
276 inline "cic:/CoRN/ftc/PartFunEquality/Feq_reflexive.con".
278 inline "cic:/CoRN/ftc/PartFunEquality/Feq_symmetric.con".
280 inline "cic:/CoRN/ftc/PartFunEquality/Feq_transitive.con".
291 Also it is preserved through application of functional constructors and restriction.
294 alias id "F" = "cic:/CoRN/ftc/PartFunEquality/More_on_Equality/Operations/F.var".
296 alias id "F'" = "cic:/CoRN/ftc/PartFunEquality/More_on_Equality/Operations/F'.var".
298 alias id "G" = "cic:/CoRN/ftc/PartFunEquality/More_on_Equality/Operations/G.var".
300 alias id "G'" = "cic:/CoRN/ftc/PartFunEquality/More_on_Equality/Operations/G'.var".
302 inline "cic:/CoRN/ftc/PartFunEquality/Feq_plus.con".
304 inline "cic:/CoRN/ftc/PartFunEquality/Feq_inv.con".
306 inline "cic:/CoRN/ftc/PartFunEquality/Feq_minus.con".
308 inline "cic:/CoRN/ftc/PartFunEquality/Feq_mult.con".
310 inline "cic:/CoRN/ftc/PartFunEquality/Feq_nth.con".
312 inline "cic:/CoRN/ftc/PartFunEquality/Feq_recip.con".
314 inline "cic:/CoRN/ftc/PartFunEquality/Feq_recip'.con".
316 inline "cic:/CoRN/ftc/PartFunEquality/Feq_div.con".
318 inline "cic:/CoRN/ftc/PartFunEquality/Feq_div'.con".
321 Notice that in the case of division we only need to require boundedness away from zero for one of the functions (as they are equal); thus the two last lemmas are stated in two different ways, as according to the context one or the other condition may be easier to prove.
323 The restriction of a function is well defined.
326 inline "cic:/CoRN/ftc/PartFunEquality/FRestr_wd.con".
329 The image of a set is extensional.
332 inline "cic:/CoRN/ftc/PartFunEquality/fun_image_wd.con".
348 We finish this group of lemmas with characterization results for the
349 power function (similar to those already proved for arbitrary rings).
350 The characterization is done at first pointwise and later using the
353 %\begin{convention}% Let [F] be a partial function with domain [P] and
354 [Q] be a predicate on the real numbers assumed to be included in [P].
358 alias id "F" = "cic:/CoRN/ftc/PartFunEquality/Nth_Power/F.var".
362 inline "cic:/CoRN/ftc/PartFunEquality/Nth_Power/P.con" "Nth_Power__".
366 alias id "Q" = "cic:/CoRN/ftc/PartFunEquality/Nth_Power/Q.var".
368 alias id "H" = "cic:/CoRN/ftc/PartFunEquality/Nth_Power/H.var".
370 alias id "Hf" = "cic:/CoRN/ftc/PartFunEquality/Nth_Power/Hf.var".
372 inline "cic:/CoRN/ftc/PartFunEquality/FNth_zero.con".
374 alias id "n" = "cic:/CoRN/ftc/PartFunEquality/Nth_Power/n.var".
376 alias id "H'" = "cic:/CoRN/ftc/PartFunEquality/Nth_Power/H'.var".
378 inline "cic:/CoRN/ftc/PartFunEquality/FNth_mult.con".
385 Section Strong_Nth_Power
389 %\begin{convention}% Let [a,b] be real numbers such that [I := [a,b]]
390 is included in the domain of [F].
394 alias id "a" = "cic:/CoRN/ftc/PartFunEquality/Strong_Nth_Power/a.var".
396 alias id "b" = "cic:/CoRN/ftc/PartFunEquality/Strong_Nth_Power/b.var".
398 alias id "Hab" = "cic:/CoRN/ftc/PartFunEquality/Strong_Nth_Power/Hab.var".
402 inline "cic:/CoRN/ftc/PartFunEquality/Strong_Nth_Power/I.con" "Strong_Nth_Power__".
406 alias id "F" = "cic:/CoRN/ftc/PartFunEquality/Strong_Nth_Power/F.var".
408 alias id "incF" = "cic:/CoRN/ftc/PartFunEquality/Strong_Nth_Power/incF.var".
410 inline "cic:/CoRN/ftc/PartFunEquality/FNth_zero'.con".
412 inline "cic:/CoRN/ftc/PartFunEquality/FNth_mult'.con".