pax_global_header 0000666 0000000 0000000 00000000064 14551434325 0014520 g ustar 00root root 0000000 0000000 52 comment=3be9be8754e7b442545109dd22f53ea48d12226f
coquelicot-coquelicot-3.4.1/ 0000775 0000000 0000000 00000000000 14551434325 0016041 5 ustar 00root root 0000000 0000000 coquelicot-coquelicot-3.4.1/COPYING 0000664 0000000 0000000 00000016743 14551434325 0017107 0 ustar 00root root 0000000 0000000 GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.
coquelicot-coquelicot-3.4.1/INSTALL.md 0000664 0000000 0000000 00000002302 14551434325 0017466 0 ustar 00root root 0000000 0000000 Installation instructions
=========================
Prerequisites
-------------
You will need the Coq proof assistant (>= 8.12). You will need the
[MathComp](http://math-comp.github.io/math-comp/) library to be installed too.
The `.tar.gz` file is distributed with a working set of configure files. They
are not in the git repository though. Consequently, if you are building from
git, you will need `autoconf` (>= 2.59).
Configuring, compiling and installing
-------------------------------------
Ideally, you should just have to type:
./configure && ./remake && ./remake install
The environment variable `COQC` can be passed to the configure script in order
to set the Coq compiler command. The configure script defaults to `coqc`.
Similarly, `COQDEP` can be used to specify the location of `coqdep`. The
`COQBIN` environment variable can be used to set both variables at once.
The library files are compiled at the logical location `Coquelicot`. The
`COQUSERCONTRIB` environment variable can be used to override the
physical location where the `Coquelicot` directory containing these files
will be installed by `./remake install`. By default, the target directory
is `` `$COQC -where`/user-contrib ``.
coquelicot-coquelicot-3.4.1/NEWS.md 0000664 0000000 0000000 00000004766 14551434325 0017154 0 ustar 00root root 0000000 0000000 Version 3.4.1
-------------
* ensured compatibility from Coq 8.12 to 8.19
Version 3.4.0
-------------
* added an `AbelianMonoid` structure at the bottom of the hierarchy
Version 3.3.1
-------------
* fixed compilation with ssreflect 1.17 and 2.0
Version 3.3.0
-------------
* improved support for complex arithmetic
* minimal version of Coq is now 8.12
Version 3.2.0
-------------
* added `closely` to filter over pairs of close values in place of `cauchy`
Version 3.1.0
-------------
* ensured compatibility from Coq 8.8 to Coq 8.13
* added some theorems about continuity and differentiability of elementary functions
Version 3.0.3
-------------
* ensured compatibility from Coq 8.8 to Coq 8.10
Version 3.0.2
-------------
* ensured compatibility from Coq 8.5 to Coq 8.9
Version 3.0.1
-------------
* ensured compatibility from Coq 8.5 to Coq 8.7
Version 3.0.0
-------------
* generalized `RInt` to `CompleteNormedModule`
* added `filterlimi` to express limits of implicitly-defined functions
* made `is_RInt_gen` similar to other limits and defined `RInt_gen`
Version 2.1.2
-------------
* fixed compilation with Coq 8.6; minimal version is now 8.5
Version 2.1.1
-------------
* fixed compilation with ssreflect 1.6
Version 2.1.0
-------------
* added `continuous` for expressing continuity
* modified definitions for `sum_n` and `sum_n_m`
* strengthened axioms for `AbsRing` and `NormedModule`
* added `closed` for characterizing closed sets
* added `iota` for Hilbert's operator on `CompleteSpace`
* added notation `[ _ , _ , ...]` for vectors of type `Tn`
* renamed `Markov*` lemmas to `LPO*`
* proved Abel's theorem on power series
* generalized continuity and differentiability of `RInt` in `RInt_analysis`
* added support for improper integrals in `RInt_gen`
* renamed `Limit` into `Lim_seq`
* added example `BacS2013_bonus` about matrices
Version 2.0.1
-------------
* fixed compilation with ssreflect 1.5
Version 2.0.0
-------------
* removed `is_derive` as a notation for `derivable_pt_lim`
* renamed some compatibility theorems from `_equiv` to `_Reals`
* introduced a hierarchy of number structures and topological spaces
* added complex numbers
* generalized `is_RInt`, `is_derive`, `is_domin`, etc, from reals to
arbitrary left-modules
Version 1.1.0
-------------
* expressed `locally`, `Rbar_locally`, etc, as filters
* defined limits using `filterlim` and modified predicates such as `is_lim`
accordingly
* simplified definitions of `Rbar` operators
Version 1.0.0
-------------
* initial release
coquelicot-coquelicot-3.4.1/README.md 0000664 0000000 0000000 00000001415 14551434325 0017321 0 ustar 00root root 0000000 0000000 COQUELICOT
==========
This library provides vernacular files containing a formalization of real
analysis for the [Coq proof assistant](https://coq.inria.fr/). It is
a conservative extension of the standard library `Reals` with a focus on
usability.
PROJECT HOME
------------
Homepage: http://coquelicot.saclay.inria.fr/
Repository: https://gitlab.inria.fr/coquelicot/coquelicot
Bug tracker: https://gitlab.inria.fr/coquelicot/coquelicot/issues
COPYRIGHT
---------
This package is free software; you can redistribute it and/or modify it
under the terms of GNU Lesser General Public License (see the
[COPYING](COPYING) file). Authors are Sylvie Boldo ,
Catherine Lelay , and
Guillaume Melquiond .
coquelicot-coquelicot-3.4.1/Remakefile.in 0000664 0000000 0000000 00000005271 14551434325 0020442 0 ustar 00root root 0000000 0000000 FILES = \
AutoDerive.v \
Compactness.v \
Complex.v \
Continuity.v \
Coquelicot.v \
Derive.v \
Derive_2d.v \
Equiv.v \
ElemFct.v \
Hierarchy.v \
Iter.v \
KHInt.v \
Lim_seq.v \
Lub.v \
Markov.v \
PSeries.v \
Rbar.v \
Rcomplements.v \
RInt.v \
RInt_analysis.v \
RInt_gen.v \
Seq_fct.v \
Series.v \
SF_seq.v
OBJS = $(addprefix theories/,$(addsuffix o,$(FILES)))
.PHONY: all check dist doc install
.PHONY: clean theories/clean examples/clean
all: $(OBJS)
clean: theories/clean examples/clean
Remakefile: Remakefile.in config.status
./config.status Remakefile
configure config.status: configure.in
autoconf
./config.status --recheck
%.vo: %.v
@COQDEP@ -R theories Coquelicot $< | @REMAKE@ -r $@
@COQC@ @TIMING@ @COQEXTRAFLAGS@ -q -R theories Coquelicot $< @TIMING_EXTRA@
theories/clean:
rm -f $(OBJS) theories/*.glob
html/full-index.html: $(OBJS)
rm -rf html
mkdir -p html
@COQDOC@ -toc -interpolate -utf8 -html -g -R theories Coquelicot -d html \
--coqlib_url https://coq.inria.fr/distrib/current/stdlib \
--external https://math-comp.github.io/htmldoc mathcomp \
$(addprefix theories/,$(FILES))
mv html/index.html html/full-index.html
for f in html/*.html; do
sed -e 's;Index;Go back to the Main page or Index.;' -i $f
done
doc: html/full-index.html deps.dot
dot -Tcmapx -odeps.map -Tpng -ohtml/deps.png deps.dot
sed -e '/img src="deps.png"/ r deps.map' -i html/Coquelicot.Coquelicot.html
cp html/Coquelicot.Coquelicot.html html/index.html
rm -f deps.map
public: doc
rm -rf public
cp -r html public
deps.dot: $(addprefix theories/,$(FILES))
(echo "digraph coquelicot_deps {" ;
echo "node [shape = ellipse, style=filled, URL=\"Coquelicot.\N.html\", color=black, fillcolor=lightskyblue];";
(cd theories ; @COQDEP@ -R . Coquelicot $(FILES)) | sed -n -e 's/[.]vo.*: [^ ]*[.]v//p' |
while read src dst; do
for d in $dst; do
echo $src "->" ${d%.vo} ";"
done
done ;
echo "}") | tred > $@
EXAMPLES = \
BacS2013.v \
BacS2013_bonus.v \
Bessel.v \
DAlembert.v
EXOBJS = $(addprefix examples/,$(addsuffix o,$(EXAMPLES)))
check: $(EXOBJS)
examples/clean:
rm -f $(EXOBJS) examples/*.glob
install:
dir="${DESTDIR}@COQUSERCONTRIB@/Coquelicot"
mkdir -p $dir
cp $(OBJS) $dir
( cd theories && find . -type d -name ".coq-native" -exec cp -RT "{}" "$dir/{}" \; )
EXTRA_DIST = \
configure
dist: $(EXTRA_DIST)
PACK=@PACKAGE_TARNAME@-@PACKAGE_VERSION@
rm -f $PACK.tar.gz
git archive --format=tar --prefix=$PACK/ -o $PACK.tar HEAD
tar rf $PACK.tar --transform="s,^,$PACK/," --mtime="`git show -s --format=%ci`" --owner=0 --group=0 $(EXTRA_DIST)
gzip -n -f --best $PACK.tar
coquelicot-coquelicot-3.4.1/_CoqProject 0000664 0000000 0000000 00000000027 14551434325 0020173 0 ustar 00root root 0000000 0000000 -R theories Coquelicot
coquelicot-coquelicot-3.4.1/configure.in 0000664 0000000 0000000 00000004001 14551434325 0020345 0 ustar 00root root 0000000 0000000 AC_INIT([Coquelicot], [3.4.1],
[Guillaume Melquiond ],
[coquelicot])
m4_divert_push(99)
if test "$ac_init_help" = "long"; then
ac_init_help=short
fi
m4_divert_pop(99)
AC_ARG_VAR(COQBIN, [path to Coq executables [empty]])
if test ${COQBIN##*/}; then COQBIN=$COQBIN/; fi
AC_ARG_VAR(COQC, [Coq compiler command [coqc]])
AC_MSG_CHECKING([for coqc])
if test ! "$COQC"; then COQC=`which ${COQBIN}coqc`; fi
AC_MSG_RESULT([$COQC])
AC_ARG_VAR(COQDEP, [Coq dependency analyzer command [coqdep]])
AC_MSG_CHECKING([for coqdep])
if test ! "$COQDEP"; then COQDEP=`which ${COQBIN}coqdep`; fi
AC_MSG_RESULT([$COQDEP])
AC_ARG_VAR(COQDOC, [Coq documentation generator command [coqdoc]])
AC_MSG_CHECKING([for coqdoc])
if test ! "$COQDOC"; then COQDOC=`which ${COQBIN}coqdoc`; fi
AC_MSG_RESULT([$COQDOC])
AC_ARG_VAR(COQEXTRAFLAGS, [extra flags passed to Coq compiler [empty]])
AC_ARG_VAR(TIMING)
if test -n "$TIMING"; then
TIMING_EXTRA="> $<.timing"
TIMING="-time"
fi
AC_SUBST(TIMING_EXTRA)
AC_MSG_CHECKING([for SSReflect])
AS_IF(
[ echo "Require Import mathcomp.ssreflect.ssreflect." > conftest.v
$COQC conftest.v > conftest.err ],
[ AC_MSG_RESULT([yes]) ],
[ AC_MSG_RESULT([no])
AC_MSG_ERROR([ *** Unable to find library mathcomp.ssreflect (http://math-comp.github.io/math-comp/)])])
rm -f conftest.v conftest.vo conftest.err
AC_ARG_VAR(COQUSERCONTRIB, [installation directory [`$COQC -where`/user-contrib]])
if test -z "$COQUSERCONTRIB"; then
COQUSERCONTRIB="`$COQC -where | tr -d '\r' | tr '\\\\' '/'`/user-contrib"
fi
AC_ARG_VAR(REMAKE, [Remake [vendored version]])
if test -z "$REMAKE"; then
AC_PROG_CXX
AC_MSG_NOTICE([building remake...])
case `$CXX -v 2>&1 | grep -e "^Target:"` in
*mingw*)
$CXX -Wall -O2 -o remake.exe remake.cpp -lws2_32
if test $? != 0; then AC_MSG_FAILURE([failed]); fi
REMAKE=./remake.exe
;;
*)
$CXX -Wall -O2 -o remake remake.cpp
if test $? != 0; then AC_MSG_FAILURE([failed]); fi
REMAKE=./remake
;;
esac
fi
AC_CONFIG_FILES(Remakefile)
AC_OUTPUT
coquelicot-coquelicot-3.4.1/examples/ 0000775 0000000 0000000 00000000000 14551434325 0017657 5 ustar 00root root 0000000 0000000 coquelicot-coquelicot-3.4.1/examples/BacS2013.v 0000664 0000000 0000000 00000030001 14551434325 0021156 0 ustar 00root root 0000000 0000000 (**
This file is part of the Coquelicot formalization of real
analysis in Coq: http://coquelicot.saclay.inria.fr/
Copyright (C) 2011-2015 Sylvie Boldo
#
#
Copyright (C) 2011-2015 Catherine Lelay
#
#
Copyright (C) 2011-2015 Guillaume Melquiond
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 3 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
COPYING file for more details.
*)
From Coq Require Import Reals Psatz ssreflect.
From Coquelicot Require Import Rcomplements Rbar Hierarchy Derive RInt Continuity Lim_seq ElemFct RInt_analysis.
(** This file describes an experiment: most 18-year old French
students pass an exam called Baccalaureate which ends the high school
and is required for attending the university. We took the 2013
mathematics test of the scientific Baccalaureate at the same time as
the students. The pdf of the test is available
#here#. *)
Ltac pos_rat :=
repeat ( apply Rdiv_lt_0_compat
|| apply Rplus_lt_0_compat
|| apply Rmult_lt_0_compat) ;
try by apply Rlt_0_1.
Lemma sign_0_lt : forall x, 0 < x <-> 0 < sign x.
Proof.
intros x.
unfold sign.
destruct total_order_T as [[H|H]|H] ; lra.
Qed.
Lemma sign_lt_0 : forall x, x < 0 <-> sign x < 0.
Proof.
intros x.
unfold sign.
destruct total_order_T as [[H|H]|H] ; lra.
Qed.
(** * Exercice 2 *)
(* 8:14 *)
Definition fab (a b x : R) : R := (a + b * ln x) / x.
(** ** Questions 1 *)
(** 1.a. On voit sur le graphique que l'image de 1 par f correspond au point B(1,2). On a donc f(1) = 2.
Comme la tangente (BC) à la courbe en ce point admet pour coefficient directeur 0, f'(1) = 0 *)
(** 1.b *)
Lemma Dfab (a b : R) : forall x, 0 < x
-> is_derive (fab a b) x (((b - a) - b * ln x) / x ^ 2).
Proof.
move => x Hx.
evar_last.
apply is_derive_div.
apply @is_derive_plus.
apply is_derive_const.
apply is_derive_scal.
now apply is_derive_Reals, derivable_pt_lim_ln.
apply is_derive_id.
by apply Rgt_not_eq.
rewrite /Rdiv /plus /zero /one /=.
field.
by apply Rgt_not_eq.
Qed.
(** 1.c *)
Lemma Val_a_b (a b : R) : fab a b 1 = 2 -> Derive (fab a b) 1 = 0 -> a = 2 /\ b = 2.
Proof.
move => Hf Hdf.
rewrite /fab in Hf.
rewrite ln_1 in Hf.
rewrite Rdiv_1 in Hf.
rewrite Rmult_0_r in Hf.
rewrite Rplus_0_r in Hf.
rewrite Hf in Hdf |- * => {a Hf}.
split.
reflexivity.
replace (Derive (fab 2 b) 1) with (((b - 2) - b * ln 1) / 1 ^ 2) in Hdf.
rewrite ln_1 /= in Hdf.
field_simplify in Hdf.
rewrite ?Rdiv_1 in Hdf.
by apply Rminus_diag_uniq.
apply sym_eq, is_derive_unique.
apply Dfab.
by apply Rlt_0_1.
Qed.
Definition f (x : R) : R := fab 2 2 x.
(** ** Questions 2 *)
(* 8:38 *)
(** 2.a. *)
Lemma Signe_df : forall x, 0 < x -> sign (Derive f x) = sign (- ln x).
Proof.
move => x Hx.
rewrite (is_derive_unique f x _ (Dfab 2 2 x Hx)).
replace ((2 - 2 - 2 * ln x) / x ^ 2) with (2 / x ^ 2 * (- ln x)) by (field ; now apply Rgt_not_eq).
rewrite sign_mult sign_eq_1.
apply Rmult_1_l.
apply Rdiv_lt_0_compat.
apply Rlt_0_2.
apply pow2_gt_0.
by apply Rgt_not_eq.
Qed.
(** 2.b. *)
Lemma filterlim_f_0 :
filterlim f (at_right 0) (Rbar_locally m_infty).
Proof.
unfold f, fab.
eapply (filterlim_comp_2 _ _ Rmult).
eapply filterlim_comp_2.
apply filterlim_const.
eapply filterlim_comp_2.
apply filterlim_const.
by apply is_lim_ln_0.
apply (filterlim_Rbar_mult 2 m_infty m_infty).
unfold is_Rbar_mult, Rbar_mult'.
case: Rle_dec (Rlt_le _ _ Rlt_0_2) => // H _ ;
case: Rle_lt_or_eq_dec (Rlt_not_eq _ _ Rlt_0_2) => //.
apply (filterlim_Rbar_plus 2 _ m_infty).
by [].
by apply filterlim_Rinv_0_right.
by apply (filterlim_Rbar_mult m_infty p_infty).
Qed.
Lemma Lim_f_p_infty : is_lim f p_infty 0.
Proof.
apply is_lim_ext_loc with (fun x => 2 / x + 2 * (ln x / x)).
exists 0.
move => y Hy.
rewrite /f /fab.
field.
by apply Rgt_not_eq.
eapply is_lim_plus.
apply is_lim_scal_l.
apply is_lim_inv.
by apply is_lim_id.
by [].
apply is_lim_scal_l.
by apply is_lim_div_ln_p.
unfold is_Rbar_plus, Rbar_plus' ; apply f_equal, f_equal ; ring.
Qed.
(** 2.c. *)
Lemma Variation_1 : forall x y, 0 < x -> x < y -> y < 1 -> f x < f y.
Proof.
apply (incr_function _ 0 1 (fun x => (2 - 2 - 2 * ln x) / x ^ 2)).
move => x H0x Hx1.
by apply (Dfab 2 2 x).
move => x H0x Hx1.
apply sign_0_lt.
rewrite -(is_derive_unique _ _ _ (Dfab 2 2 x H0x)).
rewrite Signe_df.
apply -> sign_0_lt.
apply Ropp_lt_cancel ; rewrite Ropp_0 Ropp_involutive.
rewrite -ln_1.
by apply ln_increasing.
by apply H0x.
Qed.
Lemma Variation_2 : forall x y, 1 < x -> x < y -> f x > f y.
Proof.
move => x y H1x Hxy.
apply Ropp_lt_cancel.
apply (incr_function (fun x => - f x) 1 p_infty (fun z => - ((2 - 2 - 2 * ln z) / z ^ 2))).
move => z H1z _.
apply: is_derive_opp.
apply (Dfab 2 2 z).
by apply Rlt_trans with (1 := Rlt_0_1).
move => z H1z _.
apply Ropp_lt_cancel ; rewrite Ropp_0 Ropp_involutive.
apply sign_lt_0.
rewrite -(is_derive_unique _ _ _ (Dfab 2 2 z (Rlt_trans _ _ _ Rlt_0_1 H1z))).
rewrite Signe_df.
apply -> sign_lt_0.
apply Ropp_lt_cancel ; rewrite Ropp_0 Ropp_involutive.
rewrite -ln_1.
apply ln_increasing.
by apply Rlt_0_1.
by apply H1z.
by apply Rlt_trans with (1 := Rlt_0_1).
by [].
by [].
by [].
Qed.
(** ** Questions 3 *)
(* 9:40 *)
(** 3.a *)
Lemma f_eq_1_0_1 : exists x, 0 < x <= 1 /\ f x = 1.
Proof.
case: (IVT_Rbar_incr (fun x => f (Rabs x)) 0 1 m_infty 2 1).
eapply filterlim_comp.
apply filterlim_Rabs_0.
by apply filterlim_f_0.
apply is_lim_comp with 1.
replace 2 with (f 1).
apply is_lim_continuity.
apply derivable_continuous_pt.
exists (((2 - 2) - 2 * ln 1) / 1 ^ 2) ; apply is_derive_Reals, Dfab.
by apply Rlt_0_1.
rewrite /f /fab ln_1 /= ; field.
rewrite -{2}(Rabs_pos_eq 1).
apply (is_lim_continuity Rabs 1).
by apply continuity_pt_filterlim, continuous_Rabs.
by apply Rle_0_1.
exists (mkposreal _ Rlt_0_1) => /= x H0x Hx.
rewrite /ball /= /AbsRing_ball /= in H0x.
apply Rabs_lt_between' in H0x.
rewrite Rminus_eq_0 in H0x.
contradict Hx.
rewrite -(Rabs_pos_eq x).
by apply Rbar_finite_eq.
by apply Rlt_le, H0x.
move => x H0x Hx1.
apply (continuity_pt_comp Rabs).
by apply continuity_pt_filterlim, continuous_Rabs.
rewrite Rabs_pos_eq.
apply derivable_continuous_pt.
exists (((2 - 2) - 2 * ln x) / x ^ 2) ; apply is_derive_Reals, Dfab.
by [].
by apply Rlt_le.
by apply Rlt_0_1.
split => //.
apply Rminus_lt_0 ; ring_simplify ; by apply Rlt_0_1.
move => x [H0x [Hx1 Hfx]].
rewrite Rabs_pos_eq in Hfx.
exists x ; repeat split.
by apply H0x.
by apply Rlt_le.
by apply Hfx.
by apply Rlt_le.
Qed.
(** 3.b. *)
Lemma f_eq_1_1_p_infty : exists x, 1 <= x /\ f x = 1.
Proof.
case: (IVT_Rbar_incr (fun x => - f x) 1 p_infty (-2) 0 (-1)).
replace (-2) with (-f 1).
apply (is_lim_continuity (fun x => - f x)).
apply continuity_pt_opp.
apply derivable_continuous_pt.
exists (((2 - 2) - 2 * ln 1) / 1 ^ 2) ; apply is_derive_Reals, Dfab.
by apply Rlt_0_1.
rewrite /f /fab ln_1 /= ; field.
evar_last.
apply is_lim_opp.
by apply Lim_f_p_infty.
simpl ; by rewrite Ropp_0.
move => x H0x Hx1.
apply continuity_pt_opp.
apply derivable_continuous_pt.
exists (((2 - 2) - 2 * ln x) / x ^ 2) ; apply is_derive_Reals, Dfab.
by apply Rlt_trans with (1 := Rlt_0_1).
by [].
split ; apply Rminus_lt_0 ; ring_simplify ; by apply Rlt_0_1.
move => x [H0x [Hx1 Hfx]].
exists x ; split.
by apply Rlt_le.
rewrite -(Ropp_involutive (f x)) Hfx ; ring.
Qed.
(** ** Questions 5 *)
(* 10:08 *)
(** 5.a. *)
(** 5.b. *)
Lemma If : forall x, 0 < x -> is_derive (fun y : R => 2 * ln y + (ln y) ^ 2) x (f x).
Proof.
move => y Hy.
evar_last.
apply @is_derive_plus.
apply is_derive_Reals.
apply derivable_pt_lim_scal.
by apply derivable_pt_lim_ln.
apply is_derive_pow.
by apply is_derive_Reals, derivable_pt_lim_ln.
rewrite /f /fab /plus /= ; field.
by apply Rgt_not_eq.
Qed.
Lemma RInt_f : is_RInt f ( / exp 1) 1 1.
Proof.
have Haux1: (0 < /exp 1).
apply Rinv_0_lt_compat.
apply exp_pos.
evar_last.
apply: is_RInt_derive.
move => x Hx.
apply If.
apply Rlt_le_trans with (2 := proj1 Hx).
apply Rmin_case.
by apply Haux1.
by apply Rlt_0_1.
move => x Hx.
apply continuity_pt_filterlim.
apply derivable_continuous_pt.
exists (((2 - 2) - 2 * ln x) / x ^ 2) ; apply is_derive_Reals, Dfab.
apply Rlt_le_trans with (2 := proj1 Hx).
apply Rmin_case.
by apply Haux1.
by apply Rlt_0_1.
rewrite /minus /= /plus /opp /= -[eq]/(@eq R).
rewrite ln_Rinv.
rewrite ln_exp.
rewrite ln_1.
ring.
by apply exp_pos.
Qed.
(** * Exercice 4 *)
(* 10:36 *)
Fixpoint u (n : nat) : R :=
match n with
| O => 2
| S n => 2/3 * u n + 1/3 * (INR n) + 1
end.
(** ** Questions 1 *)
(** 1.a. *)
(** 1.b. *)
(** ** Questions 2 *)
(* 10:40 *)
(** 2.a *)
Lemma Q2a : forall n, u n <= INR n + 3.
Proof.
elim => [ | n IH] ; rewrite ?S_INR /=.
apply Rminus_le_0 ; ring_simplify ; apply Rle_0_1.
eapply Rle_trans.
apply Rplus_le_compat_r.
apply Rplus_le_compat_r.
apply Rmult_le_compat_l.
lra.
by apply IH.
lra.
Qed.
(** 2.b. *)
Lemma Q2b : forall n, u (S n) - u n = 1/3 * (INR n + 3 - u n).
Proof.
move => n ; simpl.
field.
Qed.
(** 2.c. *)
Lemma Q2c : forall n, u n <= u (S n).
Proof.
move => n.
apply Rminus_le_0.
rewrite Q2b.
apply Rmult_le_pos.
lra.
apply (Rminus_le_0 (u n)).
by apply Q2a.
Qed.
(** ** Question 3 *)
(* 10:49 *)
Definition v (n : nat) : R := u n - INR n.
(** 3.a. *)
Lemma Q3a : forall n, v n = 2 * (2/3) ^ n.
Proof.
elim => [ | n IH].
rewrite /v /u /= ; ring.
replace (2 * (2 / 3) ^ S n) with (v n * (2/3)) by (rewrite IH /= ; ring).
rewrite /v S_INR /=.
field.
Qed.
(** 3.b. *)
Lemma Q3b : forall n, u n = 2 * (2/3)^n + INR n.
Proof.
move => n.
rewrite -Q3a /v ; ring.
Qed.
Lemma Q3c : is_lim_seq u p_infty.
Proof.
apply is_lim_seq_ext with (fun n => 2 * (2/3)^n + INR n).
move => n ; by rewrite Q3b.
eapply is_lim_seq_plus.
eapply is_lim_seq_mult.
by apply is_lim_seq_const.
apply is_lim_seq_geom.
rewrite Rabs_pos_eq.
lra.
lra.
by [].
apply is_lim_seq_INR.
by [].
Qed.
(** ** Questions 4 *)
(* 11:00 *)
Definition Su (n : nat) : R := sum_f_R0 u n.
Definition Tu (n : nat) : R := Su n / (INR n) ^ 2.
(** 4.a. *)
Lemma Q4a : forall n, Su n = 6 - 4 * (2/3)^n + INR n * (INR n + 1) / 2.
Proof.
move => n.
rewrite /Su.
rewrite -(sum_eq (fun n => (2/3)^n * 2 + INR n)).
rewrite sum_plus.
rewrite -scal_sum.
rewrite tech3.
rewrite sum_INR.
simpl ; field.
apply Rlt_not_eq, Rlt_div_l.
repeat apply Rplus_lt_0_compat ; apply Rlt_0_1.
apply Rminus_lt_0 ; ring_simplify ; by apply Rlt_0_1.
move => i _.
rewrite Q3b ; ring.
Qed.
(** 4.b. *)
Lemma Q4b : is_lim_seq Tu (1/2).
Proof.
apply is_lim_seq_ext_loc with (fun n => (6 - 4 * (2/3)^n) / (INR n ^2) + / (2 * INR n) + /2).
exists 1%nat => n Hn ; rewrite /Tu Q4a.
simpl ; field.
apply Rgt_not_eq, (lt_INR O) ; intuition.
eapply is_lim_seq_plus.
eapply is_lim_seq_plus.
eapply is_lim_seq_div.
eapply is_lim_seq_minus.
apply is_lim_seq_const.
eapply is_lim_seq_mult.
by apply is_lim_seq_const.
apply is_lim_seq_geom.
rewrite Rabs_pos_eq.
lra.
lra.
by [].
rewrite /is_Rbar_minus /is_Rbar_plus /=.
now ring_simplify (6 + - (4 * 0)).
repeat eapply is_lim_seq_mult.
apply is_lim_seq_INR.
apply is_lim_seq_INR.
apply is_lim_seq_const.
apply is_Rbar_mult_p_infty_pos.
by apply Rlt_0_1.
by [].
by [].
by apply is_Rbar_div_p_infty.
apply is_lim_seq_inv.
eapply is_lim_seq_mult.
by apply is_lim_seq_const.
by apply is_lim_seq_INR.
by apply is_Rbar_mult_sym, is_Rbar_mult_p_infty_pos, Rlt_0_2.
by [].
by [].
apply is_lim_seq_const.
apply (f_equal (@Some _)), f_equal.
field.
Qed.
(* 11:33 *)
coquelicot-coquelicot-3.4.1/examples/BacS2013_bonus.v 0000664 0000000 0000000 00000015016 14551434325 0022375 0 ustar 00root root 0000000 0000000 (**
This file is part of the Coquelicot formalization of real
analysis in Coq: http://coquelicot.saclay.inria.fr/
Copyright (C) 2011-2015 Sylvie Boldo
#
#
Copyright (C) 2011-2015 Catherine Lelay
#
#
Copyright (C) 2011-2015 Guillaume Melquiond
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 3 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
COPYING file for more details.
*)
From Coq Require Import Reals Psatz ssreflect.
From Coquelicot Require Import Hierarchy PSeries Rbar Lim_seq.
(** This file describes an experiment: most 18-year old French
students pass an exam called Baccalaureate which ends the high school
and is required for attending the university. We took the 2013
mathematics test of the scientific Baccalaureate at the same time as
the students. The pdf of the test is available #here#. This file is dedicated
to the mathematics specialty exercise, done after the exam. *)
Open Scope R_scope.
(** * Bac 2013 - Exercice 4 spécialité *)
(** 1. Exprimer v (S n) et c (S n) en fonction de v n et c n *)
Fixpoint v (n : nat) : R :=
match n with
| O => 7 / 10 * 250000
| S n => 95 / 100 * v n + 1 / 100 * c n
end
with c (n : nat) : R :=
match n with
| O => 3 / 10 * 250000
| S n => 5 / 100 * v n + 99 / 100 * c n
end.
(** 2. Définition de la matrice A *)
Definition A : matrix 2 2 :=
[[95/100, 1/100 ] ,
[ 5/100, 99/100]].
Definition X (n : nat) : matrix 2 1 :=
[[v n],[c n]].
Lemma Q2 : forall n, X (S n) = scal A (X n).
Proof.
intros n.
rewrite /scal /= /Mmult.
apply (coeff_mat_ext 0).
case ; [ | case => //].
case ; [ | case => //] ;
rewrite coeff_mat_bij /= ; (try lia) ;
rewrite sum_Sn sum_O /plus /mult //=.
case ; [ | case => //] ;
rewrite coeff_mat_bij /= ; (try lia) ;
rewrite sum_Sn sum_O /plus /mult //=.
Qed.
(** 3. Diagonalisation *)
Definition P : matrix 2 2 :=
[[1,-1], [5,1]].
Definition Q : matrix 2 2 :=
[[1,1],[-5,1]].
Goal mult P Q = [[6,0],[0,6]].
apply (coeff_mat_ext_aux 0 0) => i j Hi Hj.
rewrite coeff_mat_bij => //.
rewrite /coeff_mat /= /mult /plus /=.
(destruct i as [ | i] ; destruct j as [ | j] ; rewrite /zero /= ; try ring) ;
(try (destruct i as [ | i]) ; try (destruct j as [ | j]) ; rewrite /zero /= ; try ring) ;
rewrite sum_Sn sum_O /= /plus /= ; ring.
Qed.
Goal mult Q P = [[6,0],[0,6]].
apply (coeff_mat_ext_aux 0 0) => i j Hi Hj.
rewrite coeff_mat_bij => //.
rewrite /coeff_mat /= /mult /plus /=.
(destruct i as [ | i] ; destruct j as [ | j] ; rewrite /zero /= ; try ring) ;
(try (destruct i as [ | i]) ; try (destruct j as [ | j]) ; rewrite /zero /= ; try ring) ;
rewrite sum_Sn sum_O /= /plus /= ; ring.
Qed.
Definition P' : matrix 2 2 :=
[[1 / 6,1 / 6],[-5 / 6,1 / 6]].
Lemma Q3a : mult P P' = Mone /\ mult P' P = Mone.
Proof.
split.
apply (coeff_mat_ext_aux 0 0) => i j Hi Hj.
rewrite coeff_mat_bij => //.
rewrite /coeff_mat /= /mult /plus /=.
(destruct i as [ | i] ; destruct j as [ | j] ; rewrite /zero /= ; try field) ;
(try (destruct i as [ | i]) ; try (destruct j as [ | j]) ; rewrite /zero /one /= ; try field) ;
rewrite sum_Sn sum_O /= /plus /= ; field.
apply (coeff_mat_ext_aux 0 0) => i j Hi Hj.
rewrite coeff_mat_bij => //.
rewrite /coeff_mat /= /mult /plus /=.
(destruct i as [ | i] ; destruct j as [ | j] ; rewrite /zero /= ; try field) ;
(try (destruct i as [ | i]) ; try (destruct j as [ | j]) ; rewrite /zero /one /= ; try field) ;
rewrite sum_Sn sum_O /= /plus /= ; field.
Qed.
Definition D : matrix 2 2 := [[1,0],[0,94 / 100]].
Lemma Q3b : mult P' (mult A P) = D.
Proof.
apply (coeff_mat_ext_aux 0 0) => i j Hi Hj.
rewrite coeff_mat_bij => //.
rewrite /coeff_mat /= /mult /plus /=.
(destruct i as [ | i] ; destruct j as [ | j] ; rewrite /zero /= ; try field) ;
(try (destruct i as [ | i]) ; try (destruct j as [ | j]) ; rewrite /zero /one /= ; try field) ;
rewrite sum_Sn sum_O /= /plus /= ; (try field) ;
rewrite !sum_Sn !sum_O /= /plus /coeff_mat /= ; field.
Qed.
Lemma Q3c : forall n, pow_n A n = mult P (mult (pow_n D n) P').
Proof.
elim => /= [ | n IH].
rewrite mult_one_l.
apply sym_eq, Q3a.
by rewrite -{1}Q3b !mult_assoc (proj1 Q3a) mult_one_l -!mult_assoc IH.
Qed.
(** 4. Terme général et limite de la suite v n *)
Lemma Q4 : forall n, v n = 1 / 6 * (1 + 5 * (94 / 100) ^ n) * v 0
+ 1 / 6 * (1 - (94 / 100) ^ n) * c 0.
Proof.
intros n.
assert (X n = scal (pow_n A n) (X 0)).
elim: n => [ | n IH] /=.
by rewrite scal_one.
rewrite -scal_assoc -IH.
by apply Q2.
assert (pow_n D n = [[1,0], [0,(94 / 100)^n]]).
elim: (n) => [ | m IH] //=.
rewrite IH.
apply (coeff_mat_ext_aux 0 0) => i j Hi Hj.
rewrite coeff_mat_bij => //=.
rewrite /plus /mult /= /coeff_mat /=.
(destruct i as [ | i] ; destruct j as [ | j] ; rewrite /zero /one /=) ;
(try (destruct i as [ | i]) ; try (destruct j as [ | j]) ; rewrite /zero /one /= ; try field) ;
rewrite sum_Sn sum_O /= /plus /= ; field.
rewrite Q3c H0 in H.
apply (proj1 (coeff_mat_ext 0 _ _)) with (i := O) (j := O) in H.
rewrite {1}/coeff_mat /= in H.
rewrite H ; repeat (rewrite !/coeff_mat /=).
rewrite !sum_Sn !sum_O /= /plus /mult /= ; field.
Qed.
Lemma lim_v : is_lim_seq v (41666 + 2 / 3).
Proof.
eapply is_lim_seq_ext.
intros n ; apply sym_eq, Q4.
eapply is_lim_seq_plus.
eapply is_lim_seq_mult.
eapply is_lim_seq_mult.
apply is_lim_seq_const.
eapply is_lim_seq_plus.
apply is_lim_seq_const.
eapply is_lim_seq_mult.
apply is_lim_seq_const.
apply is_lim_seq_geom.
rewrite Rabs_pos_eq ; lra.
by [].
by [].
by [].
apply is_lim_seq_const.
by [].
eapply is_lim_seq_mult.
eapply is_lim_seq_mult.
apply is_lim_seq_const.
eapply is_lim_seq_minus.
apply is_lim_seq_const.
apply is_lim_seq_geom.
rewrite Rabs_pos_eq ; lra.
by [].
by [].
apply is_lim_seq_const.
by [].
apply (f_equal (fun x => Some (Finite x))) ;
simpl ; field.
Qed.
Lemma lim_c : is_lim_seq c (208333 + 1 / 3).
Proof.
assert (forall n, c n = 250000 - v n).
elim => [ | n /= ->] /= ; field.
eapply is_lim_seq_ext.
intros n ; apply sym_eq, H.
eapply is_lim_seq_minus.
apply is_lim_seq_const.
by apply lim_v.
apply (f_equal (fun x => Some (Finite x))) ;
simpl ; field.
Qed.
coquelicot-coquelicot-3.4.1/examples/Bessel.v 0000664 0000000 0000000 00000053527 14551434325 0021277 0 ustar 00root root 0000000 0000000 (**
This file is part of the Coquelicot formalization of real
analysis in Coq: http://coquelicot.saclay.inria.fr/
Copyright (C) 2011-2015 Sylvie Boldo
#
#
Copyright (C) 2011-2015 Catherine Lelay
#
#
Copyright (C) 2011-2015 Guillaume Melquiond
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 3 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
COPYING file for more details.
*)
From Coq Require Import Reals Psatz ssreflect.
From Coquelicot Require Import Rcomplements Rbar Hierarchy Derive Series PSeries Lim_seq AutoDerive.
(** This file is an example of how to use power series. It defines and
gives properties of the Bessel functions. *)
Definition Bessel1_seq (n k : nat) :=
(-1)^(k)/(INR (fact (k)) * INR (fact (n + (k)))).
Lemma Bessel1_seq_neq_0 (n : nat) :
forall k, Bessel1_seq n k <> 0.
Proof.
move => k.
apply Rmult_integral_contrapositive_currified.
apply pow_nonzero, Ropp_neq_0_compat, R1_neq_R0.
apply Rinv_neq_0_compat, Rmult_integral_contrapositive_currified ;
apply INR_fact_neq_0.
Qed.
Lemma CV_Bessel1 (n : nat) :
CV_radius (Bessel1_seq n) = p_infty.
Proof.
apply CV_radius_infinite_DAlembert.
by apply Bessel1_seq_neq_0.
apply is_lim_seq_ext with (fun p => / (INR (S p) * INR (S (n + p)))).
move => p ; rewrite /Bessel1_seq -plus_n_Sm /fact -/fact !mult_INR.
simpl ((-1)^(S p)).
field_simplify (-1 * (-1) ^ p /
(INR (S p) * INR (fact p) * (INR (S (n + p)) * INR (fact (n + p)))) /
((-1) ^ p / (INR (fact p) * INR (fact (n + p))))).
rewrite Rabs_div.
rewrite Rabs_Ropp Rabs_R1 /Rdiv Rmult_1_l Rabs_pos_eq.
by [].
apply Rmult_le_pos ; apply pos_INR.
apply Rgt_not_eq, Rmult_lt_0_compat ;
apply lt_0_INR, Nat.lt_0_succ.
repeat split.
by apply INR_fact_neq_0.
by apply INR_fact_neq_0.
by apply Rgt_not_eq, lt_0_INR, Nat.lt_0_succ.
by apply Rgt_not_eq, lt_0_INR, Nat.lt_0_succ.
by apply pow_nonzero, Rlt_not_eq, (IZR_lt (-1) 0).
replace (Finite 0) with (Rbar_inv p_infty) by auto.
apply is_lim_seq_inv.
eapply is_lim_seq_mult.
apply -> is_lim_seq_incr_1.
by apply is_lim_seq_INR.
apply is_lim_seq_ext with (fun k => INR (k + S n)).
intros k.
by rewrite (Nat.add_comm n k) plus_n_Sm.
apply is_lim_seq_incr_n.
by apply is_lim_seq_INR.
by [].
by [].
Qed.
Lemma ex_Bessel1 (n : nat) (x : R) :
ex_pseries (Bessel1_seq n) x.
Proof.
apply CV_radius_inside.
by rewrite CV_Bessel1.
Qed.
Definition Bessel1 (n : nat) (x : R) :=
(x/2)^n * PSeries (Bessel1_seq n) ((x/2)^2).
Lemma is_derive_Bessel1 (n : nat) (x : R) :
is_derive (Bessel1 n) x
((x / 2) ^ S n * PSeries (PS_derive (Bessel1_seq n)) ((x / 2) ^ 2)
+ (INR n)/2 * (x / 2) ^ pred n * PSeries (Bessel1_seq n) ((x / 2) ^ 2)).
Proof.
rewrite /Bessel1.
auto_derive.
apply ex_derive_PSeries.
by rewrite CV_Bessel1.
rewrite Derive_PSeries.
rewrite /Rdiv ; simpl ; field.
by rewrite CV_Bessel1.
Qed.
Lemma is_derive_2_Bessel1 (n : nat) (x : R) :
is_derive_n (Bessel1 n) 2 x
(((x/2)^(S (S n)) * PSeries (PS_derive (PS_derive (Bessel1_seq n))) ((x / 2) ^ 2))
+ ((INR (2*n+1)/2) * (x/2)^n * PSeries (PS_derive (Bessel1_seq n)) ((x / 2) ^ 2))
+ (INR (n * pred n) / 4 * (x / 2) ^ pred (pred n) * PSeries (Bessel1_seq n) ((x / 2) ^ 2))).
Proof.
rewrite plus_INR ?mult_INR ; simpl INR.
eapply is_derive_ext.
move => y ;
by apply sym_eq, is_derive_unique, is_derive_Bessel1.
auto_derive.
repeat split.
apply ex_derive_PSeries.
by rewrite CV_radius_derive CV_Bessel1.
apply ex_derive_PSeries.
by rewrite CV_Bessel1.
rewrite !Derive_PSeries.
case: n => [ | n] ; rewrite ?S_INR /Rdiv /= ;
field.
by rewrite CV_Bessel1.
by rewrite CV_radius_derive CV_Bessel1.
Qed.
Lemma Bessel1_correct (n : nat) (x : R) :
x^2 * Derive_n (Bessel1 n) 2 x + x * Derive (Bessel1 n) x + (x^2 - (INR n)^2) * Bessel1 n x = 0.
Proof.
rewrite (is_derive_unique _ _ _ (is_derive_Bessel1 _ _)) ;
rewrite /Derive_n (is_derive_unique _ _ _ (is_derive_2_Bessel1 _ _)) ;
rewrite /Bessel1 plus_INR ?mult_INR ; simpl INR.
set y := x/2 ; replace x with (2 * y) by (unfold y ; field).
replace (_ + _)
with (4 * y^S (S n) * (y^2 * PSeries (PS_derive (PS_derive (Bessel1_seq n))) (y ^ 2)
+ (INR n + 1) * PSeries (PS_derive (Bessel1_seq n)) (y ^ 2)
+ PSeries (Bessel1_seq n) (y ^ 2))).
2: { case: n => [|[|n]] ; rewrite ?S_INR /= ; field. }
apply Rmult_eq_0_compat_l.
rewrite -PSeries_incr_1 -PSeries_scal -?PSeries_plus.
unfold PS_derive, PS_incr_1, PS_scal, PS_plus.
rewrite -(PSeries_const_0 (y^2)).
apply PSeries_ext.
case => [ | p] ; rewrite /Bessel1_seq ;
rewrite -?plus_n_Sm ?Nat.add_0_r /fact -/fact ?mult_INR ?S_INR ?plus_INR ; simpl INR ; simpl pow ;
rewrite ?Rplus_0_l ?Rmult_1_l.
rewrite /plus /zero /scal /= /mult /=.
field.
split ; rewrite -?S_INR ; apply Rgt_not_eq.
by apply INR_fact_lt_0.
by apply (lt_INR 0), Nat.lt_0_succ.
rewrite /plus /scal /= /mult /=.
field.
repeat split ; rewrite -?plus_INR -?S_INR ; apply Rgt_not_eq.
by apply INR_fact_lt_0.
by apply (lt_INR 0), Nat.lt_0_succ.
by apply INR_fact_lt_0.
by apply (lt_INR 0), Nat.lt_0_succ.
by apply (lt_INR 0), Nat.lt_0_succ.
by apply (lt_INR 0), Nat.lt_0_succ.
apply CV_radius_inside.
apply Rbar_lt_le_trans with (2 := CV_radius_plus _ _).
apply Rbar_min_case.
by rewrite CV_radius_incr_1 ?CV_radius_derive CV_Bessel1.
rewrite CV_radius_scal.
by rewrite CV_radius_derive CV_Bessel1.
now rewrite -S_INR ; apply not_0_INR, sym_not_eq, O_S.
by apply ex_Bessel1.
apply ex_pseries_R, ex_series_Rabs, CV_disk_inside.
by rewrite CV_radius_incr_1 ?CV_radius_derive CV_Bessel1.
apply ex_pseries_R, ex_series_Rabs, CV_disk_inside.
rewrite CV_radius_scal.
by rewrite CV_radius_derive CV_Bessel1.
now rewrite -S_INR ; apply not_0_INR, sym_not_eq, O_S.
Qed.
Lemma Bessel1_equality_1 (n : nat) (x : R) : x <> 0
-> Bessel1 (S n)%nat x = INR n * Bessel1 n x / x - Derive (Bessel1 n) x.
Proof.
move => Hx.
rewrite (is_derive_unique _ _ _ (is_derive_Bessel1 _ _)) /Bessel1.
set y := (x / 2).
replace x with (2 * y) by (unfold y ; field).
(* Supprimer les PSeries *)
have Hy : y <> 0.
unfold y ; contradict Hx.
replace x with (2 * (x/2)) by field ; rewrite Hx ; ring.
case: n => [ | n] ; simpl ; field_simplify => // ; rewrite ?Rdiv_1 -/(pow _ 2).
(* * cas n = 0 *)
replace (- 2 * y ^ 2 * PSeries (PS_derive (Bessel1_seq 0)) (y ^ 2) / (2 * y))
with (y * ((-1) * PSeries (PS_derive (Bessel1_seq 0)) (y ^ 2)))
by (simpl ; unfold y ; field => //).
apply f_equal.
rewrite -PSeries_scal.
apply PSeries_ext => k.
rewrite /Bessel1_seq /PS_scal /PS_derive Nat.add_0_l.
replace (1+k)%nat with (S k) by ring.
rewrite /fact -/fact mult_INR /pow -/pow.
change scal with Rmult.
field ; split.
exact: INR_fact_neq_0.
by apply not_0_INR, not_eq_sym, O_S.
(* * cas S n *)
replace (-2 * y ^ 2 * y ^ n * PSeries (PS_derive (Bessel1_seq (S n))) (y ^ 2) / 2)
with (y^2 * y^n * (((-1)* PSeries (PS_derive (Bessel1_seq (S n))) (y ^ 2))))
by (unfold y ; field => //).
apply f_equal.
rewrite -PSeries_scal.
apply PSeries_ext => k.
rewrite /Bessel1_seq /PS_scal /PS_derive -?plus_n_Sm ?plus_Sn_m.
rewrite /pow -/pow /fact -/fact ?mult_INR ?S_INR plus_INR.
change scal with Rmult.
field.
rewrite -plus_INR -?S_INR.
repeat split ;
try by [exact: INR_fact_neq_0 | apply not_0_INR, not_eq_sym, O_S].
Qed.
Lemma Bessel1_equality_2 (n : nat) (x : R) : (0 < n)%nat -> x<>0
-> Bessel1 (S n)%nat x + Bessel1 (pred n)%nat x = (2*INR n)/x * Bessel1 n x.
Proof.
case: n => [ | n] Hn Hx.
by apply Nat.lt_irrefl in Hn.
clear Hn ; simpl pred.
rewrite /Bessel1 S_INR.
replace ((x / 2) ^ S (S n) * PSeries (Bessel1_seq (S (S n))) ((x / 2) ^ 2) +
(x / 2) ^ n * PSeries (Bessel1_seq n) ((x / 2) ^ 2))
with ((x/2)^n *
((x/2)^2 * PSeries (Bessel1_seq (S (S n))) ((x / 2) ^ 2) +
PSeries (Bessel1_seq n) ((x / 2) ^ 2)))
by (simpl ; ring).
replace (2 * (INR n + 1) / x *
((x / 2) ^ S n * PSeries (Bessel1_seq (S n)) ((x / 2) ^ 2)))
with ((x/2)^n * ((INR n + 1) * PSeries (Bessel1_seq (S n)) ((x / 2) ^ 2)))
by (simpl ; field ; exact: Hx).
apply f_equal.
rewrite -PSeries_incr_1 -PSeries_scal -PSeries_plus.
2: (* ex_pseries (PS_incr_1 (Bessel1_seq (S (S n))) (S (S n))) ((x / 2) ^ 2) *)
by apply ex_pseries_incr_1, ex_Bessel1.
2: (* ex_pseries (PS_incr_n (Bessel1_seq n) n) ((x / 2) ^ 2) *)
by apply ex_Bessel1.
apply PSeries_ext => k.
(* egalité *)
rewrite /PS_plus /PS_scal /PS_incr_1 /Bessel1_seq ;
case: k => [ | k] ;
rewrite ?Nat.add_0_r -?plus_n_Sm ?plus_Sn_m
/fact -/fact ?mult_INR ?S_INR ?plus_INR /=.
rewrite plus_zero_l /scal /= /mult /=.
field.
rewrite -S_INR ; split ;
by [apply not_0_INR, sym_not_eq, O_S | apply INR_fact_neq_0].
rewrite /plus /scal /= /mult /=.
field ;
rewrite -?plus_INR -?S_INR ; repeat split ;
by [apply INR_fact_neq_0 | apply not_0_INR, sym_not_eq, O_S].
Qed.
Lemma Bessel1_equality_3 (n : nat) (x : R) : (0 < n)%nat ->
Bessel1 (S n)%nat x - Bessel1 (pred n)%nat x = - 2 * Derive (Bessel1 n) x.
Proof.
move => Hn.
rewrite (is_derive_unique _ _ _ (is_derive_Bessel1 _ _)) /Bessel1.
case: n Hn => [ | n] Hn.
by apply Nat.lt_irrefl in Hn.
clear Hn ; simpl pred.
replace ((x / 2) ^ S (S n) * PSeries (Bessel1_seq (S (S n))) ((x / 2) ^ 2) -
(x / 2) ^ n * PSeries (Bessel1_seq n) ((x / 2) ^ 2))
with ((x/2)^n *
((x/2)^2 * PSeries (Bessel1_seq (S (S n))) ((x / 2) ^ 2) -
PSeries (Bessel1_seq n) ((x / 2) ^ 2)))
by (simpl ; ring).
replace (-2 *((x / 2) ^ S (S n) * PSeries (PS_derive (Bessel1_seq (S n))) ((x / 2) ^ 2) +
INR (S n) / 2 * (x / 2) ^ n * PSeries (Bessel1_seq (S n)) ((x / 2) ^ 2)))
with ((x/2)^n * (-2 * ((x/2)^2 * PSeries (PS_derive (Bessel1_seq (S n))) ((x / 2) ^ 2)) -
INR (S n) * PSeries (Bessel1_seq (S n)) ((x / 2) ^ 2)))
by (rewrite S_INR ; simpl ; field).
set y := (x / 2).
apply f_equal.
rewrite -?PSeries_incr_1 -?PSeries_scal -?PSeries_minus.
apply PSeries_ext => k.
rewrite /PS_minus /PS_incr_1 /PS_scal /PS_derive /Bessel1_seq.
case: k => [ | k] ; rewrite -?plus_n_Sm ?plus_Sn_m /fact -/fact ?mult_INR ?S_INR -?plus_n_O ?plus_INR /= ;
rewrite /plus /opp /zero /scal /= /mult /= ;
field ; rewrite -?plus_INR -?S_INR.
split ; (apply INR_fact_neq_0 || apply not_0_INR, sym_not_eq, O_S).
repeat split ; (apply INR_fact_neq_0 || apply not_0_INR, sym_not_eq, O_S).
apply @ex_pseries_scal, @ex_pseries_incr_1, ex_pseries_derive.
by apply Rmult_comm.
by rewrite CV_Bessel1.
apply ex_pseries_scal, ex_Bessel1.
by apply Rmult_comm.
by apply ex_pseries_incr_1, ex_Bessel1.
by apply ex_Bessel1.
Qed.
(** * Unicity *)
Lemma Bessel1_uniqueness_aux_0 (a : nat -> R) (n : nat) :
Rbar_lt 0 (CV_radius a) ->
(forall x : R, Rbar_lt (Rabs x) (CV_radius a) -> x^2 * Derive_n (PSeries a) 2 x + x * Derive (PSeries a) x + (x^2 - (INR n)^2) * PSeries a x = 0)
->
(a 0%nat = 0 \/ n = O) /\
(a 1%nat = 0 \/ n = 1%nat) /\
(forall k, (INR (S (S k)) ^ 2 - INR n ^ 2) * a (S (S k)) + a k = 0).
Proof.
move => Ha H.
cut (forall k,
(PS_plus (PS_plus (PS_incr_n (PS_derive_n 2 a) 2)
(PS_incr_1 (PS_derive a))) (PS_plus (PS_incr_n a 2) (PS_scal (- INR n ^ 2) a))) k = 0).
intros Haux.
split ; [move: (Haux 0%nat) | move: (fun k => Haux (S k))] => {} Haux.
(* n = 0 *)
rewrite /PS_plus /= /PS_incr_1 /PS_derive_n /PS_scal /PS_derive in Haux.
rewrite /plus /zero /scal /= /mult /= in Haux.
ring_simplify in Haux.
apply Rmult_integral in Haux ; case: Haux => Haux.
right.
suff : ~ n <> 0%nat.
by intuition.
contradict Haux.
apply Ropp_neq_0_compat.
apply pow_nonzero.
by apply not_0_INR.
by left.
split ; [move: (Haux 0%nat) | move: (fun k => Haux (S k))] => {} Haux.
(* n = 1 *)
rewrite /PS_plus /= /PS_incr_1 /PS_derive_n /PS_scal /PS_derive /= in Haux.
rewrite /plus /zero /scal /= /mult /= in Haux.
ring_simplify in Haux.
replace (- a 1%nat * INR n ^ 2 + a 1%nat) with ((1 - INR n ^ 2) * a 1%nat) in Haux.
apply Rmult_integral in Haux ; case: Haux => Haux.
right.
suff : ~ n <> 1%nat.
by intuition.
contradict Haux.
replace (1 - INR n ^ 2) with ((1-INR n) * (1 + INR n)) by ring.
apply Rmult_integral_contrapositive_currified.
apply Rminus_eq_contra.
apply sym_not_eq.
by apply not_1_INR.
apply Rgt_not_eq, Rlt_le_trans with (1 := Rlt_0_1).
apply Rminus_le_0 ; ring_simplify.
by apply pos_INR.
by left.
ring.
(* n >= 2 *)
move => k ; rewrite ?S_INR /= ;
move: (Haux k) ;
rewrite /PS_plus /= /PS_incr_1 /PS_derive_n /PS_scal /PS_derive -?S_INR.
replace (k + 2)%nat with (S (S k)) by ring.
rewrite /fact -/fact ?mult_INR ?S_INR => {} Haux.
rewrite /plus /scal /= /mult /= in Haux.
field_simplify in Haux.
field_simplify.
by rewrite (Rmult_comm (INR n ^ 2)).
try revert Haux.
by apply INR_fact_neq_0.
move => k.
apply (PSeries_ext_recip _ (fun _ => 0)).
apply Rbar_lt_le_trans with (2 := CV_radius_plus _ _).
apply Rbar_min_case.
apply Rbar_lt_le_trans with (2 := CV_radius_plus _ _).
apply Rbar_min_case.
rewrite /PS_incr_n ?CV_radius_incr_1.
by rewrite CV_radius_derive_n.
rewrite CV_radius_incr_1.
by rewrite CV_radius_derive.
apply Rbar_lt_le_trans with (2 := CV_radius_plus _ _).
apply Rbar_min_case.
by rewrite /PS_incr_n ?CV_radius_incr_1.
destruct n.
rewrite -(CV_radius_ext (fun _ => 0)) ?CV_radius_const_0.
by [].
intros n ; rewrite /PS_scal /= /scal /= /mult /= ; ring.
rewrite CV_radius_scal ?Ha //.
apply Ropp_neq_0_compat, pow_nonzero, not_0_INR, sym_not_eq, O_S.
by rewrite CV_radius_const_0.
assert (0 < Rbar_min 1 (CV_radius a)).
destruct (CV_radius a) as [ca | | ] ; try by auto.
apply Rbar_min_case => //.
by apply Rlt_0_1.
apply Rbar_min_case_strong => // _.
by apply Rlt_0_1.
exists (mkposreal _ H0) => x Hx.
assert (Rbar_lt (Rabs x) (CV_radius a)).
destruct (CV_radius a) as [ca | | ] ; try by auto.
simpl.
eapply Rlt_le_trans.
rewrite -(Rminus_0_r x).
by apply Hx.
simpl.
apply Rmin_case_strong => // H1.
by apply Req_le.
rewrite PSeries_const_0 ?PSeries_plus.
rewrite ?PSeries_incr_n PSeries_incr_1 PSeries_scal -Derive_n_PSeries.
rewrite -Derive_PSeries.
rewrite -Rmult_plus_distr_r.
apply H.
by apply H1.
by apply H1.
by apply H1.
apply ex_pseries_incr_n, CV_radius_inside, H1.
apply ex_pseries_scal, CV_radius_inside.
by apply Rmult_comm.
by apply H1.
apply ex_pseries_incr_n.
apply CV_radius_inside.
rewrite CV_radius_derive_n.
by apply H1.
apply ex_pseries_incr_1, ex_pseries_derive.
by apply H1.
apply ex_pseries_plus.
apply ex_pseries_incr_n.
apply CV_radius_inside.
by rewrite CV_radius_derive_n ; apply H1.
apply ex_pseries_incr_1, ex_pseries_derive.
by apply H1.
apply ex_pseries_plus.
apply ex_pseries_incr_n.
apply CV_radius_inside.
by apply H1.
apply ex_pseries_scal.
by apply Rmult_comm.
apply CV_radius_inside ; by apply H1.
Qed.
Lemma Bessel1_uniqueness_aux_1 (a : nat -> R) (n : nat) :
(a 0%nat = 0 \/ n = O) ->
(a 1%nat = 0 \/ n = 1%nat) ->
(forall k, (INR (S (S k)) ^ 2 - INR n ^ 2) * a (S (S k)) + a k = 0) ->
(forall k : nat, (k < n)%nat -> a k = 0)
/\ (forall p : nat, a (n + 2 * p + 1)%nat = 0)
/\ (forall p : nat, a (n + 2 * p)%nat = Bessel1_seq n p * / 2 ^ (2 * p) * INR (fact n) * a n).
Proof.
intros Ha0 Ha1 Ha.
assert (forall k, S (S k) <> n -> a (S (S k)) = - a k / (INR (S (S k)) ^ 2 - INR n ^ 2)).
intros k Hk.
replace (a k) with (- (INR (S (S k)) ^ 2 - INR n ^ 2) * a (S (S k))).
field.
replace (INR (S (S k)) ^ 2 - INR n ^ 2)
with ((INR (S (S k)) - INR n) * (INR (S (S k)) + INR n))
by ring.
apply Rmult_integral_contrapositive_currified.
apply Rminus_eq_contra.
by apply not_INR.
rewrite -plus_INR plus_Sn_m.
by apply (not_INR _ O), sym_not_eq, O_S.
replace (a k)
with ((INR (S (S k)) ^ 2 - INR n ^ 2) * a (S (S k)) + a k - (INR (S (S k)) ^ 2 - INR n ^ 2) * a (S (S k)))
by ring.
rewrite Ha ; ring.
assert (forall k : nat, (k < n)%nat -> a k = 0).
destruct n => k Hk.
by apply Nat.nlt_0_r in Hk.
case: Ha0 => // Ha0.
destruct n.
destruct k => //.
by apply Nat.succ_lt_mono, Nat.nlt_0_r in Hk.
case: Ha1 => // Ha1.
move: k Hk.
apply (MyNat.ind_0_1_SS (fun k => (k < S (S n))%nat -> a k = 0)) => // k IH Hk.
rewrite H.
rewrite IH /Rdiv.
ring.
eapply Nat.lt_trans, Hk.
eapply Nat.lt_trans ; apply Nat.lt_succ_diag_r.
by apply MyNat.lt_neq.
repeat split.
by [].
elim => [ | p IH].
replace (n + 2 * 0 + 1)%nat with (S n) by ring.
destruct n => //=.
case: Ha1 => // Ha1.
case: Ha0 => // Ha0.
rewrite H ; try by intuition.
rewrite H0 /Rdiv.
ring.
by apply Nat.lt_succ_diag_r.
replace (n + 2 * S p + 1)%nat with (S (S (n + 2 * p + 1)%nat)) by ring.
rewrite H ; try by intuition.
rewrite IH /Rdiv.
ring.
elim => [ | p IH].
replace (n + 2 * 0)%nat with (n) by ring.
rewrite /Bessel1_seq /= -plus_n_O.
field ; by apply INR_fact_neq_0.
replace (n + 2 * S p)%nat with (S (S (n + 2 * p)%nat)) by ring.
rewrite H ; try by intuition.
rewrite IH /Rdiv.
rewrite /Bessel1_seq -plus_n_Sm.
rewrite !pow_sqr /fact -/fact !mult_INR !S_INR !plus_INR /=.
field ; rewrite -!plus_INR -!S_INR ;
repeat split ;
try (by apply INR_fact_neq_0) ;
try (by apply (not_INR _ 0), sym_not_eq, O_S).
apply pow_nonzero, Rgt_not_eq ; apply Rmult_lt_0_compat ; by apply Rlt_0_2.
rewrite -Rsqr_plus_minus.
apply Rmult_integral_contrapositive_currified.
rewrite -plus_INR.
apply Rgt_not_eq, lt_0_INR.
lia.
apply Rminus_eq_contra, not_INR.
lia.
Qed.
Lemma Bessel1_uniqueness (a : nat -> R) (n : nat) :
(Rbar_lt 0 (CV_radius a)) ->
(forall x : R, x^2 * Derive_n (PSeries a) 2 x + x * Derive (PSeries a) x + (x^2 - (INR n)^2) * PSeries a x = 0)
-> {b : R | forall x, PSeries a x = b * Bessel1 n x}.
Proof.
intros Hcv_a Ha.
assert ((a 0%nat = 0 \/ n = O) /\
(a 1%nat = 0 \/ n = 1%nat) /\
(forall k, (INR (S (S k)) ^ 2 - INR n ^ 2) * a (S (S k)) + a k = 0)).
by apply Bessel1_uniqueness_aux_0.
assert ((forall k : nat, (k < n)%nat -> a k = 0)
/\ (forall p : nat, a (n + 2 * p + 1)%nat = 0)
/\ (forall p : nat, a (n + 2 * p)%nat = Bessel1_seq n p * / 2 ^ (2 * p) * INR (fact n) * a n)).
apply Bessel1_uniqueness_aux_1 ; by apply H.
exists (2^n * INR (fact n) * a n) => x.
rewrite /Bessel1 (PSeries_decr_n_aux _ n).
case: H0 => _ H0.
rewrite Rpow_mult_distr -Rinv_pow.
field_simplify ; rewrite ?Rdiv_1.
rewrite !(Rmult_assoc (x ^ n)).
apply Rmult_eq_compat_l.
rewrite PSeries_odd_even.
replace (PSeries (fun n0 : nat => PS_decr_n a n (2 * n0 + 1)) (x ^ 2))
with 0.
case: H0 => _ H0.
rewrite Rmult_0_r Rplus_0_r.
rewrite -PSeries_scal.
apply Series_ext => k.
rewrite /PS_decr_n /PS_scal.
rewrite H0.
rewrite -!pow_mult.
rewrite Rpow_mult_distr -Rinv_pow.
rewrite /scal /= /mult /=.
ring.
by apply Rgt_not_eq, Rlt_0_2.
apply sym_eq.
rewrite -(PSeries_const_0 (x^2)).
apply PSeries_ext => k.
rewrite /PS_decr_n.
replace (n + (2 * k + 1))%nat with (n + 2 * k + 1)%nat by ring.
by apply H0.
eapply ex_pseries_ext.
move => p ;
apply sym_eq.
apply H0.
eapply ex_pseries_ext.
intros p ; rewrite Rmult_assoc ; apply Rmult_comm.
apply @ex_pseries_scal.
by apply Rmult_comm.
case: (Req_dec x 0) => Hx0.
rewrite Hx0.
rewrite /= Rmult_0_l.
by apply @ex_pseries_0.
apply ex_series_Rabs.
apply ex_series_DAlembert with 0.
by apply Rlt_0_1.
intros p.
apply Rmult_integral_contrapositive_currified.
rewrite pow_n_pow.
by apply pow_nonzero, pow_nonzero.
apply Rmult_integral_contrapositive_currified.
by apply Bessel1_seq_neq_0.
apply Rinv_neq_0_compat.
apply pow_nonzero.
by apply Rgt_not_eq, Rlt_0_2.
apply is_lim_seq_ext with (fun p => x^2 / 4 * / (INR (S p) * INR (S (n + p)))).
intros p ; rewrite !pow_n_pow !pow_mult.
rewrite /Bessel1_seq -plus_n_Sm /fact -/fact !mult_INR.
replace (@scal R_AbsRing R_NormedModule) with Rmult by auto.
simpl (_^(S p)) ; rewrite -!/(pow _ 2) ; ring_simplify (2^2).
field_simplify (x ^ 2 * (x ^ 2) ^ p *
(-1 * (-1) ^ p /
(INR (S p) * INR (fact p) * (INR (S (n + p)) * INR (fact (n + p)))) *
/ (4 * 4 ^ p)) /
((x ^ 2) ^ p * ((-1) ^ p / (INR (fact p) * INR (fact (n + p))) * / 4 ^ p))).
rewrite Rabs_div.
rewrite Rabs_Ropp /Rdiv !Rabs_pos_eq.
field.
split ; apply (not_INR _ 0), sym_not_eq, O_S.
change 4 with (INR 2 * INR 2).
repeat apply Rmult_le_pos ; apply pos_INR.
by apply pow2_ge_0.
change 4 with (INR 2 * INR 2).
apply Rgt_not_eq ; repeat apply Rmult_lt_0_compat ;
apply lt_0_INR, Nat.lt_0_succ.
repeat split.
apply pow_nonzero, Rgt_not_eq ; repeat apply Rmult_lt_0_compat ; apply Rlt_0_2.
by apply INR_fact_neq_0.
by apply INR_fact_neq_0.
by apply Rgt_not_eq, lt_0_INR, Nat.lt_0_succ.
by apply Rgt_not_eq, lt_0_INR, Nat.lt_0_succ.
by apply pow_nonzero, Rlt_not_eq, (IZR_lt (-1) 0).
rewrite -pow_mult ; by apply pow_nonzero.
evar_last.
apply is_lim_seq_scal_l.
apply is_lim_seq_inv.
eapply is_lim_seq_mult.
apply -> is_lim_seq_incr_1.
by apply is_lim_seq_INR.
apply is_lim_seq_ext with (fun k => INR (k + S n)).
intros k.
by rewrite (Nat.add_comm n k) plus_n_Sm.
apply is_lim_seq_incr_n.
by apply is_lim_seq_INR.
by [].
by [].
simpl ; apply f_equal ; ring.
apply ex_pseries_ext with (fun _ => 0).
intros k.
rewrite /PS_decr_n /=.
replace (n + (k + (k + 0) + 1))%nat with (n + 2 * k + 1)%nat by ring.
by rewrite (proj1 H0).
eapply ex_series_ext.
intros k.
rewrite /scal /= /mult /= Rmult_0_r.
reflexivity.
exists 0 ; apply filterlim_ext with (fun _ => 0).
elim => /= [ | k IH].
by rewrite sum_O.
by rewrite sum_Sn plus_zero_r.
by apply filterlim_const.
by apply pow_nonzero, Rgt_not_eq, Rlt_0_2.
by apply Rgt_not_eq, Rlt_0_2.
by apply H0.
Qed.
coquelicot-coquelicot-3.4.1/examples/DAlembert.v 0000664 0000000 0000000 00000016707 14551434325 0021720 0 ustar 00root root 0000000 0000000 (**
This file is part of the Coquelicot formalization of real
analysis in Coq: http://coquelicot.saclay.inria.fr/
Copyright (C) 2011-2015 Sylvie Boldo
#
#
Copyright (C) 2011-2015 Catherine Lelay
#
#
Copyright (C) 2011-2015 Guillaume Melquiond
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 3 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
COPYING file for more details.
*)
From Coq Require Import Reals ssreflect.
From Coquelicot Require Import Rcomplements Derive RInt Hierarchy Derive_2d AutoDerive.
(** This file aims at proving that d'Alembert's formula defines a
function that is solution to the one-dimensional wave equation. We
also need to prove the regularity of this function. *)
Local Open Scope R_scope.
Ltac auto_derive_2 :=
match goal with
| |- is_derive_n ?f 2 ?x ?d =>
auto_derive_fun f ;
match goal with
| |- (forall x, _ -> is_derive _ x (@?d x)) -> _ =>
let H := fresh "H" in
let u := fresh "u" in
intro H ;
apply (is_derive_ext d) ;
[ intro u ;
apply sym_eq, is_derive_unique ;
apply H
| auto_derive ] ;
clear H
end
end.
Section DAlembert.
Parameter c : R.
Hypothesis Zc : c <> 0.
Parameter u0 : R -> R.
Hypothesis Du0 : forall x, ex_derive (fun u => u0 u) x.
Hypothesis D2u0 : forall x, ex_derive_n (fun u => u0 u) 2 x.
Section Alpha.
Definition alpha x t := 1/2 * (u0 (x + c * t) + u0 (x - c * t)).
Definition alpha20 x t := 1/2 * (Derive_n u0 2 (x + c * t) + Derive_n u0 2 (x - c * t)).
Definition alpha02 x t := c^2/2 * (Derive_n u0 2 (x + c * t) + Derive_n u0 2 (x - c * t)).
Lemma alpha_20_lim :
forall x t, is_derive_n (fun u => alpha u t) 2 x (alpha20 x t).
Proof.
intros x t.
unfold alpha.
auto_derive_2.
repeat split ; apply Du0.
repeat split ; apply D2u0.
unfold alpha20, Derive_n, Rminus.
ring.
Qed.
Lemma alpha_02_lim :
forall x t, is_derive_n (fun u => alpha x u) 2 t (alpha02 x t).
Proof.
intros x t.
unfold alpha.
auto_derive_2.
repeat split ; apply Du0.
repeat split ; apply D2u0.
unfold alpha02, Derive_n, Rminus, Rdiv.
ring.
Qed.
End Alpha.
Parameter u1 : R -> R.
Hypothesis Du1 : forall x, ex_derive (fun u => u1 u) x.
Lemma Cu1 : forall x, continuity_pt (fun u => u1 u) x.
intros x.
destruct (Du1 x) as (l,Hl).
apply derivable_continuous_pt.
unfold derivable_pt, derivable_pt_abs.
exists l.
now apply is_derive_Reals.
Qed.
Lemma continuity_implies_ex_Rint: forall f a b,
(forall x, continuity_pt f x) -> ex_RInt f a b.
intros f a b H.
case (Rle_or_lt a b); intros H1.
apply ex_RInt_Reals_1.
apply continuity_implies_RiemannInt.
exact H1.
intros x _; apply H.
apply ex_RInt_swap.
apply ex_RInt_Reals_1.
apply continuity_implies_RiemannInt.
left; exact H1.
intros x _; apply H.
Qed.
Lemma Iu1: forall a b, ex_RInt (fun u => u1 u) a b.
intros a b.
apply continuity_implies_ex_Rint.
apply Cu1.
Qed.
Section Beta.
Definition beta (x t : R) := 1/(2*c) * RInt (fun u => u1 u) (x - c * t) (x + c * t).
Definition beta20 x t := 1/(2*c) * (Derive (fun u => u1 u) (x + c * t) - Derive (fun u => u1 u) (x - c * t)).
Definition beta01 x t := 1/2 * (u1 (x + c * t) + u1 (x - c * t)).
Definition beta02 x t := c/2 * (Derive (fun u => u1 u) (x + c * t) - Derive (fun u => u1 u) (x - c * t)).
Lemma beta20_lim :
forall x t, is_derive_n (fun u => beta u t) 2 x (beta20 x t).
Proof.
intros x t.
unfold beta.
auto_derive_2.
(* . *)
split.
apply Iu1.
repeat split.
apply filter_forall.
apply Cu1.
apply filter_forall.
apply Cu1.
repeat split ; apply Du1.
unfold beta20, Rminus.
ring.
Qed.
Lemma beta01_lim :
forall x t, is_derive (fun u => beta x u) t (beta01 x t).
Proof.
intros x t.
unfold beta.
auto_derive.
split.
apply Iu1.
repeat split.
apply filter_forall.
apply Cu1.
apply filter_forall.
apply Cu1.
unfold beta01, Rminus, Rdiv.
now field.
Qed.
Lemma beta02_lim :
forall x t, is_derive_n (fun u => beta x u) 2 t (beta02 x t).
Proof.
intros x t.
unfold beta.
auto_derive_2.
split.
apply Iu1.
repeat split.
apply filter_forall.
apply Cu1.
apply filter_forall.
apply Cu1.
repeat split ; apply Du1.
unfold beta02, Rminus, Rdiv.
now field.
Qed.
End Beta.
Hypothesis f : R -> R -> R.
Section Gamma.
Definition gamma x t := 1/(2*c) * RInt (fun tau => RInt (fun xi => f xi tau) (x - c * (t - tau)) (x + c * (t - tau))) 0 t.
Definition gamma20 x t := 1/(2*c) * RInt (fun tau => Derive (fun u => f u tau) (x + c * (t - tau)) - Derive (fun u => f u tau) (x - c * (t - tau))) 0 t.
Definition gamma02 x t := (f x t + c/2 * RInt (fun tau => Derive (fun u => f u tau) (x + c * (t - tau)) - Derive (fun u => f u tau) (x - c * (t - tau))) 0 t).
Lemma gamma20_lim :
forall x t, is_derive_n (fun u => gamma u t) 2 x (gamma20 x t).
Proof.
intros x t.
unfold gamma.
auto_derive_2.
repeat split.
exists (mkposreal _ Rlt_0_1).
simpl.
intros t' u' _ _.
repeat split.
apply continuity_implies_ex_Rint => y.
admit. (* cont 2D -> 1D *)
apply filter_forall => y.
admit. (* cont 2D -> 1D *)
apply filter_forall => y.
admit. (* cont 2D -> 1D *)
apply filter_forall => y.
apply continuity_implies_ex_Rint => z.
apply derivable_continuous_pt.
admit. (* ??? *)
intros t' _.
admit.
repeat split.
exists (mkposreal _ Rlt_0_1).
intros t' u' _ _.
repeat split.
admit.
admit.
apply filter_forall => y.
admit.
intros t' _.
admit.
unfold gamma20.
apply f_equal.
apply RInt_ext => z _.
now rewrite 4!Rmult_1_l.
Admitted.
Lemma gamma02_lim :
forall x t, is_derive_n (fun u => gamma x u) 2 t (gamma02 x t).
Proof.
intros x t.
unfold gamma.
auto_derive_2.
repeat split.
apply locally_2d_forall => y z.
admit.
intros t' _.
admit.
apply filter_forall => y.
admit.
apply filter_forall => y.
apply continuity_implies_ex_Rint => z.
admit.
exists (mkposreal _ Rlt_0_1).
simpl.
apply filter_forall => y.
apply continuity_implies_ex_Rint => z.
admit.
exists (mkposreal _ Rlt_0_1).
simpl.
intros t' u' _ _.
repeat split.
apply continuity_implies_ex_Rint => y.
admit.
apply filter_forall => y.
admit.
apply filter_forall => y.
admit.
repeat split.
apply locally_2d_forall => y z.
admit.
apply locally_2d_forall => y z.
admit.
intros x' _.
admit.
apply filter_forall => y.
admit.
apply filter_forall => y.
admit.
apply filter_forall => y.
apply continuity_implies_ex_Rint => z.
admit.
exists (mkposreal _ Rlt_0_1).
apply filter_forall => y.
apply continuity_implies_ex_Rint => z.
admit.
exists (mkposreal _ Rlt_0_1).
apply filter_forall => y.
apply continuity_implies_ex_Rint => z.
admit.
exists (mkposreal _ Rlt_0_1).
intros t' u' _ _.
admit.
apply locally_2d_forall => y z.
admit.
intros t' _.
admit.
apply filter_forall => y.
admit.
apply filter_forall => y.
apply continuity_implies_ex_Rint => z.
admit.
exists (mkposreal _ Rlt_0_1).
apply filter_forall => y.
apply continuity_implies_ex_Rint => z.
admit.
exists (mkposreal _ Rlt_0_1).
intros t' u' _ _.
repeat split.
admit.
admit.
unfold gamma02.
ring_simplify.
rewrite Rplus_opp_r Rmult_0_r Ropp_0 Rplus_0_r.
rewrite RInt_point Rmult_0_r Rplus_0_r.
apply Rplus_eq_reg_l with (- f x t).
field_simplify.
2: exact Zc.
rewrite Rmult_1_r.
rewrite /Rdiv Rmult_comm.
rewrite Rmult_assoc (Rmult_comm _ (/2)) -Rmult_assoc.
rewrite -[Rmult]/(@scal _ R_ModuleSpace) -RInt_scal.
rewrite -RInt_scal.
apply RInt_ext => u _.
rewrite /scal /= /mult /= /Rminus.
now field.
admit.
admit.
Admitted.
End Gamma.
End DAlembert.
coquelicot-coquelicot-3.4.1/remake.cpp 0000664 0000000 0000000 00000242416 14551434325 0020022 0 ustar 00root root 0000000 0000000 /* -*- mode: C++; indent-tabs-mode: t; c-basic-offset: 8; -*- */
/**
@mainpage Remake, a build system that bridges the gap between make and redo.
As with make, remake uses a centralized rule file, which is
named Remakefile. It contains rules with a make-like
syntax:
@verbatim
target1 target2 ... : prerequisite1 prerequisite2 ...
shell script
that builds
the targets
@endverbatim
A target is known to be up-to-date if all its prerequisites are. If it
has no known prerequisites yet the file already exits, it is assumed to
be up-to-date. Obsolete targets are rebuilt thanks to the shell script
provided by the rule.
As with redo, remake supports dynamic dependencies in
addition to these static dependencies. Whenever a script executes
`remake prerequisite4 prerequisite5 ...`, these prerequisites are
rebuilt if they are obsolete. (So remake acts like
redo-ifchange.) Moreover, all the dependencies are stored in file
.remake so that they are remembered in subsequent runs. Note that
dynamic dependencies from previous runs are only used to decide whether a
target is obsolete; they are not automatically rebuilt when they are
obsolete yet a target depends on them. They will only be rebuilt once the
dynamic call to remake is executed.
In other words, the following two rules have almost the same behavior.
@verbatim
target1 target2 ... : prerequisite1 prerequisite2 ...
shell script
target1 target2 ... :
remake prerequisite1 prerequisite2 ...
shell script
@endverbatim
(There is a difference if the targets already exist, have never been
built before, and the prerequisites are either younger or obsolete, since
the targets will not be rebuilt in the second case.)
The above usage of dynamic dependencies is hardly useful. Their strength
lies in the fact that they can be computed on the fly:
@verbatim
%.o : %.c
gcc -MMD -MF $@.d -o $@ -c $<
remake -r < $@.d
rm $@.d
%.cmo : %.ml
ocamldep $< | remake -r $@
ocamlc -c $<
after.xml: before.xml rules.xsl
xsltproc --load-trace -o after.xml rules.xsl before.xml 2> deps
remake `sed -n -e "\\,//,! s,^.*URL=\"\\([^\"]*\\).*\$,\\1,p" deps`
rm deps
@endverbatim
Note that the first rule fails if any of the header files included by
a C source file has to be automatically generated. In that case, one
should perform a first call to remake them before calling the
compiler. (Dependencies from several calls to remake are
cumulative, so they will all be remembered the next time.)
\section sec-usage Usage
Usage: remake options targets
Options:
- `-B`, `--always-make`: Unconditionally make all targets.
- `-d`: Echo script commands.
- `-f FILE`: Read `FILE` as Remakefile.
- `-j[N]`, `--jobs=[N]`: Allow `N` jobs at once;
infinite jobs with no argument.
- `-k`, `--keep-going`: Keep going when some targets cannot be made.
- `-r`: Look up targets from the dependencies on standard input.
- `-s`, `--silent`, `--quiet`: Do not echo targets.
\section sec-syntax Syntax
Lines starting with a space character or a tabulation are assumed to be rule
scripts. They are only allowed after a rule header.
Lines starting with `#` are considered to be comments and are ignored.
They do interrupt rule scripts though.
Any other line is either a variable definition or a rule header. If such a
line ends with a backslash, the following line break is ignored and the line
extends to the next one.
Variable definitions are a single name followed by equal followed by a list
of names, possibly empty.
Rule headers are a nonempty list of names, followed by a colon, followed by
another list of names, possibly empty. Basically, the syntax of a rule is as
follows:
@verbatim
targets : prerequisites
shell script
@endverbatim
List of names are space-separated sequences of names. If a name contains
a space character, it should be put into double quotes. Names cannot be
any of the following special characters `:$(),="`. Again, quotation
should be used. Quotation marks can be escaped by a backslash inside
quoted names.
\subsection sec-variables Variables
Variables can be used to factor lists of targets or prerequisites. They are
expanded as they are encountered during Remakefile parsing.
@verbatim
VAR2 = a
VAR1 = c d
VAR2 += $(VAR1) b
$(VAR2) e :
@endverbatim
Variable assignments can appear instead of prerequisites inside non-generic
rules with no script. They are then expanded inside the corresponding
generic rule.
@verbatim
foo.o: CFLAGS += -DBAR
%.o : %.c
gcc $(CFLAGS) -MMD -MF $@.d -o $@ -c $<
remake -r < $@.d
rm $@.d
@endverbatim
Note: contrarily to make, variable names have to be enclosed in
parentheses. For instance, `$y` is not a shorthand for \$(y) and
is left unexpanded.
\subsection sec-autovars Automatic variables
The following special symbols can appear inside scripts:
- `$<` expands to the first static prerequisite of the rule.
- `$^` expands to all the static prerequisites of the rule, including
duplicates if any.
- `$@` expands to the first target of the rule.
- `$*` expands to the string that matched `%` in a generic rule.
- `$$` expands to a single dollar symbol.
Note: contrarily to make, there are no corresponding variables.
For instance, `$^` is not a shorthand for `$(^)`. Another difference is
that `$@` is always the first target, not the one that triggered the
rule.
\subsection sec-functions Built-in functions
remake also supports a few built-in functions inspired from make.
- $(addprefix prefix, list) returns the list obtained
by prepending its first argument to each element of its second argument.
- $(addsuffix suffix, list) returns the list obtained
by appending its first argument to each element of its second argument.
\subsection sec-order Order-only prerequisites
If the static prerequisites of a rule contain a pipe symbol, prerequisites
on its right do not cause the targets to become obsolete if they are newer
(unless they are also dynamically registered as dependencies). They are
meant to be used when the targets do not directly depend on them, but the
computation of their dynamic dependencies does.
@verbatim
%.o : %.c | parser.h
gcc -MMD -MF $@.d -o $@ -c $<
remake -r < $@.d
rm $@.d
parser.c parser.h: parser.y
yacc -d -o parser.c parser.y
@endverbatim
\subsection sec-static-pattern Static pattern rules
A rule with the following structure is expanded into several rules, one
per target.
@verbatim
targets: pattern1 pattern2 ...: prerequisites
@endverbatim
Every target is matched against one of the patterns containing the `%`
character. A rule is then created using the patterns as targets, after
having substituted `%` in the patterns and prerequisites. The automatic
variable `$*` can be used in the script of the rule.
\subsection sec-special-tgt Special targets
Target `.PHONY` marks its prerequisites as being always obsolete.
\subsection sec-special-var Special variables
Variable `.OPTIONS` is handled specially. Its content enables some
features of remake that are not enabled by default.
- `variable-propagation`: When a variable is set in the prerequisite
part of a rule, it is propagated to the rules of all the targets this rule
depends on. This option also enables variables to be set on the command
line. Note that, as in make, this features introduces non-determinism:
the content of some variables will depend on the build order.
\section sec-semantics Semantics
\subsection src-obsolete When are targets obsolete?
A target is obsolete:
- if there is no file corresponding to the target, or to one of its siblings
in a multi-target rule,
- if any of its dynamic prerequisites from a previous run or any of its static
prerequisites is obsolete,
- if the latest file corresponding to its siblings or itself is older than any
of its dynamic prerequisites or static prerequisites.
In all the other cases, it is assumed to be up-to-date (and so are all its
siblings). Note that the last rule above says "latest" and not "earliest". While
it might cause some obsolete targets to go unnoticed in corner cases, it allows
for the following kind of rules:
@verbatim
config.h stamp-config_h: config.h.in config.status
./config.status config.h
touch stamp-config_h
@endverbatim
A `config.status` file generally does not update header files (here
`config.h`) if they would not change. As a consequence, if not for the
`stamp-config_h` file above, a header would always be considered obsolete
once one of its prerequisites is modified. Note that touching `config.h`
rather than `stamp-config_h` would defeat the point of not updating it in
the first place, since the program files would need to be rebuilt.
Once all the static prerequisites of a target have been rebuilt, remake
checks whether the target still needs to be built. If it was obsolete only
because its prerequisites needed to be rebuilt and none of them changed, the
target is assumed to be up-to-date.
\subsection sec-rules How are targets (re)built?
There are two kinds of rules. If any of the targets or prerequisites contains
a `%` character, the rule is said to be generic. All the
targets of the rule shall then contain a single `%` character. All the
other rules are said to be specific.
A rule is said to match a given target:
- if it is specific and the target appears inside its target list,
- if it is generic and there is a way to replace the `%` character
from one of its targets so that it matches the given target.
When remake tries to build a given target, it looks for a specific rule
that matches it. If there is one and its script is nonempty, it uses it to
rebuild the target.
Otherwise, it looks for a generic rule that matches the target. If there are
several matching rules, it chooses the one with the shortest pattern (and if
there are several ones, the earliest one). It then looks for specific rules
that match each target of the generic rule. All the prerequisites of these
specific rules are added to those of the generic rule. The script of the
generic rule is used to build the target.
Example:
@verbatim
t%1 t2%: p1 p%2
commands building t%1 and t2%
t2z: p4
commands building t2z
ty1: p3
# t2x is built by the first rule (which also builds tx1) and its prerequisites are p1, px2
# t2y is built by the first rule (which also builds ty1) and its prerequisites are p1, py2, p3
# t2z is built by the second rule and its prerequisite is p4
@endverbatim
The set of rules from Remakefile is ill-formed:
- if any specific rule matching a target of the generic rule has a nonempty script,
- if any target of the generic rule is matched by a generic rule with a shorter pattern.
\section sec-compilation Compilation
- On Linux, MacOSX, and BSD: `g++ -o remake remake.cpp`
- On Windows: `g++ -o remake.exe remake.cpp -lws2_32`
Installing remake is needed only if Remakefile does not
specify the path to the executable for its recursive calls. Thanks to its
single source file, remake can be shipped inside other packages and
built at configuration time.
\section sec-differences Differences with other build systems
Differences with make:
- Dynamic dependencies are supported.
- For rules with multiple targets, the shell script is executed only once
and is assumed to build all the targets. There is no need for
convoluted rules that are robust enough for parallel builds. For generic
rules, this is similar to the behavior of pattern rules from gmake.
- As with redo, only one shell is run when executing a script,
rather than one per script line. Note that the shells are run with
option `-e`, thus causing them to exit as soon as an error is
encountered.
- The prerequisites of generic rules (known as implicit rules in make
lingo) are not used to decide between several of them, which means that
remake does not select one for which it could satisfy the dependencies.
- Variables and built-in functions are expanded as they are encountered
during Remakefile parsing.
- Target-specific variables are not propagated, unless specifically enabled,
since this causes non-deterministic builds. This is the same for variables
set on the command line.
Differences with redo:
- As with make, it is possible to write the following kind of rules
in remake.
@verbatim
Remakefile: Remakefile.in ./config.status
./config.status Remakefile
@endverbatim
- If a target is already built the first time remake runs, it still
uses the static prerequisites of rules mentioning it to check whether it
needs to be rebuilt. It does not assume it to be up-to-date. As with
redo though, if its obsolete status would be due to a dynamic
prerequisite, it will go unnoticed; it should be removed beforehand.
- Multiple targets are supported.
- remake has almost no features: no checksum-based dependencies, no
compatibility with job servers, etc.
\section sec-limitations Limitations
- If a rule script calls remake, the current working directory should
be the directory containing Remakefile (or the working directory
from the original remake if it was called with option `-f`).
- As with make, variables passed on the command line should keep
the same values, to ensure deterministic builds.
- Some cases of ill-formed rules are not caught by remake and can
thus lead to unpredictable behaviors.
\section sec-links Links
@see http://cr.yp.to/redo.html for the philosophy of redo and
https://github.com/apenwarr/redo for an implementation and some comprehensive documentation.
\section sec-licensing Licensing
@author Guillaume Melquiond
@version 0.15
@date 2012-2020
@copyright
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
\n
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
\section sec-internals Internals
The parent remake process acts as a server. The other ones have a
REMAKE_SOCKET environment variable that tells them how to contact the
server. They send the content of the REMAKE_JOB_ID environment variable,
so that the server can associate the child targets to the jobs that
spawned them. They then wait for completion and exit with the status
returned by the server. This is handled by #client_mode.
The server calls #load_dependencies and #save_dependencies to serialize
dynamic dependencies from .remake. It loads Remakefile with
#load_rules. It then runs #server_mode, which calls #server_loop.
When building a target, the following sequence of events happens:
- #start calls #find_rule (and #find_generic_rule) to get the rule.
- It then creates a pseudo-client if the rule has static dependencies, or
calls #run_script otherwise. In both cases, a new job is created; the
rule and the variables are stored into #jobs.
- #run_script creates a shell process and stores it in #job_pids. It
increases #running_jobs.
- The child process possibly calls remake with a list of targets.
- #accept_client receives a build request from a child process and adds
it to #clients. It also records the new dependencies of the job into
#dependencies. It increases #waiting_jobs.
- #handle_clients uses #get_status to look up the obsoleteness of the
targets.
- Once the targets of a request have been built or one of them has failed,
#handle_clients calls #complete_request and removes the request from
#clients.
- If the build targets come from a pseudo-client, #complete_request calls
#run_script. Otherwise it sends the reply to the corresponding child
process and decreases #waiting_jobs.
- When a child process ends, #server_loop calls #finalize_job, which
removes the process from #job_pids, decreases #running_jobs, and calls
#complete_job.
- #complete_job removes the job from #jobs and calls #update_status
to change the status of the targets. It also removes the target files in
case of failure.
*/
#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
#define WINDOWS
#endif
#include
#include
#include
#include