diff --git a/.cvsignore b/.cvsignore deleted file mode 100644 index 398807ecb..000000000 --- a/.cvsignore +++ /dev/null @@ -1,6 +0,0 @@ -.glob -.depend -.docdepend -.doclist -bin -lib diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 8add30ad5..000000000 --- a/LICENSE +++ /dev/null @@ -1,504 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. 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 not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the 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 -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - 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 2.1 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 GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! - - diff --git a/Makefile.common b/Makefile.common index fd401b83e..0666bce1b 100644 --- a/Makefile.common +++ b/Makefile.common @@ -17,7 +17,7 @@ endif SHELL:=bash -O nullglob # realpath utility to use -REALPATH := $(shell if ! which realpath 2>/dev/null; then $(MAKE) -f "$(SRCDIR)/Makefile.realpath" -s TOPDIR="$(TOPDIR)" realpath; echo "$(SRCDIR)/bin/realpath"; fi) +REALPATH := $(shell if ! type -p realpath 2>/dev/null; then $(MAKE) -f "$(SRCDIR)/Makefile.realpath" -s TOPDIR="$(TOPDIR)" realpath; echo "$(SRCDIR)/bin/realpath"; fi) SRCDIR:=$(shell "$(REALPATH)" "$(SRCDIR)") @@ -68,9 +68,10 @@ GLOBFILE = $(SRCDIR)/.glob ## End of user-configurable variables ## Please don't edit beyond this line, unless you really know what you are doing -# Various executables we build +# Various executables we build when we need a custom Coq image. +# (Thus currently not.) TOPLEVEL := $(LIBDIR)/$(TOPLEVELNAME) -BINARIES:=$(BINDIR)/$(TOPLEVELNAME) $(BINDIR)/$(COMPILERNAME) +BINARIES:=$(BINDIR)/$(TOPLEVELNAME) $(BINDIR)/$(COMPILERNAME) $(BINDIR)/$(IDENAME) LIBEXECS:=$(LIBDIR)/$(TOPLEVELNAME) $(LIBDIR)/$(COMPILERNAME) IDELIB:=$(LIBDIR)/$(IDENAME) IDEBIN:=$(BINDIR)/$(IDENAME) @@ -98,6 +99,7 @@ COQSRC:=-I $(COQTOP)/kernel -I $(COQTOP)/lib \ -I $(COQTOP)/contrib/ring -I $(COQTOP)/contrib/xml \ -I $(CAMLP4LIB) COQC := $(COQBIN)/coqc +COQIDE := $(COQBIN)/coqide COQDEP := $(COQBIN)/coqdep COQMKTOP := $(COQBIN)/coqmktop GRAMMARS:=grammar.cma @@ -107,7 +109,7 @@ PP:=-pp "camlp4o -I $(SRCDIR)/tactics -I $(COQTOP)/parsing $(CAMLP4EXTEND) $(GRA COQMAP = -R $(SRCDIR) $(LIBNAME) OTHERFLAGS = -dump-glob $(GLOBFILE) -I $(SRCDIR)/tactics $(COQMAP) COQFLAGS = $(COQ_XML) $(OPT) $(OTHERFLAGS) -COQCFLAGS = -image $(TOPLEVEL) +COQCFLAGS = COQDOCFLAGS = --toc -s -t "C-CoRN Documentation" $(COQMAP) \ --glob-from $(GLOBFILE) -g -l --multi-index --files-from $(DOCLIST) COQDEPFLAGS := $(shell echo $(COQDIRS) | awk -v RS=' ' -v ORS=' ' -v pwd="`pwd`" '{ if ( $$1 != pwd ) print "-I " $$1}') @@ -123,7 +125,7 @@ ifdef CoRN_MF_sub all : $(COQOBJECTS) else all : - $(MAKE) CoRN_MF_sub=1 all + exec $(MAKE) CoRN_MF_sub=1 all endif # Convenience utilities for humans @@ -137,7 +139,7 @@ makefiles : $(AUTO_MAKEFILES) $(AUTO_MAKEFILES) : @set -e; if ! [ -a $@ ]; then \ - depth="`echo -n "$(patsubst $(SRCDIR)/%,%,$@)" | sed 's|[^/]||g' | wc -c | sed 's|[[:space:]]||g'`"; \ + depth=$$(echo '$(patsubst $(SRCDIR)/%,%,$@)' | awk '{ print gsub("/","/") }'); \ model="$(SRCDIR)/Makefile.auto.$${depth}"; \ if ! [ -a "$${model}" ]; then \ ( echo -n 'TOPDIR=..'; i=1; \ @@ -167,36 +169,36 @@ $(IDELIB): $(CMX) | $(LIBDIR) @echo Building coq-ide top-level $(subst $(SRCDIR)/,, $@) @$(COQMKTOP) -ide -srcdir $(COQTOP) -ide -opt -o $@ $(CMX) -$(IDEBIN): | $(BINDIR) $(IDELIB) +$(IDEBIN): | $(BINDIR) @echo Building coq-ide top-level startup script @set -e; ( \ echo '#!/bin/sh'; \ - echo 'exec $(LIBDIR)/$(IDENAME) $(COQFLAGS) $$*' \ + echo 'exec "$(COQIDE)" $(COQFLAGS) "$$@"' \ ) > $@; chmod +x $@ $(LIBDIR)/$(TOPLEVELNAME): $(CMX) | $(LIBDIR) @echo Building top-level $(subst $(SRCDIR)/,,$@) @$(COQMKTOP) -srcdir $(COQTOP) -opt -o $@ $(CMX) -$(BINDIR)/$(TOPLEVELNAME): | $(BINDIR) $(LIBDIR)/$(TOPLEVELNAME) +$(BINDIR)/$(TOPLEVELNAME): | $(BINDIR) @echo Building top-level startup script @set -e; ( \ echo '#!/bin/sh'; \ - echo 'exec $(TOPLEVEL) $(COQFLAGS) $$*' \ + echo 'exec "$(COQBIN)/coqtop" $(COQFLAGS) "$$@"' \ ) > $@; chmod +x $@ $(LIBDIR)/$(COMPILERNAME): | $(LIBDIR) $(LIBDIR)/$(TOPLEVELNAME) @echo Building compiler $(subst $(SRCDIR)/,, $@) @set -e; ( \ echo '#!/bin/sh'; \ - echo 'exec $(COQC) $(COQCFLAGS) $$*' \ + echo 'exec $(COQC) $(COQCFLAGS) "$$@"' \ ) > $@; chmod +x $@ -$(BINDIR)/$(COMPILERNAME): | $(BINDIR) $(LIBDIR)/$(COMPILERNAME) +$(BINDIR)/$(COMPILERNAME): | $(BINDIR) @echo Building compiler startup script @set -e; ( \ echo '#!/bin/sh'; \ - echo 'exec $(LIBDIR)/$(COMPILERNAME) $(COQFLAGS) $$*' \ + echo 'exec "$(COQC)" $(COQFLAGS) "$$@"' \ ) > $@; chmod +x $@ %.cmx : %.ml @@ -208,10 +210,10 @@ $(BINDIR)/$(COMPILERNAME): | $(BINDIR) $(LIBDIR)/$(COMPILERNAME) @$(OCAMLC) -c $(COQSRC) $(PP) $< ifdef CoRN_MF_sub -%.vo : %.v $(TOPLEVEL) +%.vo : %.v @set -e; \ echo "Compiling $<"; \ - $(COQC) $(COQFLAGS) $(COQCFLAGS) $< + exec $(COQC) $(COQFLAGS) $(COQCFLAGS) $< else .PHONY: always @@ -226,7 +228,7 @@ else fi \ }; \ canon_name="$$(canonicalise "$@")" ; \ - $(MAKE) CoRN_MF_sub=1 "$${canon_name}" + exec $(MAKE) CoRN_MF_sub=1 "$${canon_name}" endif dep : $(DEPEND) $(DOCDEPEND) diff --git a/Makefile.realpath b/Makefile.realpath index dc05b2b17..670ddc125 100644 --- a/Makefile.realpath +++ b/Makefile.realpath @@ -2,6 +2,7 @@ SRCDIR=$(shell pwd)/$(TOPDIR) BINDIR=$(SRCDIR)/bin +CFLAGS:=-O3 -DVERSION='"1.9.25"' $(CFLAGS) .PHONY : realpath clean diff --git a/README b/README index 1d20cac2a..36e24debb 100644 --- a/README +++ b/README @@ -11,8 +11,9 @@ A (no longer updated) version compatible with version 7.4 is also available. Before installing C-CoRN, please check that you have: - - Coq version 8.0 (a compiled source tree, not only a binary package) - - the OCaml you used to compile Coq + - Coq version 8.0 + (CoRN used to require a compiled source tree, but a binary package will + do these days.) - at least 128MiB RAM memory available (and preferably more, especially if you plan to use the formalization of Real Analysis). - GNU make version 3.80 or later @@ -20,11 +21,15 @@ Before installing C-CoRN, please check that you have: thereof or a good emulation layer on top of another OS. In particular, *hard* links must be supported by the file system. - the GNU Bourne Again SHell (we use some bashisms) + - At least one of: + * The "realpath" utility in your PATH (Debian package realpath). + * A C compiler. In order for C-CoRN to work, you need to set some environment variables. We advise you to do this inside a .bash_profile or similar. - - COQTOP should be set to the location of the Coq sources (e.g. - /usr/local/src/coq-8.0/) + - COQTOP should be set to the Coq installation prefix (e.g. /usr/ or + /usr/local/) or the location of a compiled Coq source tree (e.g. + /usr/local/src/coq-8.0/). - COQBIN should be set to the directory where the Coq binaries can be found, if different from ${COQTOP}/bin/. @@ -113,23 +118,26 @@ are recognized. OCAMLC=file OCAMLOPT=file -> Choose an ocamlc and ocamlopt to use + (Obsolete, as CoRN does not use OCaml anymore.) COQDOC=file -> Choose a coqdoc to use HUMAN CONVENIENCE ----------------- CoRN now has a few facilities for the convenience of the human beings -using it. Enable with "make human", or "make ide" for coqide support -(this needs a coqide-enabled Coq). +using it. Enable with "make human". This will create Makefiles in every directory scanned for .v files (but will not overwrite the Makefile if any is present) so that all make commands work from anywhere in the CoRN hierarchy. -It also populates the "bin" directory with CoRNc, CoRNtop and (with -coqide support) CoRNide. These are CoRN versions of coqc, coqtop and -coqide, respectively. We suggest you add the "bin" directory of CoRN -to your PATH. +It also populates the "bin" directory with CoRNc, CoRNtop and +CoRNide. These are CoRN versions of coqc, coqtop and coqide, +respectively. We suggest you add the "bin" directory of CoRN to your +PATH. + +The old "ide" target is obsolete, as CoRN does not require a custom +Coq image anymore. DEPENDENCIES ------------ @@ -147,5 +155,5 @@ For any questions, comments, bug reports or other feel free to e-mail lcf@cs.kun.nl. $Id$ - + LocalWords: Nijmegen CoRN Coq CVS diff --git a/algebra/Basics.v b/algebra/Basics.v index c79e90117..4bf5d15d4 100644 --- a/algebra/Basics.v +++ b/algebra/Basics.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) (** printing alpha %\ensuremath{\alpha}% #α# *) diff --git a/algebra/CAbGroups.v b/algebra/CAbGroups.v index 96431ef74..5d3649a70 100644 --- a/algebra/CAbGroups.v +++ b/algebra/CAbGroups.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - Require Export CGroups. Section Abelian_Groups. @@ -253,24 +237,24 @@ Fixpoint nmult (a:G) (n:nat) {struct n} : G := Lemma nmult_wd : forall (x y:G) (n m:nat), (x [=] y) -> n = m -> nmult x n [=] nmult y m. simple induction n; intros. -rewrite <- H0; Algebra. -rewrite <- H1; simpl in |- *; Algebra. +rewrite <- H0; algebra. +rewrite <- H1; simpl in |- *; algebra. Qed. Lemma nmult_one : forall x:G, nmult x 1 [=] x. -simpl in |- *; Algebra. +simpl in |- *; algebra. Qed. Lemma nmult_Zero : forall n:nat, nmult Zero n [=] Zero. intro n. induction n. - Algebra. + algebra. simpl in |- *; Step_final ((Zero:G)[+]Zero). Qed. Lemma nmult_plus : forall m n x, nmult x m[+]nmult x n [=] nmult x (m + n). simple induction m. - simpl in |- *; Algebra. + simpl in |- *; algebra. clear m; intro m. intros. simpl in |- *. Step_final (x[+](nmult x m[+]nmult x n)). @@ -278,25 +262,25 @@ Qed. Lemma nmult_mult : forall n m x, nmult (nmult x m) n [=] nmult x (m * n). simple induction n. - intro. rewrite mult_0_r. Algebra. + intro. rewrite mult_0_r. algebra. clear n; intros. simpl in |- *. rewrite mult_comm. simpl in |- *. eapply eq_transitive_unfolded. 2: apply nmult_plus. -rewrite mult_comm. Algebra. +rewrite mult_comm. algebra. Qed. Lemma nmult_inv : forall n x, nmult [--]x n [=] [--] (nmult x n). intro; induction n; simpl in |- *. - Algebra. + algebra. intros. Step_final ([--]x[+] [--](nmult x n)). Qed. Lemma nmult_plus' : forall n x y, nmult x n[+]nmult y n [=] nmult (x[+]y) n. intro; induction n; simpl in |- *; intros. - Algebra. + algebra. astepr (x[+]y[+](nmult x n[+]nmult y n)). astepr (x[+](y[+](nmult x n[+]nmult y n))). astepr (x[+](y[+]nmult x n[+]nmult y n)). @@ -336,7 +320,7 @@ astepl (nmult x (nat_of_P p)). apply cg_cancel_rht with (nmult x n). astepr (nmult x m). astepl (nmult x (nat_of_P p + n)). -apply nmult_wd; Algebra. +apply nmult_wd; algebra. rewrite <- convert_is_POS in H. auto with zarith. @@ -351,7 +335,7 @@ astepr (nmult x m[+] [--](nmult x m)[+]nmult x n). astepr (Zero[+]nmult x n). astepr (nmult x n). astepl (nmult x (m + nat_of_P p)). -apply nmult_wd; Algebra. +apply nmult_wd; algebra. rewrite <- min_convert_is_NEG in H. auto with zarith. Qed. @@ -359,7 +343,7 @@ Qed. Lemma zmult_wd : forall (x y:G) (n m:Z), (x [=] y) -> n = m -> zmult x n [=] zmult y m. do 3 intro. case n; intros; inversion H0. -Algebra. +algebra. unfold zmult in |- *. simpl in |- *. astepl (nmult x (nat_of_P p)); Step_final (nmult y (nat_of_P p)). @@ -369,7 +353,7 @@ Step_final [--](nmult y (nat_of_P p)). Qed. Lemma zmult_one : forall x:G, zmult x 1 [=] x. -simpl in |- *; Algebra. +simpl in |- *; algebra. Qed. Lemma zmult_min_one : forall x:G, zmult x (-1) [=] [--]x. @@ -377,12 +361,12 @@ intros; simpl in |- *; Step_final (Zero[-]x). Qed. Lemma zmult_zero : forall x:G, zmult x 0 [=] Zero. -simpl in |- *; Algebra. +simpl in |- *; algebra. Qed. Lemma zmult_Zero : forall k:Z, zmult Zero k [=] Zero. intro; induction k; simpl in |- *. - Algebra. + algebra. Step_final ((Zero:G)[-]Zero). Step_final ((Zero:G)[-]Zero). Qed. @@ -442,7 +426,7 @@ Step_final (nmult Zero (nat_of_P p)). astepr [--](Zero:G). astepl [--](nmult (Zero[-]Zero) (nat_of_P p)). Step_final [--](nmult Zero (nat_of_P p)). -Algebra. +algebra. astepr (nmult x (nat_of_P (p * p0))). astepl (nmult (nmult x (nat_of_P p)) (nat_of_P p0)[-]Zero). @@ -454,7 +438,7 @@ astepl (Zero[-]nmult (nmult x (nat_of_P p)) (nat_of_P p0)). astepl [--](nmult (nmult x (nat_of_P p)) (nat_of_P p0)). rewrite nat_of_P_mult_morphism. apply un_op_wd_unfolded. apply nmult_mult. -Algebra. +algebra. astepr [--](nmult x (nat_of_P (p * p0))). astepl (nmult [--](nmult x (nat_of_P p)) (nat_of_P p0)[-]Zero). diff --git a/algebra/CAbMonoids.v b/algebra/CAbMonoids.v index f7ada7a6c..a5c6bed95 100644 --- a/algebra/CAbMonoids.v +++ b/algebra/CAbMonoids.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - Require Export CMonoids. Section Abelian_Monoids. diff --git a/algebra/CFields.v b/algebra/CFields.v index 5aa737b33..3481428d1 100644 --- a/algebra/CFields.v +++ b/algebra/CFields.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) (** printing [/] %\ensuremath{/}% #/# *) @@ -176,7 +160,7 @@ auto. astepl (x[*]One). eapply eq_transitive_unfolded. 2: apply CRings.mult_assoc. -Algebra. +algebra. Qed. Lemma mult_lft_resp_ap : forall x y z : F, x [#] y -> z [#] Zero -> z[*]x [#] z[*]y. @@ -186,7 +170,7 @@ unfold cg_minus in |- *. astepl (z[*]x[+]z[*][--]y). astepl (z[*] (x[+][--]y)). astepl (z[*] (x[-]y)). -apply mult_resp_ap_zero; Algebra. +apply mult_resp_ap_zero; algebra. Qed. Lemma mult_rht_resp_ap : forall x y z : F, x [#] y -> z [#] Zero -> x[*]z [#] y[*]z. @@ -380,7 +364,7 @@ Qed. Lemma f_rcpcl_wd : forall (x y : F) x_ y_, x [=] y -> f_rcpcl x x_ [=] f_rcpcl y y_. intros x y H. -unfold f_rcpcl in |- *; Algebra. +unfold f_rcpcl in |- *; algebra. Qed. Lemma f_rcpcl_mult : forall (y z : F) y_ z_ yz_, @@ -453,7 +437,7 @@ Defined. Lemma plus_nonzeros_eq_mult_dom : forall x y : NonZeroMonoid, scs_elem _ _ (x[+]y) [=] scs_elem _ _ x[*]scs_elem _ _ y. -simple destruct x; simple destruct y; Algebra. +simple destruct x; simple destruct y; algebra. Qed. Lemma cfield_to_mult_cgroup : CGroup. @@ -481,7 +465,7 @@ In the names of lemmas, we denote [[/]] by [div], and Variable F : CField. Lemma div_prop : forall (x : F) x_, (Zero[/] x[//]x_) [=] Zero. -unfold cf_div in |- *; Algebra. +unfold cf_div in |- *; algebra. Qed. Lemma div_1 : forall (x y : F) y_, (x[/] y[//]y_) [*]y [=] x. @@ -530,7 +514,7 @@ The next lemma says $x\cdot\frac{y}{z} = \frac{x\cdot y}{z}$ *) Lemma x_mult_y_div_z : forall (x y z : F) z_, x[*] (y[/] z[//]z_) [=] (x[*]y[/] z[//]z_). -unfold cf_div in |- *; Algebra. +unfold cf_div in |- *; algebra. Qed. Hint Resolve x_mult_y_div_z: algebra. @@ -541,7 +525,7 @@ intros x x' y y' nzy nzy' H H0. unfold cf_div in |- *. cut (f_rcpcl y nzy [=] f_rcpcl y' nzy'). intro H1. -Algebra. +algebra. apply f_rcpcl_wd. assumption. @@ -575,7 +559,7 @@ Qed. Lemma div_resp_ap_zero : forall (x y : F) y_, (x[/] y[//]y_) [#] Zero -> x [#] Zero. intros x y nzy Hxy. -astepl ((x[/] y[//]nzy) [*]y). Algebra. +astepl ((x[/] y[//]nzy) [*]y). algebra. Qed. (** @@ -620,11 +604,11 @@ apply f_rcpcl_mult. Qed. Lemma div_dist : forall (x y z : F) z_, (x[+]y[/] z[//]z_) [=] (x[/] z[//]z_) [+] (y[/] z[//]z_). -unfold cf_div in |- *; Algebra. +unfold cf_div in |- *; algebra. Qed. Lemma div_dist' : forall (x y z : F) z_, (x[-]y[/] z[//]z_) [=] (x[/] z[//]z_) [-] (y[/] z[//]z_). -unfold cf_div in |- *; Algebra. +unfold cf_div in |- *; algebra. Qed. Lemma div_semi_sym : forall (x y z : F) y_ z_, ((x[/] y[//]y_) [/] z[//]z_) [=] ((x[/] z[//]z_) [/] y[//]y_). @@ -695,7 +679,7 @@ Qed. Lemma recip_ap_zero : forall (x : F) x_, (One[/] x[//]x_) [#] Zero. intros; apply cring_mult_ap_zero with x. -astepl (One:F). Algebra. +astepl (One:F). algebra. Qed. Lemma recip_resp_ap : forall (x y : F) x_ y_, x [#] y -> (One[/] x[//]x_) [#] (One[/] y[//]y_). diff --git a/algebra/CGroups.v b/algebra/CGroups.v index 28e744296..ea5778ba6 100644 --- a/algebra/CGroups.v +++ b/algebra/CGroups.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) (** printing [-] %\ensuremath-% #−# *) @@ -100,12 +84,12 @@ Hint Resolve cg_rht_inv_unfolded cg_lft_inv_unfolded cg_minus_correct: Lemma cg_inverse' : forall x : G, is_inverse csg_op Zero [--] x x. intro x. -split; Algebra. +split; algebra. Qed. (* Hints for Auto *) Lemma cg_minus_unfolded : forall x y : G, x [-] y [=] x[+] [--] y. -Algebra. +algebra. Qed. Hint Resolve cg_minus_unfolded: algebra. @@ -194,7 +178,7 @@ Step_final ([--] [--] y). Qed. Lemma cg_zero_inv : [--] (Zero:G) [=] Zero. -apply eq_symmetric_unfolded; apply cg_inv_unique; Algebra. +apply eq_symmetric_unfolded; apply cg_inv_unique; algebra. Qed. Hint Resolve cg_zero_inv: algebra. @@ -239,7 +223,7 @@ Let subcrr : CMonoid := Build_SubCMonoid _ _ Punit op_pres_P. Let subinv : CSetoid_un_op subcrr := Build_SubCSetoid_un_op _ _ _ inv_pres_P. Lemma isgrp_scrr : is_CGroup subcrr subinv. -red in |- *. intro x. case x. intros. split; simpl in |- *; Algebra. +red in |- *. intro x. case x. intros. split; simpl in |- *; algebra. Qed. Definition Build_SubCGroup : CGroup := Build_CGroup subcrr _ isgrp_scrr. @@ -262,13 +246,13 @@ Section Assoc_properties. Variable G : CGroup. Lemma assoc_2 : forall x y z : G, x[+] (y [-] z) [=] x[+]y [-] z. -intros x y z; unfold cg_minus in |- *; Algebra. +intros x y z; unfold cg_minus in |- *; algebra. Qed. Lemma zero_minus : forall x : G, Zero [-] x [=] [--] x. intro x. unfold cg_minus in |- *. -Algebra. +algebra. Qed. Lemma cg_cancel_mixed : forall x y : G, x [=] x [-] y[+]y. @@ -279,7 +263,7 @@ Lemma cg_cancel_mixed : forall x y : G, x [=] x [-] y[+]y. Qed. Lemma plus_resp_eq : forall x y z : G, y [=] z -> x[+]y [=] x[+]z. -Algebra. +algebra. Qed. End Assoc_properties. diff --git a/algebra/CHomomorphism_Theorems.v b/algebra/CHomomorphism_Theorems.v index 6d76c1da9..d45ab4f78 100644 --- a/algebra/CHomomorphism_Theorems.v +++ b/algebra/CHomomorphism_Theorems.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* Homomorphism_Theorems.v, v1.0, 28april2004, Bart Kirkels *) (** printing [+] %\ensuremath+% #+# *) @@ -81,7 +65,7 @@ intros x y X. cut ((sigma x)[+](sigma y)[#]Zero). intro X0. apply cg_add_ap_zero; auto. -astepl (sigma (x[+]y)); Algebra. +astepl (sigma (x[+]y)); algebra. (* cm_mult *) intros x a X. cut ((rm_mu B)a (sigma x)[#]Zero). @@ -115,7 +99,7 @@ Definition tau (x:A) := (x:AdivCs). Lemma tau_strext : fun_strext tau. red in |-*; intros x y; unfold tau; simpl in |-*. unfold ap_quotmod; simpl in |-*; unfold cspred. -intro X; cut ((x[-]y)[#]Zero); Algebra. +intro X; cut ((x[-]y)[#]Zero); algebra. apply (mh_apzero A B sigma (x[-]y)); assumption. Qed. (* end hide *) @@ -215,16 +199,16 @@ intros x y X. cut ((sigma x)[+](sigma y)[#]Zero). intro X0. apply cg_add_ap_zero; auto. -astepl (sigma (x[+]y)); Algebra. +astepl (sigma (x[+]y)); algebra. (* C_mult *) intros x y X. cut ((sigma x)[*](sigma y)[#]Zero). -intro X0; split; Algebra. +intro X0; split; algebra. apply (cring_mult_ap_zero S (sigma x) (sigma y)); auto. apply (cring_mult_ap_zero_op S (sigma x) (sigma y)); auto. astepl (sigma (x[*]y)); assumption. (* C_non_triv *) -astepl (One:S); Algebra. +astepl (One:S); algebra. Qed. Definition cs_as_coideal := Build_coideal R cswdpredR cs_is_coideal. @@ -251,7 +235,7 @@ Definition Rtau (x:R) := (x:RdivCsR). Lemma Rtau_strext : fun_strext Rtau. red in |-*; intros x y; unfold Rtau; simpl in |-*. unfold ap_quotring; simpl in |-*; unfold cspred. -intro X; cut ((x[-]y)[#]Zero); Algebra. +intro X; cut ((x[-]y)[#]Zero); algebra. apply (rh_apzero R S sigma (x[-]y)); assumption. Qed. diff --git a/algebra/CIdeals.v b/algebra/CIdeals.v index 24d75f90c..174e53d00 100644 --- a/algebra/CIdeals.v +++ b/algebra/CIdeals.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* Ideals.v, v1.0, 28april2004, Bart Kirkels *) (** printing [+] %\ensuremath+% #+# *) diff --git a/algebra/CLogic.v b/algebra/CLogic.v index eafe1ba8b..07b4cfbbb 100644 --- a/algebra/CLogic.v +++ b/algebra/CLogic.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) (** printing Not %\ensuremath\neg% #~# *) diff --git a/algebra/CModule_Homomorphisms.v b/algebra/CModule_Homomorphisms.v index aa33de5f3..a4ee58a65 100644 --- a/algebra/CModule_Homomorphisms.v +++ b/algebra/CModule_Homomorphisms.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* CModule_Homomorphisms.v, v1.0, 28april2004, Bart Kirkels *) (** printing [+] %\ensuremath+% #+# *) diff --git a/algebra/CModules.v b/algebra/CModules.v index 902771370..ece438fba 100644 --- a/algebra/CModules.v +++ b/algebra/CModules.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* CModules.v, v1.0, 28april2004, Bart Kirkels *) (** printing [+] %\ensuremath+% #+# *) @@ -121,15 +105,15 @@ Variable A : RModule R. (* begin hide *) Lemma mu0help : forall (a:R) (x:A), Zero[']x [=] a[']Zero[']x. -intros a x; astepl ((a[*]Zero)[']x); Algebra. +intros a x; astepl ((a[*]Zero)[']x); algebra. Qed. Hint Resolve mu0help : algebra. Lemma mu0help2 : forall x:A, Zero[']x [=] Zero[']x [+] Zero[']x. -intro x; astepl ((One[+]One)[']Zero[']x); Algebra. +intro x; astepl ((One[+]One)[']Zero[']x); algebra. astepl (One[']Zero[']x [+] One['](Zero[']x)). -Algebra. +algebra. Qed. Hint Resolve mu0help2 : algebra. @@ -138,8 +122,8 @@ Hint Resolve mu0help2 : algebra. Lemma mu_zerox : forall x : A, Zero[']x [=] Zero. intro x; apply eq_symmetric. -apply (cg_cancel_lft _ (Zero[']x)); Algebra. -astepl (Zero[']x); Algebra. +apply (cg_cancel_lft _ (Zero[']x)); algebra. +astepl (Zero[']x); algebra. Qed. Hint Resolve mu_zerox : algebra. @@ -149,7 +133,7 @@ intro x; apply (cg_cancel_rht A x ([--]One[']x) [--]x). astepr (Zero:A). astepl ([--]One[']x [+] One[']x). astepl (([--]One[+]One)['] x). -astepl (Zero[']x); Algebra. +astepl (Zero[']x); algebra. Qed. Hint Resolve mu_minusonex : algebra. diff --git a/algebra/CMonoidCyc.v b/algebra/CMonoidCyc.v index 897ccde20..ff466a385 100644 --- a/algebra/CMonoidCyc.v +++ b/algebra/CMonoidCyc.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export CMonoids. @@ -693,7 +677,7 @@ Definition to_C: (H3:((Z_of_nat k)>=0)%Z),(is_generator M u)-> (k + and ((forall (k0 l0:nat), (k0<>l0 and (k0 (power_CMonoid u k0 [#] power_CMonoid u l0))))-> M -> (C_as_CMonoid (Z_of_nat k)(Z_of_nat (l-k)) H2 H3). intros M u k l H2 H3 H H1 m1. @@ -742,7 +726,7 @@ Lemma to_C_strext: forall (M:CMonoid)(u:M)(k l:nat)(H2:((Z_of_nat (l-k))>0)%Z) (H3:((Z_of_nat k)>=0)%Z)(H:(is_generator M u))(H1:(k + and ((forall (k0 l0:nat), (k0<>l0 and (k0 (power_CMonoid u k0 [#] power_CMonoid u l0))))), (fun_strext (to_C M u k l H2 H3 H H1)):CProp. intros M u k l H2 H3 H H1. @@ -753,16 +737,8 @@ unfold ZFap. unfold to_C. unfold sigT_rec. unfold sigT_rect. -(* generalize H1.*) set (H99:= (power_k_n M u)). -(* generalize H99. -clear H99. -clear H1.*) -(* case H. -simpl. -clear H.*) unfold is_generator in H. -(* intros H99.*) case (H x). intros n0 prfn0. case (H y). @@ -793,7 +769,7 @@ clear H8. intro H8. cut (p+(l-q)p+(l-q) and (k0)%Z. +intro H11. unfold q. set (H9:= (mod_nat_correct (n1-k)(l-k) H2)). apply surj_lt. rewrite (inj_plus k ( mod_nat (n1 - k) (l - k) H2)). rewrite<- H9. -cut ((l-k)>0)%Z. -intro H11. set (H10:=(Z_mod_lt (n1-k) (l-k) H11)). 2:intuition. cut (k<= n1). @@ -879,7 +904,7 @@ clear H8. intro H8. cut (q+(l-p)q+(l-p) and(kk or ((p+(l-q)=k))). +intro H13. +elim H13. +clear H13. +intro H13. +cut (k<>p+(l-q) and (kq and (pk or ((q+(l-p)=k))). +intro H13. +elim H13. +clear H13. +intro H13. +cut (k<>(q+(l-p)) and(kp and (qk or ((p+(l-q)=k))). +intro H13. +elim H13. +clear H13. +intro H13. +cut (k<>p+(l-q) and (kq and (pk or ((q+(l-p)=k))). +intro H13. +elim H13. +clear H13. +intro H13. +cut (k<>q+(l-p) and (kp and (qk or ((p+(l-q)=k))). +intro H13. +elim H13. +clear H13. +intro H13. +cut (k<>(p+(l-q)) and (kq and (pk or ((q+(l-p)=k))). +intro H13. +elim H13. +clear H13. +intro H13. +cut (k<>q+(l-p) and (kp and (q0)%Z)(H3:((Z_of_nat k)>=0)%Z)(H:(is_generator M u)) (H1:(k +and ((forall (k0 l0:nat), k0<>l0 and (k0 (power_CMonoid u k0 [#] power_CMonoid u l0))))) := (Build_CSetoid_fun M (C_as_CMonoid k (l - k)%nat H2 H3) @@ -1496,8 +1808,8 @@ Variable power_mod:forall (k l n : nat) (H2 : (Z_of_nat (l - k) > 0)%Z), k < n -> k < l and power_CMonoid c0 k[=]power_CMonoid c0 l - and (forall k0 l0 : nat, - k0 < k or k0 = k and l0 < l -> + and (forall k0 l0 : nat, k0<>l0 and + (k0 < k or k0 = k and l0 < l) -> power_CMonoid c0 k0[#]power_CMonoid c0 l0) -> power_CMonoid c0 n[=] power_CMonoid c0 (k + mod_nat (n - k) (l - k) H2). @@ -1506,14 +1818,14 @@ Variable w_inj:forall k l a b : nat, b < l -> k < l and power_CMonoid c0 k[=]power_CMonoid c0 l - and (forall k0 l0 : nat, - k0 < k or k0 = k and l0 < l -> + and (forall k0 l0 : nat, k0<>l0 and + (k0 < k or k0 = k and l0 < l) -> power_CMonoid c0 k0[#]power_CMonoid c0 l0) -> power_CMonoid c0 a[=]power_CMonoid c0 b -> a = b. Variable smallest: k < l and power_CMonoid c0 k[=]power_CMonoid c0 l - and (forall k0 l0 : nat, - k0 < k or k0 = k and l0 < l -> + and (forall k0 l0 : nat, k0<>l0 and + (k0 < k or k0 = k and l0 < l) -> power_CMonoid c0 k0[#]power_CMonoid c0 l0). Variable n0 n1 n2:nat. Variable a b:cs_crr (csg_crr (cm_crr M)). @@ -1570,7 +1882,6 @@ intuition. 2:intuition. - apply surj_lt. rewrite (inj_plus k (mod_nat (n0 - k) (l - k) H13)). rewrite<- H14. @@ -1584,7 +1895,6 @@ cut (k<=l). intro H18. rewrite<- (inj_minus1 l k H18). exact H17. - intuition. cut (k + and (forall k0 l0 : nat, k0<>l0 and + (k0 < k or k0 = k and l0 < l) -> power_CMonoid u k0[#] power_CMonoid u l0). Variable a b:cs_crr (csg_crr (cm_crr M)). @@ -2440,16 +2750,8 @@ unfold ZFeq. unfold to_C. unfold sigT_rec. unfold sigT_rect. -(* generalize smallest_gen.*) set (power_mod :=(power_k_n M u)). set (w_inj:=(weakly_inj1 M u)). -(* generalize w_inj_gen. -generalize power_mod_gen. -clear power_mod_gen. -clear w_inj_gen. -case cyc. -simpl. -intros c0 H power_mod w_inj smallest.*) case ( gen (csbf_fun M M M (csg_op (c:=M)) a b)). intros n0 Hn0. case (le_lt_dec l n0). @@ -2932,13 +3234,18 @@ intros z l2 Hn2 l1 Hn1 l0. apply Char11 with M k l u a b. exact H5. intros. +apply power_mod. +exact gen. +exact H. +exact X. +intros. apply w_inj with k0 l3. exact gen. exact H. exact H0. exact X. exact H1. -exact smallest. +apply smallest. exact Hn0. exact Hn1. exact Hn2. @@ -2978,7 +3285,6 @@ exact l0. Qed. End MP. - Section ZP. Variable M:CMonoid. @@ -2988,8 +3294,8 @@ Variable l k: nat. Variable smallest:k < l and power_CMonoid u k[=] power_CMonoid u l - and (forall k0 l0 : nat, - k0 < k or k0 = k and l0 < l -> + and (forall k0 l0 : nat, k0<>l0 and + (k0 < k or k0 = k and l0 < l) -> power_CMonoid u k0[#] power_CMonoid u l0). Variable H3:k >= 0. @@ -3024,7 +3330,11 @@ unfold Cdecidable in H10. elim H10. clear H10. intro H10. -set (H11:= (H8 H10)). +cut (0<>i). +intro H10'. +cut (0<>i and (0 < k or 0 = k and i < l)). +intro H10''. +set (H11:= (H8 H10'')). simpl. csetoid_replace_cxt (@cm_unit M) (power_CMonoid u 0) H2. set (H12:=(eq_imp_not_ap M ( power_CMonoid u i)(power_CMonoid u 0)H2)). @@ -3035,6 +3345,9 @@ intuition. simpl. apply eq_reflexive. +intuition. +intuition. + intro H11. cut (k=0). simpl. @@ -3067,7 +3380,16 @@ unfold Not in H18. apply H18. apply H17. rewrite H12. -right. +split. + +apply surj_not. +rewrite<- mod_nat_correct. +replace i with (i-0). +replace l with (l-0). +intuition. +intuition. +intuition. + intuition. rewrite<- (mod_nat_correct i l H14). @@ -3130,7 +3452,6 @@ exact H2. Qed. End ZP. - Section inj_surj. Variable M:CMonoid. @@ -3140,13 +3461,12 @@ Variable k l:nat. Variable smallest:k < l and power_CMonoid u k[=] power_CMonoid u l - and (forall k0 l0 : nat, - k0 < k or k0 = k and l0 < l -> + and (forall k0 l0 : nat,k0<>l0 and + (k0 < k or k0 = k and l0 < l) -> power_CMonoid u k0[#] power_CMonoid u l0). Variable H7:((l - k)%nat > 0)%Z. Variable H4: (k >= 0)%Z. - Section IL. Variable a0 : M. @@ -3157,7 +3477,7 @@ Variable power_mod : forall (n : nat) (H2 : (Z_of_nat (l - k) > 0)%Z), k < n -> k < l and power_CMonoid u k[=]power_CMonoid u l - and ((forall k0 l0 : nat, + and ((forall k0 l0 : nat, k0<>l0 and (k0 < k or k0 = k and l0 < l) -> power_CMonoid u k0[#]power_CMonoid u l0):CProp) -> power_CMonoid u n[=] @@ -3505,7 +3825,6 @@ exact H4. Qed. End CTN. - Section Th17. Variable M:CMonoid. @@ -3514,7 +3833,7 @@ Variable gen:(is_generator M u). Theorem Th17_partI: ({k:nat | {l:nat |k +and (forall (k0 l0:nat), k0<>l0 and (k0 (power_CMonoid u k0 [#] power_CMonoid u l0) )}} -> {k:Z|{H0:(k>=0)%Z|{n:Z|{H:(n>0)%Z| (isomorphic M (C_as_CMonoid k n H H0))}}}}): diff --git a/algebra/CMonoids.v b/algebra/CMonoids.v index b50627868..0566d13bc 100644 --- a/algebra/CMonoids.v +++ b/algebra/CMonoids.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) (** printing Zero %\ensuremath{\mathbf0}% #0# *) @@ -300,7 +284,7 @@ apply cm_lft_unit_unfolded. simpl. astepl (csbf_fun M M M (csg_op (c:=M)) a ((csbf_fun M M M (csg_op (c:=M)) (power_CMonoid a m) (power_CMonoid a n)))). -Algebra. +algebra. Qed. @@ -319,7 +303,7 @@ Section gen_cyc. Lemma power_k:forall (M:CMonoid)(u:M)(k l s:nat),(is_generator M u)-> ((k + and ((forall (k0 l0:nat), (k0<>l0 and (k0 (power_CMonoid u k0 [#] power_CMonoid u l0)))):CProp)-> (power_CMonoid u k)[=](power_CMonoid u (k+(s*(l-k)))). intros M u k l s H. @@ -365,7 +349,7 @@ Lemma power_k_n:forall (M:CMonoid)(u:M)(k l n :nat) (H2:((Z_of_nat (l-k)>0)%Z)),(is_generator M u)->(k ((k + and ((forall (k0 l0:nat), (k0<> l0 and (k0 (power_CMonoid u k0 [#] power_CMonoid u l0)))):CProp)-> (power_CMonoid u n)[=](power_CMonoid u (k+(mod_nat (n-k) (l-k) H2))). intros M u k l n H2 H H15. @@ -517,7 +501,7 @@ Qed. Lemma weakly_inj1: forall (M:CMonoid)(u:M)(k l a b:nat),(is_generator M u)->(a(b (k + and (forall (k0 l0:nat),k0<>l0 and (k0 (power_CMonoid u k0 [#] power_CMonoid u l0)))-> (power_CMonoid u a)[=](power_CMonoid u b) -> a=b. @@ -536,7 +520,11 @@ intuition. set (H6:= (eq_imp_not_ap M (power_CMonoid u a)(power_CMonoid u b) H4)). unfold Not in H6. -apply H6. +cut (k<>a+(l-b) or k=a+(l-b)). +intro orex. +elim orex. +clear orex. +intro orex. cut ((power_CMonoid u a[#]power_CMonoid u b) or (power_CMonoid u (l-b)[#]power_CMonoid u (l-b))). intro H7. @@ -560,19 +548,34 @@ replace (b+(l-b)) with l. csetoid_rewrite_rev H7. apply ap_symmetric_unfolded. apply H8. +split. +intuition. right. intuition. intuition. +clear orex. +intro orex. +intuition. + +intuition. + clear H5. intro H5. cut False. intuition. +cut (power_CMonoid (M:=M) u b[=]power_CMonoid (M:=M) u a). +intro H4'. set (H6:= (eq_imp_not_ap M (power_CMonoid u a)(power_CMonoid u b) H4)). +set (H6':= (eq_imp_not_ap M (power_CMonoid u b)(power_CMonoid u a) H4')). unfold Not in H6. -apply H6. +cut (k<>b+(l-a) or k=b+(l-a)). +intro orex. +elim orex. +clear orex. +intro orex. cut ((power_CMonoid u a[#]power_CMonoid u b) or (power_CMonoid u (l-a)[#]power_CMonoid u (l-a))). intro H7. @@ -595,10 +598,21 @@ intros H7 H8. replace (a+(l-a)) with l. csetoid_rewrite_rev H7. apply H8. +split. +intuition. right. intuition. intuition. + +clear orex. +intro orex. +intuition. + +intuition. + +intuition. + Qed. (** diff --git a/algebra/COrdAbs.v b/algebra/COrdAbs.v index 1c2750a1e..791c9911f 100644 --- a/algebra/COrdAbs.v +++ b/algebra/COrdAbs.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - Require Export COrdFields2. (** @@ -105,6 +89,17 @@ assumption. assumption. Qed. +Lemma AbsSmall_reflexive : forall (e : R), Zero [<=] e -> AbsSmall e e. +intros. +unfold AbsSmall. +split. +apply leEq_transitive with (Zero:R); auto. +astepr ([--]Zero:R). +apply inv_resp_leEq. +auto. +apply leEq_reflexive. +Qed. + Lemma AbsSmall_trans : forall e1 e2 d : R, e1 [<] e2 -> AbsSmall e1 d -> AbsSmall e2 d. intros. @@ -136,6 +131,49 @@ apply inv_resp_leEq. assumption. Qed. +Lemma mult_resp_AbsSmall: forall (R: COrdField) (x y e : R) (H: Zero[<=]y), +AbsSmall e x -> AbsSmall (y[*]e) (y[*]x). +unfold AbsSmall. +intros. +destruct H0. +split. +rstepl (y[*]([--]e)). +apply mult_resp_leEq_lft; auto. +apply mult_resp_leEq_lft; auto. +Qed. + +Lemma div_resp_AbsSmall: forall (R: COrdField) (x y e : R) (H: Zero[<]y), +AbsSmall e x -> AbsSmall (e[/]y[//]pos_ap_zero _ _ H) (x[/]y[//]pos_ap_zero _ _ H). +unfold AbsSmall. +intros. +destruct H0. +split. +rstepl (([--]e)[/]y[//]pos_ap_zero _ _ H). +apply div_resp_leEq; auto. +apply div_resp_leEq; auto. +Qed. + +Lemma sum_resp_AbsSmall : forall +(x y : nat -> R) (n m: nat) +(H1 : m <= n) (H2 : forall i : nat, m <= i -> i <= n -> AbsSmall (y i) (x i)), +AbsSmall (Sum m n y) (Sum m n x). +unfold AbsSmall. +intros. +assert (H3 : forall i : nat, m <= i -> i <= n -> [--](y i)[<=]x i). +intros. +elim (H2 i H H0). auto. +assert (H4 : forall i : nat, m <= i -> i <= n -> x i[<=]y i). +intros. +elim (H2 i H H0). auto. +split. +astepl (Sum m n (fun k: nat => [--](y k))). +apply Sum_resp_leEq . +auto with arith. intros. auto. +apply Sum_resp_leEq . +auto with arith. intros. auto. +Qed. + + Lemma AbsSmall_minus : forall e x1 x2 : R, AbsSmall e (x1[-]x2) -> AbsSmall e (x2[-]x1). intros. rstepr ([--](x1[-]x2)). diff --git a/algebra/COrdCauchy.v b/algebra/COrdCauchy.v index ad6954231..572f671a3 100644 --- a/algebra/COrdCauchy.v +++ b/algebra/COrdCauchy.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - Require Export COrdAbs. (* Begin_SpecReals *) @@ -114,7 +98,7 @@ Theorem CS_seq_bounded : forall g : nat -> R, Cauchy_prop g -> rstepr ((g N[-]One)[*](g N[-]One)). apply leEq_wdr with (y := (g N[-]One)[^]2). apply sqr_nonneg. - Algebra. + algebra. Qed. Lemma CS_seq_const : forall c : R, Cauchy_prop (fun n => c). @@ -634,7 +618,7 @@ Lemma local_mon_imp_mon' : forall f : nat -> R, intros f H i j H0. elim (le_lt_eq_dec _ _ H0); intro. apply less_leEq; apply local_mon_imp_mon with (f := f); assumption. -apply eq_imp_leEq; rewrite b; Algebra. +apply eq_imp_leEq; rewrite b; algebra. Qed. Lemma local_mon'_imp_mon' : forall f : nat -> R, diff --git a/algebra/COrdFields.v b/algebra/COrdFields.v index 3f978921a..35970bd7d 100644 --- a/algebra/COrdFields.v +++ b/algebra/COrdFields.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) (** printing [<] %\ensuremath<% #<# *) @@ -34,6 +18,7 @@ Require Export FieldReflection. Require Export CSetoids. +Require Export Rational. (* ORDERED FIELDS *) @@ -425,7 +410,7 @@ Lemma pos_Snring : forall n : nat, (Zero:R) [<] Snring n. intro n. apply less_leEq_trans with (One:R). apply pos_one. -stepl (nring (R:=R) 1). 2: simpl in |- *; Algebra. +stepl (nring (R:=R) 1). 2: simpl in |- *; algebra. unfold Snring in |- *. apply nring_leEq. auto with arith. @@ -1431,14 +1416,14 @@ apply inv_resp_less; assumption. generalize f H; clear X H f. induction n as [| n Hrecn]. simpl in |- *. -intros; Algebra. +intros; algebra. intros. simpl in |- *. rstepl ([--](Sumx (fun (i : nat) (l : i < n) => f i (lt_S i n l)))[+] [--](f n (lt_n_Sn n))). apply bin_op_wd_unfolded. -2: Algebra. +2: algebra. apply Hrecn with (f := fun (i : nat) (l : i < n) => f i (lt_S i n l)). red in |- *; intros; apply H; auto. Qed. diff --git a/algebra/COrdFields2.v b/algebra/COrdFields2.v index 168bb5b79..143b2eecc 100644 --- a/algebra/COrdFields2.v +++ b/algebra/COrdFields2.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - Require Export COrdFields. (** printing one_div_succ %\ensuremath{\frac1{\cdot+1}}% *) diff --git a/algebra/CPoly_ApZero.v b/algebra/CPoly_ApZero.v index cc45c30a6..983308e3c 100644 --- a/algebra/CPoly_ApZero.v +++ b/algebra/CPoly_ApZero.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export CPoly_Degree. @@ -55,7 +39,7 @@ induction f0 as [| s f0 Hrecf0]; intros. exists (cpoly_zero R). exists (Zero:R). simpl in |- *. -Algebra. +algebra. elim Hrecf0. intro g'. intros H. elim H. intro g''. intros H0. exists (_X_[*]g'[+]_C_ g''). @@ -169,7 +153,7 @@ Lemma poly_01_factor'_apzero : intros. unfold poly_01_factor' in |- *. astepl (_X_ ! (a_ i) [-] (_C_ (a_ n0)) ! (a_ i)). -astepl (a_ i[-]a_ n0). Algebra. +astepl (a_ i[-]a_ n0). algebra. Qed. Hint Resolve poly_01_factor'_zero. @@ -241,14 +225,14 @@ apply degree_le_mon with 0. auto with arith. apply degree_le_c_. apply degree_le_wd with (poly_01_factor 0 i y). -Algebra. +algebra. apply poly_01_factor_degree. simpl in |- *. elim (eq_nat_dec i (S n0)); intro. apply degree_le_mon with (S n0). auto. apply degree_le_wd with (poly_01 i n0). -Algebra. +algebra. auto. replace (S (S n0)) with (1 + S n0). apply degree_le_mult. @@ -271,7 +255,7 @@ auto with arith. simpl in |- *. elim (eq_nat_dec i (S n0)); intro. apply degree_le_wd with (poly_01 i n0). -Algebra. +algebra. apply poly_01_degree'. pattern (S n0) at 1 in |- *. replace (S n0) with (1 + n0). @@ -347,7 +331,7 @@ intros. astepl (a 0[+]Sum 1 n a). astepr (a 0[+]Zero). apply bin_op_wd_unfolded. -Algebra. +algebra. apply Sum_zero. auto with arith. intros. @@ -366,7 +350,7 @@ intro; rewrite H4 in H3; exact (le_Sn_n _ H3). astepl (a (S i') [+]Sum (S (S i')) n a). astepr (a (S i') [+]Zero). apply bin_op_wd_unfolded. -Algebra. +algebra. apply Sum_zero. auto with arith. intros. diff --git a/algebra/CPoly_Degree.v b/algebra/CPoly_Degree.v index f7fd8d7a0..2a31aa14f 100644 --- a/algebra/CPoly_Degree.v +++ b/algebra/CPoly_Degree.v @@ -1,23 +1,8 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export CPoly_NthCoeff. Require Export CFields. +Require Export Rational. (** *Degrees of Polynomials ** Degrees of polynomials over a ring @@ -118,7 +103,7 @@ Qed. Lemma degree_le_c_ : forall c : R, degree_le 0 (_C_ c). unfold degree_le in |- *. intros c m. elim m; intros. elim (lt_irrefl _ H). -simpl in |- *. Algebra. +simpl in |- *. algebra. Qed. Lemma degree_c_ : forall c : R, c [#] Zero -> degree 0 (_C_ c). @@ -126,22 +111,22 @@ unfold degree in |- *. intros. split. simpl in |- *. auto. apply degree_le_c_. Qed. Lemma monic_c_one : monic 0 (_C_ (One:R)). -unfold monic in |- *. intros. split. simpl in |- *. Algebra. apply degree_le_c_. +unfold monic in |- *. intros. split. simpl in |- *. algebra. apply degree_le_c_. Qed. Lemma degree_le_x_ : degree_le 1 (_X_:RX). unfold degree_le in |- *. intro. elim m. intros. elim (lt_n_O _ H). intro. elim n. intros. elim (lt_irrefl _ H0). -intros. simpl in |- *. Algebra. +intros. simpl in |- *. algebra. Qed. Lemma degree_x_ : degree 1 (_X_:RX). -unfold degree in |- *. split. simpl in |- *. Algebra. exact degree_le_x_. +unfold degree in |- *. split. simpl in |- *. algebra. exact degree_le_x_. Qed. Lemma monic_x_ : monic 1 (_X_:RX). -unfold monic in |- *. split. simpl in |- *. Algebra. exact degree_le_x_. +unfold monic in |- *. split. simpl in |- *. algebra. exact degree_le_x_. Qed. Lemma degree_le_mon : forall (p : RX) m n, @@ -177,14 +162,14 @@ generalize (toCle _ _ H); clear H; intro H. inversion H as [|m0 X]. unfold Sum in |- *. unfold Sum1 in |- *. simpl in |- *. apply eq_transitive_unfolded with (nth_coeff m (Zero:RX)). -apply nth_coeff_wd. Algebra. Algebra. +apply nth_coeff_wd. algebra. algebra. inversion X. unfold Sum in |- *. unfold Sum1 in |- *. simpl in |- *. apply eq_transitive_unfolded with (nth_coeff m (f 0)). -apply nth_coeff_wd. cut (f 0[-]Zero [=] f 0). auto. Algebra. +apply nth_coeff_wd. cut (f 0[-]Zero [=] f 0). auto. algebra. apply H0; try auto. rewrite H2. auto. elim (le_lt_eq_dec _ _ H); intro y. apply eq_transitive_unfolded with (nth_coeff m (Sum k l f[+]f (S l))). -apply nth_coeff_wd. Algebra. +apply nth_coeff_wd. algebra. astepl (nth_coeff m (Sum k l f) [+]nth_coeff m (f (S l))). astepr (Zero[+] (Zero:R)). apply bin_op_wd_unfolded. apply Hrecl. auto with arith. intros. @@ -192,13 +177,13 @@ apply H0. auto. auto. auto. apply H0. auto with arith. auto. auto. rewrite y. unfold Sum in |- *. unfold Sum1 in |- *. simpl in |- *. apply eq_transitive_unfolded with (nth_coeff m (Zero:RX)). -apply nth_coeff_wd. Algebra. Algebra. +apply nth_coeff_wd. algebra. algebra. Qed. Lemma degree_inv : forall (p : RX) (n : nat), degree n p -> degree n [--]p. unfold degree in |- *. intros p n H. elim H. clear H. intros. split. -astepl ( [--] (nth_coeff n p)). Algebra. +astepl ( [--] (nth_coeff n p)). algebra. apply degree_le_inv; auto. Qed. @@ -295,7 +280,7 @@ apply Sum_zero. auto with arith. intros. cut (n < S x + n - i). intro. Step_final (nth_coeff i p[*]Zero). omega. -replace (S x + n - S x) with n. Algebra. auto with arith. +replace (S x + n - S x) with n. algebra. auto with arith. rewrite <- y in H. rewrite <- y. pattern n at 2 in |- *. replace n with (0 + n - 0). apply @@ -322,11 +307,11 @@ Lemma degree_le_nexp : forall (p : RX) m n, degree_le m p -> degree_le (m * n) (p[^]n). intros. induction n as [| n Hrecn]; intros. replace (m * 0) with 0. -apply degree_le_wd with (_C_ (One:R)). Algebra. +apply degree_le_wd with (_C_ (One:R)). algebra. apply degree_le_c_. auto. replace (m * S n) with (m * n + m). -apply degree_le_wd with (p[^]n[*]p). Algebra. +apply degree_le_wd with (p[^]n[*]p). algebra. apply degree_le_mult; auto. auto. Qed. @@ -334,11 +319,11 @@ Qed. Lemma monic_nexp : forall (p : RX) m n, monic m p -> monic (m * n) (p[^]n). intros. induction n as [| n Hrecn]; intros. replace (m * 0) with 0. -apply monic_wd with (_C_ (One:R)). Algebra. +apply monic_wd with (_C_ (One:R)). algebra. apply monic_c_one. auto. replace (m * S n) with (m * n + m). -apply monic_wd with (p[^]n[*]p). Algebra. +apply monic_wd with (p[^]n[*]p). algebra. apply monic_mult; auto. auto. Qed. @@ -376,7 +361,7 @@ apply nth_coeff_sum with (p_ := fun i : nat => _C_ (nth_coeff i p) [*]_X_[^]i). apply eq_transitive_unfolded with (Sum 0 n (fun i0 : nat => nth_coeff i0 p[*]nth_coeff i (_X_[^]i0))). -apply Sum_wd. intros. Algebra. +apply Sum_wd. intros. algebra. elim (le_lt_dec i n); intros. astepr (nth_coeff i p[*]One). astepr (nth_coeff i p[*]nth_coeff i (_X_[^]i)). @@ -423,7 +408,7 @@ apply all_nth_coeff_eq_imp. intros. elim (O_or_S i); intro y. elim y. clear y. intros x y. rewrite <- y. cut (0 < S x). intro. Step_final (Zero:R). auto with arith. -rewrite <- y. Algebra. +rewrite <- y. algebra. Qed. Lemma degree_le_1_imp : forall p : RX, @@ -434,7 +419,7 @@ apply all_nth_coeff_eq_imp. intros. elim i; intros. simpl in |- *. rational. elim n; intros. -simpl in |- *. Algebra. +simpl in |- *. algebra. simpl in |- *. apply H. auto with arith. Qed. @@ -492,18 +477,18 @@ Lemma degree_mult : forall (p q : FX) m n, unfold degree in |- *. intros. rename X into H. rename X0 into H0. elim H. clear H. intros H1 H2. elim H0. clear H0. intros H3 H4. split. -astepl (nth_coeff m p[*]nth_coeff n q). Algebra. +astepl (nth_coeff m p[*]nth_coeff n q). algebra. apply degree_le_mult; auto. Qed. Lemma degree_nexp : forall (p : FX) m n, degree m p -> degree (m * n) (p[^]n). intros. induction n as [| n Hrecn]; intros. replace (m * 0) with 0. -apply degree_wd with (_C_ (One:F)). Algebra. -apply degree_c_. Algebra. +apply degree_wd with (_C_ (One:F)). algebra. +apply degree_c_. algebra. auto. replace (m * S n) with (m * n + m). -apply degree_wd with (p[^]n[*]p). Algebra. +apply degree_wd with (p[^]n[*]p). algebra. apply degree_mult; auto. auto. Qed. diff --git a/algebra/CPoly_NthCoeff.v b/algebra/CPoly_NthCoeff.v index ad87fea83..3d0b369b7 100644 --- a/algebra/CPoly_NthCoeff.v +++ b/algebra/CPoly_NthCoeff.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export CPolynomials. @@ -173,25 +157,25 @@ Notation RX := (cpoly_cring R). Lemma nth_coeff_zero : forall n, nth_coeff n (Zero:RX) [=] Zero. intros. simpl in |- *. -Algebra. +algebra. Qed. Lemma coeff_O_lin : forall p (c : R), nth_coeff 0 (c[+X*]p) [=] c. intros. simpl in |- *. -Algebra. +algebra. Qed. Lemma coeff_Sm_lin : forall p (c : R) m, nth_coeff (S m) (c[+X*]p) [=] nth_coeff m p. intros. simpl in |- *. -Algebra. +algebra. Qed. Lemma coeff_O_c_ : forall c : R, nth_coeff 0 (_C_ c) [=] c. intros. simpl in |- *. -Algebra. +algebra. Qed. Lemma coeff_O_x_mult : forall p : RX, nth_coeff 0 (_X_[*]p) [=] Zero. @@ -200,7 +184,7 @@ astepl (nth_coeff 0 (Zero[+]_X_[*]p)). astepl (nth_coeff 0 (_C_ Zero[+]_X_[*]p)). astepl (nth_coeff 0 (Zero[+X*]p)). simpl in |- *. -Algebra. +algebra. Qed. Lemma coeff_Sm_x_mult : forall (p : RX) m, nth_coeff (S m) (_X_[*]p) [=] nth_coeff m p. @@ -209,7 +193,7 @@ astepl (nth_coeff (S m) (Zero[+]_X_[*]p)). astepl (nth_coeff (S m) (_C_ Zero[+]_X_[*]p)). astepl (nth_coeff (S m) (Zero[+X*]p)). simpl in |- *. -Algebra. +algebra. Qed. Lemma coeff_Sm_mult_x_ : forall (p : RX) m, nth_coeff (S m) (p[*]_X_) [=] nth_coeff m p. @@ -226,7 +210,7 @@ intros. cut (nth_coeff n p [#] nth_coeff n Zero). intro H0. apply (nth_coeff_strext _ _ _ _ H0). -Algebra. +algebra. Qed. Lemma nth_coeff_plus : forall (p q : RX) n, @@ -240,16 +224,16 @@ astepr (nth_coeff n p1[+]nth_coeff n q1). apply H1. intros. simpl in |- *. -Algebra. +algebra. intros. elim n. simpl in |- *. -Algebra. +algebra. intros. astepl (nth_coeff n0 (p0[+]q0)). generalize (H n0); intro. astepl (nth_coeff n0 p0[+]nth_coeff n0 q0). -Algebra. +algebra. Qed. Lemma nth_coeff_inv : forall (p : RX) n, nth_coeff n [--]p [=] [--] (nth_coeff n p). @@ -258,11 +242,11 @@ pattern p in |- *. apply cpoly_induc. intros. simpl in |- *. -Algebra. +algebra. intros. elim n. simpl in |- *. -Algebra. +algebra. intros. simpl in |- *. apply H. Qed. @@ -277,16 +261,16 @@ intros. astepl (nth_coeff n (Zero:RX)). astepr (c[*]Zero). astepl (Zero:R). -Algebra. +algebra. intros. elim n. simpl in |- *. -Algebra. +algebra. intros. astepl (nth_coeff (S n0) (c[*]c0[+X*]_C_ c[*]p0)). astepl (nth_coeff n0 (_C_ c[*]p0)). astepl (c[*]nth_coeff n0 p0). -Algebra. +algebra. Qed. Lemma nth_coeff_p_mult_c_ : forall (p : RX) c n, nth_coeff n (p[*]_C_ c) [=] nth_coeff n p[*]c. @@ -305,7 +289,7 @@ astepl (nth_coeff (S n) (_C_ a[*]_X_[*]p[+]_C_ b[*]p)). astepl (nth_coeff (S n) (_C_ a[*]_X_[*]p) [+]nth_coeff (S n) (_C_ b[*]p)). astepl (nth_coeff (S n) (_C_ a[*] (_X_[*]p)) [+]b[*]nth_coeff (S n) p). astepl (a[*]nth_coeff (S n) (_X_[*]p) [+]b[*]nth_coeff (S n) p). -Algebra. +algebra. Qed. Lemma all_nth_coeff_eq_imp : forall p p' : RX, @@ -313,7 +297,7 @@ Lemma all_nth_coeff_eq_imp : forall p p' : RX, intro. induction p as [| s p Hrecp]; intros; [ induction p' as [| s p' Hrecp'] | induction p' as [| s0 p' Hrecp'] ]; intros. -Algebra. +algebra. simpl in |- *. simpl in H. simpl in Hrecp'. split. apply eq_symmetric_unfolded. apply (H 0). apply Hrecp'. intros. apply (H (S i)). @@ -328,13 +312,13 @@ Qed. Lemma poly_at_zero : forall p : RX, p ! Zero [=] nth_coeff 0 p. intros. induction p as [| s p Hrecp]; intros. -simpl in |- *. Algebra. +simpl in |- *. algebra. simpl in |- *. Step_final (s[+]Zero). Qed. Lemma nth_coeff_inv' : forall (p : RX) i, nth_coeff i (cpoly_inv _ p) [=] [--] (nth_coeff i p). -intros. change (nth_coeff i [--] (p:RX) [=] [--] (nth_coeff i p)) in |- *. Algebra. +intros. change (nth_coeff i [--] (p:RX) [=] [--] (nth_coeff i p)) in |- *. algebra. Qed. Lemma nth_coeff_minus : forall (p q : RX) i, @@ -350,7 +334,7 @@ Hint Resolve nth_coeff_minus: algebra. Lemma nth_coeff_sum0 : forall (p_ : nat -> RX) k n, nth_coeff k (Sum0 n p_) [=] Sum0 n (fun i => nth_coeff k (p_ i)). intros. induction n as [| n Hrecn]; intros. -simpl in |- *. Algebra. +simpl in |- *. algebra. change (nth_coeff k (Sum0 n p_[+]p_ n) [=] Sum0 n (fun i : nat => nth_coeff k (p_ i)) [+]nth_coeff k (p_ n)) @@ -367,7 +351,7 @@ Qed. Lemma nth_coeff_nexp_eq : forall i, nth_coeff i (_X_[^]i) [=] (One:R). intros. induction i as [| i Hreci]; intros. -simpl in |- *. Algebra. +simpl in |- *. algebra. change (nth_coeff (S i) (_X_[^]i[*]_X_) [=] (One:R)) in |- *. Step_final (nth_coeff i (_X_[^]i):R). Qed. @@ -378,7 +362,7 @@ intro; induction i as [| i Hreci]; intros; intros. elim (H (refl_equal _)). Step_final (nth_coeff 0 (_X_[*]_X_[^]j):R). -simpl in |- *. Algebra. +simpl in |- *. algebra. change (nth_coeff (S i) (_X_[^]j[*]_X_) [=] (Zero:R)) in |- *. astepl (nth_coeff i (_X_[^]j):R). apply Hreci. auto. @@ -388,7 +372,7 @@ Lemma nth_coeff_mult : forall (p q : RX) n, nth_coeff n (p[*]q) [=] Sum 0 n (fun i => nth_coeff i p[*]nth_coeff (n - i) q). intro; induction p as [| s p Hrecp]. intros. simpl in |- *. apply eq_symmetric_unfolded. -apply Sum_zero. auto with arith. intros. Algebra. +apply Sum_zero. auto with arith. intros. algebra. intros. apply eq_transitive_unfolded with (nth_coeff n (_C_ s[*]q[+]_X_[*] ((p:RX) [*]q))). @@ -418,9 +402,9 @@ apply Sum 1 (S n) (fun i : nat => nth_coeff i (cpoly_linear _ s p) [*]nth_coeff (S n - i) q)). -apply bin_op_wd_unfolded. Algebra. +apply bin_op_wd_unfolded. algebra. astepl (Sum 0 n (fun i : nat => nth_coeff i p[*]nth_coeff (n - i) q)). -apply Sum_shift. intros. simpl in |- *. Algebra. +apply Sum_shift. intros. simpl in |- *. algebra. apply eq_symmetric_unfolded. apply Sum_first diff --git a/algebra/CPolynomials.v b/algebra/CPolynomials.v index 6e201a6a4..a8df2af50 100644 --- a/algebra/CPolynomials.v +++ b/algebra/CPolynomials.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) (** printing _X_ %\ensuremath{x}% *) @@ -522,9 +506,9 @@ intro p0; pattern p0 in |- *; apply Ccpoly_ind_cs. assumption. intros p1 c. intros. apply X with (cpoly_linear_cs c p1) (cpoly_linear_cs Zero cpoly_zero_cs). -Algebra. +algebra. apply _cpoly_lin_eq_zero. -split; Algebra. +split; algebra. apply X1. assumption. @@ -533,8 +517,8 @@ assumption. intros. apply X with (cpoly_linear_cs Zero cpoly_zero_cs) (cpoly_linear_cs c p1). apply _cpoly_lin_eq_zero. -split; Algebra. -Algebra. +split; algebra. +algebra. apply X1. assumption. intros. @@ -557,7 +541,7 @@ intros. apply X with p1 q1 r. assumption. assumption. -Algebra. +algebra. apply X2. intro r; pattern r in |- *; apply Ccpoly_ind_cs. @@ -569,9 +553,9 @@ apply (cpoly_linear_cs Zero cpoly_zero_cs) (cpoly_linear_cs Zero cpoly_zero_cs) (cpoly_linear_cs c p0). -apply _cpoly_lin_eq_zero; split; Algebra. -apply _cpoly_lin_eq_zero; split; Algebra. -Algebra. +apply _cpoly_lin_eq_zero; split; algebra. +apply _cpoly_lin_eq_zero; split; algebra. +algebra. apply X1. assumption. @@ -583,9 +567,9 @@ apply (cpoly_linear_cs c p0) (cpoly_linear_cs d q0) (cpoly_linear_cs Zero cpoly_zero_cs). -Algebra. -Algebra. -apply _cpoly_lin_eq_zero; split; Algebra. +algebra. +algebra. +apply _cpoly_lin_eq_zero; split; algebra. apply X1. apply X2. intros. @@ -603,9 +587,9 @@ intro p0; pattern p0 in |- *; apply cpoly_ind_cs. assumption. intros. apply H with (cpoly_linear_cs c p1) (cpoly_linear_cs Zero cpoly_zero_cs). -Algebra. +algebra. apply _cpoly_lin_eq_zero. -split; Algebra. +split; algebra. apply H1. assumption. @@ -614,8 +598,8 @@ assumption. intros. apply H with (cpoly_linear_cs Zero cpoly_zero_cs) (cpoly_linear_cs c p1). apply _cpoly_lin_eq_zero. -split; Algebra. -Algebra. +split; algebra. +algebra. apply H1. assumption. intros. @@ -638,7 +622,7 @@ intros. apply H with p1 q1 r. assumption. assumption. -Algebra. +algebra. apply H4. intro r; pattern r in |- *; apply cpoly_ind_cs. @@ -650,9 +634,9 @@ apply (cpoly_linear_cs Zero cpoly_zero_cs) (cpoly_linear_cs Zero cpoly_zero_cs) (cpoly_linear_cs c p0). -apply _cpoly_lin_eq_zero; split; Algebra. -apply _cpoly_lin_eq_zero; split; Algebra. -Algebra. +apply _cpoly_lin_eq_zero; split; algebra. +apply _cpoly_lin_eq_zero; split; algebra. +algebra. apply H1. assumption. @@ -664,9 +648,9 @@ apply (cpoly_linear_cs c p0) (cpoly_linear_cs d q0) (cpoly_linear_cs Zero cpoly_zero_cs). -Algebra. -Algebra. -apply _cpoly_lin_eq_zero; split; Algebra. +algebra. +algebra. +apply _cpoly_lin_eq_zero; split; algebra. apply H1. apply H2. intros. @@ -712,16 +696,16 @@ pattern p, q in |- *. apply cpoly_double_sym_ind0_cs. unfold Tsymmetric in |- *. intros. -Algebra. +algebra. intro p0. rewrite cpoly_zero_plus. rewrite cpoly_plus_zero. -Algebra. +algebra. intros. repeat rewrite cpoly_lin_plus_lin. apply _cpoly_lin_eq_lin. split. -Algebra. +algebra. assumption. Qed. @@ -978,7 +962,7 @@ intros. repeat rewrite cpoly_lin_plus_lin. apply _cpoly_lin_eq_lin. split. -Algebra. +algebra. assumption. Qed. @@ -989,13 +973,13 @@ apply Build_is_CMonoid. unfold is_rht_unit in |- *. intro. rewrite cpoly_plus_zero. -Algebra. +algebra. unfold is_lft_unit in |- *. intros. eapply eq_transitive_unfolded. apply cpoly_plus_commutative. rewrite cpoly_plus_zero. -Algebra. +algebra. Qed. Definition cpoly_cmonoid := Build_CMonoid _ _ cpoly_cm_proof. @@ -1045,7 +1029,7 @@ apply _cpoly_lin_ap_zero. auto. elim H0. left. -astepl ( [--][--]c). Algebra. +astepl ( [--][--]c). algebra. right. apply X. assumption. @@ -1089,7 +1073,7 @@ rewrite cpoly_inv_lin. rewrite cpoly_lin_plus_lin. apply _cpoly_lin_eq_zero. split. -Algebra. +algebra. assumption. split; auto. eapply eq_transitive_unfolded. @@ -1140,12 +1124,12 @@ Qed. Lemma cpoly_mult_cr_zero : forall p, cpoly_mult_cr_cs p Zero [=] cpoly_zero_cs. intro; pattern p in |- *; apply cpoly_ind_cs. rewrite cpoly_zero_mult_cr. -Algebra. +algebra. intros. rewrite cpoly_lin_mult_cr. apply _cpoly_lin_eq_zero. split. -Algebra. +algebra. assumption. Qed. @@ -1267,7 +1251,7 @@ apply cpoly_plus_op_wd. apply eq_symmetric_unfolded. apply cpoly_mult_cr_zero. apply _cpoly_zero_eq_lin. -split; Algebra. +split; algebra. intro; pattern p in |- *; apply Ccpoly_ind_cs. auto. @@ -1303,7 +1287,7 @@ apply cpoly_plus_op_wd. apply eq_symmetric_unfolded. apply cpoly_mult_cr_zero. apply _cpoly_zero_eq_lin. -split; Algebra. +split; algebra. intros. cut ((c [#] d or p [#] q) or y1 [#] y2). @@ -1337,20 +1321,20 @@ apply cpoly_mult_cr_wd. apply cpoly_plus_op_wd. assumption. assumption. -Algebra. +algebra. astepl (cpoly_plus_cs (cpoly_mult_cr_cs p1 c) (cpoly_mult_cr_cs q1 c)). apply cpoly_plus_op_wd. -apply cpoly_mult_cr_wd; Algebra. -apply cpoly_mult_cr_wd; Algebra. +apply cpoly_mult_cr_wd; algebra. +apply cpoly_mult_cr_wd; algebra. repeat rewrite cpoly_zero_plus. -Algebra. +algebra. intros. repeat rewrite cpoly_lin_mult_cr. repeat rewrite cpoly_lin_plus_lin. rewrite cpoly_lin_mult_cr. apply _cpoly_lin_eq_lin. split. -Algebra. +algebra. assumption. Qed. @@ -1364,7 +1348,7 @@ change pattern p in |- *. apply cpoly_ind_cs. repeat rewrite cpoly_zero_mult. rewrite cpoly_zero_plus. -Algebra. +algebra. intros. repeat rewrite cpoly_lin_mult. apply @@ -1379,7 +1363,7 @@ apply cpoly_mult_cr_dist. rewrite cpoly_lin_plus_lin. apply _cpoly_lin_eq_lin. split. -Algebra. +algebra. assumption. clear H. apply @@ -1399,7 +1383,7 @@ apply (cpoly_plus_cs (cpoly_mult_cr_cs r c) (cpoly_linear_cs Zero (cpoly_mult_cs p0 r))))). apply cpoly_plus_op_wd. -Algebra. +algebra. apply eq_transitive_unfolded with @@ -1416,7 +1400,7 @@ apply (cpoly_mult_cr_cs r c)) (cpoly_linear_cs Zero (cpoly_mult_cs p0 r))). apply cpoly_plus_op_wd. apply cpoly_plus_commutative. -Algebra. +algebra. apply eq_symmetric_unfolded. apply cpoly_plus_associative. apply cpoly_plus_associative. @@ -1427,12 +1411,12 @@ Lemma cpoly_mult_cr_assoc_mult_cr : forall p c d, intros. pattern p in |- *; apply cpoly_ind_cs. repeat rewrite cpoly_zero_mult_cr. -Algebra. +algebra. intros. repeat rewrite cpoly_lin_mult_cr. apply _cpoly_lin_eq_lin. split. -Algebra. +algebra. assumption. Qed. @@ -1443,7 +1427,7 @@ pattern p in |- *; apply cpoly_ind_cs. rewrite cpoly_zero_mult. repeat rewrite cpoly_zero_mult_cr. rewrite cpoly_zero_mult. -Algebra. +algebra. intros. rewrite cpoly_lin_mult. repeat rewrite cpoly_lin_mult_cr. @@ -1459,21 +1443,21 @@ apply cpoly_mult_cr_assoc_mult_cr. rewrite cpoly_lin_mult_cr. apply _cpoly_lin_eq_lin. split. -Algebra. +algebra. assumption. Qed. Lemma cpoly_mult_zero : forall p, cpoly_mult_cs p cpoly_zero_cs [=] cpoly_zero_cs. intros. pattern p in |- *; apply cpoly_ind_cs. -Algebra. +algebra. intros. rewrite cpoly_lin_mult. rewrite cpoly_zero_mult_cr. rewrite cpoly_zero_plus. apply _cpoly_lin_eq_zero. split. -Algebra. +algebra. assumption. Qed. @@ -1486,13 +1470,13 @@ repeat rewrite cpoly_zero_mult. rewrite cpoly_zero_mult_cr. rewrite cpoly_zero_plus. apply _cpoly_zero_eq_lin. -Algebra. +algebra. intros. repeat rewrite cpoly_lin_mult. repeat rewrite cpoly_lin_mult_cr. repeat rewrite cpoly_lin_plus_lin. apply _cpoly_lin_eq_lin. split. -Algebra. +algebra. apply eq_transitive_unfolded with @@ -1508,7 +1492,7 @@ apply (cpoly_plus_cs (cpoly_mult_cr_cs q c0) (cpoly_mult_cr_cs p0 c)) (cpoly_linear_cs Zero (cpoly_mult_cs p0 q))). 2: apply cpoly_plus_op_wd. -3: Algebra. +3: algebra. 2: apply cpoly_plus_commutative. apply eq_transitive_unfolded @@ -1518,7 +1502,7 @@ apply (cpoly_linear_cs Zero (cpoly_mult_cs p0 q)))). 2: apply cpoly_plus_associative. apply cpoly_plus_op_wd. -Algebra. +algebra. assumption. Qed. @@ -1539,9 +1523,9 @@ apply (cpoly_linear_cs Zero (cpoly_mult_cs q p0))). 2: apply eq_symmetric_unfolded; apply cpoly_mult_lin. apply cpoly_plus_op_wd. -Algebra. +algebra. apply cpoly_linear_wd. -Algebra. +algebra. assumption. Qed. @@ -1572,7 +1556,7 @@ change in |- *. pattern p in |- *; apply cpoly_ind_cs. repeat rewrite cpoly_zero_mult. -Algebra. +algebra. intros. repeat rewrite cpoly_lin_mult. apply @@ -1591,15 +1575,15 @@ apply rewrite cpoly_zero_plus. apply _cpoly_lin_eq_lin. split. -Algebra. +algebra. assumption. apply cpoly_plus_op_wd. apply eq_symmetric_unfolded. apply cpoly_mult_cr_zero. apply _cpoly_lin_eq_lin. split. -Algebra. -Algebra. +algebra. +algebra. apply eq_symmetric_unfolded. apply cpoly_mult_dist_rht. Qed. @@ -1607,11 +1591,11 @@ Qed. Lemma cpoly_mult_cr_one : forall p, cpoly_mult_cr_cs p One [=] p. intro. pattern p in |- *; apply cpoly_ind_cs. -Algebra. +algebra. intros. rewrite cpoly_lin_mult_cr. apply _cpoly_lin_eq_lin. -Algebra. +algebra. Qed. Lemma cpoly_one_mult : forall p, cpoly_mult_cs cpoly_one p [=] p. @@ -1625,8 +1609,8 @@ rewrite cpoly_zero_mult. apply eq_transitive_unfolded with (cpoly_plus_cs p cpoly_zero_cs). apply cpoly_plus_op_wd. apply cpoly_mult_cr_one. -apply _cpoly_lin_eq_zero; Algebra. -rewrite cpoly_plus_zero; Algebra. +apply _cpoly_lin_eq_zero; algebra. +rewrite cpoly_plus_zero; algebra. Qed. Lemma cpoly_mult_one : forall p, cpoly_mult_cs p cpoly_one [=] p. @@ -1648,7 +1632,7 @@ change (cpoly_linear_cs One cpoly_zero_cs [#] cpoly_zero_cs) in |- *. cut ((One:CR) [#] Zero or cpoly_zero_cs [#] cpoly_zero_cs). auto. left. -Algebra. +algebra. Qed. Lemma cpoly_is_CRing : is_CRing cpoly_cabgroup cpoly_one cpoly_mult_op. @@ -1936,31 +1920,31 @@ Notation RX := (cpoly_cring R). *) Lemma cpoly_X_ : _X_ [=] (Zero:RX) [+X*]One. -Algebra. +algebra. Qed. Lemma cpoly_C_ : forall c : RX, _C_ c [=] c[+X*]Zero. -Algebra. +algebra. Qed. Hint Resolve cpoly_X_ cpoly_C_: algebra. Lemma cpoly_const_eq : forall c d : R, c [=] d -> _C_ c [=] _C_ d. intros. -Algebra. +algebra. Qed. Lemma _c_zero : Zero [=] _C_ (Zero:R). simpl in |- *. -split; Algebra. +split; algebra. Qed. Lemma _c_one : One [=] _C_ (One:R). -simpl in |- *; split; Algebra. +simpl in |- *; split; algebra. Qed. Lemma _c_mult : forall a b : R, _C_ (a[*]b) [=] _C_ a[*]_C_ b. -simpl in |- *; split; Algebra. +simpl in |- *; split; algebra. Qed. Lemma cpoly_lin : forall (p : RX) (c : R), c[+X*]p [=] _C_ c[+]_X_[*]p. @@ -1987,17 +1971,17 @@ apply with (c[+X*]Zero[+]((Zero:RX) [+]cpoly_linear _ (Zero:R) (p:cpoly_csetoid R))). 2: apply bin_op_wd_unfolded. -2: Algebra. +2: algebra. 2: apply bin_op_wd_unfolded. -2: Algebra. +2: algebra. 2: apply (cpoly_linear_wd R). -2: Algebra. +2: algebra. 2: apply eq_symmetric_unfolded. 2: apply cpoly_one_mult. astepr (c[+X*]Zero[+]cpoly_linear _ (Zero:R) (p:cpoly_csetoid R)). astepr (c[+]Zero[+X*](Zero[+]p)). astepr (c[+X*]p). -Algebra. +algebra. apply cpoly_one_mult. Qed. @@ -2024,11 +2008,11 @@ intros. pattern p in |- *. apply cpoly_induc. simpl in |- *. -repeat split; Algebra. +repeat split; algebra. intros. simpl in |- *. -repeat split; Algebra. +repeat split; algebra. change ((cpoly_mult_cr R p0 c:RX) [=] (cpoly_mult_cr R p0 c:RX)[+]Zero) in |- *. -Algebra. +algebra. Qed. @@ -2037,7 +2021,7 @@ Lemma lin_mult : forall (p q : RX) c, (c[+X*]p) [*]q [=] _C_ c[*]q[+]_X_[*] (p[* intros. astepl ((_C_ c[+]_X_[*]p)[*]q). astepl (_C_ c[*]q[+]_X_[*]p[*]q). -Algebra. +algebra. Qed. Hint Resolve lin_mult: algebra. @@ -2049,17 +2033,17 @@ Lemma poly_eq_zero : forall p : RX, p [=] cpoly_zero R -> forall x, p ! x [=] Ze intros. astepl (cpoly_zero R) ! x. change (Zero ! x [=] Zero) in |- *. -Algebra. +algebra. Qed. Lemma apply_wd : forall (p p' : RX) x x', p [=] p' -> x [=] x' -> p ! x [=] p' ! x'. intros. -Algebra. +algebra. Qed. Lemma cpolyap_pres_eq : forall (f : RX) x y, x [=] y -> f ! x [=] f ! y. intros. -Algebra. +algebra. Qed. Lemma cpolyap_strext : forall (f : RX) x y, f ! x [#] f ! y -> x [#] y. @@ -2076,7 +2060,7 @@ Lemma _c_apply : forall c x : R, (_C_ c) ! x [=] c. intros. simpl in |- *. astepl (c[+]Zero). -Algebra. +algebra. Qed. Lemma _x_apply : forall x : R, _X_ ! x [=] x. @@ -2085,7 +2069,7 @@ simpl in |- *. astepl (x[*](One[+]x[*]Zero)). astepl (x[*](One[+]Zero)). astepl (x[*]One). -Algebra. +algebra. Qed. Lemma plus_apply : forall (p q : RX) x, (p[+]q) ! x [=] p ! x[+]q ! x. @@ -2094,9 +2078,9 @@ pattern p, q in |- *; apply poly_double_comp_ind. intros. astepl (p1[+]q1) ! x. astepr (p1 ! x[+]q1 ! x). -Algebra. +algebra. simpl in |- *. -Algebra. +algebra. intros. astepl (c[+]d[+]x[*](p0[+]q0) ! x). astepr (c[+]x[*]p0 ! x[+](d[+]x[*]q0 ! x)). @@ -2106,7 +2090,7 @@ astepl (c[+](d[+](x[*]p0 ! x[+]x[*]q0 ! x))). astepr (c[+](x[*]p0 ! x[+](d[+]x[*]q0 ! x))). astepl (c[+](d[+]x[*]p0 ! x[+]x[*]q0 ! x)). astepr (c[+](x[*]p0 ! x[+]d[+]x[*]q0 ! x)). -Algebra. +algebra. Qed. Lemma inv_apply : forall (p : RX) x, ( [--]p) ! x [=] [--]p ! x. @@ -2114,13 +2098,13 @@ intros. pattern p in |- *. apply cpoly_induc. simpl in |- *. -Algebra. +algebra. intros. astepl ( [--]c[+]x[*]( [--]p0) ! x). astepr ( [--](c[+]x[*]p0 ! x)). astepr ( [--]c[+][--](x[*]p0 ! x)). astepr ( [--]c[+]x[*][--]p0 ! x). -Algebra. +algebra. Qed. Hint Resolve plus_apply inv_apply: algebra. @@ -2130,7 +2114,7 @@ intros. astepl (p[+][--]q) ! x. astepr (p ! x[+][--]q ! x). astepl (p ! x[+]( [--]q) ! x). -Algebra. +algebra. Qed. Lemma _c_mult_apply : forall (q : RX) c x, (_C_ c[*]q) ! x [=] c[*]q ! x. @@ -2144,7 +2128,7 @@ astepl (cpoly_mult_cr R q c) ! x. pattern q in |- *. apply cpoly_induc. simpl in |- *. -Algebra. +algebra. intros. astepl (c[*]c0[+X*]cpoly_mult_cr R p c) ! x. astepl (c[*]c0[+]x[*](cpoly_mult_cr R p c) ! x). @@ -2152,10 +2136,10 @@ astepl (c[*]c0[+]x[*](c[*]p ! x)). astepr (c[*](c0[+]x[*]p ! x)). astepr (c[*]c0[+]c[*](x[*]p ! x)). apply bin_op_wd_unfolded. -Algebra. +algebra. astepl (x[*]c[*]p ! x). astepr (c[*]x[*]p ! x). -Algebra. +algebra. Qed. Hint Resolve _c_mult_apply: algebra. @@ -2165,7 +2149,7 @@ intros. pattern p in |- *. apply cpoly_induc. simpl in |- *. -Algebra. +algebra. intros. astepl (_C_ c[*]q[+]_X_[*](p0[*]q)) ! x. astepl ((_C_ c[*]q) ! x[+](_X_[*](p0[*]q)) ! x). @@ -2177,7 +2161,7 @@ astepl (c[*]q ! x[+]x[*](p0[*]q) ! x). astepl (c[*]q ! x[+]x[*](p0 ! x[*]q ! x)). astepr ((c[+]x[*]p0 ! x)[*]q ! x). astepr (c[*]q ! x[+]x[*]p0 ! x[*]q ! x). -Algebra. +algebra. Qed. Hint Resolve mult_apply: algebra. @@ -2195,11 +2179,11 @@ intros. induction n as [| n Hrecn]. astepl (One:RX) ! x. astepl (One:R). -Algebra. +algebra. astepl (p[*]p[^]n) ! x. astepl (p ! x[*](p[^]n) ! x). astepl (p ! x[*]p ! x[^]n). -Algebra. +algebra. Qed. (* SUPERFLUOUS *) @@ -2211,12 +2195,12 @@ Lemma Sum0_cpoly_ap : forall (f : nat -> RX) a k, (Sum0 k f) ! a [=] Sum0 k (fun intros. induction k as [| k Hreck]. simpl in |- *. -Algebra. +algebra. astepl (Sum0 k f[+]f k) ! a. astepl ((Sum0 k f) ! a[+](f k) ! a). astepl (Sum0 k (fun i : nat => (f i) ! a)[+](f k) ! a). simpl in |- *. -Algebra. +algebra. Qed. Lemma Sum_cpoly_ap : forall (f : nat -> RX) a k l, diff --git a/algebra/CQuotient_Modules.v b/algebra/CQuotient_Modules.v index cc753fff3..c58e29831 100644 --- a/algebra/CQuotient_Modules.v +++ b/algebra/CQuotient_Modules.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* CQuotient_Modules.v, v1.0, 28april2004, Bart Kirkels *) (** printing [+] %\ensuremath+% #+# *) @@ -48,8 +32,8 @@ Lemma ap_quotmod_irreflexive : irreflexive ap_quotmod. red in |-*. intro x. unfold ap_quotmod in |-*. -assert (x[-]x[=]Zero); Algebra. -assert (Not ((cmpred A cm) Zero)); Algebra. +assert (x[-]x[=]Zero); algebra. +assert (Not ((cmpred A cm) Zero)); algebra. intro. apply H0. apply (comod_wd A cm (x[-]x) Zero); auto. Qed. @@ -60,12 +44,12 @@ intros x y. unfold ap_quotmod. intro X. apply (comod_mult A cm (y[-]x) ([--]One)). -apply (comod_wd A cm (x[-]y) (rm_mu A [--]One (y[-]x))); Algebra. +apply (comod_wd A cm (x[-]y) (rm_mu A [--]One (y[-]x))); algebra. astepr [--](y[-]x); try apply eq_symmetric; try apply muminus1. astepl [--](y[+][--]x). astepl ([--][--]x[+][--]y). astepl (x[+][--]y). -Algebra. +algebra. Qed. Lemma ap_quotmod_cotransitive : cotransitive ap_quotmod. @@ -93,8 +77,8 @@ Definition eq_quotmod (x y:A) := Not (cm(x[-]y)). Lemma eq_quotmod_wd : forall (x y:A), x[=]y -> (eq_quotmod x y). intros x y X; auto. red in |-*; intro X0. -assert ((cmpred A cm)(Zero)); Algebra. -apply (comod_wd A cm (x[-]y) Zero); Algebra. +assert ((cmpred A cm)(Zero)); algebra. +apply (comod_wd A cm (x[-]y) Zero); algebra. apply x_minus_x; auto. apply (comod_nonzero A cm); assumption. Qed. @@ -139,7 +123,7 @@ astepr (([--]y2[+][--]x2)[+]x1[+]y1). astepr (([--]y2[+][--]x2)[+](x1[+]y1)). astepr ((x1[+]y1)[+]([--]y2[+][--]x2)). astepr ((x1[+]y1)[+][--](x2[+]y2)). -Algebra. +algebra. Qed. Definition dmplus_is_bin_fun := @@ -149,7 +133,7 @@ quotmod_as_CSetoid (csg_op (c:=A)) dmplus_is_ext. Lemma dmplus_is_assoc : associative dmplus_is_bin_fun. red in |-*; auto. intros x y z; simpl in |-*. -apply eq_quotmod_wd; Algebra. +apply eq_quotmod_wd; algebra. Qed. Definition quotmod_as_CSemiGroup := Build_CSemiGroup quotmod_as_CSetoid @@ -163,12 +147,12 @@ dmplus_is_bin_fun dmplus_is_assoc. Lemma zero_as_rht_unit : is_rht_unit dmplus_is_bin_fun Zero. red in |-*; intro x. simpl in |-*. -apply eq_quotmod_wd; Algebra. +apply eq_quotmod_wd; algebra. Qed. Lemma zero_as_lft_unit : is_lft_unit dmplus_is_bin_fun Zero. red in |-*; intro x; simpl in |-*. -apply eq_quotmod_wd; Algebra. +apply eq_quotmod_wd; algebra. Qed. Definition quotmod_is_CMonoid := Build_is_CMonoid quotmod_as_CSemiGroup @@ -189,12 +173,12 @@ intros x y. simpl in |-*. unfold ap_quotmod in |-*. intro X. -apply (comod_mult A cm (x[-]y) [--]One); Algebra. -apply (comod_wd A cm ([--]x[-][--]y) ([--]One['](x[-]y))); Algebra. +apply (comod_mult A cm (x[-]y) [--]One); algebra. +apply (comod_wd A cm ([--]x[-][--]y) ([--]One['](x[-]y))); algebra. astepr ([--](x[-]y)). astepr ([--](x[+][--]y)). astepr ([--]x[+][--][--]y). -Algebra. +algebra. Qed. Definition dminv_is_un_op := @@ -206,7 +190,7 @@ intro x. simpl in |-*. unfold is_inverse in |-*. simpl in |-*. -split; apply eq_quotmod_wd; Algebra. +split; apply eq_quotmod_wd; algebra. Qed. Definition quotmod_as_CGroup := Build_CGroup quotmod_as_CMonoid @@ -221,7 +205,7 @@ Lemma dmplus_is_commutative : commutes dmplus_is_bin_fun. red in |-*. intros x y. simpl in |-*. -apply eq_quotmod_wd; Algebra. +apply eq_quotmod_wd; algebra. Qed. Definition quotmod_as_CAbGroup := Build_CAbGroup quotmod_as_CGroup @@ -242,13 +226,13 @@ intro X. cut (cm ( a1['](x1[-]x2) [+] (a1[-]a2)[']x2) ). intro. assert ( cm (a1['](x1[-]x2)) or cm ((a1[-]a2)[']x2) ). -Algebra. +algebra. elim X1;intros. right. apply (comod_mult A cm (x1[-]x2) a1); assumption. left. cut ( (a1[-]a2)[']x2 [#] Zero). -intro X2; cut ((a1[-]a2)[#]Zero); Algebra. +intro X2; cut ((a1[-]a2)[#]Zero); algebra. apply (mu_axap0_aap0 R A (a1[-]a2) x2); assumption. apply (comod_apzero A cm); assumption. apply (comod_wd A cm (a1[']x1 [-] a2[']x2) ); try assumption. @@ -271,7 +255,7 @@ astepr (a1[']x1 [+] [--]a2[']x2). astepr (a1[']x1 [+] [--](a2[']x2)). Step_final (a1[']x1 [-] a2[']x2). astepl ((a1[']x2 [+] [--]a2[']x2) [+] (a1[']x1 [+] a1['][--]x2)). -apply plus_resp_eq; Algebra. +apply plus_resp_eq; algebra. Qed. Definition dmmu_is_bin_fun := @@ -280,7 +264,7 @@ quotmod_as_CAbGroup (rm_mu A) dmmu_is_ext. Lemma quotmod_is_RModule : is_RModule quotmod_as_CAbGroup dmmu_is_bin_fun. -apply Build_is_RModule; intuition; simpl in |-*; apply eq_quotmod_wd; Algebra. +apply Build_is_RModule; intuition; simpl in |-*; apply eq_quotmod_wd; algebra. Qed. Definition quotmod_as_RModule := Build_RModule R quotmod_as_CAbGroup diff --git a/algebra/CQuotient_Rings.v b/algebra/CQuotient_Rings.v index ded127c8d..6b142df4b 100644 --- a/algebra/CQuotient_Rings.v +++ b/algebra/CQuotient_Rings.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* CQuotient_Rings.v, v1.0, 28april2004, Bart Kirkels *) (** printing [+] %\ensuremath+% #+# *) @@ -47,8 +31,8 @@ Lemma ap_quotring_irreflexive : irreflexive ap_quotring. red in |-*. intro x. unfold ap_quotring in |-*. -assert (x[-]x[=]Zero); Algebra. -assert (Not ((cipred R C) Zero)); Algebra. +assert (x[-]x[=]Zero); algebra. +assert (Not ((cipred R C) Zero)); algebra. intro. apply H0. apply (coideal_wd R C (x[-]x) Zero); auto. Qed. @@ -60,7 +44,7 @@ unfold ap_quotring. intro X. cut (C [--]One and C (y[-]x)). intuition. apply (coideal_mult R C [--]One (y[-]x)). -apply (coideal_wd R C (x[-]y) ([--]One[*](y[-]x))); Algebra. +apply (coideal_wd R C (x[-]y) ([--]One[*](y[-]x))); algebra. astepr [--](y[-]x). astepr [--](y[+][--]x). astepr ([--][--]x[+][--]y). @@ -92,8 +76,8 @@ Definition eq_quotring (x y:R) := Not (C(x[-]y)). Lemma eq_quotring_wd : forall (x y:R), x[=]y -> (eq_quotring x y). intros x y X; auto. red in |-*; intro X0. -assert ((cipred R C)(Zero)); Algebra. -apply (coideal_wd R C (x[-]y) Zero); Algebra. +assert ((cipred R C)(Zero)); algebra. +apply (coideal_wd R C (x[-]y) Zero); algebra. apply x_minus_x; auto. apply (coideal_nonzero R C); assumption. Qed. @@ -138,7 +122,7 @@ astepr (([--]y2[+][--]x2)[+]x1[+]y1). astepr (([--]y2[+][--]x2)[+](x1[+]y1)). astepr ((x1[+]y1)[+]([--]y2[+][--]x2)). astepr ((x1[+]y1)[+][--](x2[+]y2)). -Algebra. +algebra. Qed. Definition drplus_is_bin_fun := @@ -148,7 +132,7 @@ quotring_as_CSetoid (csg_op (c:=R)) drplus_is_ext. Lemma drplus_is_assoc : associative drplus_is_bin_fun. red in |-*; auto. intros x y z; simpl in |-*. -apply eq_quotring_wd; Algebra. +apply eq_quotring_wd; algebra. Qed. Definition quotring_as_CSemiGroup := Build_CSemiGroup quotring_as_CSetoid @@ -162,12 +146,12 @@ drplus_is_bin_fun drplus_is_assoc. Lemma zero_as_rht_unit : is_rht_unit drplus_is_bin_fun Zero. red in |-*; intro x. simpl in |-*. -apply eq_quotring_wd; Algebra. +apply eq_quotring_wd; algebra. Qed. Lemma zero_as_lft_unit : is_lft_unit drplus_is_bin_fun Zero. red in |-*; intro x; simpl in |-*. -apply eq_quotring_wd; Algebra. +apply eq_quotring_wd; algebra. Qed. Definition quotring_is_CMonoid := Build_is_CMonoid quotring_as_CSemiGroup @@ -189,9 +173,9 @@ simpl in |-*. unfold ap_quotring in |-*. intro X. cut (C (x[-]y) and C [--]One). intuition. -apply (coideal_mult R C (x[-]y) [--]One); Algebra. -apply (coideal_wd R C ([--]One[*](x[-]y)) ((x[-]y)[*][--]One)); Algebra. -apply (coideal_wd R C ([--]x[-][--]y) ([--]One[*](x[-]y))); Algebra. +apply (coideal_mult R C (x[-]y) [--]One); algebra. +apply (coideal_wd R C ([--]One[*](x[-]y)) ((x[-]y)[*][--]One)); algebra. +apply (coideal_wd R C ([--]x[-][--]y) ([--]One[*](x[-]y))); algebra. astepr ([--](x[-]y)). astepr ([--](x[+][--]y)). Step_final ([--]x[+][--][--]y). @@ -206,7 +190,7 @@ intro x. simpl in |-*. unfold is_inverse in |-*. simpl in |-*. -split; apply eq_quotring_wd; Algebra. +split; apply eq_quotring_wd; algebra. Qed. Definition quotring_as_CGroup := Build_CGroup quotring_as_CMonoid @@ -221,7 +205,7 @@ Lemma drplus_is_commutative : commutes drplus_is_bin_fun. red in |-*. intros x y. simpl in |-*. -apply eq_quotring_wd; Algebra. +apply eq_quotring_wd; algebra. Qed. Definition quotring_as_CAbGroup := Build_CAbGroup quotring_as_CGroup @@ -242,7 +226,7 @@ unfold ap_quotring. intro X. cut (C ((x1[*](y1[-]y2)) [+] ((x1[-]x2)[*]y2))). intro. -assert (C (x1[*](y1[-]y2)) or C ((x1[-]x2)[*]y2)); Algebra. +assert (C (x1[*](y1[-]y2)) or C ((x1[-]x2)[*]y2)); algebra. elim X1; intros. right. cut (C x1 and C (y1[-]y2)). intuition. apply coideal_mult; assumption. @@ -271,28 +255,28 @@ Build_CSetoid_bin_op quotring_as_CAbGroup (cr_mult (c:=R)) drmult_is_ext. Lemma drmult_associative : associative drmult_is_bin_op. red in |-*; simpl in |-*. intros x y z; apply eq_quotring_wd. -Algebra. +algebra. Qed. Lemma drmult_monoid : is_CMonoid (Build_CSemiGroup quotring_as_CAbGroup drmult_is_bin_op drmult_associative) One. apply Build_is_CMonoid; red in |-*; intro x; simpl in |-*; -apply eq_quotring_wd; Algebra. +apply eq_quotring_wd; algebra. Qed. Lemma drmult_commutes : commutes drmult_is_bin_op. -red in |-*; simpl in |-*; intros x y; apply eq_quotring_wd; Algebra. +red in |-*; simpl in |-*; intros x y; apply eq_quotring_wd; algebra. Qed. Lemma quotring_distr : distributive drmult_is_bin_op drplus_is_bin_fun. red in |-*; simpl in |-*; intros x y z. -apply eq_quotring_wd; Algebra. +apply eq_quotring_wd; algebra. Qed. Lemma quotring_nontriv : (One:quotring_as_CAbGroup) [#] (Zero:quotring_as_CAbGroup). simpl in |-*. unfold ap_quotring. -apply (coideal_wd R C One (One[-]Zero)); Algebra. +apply (coideal_wd R C One (One[-]Zero)); algebra. Qed. Definition quotring_is_CRing := Build_is_CRing quotring_as_CAbGroup One diff --git a/algebra/CRing_Homomorphisms.v b/algebra/CRing_Homomorphisms.v index 9c4624513..cee25c7fc 100644 --- a/algebra/CRing_Homomorphisms.v +++ b/algebra/CRing_Homomorphisms.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* CRing_Homomorphisms.v, v1.0, 28april2004, Bart Kirkels *) (** printing [+] %\ensuremath+% #+# *) diff --git a/algebra/CRings.v b/algebra/CRings.v index dc222ccc2..dcd61d25d 100644 --- a/algebra/CRings.v +++ b/algebra/CRings.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) (** printing [*] %\ensuremath\times% #×# *) @@ -123,15 +107,15 @@ elim (cr_proof R); auto. Qed. Lemma mult_wd : forall x1 x2 y1 y2 : R, x1 [=] x2 -> y1 [=] y2 -> x1[*]y1 [=] x2[*]y2. -intros; Algebra. +intros; algebra. Qed. Lemma mult_wdl : forall x1 x2 y : R, x1 [=] x2 -> x1[*]y [=] x2[*]y. -intros; Algebra. +intros; algebra. Qed. Lemma mult_wdr : forall x y1 y2 : R, y1 [=] y2 -> x[*]y1 [=] x[*]y2. -intros; Algebra. +intros; algebra. Qed. (* Begin_SpecReals *) @@ -345,7 +329,7 @@ Fixpoint nexp (m : nat) : R -> R := Lemma nexp_well_def : forall n, fun_wd (nexp n). intro n; induction n as [| n Hrecn]; red in |- *; intros; simpl in |- *; - Algebra. + algebra. Qed. Lemma nexp_strong_ext : forall n, fun_strext (nexp n). @@ -394,7 +378,7 @@ Definition Char0 := forall n : nat, 0 < n -> nring n [#] Zero. Lemma nring_comm_plus : forall n m, nring (n + m) [=] nring n[+]nring m. intros n m; induction n as [| n Hrecn]; simpl in |- *. - Algebra. + algebra. astepr (nring n[+] (One[+]nring m)). astepr (nring n[+] (nring m[+]One)). Step_final (nring n[+]nring m[+]One). @@ -402,7 +386,7 @@ Qed. Lemma nring_comm_mult : forall n m, nring (n * m) [=] nring n[*]nring m. intros n m; induction n as [| n Hrecn]; simpl in |- *. - Algebra. + algebra. apply eq_transitive_unfolded with (nring m[+]nring (n * m)). apply (nring_comm_plus m (n * m)). astepr (nring n[*]nring m[+]One[*]nring m). astepr (nring n[*]nring m[+]nring m). @@ -438,14 +422,14 @@ Notation TwentyFour := (nring 24). Notation FortyEight := (nring 48). Lemma one_plus_one : forall R : CRing, One[+]One [=] (Two:R). -simpl in |- *; Algebra. +simpl in |- *; algebra. Qed. Lemma x_plus_x : forall (R : CRing) (x : R), x[+]x [=] Two[*]x. intros R x. astepl (One[*]x[+]One[*]x). astepl ((One[+]One) [*]x). -simpl in |- *; Algebra. +simpl in |- *; algebra. Qed. Hint Resolve one_plus_one x_plus_x: algebra. @@ -497,7 +481,7 @@ one. It is kept to avoid having to redo all the proofs. Definition zring_old k : R := caseZ_diff k (fun m n => nring m[-]nring n). Lemma zring_old_zero : zring_old 0 [=] Zero. -simpl in |- *; Algebra. +simpl in |- *; algebra. Qed. Hint Resolve zring_old_zero: algebra. @@ -523,7 +507,7 @@ astepr (nring (R:=R) n[+]nring p). astepr (nring (R:=R) (n + p)). astepl (nring (R:=R) (m + q)). rewrite H. -Algebra. +algebra. Qed. Hint Resolve zring_old_diff. @@ -532,7 +516,7 @@ Lemma zring_old_plus_nat : forall n : nat, zring_old n [=] nring n. intro n. replace (n:Z) with (n - 0%nat)%Z. astepl (nring (R:=R) n[-]nring 0). - simpl in |- *; Algebra. + simpl in |- *; algebra. simpl in |- *; auto with zarith. Qed. @@ -542,7 +526,7 @@ Lemma zring_old_inv_nat : forall n : nat, zring_old (- n) [=] [--] (nring n). intro n. replace (- n)%Z with (0%nat - n)%Z. astepl (nring 0[-]nring (R:=R) n). - simpl in |- *; Algebra. + simpl in |- *; algebra. simpl in |- *; auto. Qed. @@ -565,7 +549,7 @@ unfold cg_minus in |- *. astepl (nring m[+] (nring m0[+] [--] (nring n[+]nring n0)):R). astepr (nring m[+] ( [--] (nring n) [+] (nring m0[+] [--] (nring n0))):R). apply bin_op_wd_unfolded. - Algebra. + algebra. astepl (nring m0[+] ( [--] (nring n) [+] [--] (nring n0)):R). astepl (nring m0[+] [--] (nring n) [+] [--] (nring n0):R). Step_final ( [--] (nring n) [+]nring m0[+] [--] (nring n0):R). @@ -640,7 +624,7 @@ astepl (nring (R:=R) m[*]nring m0[+] (nring n[*]nring n0[+] [--] (nring n[*]nring m0[+]nring m[*]nring n0))). apply bin_op_wd_unfolded. - Algebra. + algebra. astepl (nring (R:=R) n[*]nring n0[+] ( [--] (nring n[*]nring m0) [+] [--] (nring m[*]nring n0))). @@ -703,7 +687,7 @@ Definition zring (z : Z) : R := end. Lemma pring_aux_lemma : forall p r r', r [=] r' -> pring_aux p r [=] pring_aux p r'. -simple induction p; simpl in |- *; Algebra. +simple induction p; simpl in |- *; algebra. Qed. Lemma double_nring : forall n, Two[*]nring (R:=R) n [=] nring (R:=R) (n + n). @@ -721,30 +705,30 @@ Step_final (nring (R:=R) n[+]nring (R:=R) (Pmult_nat p0 (n + n))). Step_final (pring_aux p0 (nring (n + n))). -Algebra. +algebra. Qed. Hint Resolve pring_aux_nring: algebra. Lemma pring_convert : forall p, pring p [=] nring (nat_of_P p). intros; unfold pring, nat_of_P in |- *; simpl in |- *. astepr (pring_aux p (nring 1)). -simpl in |- *; Algebra. +simpl in |- *; algebra. Qed. Hint Resolve pring_convert: algebra. Lemma zring_zring_old : forall z : Z, zring z [=] zring_old z. simple induction z; simpl in |- *; intros. -Algebra. +algebra. astepr (nring (R:=R) (nat_of_P p)). -Algebra. +algebra. astepr ( [--] (nring (R:=R) (nat_of_P p))). -Algebra. +algebra. Qed. Hint Resolve zring_zring_old: algebra. Lemma zring_zero : zring 0 [=] Zero. -simpl in |- *; Algebra. +simpl in |- *; algebra. Qed. Lemma zring_diff : forall m n : nat, zring (m - n) [=] nring m[-]nring n. @@ -786,7 +770,7 @@ Qed. Lemma zring_one : zring 1 [=] One. simpl in |- *. unfold pring in |- *. -Algebra. +algebra. Qed. Lemma zring_inv_one : forall x, zring (-1) [*]x [=] [--]x. @@ -827,7 +811,7 @@ Fixpoint Sum_upto (f : nat -> R) (n : nat) {struct n} : R := end. Lemma sum_upto_O : forall f : nat -> R, Sum_upto f 0 [=] Zero. -Algebra. +algebra. Qed. Definition Sum_from_upto f m n : R := Sum_upto f n[-]Sum_upto f m. @@ -861,7 +845,7 @@ Fixpoint List_Sum_upto (l : list R) (n : nat) {struct n} : R := end. Lemma list_sum_upto_O : forall l : list R, List_Sum_upto l 0 [=] Zero. -Algebra. +algebra. Qed. Definition List_Sum_from_upto l m n := List_Sum_upto l n[-]List_Sum_upto l m. @@ -904,7 +888,7 @@ Lemma mult_distr_sum0_lft : forall (f : nat -> R) x n, Sum0 n (fun i => x[*]f i) [=] x[*]Sum0 n f. intros f x n. induction n as [| n Hrecn]. - simpl in |- *; Algebra. + simpl in |- *; algebra. simpl in |- *. Step_final (x[*]Sum0 n f[+]x[*]f n). Qed. @@ -928,7 +912,7 @@ Qed. Lemma sumx_const : forall n (x : R), Sumx (fun i (_ : i < n) => x) [=] nring n[*]x. intros n x; induction n as [| n Hrecn]. - simpl in |- *; Algebra. + simpl in |- *; algebra. simpl in |- *. astepr (nring n[*]x[+]One[*]x). Step_final (nring n[*]x[+]x). @@ -950,7 +934,7 @@ Section NExp_properties. Variable R : CRing. Lemma nexp_wd : forall (x y : R) n, x [=] y -> x[^]n [=] y[^]n. -Algebra. +algebra. Qed. Lemma nexp_strext : forall (x y : R) n, x[^]n [#] y[^]n -> x [#] y. @@ -981,7 +965,7 @@ Hint Resolve nexp_plus: algebra. Lemma one_nexp : forall n : nat, (One:R) [^]n [=] One. intro n. induction n as [| n Hrecn]. - Algebra. + algebra. astepl ((One:R) [*]One[^]n). Step_final ((One:R) [*]One). Qed. @@ -1011,7 +995,7 @@ astepl ((x[*]x[^]m) [^]n). astepl (x[^]n[*] (x[^]m) [^]n). astepl (x[^]n[*]x[^] (m * n)). astepl (x[^] (n + m * n)). -replace (n + m * n) with (S m * n); Algebra. +replace (n + m * n) with (S m * n); algebra. Qed. Hint Resolve nexp_mult: algebra. @@ -1096,7 +1080,7 @@ intros x y. unfold cg_minus in |- *. eapply eq_transitive_unfolded. apply square_plus. -Algebra. +algebra. Qed. Lemma nexp_funny : forall x y : R, (x[+]y) [*] (x[-]y) [=] x[^]2[-]y[^]2. diff --git a/algebra/CSemiGroups.v b/algebra/CSemiGroups.v index 1e29a5ce7..bb559a7fa 100644 --- a/algebra/CSemiGroups.v +++ b/algebra/CSemiGroups.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) (** printing [+] %\ensuremath+% #+# *) diff --git a/algebra/CSetoidFun.v b/algebra/CSetoidFun.v index e60cf0ac7..cbfbe0fdc 100644 --- a/algebra/CSetoidFun.v +++ b/algebra/CSetoidFun.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export CSetoids. diff --git a/algebra/CSetoidInc.v b/algebra/CSetoidInc.v index 7e25cfbda..b9fa48f73 100644 --- a/algebra/CSetoidInc.v +++ b/algebra/CSetoidInc.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) (** printing included %\ensuremath{\subseteq}% #⊆# *) diff --git a/algebra/CSetoids.v b/algebra/CSetoids.v index 574eb35ee..e732bb0d8 100644 --- a/algebra/CSetoids.v +++ b/algebra/CSetoids.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id.v,v 1.18 2002/11/25 14:43:42 lcf Exp $ *) (** printing [=] %\ensuremath{\equiv}% #≡# *) @@ -1314,7 +1298,7 @@ End SubCSetoids. (* End_SpecReals *) (* begin hide *) -Ltac Step_final x := apply eq_transitive_unfolded with x; Algebra. +Ltac Step_final x := apply eq_transitive_unfolded with x; algebra. (* end hide *) Tactic Notation "Step_final" constr(c) := Step_final c. diff --git a/algebra/CSums.v b/algebra/CSums.v index 8cb8937a9..d132e5e5f 100644 --- a/algebra/CSums.v +++ b/algebra/CSums.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) (** printing Sum0 %\ensuremath{\sum_0}% #∑0# *) @@ -74,7 +58,7 @@ Lemma part_tot_nat_fun_ch2 : forall n (f : forall i, i < n -> G) i, intros n f i Hi. unfold part_tot_nat_fun in |- *. elim le_lt_dec; intro. - simpl in |- *; Algebra. + simpl in |- *; algebra. elimtype False; apply (le_not_lt n i); auto. Qed. @@ -121,7 +105,7 @@ Lemma Sum_empty : forall n f, 0 < n -> Sum n (pred n) f [=] Zero. intros n f H. unfold Sum in |- *. rewrite <- (S_pred _ _ H). -unfold Sum1 in |- *; Algebra. +unfold Sum1 in |- *; algebra. Qed. Hint Resolve Sum_empty: algebra. @@ -149,13 +133,13 @@ astepr (Sum0 (S n) f[+]f m[-]Sum0 (S m) f). astepr (Sum0 (S n) f[+] (f m[-]Sum0 (S m) f)). unfold cg_minus in |- *. apply bin_op_wd_unfolded. -Algebra. +algebra. simpl in |- *. astepr (f m[+] [--] (f m[+]Sum0 m f)). astepr (f m[+] ([--] (f m) [+] [--] (Sum0 m f))). astepr (f m[+] [--] (f m) [+] [--] (Sum0 m f)). astepr (Zero[+] [--] (Sum0 m f)). -Algebra. +algebra. Qed. Lemma Sum_last : forall m n f, Sum m (S n) f [=] Sum m n f[+]f (S n). @@ -166,7 +150,7 @@ simpl in |- *. unfold cg_minus in |- *. astepl (Sum0 n f[+]f n[+] (f (S n) [+] [--] (Sum0 m f))). astepr (Sum0 n f[+]f n[+] ([--] (Sum0 m f) [+]f (S n))). -Algebra. +algebra. Qed. Hint Resolve Sum_last: algebra. @@ -268,14 +252,14 @@ elim (bin_op_strext_unfolded _ _ _ _ _ _ H1); clear H1; intro H1. eapply ap_wdl_unfolded. eapply ap_wdr_unfolded. apply H'. - Algebra. - Algebra. + algebra. + algebra. exists n. exists (lt_n_Sn n). eapply ap_wdl_unfolded. eapply ap_wdr_unfolded. apply H1. - Algebra. -Algebra. + algebra. +algebra. Qed. Lemma Sum0_strext' : forall f g n, Sum0 n f [#] Sum0 n g -> {i : nat | f i [#] g i}. @@ -292,7 +276,7 @@ Qed. Lemma Sum0_wd : forall m f f', (forall i, f i [=] f' i) -> Sum0 m f [=] Sum0 m f'. intros m f f' H. -elim m; simpl in |- *; Algebra. +elim m; simpl in |- *; algebra. Qed. Lemma Sum_wd : forall m n f f', (forall i, f i [=] f' i) -> Sum m n f [=] Sum m n f'. @@ -307,7 +291,7 @@ apply Sum0_wd; exact H. Qed. Lemma Sumx_wd : forall n f g, (forall i H, f i H [=] g i H) -> Sumx n f [=] Sumx n g. -intro n; elim n; intros; simpl in |- *; Algebra. +intro n; elim n; intros; simpl in |- *; algebra. Qed. Lemma Sum_wd' : forall m n, m <= S n -> forall f f', @@ -335,13 +319,13 @@ elim le_lt_dec; intro H3; [ simpl in |- * | elimtype False; apply (le_not_lt i n); auto ]. elim le_lt_dec; intro H4; [ simpl in |- * | elimtype False; apply (le_not_lt m i); auto ]. -Algebra. +algebra. Qed. Lemma Sum0_plus_Sum0 : forall f g m, Sum0 m (fun i => f i[+]g i) [=] Sum0 m f[+]Sum0 m g. intros f g m. elim m. - simpl in |- *; Algebra. + simpl in |- *; algebra. intros n H. simpl in |- *. astepl (Sum0 n f[+]Sum0 n g[+] (f n[+]g n)). @@ -364,13 +348,13 @@ astepr (Sum0 (S n) f[+] [--] (Sum0 m f) [+]Sum0 (S n) g[+] [--] (Sum0 m g)). apply bin_op_wd_unfolded. astepl (Sum0 (S n) f[+] (Sum0 (S n) g[+] [--] (Sum0 m f))). astepl (Sum0 (S n) f[+] ([--] (Sum0 m f) [+]Sum0 (S n) g)). - Algebra. -Algebra. + algebra. +algebra. Qed. Lemma Sumx_plus_Sumx : forall n f g, Sumx n f[+]Sumx n g [=] Sumx n (fun i Hi => f i Hi[+]g i Hi). intro n; induction n as [| n Hrecn]. - intros; simpl in |- *; Algebra. + intros; simpl in |- *; algebra. intros f g; simpl in |- *. apply eq_transitive_unfolded @@ -385,7 +369,7 @@ apply astepl (Sf[+] (fn[+]Sg) [+]gn). astepl (Sf[+] (Sg[+]fn) [+]gn). Step_final (Sf[+]Sg[+]fn[+]gn). -apply bin_op_wd_unfolded; Algebra. +apply bin_op_wd_unfolded; algebra. apply Hrecn with @@ -402,13 +386,13 @@ eapply eq_transitive_unfolded. 2: apply Sum_plus_Sum. apply Sum_wd; intro i. elim le_lt_dec; intro H0; simpl in |- *; elim le_lt_dec; intro H1; - simpl in |- *; Algebra. + simpl in |- *; algebra. Qed. Lemma inv_Sum0 : forall f n, Sum0 n (fun i => [--] (f i)) [=] [--] (Sum0 n f). intros f n. induction n as [| n Hrecn]. - simpl in |- *; Algebra. + simpl in |- *; algebra. simpl in |- *. Step_final ([--] (Sum0 n f) [+] [--] (f n)). Qed. @@ -428,14 +412,14 @@ Hint Resolve inv_Sum: algebra. Lemma inv_Sumx : forall n f, [--] (Sumx n f) [=] Sumx _ (fun i Hi => [--] (f i Hi)). intro n; induction n as [| n Hrecn]. - simpl in |- *; Algebra. + simpl in |- *; algebra. intro f; simpl in |- *. astepl ([--] (Sumx _ (fun i (l : i < n) => f i (lt_S i n l))) [+] [--] (f n (lt_n_Sn n))). apply bin_op_wd_unfolded. apply Hrecn with (f := fun i (l : i < n) => f i (lt_S i n l)). -Algebra. +algebra. Qed. Lemma inv_Sum2 : forall m n : nat, m <= S n -> forall f, @@ -447,7 +431,7 @@ eapply eq_transitive_unfolded. 2: apply inv_Sum. apply Sum_wd; intro i. elim le_lt_dec; intro; simpl in |- *; elim le_lt_dec; intro; simpl in |- *; - Algebra. + algebra. Qed. Lemma Sum_minus_Sum : forall f g m n, Sum m n (fun i => f i[-]g i) [=] Sum m n f[-]Sum m n g. @@ -477,7 +461,7 @@ eapply eq_transitive_unfolded. 2: apply Sumx_plus_Sumx with (f := f) (g := fun i (Hi : i < n) => [--] (g i Hi)). -apply bin_op_wd_unfolded; Algebra. +apply bin_op_wd_unfolded; algebra. apply inv_Sumx. Qed. @@ -492,7 +476,7 @@ eapply eq_transitive_unfolded. (g := fun i (Hm : m <= i) (Hn : i <= n) => [--] (g i Hm Hn)); assumption. apply bin_op_wd_unfolded. - Algebra. + algebra. apply inv_Sum2; assumption. Qed. @@ -527,7 +511,7 @@ intros a k l H H0. induction l as [| l Hrecl]. replace k with 0. astepl (a 0). apply H0. auto. auto with arith. auto. inversion H. auto. inversion H2. rewrite H. - unfold Sum in |- *. unfold Sum1 in |- *. Algebra. + unfold Sum in |- *. unfold Sum1 in |- *. algebra. elim (le_lt_eq_dec k (S (S l)) H); intro HH. astepl (Sum k l a[+]a (S l)). astepr (Zero[+] (Zero:G)). @@ -535,7 +519,7 @@ elim (le_lt_eq_dec k (S (S l)) H); intro HH. apply Hrecl; auto with arith. apply H0; auto with arith. rewrite HH. -unfold Sum in |- *. unfold Sum1 in |- *. Algebra. +unfold Sum in |- *. unfold Sum1 in |- *. algebra. Qed. Lemma Sum_term : forall f m i n, m <= i -> i <= n -> @@ -552,16 +536,16 @@ apply bin_op_wd_unfolded. apply bin_op_wd_unfolded. apply Sum_zero. rewrite Hm; auto. intros i H3 H4. apply H1. auto. omega. omega. - Algebra. + algebra. rewrite <- H2 in H. rewrite <- H2. - inversion H. Algebra. + inversion H. algebra. apply Sum_zero. auto with arith. intros. apply H1. omega. omega. auto. Qed. Lemma Sum0_shift : forall f g n, (forall i, f i [=] g (S i)) -> g 0[+]Sum0 n f [=] Sum0 (S n) g. intros a b l H. induction l as [| l Hrecl]. - simpl in |- *; Algebra. + simpl in |- *; algebra. simpl in |- *. astepl (b 0[+]Sum0 l a[+]a l). Step_final (Sum0 (S l) b[+]a l). @@ -588,7 +572,7 @@ pattern i at 2 in |- *; rewrite (plus_n_O i); apply H; auto. intros; repeat rewrite <- plus_n_Sm. apply eq_transitive_unfolded with (Sum (m + k) (n + k) (fun n : nat => g (S n))). -2: apply Sum_shift; Algebra. +2: apply Sum_shift; algebra. apply Hreck. intros; rewrite plus_n_Sm; apply H; auto with arith. auto. @@ -596,7 +580,7 @@ Qed. Lemma Sumx_Sum0 : forall n f g, (forall i Hi, f i Hi [=] g i) -> Sumx n f [=] Sum0 n g. -intro; induction n as [| n Hrecn]; simpl in |- *; Algebra. +intro; induction n as [| n Hrecn]; simpl in |- *; algebra. Qed. End Sums. @@ -622,7 +606,7 @@ Lemma Mengolli_Sum : forall n (f : forall i, i <= n -> G) (g : forall i, i < n - Sumx g [=] f n (le_n n) [-]f 0 (le_O_n n). intro n; induction n as [| n Hrecn]; intros f g Hf H; simpl in |- *. astepl (f 0 (le_n 0) [-]f 0 (le_n 0)). - apply cg_minus_wd; Algebra. + apply cg_minus_wd; algebra. apply eq_transitive_unfolded with @@ -633,18 +617,18 @@ apply apply bin_op_wd_unfolded. eapply eq_transitive_unfolded. apply H. - apply cg_minus_wd; apply Hf; Algebra. + apply cg_minus_wd; apply Hf; algebra. set (f' := fun i (H : i <= n) => f i (le_S _ _ H)) in *. set (g' := fun i (H : i < n) => g i (lt_S _ _ H)) in *. apply eq_transitive_unfolded with (f' n (le_n n) [-]f' 0 (le_O_n n)). apply Hrecn. - red in |- *; intros; unfold f' in |- *; apply Hf; Algebra. + red in |- *; intros; unfold f' in |- *; apply Hf; algebra. intros i Hi. unfold f' in |- *; unfold g' in |- *. eapply eq_transitive_unfolded. apply H. - apply cg_minus_wd; apply Hf; Algebra. - unfold f' in |- *; apply cg_minus_wd; apply Hf; Algebra. + apply cg_minus_wd; apply Hf; algebra. + unfold f' in |- *; apply cg_minus_wd; apply Hf; algebra. astepr (f (S n) (le_n (S n)) [+]Zero[-]f 0 (le_O_n (S n))). astepr (f (S n) (le_n (S n)) [+] @@ -688,7 +672,7 @@ Lemma str_Mengolli_Sum_gen : forall (f g : nat -> G) m n, m <= S n -> intros f g m n H H0. apply eq_transitive_unfolded with (Sum m n (fun i : nat => f (S i) [-]f i)). apply Sum_wd'; assumption. -apply Mengolli_Sum_gen; [ intro; Algebra | assumption ]. +apply Mengolli_Sum_gen; [ intro; algebra | assumption ]. Qed. Lemma Sumx_to_Sum : forall n, 0 < n -> forall f, nat_less_n_fun f -> @@ -716,7 +700,7 @@ elim (le_lt_eq_dec _ _ H0); clear H H0; intro H. eapply eq_transitive_unfolded. apply part_tot_nat_fun_ch1 with (Hi := lt_S _ _ H0). red in |- *; intros; apply Hf; auto. - Algebra. + algebra. rewrite <- (S_pred _ _ H). apply eq_symmetric_unfolded; apply part_tot_nat_fun_ch1; auto. generalize f Hf; clear Hf f; rewrite <- H. diff --git a/algebra/CVectorSpace.v b/algebra/CVectorSpace.v index 6e88f7726..09da998d8 100644 --- a/algebra/CVectorSpace.v +++ b/algebra/CVectorSpace.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) (** printing ['] %{'}% #'# *) diff --git a/algebra/Cauchy_COF.v b/algebra/Cauchy_COF.v index 306aaadcd..9a6950b68 100644 --- a/algebra/Cauchy_COF.v +++ b/algebra/Cauchy_COF.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export COrdCauchy. diff --git a/algebra/Expon.v b/algebra/Expon.v index 20d7cc0f6..b0e20e276 100644 --- a/algebra/Expon.v +++ b/algebra/Expon.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) (** printing [^^] %\ensuremath{\hat{\ }}% #^# *) @@ -37,7 +21,7 @@ Lemma nexp_resp_ap_zero : forall (x : R) n, x [#] Zero -> x[^]n [#] Zero. intros. elim n. simpl in |- *. -Algebra. +algebra. intros. simpl in |- *. apply mult_resp_ap_zero. @@ -51,7 +35,7 @@ Lemma nexp_distr_div : forall (x y : R) n y_ yn_, (x[/] y[//]y_) [^]n [=] (x[^]n simple induction n. intros. simpl in |- *. -Algebra. +algebra. intros. simpl in |- *. generalize (H y_ (nexp_resp_ap_zero y n0 y_)); intro. @@ -163,7 +147,7 @@ Qed. Lemma nexp_resp_leEq_one : forall c : R, Zero [<=] c -> c [<=] One -> forall n, c[^]n [<=] One. simple induction n. red in |- *; apply eq_imp_leEq. -Algebra. +algebra. clear n; intros. astepl (c[^]n[*]c). astepr ((One:R)[*]One). @@ -213,13 +197,13 @@ Qed. Lemma nexp_distr_recip : forall (x : R) n x_ xn_, (One[/] x[//]x_) [^]n [=] (One[/] x[^]n[//]xn_). intros. induction n as [| n Hrecn]; intros. -simpl in |- *. Algebra. +simpl in |- *. algebra. astepl ((One[/] x[//]x_)[^]n[*] (One[/] x[//]x_)). cut (x[^]n [#] Zero). intro H. astepl ((One[/] x[^]n[//]H)[*] (One[/] x[//]x_)). cut (x[^]n[*]x [#] Zero). intro H2. rstepl (One[/] x[^]n[*]x[//]H2). -apply div_wd; Algebra. +apply div_wd; algebra. apply mult_resp_ap_zero; auto. apply nexp_resp_ap_zero. auto. Qed. @@ -250,11 +234,11 @@ apply shift_leEq_minus. astepl (c[^]N). apply nexp_resp_leEq_one; assumption. apply cg_minus_wd. -Algebra. +algebra. eapply eq_transitive_unfolded. apply nexp_plus. replace n with (m + (n - m)). -Algebra. +algebra. auto with arith. Qed. @@ -363,7 +347,7 @@ Variable R : COrdField. Lemma zexp_zero : forall (x : R) x_, (x[//]x_) [^^] (0) [=] One. intros. unfold zexp in |- *. -Algebra. +algebra. Qed. Hint Resolve zexp_zero: algebra. @@ -374,12 +358,12 @@ unfold zexp in |- *. simpl in |- *. elim n. simpl in |- *. -Algebra. +algebra. intros. simpl in |- *. rewrite nat_of_P_o_P_of_succ_nat_eq_succ. simpl in |- *. -Algebra. +algebra. Qed. Hint Resolve zexp_nexp: algebra. @@ -390,12 +374,12 @@ unfold zexp in |- *. simpl in |- *. elim n. simpl in |- *. -Algebra. +algebra. intros. simpl in |- *. rewrite nat_of_P_o_P_of_succ_nat_eq_succ. simpl in |- *. -Algebra. +algebra. Qed. Hint Resolve zexp_inv_nexp: algebra. @@ -452,13 +436,13 @@ intro. replace (Z_of_nat n + 1)%Z with (S n:Z). astepl (x[^]S n). astepr (x[^]n[*]x). -Algebra. +algebra. rewrite Znat.inj_S. reflexivity. intros. induction n as [| n Hrecn]. simpl in |- *. -Algebra. +algebra. replace (- Z_of_nat (S n) + 1)%Z with (- n)%Z. astepl ((One[/] x[//]Hx) [^]n). astepr ((One[/] x[//]Hx) [^]S n[*]x). @@ -489,7 +473,7 @@ intro. astepl ((One[/] x[//]x_) [^]n). apply nexp_resp_ap_zero. apply div_resp_ap_zero_rev. -Algebra. +algebra. Qed. Hint Resolve zexp_resp_ap_zero: algebra. @@ -504,8 +488,8 @@ intros. apply eq_transitive_unfolded with (One[/] x[^]n[//]nexp_resp_ap_zero n Hx). apply zexp_inv_nexp'. apply div_wd. -Algebra. -Algebra. +algebra. +algebra. intros. rewrite Zopp_involutive. @@ -517,7 +501,7 @@ astepl ((x[*] (One[/] x[//]Hx)) [^]n). astepr (One:R). astepr ((One:R) [^]n). apply nexp_wd. -Algebra. +algebra. Qed. Hint Resolve zexp_inv: algebra. @@ -546,21 +530,21 @@ pattern n in |- *. apply pred_succ_Z_ind. simpl in |- *. replace (m + 0)%Z with m. -Algebra. +algebra. auto with zarith. intros. replace (m + (n0 + 1))%Z with (m + n0 + 1)%Z. astepl ((x[//]Hx) [^^] (m + n0) [*]x). astepr ((x[//]Hx) [^^] (m) [*] ((x[//]Hx) [^^] (n0) [*]x)). astepr ((x[//]Hx) [^^] (m) [*] (x[//]Hx) [^^] (n0) [*]x). -Algebra. +algebra. auto with zarith. intros. replace (m + (n0 - 1))%Z with (m + n0 - 1)%Z. astepl ((x[//]Hx) [^^] (m + n0) [/] x[//]Hx). astepr ((x[//]Hx) [^^] (m) [*] ((x[//]Hx) [^^] (n0) [/] x[//]Hx)). astepr ((x[//]Hx) [^^] (m) [*] (x[//]Hx) [^^] (n0) [/] x[//]Hx). -Algebra. +algebra. unfold Zminus in |- *. auto with zarith. Qed. @@ -574,7 +558,7 @@ replace (m - n)%Z with (m + - n)%Z. astepl ((x[//]Hx) [^^] (m) [*] (x[//]Hx) [^^] (- n)). astepl ((x[//]Hx) [^^] (m) [*] (One[/] (x[//]Hx) [^^] (n) [//]Hexp)). astepl ((x[//]Hx) [^^] (m) [*]One[/] (x[//]Hx) [^^] (n) [//]Hexp). -Algebra. +algebra. reflexivity. Qed. @@ -596,7 +580,7 @@ astepr ((One:R) [/]OneNZ). apply eq_div. astepr ((One:R) [*]One[^]n). astepr ((One:R) [*]One). -Algebra. +algebra. Qed. Hint Resolve one_zexp: algebra. @@ -623,7 +607,7 @@ rstepr (One[/] x[^]n[*]y[^]n[//] mult_resp_ap_zero _ _ _ (nexp_resp_ap_zero n Hx) (nexp_resp_ap_zero n Hy)). apply eq_div. -Algebra. +algebra. Qed. Hint Resolve mult_zexp: algebra. @@ -634,20 +618,20 @@ intros x m n Hx He. pattern n in |- *. apply pred_succ_Z_ind. rewrite <- Zmult_0_r_reverse. -Algebra. +algebra. intros. rewrite Zmult_plus_distr_r. astepr (((x[//]Hx) [^^] (m) [//]He) [^^] (n0) [*] (x[//]Hx) [^^] (m)). rewrite Zmult_1_r. astepl ((x[//]Hx) [^^] (m * n0) [*] (x[//]Hx) [^^] (m)). -Algebra. +algebra. intros. rewrite Basics.Zmult_minus_distr_r. astepr (((x[//]Hx) [^^] (m) [//]He) [^^] (n0) [/] (x[//]Hx) [^^] (m) [//]He). rewrite Zmult_1_r. astepl ((x[//]Hx) [^^] (m * n0) [/] (x[//]Hx) [^^] (m) [//]He). -Algebra. +algebra. Qed. Hint Resolve zexp_mult: algebra. @@ -655,7 +639,7 @@ Hint Resolve zexp_mult: algebra. Lemma zexp_two : forall (x : R) x_, (x[//]x_) [^^] (2) [=] x[*]x. intros. simpl in |- *. -Algebra. +algebra. Qed. Hint Resolve zexp_two: algebra. @@ -672,7 +656,7 @@ astepl ([--]x[*][--]x[//]mult_resp_ap_zero _ _ _ Hneg Hneg) [^^] (Zeven.Zdiv2 m). astepl (x[*]x[//]mult_resp_ap_zero _ _ _ Hx Hx) [^^] (Zeven.Zdiv2 m). astepl ((x[//]Hx) [^^] (2) [//]zexp_resp_ap_zero x 2 Hx) [^^] (Zeven.Zdiv2 m). -Algebra. +algebra. assumption. Qed. @@ -700,7 +684,7 @@ apply Zodd_Zeven_min1. assumption. simpl in |- *. auto. -Algebra. +algebra. change ((m + -1 + 1)%Z = m) in |- *. rewrite <- Zplus_assoc. simpl in |- *. @@ -711,7 +695,7 @@ Qed. Lemma zexp_one : forall (x : R) x_, (x[//]x_) [^^] (1) [=] x. intros. simpl in |- *. -Algebra. +algebra. Qed. Hint Resolve zexp_one: algebra. diff --git a/algebra/ListType.v b/algebra/ListType.v index a221d3332..50683b555 100644 --- a/algebra/ListType.v +++ b/algebra/ListType.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* begin hide *) (***********************************************************************) (* v * The Coq Proof Assistant / The Coq Development Team *) diff --git a/complex/AbsCC.v b/complex/AbsCC.v index 5d2a513ef..5ad0b914e 100644 --- a/complex/AbsCC.v +++ b/complex/AbsCC.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export CComplex. @@ -42,7 +26,7 @@ change (sqrt (x1[^]2[+]x2[^]2) (cc_abs_aid _ x1 x2) [=] sqrt (y1[^]2[+]y2[^]2) (cc_abs_aid _ y1 y2)) in |- *. elim H. clear H. intros. -apply sqrt_wd. Algebra. +apply sqrt_wd. algebra. Qed. Hint Resolve AbsCC_wd: algebra_c. @@ -78,7 +62,7 @@ Hint Resolve cc_mult_abs: algebra. Lemma AbsCC_minzero : forall x : CC, AbsCC (x[-]Zero) [=] AbsCC x. intros. apply AbsCC_wd. -Algebra. +algebra. Qed. Lemma AbsCC_IR : forall x : IR, Zero [<=] x -> AbsCC (cc_IR x) [=] x. @@ -94,7 +78,7 @@ Hint Resolve AbsCC_IR: algebra. Lemma cc_div_abs : forall (x y : CC) y_ y__, AbsCC (x[/] y[//]y_) [=] (AbsCC x[/] AbsCC y[//]y__). intros x y nz anz. rstepl (AbsCC y[*]AbsCC (x[/] y[//]nz) [/] AbsCC y[//]anz). -apply div_wd. 2: Algebra. +apply div_wd. 2: algebra. astepl (AbsCC (y[*] (x[/] y[//]nz))). apply AbsCC_wd. rational. Qed. @@ -103,7 +87,7 @@ Lemma cc_div_abs' : forall (x : CC) (y : IR) y_ y__, Zero [<=] y -> AbsCC (x[/] cc_IR y[//]y__) [=] (AbsCC x[/] y[//]y_). intros x y nz cnz H. rstepl (y[*]AbsCC (x[/] cc_IR y[//]cnz) [/] y[//]nz). -apply div_wd. 2: Algebra. +apply div_wd. 2: algebra. astepl (AbsCC (cc_IR y) [*]AbsCC (x[/] cc_IR y[//]cnz)). astepl (AbsCC (cc_IR y[*] (x[/] cc_IR y[//]cnz))). apply AbsCC_wd. @@ -204,7 +188,7 @@ apply eq_transitive_unfolded with (S := cc_csetoid) (y := cc_IR (x[^]2[+]y[^]2)). eapply l_1_1_2 with (x := x) (y := y). split; simpl in |- *. -2: Algebra. +2: algebra. eapply AbsCC_square_Re_Im with (x := x) (y := y). Qed. @@ -224,7 +208,7 @@ Hint Resolve l_2_1_2: algebra. (* end hide *) Lemma AbsCC_mult_square : forall x y : CC, AbsCC (x[*]y) [^]2 [=] AbsCC x[^]2[*]AbsCC y[^]2. -intros. rstepr ((AbsCC x[*]AbsCC y) [^]2). Algebra. +intros. rstepr ((AbsCC x[*]AbsCC y) [^]2). algebra. Qed. Lemma AbsCC_square_ap_zero : forall z : CC, z [#] Zero -> AbsCC z[^]2 [#] Zero. @@ -250,7 +234,7 @@ apply (y := cc_IR (Re z[^]2[+]Im z[^]2)) (x' := CC_conj z) (y' := cc_IR (AbsCC z[^]2)). -elim z. intros x y. simpl in |- *. split; simpl in |- *; Algebra. +elim z. intros x y. simpl in |- *. split; simpl in |- *; algebra. apply cc_IR_wd. apply AbsCC_square_Re_Im with (x := Re z) (y := Im z). Qed. @@ -361,7 +345,7 @@ astepl (cc_IR [--]Two[*]cc_IR eps). rstepr ( [--]Two[*]cc_IR eps). apply mult_wdl. simpl in |- *. unfold cc_eq in |- *. simpl in |- *. -split; [ Algebra | rational ]. +split; [ algebra | rational ]. Qed. (* The following lemmas are just auxiliary results *) @@ -378,7 +362,7 @@ apply (S := cc_csetoid) (y := z[*] (CC_conj z[/] _[//]cc_IR_resp_ap _ _ (AbsCC_square_ap_zero _ H))). -2: Algebra. +2: algebra. astepr (z[*] (CC_conj z[/] _[//]cc_IR_resp_ap _ _ (AbsCC_square_ap_zero _ H))). apply bin_op_wd_unfolded @@ -388,7 +372,7 @@ apply (x2 := z) (y1 := cc_recip z H) (y2 := CC_conj z[/] _[//]cc_IR_resp_ap _ _ (AbsCC_square_ap_zero _ H)). -Algebra. +algebra. apply cc_recip_char. generalize H. clear H. elim z. intros x y H. simpl in |- *. split; simpl in |- *; rational. Qed. @@ -407,7 +391,7 @@ apply (x' := cc_IR (AbsCC z[^]2)) (y' := cc_IR (AbsCC z[^]2)). apply AbsCC_mult_conj. -Algebra. +algebra. Qed. Let l_4_3_4 : diff --git a/complex/CComplex.v b/complex/CComplex.v index 73b702fd9..856489784 100644 --- a/complex/CComplex.v +++ b/complex/CComplex.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) (** printing Re %\ensuremath{\Re}% #ℜ# *) @@ -92,7 +76,7 @@ Unfold bin_op_wd. Unfold bin_fun_wd. Intros x1 x2 y1 y2. Elim x1. Elim x2. Elim y1. Elim y2. Simpl. Unfold cc_eq. Simpl. Intros. Elim H. Clear H. Intros. Elim H0. Clear H0. Intros. -Split; Algebra. +Split; algebra. Qed. Lemma cc_mult_op_proof : (bin_op_wd cc_csetoid cc_mult). @@ -100,7 +84,7 @@ Unfold bin_op_wd. Unfold bin_fun_wd. Intros x1 x2 y1 y2. Elim x1. Elim x2. Elim y1. Elim y2. Simpl. Unfold cc_eq. Simpl. Intros. Elim H. Clear H. Intros. Elim H0. Clear H0. Intros. -Split; Algebra. +Split; algebra. Qed. Lemma cc_inv_op_proof : (un_op_wd cc_csetoid cc_inv). @@ -108,7 +92,7 @@ Unfold un_op_wd. Unfold fun_wd. Intros x y. Elim x. Elim y. Simpl. Unfold cc_eq. Simpl. Intros. Elim H. Clear H. Intros. -Split; Algebra. +Split; algebra. Qed. *) @@ -160,7 +144,7 @@ Definition cc_mult_op := Build_CSetoid_bin_op _ _ cc_mult_strext. Lemma cc_csg_associative : associative cc_plus_op. unfold associative in |- *. intros. elim x. elim y. elim z. intros. -simpl in |- *. unfold cc_eq in |- *. simpl in |- *. split; Algebra. +simpl in |- *. unfold cc_eq in |- *. simpl in |- *. split; algebra. Qed. Lemma cc_cr_mult_associative : associative cc_mult_op. @@ -173,9 +157,9 @@ Definition cc_csemi_grp := Build_CSemiGroup cc_csetoid _ cc_csg_associative. Lemma cc_cm_proof : is_CMonoid cc_csemi_grp cc_zero. apply Build_is_CMonoid. unfold is_rht_unit in |- *. intros. elim x. intros. -simpl in |- *. unfold cc_eq in |- *. simpl in |- *. split; Algebra. +simpl in |- *. unfold cc_eq in |- *. simpl in |- *. split; algebra. unfold is_lft_unit in |- *. intros. elim x. intros. -simpl in |- *. unfold cc_eq in |- *. simpl in |- *. split; Algebra. +simpl in |- *. unfold cc_eq in |- *. simpl in |- *. split; algebra. Qed. Definition cc_cmonoid := Build_CMonoid _ _ cc_cm_proof. @@ -183,8 +167,8 @@ Definition cc_cmonoid := Build_CMonoid _ _ cc_cm_proof. Lemma cc_cg_proof : is_CGroup cc_cmonoid cc_inv_op. unfold is_CGroup in |- *. intros. elim x. intros. split. -simpl in |- *. unfold cc_eq in |- *. simpl in |- *. split; Algebra. -simpl in |- *. unfold cc_eq in |- *. simpl in |- *. split; Algebra. +simpl in |- *. unfold cc_eq in |- *. simpl in |- *. split; algebra. +simpl in |- *. unfold cc_eq in |- *. simpl in |- *. split; algebra. Qed. Lemma cc_cr_dist : distributive cc_mult_op cc_plus_op. @@ -202,7 +186,7 @@ Definition cc_cabgroup : CAbGroup. apply Build_CAbGroup with cc_cgroup. red in |- *; unfold commutes in |- *. intros. -elim x; elim y; split; simpl in |- *; Algebra. +elim x; elim y; split; simpl in |- *; algebra. Defined. Lemma cc_cr_mult_mon : is_CMonoid @@ -379,7 +363,7 @@ simpl in |- *. unfold cc_eq in |- *. simpl in |- *. split; rational. Qed. Lemma I_wd : forall x x' y y' : IR, x [=] x' -> y [=] y' -> x[+I*]y [=] x'[+I*]y'. -simpl in |- *. unfold cc_eq in |- *. simpl in |- *. Algebra. +simpl in |- *. unfold cc_eq in |- *. simpl in |- *. algebra. Qed. (** ** Properties of [Re] and [Im] *) @@ -410,22 +394,22 @@ Qed. Lemma Re_resp_plus : forall x y : CC, Re (x[+]y) [=] Re x[+]Re y. intros. elim x. intros x1 x2. elim y. intros y1 y2. -simpl in |- *. unfold cc_eq in |- *. Algebra. +simpl in |- *. unfold cc_eq in |- *. algebra. Qed. Lemma Re_resp_inv : forall x y : CC, Re (x[-]y) [=] Re x[-]Re y. intros. elim x. intros x1 x2. elim y. intros y1 y2. -simpl in |- *. unfold cc_eq in |- *. Algebra. +simpl in |- *. unfold cc_eq in |- *. algebra. Qed. Lemma Im_resp_plus : forall x y : CC, Im (x[+]y) [=] Im x[+]Im y. intros. elim x. intros x1 x2. elim y. intros y1 y2. -simpl in |- *. unfold cc_eq in |- *. Algebra. +simpl in |- *. unfold cc_eq in |- *. algebra. Qed. Lemma Im_resp_inv : forall x y : CC, Im (x[-]y) [=] Im x[-]Im y. intros. elim x. intros x1 x2. elim y. intros y1 y2. -simpl in |- *. unfold cc_eq in |- *. Algebra. +simpl in |- *. unfold cc_eq in |- *. algebra. Qed. Lemma cc_calculate_square : forall x y, (x[+I*]y) [^]2 [=] (x[^]2[-]y[^]2) [+I*]x[*]y[*]Two. @@ -444,7 +428,7 @@ Section Conj_properties. Lemma CC_conj_plus : forall c c' : CC, CC_conj (c[+]c') [=] CC_conj c[+]CC_conj c'. intros c c'. elim c. intros x y. elim c'. intros x' y'. -simpl in |- *. unfold cc_eq in |- *. simpl in |- *. split; Algebra. +simpl in |- *. unfold cc_eq in |- *. simpl in |- *. split; algebra. Qed. Lemma CC_conj_mult : forall c c' : CC, CC_conj (c[*]c') [=] CC_conj c[*]CC_conj c'. @@ -463,15 +447,15 @@ right. apply un_op_strext_unfolded with (cg_inv (c:=IR)). auto. Qed. Lemma CC_conj_conj : forall c : CC, CC_conj (CC_conj c) [=] c. -intros. elim c. intros x y. simpl in |- *. unfold cc_eq in |- *. simpl in |- *. split; Algebra. +intros. elim c. intros x y. simpl in |- *. unfold cc_eq in |- *. simpl in |- *. split; algebra. Qed. Lemma CC_conj_zero : CC_conj Zero [=] Zero. -simpl in |- *. unfold cc_eq in |- *. simpl in |- *. split; Algebra. +simpl in |- *. unfold cc_eq in |- *. simpl in |- *. split; algebra. Qed. Lemma CC_conj_one : CC_conj One [=] One. -simpl in |- *. unfold cc_eq in |- *. simpl in |- *. split; Algebra. +simpl in |- *. unfold cc_eq in |- *. simpl in |- *. split; algebra. Qed. Hint Resolve CC_conj_one: algebra. @@ -503,7 +487,7 @@ intro x. simpl in |- *. apply eq_reflexive. Qed. Lemma cc_IR_wd : forall x y : IR, x [=] y -> cc_IR x [=] cc_IR y. -intros. simpl in |- *. unfold cc_eq in |- *. simpl in |- *. split; Algebra. +intros. simpl in |- *. unfold cc_eq in |- *. simpl in |- *. split; algebra. Qed. Hint Resolve cc_IR_wd: algebra_c. @@ -527,23 +511,23 @@ intros. simpl in |- *. unfold cc_eq in |- *. simpl in |- *. split; rational. Qed. Lemma cc_IR_plus : forall x y : IR, cc_IR x[+]cc_IR y [=] cc_IR (x[+]y). -intros. simpl in |- *. unfold cc_eq in |- *. simpl in |- *. split; Algebra. +intros. simpl in |- *. unfold cc_eq in |- *. simpl in |- *. split; algebra. Qed. Hint Resolve cc_IR_plus: algebra. Lemma cc_IR_minus : forall x y : IR, cc_IR x[-]cc_IR y [=] cc_IR (x[-]y). -intros. simpl in |- *. unfold cc_eq in |- *. simpl in |- *. split; Algebra. +intros. simpl in |- *. unfold cc_eq in |- *. simpl in |- *. split; algebra. Qed. Lemma cc_IR_zero : cc_IR Zero [=] Zero. -simpl in |- *. unfold cc_eq in |- *. simpl in |- *. split; Algebra. +simpl in |- *. unfold cc_eq in |- *. simpl in |- *. split; algebra. Qed. Hint Resolve cc_IR_zero: algebra. Lemma cc_IR_one : cc_IR One [=] One. -simpl in |- *. unfold cc_eq in |- *. simpl in |- *. split; Algebra. +simpl in |- *. unfold cc_eq in |- *. simpl in |- *. split; algebra. Qed. Hint Resolve cc_IR_one: algebra. diff --git a/complex/Complex_Exponential.v b/complex/Complex_Exponential.v index ea83ef253..66d2896f4 100644 --- a/complex/Complex_Exponential.v +++ b/complex/Complex_Exponential.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) (** printing ExpCC %\ensuremath{\exp_{\mathbb C}}% *) @@ -53,9 +37,9 @@ unfold ExpCC in |- *. apply bin_op_wd_unfolded. apply cc_IR_wd. apply Exp_wd. -Algebra. +algebra. -split; Algebra. +split; algebra. Qed. @@ -67,9 +51,9 @@ Lemma ExpCC_equation_aid_2 : (Sin (Im z1) [*]Cos (Im z2) [+]Cos (Im z1) [*]Sin (Im z2))). intros z1 z2. apply bin_op_wd_unfolded. -apply cc_IR_wd. Algebra. +apply cc_IR_wd. algebra. -split; Algebra. +split; algebra. Qed. @@ -88,7 +72,7 @@ set (c1 := Cos (Im z1)) in *. set (c2 := Cos (Im z2)) in *. set (s1 := Sin (Im z1)) in *. set (s2 := Sin (Im z2)) in *. -split; simpl in |- *; Algebra. +split; simpl in |- *; algebra. Qed. Lemma ExpCC_equation_aid_4 : @@ -138,7 +122,7 @@ apply eq_transitive_unfolded with (S := cc_csetoid) (y := ExpCC Zero). astepl (ExpCC (z[+][--]z)). apply ExpCC_wd. rational. -Algebra. +algebra. Qed. Hint Resolve ExpCC_inv_aid: algebra. @@ -174,8 +158,8 @@ astepl (ExpCC z[^]n0[*]ExpCC z). astepl (ExpCC (nring n0[*]z) [*]ExpCC z). astepl (ExpCC (nring n0[*]z[+]z)). apply ExpCC_wd. -Algebra. -rstepl ((nring n0[+]One) [*]z). Algebra. +algebra. +rstepl ((nring n0[+]One) [*]z). algebra. Qed. Hint Resolve ExpCC_pow: algebra. @@ -248,7 +232,7 @@ intro x. unfold ExpCC in |- *. astepl (cc_IR (Exp x) [*] (Cos (Im (cc_IR x)) [+I*]Sin (Im (cc_IR x)))). astepr (cc_IR (Exp x) [*]One). apply bin_op_wd_unfolded. -Algebra. +algebra. astepl (Cos Zero[+I*]Sin Zero). Step_final (One[+I*]Zero). Qed. diff --git a/complex/NRootCC.v b/complex/NRootCC.v index 22b057861..dda38ac30 100644 --- a/complex/NRootCC.v +++ b/complex/NRootCC.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) (** printing sqrt_Half %\ensuremath{\sqrt{\frac12}}% *) @@ -38,10 +22,10 @@ intro. intro. intro. intro. elim c. intros a b. intro H1. elim H1; intros H2. apply H. -(* Algebra. *) +(* algebra. *) exact H2. apply H0. -(* Algebra. *) +(* algebra. *) exact H2. Qed. @@ -51,10 +35,10 @@ intro. intro H. intro H0. intro. elim c. intros a b. intro H1. elim H1; intros H2. apply H. -(* Algebra. *) +(* algebra. *) exact H2. apply H0. -(* Algebra. *) +(* algebra. *) exact H2. Qed. @@ -118,7 +102,7 @@ cut (sqrt_Half[*]sqrt_Half [=] Half); intros. apply eq_transitive_unfolded with (sqrt_Half[^]2). apply eq_symmetric_unfolded. apply nexp_two. unfold sqrt_Half in |- *. -(* Algebra. *) +(* algebra. *) apply sqrt_sqr. Qed. @@ -235,7 +219,7 @@ apply (Ccsr_wdl _ (cof_less (c:=IR)) (a[^]2[+]Zero) (a[^]2[+]b[^]2)). apply plus_resp_less_lft. change (Zero [<] b[^]2) in |- *. apply pos_square. assumption. -(* Algebra. *) +(* algebra. *) apply cm_rht_unit_unfolded. apply pos_half. Qed. @@ -416,7 +400,7 @@ cut (a'[*]b'[*]Two [=] b); intros. apply eq_transitive_unfolded with (b[*]Half[*]Two). apply bin_op_wd_unfolded. apply nrCC1_a7_upper. rename X into H. exact H. apply eq_reflexive_unfolded. -(* Algebra. *) +(* algebra. *) apply half_1'. Qed. @@ -435,7 +419,7 @@ rename H0 into H1. rename H into H0. rename X into H. exact H1. apply bin_op_wd_unfolded. apply nrCC1_a7_lower. rename H into H0. rename X into H. exact H. apply eq_reflexive_unfolded. -(* Algebra. *) +(* algebra. *) apply half_1'. (* Step_final a'[^] (2) [-]b'[^] (2). *) apply eq_transitive_unfolded with (a'[^]2[-]b'[^]2). @@ -727,7 +711,7 @@ cut (forall c x : CC, _X_ ! x[+] (_C_ c) ! x [=] x[+]c); intros. apply eq_reflexive_unfolded. apply un_op_wd_unfolded. apply I_wd. apply cm_rht_unit_unfolded. apply cm_lft_unit_unfolded. -(* Algebra. *) +(* algebra. *) apply bin_op_wd_unfolded. apply _x_apply. apply _c_apply. Qed. @@ -735,9 +719,9 @@ Lemma nrCC3_a4 : degree_le 1 (_X_[+]_C_ II). apply degree_imp_degree_le. cut (degree 1 (_C_ II[+]_X_)); intros. apply (degree_wd _ (_C_ II[+]_X_)). -(* Algebra. *) +(* algebra. *) apply cag_commutes_unfolded. -(* Algebra. *) +(* algebra. *) rename X into H. exact H. apply (degree_plus_rht _ (_C_ II) _X_ 0 1). apply degree_le_c_. @@ -762,7 +746,7 @@ replace n with (1 * n). unfold nrCC3_poly'' in |- *. apply monic_nexp. unfold monic in |- *; split. -(* Algebra. *) +(* algebra. *) apply eq_reflexive_unfolded. exact nrCC3_a4. unfold mult in |- *. @@ -1085,7 +1069,7 @@ Let x := nrCC4_x. Lemma nrCC4_a5 : x [=] y[*]r. unfold x in |- *. unfold nrCC4_x in |- *. -(* Algebra. *) +(* algebra. *) apply eq_reflexive_unfolded. Qed. @@ -1260,9 +1244,9 @@ Let b' := Im c'. Lemma nrootCC_4_ap_real' : {z' : CC | z'[^]n [=] a'[+I*]b'}. apply nrootCC_4_ap_real; try assumption. apply (imag_to_real a b a' b'). -(* Algebra. *) +(* algebra. *) apply eq_reflexive_unfolded. -(* Algebra. *) +(* algebra. *) exact a_. Qed. @@ -1319,7 +1303,7 @@ intros. apply eq_transitive_unfolded with (z[^] (2 * n)). apply nexp_mult. rewrite <- nrCC_5a2. -(* Algebra. *) +(* algebra. *) apply eq_reflexive_unfolded. Qed. Hint Resolve nrCC_5a3: algebra. diff --git a/fta/CC_Props.v b/fta/CC_Props.v index 7199fc81a..0ca01e71d 100644 --- a/fta/CC_Props.v +++ b/fta/CC_Props.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export AbsCC. @@ -151,7 +135,7 @@ apply leEq_less_trans with (AbsCC (s M[-]l) [+]AbsCC (s M[-]l')). apply leEq_wdl with (AbsCC ( [--] (s M[-]l) [+] (s M[-]l'))). apply leEq_wdr with (AbsCC [--] (s M[-]l) [+]AbsCC (s M[-]l')). apply triangle. -Algebra. +algebra. apply AbsCC_wd. rational. rstepr (e [/]ThreeNZ[+]e [/]ThreeNZ[+]e [/]ThreeNZ). astepl (Zero[+]AbsCC (s M[-]l) [+]AbsCC (s M[-]l')). apply plus_resp_less_leEq. diff --git a/fta/CPoly_Contin1.v b/fta/CPoly_Contin1.v index 5339bac7b..270578e97 100644 --- a/fta/CPoly_Contin1.v +++ b/fta/CPoly_Contin1.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export CC_Props. diff --git a/fta/CPoly_Rev.v b/fta/CPoly_Rev.v index 2a10df250..0fe4b5d48 100644 --- a/fta/CPoly_Rev.v +++ b/fta/CPoly_Rev.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export CPoly_Degree. @@ -42,33 +26,33 @@ Fixpoint monom (a : R) (n : nat) {struct n} : cpoly_cring R := Lemma monom_coeff : forall (c : R) n, nth_coeff n (monom c n) [=] c. intros. induction n as [| n Hrecn]; intros. -simpl in |- *. Algebra. -simpl in |- *. Algebra. +simpl in |- *. algebra. +simpl in |- *. algebra. Qed. Lemma monom_coeff' : forall (c : R) m n, m <> n -> nth_coeff n (monom c m) [=] Zero. intros c m. induction m as [| m Hrecm]; intros. elim (O_or_S n); intro y. elim y. clear y. intros x y. rewrite <- y. -simpl in |- *. Algebra. +simpl in |- *. algebra. elim (H y). elim (O_or_S n); intro y. elim y. clear y. intros x y. rewrite <- y. simpl in |- *. apply Hrecm. omega. rewrite <- y. -simpl in |- *. Algebra. +simpl in |- *. algebra. Qed. Hint Resolve monom_coeff monom_coeff': algebra. Lemma monom_degree : forall (a : R) n, degree_le n (monom a n). unfold degree_le in |- *. intros. -cut (n <> m). intro. Algebra. omega. +cut (n <> m). intro. algebra. omega. Qed. Lemma monom_S : forall (a : R) n, monom a (S n) [=] _X_[*]monom a n. intros. apply eq_transitive_unfolded with (cpoly_linear _ Zero (monom a n)). -simpl in |- *. split. Algebra. cut (monom a n [=] monom a n). auto. Algebra. +simpl in |- *. split. algebra. cut (monom a n [=] monom a n). auto. algebra. astepl (_X_[*]monom a n[+]_C_ Zero). Step_final (_X_[*]monom a n[+]Zero). Qed. @@ -88,7 +72,7 @@ Hint Resolve monom_wd_lft: algebra_c. Lemma monom_mult' : forall (a b : R) n, _C_ a[*]monom b n [=] monom (a[*]b) n. intros. induction n as [| n Hrecn]. -simpl in |- *. split; Algebra. +simpl in |- *. split; algebra. astepl (_C_ a[*] (_X_[*]monom b n)). astepl (_C_ a[*]_X_[*]monom b n). astepl (_X_[*]_C_ a[*]monom b n). @@ -101,7 +85,7 @@ Hint Resolve monom_mult': algebra. Lemma monom_mult : forall (a b : R) m n, monom a m[*]monom b n [=] monom (a[*]b) (m + n). intros. induction m as [| m Hrecm]; intros. -replace (monom a 0) with (_C_ a). Algebra. Algebra. +replace (monom a 0) with (_C_ a). algebra. algebra. astepl (_X_[*]monom a m[*]monom b n). astepl (_X_[*] (monom a m[*]monom b n)). replace (S m + n) with (S (m + n)). @@ -126,12 +110,12 @@ apply (f := fun i0 : nat => nth_coeff i (monom (nth_coeff i0 p) i0)) (i := i). auto with arith. auto. -intros. Algebra. -Algebra. +intros. algebra. +algebra. apply eq_transitive_unfolded with (Zero:R). apply Sum_zero. auto with arith. -intros. cut (i0 <> i). intro. Algebra. omega. -Algebra. +intros. cut (i0 <> i). intro. algebra. omega. +algebra. Qed. End Monomials. @@ -169,8 +153,8 @@ apply (f := fun i0 : nat => nth_coeff i (monom (nth_coeff i0 p) (n - i0))). auto with arith. omega. intros. -cut (n - j <> i). intro. Algebra. omega. -replace (n - (n - i)) with i. Algebra. omega. +cut (n - j <> i). intro. algebra. omega. +replace (n - (n - i)) with i. algebra. omega. Qed. Lemma Rev_coeff' : forall n p i, n < i -> nth_coeff i (Rev n p) [=] Zero. @@ -185,7 +169,7 @@ apply with (p_ := fun i0 : nat => monom (nth_coeff (R:=R) i0 p) (n - i0)). apply Sum_zero. auto with arith. intros. -cut (n - i0 <> i). intro. Algebra. omega. +cut (n - i0 <> i). intro. algebra. omega. Qed. Hint Resolve Rev_coeff Rev_coeff': algebra. @@ -217,7 +201,7 @@ Qed. Hint Resolve Rev_rev: algebra. Lemma Rev_degree_le : forall n p, degree_le n (Rev n p). -unfold degree_le in |- *. Algebra. +unfold degree_le in |- *. algebra. Qed. Lemma Rev_degree : forall n p, p ! Zero [#] Zero -> degree n (Rev n p). @@ -294,12 +278,12 @@ intros. induction l as [| l Hrecl]. replace (Sum0 0 a_) with (Zero:RX). replace (Sum0 0 (fun i : nat => Rev n (a_ i))) with (Zero:RX). -Algebra. auto. auto. +algebra. auto. auto. replace (Sum0 (S l) a_) with (Sum0 l a_[+]a_ l). replace (Sum0 (S l) (fun i : nat => Rev n (a_ i))) with (Sum0 l (fun i : nat => Rev n (a_ i)) [+]Rev n (a_ l)). astepl (Rev n (Sum0 l a_) [+]Rev n (a_ l)). -apply bin_op_wd_unfolded. auto. Algebra. +apply bin_op_wd_unfolded. auto. algebra. auto. auto. Qed. @@ -379,10 +363,10 @@ astepl (monom (nth_coeff i1 p1) (n1 - i1) [*]monom (nth_coeff i2 p2) (n2 - i2)). astepl (monom (nth_coeff i1 p1[*]nth_coeff i2 p2) (n1 - i1 + (n2 - i2))). replace (n1 - i1 + (n2 - i2)) with (n1 + n2 - (i1 + i2)). -Algebra. +algebra. omega. -unfold Rev in |- *. Algebra. -unfold Rev in |- *. Algebra. +unfold Rev in |- *. algebra. +unfold Rev in |- *. algebra. astepl (Rev (n1 + n2) (Sum 0 n2 diff --git a/fta/CPoly_Shift.v b/fta/CPoly_Shift.v index c67ae233d..81bfbdd0b 100644 --- a/fta/CPoly_Shift.v +++ b/fta/CPoly_Shift.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export CComplex. @@ -70,7 +54,7 @@ Lemma Shift_shift : forall a p, Shift [--]a (Shift a p) [=] p. intros. apply poly_CC_extensional. intros. astepl (Shift a p) ! (x[+][--]a). astepl p ! (x[+][--]a[+]a). -apply apply_wd. Algebra. rational. +apply apply_wd. algebra. rational. Qed. Lemma Shift_mult : forall a p1 p2, Shift a (p1[*]p2) [=] Shift a p1[*]Shift a p2. @@ -90,7 +74,7 @@ apply degree_le_mult. apply degree_le_c_. apply degree_le_mon with (1 * i). omega. apply degree_le_nexp. apply degree_imp_degree_le. -apply degree_wd with (_C_ a[+]_X_). Algebra. +apply degree_wd with (_C_ a[+]_X_). algebra. apply degree_plus_rht with 0. apply degree_le_c_. apply degree_x_. auto. auto. unfold degree_le in H. @@ -99,7 +83,7 @@ astepl (Zero:cpoly_cring CC). astepl (Zero[*] (_X_[+]_C_ a) [^]i). apply bin_op_wd_unfolded. Step_final (_C_ (Zero:CC)). -Algebra. +algebra. apply degree_le_mon with 0. auto with arith. apply degree_le_c_. @@ -119,11 +103,11 @@ apply (Sum 0 n (fun i : nat => _C_ (nth_coeff i p) [*] (_X_[+]_C_ a) [^]i) [+] Sum (S n) (lth_of_poly p) (fun i : nat => _C_ (nth_coeff i p) [*] (_X_[+]_C_ a) [^]i)). -apply bin_op_wd_unfolded. Algebra. +apply bin_op_wd_unfolded. algebra. apply eq_symmetric_unfolded. apply Sum_zero. cut (n < lth_of_poly p). intro. auto with arith. -apply lt_i_lth_of_poly. astepl (One:CC). Algebra. +apply lt_i_lth_of_poly. astepl (One:CC). algebra. intros. cut (n < i). intro. astepl (_C_ Zero[*] (_X_[+]_C_ a) [^]i). Step_final (Zero[*] (_X_[+]_C_ a) [^]i). @@ -142,10 +126,10 @@ apply with (Sum 0 x (fun i : nat => _C_ (nth_coeff i p) [*] (_X_[+]_C_ a) [^]i) [+] _C_ (nth_coeff (S x) p) [*] (_X_[+]_C_ a) [^]S x). -apply bin_op_wd_unfolded. Algebra. +apply bin_op_wd_unfolded. algebra. astepl (One[*] (_X_[+]_C_ a) [^]S x). apply bin_op_wd_unfolded. -Step_final (_C_ (One:CC)). Algebra. +Step_final (_C_ (One:CC)). algebra. apply eq_symmetric_unfolded. apply Sum_last with (f := fun i : nat => _C_ (nth_coeff i p) [*] (_X_[+]_C_ a) [^]i). @@ -156,12 +140,12 @@ apply degree_le_mult. apply degree_le_c_. apply degree_le_mon with (1 * i). omega. apply degree_le_nexp. apply degree_imp_degree_le. -apply degree_wd with (_C_ a[+]_X_). Algebra. +apply degree_wd with (_C_ a[+]_X_). algebra. apply degree_plus_rht with 0. apply degree_le_c_. apply degree_x_. auto. auto. pattern (S x) at 1 in |- *. replace (S x) with (1 * S x). apply monic_nexp. -apply monic_wd with (_C_ a[+]_X_). Algebra. +apply monic_wd with (_C_ a[+]_X_). algebra. apply monic_plus with 0. apply degree_le_c_. apply monic_x_. auto. auto with arith. auto. @@ -170,7 +154,7 @@ apply monic_wd with (One:CCX). unfold Sum in |- *. unfold Sum1 in |- *. simpl in |- *. split. cut (One [=] nth_coeff 0 p[*]One[+]Zero). auto. astepl (nth_coeff 0 p). rational. auto. -apply monic_wd with (_C_ (One:CC)). Algebra. +apply monic_wd with (_C_ (One:CC)). algebra. apply monic_c_one. Qed. diff --git a/fta/FTA.v b/fta/FTA.v index f64a018e8..4c631ab16 100644 --- a/fta/FTA.v +++ b/fta/FTA.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export CPoly_Rev. @@ -99,7 +83,7 @@ astepl (Shift [--]c (Rev (1 + n) g)). astepl (Shift [--]c (Rev (1 + n) (g1[*]g2))). Step_final (Shift [--]c (Rev 1 g1[*]Rev n g2)). exact FTA_1a. -apply degree_le_wd with (g1[*]g2); Algebra. +apply degree_le_wd with (g1[*]g2); algebra. apply degree_le_mult; auto. apply degree_imp_degree_le; auto. apply degree_imp_degree_le; auto. @@ -208,7 +192,7 @@ apply (fun i : nat => nth_coeff i f[*]x[^]i[-]nth_coeff i f[*]y[^]i)). 2: apply Sum_wd. 2: intro. -2: Algebra. +2: algebra. apply ap_wdl_unfolded with diff --git a/fta/FTAreg.v b/fta/FTAreg.v index 8310a338b..d6e94be01 100644 --- a/fta/FTAreg.v +++ b/fta/FTAreg.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export KneserLemma. @@ -79,7 +63,7 @@ intro HH. apply (Build_Knes_tupp (Build_Knes_tup z c pzltc) (Build_Knes_tup (z'[+]z) (qK[*]c) HH)). -simpl in |- *; Algebra. +simpl in |- *; algebra. simpl in |- *; apply leEq_wdl with (AbsCC z'[^]n). assumption. apply (nexp_wd IR (AbsCC z') (AbsCC (z'[+]z[-]z)) n). @@ -97,7 +81,7 @@ apply eq_symmetric_unfolded. apply AbsCC_wd. apply eq_transitive_unfolded with p ! (Zero[+]z). assumption. -Algebra. +algebra. Defined. Fixpoint Knes_fun_it (i : nat) : Knes_tup := @@ -315,8 +299,8 @@ astepr ((nrtq[^]n) [^]i[*]nrtc[^]n). unfold nrtq in |- *. unfold nrtc in |- *. apply bin_op_wd_unfolded. apply un_op_wd_unfolded. -Algebra. -Algebra. +algebra. +algebra. Qed. Lemma abs_pow_ltRe : forall s, (forall i, AbsCC (s (S i) [-]s i) [^]n [<=] q[^]i[*]c) -> @@ -340,7 +324,7 @@ auto with arith. apply NRoot_nonneg. apply leEq_wdr with (q[^]i[*]c). exact (H i). -Algebra. +algebra. apply mult_resp_nonneg. apply nexp_resp_nonneg. assumption. @@ -370,7 +354,7 @@ auto with arith. apply NRoot_nonneg. apply leEq_wdr with (q[^]i[*]c). exact (H i). -Algebra. +algebra. apply mult_resp_nonneg. apply nexp_resp_nonneg. assumption. diff --git a/fta/KeyLemma.v b/fta/KeyLemma.v index 1dcf93fd0..09a14e8d4 100644 --- a/fta/KeyLemma.v +++ b/fta/KeyLemma.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export ZArith. @@ -224,7 +208,7 @@ Qed. Lemma p3m_pow : forall i j : nat, p3m i[^]j [=] p3m (i * j). intros. unfold p3m in |- *. -Algebra. +algebra. Qed. Hint Resolve p3m_aux: algebra. @@ -232,7 +216,7 @@ Hint Resolve p3m_aux: algebra. Lemma p3m_0 : p3m 0 [=] One. unfold p3m in |- *. simpl in |- *. -Algebra. +algebra. Qed. Hint Resolve p3m_0: algebra. @@ -254,13 +238,13 @@ Hint Resolve third_less_one: algebra. Lemma p3m_mon : forall i j : nat, i < j -> p3m j [<] p3m i. intros. unfold p3m in |- *. -apply small_nexp_resp_lt; Algebra. +apply small_nexp_resp_lt; algebra. Qed. Lemma p3m_mon' : forall i j : nat, i <= j -> p3m j [<=] p3m i. intros. unfold p3m in |- *. -apply small_nexp_resp_le; try apply less_leEq; Algebra. +apply small_nexp_resp_le; try apply less_leEq; algebra. Qed. Lemma p3m_small : forall i : nat, p3m i [<=] One. diff --git a/fta/KneserLemma.v b/fta/KneserLemma.v index 97bb89fe4..0c62b1693 100644 --- a/fta/KneserLemma.v +++ b/fta/KneserLemma.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) (** printing Smallest %\ensuremath{\frac13^{2n^2+n}}% *) @@ -224,7 +208,7 @@ apply leEq_wdl with (AbsCC b_0'[-]a k[*]r[^]k[+]AbsCC (b_0[-]b_0')). apply leEq_wdl with (AbsCC (b_0'[-]b_0)); auto. apply AbsCC_wd; rational. apply bin_op_wd_unfolded. - 2: Algebra. + 2: algebra. apply eq_transitive_unfolded with @@ -243,10 +227,10 @@ apply apply eq_transitive_unfolded with (AbsCC (cc_IR (AbsCC b_0') [-]cc_IR (a k) [*]cc_IR (r[^]k))). - 2: apply AbsCC_wd; Algebra. + 2: apply AbsCC_wd; algebra. astepr (AbsCC (cc_IR (AbsCC b_0') [-]cc_IR (a k[*]r[^]k))). astepr (AbsCC (cc_IR (AbsCC b_0'[-]a k[*]r[^]k))). - cut (Zero [<=] AbsCC b_0'[-]a k[*]r[^]k). Algebra. + cut (Zero [<=] AbsCC b_0'[-]a k[*]r[^]k). algebra. apply shift_leEq_lft; auto. apply AbsCC_wd. rstepl @@ -254,8 +238,8 @@ rstepl b k[*] (cc_IR r[^]k[*] [--] ((cc_IR (a k) [/] cc_IR (AbsCC b_0') [//]H8) [*] (b_0'[/] b k[//]H10)))). -apply bin_op_wd_unfolded. Algebra. -apply bin_op_wd_unfolded. Algebra. +apply bin_op_wd_unfolded. algebra. +apply bin_op_wd_unfolded. algebra. Step_final (cc_IR r[^]k[*]w[^]k). apply root_one with k; auto. @@ -515,7 +499,7 @@ apply with (AbsCC (b_0[+]b k[*]z[^]k) [+] (Sum 1 (pred k) p_''[+]Sum (S k) n p_'')); unfold p_'' in |- *. 2: apply bin_op_wd_unfolded; - [ Algebra | apply bin_op_wd_unfolded; apply Sum_wd; Algebra ]. + [ algebra | apply bin_op_wd_unfolded; apply Sum_wd; algebra ]. apply leEq_transitive with diff --git a/fta/MainLemma.v b/fta/MainLemma.v index 0414dbafa..a96db3c68 100644 --- a/fta/MainLemma.v +++ b/fta/MainLemma.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) (** printing two_n %\ensuremath{2n}% #2n# *) diff --git a/ftc/COrdLemmas.v b/ftc/COrdLemmas.v index 90ee45ece..8e6dc439f 100644 --- a/ftc/COrdLemmas.v +++ b/ftc/COrdLemmas.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export COrdCauchy. @@ -135,7 +119,7 @@ Lemma om_fun_3a : forall n m f g Hfg, nat_less_n_fun f -> nat_less_n_fun g -> intro n. induction n as [| n Hrecn]. simpl in |- *; intros. elimtype False; inversion Hi. intro m; induction m as [| m Hrecm]. - simpl in |- *; intros. exists i. exists Hi. Algebra. + simpl in |- *; intros. exists i. exists Hi. algebra. intros. simpl in |- *; elim ap_imp_less; simpl in |- *; intro. set (h := fun i Hi => g i (lt_S _ _ Hi)) in *. @@ -172,7 +156,7 @@ Lemma om_fun_3b : forall n m f g Hfg, nat_less_n_fun f -> nat_less_n_fun g -> intro n. induction n as [| n Hrecn]. simpl in |- *; intros. exists i. assert (i < m + 0). rewrite <- plus_n_O. auto. - exists H1. Algebra. + exists H1. algebra. intro m; induction m as [| m Hrecm]. simpl in |- *; intros. elimtype False; inversion Hi. intros. @@ -287,7 +271,7 @@ Lemma Sumx_Sum_Sum Sumx (fun i (H : i < n) => Sum (f i) (pred (f (S i))) h) [=] Sumx (fun i (H : i < f n) => h i). simple induction n. -rewrite f0; simpl in |- *; Algebra. +rewrite f0; simpl in |- *; algebra. clear n; intros. elim (le_lt_dec n 0); intro. cut (n = 0); [ clear a; intro | auto with arith ]. @@ -301,7 +285,7 @@ eapply eq_transitive_unfolded. apply Sumx_to_Sum. pattern 0 at 1 in |- *; rewrite <- f0; apply f_mon; apply lt_n_Sn. red in |- *; intros. -rewrite H1; Algebra. +rewrite H1; algebra. clear H; apply Sum_wd'; unfold part_tot_nat_fun in |- *. auto with arith. intros. @@ -309,7 +293,7 @@ elim (le_lt_dec (f 1) i); intro; simpl in |- *. cut (0 < f 1). intro; elimtype False; omega. pattern 0 at 1 in |- *; rewrite <- f0; apply f_mon; apply lt_n_Sn. -Algebra. +algebra. cut (0 < f n); [ intro | rewrite <- f0; apply f_mon; assumption ]. simpl in |- *. eapply eq_transitive_unfolded. @@ -326,8 +310,8 @@ apply H. apply Sumx_to_Sum. assumption. red in |- *; intros. -rewrite H1; Algebra. -Algebra. +rewrite H1; algebra. +algebra. cut (f n = S (pred (f n))); [ intro | apply S_pred with 0; auto ]. pattern (f n) at 4 in |- *; rewrite H1. eapply eq_transitive_unfolded. @@ -341,7 +325,7 @@ elim (le_lt_dec (f (S n)) i); intro; simpl in |- *. cut (f n < f (S n)); [ intro | apply f_mon; apply lt_n_Sn ]. elimtype False; apply (le_not_lt (f n) i); auto. apply le_trans with (f (S n)); auto with arith. -Algebra. +algebra. rewrite <- H1. cut (0 < f (S n)); [ intro | rewrite <- f0; auto with arith ]. cut (f (S n) = S (pred (f (S n)))); [ intro | apply S_pred with 0; auto ]. @@ -351,10 +335,10 @@ intros. unfold part_tot_nat_fun in |- *. elim (le_lt_dec (f (S n)) i); intro; simpl in |- *. elimtype False; omega. -Algebra. +algebra. apply lt_trans with (f n); auto with arith. red in |- *; intros. -rewrite H1; Algebra. +rewrite H1; algebra. Qed. (* end hide *) @@ -432,7 +416,7 @@ rewrite <- (S_pred (f (S i) H5) (f i (lt_le_weak _ _ H5)) (H1 _ _ _ _ (lt_n_Sn i))) . apply lt_le_weak; apply H1; apply lt_n_Sn. -intros; Algebra. +intros; algebra. apply str_Sumx_Sum_Sum. unfold f' in |- *; simpl in |- *. elim (le_lt_dec 0 m); intro; simpl in |- *. diff --git a/ftc/CalculusTheorems.v b/ftc/CalculusTheorems.v index a8342a3ab..1b0fe4cc7 100644 --- a/ftc/CalculusTheorems.v +++ b/ftc/CalculusTheorems.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export Rolle. @@ -446,7 +430,7 @@ intros a b F H Ha H0 x H1 Hx H2. cut (Not (olor a b x)); intro H3. cut (x [=] a). intro H4. apply H0. -eapply less_wdl; [ apply H2 | Algebra ]. +eapply less_wdl; [ apply H2 | algebra ]. red in H3. apply not_ap_imp_eq; intro H4. inversion_clear H1. @@ -464,7 +448,7 @@ intros a b F H Ha H0 x H1 Hx H2. cut (Not (olor a b x)); intro H3. cut (x [=] b). intro H4. apply H0. -eapply less_wdl; [ apply H2 | Algebra ]. +eapply less_wdl; [ apply H2 | algebra ]. red in H3. apply not_ap_imp_eq; intro H4. inversion_clear H1. @@ -483,7 +467,7 @@ cut (Not (olor a b x)); intro H4. elim (less_cotransitive_unfolded _ _ _ Hab x); intro H5. cut (x [=] b). intro H6. apply H1. -eapply less_wdl; [ apply H3 | Algebra ]. +eapply less_wdl; [ apply H3 | algebra ]. red in H4. apply not_ap_imp_eq; intro H6. inversion_clear H2. @@ -492,7 +476,7 @@ apply H4; split; auto. apply (less_irreflexive_unfolded _ b); apply less_leEq_trans with x; auto. cut (x [=] a); intros. apply H0. -eapply less_wdl; [ apply H3 | Algebra ]. +eapply less_wdl; [ apply H3 | algebra ]. red in H4. apply not_ap_imp_eq; intro. inversion_clear H2. @@ -645,7 +629,7 @@ apply mult_resp_nonneg. eapply leEq_transitive; [ apply H0 | apply Hglb1 ]. exists x. split. auto. -split; Algebra. +split; algebra. apply (contin_imp_inc _ _ _ _ H); auto. apply shift_leEq_minus; astepl a; auto. Qed. diff --git a/ftc/Composition.v b/ftc/Composition.v index 407b5e4cd..a6b60ede5 100644 --- a/ftc/Composition.v +++ b/ftc/Composition.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export MoreFunctions. diff --git a/ftc/Continuity.v b/ftc/Continuity.v index d93f7a30b..db6ff8119 100644 --- a/ftc/Continuity.v +++ b/ftc/Continuity.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) (** printing Norm_Funct %\ensuremath{\|\cdot\|}% *) @@ -95,7 +79,7 @@ exists x; split. auto. split. apply H0; auto. -Algebra. +algebra. intros e H2. elim (H1 _ H2). intros d H3 H4. @@ -119,12 +103,12 @@ intros x0 H. apply Hl'; left; assumption. exists a0. split. -apply Hl'; right; Algebra. +apply Hl'; right; algebra. split. -apply H0; apply Hl'; right; Algebra. +apply H0; apply Hl'; right; algebra. intro; eapply eq_transitive_unfolded. 2: apply eq_symmetric_unfolded; apply H1. -Algebra. +algebra. intros x H; simpl in |- *. elim H; intros x0 H1. elim H1; clear H1; intros Hy' H1. @@ -177,7 +161,7 @@ elim glb_is_glb. intros. apply a0. exists x. -split; Algebra. +split; algebra. Qed. Lemma lub_prop : forall x : IR, I x -> forall Hx, F x Hx [<=] lub_funct. @@ -186,7 +170,7 @@ elim lub_is_lub. intros. apply a0. exists x. -split; Algebra. +split; algebra. Qed. (** @@ -292,7 +276,7 @@ intros x Hx; elim Hx; clear Hx; intros y Hx'; elim Hx'; clear Hx'; exists y; split. auto. intro; apply shift_minus_less; apply shift_less_plus'. -eapply less_wdl; [ apply q | Algebra ]. +eapply less_wdl; [ apply q | algebra ]. elim H0; clear H0; intros H2 H3. elim (H3 _ (pos_div_two _ _ H)). intros x Hx; elim Hx; clear Hx; intros y Hx'; elim Hx'; clear Hx'; @@ -300,7 +284,7 @@ intros x Hx; elim Hx; clear Hx; intros y Hx'; elim Hx'; clear Hx'; exists y; split. auto. intro; apply shift_less_plus'. -eapply less_wdl; [ apply q | Algebra ]. +eapply less_wdl; [ apply q | algebra ]. Qed. Lemma leEq_Norm_Funct : forall e, (forall x, I x -> forall Hx, AbsIR (F x Hx) [<=] e) -> Norm_Funct [<=] e. @@ -467,7 +451,7 @@ apply pos_one. intros. apply leEq_wdl with (AbsIR Zero). astepl ZeroR; apply less_leEq; assumption. -Algebra. +algebra. Qed. Lemma Continuous_I_id : Continuous_I Hab FId. @@ -731,8 +715,8 @@ astepl (ZeroR[*]Zero); apply mult_resp_less_both; try apply leEq_reflexive; eapply leEq_wdr. 2: apply eq_symmetric_unfolded; apply AbsIR_resp_mult. apply mult_resp_leEq_both; try (apply less_leEq; assumption). -eapply leEq_wdr; [ apply (H0 x Hxx H4) | Algebra ]. -eapply leEq_wdr; [ apply (H0 y Hyy H5) | Algebra ]. +eapply leEq_wdr; [ apply (H0 x Hxx H4) | algebra ]. +eapply leEq_wdr; [ apply (H0 y Hyy H5) | algebra ]. apply AbsIR_nonneg. apply shift_div_leEq'. astepl (ZeroR[*]Zero); apply mult_resp_less_both; try apply leEq_reflexive; diff --git a/ftc/Derivative.v b/ftc/Derivative.v index cf66d0e5d..26969c175 100644 --- a/ftc/Derivative.v +++ b/ftc/Derivative.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export Continuity. diff --git a/ftc/DerivativeOps.v b/ftc/DerivativeOps.v index 720f2a73b..5ccb95b37 100644 --- a/ftc/DerivativeOps.v +++ b/ftc/DerivativeOps.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export Derivative. @@ -377,7 +361,7 @@ intro leEqM. 2: eapply leEq_transitive. 3: apply lft_leEq_Max. 2: unfold nF1 in |- *; apply norm_bnd_AbsIR; assumption. -2: apply AbsIR_wd; simpl in |- *; Algebra. +2: apply AbsIR_wd; simpl in |- *; algebra. cut (Dom F x); [ intro Hxx | simpl in Hx; unfold extend in Hx; inversion_clear Hx; assumption ]. diff --git a/ftc/Differentiability.v b/ftc/Differentiability.v index 799f8b4f7..fbef63a33 100644 --- a/ftc/Differentiability.v +++ b/ftc/Differentiability.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export PartInterval. @@ -77,7 +61,7 @@ exists (included_refl _ _)). apply Derivative_I_wdr with (PartInt f'). FEQ. -simpl in |- *; apply csf_wd_unfolded; simpl in |- *; Algebra. +simpl in |- *; apply csf_wd_unfolded; simpl in |- *; algebra. exact (included_imp_deriv _ _ _ _ _ _ _ _ H derF). Qed. diff --git a/ftc/FTC.v b/ftc/FTC.v index 34336756d..a992827f2 100644 --- a/ftc/FTC.v +++ b/ftc/FTC.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) (** printing [-S-] %\ensuremath{\int}% #∫# *) @@ -208,7 +192,7 @@ apply leEq_Norm_Funct. intros z Hz Hz1. simpl in |- *. apply leEq_wdl with (AbsIR (F z (X1 z (X z (Hinc z Hz))) [-]F x Hx')). -2: apply AbsIR_wd; Algebra. +2: apply AbsIR_wd; algebra. apply H4; auto. eapply leEq_transitive. 2: apply H. @@ -284,7 +268,7 @@ apply included_imp_Continuous with J. auto. apply included3_interval; auto. intros; apply eq_symmetric_unfolded. -rstepr (x[+]y[-]x); Algebra. +rstepr (x[+]y[-]x); algebra. cut (forall x y z : IR, x[-]y [=] z -> x [=] y[+]z); intros. Opaque G. cut (forall x : IR, J x -> forall Hx Hx', G x Hx[-]G0 x Hx' [=] c); intros. @@ -292,11 +276,11 @@ apply cg_minus_wd; unfold Ga, Gb, G0a, G0b in |- *; apply H; auto. simpl in H0. apply eq_transitive_unfolded with ((G{-}G0) x (CAnd_intro _ _ Hx Hx')). 2: apply H0 with (Hx := CAnd_intro _ _ Hx Hx'). -simpl in |- *; Algebra. +simpl in |- *; algebra. auto. auto. rstepl (y[+] (x[-]y)). -Algebra. +algebra. Qed. (* end hide *) diff --git a/ftc/FunctSequence.v b/ftc/FunctSequence.v index 8671cde72..70f1434d9 100644 --- a/ftc/FunctSequence.v +++ b/ftc/FunctSequence.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export Continuity. @@ -453,7 +437,7 @@ apply Part (Cauchy_fun_seq_Lim _ _ _ _ _ H) x (incf' x Hx))). 2: apply AbsIR_wd; apply cg_minus_wd. 2: apply eq_symmetric_unfolded; apply Lim_const. -2: Algebra. +2: algebra. simpl in |- *. apply leEq_wdl @@ -493,7 +477,7 @@ apply AbsIR_wd; apply cg_minus_wd. elim (H n); intros Haux inc. inversion_clear inc. auto. -Algebra. +algebra. Qed. Lemma conv_fun_seq'_wdr : Feq I F G -> @@ -504,7 +488,7 @@ exists N; intros. eapply leEq_wdl. apply (HN n H2 x Hx). apply AbsIR_wd; apply cg_minus_wd. -Algebra. +algebra. elim H; intros Haux inc. inversion_clear inc. auto. @@ -521,7 +505,7 @@ apply AbsIR_wd; apply cg_minus_wd. elim (H n); intros Haux inc. inversion_clear inc. auto. -Algebra. +algebra. Qed. Lemma conv_fun_seq'_wdr' : Feq I F G -> @@ -532,7 +516,7 @@ exists N; intros. eapply leEq_wdl. apply (HN n H2 x Hx). apply AbsIR_wd; apply cg_minus_wd. -Algebra. +algebra. elim H; intros Haux inc. inversion_clear inc. auto. @@ -549,7 +533,7 @@ elim (H n); intros. inversion_clear b0. elim (H m); intros. inversion_clear b0. -apply AbsIR_wd; Algebra. +apply AbsIR_wd; algebra. Qed. Lemma Cauchy_cont_Lim : forall H : Cauchy_fun_seq a b Hab f contf, @@ -582,7 +566,7 @@ apply leEq_wdl with (AbsIR (Part _ _ Hx[-]Lim (Cauchy_const (Part _ _ (incf x H2))))). 2: apply AbsIR_wd; apply cg_minus_wd. -2: Algebra. +2: algebra. 2: apply eq_symmetric_unfolded; apply Lim_const. simpl in |- *. apply @@ -613,7 +597,7 @@ apply Part (Cauchy_fun_seq_Lim _ _ _ _ _ H) y Hy)). 2: apply AbsIR_wd; apply cg_minus_wd. 2: apply eq_symmetric_unfolded; apply Lim_const. -2: Algebra. +2: algebra. simpl in |- *. apply leEq_wdl @@ -644,7 +628,7 @@ cut (Continuous_I Hab (PartInt (IntPartIR (contin_imp_inc _ _ _ _ H0)))). 2: eapply Continuous_I_wd. 3: apply Cauchy_cont_Lim with (H := H). 2: FEQ. -2: simpl in |- *; apply Lim_wd'; intros; Algebra. +2: simpl in |- *; apply Lim_wd'; intros; algebra. intro H2; exists H2. intros e H1. elim (Cauchy_conv_fun_seq' H H0 e H1); intros N HN. @@ -652,9 +636,9 @@ exists N; intros. eapply leEq_wdl. apply (HN n H3 x Hx). apply AbsIR_wd; apply cg_minus_wd. -Algebra. +algebra. simpl in |- *; apply Lim_wd'; intros; simpl in |- *; rational. -simpl in |- *; Algebra. +simpl in |- *; algebra. simpl in |- *; apply Cauchy_cont_Lim. Qed. @@ -681,7 +665,7 @@ exists N; intros. apply AbsIR_imp_AbsSmall. eapply leEq_wdl. apply (HN m H2 x H0). -apply AbsIR_wd; Algebra. +apply AbsIR_wd; algebra. Qed. (** @@ -811,7 +795,7 @@ apply (AbsIR (Part _ _ (incf n x Hx) [+]Part _ _ (incg n x Hx) [-] (Part _ _ (incF x Hx) [+]Part _ _ (incG x Hx)))). -2: apply AbsIR_wd; simpl in |- *; Algebra. +2: apply AbsIR_wd; simpl in |- *; algebra. apply leEq_wdl with @@ -841,7 +825,7 @@ apply (AbsIR (Part _ _ (incf n x Hx) [-]Part _ _ (incg n x Hx) [-] (Part _ _ (incF x Hx) [-]Part _ _ (incG x Hx)))). -2: apply AbsIR_wd; simpl in |- *; Algebra. +2: apply AbsIR_wd; simpl in |- *; algebra. apply leEq_wdl with @@ -884,7 +868,7 @@ apply (AbsIR (Part _ _ (incf n x Hx) [*]Part _ _ (incg n x Hx) [-] Part _ _ (incF x Hx) [*]Part _ _ (incG x Hx))). -2: apply AbsIR_wd; simpl in |- *; Algebra. +2: apply AbsIR_wd; simpl in |- *; algebra. apply leEq_wdl with @@ -1141,7 +1125,7 @@ astepr apply cg_minus_wd. eapply eq_transitive_unfolded. 2: apply eq_symmetric_unfolded; apply Lim_const. -apply Lim_wd'; intros; simpl in |- *; Algebra. +apply Lim_wd'; intros; simpl in |- *; algebra. apply Lim_wd'; intros; simpl in |- *; rational. apply fun_Lim_seq_minus with (f := fun n : nat => [-C-]Zero:PartIR). Contin. diff --git a/ftc/FunctSeries.v b/ftc/FunctSeries.v index 71a693c18..9b224f8ae 100644 --- a/ftc/FunctSeries.v +++ b/ftc/FunctSeries.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export FunctSequence. @@ -181,7 +165,7 @@ apply AbsSmall_imp_AbsIR. apply AbsSmall_wdr_unfolded with (seq_part_sum x m[-]seq_part_sum x N). apply HN; assumption. unfold seq_part_sum in |- *; simpl in |- *. -apply cg_minus_wd; apply Sum0_wd; Algebra. +apply cg_minus_wd; apply Sum0_wd; algebra. Qed. Lemma fun_const_series_sum : forall y H @@ -189,7 +173,7 @@ Lemma fun_const_series_sum : forall y H intros. simpl in |- *. apply series_sum_wd. -Algebra. +algebra. Qed. Lemma conv_zero_fun_series : fun_series_convergent _ _ Hab (fun n => [-C-]Zero). @@ -336,10 +320,10 @@ eapply eq_transitive_unfolded. apply Sum0_wd; intros; rational. unfold cg_minus in |- *. apply bin_op_wd_unfolded. -Algebra. +algebra. eapply eq_transitive_unfolded. 2: apply inv_Sum0. -apply Sum0_wd; Algebra. +apply Sum0_wd; algebra. Qed. Lemma Fun_Series_Sum_min : forall H : fun_series_convergent _ _ Hab (fun n => f n{-}g n), @@ -555,7 +539,7 @@ intros. FEQ. simpl in |- *; unfold series_sum in |- *. apply Lim_wd'; simpl in |- *; intros. -unfold seq_part_sum in |- *; apply Sum0_wd; intros; Algebra. +unfold seq_part_sum in |- *; apply Sum0_wd; intros; algebra. Qed. Lemma fun_series_conv : forall H H', @@ -588,7 +572,7 @@ FEQ. simpl in |- *. unfold series_sum in |- *; apply Lim_wd'. intro; simpl in |- *. -unfold seq_part_sum in |- *; apply Sum0_wd; intros; Algebra. +unfold seq_part_sum in |- *; apply Sum0_wd; intros; algebra. Qed. Lemma Fun_Series_Sum_as_Lim : forall Hf H', @@ -799,7 +783,7 @@ apply 2: apply H0 with (Hx' := Hx) (Hx := ProjIR1 (ProjIR1 Hx')); auto with arith. Opaque FAbs. 2: simpl in |- *; apply mult_wd; - [ apply eq_symmetric_unfolded; apply FAbs_char | Algebra ]. + [ apply eq_symmetric_unfolded; apply FAbs_char | algebra ]. apply conv_fun_series_scal with (f := fun n : nat => [-C-] (c[^] (n - N))). apply conv_fun_const_series with (x := fun n : nat => c[^] (n - N)). apply join_series with (power_series c). @@ -808,7 +792,7 @@ exists N. exists 0. intro. rewrite plus_comm; rewrite Minus.minus_plus. -Algebra. +algebra. Contin. intros x H0 n; induction n as [| n Hrecn]. intro. @@ -818,7 +802,7 @@ intros. apply eq_imp_leEq. simpl in |- *. astepl (AbsIR (Part _ _ Hx') [*]One); apply mult_wdl; apply AbsIR_wd; - Algebra. + algebra. intro. elim (le_lt_eq_dec _ _ H1); intro. intros; @@ -839,7 +823,7 @@ rewrite <- minus_n_n. apply eq_imp_leEq. simpl in |- *; eapply eq_transitive_unfolded. 2: apply eq_symmetric_unfolded; apply mult_one. -apply AbsIR_wd; Algebra. +apply AbsIR_wd; algebra. Qed. End Convergence_Criteria. diff --git a/ftc/FunctSums.v b/ftc/FunctSums.v index ea6c42294..fbf415253 100644 --- a/ftc/FunctSums.v +++ b/ftc/FunctSums.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) (** printing FSum0 %\ensuremath{\sum_0}% #∑0# *) @@ -88,7 +72,7 @@ Lemma FSum_FSum0 : forall m n (f : nat -> PartIR) x Hx Hx' Hx'', intros. simpl in |- *; unfold Sum, Sum1 in |- *; simpl in |- *. apply cg_minus_wd; try apply bin_op_wd_unfolded; try apply Sum0_wd; intros; - Algebra. + algebra. Qed. Lemma FSum0_wd : forall m (f g : nat -> PartIR), @@ -97,7 +81,7 @@ Lemma FSum0_wd : forall m (f g : nat -> PartIR), intros. simpl in |- *. apply Sum0_wd. -intros; simpl in |- *; Algebra. +intros; simpl in |- *; algebra. Qed. Lemma FSum_one : forall n (f : nat -> PartIR) x Hx Hx', @@ -152,7 +136,7 @@ Lemma FSum_wd : forall m n (f g : nat -> PartIR), intros. simpl in |- *. apply Sum_wd. -Algebra. +algebra. Qed. Lemma FSum_plus_FSum : forall (f g : nat -> PartIR) m n x Hx HxF HxG, @@ -188,7 +172,7 @@ Lemma FSum_wd' : forall m n, m <= S n -> forall f g : nat -> PartIR, intros. simpl in |- *. apply Sum_wd'; try assumption. -Algebra. +algebra. Qed. Lemma FSum_resp_less : forall (f g : nat -> PartIR) m n, m <= n -> @@ -247,10 +231,10 @@ Lemma FSumx_wd : forall n (f g : forall i, i < n -> PartIR), (forall i Hi x HxF HxG, f i Hi x HxF [=] g i Hi x HxG) -> forall x HxF HxG, FSumx n f x HxF [=] FSumx n g x HxG. intro; case n. -intros; simpl in |- *; Algebra. +intros; simpl in |- *; algebra. clear n. simple induction n. -intros; simpl in |- *; Algebra. +intros; simpl in |- *; algebra. clear n; intro. cut {p : nat | S n = p}; [ intro H | exists (S n); auto ]. elim H; intros p Hp. @@ -298,7 +282,7 @@ cut (i < n); [ intro | auto with arith ]. set (g := fun i Hi => f i (lt_S _ _ Hi)) in *. apply H with i (lt_S _ _ H1) x. auto. -Algebra. +algebra. change (Dom (g i H1) x) in |- *. apply Hrecn. unfold g in |- *; intros. @@ -307,7 +291,7 @@ inversion_clear H0; assumption. elim H0; intros H1 H2; clear H0 H1. apply H with n (lt_n_Sn n) x; auto. symmetry in |- *; auto. -Algebra. +algebra. Qed. Lemma FSumx_pred' : forall n (f : forall i, i < n -> PartIR), @@ -326,14 +310,14 @@ Qed. Lemma FSumx_char : forall n f x Hx Hf, FSumx n f x Hx [=] Sumx (fun i Hi => f i Hi x (FSumx_pred n f Hf x Hx i Hi)). intro; induction n as [| n Hrecn]. -Algebra. +algebra. intros; simpl in |- *. -apply bin_op_wd_unfolded; Algebra. +apply bin_op_wd_unfolded; algebra. cut (ext_fun_seq' (fun i Hi => f i (lt_S i n Hi))). intro H. eapply eq_transitive_unfolded. apply Hrecn with (Hf := H). -apply Sumx_wd; intros; simpl in |- *; Algebra. +apply Sumx_wd; intros; simpl in |- *; algebra. intros i j H H0 H' x0 y H1 H2. apply Hf with i (lt_S i n H0) x0; auto. Qed. @@ -356,7 +340,7 @@ unfold FSumx_to_FSum in |- *. elim (le_lt_dec n i); intro; simpl in |- *. elimtype False; apply (le_not_lt n i); auto. intros; apply H; auto. -Algebra. +algebra. Qed. Lemma FSumx_le : forall n (f : forall i, i < n -> PartIR), ext_fun_seq f -> @@ -364,7 +348,7 @@ Lemma FSumx_le : forall n (f : forall i, i < n -> PartIR), ext_fun_seq f -> do 5 intro. unfold FSumx_to_FSum in |- *. elim (le_lt_dec n i); intro; simpl in |- *. -intro; Algebra. +intro; algebra. intros; elimtype False; apply (le_not_lt n i); auto. Qed. @@ -409,7 +393,7 @@ cut (i < S n); [ intro | auto with arith ]. apply eq_transitive_unfolded with (g i H8 x (FSumx_pred _ _ H3 x H4 i H8)). 2: apply eq_symmetric_unfolded; apply FSumx_lt; assumption. unfold g in |- *; apply H0; auto. -Algebra. +algebra. intro. simpl in Hx. generalize (Hx m); clear H4 H3 H2 Hx. @@ -449,8 +433,8 @@ simpl in |- *; red in |- *; intros. apply (H n0); auto. simpl in |- *. red in |- *; intros; apply (H n0); auto. -simpl in |- *; apply bin_op_wd_unfolded; Algebra. -apply Sum0_wd; Algebra. +simpl in |- *; apply bin_op_wd_unfolded; algebra. +apply Sum0_wd; algebra. Qed. Lemma FSum_0 : forall P f n, (forall i, included P (Dom (f i))) -> Feq P (f n) (FSum n n f). @@ -462,7 +446,7 @@ simpl in |- *. apply eq_symmetric_unfolded. eapply eq_transitive_unfolded. apply Sum_one. -Algebra. +algebra. Qed. Lemma FSum_S : forall P f m n, (forall i, included P (Dom (f i))) -> @@ -477,7 +461,7 @@ red in |- *; intros; apply (H n0); auto. intros; simpl in |- *; apply eq_symmetric_unfolded. eapply eq_transitive_unfolded. apply Sum_last. -Algebra. +algebra. Qed. Lemma FSum_FSum0' : forall P f m n, (forall i, included P (Dom (f i))) -> diff --git a/ftc/Integral.v b/ftc/Integral.v index ae48eaad0..8de7a33f2 100644 --- a/ftc/Integral.v +++ b/ftc/Integral.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export RefLemma. @@ -34,7 +18,7 @@ intro; induction n as [| n Hrecn]. do 2 intro. rewrite H. intros; simpl in |- *; apply eq_symmetric_unfolded. -astepr (g 0 (lt_n_Sn 0)); Algebra. +astepr (g 0 (lt_n_Sn 0)); algebra. do 2 intro; rewrite H; intros. astepl (Sumx (fun (i : nat) (Hi : i < n) => f i (lt_S _ _ Hi)) [+]f n (lt_n_Sn n)). @@ -70,7 +54,7 @@ apply with (Sumx f1[+]Sumx (fun (i : nat) (Hi : i < m) => f2 i (lt_S _ _ Hi)) [+] f2 m (lt_n_Sn m)). -simpl in |- *; Algebra. +simpl in |- *; algebra. astepr (Sumx (fun (i : nat) (Hi : i < l') => f3 i (lt_S _ _ Hi)) [+] f3 l' (lt_n_Sn l')). @@ -244,7 +228,7 @@ apply (Lim (Cauchy_const (Partition_Sum HfP (contin_imp_inc _ _ _ _ contF))) [-] integral)). 2: apply AbsIR_wd; apply cg_minus_wd; - [ apply eq_symmetric_unfolded; apply Lim_const | Algebra ]. + [ apply eq_symmetric_unfolded; apply Lim_const | algebra ]. unfold integral in |- *. apply leEq_wdl @@ -291,7 +275,7 @@ assumption. apply nring_less; auto with arith. assumption. red in |- *; do 3 intro. -rewrite H0; intros; simpl in |- *; Algebra. +rewrite H0; intros; simpl in |- *; algebra. unfold ee in |- *; apply div_resp_pos. apply pos_max_one. assumption. @@ -306,8 +290,8 @@ apply less_leEq; assumption. apply AbsIR_wd; apply cg_minus_wd. unfold Partition_Sum in |- *. apply Sumx_wd; intros. -Algebra. -Algebra. +algebra. +algebra. Qed. End Integral_Thm. @@ -373,8 +357,8 @@ elim (bin_op_strext_unfolded _ _ _ _ _ _ H'); clear H'; intro. eapply ap_wdl_unfolded. eapply ap_wdr_unfolded. apply a0. -Algebra. -Algebra. +algebra. +algebra. elimtype False; generalize b0; exact (ap_irreflexive_unfolded _ _). eapply ap_wdl_unfolded. eapply ap_wdr_unfolded. @@ -384,9 +368,9 @@ unfold g', Partition_imp_points in |- *; apply Sumx_wd; intros; simpl in |- *; unfold f', Partition_imp_points in |- *; apply Sumx_wd; intros; simpl in |- *; rational. do 3 intro. -rewrite H0; unfold g' in |- *; intros; Algebra. +rewrite H0; unfold g' in |- *; intros; algebra. do 3 intro. -rewrite H; unfold f' in |- *; intros; Algebra. +rewrite H; unfold f' in |- *; intros; algebra. Qed. Lemma integral_strext' : forall c d Hcd HF1 HF2, @@ -464,12 +448,12 @@ red in |- *. do 3 intro. rewrite H0; clear H0; intros. unfold f2 in |- *. -Algebra. +algebra. red in |- *. do 3 intro. rewrite H; clear H; intros. unfold f1 in |- *. -Algebra. +algebra. Qed. Lemma integral_wd : Feq (Compact Hab) F G -> Integral F contF [=] Integral G contG. @@ -494,13 +478,13 @@ apply Lim_wd'. intro; simpl in |- *. unfold integral_seq, Even_Partition_Sum, Partition_Sum in |- *. apply Sumx_wd; intros; apply mult_wd. -apply pfwdef; simpl in |- *; Algebra. +apply pfwdef; simpl in |- *; algebra. simpl in |- *. repeat first [ apply cg_minus_wd | apply bin_op_wd_unfolded | apply mult_wd - | apply div_wd ]; Algebra. + | apply div_wd ]; algebra. Qed. End Well_Definedness. @@ -581,13 +565,13 @@ apply dist_2a. apply x_minus_x. apply mult_wdr. apply bin_op_wd_unfolded. -Algebra. +algebra. astepl (nring (S i) [*] (b[-]b[/] _[//]nring_ap_zero' _ _ (O_S n))). astepr (nring i[*] (b[-]b[/] _[//]nring_ap_zero' _ _ (O_S n))). rational. eapply eq_transitive_unfolded. apply sumx_const. -Algebra. +algebra. Qed. End Linearity_and_Monotonicity. @@ -915,7 +899,7 @@ Lemma pjp_1 : forall (i : nat) Hi Hi', partition_join_pts i Hi [=] fP i Hi'. intros; unfold partition_join_pts in |- *. elim le_lt_dec; intro; simpl in |- *. elim le_lt_eq_dec; intro; simpl in |- *. -Algebra. +algebra. elimtype False; rewrite b0 in Hi'; apply (lt_irrefl _ Hi'). elimtype False; apply le_not_lt with i n; auto with arith. Qed. @@ -925,7 +909,7 @@ intros; unfold partition_join_pts in |- *. elim le_lt_dec; intro; simpl in |- *. elim le_lt_eq_dec; intro; simpl in |- *. elimtype False; rewrite H in a1; apply (lt_irrefl _ a1). -Algebra. +algebra. elimtype False; rewrite H in b0; apply (lt_irrefl _ b0). Qed. @@ -936,7 +920,7 @@ elim le_lt_dec; intro; simpl in |- *. elimtype False; apply le_not_lt with i n; auto. cut (fQ _ (partition_join_aux' _ _ _ b0 Hi) [=] fQ _ Hi'). 2: apply HfQ'; auto. -Algebra. +algebra. Qed. (* end hide *) @@ -1001,7 +985,7 @@ eapply eq_transitive_unfolded. apply pjp_2; auto. eapply eq_transitive_unfolded. 2: apply eq_symmetric_unfolded; apply pjp_2; auto. -Algebra. +algebra. cut (n < j); [ intro | rewrite <- H; assumption ]. cut (i - S n < m); [ intro | omega ]. cut (j - S n < m); [ intro | omega ]. @@ -1018,12 +1002,12 @@ Lemma partition_join_Sum_lemma : unfold Partition_Sum in |- *; apply Sumx_weird_lemma. auto with arith. Opaque partition_join. -red in |- *; intros; apply mult_wd; Algebra; apply cg_minus_wd; apply prf1; +red in |- *; intros; apply mult_wd; algebra; apply cg_minus_wd; apply prf1; auto. -red in |- *; intros; apply mult_wd; Algebra; apply cg_minus_wd; apply prf1; +red in |- *; intros; apply mult_wd; algebra; apply cg_minus_wd; apply prf1; auto. red in |- *; intros; apply mult_wd; try apply cg_minus_wd; try apply pfwdef; - Algebra. + algebra. apply partition_join_Pts_wd; auto. apply prf1; auto. apply prf1; auto. @@ -1062,7 +1046,7 @@ apply prf1; transitivity (n + i - n); auto with arith. intro; apply x_mult_zero. astepr (partition_join _ Hi[-]partition_join _ Hi). apply cg_minus_wd. -Algebra. +algebra. unfold partition_join in |- *; simpl in |- *. apply eq_transitive_unfolded with c; unfold partition_join_fun in |- *; elim le_lt_dec; simpl in |- *. @@ -1211,16 +1195,16 @@ rewrite H2; clear H2; intros. apply partition_join_Pts_wd; auto. apply AbsIR_wd. apply cg_minus_wd. -2: Algebra. +2: algebra. apply eq_symmetric_unfolded. unfold Partition_Sum in |- *; apply Sumx_weird_lemma. auto. red in |- *; do 3 intro. -rewrite H2; clear H2; intros; Algebra. +rewrite H2; clear H2; intros; algebra. red in |- *; do 3 intro. -rewrite H2; clear H2; intros; Algebra. +rewrite H2; clear H2; intros; algebra. red in |- *; do 3 intro. -rewrite H2; clear H2; intros; Algebra. +rewrite H2; clear H2; intros; algebra. Opaque Even_Partition. intros; apply mult_wd. apply pfwdef; unfold partition_join_pts in |- *. @@ -1259,7 +1243,7 @@ unfold cg_minus in |- *. eapply eq_transitive_unfolded. apply Lim_plus. apply bin_op_wd_unfolded. -Algebra. +algebra. apply eq_symmetric_unfolded; apply Lim_const. unfold e in |- *. rstepl (e'[*] (b[-]a) [/] _[//]max_one_ap_zero (b[-]a)). @@ -1325,7 +1309,7 @@ apply with (integral _ _ _ _ H4[+]integral _ _ _ _ cont3). 2: apply bin_op_wd_unfolded. 2: apply integral_plus_integral. -2: Algebra. +2: algebra. 2: apply integral_plus_integral. rstepr (N[*] (mid1[-]a) [+]N[*] (mid2[-]mid1) [+]N[*] (b[-]mid2)). eapply leEq_less_trans. @@ -1464,7 +1448,7 @@ apply with (integral _ _ _ _ H5[+]integral _ _ _ _ cont3). 2: apply bin_op_wd_unfolded. 2: apply integral_plus_integral. -2: Algebra. +2: algebra. 2: apply integral_plus_integral. rstepl (Zero[*] (mid1[-]a) [+]Zero[*] (mid2[-]mid1) [+]Zero[*] (b[-]mid2)). apply plus_resp_less_leEq. diff --git a/ftc/IntervalFunct.v b/ftc/IntervalFunct.v index ea08b4b9a..d8b9b6d54 100644 --- a/ftc/IntervalFunct.v +++ b/ftc/IntervalFunct.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export PartFunEquality. @@ -70,7 +54,7 @@ Definition IConst := Build_CSetoid_fun _ _ (fun x => c) IConst_strext. End Const. Lemma IId_strext : forall x y : subset I, scs_elem _ _ x [#] scs_elem _ _ y -> x [#] y. -intros x y; case x; case y; intros; Algebra. +intros x y; case x; case y; intros; algebra. Qed. Definition IId := Build_CSetoid_fun _ _ _ IId_strext. diff --git a/ftc/MoreFunSeries.v b/ftc/MoreFunSeries.v index 3da01f8f0..2ba600958 100644 --- a/ftc/MoreFunSeries.v +++ b/ftc/MoreFunSeries.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export FunctSeries. @@ -113,7 +97,7 @@ apply (compact_single_prop x))). apply Cauchy_fun_real. unfold contf' in |- *; simpl in |- *; apply H. -intro; simpl in |- *; Algebra. +intro; simpl in |- *; algebra. apply compact_single_iprop; auto. Qed. @@ -153,7 +137,7 @@ Lemma Cauchy_fun_seq_Lim_char : forall a b Hab (Hinc : included (Compact Hab) J) intros. FEQ. simpl in |- *. -apply Lim_wd'; intros; simpl in |- *; Algebra. +apply Lim_wd'; intros; simpl in |- *; algebra. Qed. End More_Definitions. @@ -667,7 +651,7 @@ Lemma FSeries_Sum_char : forall a b Hab (Hinc : included (Compact Hab) J), intros; FEQ. simpl in |- *; Included. simpl in |- *; unfold h in |- *. -apply series_sum_wd; intros; Algebra. +apply series_sum_wd; intros; algebra. Qed. End Series_Definitions. @@ -777,7 +761,7 @@ Lemma fun_const_series_Sum_IR : forall y H intros. simpl in |- *. apply series_sum_wd. -Algebra. +algebra. Qed. Lemma conv_zero_fun_series_IR : fun_series_convergent_IR J (fun n => [-C-]Zero). @@ -993,8 +977,8 @@ Qed. Lemma insert_series_sum_char : forall n x Hx Hx', fun_seq_part_sum f n x Hx [=] fun_seq_part_sum insert_series (S n) x Hx'. intro; induction n as [| n Hrecn]. -intros; simpl in |- *; Algebra. -intros; simpl in |- *; simpl in Hrecn; Algebra. +intros; simpl in |- *; algebra. +intros; simpl in |- *; simpl in Hrecn; algebra. Qed. Lemma insert_series_conv : fun_series_convergent_IR J insert_series. @@ -1045,7 +1029,7 @@ clear convS; exists N; intros. eapply leEq_wdl. apply (HN (S n) (le_S _ _ H0) _ Hx). apply AbsIR_wd; apply cg_minus_wd. -2: Algebra. +2: algebra. apply eq_symmetric_unfolded. eapply eq_transitive_unfolded. eapply eq_transitive_unfolded. @@ -1057,8 +1041,8 @@ eapply eq_transitive_unfolded. (contin_imp_inc _ _ _ _ (included_imp_Continuous _ _ (Continuous_Sum0 _ _ insert_series_cont (S n)) _ _ _ Hinc) _ Hx)). -unfold fun_seq_part_sum in |- *; Algebra. -unfold fun_seq_part_sum in |- *; Algebra. +unfold fun_seq_part_sum in |- *; algebra. +unfold fun_seq_part_sum in |- *; algebra. Qed. End Insert_Series. diff --git a/ftc/MoreFunctions.v b/ftc/MoreFunctions.v index c3f76aac9..ac87d43f0 100644 --- a/ftc/MoreFunctions.v +++ b/ftc/MoreFunctions.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) (** printing FNorm %\ensuremath{\|\cdot\|_{\infty}}% *) @@ -133,7 +117,7 @@ auto. intros. apply Continuous_I_wd with F. FEQ. -simpl in |- *; Algebra. +simpl in |- *; algebra. auto. Qed. @@ -835,7 +819,7 @@ intros. unfold N_Deriv_fun in |- *. elim diffF; intros; simpl in |- *. apply n_deriv_I_wd'. -Algebra. +algebra. apply iprop_compact_in_interval'. apply iprop_compact_in_interval'. apply b. @@ -855,11 +839,11 @@ apply H1. eapply eq_transitive_unfolded. apply Min_comm. apply leEq_imp_Min_is_lft; apply eq_imp_leEq. -apply compact_in_interval_wd1; Algebra. +apply compact_in_interval_wd1; algebra. eapply leEq_wdr. apply H2. apply leEq_imp_Max_is_rht; apply eq_imp_leEq. -apply compact_in_interval_wd2; Algebra. +apply compact_in_interval_wd2; algebra. Qed. (* end hide *) @@ -887,7 +871,7 @@ apply H. eapply eq_transitive_unfolded. apply (N_Deriv_char y Hy H2). apply n_deriv_I_wd'. -Algebra. +algebra. apply iprop_compact_in_interval_inc2; apply iprop_compact_in_interval. apply iprop_compact_in_interval2_inc2; apply iprop_compact_in_interval2y. apply @@ -911,7 +895,7 @@ apply compact_in_interval_y_rht. eapply eq_transitive_unfolded. apply (N_Deriv_char x Hx H1). apply n_deriv_I_wd'. -Algebra. +algebra. apply iprop_compact_in_interval_inc2; apply iprop_compact_in_interval. apply iprop_compact_in_interval2_inc2; apply iprop_compact_in_interval2x. apply @@ -1161,7 +1145,7 @@ cut eapply eq_transitive_unfolded. apply (N_Deriv_char n F diffF x Hx H1). apply n_deriv_I_wd'; auto. -Algebra. +algebra. apply iprop_compact_in_interval_inc2; apply iprop_compact_in_interval. apply included_imp_Diffble_n; auto. apply included_interval'. diff --git a/ftc/MoreIntegrals.v b/ftc/MoreIntegrals.v index 02b4ac5e3..3a9f0b638 100644 --- a/ftc/MoreIntegrals.v +++ b/ftc/MoreIntegrals.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export Integral. @@ -101,7 +85,7 @@ astepr (integral a b Hab' F HF'[-]Zero). apply cg_minus_wd. apply integral_wd'. apply leEq_imp_Min_is_lft; assumption. -Algebra. +algebra. apply integral_empty. apply leEq_imp_Min_is_lft; assumption. Qed. @@ -168,7 +152,7 @@ Lemma Integral_wd' : forall a' b' Ha'b' contF', a [=] a' -> b [=] b' -> Integral contF [=] Integral (a:=a') (b:=b') (Hab:=Ha'b') (F:=F) contF'. intros. unfold Integral in |- *. -apply cg_minus_wd; apply integral_wd'; try apply bin_op_wd_unfolded; Algebra. +apply cg_minus_wd; apply integral_wd'; try apply bin_op_wd_unfolded; algebra. Qed. (** @@ -302,7 +286,7 @@ rstepl (integral a c Hac F Hac'[+]integral c b Hcb F Hcb'[-]integral a c Hac F Hac'). apply cg_minus_wd. apply integral_plus_integral. -Algebra. +algebra. Qed. Lemma integral_plus_integral' : forall a b Hab F c Hac Hcb Hab' Hac' Hcb', @@ -312,7 +296,7 @@ rstepl (integral a c Hac F Hac'[+]integral c b Hcb F Hcb'[-]integral c b Hcb F Hcb'). apply cg_minus_wd. apply integral_plus_integral. -Algebra. +algebra. Qed. (** @@ -534,7 +518,7 @@ apply rht_leEq_Max. apply leEq_transitive with b. apply Min_leEq_rht. apply rht_leEq_Max. -apply Integral_empty; Algebra. +apply Integral_empty; algebra. apply included_imp_contin with (Hab := Hab). 2: apply contF. intros x H. diff --git a/ftc/MoreIntervals.v b/ftc/MoreIntervals.v index 8acbd0507..5d0a729a8 100644 --- a/ftc/MoreIntervals.v +++ b/ftc/MoreIntervals.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export NthDerivative. @@ -672,14 +656,14 @@ Lemma compact_in_interval_wd1 : forall I pI x Hx y Hy (H : compact_ (compact_in_interval I pI x Hx)) (H' : compact_ (compact_in_interval I pI y Hy)), x [=] y -> Lend H [=] Lend H'. -intro I; elim I; simpl in |- *; intros; Algebra. +intro I; elim I; simpl in |- *; intros; algebra. Qed. Lemma compact_in_interval_wd2 : forall I pI x Hx y Hy (H : compact_ (compact_in_interval I pI x Hx)) (H' : compact_ (compact_in_interval I pI y Hy)), x [=] y -> Rend H [=] Rend H'. -intro I; elim I; simpl in |- *; intros; Algebra. +intro I; elim I; simpl in |- *; intros; algebra. Qed. (** diff --git a/ftc/NthDerivative.v b/ftc/NthDerivative.v index 8fdaa6c43..67b504abd 100644 --- a/ftc/NthDerivative.v +++ b/ftc/NthDerivative.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export Differentiability. @@ -349,11 +333,11 @@ eapply eq_transitive_unfolded. apply csf_wd_unfolded. cut (scs_elem _ _ x [=] scs_elem _ _ x). case x; simpl in |- *; auto. -Algebra. +algebra. apply csf_wd_unfolded. cut (scs_elem _ _ x [=] scs_elem _ _ x). case x; simpl in |- *; auto. -Algebra. +algebra. Qed. End aux. @@ -372,11 +356,11 @@ exists (IntPartIR (F:=(Frestr (F:=PartInt f') (compact_wd _ _ _) H)) (included_refl _ _)). apply Derivative_I_wdr with (PartInt f'). FEQ. -simpl in |- *; apply csf_wd_unfolded; simpl in |- *; Algebra. +simpl in |- *; apply csf_wd_unfolded; simpl in |- *; algebra. apply included_imp_deriv with (Hab := Hab'); auto. apply Derivative_I_n_wdl with (PartInt f'). FEQ. -simpl in |- *; apply csf_wd_unfolded; simpl in |- *; Algebra. +simpl in |- *; apply csf_wd_unfolded; simpl in |- *; algebra. auto. Qed. @@ -410,7 +394,7 @@ elim H0; clear H0; intros H3 H4. elim H4; clear H4; intros H0 H5. apply Derivative_I_n_unique with 0 G. simpl in |- *; apply Feq_reflexive; auto. -simpl in |- *; FEQ; Algebra. +simpl in |- *; FEQ; algebra. auto. elim H0; intros F' H3 H4. exists F'; auto. @@ -525,7 +509,7 @@ apply apply eq_imp_Feq. Included. Included. -intros; simpl in |- *; apply csf_wd_unfolded; simpl in |- *; Algebra. +intros; simpl in |- *; apply csf_wd_unfolded; simpl in |- *; algebra. apply projT2. intro. cut {p : nat | p = S n}. @@ -586,7 +570,7 @@ apply projT2. apply projT2. FEQ. apply n_deriv_inc. -simpl in |- *; Algebra. +simpl in |- *; algebra. elim H'; intros. eapply Diffble_I_n_wd. 2: apply p. @@ -634,7 +618,7 @@ auto. apply lft_leEq_Max. apply n_deriv_lemma. auto. -simpl in |- *; Algebra. +simpl in |- *; algebra. apply eq_symmetric_unfolded. apply Feq_imp_eq with (Compact (less_leEq _ _ _ Hab')). apply Derivative_I_n_unique with n F. @@ -677,7 +661,7 @@ Lemma n_deriv_I_wd'' : forall n a b Hab Hab' F H H' x y, x [=] y -> forall Hx Hy, n_deriv_I a b Hab n F H x Hx [=] n_deriv_I a b Hab' n F H' y Hy. intros n a b Hab Hab' F H H' x y H0 H1 H2 Hx Hy. apply n_deriv_I_wd'. -Algebra. +algebra. auto. auto. apply included_imp_diffble_n with (Hab' := Hab). diff --git a/ftc/PartFunEquality.v b/ftc/PartFunEquality.v index 624ae6a7c..85308b130 100644 --- a/ftc/PartFunEquality.v +++ b/ftc/PartFunEquality.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) (** printing Feq %\ensuremath{\approx}% #≈# *) @@ -307,7 +291,7 @@ Lemma Feq_symmetric : Feq I F G -> Feq I G F. intro H0. elim H0; intros H' H1. elim H1; intros incF incG. -FEQ; Algebra. +FEQ; algebra. Qed. Lemma Feq_transitive : Feq I F G -> Feq I G H -> Feq I F H. @@ -339,14 +323,14 @@ elim H0; intros incF H0'. elim H0'; clear H0 H0'; intros incG H2. elim H1; intros incF' H1'. elim H1'; clear H1 H1'; intros incG' H1. -FEQ; simpl in |- *; Algebra. +FEQ; simpl in |- *; algebra. Qed. Lemma Feq_inv : Feq I F F' -> Feq I {--}F {--}F'. intro H0. elim H0; intros incF H0'. elim H0'; clear H0 H0'; intros incF' H1. -FEQ; simpl in |- *; Algebra. +FEQ; simpl in |- *; algebra. Qed. Lemma Feq_minus : Feq I F F' -> Feq I G G' -> Feq I (F{-}G) (F'{-}G'). @@ -355,7 +339,7 @@ elim H0; intros incF H0'. elim H0'; clear H0 H0'; intros incG H2. elim H1; intros incF' H1'. elim H1'; clear H1 H1'; intros incG' H0. -FEQ; simpl in |- *; Algebra. +FEQ; simpl in |- *; algebra. Qed. Lemma Feq_mult : Feq I F F' -> Feq I G G' -> Feq I (F{*}G) (F'{*}G'). @@ -364,7 +348,7 @@ elim H0; intros incF H0'. elim H0'; clear H0 H0'; intros incG H2. elim H1; intros incF' H1'. elim H1'; clear H1 H1'; intros incG' H0. -FEQ; simpl in |- *; Algebra. +FEQ; simpl in |- *; algebra. Qed. Lemma Feq_nth : forall n : nat, Feq I F F' -> Feq I (F{^}n) (F'{^}n). @@ -385,7 +369,7 @@ auto. intros x H Hx; apply ap_wdl_unfolded with (F x (incF x H)). apply bnd_imp_ap_zero with I; assumption. auto. -simpl in |- *; Algebra. +simpl in |- *; algebra. Qed. Lemma Feq_recip' : bnd_away_zero I F -> Feq I F' F -> Feq I {1/}F' {1/}F. @@ -407,7 +391,7 @@ apply included_FDiv; auto. intros x H Hx; apply ap_wdl_unfolded with (G x (incG x H)). apply bnd_imp_ap_zero with I; assumption. auto. -simpl in |- *; Algebra. +simpl in |- *; algebra. Qed. Lemma Feq_div' : bnd_away_zero I G -> @@ -476,7 +460,7 @@ Hypothesis Hf : included Q (Dom F). Lemma FNth_zero : forall x, Q x -> forall Hx Hx', [-C-]One x Hx [=] (F{^}0) x Hx'. intros. -Algebra. +algebra. Qed. Variable n : nat. diff --git a/ftc/PartInterval.v b/ftc/PartInterval.v index 6ff0d9658..e1e29a49c 100644 --- a/ftc/PartInterval.v +++ b/ftc/PartInterval.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export IntervalFunct. @@ -143,14 +127,14 @@ Lemma part_int_const : Feq I [-C-]c (PartInt (IConst (Hab:=Hab) c)). apply eq_imp_Feq. red in |- *; simpl in |- *; intros; auto. unfold I in |- *; apply included_refl. -intros; simpl in |- *; Algebra. +intros; simpl in |- *; algebra. Qed. Lemma part_int_id : Feq I FId (PartInt (IId (Hab:=Hab))). apply eq_imp_Feq. red in |- *; simpl in |- *; intros; auto. unfold I in |- *; apply included_refl. -intros; simpl in |- *; Algebra. +intros; simpl in |- *; algebra. Qed. Lemma part_int_plus : Feq I (F{+}G) (PartInt (IPlus f g)). @@ -162,7 +146,7 @@ apply eq_imp_Feq. Included. Included. intros; simpl in |- *; simpl in Hf, Hg. -simpl in |- *; Algebra. +simpl in |- *; algebra. Qed. Lemma part_int_inv : Feq I {--}F (PartInt (IInv f)). @@ -172,7 +156,7 @@ apply eq_imp_Feq. Included. Included. intros; simpl in |- *; simpl in Hf. -simpl in |- *; Algebra. +simpl in |- *; algebra. Qed. Lemma part_int_minus : Feq I (F{-}G) (PartInt (IMinus f g)). @@ -184,7 +168,7 @@ apply eq_imp_Feq. Included. Included. intros; simpl in |- *; simpl in Hf, Hg. -simpl in |- *; Algebra. +simpl in |- *; algebra. Qed. Lemma part_int_mult : Feq I (F{*}G) (PartInt (IMult f g)). @@ -196,7 +180,7 @@ apply eq_imp_Feq. Included. Included. intros; simpl in |- *; simpl in Hf, Hg. -simpl in |- *; Algebra. +simpl in |- *; algebra. Qed. Lemma part_int_nth : forall n : nat, Feq I (F{^}n) (PartInt (INth f n)). @@ -208,7 +192,7 @@ Included. Included. intros; simpl in |- *; simpl in Hf. astepl (Part F x Hx[^]n); astepr (f (Build_subcsetoid_crr IR _ x Hx')[^]n). -apply nexp_wd; Algebra. +apply nexp_wd; algebra. Qed. (* begin show *) @@ -222,7 +206,7 @@ elim Hg'; clear Gg Hg'; intros incG' Hg'. apply eq_imp_Feq. Included. Included. -intros; simpl in Hg'; simpl in |- *; Algebra. +intros; simpl in Hg'; simpl in |- *; algebra. Qed. Lemma part_int_div : Feq I (F{/}G) (PartInt (IDiv f g Hg)). @@ -234,7 +218,7 @@ apply eq_imp_Feq. Included. Included. intros; simpl in Hf, Hg'; simpl in |- *. -Algebra. +algebra. Qed. End Equivalences. diff --git a/ftc/Partitions.v b/ftc/Partitions.v index 483668a1d..2b330732d 100644 --- a/ftc/Partitions.v +++ b/ftc/Partitions.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export Continuity. @@ -152,7 +136,7 @@ apply (fun (i : nat) (Hi : i <= n) => a[+]nring i[*] (b[-]a[/] _[//]nring_ap_zero' _ n Hn)). intros; simpl in |- *. -rewrite H; Algebra. +rewrite H; algebra. intros; simpl in |- *. apply plus_resp_leEq_lft. apply mult_resp_leEq_rht. @@ -401,7 +385,7 @@ apply leEq_transitive with (P _ (le_n (S n)) [-]P _ (le_S _ _ (le_n n))). apply shift_leEq_minus; astepl (P _ (le_S _ _ (le_n n))). apply prf2. apply maxlist_greater. -right; Algebra. +right; algebra. Qed. Lemma AntiMesh_nonneg : forall n (a b : IR) (Hab : a [<=] b) (P : Partition Hab n), @@ -546,7 +530,7 @@ Lemma Mesh_wd : forall n a b b' (Hab : a [<=] b) (Hab' : a [<=] b') (forall i Hi, P i Hi [=] Q i Hi) -> Mesh P [=] Mesh Q. simple induction n. intros. -unfold Mesh in |- *; simpl in |- *; Algebra. +unfold Mesh in |- *; simpl in |- *; algebra. clear n; intro. case n. intros. @@ -559,23 +543,23 @@ apply with (Max (P _ (le_n (S (S n))) [-]P _ (le_S _ _ (le_n (S n)))) (maxlist (Part_Mesh_List (Partition_Dom P)))). -simpl in |- *; Algebra. +simpl in |- *; algebra. apply eq_transitive_unfolded with (Max (Q _ (le_n (S (S n))) [-]Q _ (le_S _ _ (le_n (S n)))) (maxlist (Part_Mesh_List (Partition_Dom Q)))). -2: simpl in |- *; Algebra. +2: simpl in |- *; algebra. apply Max_wd_unfolded. apply cg_minus_wd; apply H0. apply eq_transitive_unfolded with (Mesh (Partition_Dom P)). -unfold Mesh in |- *; Algebra. +unfold Mesh in |- *; algebra. apply eq_transitive_unfolded with (Mesh (Partition_Dom Q)). apply H. intros. unfold Partition_Dom in |- *; simpl in |- *. apply H0. -unfold Mesh in |- *; Algebra. +unfold Mesh in |- *; algebra. Qed. Lemma Mesh_wd' : forall n a b (Hab : a [<=] b) (P Q : Partition Hab n), @@ -610,7 +594,7 @@ apply (maxlist (Part_Mesh_List (Partition_Dom (Even_Partition Hab _ Hm))))). cut (n = S (pred n)); [ intro | apply S_pred with 0; auto ]. generalize Hm; rewrite H0; clear Hm; intro. -simpl in |- *; Algebra. +simpl in |- *; algebra. eapply eq_transitive_unfolded. apply Max_comm. simpl in |- *. @@ -621,7 +605,7 @@ apply eq_imp_leEq. rstepr (b[-]a[/] nring n[+]One[//]nring_ap_zero' _ _ Hm). apply eq_transitive_unfolded with (Mesh (Partition_Dom (Even_Partition Hab _ Hm))). -simpl in |- *; Algebra. +simpl in |- *; algebra. cut (0 <> n); intro. eapply eq_transitive_unfolded. apply @@ -686,7 +670,7 @@ intro. exists H1. simpl in |- *. apply bin_op_wd_unfolded. -Algebra. +algebra. generalize Hm; rewrite Hk. clear Hm; intro. rstepl @@ -696,7 +680,7 @@ rstepl apply mult_wd. apply eq_symmetric_unfolded; apply nring_comm_mult. apply div_wd. -Algebra. +algebra. apply eq_symmetric_unfolded; apply nring_comm_mult. rewrite Hk. apply mult_le_compat_r; assumption. diff --git a/ftc/RefLemma.v b/ftc/RefLemma.v index bf72e2d75..c56965fe5 100644 --- a/ftc/RefLemma.v +++ b/ftc/RefLemma.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export RefSeparating. @@ -369,7 +353,7 @@ apply eq_symmetric_unfolded; (f := fun (j : nat) (Hj : sub i <= j) (Hj' : j <= pred (sub (S i))) => Q (S j) (H' _ _ H1 Hj') [-]Q j (lt_le_weak _ _ (H _ _ H1 Hj'))). apply RL_sub_SS. -Algebra. +algebra. Qed. Lemma ref_calc4 : @@ -402,7 +386,7 @@ apply Sumx_wd; intros. eapply eq_transitive_unfolded. apply Sum2_minus_Sum2. apply RL_sub_SS. -Algebra. +algebra. Qed. Lemma ref_calc5 : @@ -425,7 +409,7 @@ Lemma ref_calc5 : apply AbsIR_wd; apply Sumx_wd; intros. apply Sum2_wd; intros. apply RL_sub_SS. -Algebra. +algebra. Qed. Lemma ref_calc6 : @@ -451,7 +435,7 @@ apply AbsIR_wd. apply Sum2_wd. apply RL_sub_SS. intros j Hj Hj'. -Algebra. +algebra. Qed. Lemma ref_calc7 : @@ -473,7 +457,7 @@ apply Sumx_resp_leEq; intros. eapply leEq_wdr. apply triangle_Sum2IR. apply RL_sub_SS. -Algebra. +algebra. Qed. Lemma ref_calc8 : @@ -580,7 +564,7 @@ apply eq_symmetric_unfolded; eapply eq_transitive_unfolded. apply Sumx_wd; intros. eapply eq_transitive_unfolded. 2: apply Sum2_comm_scal'. -Algebra. +algebra. apply RL_sub_SS. Qed. @@ -779,9 +763,9 @@ apply apply sep__part_Sum. assumption. apply AbsIR_wd; apply cg_minus_wd. -Algebra. +algebra. unfold Partition_Sum in |- *; apply Sumx_wd; intros. -Algebra. +algebra. Qed. Let csi2 := Min (b[-]a) ((d'[-]Mesh R) [/]TwoNZ). @@ -853,9 +837,9 @@ apply apply sep__part_Sum. assumption. apply AbsIR_wd; apply cg_minus_wd. -Algebra. +algebra. unfold Partition_Sum in |- *; apply Sumx_wd; intros. -Algebra. +algebra. Qed. Let csi3 := d[-]Mesh P'. @@ -901,9 +885,9 @@ apply unfold Q, fQ in |- *; apply sep__sep_Sum. apply AbsIR_wd. unfold Partition_Sum in |- *; apply cg_minus_wd. -Algebra. +algebra. apply Sumx_wd; intros. -Algebra. +algebra. Qed. (* end hide *) @@ -979,16 +963,16 @@ unfold Partition_Sum in |- *; apply Sumx_wd; intros. eapply eq_transitive_unfolded. 2: apply ring_distl_minus. apply mult_wdl. -rstepr (Part F (fP i H) (just HfP)); Algebra. +rstepr (Part F (fP i H) (just HfP)); algebra. apply cg_minus_wd. -2: Algebra. +2: algebra. astepr (Fa[*]b[-]Fa[*]a). eapply eq_transitive_unfolded. apply Mengolli_Sum with (f := fun (i : nat) (Hi : i <= n) => Fa[*]P i Hi). red in |- *; intros. apply mult_wdr. apply prf1; auto. -intros; Algebra. +intros; algebra. apply cg_minus_wd; apply mult_wdr. apply finish. apply start. @@ -1105,7 +1089,7 @@ eapply eq_transitive_unfolded. apply Mengolli_Sum with (f := fun (i : nat) (Hi : i <= m) => R i Hi). red in |- *; intros. apply prf1; auto. -intros; Algebra. +intros; algebra. apply cg_minus_wd; [ apply finish | apply start ]. eapply leEq_transitive. apply triangle_SumxIR. @@ -1142,7 +1126,7 @@ eapply eq_transitive_unfolded. apply Mengolli_Sum with (f := fun (i : nat) (Hi : i <= n) => P i Hi). red in |- *; intros. apply prf1; auto. -intros; Algebra. +intros; algebra. apply cg_minus_wd; [ apply finish | apply start ]. Qed. diff --git a/ftc/RefSepRef.v b/ftc/RefSepRef.v index ee79a93b0..b0c6e4dbe 100644 --- a/ftc/RefSepRef.v +++ b/ftc/RefSepRef.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) (* begin hide *) @@ -185,21 +169,21 @@ do 3 intro. rewrite <- H; intros; unfold Separated_Refinement_fun in |- *; simpl in |- *. elim (le_lt_eq_dec _ _ Hi); elim (le_lt_eq_dec _ _ Hj); elim (le_lt_dec i 0); intros; simpl in |- *. -Algebra. +algebra. apply RSR_h_nlnf; reflexivity. elimtype False; rewrite <- b0 in a1; apply (lt_irrefl _ a1). elimtype False; rewrite <- b1 in a0; apply (lt_irrefl _ a0). elimtype False; rewrite <- b0 in a1; apply (lt_irrefl _ a1). elimtype False; rewrite <- b1 in a0; apply (lt_irrefl _ a0). -Algebra. -Algebra. +algebra. +algebra. Qed. Lemma Separated_Refinement_lemma3 : forall H : 0 <= pred (m + n), Separated_Refinement_fun 0 H[=]a. intros; unfold Separated_Refinement_fun in |- *; simpl in |- *. elim (le_lt_eq_dec _ _ H); elim (le_lt_dec 0 0); intros; simpl in |- *. -Algebra. +algebra. elimtype False; inversion b0. apply eq_symmetric_unfolded; apply partition_length_zero with Hab. cut (m + n <= 1); [ intro | omega ]. @@ -214,11 +198,11 @@ Lemma Separated_Refinement_lemma4 : Separated_Refinement_fun (pred (m + n)) H[=]b. intros; unfold Separated_Refinement_fun in |- *; simpl in |- *. elim (le_lt_eq_dec _ _ H); elim (le_lt_dec 0 0); intros; simpl in |- *. -Algebra. +algebra. elimtype False; apply (lt_irrefl _ a1). elimtype False; apply (lt_irrefl _ a0). -Algebra. -Algebra. +algebra. +algebra. Qed. Lemma Separated_Refinement_lemma2 : diff --git a/ftc/RefSeparated.v b/ftc/RefSeparated.v index 61f32531c..553ebd372 100644 --- a/ftc/RefSeparated.v +++ b/ftc/RefSeparated.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) (* begin hide *) @@ -202,7 +186,7 @@ apply RS_delta_deltaR. unfold deltaR in |- *; apply AntiMesh_lemma. apply shift_leEq_minus; eapply leEq_wdl. apply H3. -Algebra. +algebra. apply shift_leEq_minus; astepl (R j' Hj'). eapply leEq_transitive. apply H3. @@ -328,7 +312,7 @@ eapply less_wdl. apply H with (Hi' := Hi). apply AbsIR_wd. apply cg_minus_wd. -Algebra. +algebra. apply prf1; auto. apply less_imp_ap; apply separation_conseq with j' Hj'. apply H. @@ -364,8 +348,8 @@ rstepr (P i Hi'[+]delta [/]TwoNZ[-]P i Hi'). apply cg_minus_wd. apply bin_op_wd_unfolded. apply prf1; auto. -Algebra. -Algebra. +algebra. +algebra. astepr (delta [/]TwoNZ); apply less_leEq; apply pos_div_two; exact RS_delta_pos. apply leEq_wdl with ZeroR. astepr (delta [/]TwoNZ); apply less_leEq; apply pos_div_two; exact RS_delta_pos. @@ -390,7 +374,7 @@ eapply eq_transitive_unfolded. apply eq_symmetric_unfolded; apply AbsIRz_isz. apply AbsIR_wd. astepl (a[-]a). -apply cg_minus_wd; [ Algebra | apply eq_symmetric_unfolded; apply start ]. +apply cg_minus_wd; [ algebra | apply eq_symmetric_unfolded; apply start ]. elim (le_lt_eq_dec _ _ Hi); intro; simpl in |- *. apply sep__sep_fun_i_delta; assumption. generalize Hi'; rewrite b1; intros. @@ -400,7 +384,7 @@ eapply eq_transitive_unfolded. apply eq_symmetric_unfolded; apply AbsIRz_isz. apply AbsIR_wd. astepl (b[-]b). -apply cg_minus_wd; [ Algebra | apply eq_symmetric_unfolded; apply finish ]. +apply cg_minus_wd; [ algebra | apply eq_symmetric_unfolded; apply finish ]. Qed. Lemma sep__sep_mon_i : @@ -449,7 +433,7 @@ rewrite <- H. intros. unfold sep__sep_fun_i in |- *. elim (sep__sep_aux_lemma i); intros; simpl in |- *. -apply bin_op_wd_unfolded; [ apply prf1; auto | Algebra ]. +apply bin_op_wd_unfolded; [ apply prf1; auto | algebra ]. apply prf1; auto. Qed. @@ -460,7 +444,7 @@ Lemma sep__sep_fun_wd : intros. unfold sep__sep_fun in |- *. elim (le_lt_dec i 0); elim (le_lt_dec j 0); intros; simpl in |- *. -Algebra. +algebra. elimtype False; apply (lt_irrefl 0); apply lt_le_trans with j; auto; rewrite <- H; auto. elimtype False; apply (lt_irrefl 0); apply lt_le_trans with j; auto; @@ -469,7 +453,7 @@ elim (le_lt_eq_dec _ _ Hi); elim (le_lt_eq_dec _ _ Hj); intros; simpl in |- *. apply sep__sep_fun_i_wd; auto. elimtype False; rewrite H in a0; rewrite b2 in a0; apply (lt_irrefl _ a0). elimtype False; rewrite <- H in a0; rewrite b2 in a0; apply (lt_irrefl _ a0). -Algebra. +algebra. Qed. Definition sep__sep_part : Partition Hab n. @@ -478,7 +462,7 @@ exact sep__sep_fun_wd. intros; apply less_leEq; apply sep__sep_mon. intros; unfold sep__sep_fun in |- *. elim (le_lt_dec 0 0); intro; simpl in |- *. -Algebra. +algebra. elimtype False; inversion b0. intros; unfold sep__sep_fun in |- *. elim (le_lt_dec n 0); intro; simpl in |- *. @@ -487,7 +471,7 @@ cut (n = 0); [ intro | auto with arith ]. rewrite <- H0; apply P. elim (le_lt_eq_dec _ _ H); intro; simpl in |- *. elimtype False; apply (lt_irrefl _ a0). -Algebra. +algebra. Defined. Lemma sep__sep_lemma : Separated sep__sep_part R. @@ -584,7 +568,7 @@ apply shift_leEq_plus; astepl ZeroR; apply less_leEq; exact RS_Hd. apply shift_leEq_minus. eapply leEq_wdl. apply rht_leEq_Max. -Algebra. +algebra. Qed. Notation just1 := (incF _ (Pts_part_lemma _ _ _ _ _ _ gP _ _)). @@ -655,7 +639,7 @@ apply AbsIR (P _ H[-]P _ (lt_le_weak _ _ H))). eapply eq_transitive_unfolded. 2: apply AbsIR_resp_mult. -apply AbsIR_wd; Algebra. +apply AbsIR_wd; algebra. apply mult_wdr. apply AbsIR_eq_x. apply shift_leEq_minus; astepl (P i (lt_le_weak _ _ H)); apply prf2. @@ -691,7 +675,7 @@ apply mult_wdr. eapply eq_transitive_unfolded. apply Mengolli_Sum with (f := fun (i : nat) (Hi : i <= n) => P i Hi). red in |- *; intros; apply prf1; auto. -intros; Algebra. +intros; algebra. apply cg_minus_wd. apply finish. apply start. @@ -747,14 +731,14 @@ fold (Mesh P) in |- *; apply Mesh_lemma. apply leEq_transitive with delta. apply less_leEq; apply pos_div_two'; exact RS_delta_pos. apply RS_delta_csi. -apply cg_minus_wd; [ Algebra | apply start ]. +apply cg_minus_wd; [ algebra | apply start ]. generalize Hi'; rewrite H0; clear Hx Hi'; intro. apply leEq_wdl with (P 1 Hi'[-]P 0 (le_O_n _)). fold (Mesh P) in |- *; apply leEq_transitive with (Mesh P[+]Zero). astepr (Mesh P); apply Mesh_lemma. apply plus_resp_leEq_lft. apply less_leEq; assumption. -apply cg_minus_wd; [ Algebra | apply start ]. +apply cg_minus_wd; [ algebra | apply start ]. elim (le_lt_eq_dec _ _ Hi); intro; simpl in |- *. unfold sep__sep_fun_i in |- *. elim (sep__sep_aux_lemma (S i)); elim (sep__sep_aux_lemma i); intros; @@ -812,7 +796,7 @@ apply less_leEq; exact RS_delta_pos. apply RS_delta_csi. apply cg_minus_wd. generalize Hi'; rewrite b1; intro; apply finish. -Algebra. +algebra. apply leEq_wdl with (P (S i) Hi'[-]P i Hi). fold (Mesh P) in |- *; apply leEq_transitive with (Mesh P[+]Zero). astepr (Mesh P); apply Mesh_lemma. @@ -820,7 +804,7 @@ apply plus_resp_leEq_lft. apply less_leEq; assumption. apply cg_minus_wd. generalize Hi'; rewrite b1; intro; apply finish. -Algebra. +algebra. elimtype False; rewrite b3 in b1; apply n_Sn with n; auto. Qed. diff --git a/ftc/RefSeparating.v b/ftc/RefSeparating.v index 645107a77..69f7b8f2f 100644 --- a/ftc/RefSeparating.v +++ b/ftc/RefSeparating.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) (* begin hide *) @@ -882,7 +866,7 @@ assumption. apply lt_le_trans with (sep__part_fun (S i) Hi''). assumption. apply sep__part_fun_bnd. -apply mult_wd; Algebra. +apply mult_wd; algebra. apply cg_minus_wd; apply prf1; auto. elimtype False. apply le_not_lt with (sep__part_fun i Hi') j. @@ -905,7 +889,7 @@ apply Sumx_wd; intros. unfold part_tot_nat_fun in |- *. elim (le_lt_dec n i); intro; simpl in |- *. elimtype False; apply le_not_lt with n i; auto. -apply mult_wd; Algebra. +apply mult_wd; algebra. apply cg_minus_wd; apply prf1; auto. Qed. @@ -972,10 +956,10 @@ apply F (sep__part_pts i Hi) just2[*] (P _ (RS'_Hsep_S _ _ _ Hj')[-]P _ (RS'_Hsep _ _ _ Hj')))). apply cg_minus_wd. -Algebra. +algebra. apply eq_symmetric_unfolded; eapply eq_transitive_unfolded. 2: apply Sum2_comm_scal'. -Algebra. +algebra. rewrite <- (S_pred (sep__part_fun (S i) Hi) (sep__part_fun i (lt_le_weak _ _ Hi)) (sep__part_fun_mon _ _ _ _ (lt_n_Sn i))). @@ -991,7 +975,7 @@ rewrite <- (S_pred (sep__part_fun (S i) Hi) (sep__part_fun i (lt_le_weak _ _ Hi)) (sep__part_fun_mon _ _ _ _ (lt_n_Sn i))). apply lt_le_weak; apply sep__part_fun_mon; apply lt_n_Sn. -Algebra. +algebra. Qed. Lemma sep__part_Sum4 : @@ -1081,7 +1065,7 @@ assumption. eapply lt_le_trans. apply H0. apply sep__part_fun_bnd. -Algebra. +algebra. elimtype False; apply (le_not_lt _ _ H0). rewrite (S_pred (sep__part_fun (S i) Hi'') (sep__part_fun i Hi')). cut (sep__part_fun (S i) Hi'' = sep__part_fun (S i) Hi); @@ -1145,16 +1129,16 @@ apply ((F (g k (RS'_Hsep_S _ _ H Hk')) just1[-]F (g _ (sep__part_aux RS'_m1)) just1)[*] (P (S k) (RS'_Hsep_S _ _ H Hk')[-]P k (RS'_Hsep _ _ H Hk')))). 2: apply AbsIR_wd; apply mult_wdl. -2: apply cg_minus_wd; [ Algebra | idtac ]. +2: apply cg_minus_wd; [ algebra | idtac ]. 2: cut (i = RS'_m1); [ intro | auto ]. 2: generalize H; rewrite H3; intro. -2: unfold sep__part_pts in |- *; simpl in |- *; Algebra. +2: unfold sep__part_pts in |- *; simpl in |- *; algebra. elim (le_lt_dec (pred (sep__part_h (S RS'_m1))) k); intro. cut (pred (sep__part_h (S RS'_m1)) = k); intros. apply leEq_wdl with ZeroR. astepl ((Zero[+]Zero)[*]ZeroR). apply mult_resp_leEq_both. -apply eq_imp_leEq; Algebra. +apply eq_imp_leEq; algebra. apply leEq_reflexive. apply plus_resp_leEq_both; unfold M in |- *; apply positive_norm. apply less_leEq; astepr (delta [/]TwoNZ); apply pos_div_two; exact RS'_delta_pos. @@ -1164,7 +1148,7 @@ apply AbsIR_wd. rstepr ((F (g _ (sep__part_aux RS'_m1)) just1[-]F (g _ (sep__part_aux RS'_m1)) just1)[*] (P (S k) (RS'_Hsep_S _ _ H Hk')[-]P k (RS'_Hsep _ _ H Hk'))). -Algebra. +algebra. cut (forall H, sep__part_fun (S i) H = n). intro. cut (sep__part_h (S RS'_m1) = n); intros. @@ -1196,7 +1180,7 @@ apply (P (S k) (RS'_Hsep_S _ _ H Hk')[-]P k (RS'_Hsep _ _ H Hk')))). 2: apply AbsIR_wd; apply mult_wd. 2: apply cg_minus_wd; apply pfwdef; - [ Algebra | unfold sep__part_pts in |- *; apply gP' ]; + [ algebra | unfold sep__part_pts in |- *; apply gP' ]; auto. 2: apply cg_minus_wd; apply prf1; auto. elim (le_lt_dec (pred (sep__part_h RS'_m1)) k); intro. @@ -1233,7 +1217,7 @@ clear Hk Hk'; omega. apply leEq_wdl with ZeroR. astepl ((Zero[+]Zero)[*]ZeroR). apply mult_resp_leEq_both. -apply eq_imp_leEq; Algebra. +apply eq_imp_leEq; algebra. apply leEq_reflexive. apply plus_resp_leEq_both; unfold M in |- *; apply positive_norm. apply less_leEq; astepr (delta [/]TwoNZ); apply pos_div_two; exact RS'_delta_pos. @@ -1282,7 +1266,7 @@ apply sep__part_fun_bnd. apply leEq_wdl with ZeroR. astepl ((Zero[+]Zero)[*]ZeroR). apply mult_resp_leEq_both. -apply eq_imp_leEq; Algebra. +apply eq_imp_leEq; algebra. apply leEq_reflexive. apply plus_resp_leEq_both; unfold M in |- *; apply positive_norm. apply less_leEq; astepr (delta [/]TwoNZ); apply pos_div_two; exact RS'_delta_pos. diff --git a/ftc/Rolle.v b/ftc/Rolle.v index cf3d0e27c..20d6cac98 100644 --- a/ftc/Rolle.v +++ b/ftc/Rolle.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export DiffTactics2. @@ -145,14 +129,14 @@ apply eq_transitive_unfolded with (fcp _ (le_n n) [-]fcp 0 (le_O_n n)). apply Mengolli_Sum with (f := fun (i : nat) (H : i <= n) => fcp _ H). red in |- *; do 3 intro. rewrite H; intros. -unfold fcp in |- *; simpl in |- *; Algebra. -intros; Algebra. +unfold fcp in |- *; simpl in |- *; algebra. +intros; algebra. apply eq_transitive_unfolded with (F b Hb[-]F a Ha). unfold fcp, compact_part, n in |- *; simpl in |- *. apply cg_minus_wd; apply pfwdef; rational. astepr (F a Ha[-]F a Ha); apply cg_minus_wd. apply eq_symmetric_unfolded; apply Fab. -Algebra. +algebra. Qed. Let incF' : included (Compact Hab) (Dom F'). @@ -180,7 +164,7 @@ apply (cp _ H[-]cp _ (lt_le_weak _ _ H))). red in |- *; do 3 intro. rewrite H; intros. -unfold fcp' in |- *; Algebra. +unfold fcp' in |- *; algebra. apply less_wdl with @@ -209,7 +193,7 @@ apply plus_resp_leEq_lft. apply leEq_wdr with (e [/]TwoNZ[*]AbsIR (cp (S i) H[-]cp i (lt_le_weak _ _ H))). 2: apply mult_wd. -2: Algebra. +2: algebra. 2: apply AbsIR_eq_x. 2: apply less_leEq; apply compact_less. eapply leEq_transitive. @@ -234,7 +218,7 @@ astepl (Zero[-]e); apply shift_minus_less. eapply mult_cancel_less. 2: eapply less_wdl. 2: apply Hi'. -2: Algebra. +2: algebra. apply compact_less. Qed. @@ -251,7 +235,7 @@ apply (cp _ H[-]cp _ (lt_le_weak _ _ H))). red in |- *; do 3 intro. rewrite H; intros. -unfold fcp' in |- *; Algebra. +unfold fcp' in |- *; algebra. apply less_wdr with @@ -283,7 +267,7 @@ unfold cg_minus at 1 in |- *; apply plus_resp_leEq_lft. apply inv_resp_leEq; apply leEq_wdr with (e [/]TwoNZ[*]AbsIR (cp _ H[-]cp _ (lt_le_weak _ _ H))). 2: apply mult_wd. -2: Algebra. +2: algebra. 2: apply AbsIR_eq_x. 2: apply less_leEq; apply compact_less. eapply leEq_transitive. @@ -308,7 +292,7 @@ astepr (e[+]Zero); apply shift_less_plus'. eapply mult_cancel_less. 2: eapply less_wdr. 2: apply Hi'. -2: Algebra. +2: algebra. apply shift_less_minus. astepl (cp _ (lt_le_weak _ _ Hi)). unfold compact_part in |- *. @@ -357,13 +341,13 @@ intros i i' Hii'; rewrite Hii'; intros Hi Hi' HP. red in |- *; red in HP. eapply less_wdl. apply HP. -apply AbsIR_wd; unfold fcp' in |- *; Algebra. +apply AbsIR_wd; unfold fcp' in |- *; algebra. red in |- *. intros i i' Hii'; rewrite Hii'; intros Hi Hi' HQ. red in |- *; red in HQ. eapply less_wdr. apply HQ. -apply AbsIR_wd; unfold fcp' in |- *; Algebra. +apply AbsIR_wd; unfold fcp' in |- *; algebra. apply Rolle_lemma8. Qed. @@ -376,7 +360,7 @@ exists (cp _ Hm). red in |- *; apply compact_part_hyp. intro; apply less_leEq; eapply less_wdl. apply Hm'. -apply AbsIR_wd; unfold fcp' in |- *; Algebra. +apply AbsIR_wd; unfold fcp' in |- *; algebra. Qed. Let Rolle_lemma11 : @@ -491,19 +475,19 @@ intro; simpl in |- *; unfold ABSIR in |- *; apply Max_leEq. apply less_leEq; apply less_transitive_unfolded with ZeroR. eapply less_wdl. apply (H0 _ Hj). -unfold fcp' in |- *; Algebra. +unfold fcp' in |- *; algebra. assumption. astepr ( [--][--]e); apply inv_resp_leEq. apply less_leEq; eapply less_wdr. apply Hj'. -unfold fcp' in |- *; Algebra. +unfold fcp' in |- *; algebra. exists (cp _ Hk). red in |- *; apply compact_part_hyp. intros. simpl in |- *; unfold ABSIR in |- *; apply Max_leEq. apply less_leEq; eapply less_wdl. apply Hk'. -unfold fcp' in |- *; Algebra. +unfold fcp' in |- *; algebra. apply less_leEq; apply less_transitive_unfolded with ZeroR. astepr ( [--]ZeroR); apply inv_resp_less; eapply less_wdr. apply (H0 _ Hk). @@ -534,13 +518,13 @@ assumption. intro. eapply less_wdl. apply a0. -unfold fcp' in |- *; Algebra. +unfold fcp' in |- *; algebra. right; apply Rolle_lemma12. assumption. intro. eapply less_wdr. apply b1. -unfold fcp' in |- *; Algebra. +unfold fcp' in |- *; algebra. Qed. End Rolle. @@ -706,7 +690,7 @@ apply compact_map2 with (Hab := less_leEq _ _ _ a1); auto. intros. eapply leEq_wdl. apply (H4 Hx). -apply AbsIR_wd; Algebra. +apply AbsIR_wd; algebra. cut (included (Compact (Min_leEq_Max b a)) (Compact (Min_leEq_Max a b))). intro H2. cut (included (Compact (less_leEq _ _ _ b0)) I). intro H3. 2: apply included_trans with (Compact (Min_leEq_Max b a)); @@ -749,7 +733,7 @@ apply compact_Min_lft. intros; apply less_leEq. eapply less_wdl. apply b0. -apply AbsIR_wd; Algebra. +apply AbsIR_wd; algebra. Qed. (** diff --git a/ftc/StrongIVT.v b/ftc/StrongIVT.v index cbd1d2147..22e661a2b 100644 --- a/ftc/StrongIVT.v +++ b/ftc/StrongIVT.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export WeakIVT. @@ -204,7 +188,7 @@ Qed. Lemma a'_seq_b'_seq_dist : forall n, b'_seq n[-]a'_seq n [=] (Two [/]ThreeNZ) [^]n[*] (b[-]a). simple induction n. -simpl in |- *; Algebra. +simpl in |- *; algebra. clear n; intros. astepr (Two [/]ThreeNZ[*] (Two [/]ThreeNZ) [^]n[*] (b[-]a)). astepr (Two [/]ThreeNZ[*] ((Two [/]ThreeNZ) [^]n[*] (b[-]a))). @@ -345,7 +329,7 @@ set (Ha' := incF _ (compact_inc_lft _ _ (Min_leEq_Max a b))) in *. set (Hb' := incF _ (compact_inc_rht _ _ (Min_leEq_Max a b))) in *. cut (F _ Ha' [<] F _ Hb'). intro H7. apply Weak_IVT_ap_lft with (HFab := H7); auto. -apply compact_wd' with (Hab := less_leEq _ _ _ HFab); Algebra. +apply compact_wd' with (Hab := less_leEq _ _ _ HFab); algebra. astepl (F a Ha); astepr (F b Hb); auto. cut (Continuous_I (Min_leEq_Max b a) F). intro H4. 2: apply included_imp_Continuous with I; auto; apply included_interval; auto. @@ -364,7 +348,7 @@ intro x; intros. exists x; auto. apply compact_wd' with (Hab := Min_leEq_Max b a); [ apply Min_comm | apply Max_comm | auto ]. -apply compact_wd' with (Hab := less_leEq _ _ _ HFab); Algebra. +apply compact_wd' with (Hab := less_leEq _ _ _ HFab); algebra. apply pfwdef; astepl (Max a b); apply Max_comm. apply pfwdef; astepl (Min a b); apply Min_comm. apply less_wdl with (F a Ha). @@ -389,8 +373,8 @@ cut (Max a b [=] b); [ intro | apply leEq_imp_Max_is_rht; apply less_leEq; auto ]. cut (forall H H', F (Min a b) H [<] F (Max a b) H'); intros. 2: apply H3; auto. -2: apply iprop_wd with a; Algebra. -2: apply iprop_wd with b; Algebra. +2: apply iprop_wd with a; algebra. +2: apply iprop_wd with b; algebra. 2: astepl a; astepr b; auto. elim H4; intros. apply IVT_I with H5. @@ -413,8 +397,8 @@ cut (Max b a [=] a); [ intro | apply leEq_imp_Max_is_rht; apply less_leEq; auto ]. cut (forall H H', F (Min b a) H [<] F (Max b a) H'). intro H8. 2: apply H3; auto. -2: apply iprop_wd with b; Algebra. -2: apply iprop_wd with a; Algebra. +2: apply iprop_wd with b; algebra. +2: apply iprop_wd with a; algebra. 2: astepl b; astepr a; auto. elim H4; intros. elim IVT_I with (contF := H5) (z := y); intros; auto. @@ -468,7 +452,7 @@ inversion_clear H as (H0,H1); split; simpl in |- *; unfold MIN. apply inv_resp_leEq. eapply leEq_wdr. apply H1. -apply Max_wd_unfolded; Algebra. +apply Max_wd_unfolded; algebra. astepr ( [--][--] (Max [--] (F a Ha) [--] (F b Hb))). apply inv_resp_leEq; auto. Qed. @@ -488,8 +472,8 @@ cut (Max a b [=] b); [ intro | apply leEq_imp_Max_is_rht; apply less_leEq; auto ]. cut (forall H H', F (Min a b) H [<] F (Max a b) H'). intro H8. 2: apply H3; auto. -2: apply iprop_wd with a; Algebra. -2: apply iprop_wd with b; Algebra. +2: apply iprop_wd with a; algebra. +2: apply iprop_wd with b; algebra. 2: astepl a; astepr b; auto. elim H4; intros. apply IVT'_I with (Min_leEq_Max a b) H5. @@ -512,8 +496,8 @@ cut (Max b a [=] a); [ intro | apply leEq_imp_Max_is_rht; apply less_leEq; auto ]. cut (forall H H', F (Min b a) H [<] F (Max b a) H'). intro H8. 2: apply H3; auto. -2: apply iprop_wd with b; Algebra. -2: apply iprop_wd with a; Algebra. +2: apply iprop_wd with b; algebra. +2: apply iprop_wd with a; algebra. 2: astepl b; astepr a; auto. elim H4; intros. elim IVT'_I with (contF := H5) (z := y); auto. @@ -567,7 +551,7 @@ inversion_clear X4; split; simpl in |- *; unfold MIN. apply inv_resp_less. eapply less_wdr. apply X6. -apply Max_wd_unfolded; Algebra. +apply Max_wd_unfolded; algebra. astepr ( [--][--] (Max [--] (F a Ha) [--] (F b Hb))). apply inv_resp_less; auto. Qed. diff --git a/ftc/Taylor.v b/ftc/Taylor.v index 9be786cb3..c99c6a0e9 100644 --- a/ftc/Taylor.v +++ b/ftc/Taylor.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export TaylorLemma. @@ -87,7 +71,7 @@ astepr rstepr (x[-]z[-]Sumx (fun i (l : i < n) => y' i (lt_S _ _ l)) [-] y' n (lt_n_Sn n)). -Algebra. +algebra. Qed. Lemma Taylor_lemma_ap : forall n Hf Hf' Ha', @@ -127,7 +111,7 @@ cut 2: eapply ap_wdr_unfolded. 2: apply H. 2: apply eq_symmetric_unfolded; eapply eq_transitive_unfolded; - [ apply sumx_const | Algebra ]. + [ apply sumx_const | algebra ]. 2: exact (FSumx_char _ _ _ _ H1). simpl in H2. cut @@ -141,12 +125,12 @@ elim HN; clear HN; intros HN H. cut (b[+][--]a [#] Zero). intro H3. 2: eapply cring_mult_ap_zero_op; eapply cring_mult_ap_zero_op; apply H. apply ap_symmetric_unfolded; apply zero_minus_apart; auto. -red in |- *; Algebra. +red in |- *; algebra. red in |- *; do 3 intro. rewrite H3; intros; unfold fi in |- *. apply mult_wdl. apply div_wd. -2: Algebra. +2: algebra. apply Feq_imp_eq with I. apply Derivative_n_unique with pI (S j) F; apply N_Deriv_lemma. auto. @@ -170,7 +154,7 @@ apply (fun i Hi => Part _ _ (FSumx_pred _ _ H1 b (TaylorB n Hf') i Hi))). apply cg_minus_wd. -Algebra. +algebra. exact (FSumx_char _ _ _ _ H1). cut (ext_fun_seq' @@ -185,7 +169,7 @@ apply Sumx (fun i (Hi : i < n) => Part _ _ (FSumx_pred _ _ H2 b H0 i Hi))). 2: apply cg_minus_wd. -2: Algebra. +2: algebra. 2: apply eq_symmetric_unfolded; exact (FSumx_char _ _ _ _ H2). apply Taylor_Sumx_lemma. intros; simpl in |- *. @@ -193,7 +177,7 @@ unfold fi in |- *. rstepr ((Part _ _ (Hpred a Ha) [/] Zero[+]One[//]nring_fac_ap_zero IR 0) [*]One). apply mult_wdl; apply div_wd. -2: Algebra. +2: algebra. apply Feq_imp_eq with I. apply Derivative_n_unique with pI 0 F. apply N_Deriv_lemma. @@ -204,7 +188,7 @@ apply Feq_reflexive; Included. auto. intros; simpl in |- *. apply mult_wdl; apply div_wd. -2: Algebra. +2: algebra. unfold fi in |- *. apply Feq_imp_eq with I. apply Derivative_n_unique with pI (S i) F; apply N_Deriv_lemma; auto. @@ -246,7 +230,7 @@ eapply leEq_wdl. apply (H4 H5). unfold Taylor_rem, Taylor_Rem in |- *. apply AbsIR_wd; repeat apply cg_minus_wd. -Algebra. +algebra. simpl in |- *. repeat first [ apply bin_op_wd_unfolded @@ -256,7 +240,7 @@ repeat first apply FSumx_wd; intros; simpl in |- *. apply mult_wdl. apply div_wd. -2: Algebra. +2: algebra. apply eq_transitive_unfolded with @@ -265,7 +249,7 @@ apply (Diffble_I_n_imp_deriv_n _ _ _ _ _ (le_imp_Diffble_I _ _ _ _ _ (lt_n_Sm_le _ _ (lt_S _ _ Hi)) _ H2))) a (compact_Min_lft _ _ (less_leEq _ _ _ (ap_imp_Min_less_Max _ _ H1)))). -simpl in |- *; Algebra. +simpl in |- *; algebra. apply Feq_imp_eq with (Compact (less_leEq _ _ _ (ap_imp_Min_less_Max _ _ H1))). apply Derivative_I_n_unique with i F. @@ -287,7 +271,7 @@ apply (Diffble_I_n_imp_deriv_n _ _ _ _ _ (le_imp_Diffble_I _ _ _ _ _ (lt_n_Sm_le _ _ (lt_n_Sn n)) _ H2))) a (compact_Min_lft _ _ (less_leEq _ _ _ (ap_imp_Min_less_Max _ _ H1)))). -simpl in |- *; Algebra. +simpl in |- *; algebra. apply Feq_imp_eq with (Compact (less_leEq _ _ _ (ap_imp_Min_less_Max _ _ H1))). apply Derivative_I_n_unique with n F. @@ -422,7 +406,7 @@ apply AbsIR_wd; simpl in |- *; repeat apply cg_minus_wd. 2: repeat apply mult_wdl. unfold Taylor_Rem in |- *; simpl in |- *. apply cg_minus_wd. -Algebra. +algebra. apply bin_op_wd_unfolded. apply Feq_imp_eq with (Compact (Min_leEq_Max a b)). apply FSumx_wd'. @@ -436,12 +420,12 @@ apply Derivative_n_unique with pI i F. apply N_Deriv_lemma. apply derF. auto. -Algebra. +algebra. apply Feq_reflexive; repeat split. apply compact_Min_rht. apply mult_wdl. apply div_wd. -2: Algebra. +2: algebra. apply Feq_imp_eq with I. apply Derivative_n_unique with pI n F. apply N_Deriv_lemma. diff --git a/ftc/TaylorLemma.v b/ftc/TaylorLemma.v index 90092620f..b6028c66f 100644 --- a/ftc/TaylorLemma.v +++ b/ftc/TaylorLemma.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export Rolle. @@ -122,7 +106,7 @@ red in |- *; intros n Hf i j H H0 H' x y H1 Hx Hy. simpl in |- *. apply mult_wd. apply div_wd. -2: rewrite H; Algebra. +2: rewrite H; algebra. generalize H' Hx Hy; clear Hy Hx H'. rewrite <- H; intros. cut @@ -147,7 +131,7 @@ red in |- *; intros n Hf i j H H0 H' x y H1 Hx Hy. simpl in |- *. apply mult_wd. apply mult_wd. -2: rewrite H; Algebra. +2: rewrite H; algebra. generalize H' Hx Hy; clear Hy Hx H'. rewrite <- H; intros. cut @@ -156,14 +140,14 @@ cut simpl in H2. apply H2. cut (Dom (PartInt (fi n Hf i H')) x); - [ intro H2 | apply dom_wd with y; Algebra ]. + [ intro H2 | apply dom_wd with y; algebra ]. apply eq_transitive_unfolded with (Part _ _ H2). apply Feq_imp_eq with (Compact Hab). unfold Hab in |- *; apply Derivative_I_n_unique with i F; apply Taylor_lemma1. simpl in Hx. elim Hx; intros. inversion_clear a0; auto. -Algebra. +algebra. rewrite H. astepl ((b[+][--]x) [^]j); Step_final ((b[+][--]y) [^]j). Qed. @@ -286,7 +270,7 @@ cut auto. unfold FSumx_to_FSum in |- *. elim le_lt_dec; intro; simpl in |- *. -Algebra. +algebra. intros. set (w := @@ -295,9 +279,9 @@ set in *. astepr (w[-]w); unfold w in |- *; simpl in |- *. repeat first [ apply cg_minus_wd | apply mult_wd ]; - try apply csf_wd_unfolded; Algebra. + try apply csf_wd_unfolded; algebra. rational. -simpl in |- *; Algebra. +simpl in |- *; algebra. simpl in |- *; intro i. Opaque funct_i'. unfold FSumx_to_FSum in |- *. @@ -340,13 +324,13 @@ apply with (F b Hb[-]FSumx (S n) (funct_i' n Hf) b (ProjIR2 H)). simpl in |- *; rational. apply cg_minus_wd. -Algebra. +algebra. apply eq_symmetric_unfolded; apply FSum_FSumx_to_FSum. apply Taylor_lemma3. apply Taylor_lemma3'. simpl in |- *. astepr (Part _ _ Hb[-]Part _ _ Hb); apply cg_minus_wd. -Algebra. +algebra. eapply eq_transitive_unfolded. apply Sum_first. astepr (Part _ _ Hb[+]Zero); apply bin_op_wd_unfolded. @@ -362,7 +346,7 @@ apply mult_wd. 2: rational. apply eq_symmetric_unfolded. apply eq_transitive_unfolded with (PartInt (fi n Hf 0 b0) b TL_compact_b). -2: simpl in |- *; apply csf_wd_unfolded; simpl in |- *; Algebra. +2: simpl in |- *; apply csf_wd_unfolded; simpl in |- *; algebra. apply Feq_imp_eq with (Compact Hab). apply (ProjT2 @@ -375,7 +359,7 @@ intros. cut (forall H', FSumx_to_FSum (S n) (funct_i' n Hf) i b H' [=] Zero); auto. unfold FSumx_to_FSum in |- *. elim le_lt_dec; intro; simpl in |- *. -Algebra. +algebra. intro. astepr (fi n Hf i b0 (Build_subcsetoid_crr IR _ b (ProjIR1 (ProjIR1 H'))) [*] @@ -453,7 +437,7 @@ Ltac Lazy_Eq := | apply un_op_wd_unfolded | apply cg_minus_wd | apply div_wd - | apply csf_wd_unfolded ]; Algebra. + | apply csf_wd_unfolded ]; algebra. Lemma Taylor_lemma7 : forall n Hf Hf' i (Hi : 0 < i) Hi', Derivative_I Hab' (funct_i' n Hf i Hi') (funct_aux n Hf' i Hi'{-}funct_aux n Hf' (pred i) (lt_5 i (S n) Hi')). @@ -507,8 +491,8 @@ set (a1 := fiSp1 x1) in *; set (a5 := fiSSp x5) in *; rstepl (a5[*]pp[*] (bxp[*] (b[-]x)) [-]a1[*] ((nring p[+]One) [*]pp) [*]bxp). unfold a1, a5 in |- *; clear a1 a5. Lazy_Eq. -unfold x4, x5 in |- *; Algebra. -simpl in |- *; Algebra. +unfold x4, x5 in |- *; algebra. +simpl in |- *; algebra. unfold pp in |- *. rstepr (nring (S p) [*] @@ -516,13 +500,13 @@ rstepr mult_resp_ap_zero _ _ _ (nring_fac_ap_zero _ p) (pos_ap_zero _ _ (pos_nring_S IR p)))); simpl in |- *. apply mult_wdr; apply div_wd. -Algebra. +algebra. clear X H bxp pp x5 x4 x3 x2 x1 fiSSp fiSp1 fiSp2 Hx. cut (fac p + p * fac p = fac p * S p). intro; rewrite H. eapply eq_transitive_unfolded. apply nring_comm_mult. -Algebra. +algebra. transitivity (S p * fac p); auto with arith. unfold fiSp1, fiSp2 in |- *. apply @@ -534,7 +518,7 @@ apply (PartInt (fi (S n) Hf' (S p) (lt_n_S _ _ (lt_5 _ _ Hi'))) (scs_elem _ _ x0) (scs_prf _ _ x0)). simpl in |- *; apply csf_wd_unfolded. -case x0; simpl in |- *; Algebra. +case x0; simpl in |- *; algebra. apply Feq_imp_eq with (Compact Hab). unfold Hab in |- *; apply Derivative_I_n_unique with (S p) F; apply Taylor_lemma1. @@ -563,7 +547,7 @@ apply (Build_subcsetoid_crr _ _ _ (ProjIR1 (ProjIR2 (ProjIR1 (ProjIR2 Hx))))) [*] (One[/] _[//]nring_fac_ap_zero IR 0) [*]One). simpl in |- *; rational. -Lazy_Eq; simpl in |- *; Algebra. +Lazy_Eq; simpl in |- *; algebra. Qed. Lemma Taylor_lemma9 : forall n Hf Hf', @@ -584,7 +568,7 @@ apply (Build_subcsetoid_crr _ _ _ (ProjIR1 (ProjIR1 Hx))) [*] (One[/] Zero[+]One[//]nring_fac_ap_zero IR 0) [*]One). simpl in |- *; rational. -Lazy_Eq; simpl in |- *; Algebra. +Lazy_Eq; simpl in |- *; algebra. apply Taylor_lemma8; assumption. cut {p : nat | S n = p}; [ intro H | exists (S n); auto ]. elim H; intros p H0. @@ -616,7 +600,7 @@ repeat first | apply bin_op_wd_unfolded | apply csf_wd_unfolded | apply eq_reflexive_unfolded ]; simpl in |- *. -3: Algebra. +3: algebra. apply Feq_imp_eq with (Compact Hab). 2: assumption. apply FSumx_wd'. @@ -626,11 +610,11 @@ repeat (split; auto). intros x0 H4; intros; simpl in |- *. repeat apply mult_wdl. apply eq_transitive_unfolded with (PartInt (fi n H1 i (lt_S _ _ H3)) x0 H4). -simpl in |- *; apply csf_wd_unfolded; simpl in |- *; Algebra. +simpl in |- *; apply csf_wd_unfolded; simpl in |- *; algebra. apply eq_transitive_unfolded with (PartInt (fi (S n) Hf i (lt_S _ _ (lt_S _ _ H'))) x0 H4). -2: simpl in |- *; apply csf_wd_unfolded; simpl in |- *; Algebra. +2: simpl in |- *; apply csf_wd_unfolded; simpl in |- *; algebra. apply Feq_imp_eq with (Compact Hab). unfold Hab in |- *; apply Derivative_I_n_unique with i F; apply Taylor_lemma1. auto. @@ -638,8 +622,8 @@ apply eq_transitive_unfolded with (PartInt (fi n H1 n (lt_n_Sn _)) x H2). 2: apply eq_transitive_unfolded with (PartInt (fi (S n) Hf n (lt_S _ _ (lt_n_Sn _))) x H2). -simpl in |- *; apply csf_wd_unfolded; simpl in |- *; Algebra. -2: simpl in |- *; apply csf_wd_unfolded; simpl in |- *; Algebra. +simpl in |- *; apply csf_wd_unfolded; simpl in |- *; algebra. +2: simpl in |- *; apply csf_wd_unfolded; simpl in |- *; algebra. apply Feq_imp_eq with (Compact Hab). unfold Hab in |- *; apply Derivative_I_n_unique with n F; apply Taylor_lemma1. auto. @@ -670,8 +654,8 @@ apply (PartInt (fi (S (S n)) Hf' (S n) (lt_n_S _ _ (lt_5 _ _ (lt_n_Sn (S n))))) x H2). -simpl in |- *; apply csf_wd_unfolded; simpl in |- *; Algebra. -2: simpl in |- *; apply csf_wd_unfolded; simpl in |- *; Algebra. +simpl in |- *; apply csf_wd_unfolded; simpl in |- *; algebra. +2: simpl in |- *; apply csf_wd_unfolded; simpl in |- *; algebra. apply Feq_imp_eq with (Compact Hab). unfold Hab in |- *; apply Derivative_I_n_unique with (S n) F; apply Taylor_lemma1. @@ -839,7 +823,7 @@ eapply eq_transitive_unfolded. apply AbsIR_wd. rstepr (Taylor_rem n Hf[-]Part _ _ H0[*] (b[-]a)). apply cg_minus_wd. -Algebra. +algebra. apply mult_wdl. Transparent Taylor_rem funct_aux. unfold deriv_Sn', funct_aux in |- *. @@ -850,12 +834,12 @@ simpl in |- *; with (n_deriv_I _ _ Hab' (S n) F Hf' c H1[*] (One[/] _[//]nring_fac_ap_zero _ n) [*] (b[-]c) [^]n). -repeat apply mult_wdl; apply pfwdef; Algebra. +repeat apply mult_wdl; apply pfwdef; algebra. repeat apply mult_wdl. apply eq_transitive_unfolded with (PartInt (fi (S n) Hf' (S n) (lt_n_S _ _ (lt_n_Sn _))) c Hc'). -2: simpl in |- *; apply csf_wd_unfolded; simpl in |- *; Algebra. +2: simpl in |- *; apply csf_wd_unfolded; simpl in |- *; algebra. apply Feq_imp_eq with (Compact Hab). unfold Hab in |- *; apply Derivative_I_n_unique with (S n) F. apply n_deriv_lemma. diff --git a/ftc/WeakIVT.v b/ftc/WeakIVT.v index 458a8ebb8..8f394b0c7 100644 --- a/ftc/WeakIVT.v +++ b/ftc/WeakIVT.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) (** printing ** %\ensuremath\times% #×# *) @@ -95,7 +79,7 @@ apply leEq_less_trans with ZeroR. 2: auto. apply leEq_wdl with (f _ (le_n n)); auto. unfold f, compact_part, n in |- *; simpl in |- *. -apply cg_minus_wd; [ apply pfwdef; rational | Algebra ]. +apply cg_minus_wd; [ apply pfwdef; rational | algebra ]. simple induction i. intros; unfold f, compact_part in |- *. apply leEq_wdl with (F a Ha[-]z). @@ -156,11 +140,11 @@ apply less_leEq. apply plus_cancel_less with ( [--]m). eapply less_wdl. apply q. -unfold cg_minus in |- *; Algebra. +unfold cg_minus in |- *; algebra. unfold G in |- *. apply eq_transitive_unfolded with (AbsIR (Part _ _ (ProjIR1 H2))). apply FAbs_char. -apply AbsIR_wd; simpl in |- *; Algebra. +apply AbsIR_wd; simpl in |- *; algebra. apply shift_less_minus; astepl m; auto. apply a0. exists x. @@ -170,7 +154,7 @@ repeat split; auto. intro; unfold G in |- *. apply eq_transitive_unfolded with (AbsIR (Part _ _ (ProjIR1 Hy))). apply FAbs_char. -apply AbsIR_wd; simpl in |- *; Algebra. +apply AbsIR_wd; simpl in |- *; algebra. set (H1 := less_imp_ap _ _ _ HFab) in *. set (H2 := pfstrx _ _ _ _ _ _ H1) in *. elim (ap_imp_less _ _ _ H2); intro. @@ -417,7 +401,7 @@ Qed. Lemma a_seq_b_seq_dist : forall n, b_seq n[-]a_seq n [=] (Two [/]ThreeNZ) [^]n[*] (b[-]a). simple induction n. -simpl in |- *; Algebra. +simpl in |- *; algebra. clear n; intros. astepr (Two [/]ThreeNZ[*] (Two [/]ThreeNZ) [^]n[*] (b[-]a)). astepr (Two [/]ThreeNZ[*] ((Two [/]ThreeNZ) [^]n[*] (b[-]a))). @@ -570,7 +554,7 @@ apply b_seq_I. apply xa_in_interval. apply leEq_wdl with (AbsIR (b_seq N[-]xb)). 2: apply AbsIR_wd; apply cg_minus_wd; - [ Algebra | apply eq_symmetric_unfolded; apply a_seq_b_seq_lim ]. + [ algebra | apply eq_symmetric_unfolded; apply a_seq_b_seq_lim ]. apply AbsSmall_imp_AbsIR. auto. apply shift_leEq_minus; astepl (F xa Hx). diff --git a/metrics/CMetricSpaces.v b/metrics/CMetricSpaces.v index 07333e244..f3e5f7635 100644 --- a/metrics/CMetricSpaces.v +++ b/metrics/CMetricSpaces.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export Prod_Sub. diff --git a/metrics/CPMSTheory.v b/metrics/CPMSTheory.v index 03d3a6b6a..e4ecd36f0 100644 --- a/metrics/CPMSTheory.v +++ b/metrics/CPMSTheory.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export Prod_Sub. diff --git a/metrics/CPseudoMSpaces.v b/metrics/CPseudoMSpaces.v index 07fdb445b..38ba654bf 100644 --- a/metrics/CPseudoMSpaces.v +++ b/metrics/CPseudoMSpaces.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export Intervals. diff --git a/metrics/ContFunctions.v b/metrics/ContFunctions.v index 567a8a669..a1c7af39b 100644 --- a/metrics/ContFunctions.v +++ b/metrics/ContFunctions.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export CPseudoMSpaces. @@ -65,6 +49,9 @@ Definition lipschitz (f : CSetoid_fun A B) : CProp := Definition lipschitz' (f : CSetoid_fun A B) : CProp := {n : nat | forall x y : A, f x[-d]f y[<=]nring n[*](x[-d]y)}. +Definition lipschitz_c (f : CSetoid_fun A B) (C : IR) : CProp := + forall x1 x2 : A, f x1 [-d] f x2 [<=] C [*] (x1 [-d] x2). + End Continuous_functions. Implicit Arguments continuous [A B]. Implicit Arguments uni_continuous [A B]. @@ -73,6 +60,7 @@ Implicit Arguments continuous' [A B]. Implicit Arguments uni_continuous' [A B]. Implicit Arguments uni_continuous'' [A B]. Implicit Arguments lipschitz' [A B]. +Implicit Arguments lipschitz_c [A B]. Section Lemmas. @@ -80,7 +68,7 @@ Section Lemmas. Lemma nexp_power : forall p : nat, nexp IR p Two[=]nring (power p 2). simple induction p. simpl in |- *. -Algebra. +algebra. intros n H. astepr (nring (R:=IR) (power n 2 * 2)). @@ -132,7 +120,7 @@ apply plus_resp_eq. apply nexp_power. simpl in |- *. -Algebra. +algebra. apply less_leEq. astepl (OneR[^]S n[/] (Two:IR)[^]S n[//]nexp_resp_ap_zero (S n) H1). astepl (OneR[/] (Two:IR)[^]S n[//]nexp_resp_ap_zero (S n) H1). @@ -332,6 +320,24 @@ apply ax_d_nneg. apply CPsMetricSpace_is_CPsMetricSpace. Qed. +Lemma lip_c_imp_lip : forall (A B : CPsMetricSpace) (f : CSetoid_fun A B) (C : IR), +lipschitz_c f C -> lipschitz' f. +unfold lipschitz_c. +unfold lipschitz'. +intros. +assert ({n : nat| C [<=] nring n}). +apply Archimedes. +destruct X as [n H1]. +exists n. +intros. +assert (f x[-d]f y [<=] C[*](x[-d]y)). +apply H. +apply leEq_transitive with (C[*](x[-d]y)); auto. +apply mult_resp_leEq_rht; auto. +apply ax_d_nneg. +apply CPsMetricSpace_is_CPsMetricSpace. +Qed. + (** Every uniformly continuous function is continuous and every Lipschitz function is uniformly continuous. diff --git a/metrics/Equiv.v b/metrics/Equiv.v index b265b3e92..81f385e2d 100644 --- a/metrics/Equiv.v +++ b/metrics/Equiv.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export IR_CPMSpace. diff --git a/metrics/IR_CPMSpace.v b/metrics/IR_CPMSpace.v index c320bf723..076ebe067 100644 --- a/metrics/IR_CPMSpace.v +++ b/metrics/IR_CPMSpace.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export ContFunctions. diff --git a/metrics/LipExt.v b/metrics/LipExt.v new file mode 100644 index 000000000..3746db5bd --- /dev/null +++ b/metrics/LipExt.v @@ -0,0 +1,417 @@ +(* + +Formalization of the theorem about extension of real-valued Lipschitz +functions. This theorem originally belongs to McShane and Kirchbraun. + +Theorem. Let M - metric space, let X - subset of M. Let f - Lipschitz +function from X to reals with constant C. Then the function defined by + +\tilde f (y) = inf_{x \in X} { f(x) + C * d_M (x, y)} + +is the extension of f and has the same Lipshitz constant. + +The constructive proof also has a restriction on totally boundness of +subset X. + +*) + +Require Import ContFunctions. +Require Import CMetricSpaces. +Require Import CPMSTheory. + +Section LipschitzExtension. + +Variable M : CMetricSpace. +Variable P : M -> CProp. +Variable C : IR. +Variable f : CSetoid_fun (SubMetricSpace M P) IR_as_CMetricSpace. + +Hypothesis set_bounded : MStotally_bounded (SubMetricSpace M P). +Hypothesis non_empty : {x : M | P x}. +Hypothesis constant_positive : Zero[<]C. + +Hypothesis f_lip : lipschitz_c f C. + +Section BuildExtension. + +Definition cdsub' (y : M) : CSetoid_fun (SubMetricSpace M P) IR_as_CMetricSpace. +intros. +apply Build_CSetoid_fun with (fun x : (SubMetricSpace M P) => +C [*] (dsub' M P y x)). +red. intros x y0 H1. +elim (bin_op_strext_unfolded _ _ _ _ _ _ H1). +intros H3. +elim (ap_irreflexive_unfolded _ _ H3). +intros H3. +apply (dsub'_strext M P y); auto. +Defined. + +Lemma f_uni_cont: uni_continuous f. +assert (lipschitz' f). +apply (lip_c_imp_lip (SubMetricSpace M P) IR_as_CMetricSpace f C). +apply f_lip. +assert (lipschitz f). +apply (lipschitz'_imp_lipschitz (SubMetricSpace M P) IR_as_CMetricSpace f); auto. +apply lipschitz_imp_uni_continuous; auto. +Qed. + +Lemma dsub'_is_lipschitz : +forall (y : M) (x1 x2 : SubMetricSpace M P), +C[*]dIR (dsub' M P y x1) (dsub' M P y x2)[<=]C[*](dsub M P x1 x2). +intros. +apply mult_resp_leEq_lft. +2: apply less_leEq. +2: apply constant_positive. +unfold dsub'. unfold dsub. +case x1. case x2. intros. simpl. + +astepl (dIR (y[-d]scs_elem0) (y[-d]scs_elem)). +apply rev_tri_ineq'. + +unfold dIR. +apply ABSIR_wd. +assert ((y[-d]scs_elem0)[=](scs_elem0[-d]y)). +apply ax_d_com. +apply CPsMetricSpace_is_CPsMetricSpace. +assert ((y[-d]scs_elem)[=](scs_elem[-d]y)). +apply ax_d_com. +apply CPsMetricSpace_is_CPsMetricSpace. +algebra. +Qed. + + +Lemma exp_prop : forall (k : nat) (n : nat) (H : Two[#]Zero), +Two[^]k[*]nexp IR (n + k) (One[/] (Two:IR)[//]H)[=] +nexp IR n (One[/] (Two:IR)[//]H). +intros. +astepl ((zexp Two H k)[*](nexp IR (n + k) (One[/] Two[//]H) )). +astepl ((zexp Two H k)[*](zexp Two H (- (n + k)%nat))). +astepr (zexp Two H (k + (- (n + k)%nat))). +apply eq_symmetric. +apply zexp_plus. +astepl (zexp Two H (-n)). +apply (zexp_inv_nexp IR Two H n). +replace (- n)%Z with (k + - (n + k)%nat)%Z; auto with zarith. +apply eq_reflexive. +intros. auto with zarith. +assert ((n + k)%Z = (n + k)%nat). +symmetry. apply inj_plus. +auto with zarith. +apply mult_wd; auto. +apply eq_reflexive. +apply (zexp_inv_nexp IR Two H (n+k)). +Qed. + +Lemma cdsub'_uni_cont : forall y : M, uni_continuous (cdsub' y). +intros. +unfold uni_continuous. +unfold cdsub'. +simpl. +intros. +elim (power_big C Two). intros k H1. +3: apply one_less_two. +2: apply less_leEq; apply constant_positive. +exists (n + k). +intros. +astepl (C[*](dIR (dsub' M P y x) (dsub' M P y y0))). +cut (C[*]dIR (dsub' M P y x) (dsub' M P y y0)[<=]C[*](dsub M P x y0)). +intros. +cut (C[*](dsub M P x y0)[<] nexp IR n (One[/] Two[//]H)). +intros. +apply leEq_less_trans with (C[*](dsub M P x y0)); auto with algebra. +cut (Two[^]k[*](dsub M P x y0)[<] nexp IR n (One[/] Two[//]H)). +intros. +cut (C[*](dsub M P x y0)[<=]Two[^]k[*](dsub M P x y0)). +intros. +apply leEq_less_trans with (Two[^]k[*](dsub M P x y0)); auto with algebra. +apply mult_resp_leEq_rht; auto. +apply dsub_nneg. +astepr (Two[^]k[*](nexp IR (n + k) (One[/] Two[//]H))). +apply mult_resp_less_lft; auto. +apply nexp_resp_pos. +cut ((One:IR)[<]Two). +cut (Zero[<](One:IR)). +intros. +apply less_transitive_unfolded with (One:IR); auto. +apply pos_one. +apply one_less_two. +apply exp_prop. +apply dsub'_is_lipschitz. +unfold dIR. +astepr (ABSIR (C[*](dsub' M P y x[-]dsub' M P y y0))). +apply AbsIR_mult. +apply constant_positive. +apply ABSIR_wd; auto with algebra. +Qed. + +Definition f_multi_ext (y : M) : CSetoid_fun (SubMetricSpace M P) IR_as_CMetricSpace. +intros. +apply Build_CSetoid_fun with (fun x : (SubMetricSpace M P) => +f (x) [+] (cdsub' y x)). +red. intros x y0 H1. +elim (bin_op_strext_unfolded _ _ _ _ _ _ H1). +apply (csf_strext (SubMetricSpace M P) IR_as_CMetricSpace f). +apply (csf_strext (SubMetricSpace M P) IR_as_CMetricSpace (cdsub' y)). +Defined. + +Lemma f_multi_ext_uni_continuous : forall y : M, uni_continuous (A:=SubMetricSpace M P) (B:=IR_as_CPsMetricSpace) + (f_multi_ext y). +intros. +unfold f_multi_ext. +apply (plus_resp_uni_continuous (SubMetricSpace M P) f (cdsub' y) + f_uni_cont (cdsub'_uni_cont y)). +Qed. + +Lemma inf_f_multi_ext_exists : +forall y : M, {z : IR | set_glb_IR (fun v : IR_as_CMetricSpace => {x : SubMetricSpace M P | f_multi_ext y x[=]v}) z}. +intros. +elim (infimum_exists (SubMetricSpace M P) (f_multi_ext y)). +3: apply set_bounded. +intros x H. +exists x. +apply H. +assert (uni_continuous (f_multi_ext y)). +apply f_multi_ext_uni_continuous. +assert (uni_continuous' (f_multi_ext y)). +apply uni_continuous_imp_uni_continuous'; auto. +apply uni_continuous'_imp_uni_continuous''; auto. +elim non_empty. +intros x H. +exists x. apply H. +Qed. + +Definition lip_extension_f (y : M) : IR. +intros. +assert ({z : IR | set_glb_IR (fun v : IR_as_CMetricSpace => {x : SubMetricSpace M P | f_multi_ext y x[=]v}) z}). +apply inf_f_multi_ext_exists. +destruct X. +exact x. +Defined. + +Lemma lip_extension_strext_case: forall (x : M) (y : M) + (z1 : IR) (z2 : IR) (H : z1[<]z2) + (H1 : set_glb_IR + (fun v : IR => + sigT (fun x : subcsetoid_crr M P => f x[+]C[*]dsub' M P y x[=]v)) + z1) + (H2 : set_glb_IR + (fun v : IR => + sigT (fun x0 : subcsetoid_crr M P => f x0[+]C[*]dsub' M P x x0[=]v)) + z2), x [#] y. +unfold set_glb_IR. +intros. +destruct H1. destruct H2. +assert {x0 : IR | + sigT (fun x1 : subcsetoid_crr M P => f x1[+]C[*]dsub' M P y x1[=]x0) | + x0[-]z1[<](z2 [-] z1)}. +apply s. +apply shift_zero_less_minus; auto. +destruct X. destruct s1. +assert (z2[<=]f x1[+]C[*]dsub' M P x x1). +apply (l0 (f x1[+]C[*]dsub' M P x x1)). +exists x1. +algebra. +assert (x0 [<] z2). +apply plus_cancel_less with ([--]z1). algebra. +assert (f x1[+]C[*]dsub' M P y x1 [<] f x1[+]C[*]dsub' M P x x1). +apply less_leEq_trans with z2; auto. +astepl (x0). auto. +assert ((from_SubPsMetricSpace M P x1[-d] y)[#](from_SubPsMetricSpace M P x1[-d]x)). +apply less_imp_ap. +apply mult_cancel_less with (z := C). +apply constant_positive. +astepl (C[*]dsub' M P y x1). +astepr (C[*]dsub' M P x x1). +apply plus_cancel_less with (f x1). +astepl (f x1[+]C[*]dsub' M P y x1). +astepr (f x1[+]C[*]dsub' M P x x1). +auto. +set (H1 := csbf_strext _ _ _ (cms_d (c:=M)) _ _ _ _ X1). +elim H1. +assert (Not (from_SubPsMetricSpace M P x1[#]from_SubPsMetricSpace M P x1)). +apply ap_irreflexive_unfolded. +contradiction. +intros. +apply ap_symmetric_unfolded. +auto. +Qed. + +Lemma lip_extension_strext : + fun_strext (lip_extension_f). +unfold fun_strext. +unfold lip_extension_f. +intros x y. +elim inf_f_multi_ext_exists. +elim inf_f_multi_ext_exists. +simpl. intros z1 H1 z2 H2 H. +elim (ap_imp_less IR z1 z2); auto; intros. +unfold f_multi_ext. +apply (lip_extension_strext_case x y z1 z2 a H1 H2). +apply ap_symmetric_unfolded. +apply (lip_extension_strext_case y x z2 z1 b H2 H1). +apply ap_symmetric_unfolded. auto. +Qed. + +Definition lip_extension := + Build_CSetoid_fun M IR_as_CPsMetricSpace (lip_extension_f) + (lip_extension_strext). + +Lemma lip_unfolded : forall (x x1: SubMetricSpace M P), +f x[-]f x1[<=]C[*]dsub' M P (from_SubPsMetricSpace M P x) x1. +intros. +unfold dsub'. +astepr (C[*](x[-d]x1)). +apply leEq_transitive with (AbsIR (f x[-] f x1)). +apply leEq_AbsIR. +astepl (f x[-d]f x1). +assert (lipschitz_c f C). +apply f_lip. +apply X. +apply mult_wd; algebra. +case x. case x1. intros. simpl. +apply ax_d_com. +apply CPsMetricSpace_is_CPsMetricSpace. +Qed. + + +End BuildExtension. + +Section ExtensionProperties. + +Lemma lip_extension_keeps_fun : forall (x : SubMetricSpace M P), +lip_extension (from_SubPsMetricSpace M P x) [=] f x. +intros. +unfold lip_extension. +simpl. +unfold lip_extension_f. +elim inf_f_multi_ext_exists. +unfold set_glb_IR. +simpl. intros y H. +destruct H. + +apply leEq_imp_eq. + +apply l. +exists x. +assert (dsub' M P (from_SubPsMetricSpace M P x) x[=]Zero). +unfold dsub'. + +assert (diag_zero M (cms_d (c:=M))). +apply pos_imp_ap_imp_diag_zero. +apply ax_d_pos_imp_ap. +apply (CPsMetricSpace_is_CPsMetricSpace M). +apply ax_d_nneg. +apply (CPsMetricSpace_is_CPsMetricSpace M). +apply H. + +astepl (f x[+]C[*]Zero). +astepl (f x[+]Zero). algebra. + +assert (forall e : IR, Zero [<]e -> f x [-] y [<] e). +intros. +assert (sig2T IR + (fun x0 : IR => + sigT + (fun x1 : subcsetoid_crr M P => + f x1[+]C[*]dsub' M P (from_SubPsMetricSpace M P x) x1[=]x0)) + (fun x : IR => x[-]y[<]e)). +apply s. auto. destruct X0. destruct s0. +assert (f x [<=] f x1[+]C[*]dsub' M P (from_SubPsMetricSpace M P x) x1). +astepr (C[*] dsub' M P (from_SubPsMetricSpace M P x) x1 [+] f x1). +apply shift_leEq_plus. +apply lip_unfolded. +apply leEq_less_trans with (f x1[+]C[*]dsub' M P (from_SubPsMetricSpace M P x) x1[-]y). +apply minus_resp_leEq; auto. +astepl (x0 [-] y); auto. +astepl (f x [-] y [+] y). +astepr (Zero [+] y). +apply plus_resp_leEq. +unfold leEq. +apply approach_zero; auto. +Qed. + +Lemma extension_also_lipschitz_case : +forall (y1 : M) (y2 : M) (fy2 : IR) +(Hfy2 : set_glb_IR (fun v : IR => + sigT (fun x : subcsetoid_crr M P => f x[+]C[*]dsub' M P y2 x[=]v)) fy2) +(fy1 : IR) +(Hfy1 : set_glb_IR (fun v : IR => + sigT (fun x : subcsetoid_crr M P => f x[+]C[*]dsub' M P y1 x[=]v)) fy1) +(e : IR) +(X : Zero[<]e), +fy2[-]fy1[<=]C[*](y1[-d]y2)[+]e. +intros. +destruct Hfy1. destruct Hfy2. +assert ({x : IR | sigT (fun x0 : SubMetricSpace M P => f x0[+]C[*]dsub' M P y1 x0[=]x) | + x[-]fy1[<]e}). +apply s. auto. destruct X0 as [fx1 Ht Hl1]. destruct Ht as [x1 He1]. + +assert (fy2 [<=] f x1[+]C[*]dsub' M P y2 x1). +apply l0; auto. exists x1. apply eq_reflexive_unfolded. + +assert (fx1[-]e[<=]fy1). +apply less_leEq. +apply shift_minus_less. +apply shift_less_plus'; auto. + +(* Inequalites are simple and symmetric*) + +apply leEq_transitive with ((f x1[+]C[*]dsub' M P y2 x1)[-](fx1[-]e)). +apply minus_resp_leEq_both; auto. +astepl (f x1[+]C[*]dsub' M P y2 x1[-]fx1[+]e). +apply plus_resp_leEq. +astepl (f x1[+]C[*]dsub' M P y2 x1[-](f x1[+]C[*]dsub' M P y1 x1)). +astepl (f x1[+]C[*]dsub' M P y2 x1[-]f x1[-]C[*]dsub' M P y1 x1). +astepl (f x1[-]f x1[+]C[*]dsub' M P y2 x1[-]C[*]dsub' M P y1 x1). +astepl (Zero[+]C[*]dsub' M P y2 x1[-]C[*]dsub' M P y1 x1). +astepl (C[*]dsub' M P y2 x1[-]C[*]dsub' M P y1 x1). +astepl (C[*](dsub' M P y2 x1[-]dsub' M P y1 x1)). +apply mult_resp_leEq_lft. +2: apply less_leEq. +2: apply constant_positive. +unfold dsub'. +astepr (y2[-d]y1). +apply leEq_transitive with (AbsIR ((from_SubPsMetricSpace M P x1[-d]y2)[-] + (from_SubPsMetricSpace M P x1[-d]y1))). +apply leEq_AbsIR. +apply AbsSmall_imp_AbsIR. +apply rev_tri_ineq. +apply ax_d_com. +apply CPsMetricSpace_is_CPsMetricSpace. +rational. +Qed. + +Lemma extension_also_liscphitz : lipschitz_c (lip_extension) C. +unfold lipschitz_c. +unfold lip_extension. +unfold lip_extension_f. +intros y1 y2. intros. simpl. +elim inf_f_multi_ext_exists. +elim inf_f_multi_ext_exists. +unfold f_multi_ext. +unfold dIR. +simpl. +intros fy2 Hfy2 fy1 Hfy1. +apply AbsSmall_imp_AbsIR. + +assert (forall e : IR, Zero[<]e -> AbsSmall (C[*](y1[-d]y2)[+]e) (fy1[-]fy2)). + +intros. +unfold AbsSmall. split. +astepr ([--](fy2 [-] fy1)). +apply inv_resp_leEq. +apply extension_also_lipschitz_case; auto. +rational. +astepr (C[*](y2[-d]y1)[+]e). +astepl (fy1 [-] fy2). +apply (extension_also_lipschitz_case y2 y1 fy1 Hfy1 fy2 Hfy2 e X). +assert (y2[-d]y1[=]y1[-d]y2). +apply ax_d_com. +apply CPsMetricSpace_is_CPsMetricSpace. +algebra. +apply AbsSmall_approach. auto. +Qed. + +End ExtensionProperties. + +End LipschitzExtension. diff --git a/metrics/Prod_Sub.v b/metrics/Prod_Sub.v index e3f0e94e5..445910da6 100644 --- a/metrics/Prod_Sub.v +++ b/metrics/Prod_Sub.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export IR_CPMSpace. diff --git a/model/Zmod/Cmod.v b/model/Zmod/Cmod.v index b88905ca8..b1cc01879 100644 --- a/model/Zmod/Cmod.v +++ b/model/Zmod/Cmod.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export ZMod. diff --git a/model/Zmod/IrrCrit.v b/model/Zmod/IrrCrit.v index 2f9948554..27e95f5b3 100644 --- a/model/Zmod/IrrCrit.v +++ b/model/Zmod/IrrCrit.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* IrrCrit.v, v1.1, 27aug2004, Bart Kirkels *) @@ -182,7 +166,7 @@ astepr (cpoly_zero fp); intuition. induction g. astepl (cpoly_mult_op fp (zxfpx (c[+X*]f)) (cpoly_zero fp)). astepl (cpoly_zero fp). -astepr (zxfpx (cpoly_zero Z_as_CRing)); try Algebra. +astepr (zxfpx (cpoly_zero Z_as_CRing)); try algebra. apply fpxeq_wd. apply eq_symmetric. apply (mult_zero Z_as_CRing). diff --git a/model/Zmod/ZBasics.v b/model/Zmod/ZBasics.v index 2317ff7e4..90fd7c298 100644 --- a/model/Zmod/ZBasics.v +++ b/model/Zmod/ZBasics.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* ZBasics.v, by Vince Barany *) Require Export ZArith. diff --git a/model/Zmod/ZDivides.v b/model/Zmod/ZDivides.v index 18d408327..c24b06be1 100644 --- a/model/Zmod/ZDivides.v +++ b/model/Zmod/ZDivides.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* ZDivides.v, by Vince Barany *) Require Export ZBasics. diff --git a/model/Zmod/ZGcd.v b/model/Zmod/ZGcd.v index e2b6bebdb..5c1089948 100644 --- a/model/Zmod/ZGcd.v +++ b/model/Zmod/ZGcd.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* ZGcd.v, by Vince Barany *) Require Export ZDivides. @@ -1227,7 +1211,9 @@ apply Zgcd_is_divisor_rht. generalize (Zgcd_lin_comb a b); intro Hlincomb; generalize (Zgcd_is_divisor_lft a b); intro Hdivb; elim Hdivb; intros y Hy; generalize (Zgcd_is_divisor_rht a b); - intro Hdiva; elim Hdiva; intros x Hx; set (d := Zgcd a b) in Hx, Hy |- *. + intro Hdiva; elim Hdiva; intros x Hx; set (d := Zgcd a b). +move d after Hy. +fold d in Hx; fold d in Hy. replace 1%Z with (Zgcd a b / d)%Z; auto with zarith. rewrite Hlincomb. set (u := Zgcd_coeff_a a b); set (v := Zgcd_coeff_b a b). diff --git a/model/Zmod/ZMod.v b/model/Zmod/ZMod.v index 61633e4a7..337ac0413 100644 --- a/model/Zmod/ZMod.v +++ b/model/Zmod/ZMod.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* ZMod.v, by Vince Barany *) Require Export ZGcd. diff --git a/model/Zmod/Zm.v b/model/Zmod/Zm.v index c2152a293..20c4b5d0c 100644 --- a/model/Zmod/Zm.v +++ b/model/Zmod/Zm.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* Zm.v, by Vince Barany *) Require Export ZMod. diff --git a/model/abgroups/QSposabgroup.v b/model/abgroups/QSposabgroup.v index 648f6f51c..148b64d26 100644 --- a/model/abgroups/QSposabgroup.v +++ b/model/abgroups/QSposabgroup.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) diff --git a/model/abgroups/Qabgroup.v b/model/abgroups/Qabgroup.v index 701076077..094818135 100644 --- a/model/abgroups/Qabgroup.v +++ b/model/abgroups/Qabgroup.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export Qgroup. diff --git a/model/abgroups/Qposabgroup.v b/model/abgroups/Qposabgroup.v index a39214534..525413954 100644 --- a/model/abgroups/Qposabgroup.v +++ b/model/abgroups/Qposabgroup.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) diff --git a/model/abgroups/Zabgroup.v b/model/abgroups/Zabgroup.v index 6d4c85036..a55789b1d 100644 --- a/model/abgroups/Zabgroup.v +++ b/model/abgroups/Zabgroup.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) diff --git a/model/fields/Qfield.v b/model/fields/Qfield.v index 0ea4aa769..85e35f508 100644 --- a/model/fields/Qfield.v +++ b/model/fields/Qfield.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export Qring. diff --git a/model/groups/QSposgroup.v b/model/groups/QSposgroup.v index a399d5407..800add992 100644 --- a/model/groups/QSposgroup.v +++ b/model/groups/QSposgroup.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export QSposmonoid. diff --git a/model/groups/Qgroup.v b/model/groups/Qgroup.v index b975f2c12..b6ba8ab75 100644 --- a/model/groups/Qgroup.v +++ b/model/groups/Qgroup.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export Qmonoid. diff --git a/model/groups/Qposgroup.v b/model/groups/Qposgroup.v index ab9e45962..144385956 100644 --- a/model/groups/Qposgroup.v +++ b/model/groups/Qposgroup.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export Qposmonoid. diff --git a/model/groups/Zgroup.v b/model/groups/Zgroup.v index 72c4f72a6..a7703cad8 100644 --- a/model/groups/Zgroup.v +++ b/model/groups/Zgroup.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) diff --git a/model/monoids/Nm_to_cycm.v b/model/monoids/Nm_to_cycm.v index 2e7f97078..45b7eae6e 100644 --- a/model/monoids/Nm_to_cycm.v +++ b/model/monoids/Nm_to_cycm.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export CMonoids. diff --git a/model/monoids/Nm_to_freem.v b/model/monoids/Nm_to_freem.v index 528668ffb..91114e862 100644 --- a/model/monoids/Nm_to_freem.v +++ b/model/monoids/Nm_to_freem.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export CMonoids. diff --git a/model/monoids/Nmonoid.v b/model/monoids/Nmonoid.v index e1c8419aa..4d1c7b7bf 100644 --- a/model/monoids/Nmonoid.v +++ b/model/monoids/Nmonoid.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export Nsemigroup. diff --git a/model/monoids/Nposmonoid.v b/model/monoids/Nposmonoid.v index d6dd383ff..3c1503c88 100644 --- a/model/monoids/Nposmonoid.v +++ b/model/monoids/Nposmonoid.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export Npossemigroup. diff --git a/model/monoids/QSposmonoid.v b/model/monoids/QSposmonoid.v index 4542e4779..40558b384 100644 --- a/model/monoids/QSposmonoid.v +++ b/model/monoids/QSposmonoid.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) diff --git a/model/monoids/Qmonoid.v b/model/monoids/Qmonoid.v index 80b6e6275..b3c2bdc5d 100644 --- a/model/monoids/Qmonoid.v +++ b/model/monoids/Qmonoid.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) diff --git a/model/monoids/Qposmonoid.v b/model/monoids/Qposmonoid.v index 771faf88c..09d46dc4a 100644 --- a/model/monoids/Qposmonoid.v +++ b/model/monoids/Qposmonoid.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) diff --git a/model/monoids/Zmonoid.v b/model/monoids/Zmonoid.v index f417b3ab3..5db594a86 100644 --- a/model/monoids/Zmonoid.v +++ b/model/monoids/Zmonoid.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) diff --git a/model/monoids/freem_to_Nm.v b/model/monoids/freem_to_Nm.v index 1714cd237..6bb9059d5 100644 --- a/model/monoids/freem_to_Nm.v +++ b/model/monoids/freem_to_Nm.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export CMonoids. diff --git a/model/monoids/twoelemmonoid.v b/model/monoids/twoelemmonoid.v index 3893eeeef..8307ec79b 100644 --- a/model/monoids/twoelemmonoid.v +++ b/model/monoids/twoelemmonoid.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export CMonoids. diff --git a/model/non_examples/N_no_group.v b/model/non_examples/N_no_group.v index 6457db4f2..6810f9312 100644 --- a/model/non_examples/N_no_group.v +++ b/model/non_examples/N_no_group.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) diff --git a/model/non_examples/Npos_no_group.v b/model/non_examples/Npos_no_group.v index 3302fe410..f685a7d60 100644 --- a/model/non_examples/Npos_no_group.v +++ b/model/non_examples/Npos_no_group.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) diff --git a/model/non_examples/Npos_no_monoid.v b/model/non_examples/Npos_no_monoid.v index 485fe92c8..b4c339b03 100644 --- a/model/non_examples/Npos_no_monoid.v +++ b/model/non_examples/Npos_no_monoid.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) diff --git a/model/ordfields/Qordfield.v b/model/ordfields/Qordfield.v index c9c5425b4..04582520e 100644 --- a/model/ordfields/Qordfield.v +++ b/model/ordfields/Qordfield.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export Qfield. diff --git a/model/reals/Cauchy_IR.v b/model/reals/Cauchy_IR.v index db9a97c9c..2e0257754 100644 --- a/model/reals/Cauchy_IR.v +++ b/model/reals/Cauchy_IR.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export Qordfield. diff --git a/model/rings/Qring.v b/model/rings/Qring.v index 80947f370..bf591ece9 100644 --- a/model/rings/Qring.v +++ b/model/rings/Qring.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export Qabgroup. diff --git a/model/rings/Zring.v b/model/rings/Zring.v index 7ff41cab0..9c9351c22 100644 --- a/model/rings/Zring.v +++ b/model/rings/Zring.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export Zabgroup. diff --git a/model/semigroups/Npossemigroup.v b/model/semigroups/Npossemigroup.v index 007b2d7bb..5d1e589c7 100644 --- a/model/semigroups/Npossemigroup.v +++ b/model/semigroups/Npossemigroup.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export CSemiGroups. diff --git a/model/semigroups/Nsemigroup.v b/model/semigroups/Nsemigroup.v index 46f034d60..5a9f6064f 100644 --- a/model/semigroups/Nsemigroup.v +++ b/model/semigroups/Nsemigroup.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export Nsetoid. diff --git a/model/semigroups/QSpossemigroup.v b/model/semigroups/QSpossemigroup.v index e67450e05..1f5e29712 100644 --- a/model/semigroups/QSpossemigroup.v +++ b/model/semigroups/QSpossemigroup.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export Qpossetoid. diff --git a/model/semigroups/Qpossemigroup.v b/model/semigroups/Qpossemigroup.v index e91bf33aa..2b6fc4d71 100644 --- a/model/semigroups/Qpossemigroup.v +++ b/model/semigroups/Qpossemigroup.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export Qpossetoid. diff --git a/model/semigroups/Qsemigroup.v b/model/semigroups/Qsemigroup.v index b64391c8b..55e40a3cf 100644 --- a/model/semigroups/Qsemigroup.v +++ b/model/semigroups/Qsemigroup.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export Qsetoid. diff --git a/model/semigroups/Zsemigroup.v b/model/semigroups/Zsemigroup.v index 6603734bc..ec4d1a8e1 100644 --- a/model/semigroups/Zsemigroup.v +++ b/model/semigroups/Zsemigroup.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export Zsetoid. diff --git a/model/semigroups/twoelemsemigroup.v b/model/semigroups/twoelemsemigroup.v index b21c6b0f3..4add5d693 100644 --- a/model/semigroups/twoelemsemigroup.v +++ b/model/semigroups/twoelemsemigroup.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export CSemiGroups. diff --git a/model/setoids/Nfinsetoid.v b/model/setoids/Nfinsetoid.v index 47e05f498..285012a90 100644 --- a/model/setoids/Nfinsetoid.v +++ b/model/setoids/Nfinsetoid.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Import CSetoids. diff --git a/model/setoids/Npossetoid.v b/model/setoids/Npossetoid.v index 93d9a3f23..32cf071b2 100644 --- a/model/setoids/Npossetoid.v +++ b/model/setoids/Npossetoid.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export Nsetoid. diff --git a/model/setoids/Nsetoid.v b/model/setoids/Nsetoid.v index 757b76508..dce58e2e7 100644 --- a/model/setoids/Nsetoid.v +++ b/model/setoids/Nsetoid.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export Nsec. diff --git a/model/setoids/Qpossetoid.v b/model/setoids/Qpossetoid.v index 4975ae910..8504e7c1f 100644 --- a/model/setoids/Qpossetoid.v +++ b/model/setoids/Qpossetoid.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export Qsetoid. diff --git a/model/setoids/Qsetoid.v b/model/setoids/Qsetoid.v index c4a4c18e6..88a93216d 100644 --- a/model/setoids/Qsetoid.v +++ b/model/setoids/Qsetoid.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) diff --git a/model/setoids/Zfinsetoid.v b/model/setoids/Zfinsetoid.v index bd2e21118..abe084af2 100644 --- a/model/setoids/Zfinsetoid.v +++ b/model/setoids/Zfinsetoid.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export ZArith. Require Import CSetoids. diff --git a/model/setoids/Zsetoid.v b/model/setoids/Zsetoid.v index 9240fb64d..4a54df214 100644 --- a/model/setoids/Zsetoid.v +++ b/model/setoids/Zsetoid.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) diff --git a/model/setoids/twoelemsetoid.v b/model/setoids/twoelemsetoid.v index 90179dee5..8387d19e3 100644 --- a/model/setoids/twoelemsetoid.v +++ b/model/setoids/twoelemsetoid.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export CSetoidFun. diff --git a/model/structures/Npossec.v b/model/structures/Npossec.v index 53970328d..f5f9c12bb 100644 --- a/model/structures/Npossec.v +++ b/model/structures/Npossec.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) (** printing Npos $\mathbb{N}^{+}$ #N+# *) diff --git a/model/structures/Nsec.v b/model/structures/Nsec.v index dfb45c9fe..45380c6df 100644 --- a/model/structures/Nsec.v +++ b/model/structures/Nsec.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) (** printing {#N} $\ensuremath{\mathrel\#_{\mathbb N}}$ *) diff --git a/model/structures/Qpossec.v b/model/structures/Qpossec.v index 11f0a671a..98a58da68 100644 --- a/model/structures/Qpossec.v +++ b/model/structures/Qpossec.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) (** printing Qpos $\mathbb{Q}^{+}$ #Q+# *) diff --git a/model/structures/Qsec.v b/model/structures/Qsec.v index 1a2b4d9f6..f4dbf0117 100644 --- a/model/structures/Qsec.v +++ b/model/structures/Qsec.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) (** printing Q %\ensuremath{\mathbb{Q}}% *) diff --git a/model/structures/Zsec.v b/model/structures/Zsec.v index 14175c76d..e40dd5a3f 100644 --- a/model/structures/Zsec.v +++ b/model/structures/Zsec.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) (** printing {#Z} %\ensuremath{\mathrel\#_{\mathbb Z}}% *) diff --git a/reals/Bridges_LUB.v b/reals/Bridges_LUB.v index ceea9da3a..20df85b67 100644 --- a/reals/Bridges_LUB.v +++ b/reals/Bridges_LUB.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* begin hide *) (* file : least_upper_bound_principle.v *) (* version : 1.50 - 03/05/2001 *) @@ -577,7 +561,7 @@ Proof. apply lt_S_n. assumption. simpl in |- *. - Algebra. + algebra. apply bin_op_wd_unfolded. apply eq_reflexive_unfolded. simpl in |- *. diff --git a/reals/Bridges_iso.v b/reals/Bridges_iso.v index 4a06fba68..d678f612b 100644 --- a/reals/Bridges_iso.v +++ b/reals/Bridges_iso.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* begin hide *) (* file : bridges_gives_our.v *) (* version : 1.50 - 09/05/2001 *) @@ -130,7 +114,7 @@ Proof. apply (less_irreflexive_unfolded _ b). apply H3 with (x := [--]x) (z := b). apply (strong_extensionality_of_X x [--][--]x). - Algebra. + algebra. assumption. apply inv_cancel_less. astepl x. @@ -157,7 +141,7 @@ Proof. intro. exists ([--]x). apply (strong_extensionality_of_X x [--][--]x). - Algebra. + algebra. assumption. case H0. @@ -202,7 +186,7 @@ Proof. intros. exists ([--]s). apply (strong_extensionality_of_X s [--][--]s). - Algebra. + algebra. assumption. apply inv_cancel_less. rstepl s. @@ -786,7 +770,7 @@ Proof. elim (less_irreflexive_unfolded _ b). apply H0 with (x := [--]x) (z := b). apply (P_is_strongly_extensional x [--][--]x). - Algebra. + algebra. assumption. apply inv_cancel_less. astepl x. @@ -815,7 +799,7 @@ Proof. intro. exists ([--]x). apply (P_is_strongly_extensional x [--][--]x). - Algebra. + algebra. assumption. case is_finite_P. @@ -872,7 +856,7 @@ Proof. intros H2 H3. exists ([--](seq j)). apply (P_is_strongly_extensional (seq j) [--][--](seq j)). - Algebra. + algebra. assumption. assumption. diff --git a/reals/CMetricFields.v b/reals/CMetricFields.v index 5e1608dca..5c9ac042d 100644 --- a/reals/CMetricFields.v +++ b/reals/CMetricFields.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export CReals1. @@ -109,7 +93,7 @@ apply less_imp_ap. apply pos_two. astepl OneR. -Algebra. +algebra. astepl (cmf_abs F [--]One[*]cmf_abs F [--]One). astepl (cmf_abs F ( [--]One[*][--]One)). @@ -122,7 +106,7 @@ astepl (cmf_abs F One). 2: astepl ( [--] ( [--] (One:F) [*]One)). 2: astepl ( [--][--] ((One:F) [*]One)). 2: astepl ((One:F) [*]One). -2: Algebra. +2: algebra. astepl (cmf_abs F (One[*]One)). astepl (cmf_abs F One[*]cmf_abs F One). diff --git a/reals/CPoly_Contin.v b/reals/CPoly_Contin.v index fd9ea7632..0d2f6542b 100644 --- a/reals/CPoly_Contin.v +++ b/reals/CPoly_Contin.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) (** * Continuity of polynomials *) diff --git a/reals/CReals.v b/reals/CReals.v index e7840c79a..02103dc44 100644 --- a/reals/CReals.v +++ b/reals/CReals.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) (** printing Lim %\ensuremath{\lim}% *) diff --git a/reals/CReals1.v b/reals/CReals1.v index ee3c77745..cc521a198 100644 --- a/reals/CReals1.v +++ b/reals/CReals1.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export Max_AbsIR. @@ -126,7 +110,7 @@ apply shift_leEq_plus'; rstepl (seq m[-]y); assumption. apply plus_resp_leEq. apply rht_leEq_Max. unfold cg_minus in |- *. -Algebra. +algebra. Qed. Lemma Cauchy_abs : forall seq : CauchySeq IR, Cauchy_prop (fun n => AbsIR (seq n)). @@ -145,6 +129,34 @@ simpl in |- *; apply Cauchy_Lim_abs. apply Cauchy_complete. Qed. +Lemma CS_seq_bounded' : forall seq : CauchySeqR, + {K : IR | Zero [<] K | forall m : nat, AbsSmall K (seq m)}. +unfold CauchySeqR in |- *. +intros. +assert (X0 : {K : IR | Zero [<] K | {N : nat | forall m, N <= m -> AbsSmall K (seq m)}}). +apply CS_seq_bounded; auto. +apply (CS_proof _ seq). +destruct X0 as [K1 K1_pos H1]. +destruct H1 as [N H1]. +exists (Max K1 (SeqBound0 seq N)). +apply less_leEq_trans with K1; auto. +apply lft_leEq_MAX. +intros. +elim (le_or_lt N m). +intros. +assert (AbsSmall (R:=IR) K1 (seq m)). +apply H1. auto. +apply AbsSmall_leEq_trans with K1; auto. +apply lft_leEq_MAX. +intros. +apply AbsSmall_leEq_trans with (SeqBound0 seq N). +apply rht_leEq_MAX. +apply AbsSmall_leEq_trans with (AbsIR (seq m)). +apply SeqBound0_greater; auto. +apply AbsIR_imp_AbsSmall. +apply leEq_reflexive. +Qed. + End More_Cauchy_Props. Section Subsequences. @@ -236,7 +248,7 @@ apply leEq_wdl with (AbsIR (seq1 i[-]seq1 N)). apply AbsSmall_imp_AbsIR; apply HN. apply lt_le_weak. apply mon_F'; apply le_lt_trans with m; auto. -apply AbsIR_wd; Algebra. +apply AbsIR_wd; algebra. Qed. Lemma Cprop2_seq_imp_Cprop2_subseq : forall a, diff --git a/reals/CSumsReals.v b/reals/CSumsReals.v index 2da66eba9..526fccd98 100644 --- a/reals/CSumsReals.v +++ b/reals/CSumsReals.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export CReals1. @@ -79,7 +63,7 @@ Lemma diff_is_Sum0 : forall (s : nat -> IR) n, s n[-]s 0 [=] Sum0 n (fun i => s Proof. intros s. simple induction n. -simpl in |- *. Algebra. +simpl in |- *. algebra. intros. simpl in |- *. apply eq_transitive_unfolded with (s (S n0) [-]s n0[+] (s n0[-]s 0)). @@ -141,7 +125,7 @@ Qed. Lemma Sum0_comm_scal : forall (s : nat -> IR) a m, Sum0 m (fun i => s i[*]a) [=] Sum0 m s [*]a. intros. induction m as [| m Hrecm]; intros. -simpl in |- *. Algebra. +simpl in |- *. algebra. simpl in |- *. Step_final (Sum0 m s [*]a[+]s m[*]a). Qed. @@ -158,10 +142,10 @@ Lemma Sum0_comm_scal' : forall (s : nat -> IR) a m, intros. apply eq_transitive_unfolded with (Sum0 m s[*]a). 2: astepr (Sum0 m s[*]a); apply mult_wdl. -2: apply Sum0_wd; Algebra. +2: apply Sum0_wd; algebra. eapply eq_transitive_unfolded. 2: apply Sum0_comm_scal. -apply Sum0_wd; Algebra. +apply Sum0_wd; algebra. Qed. Lemma Sum_comm_scal' : forall (s : nat -> IR) a m n, @@ -176,13 +160,13 @@ Qed. Lemma Sumx_comm_scal' : forall n (a : IR) (f : forall i, i < n -> IR), Sumx (fun i H => a[*]f i H) [=] a[*]Sumx f. simple induction n. -intros; simpl in |- *; Algebra. +intros; simpl in |- *; algebra. clear n; intros; simpl in |- *. eapply eq_transitive_unfolded. 2: apply eq_symmetric_unfolded; apply ring_dist_unfolded. apply bin_op_wd_unfolded. apply H with (f := fun i l => f i (lt_S _ _ l)). -Algebra. +algebra. Qed. Lemma Sum2_comm_scal' : forall a m n (f: forall i, m <= i -> i <= n -> IR), @@ -194,6 +178,6 @@ apply Sum_wd'. assumption. intros. elim (le_lt_dec m i); intros; simpl in |- *. -elim (le_lt_dec i n); intros; simpl in |- *; Algebra. -Algebra. +elim (le_lt_dec i n); intros; simpl in |- *; algebra. +algebra. Qed. diff --git a/reals/CauchySeq.v b/reals/CauchySeq.v index 977520374..bfa1d712c 100644 --- a/reals/CauchySeq.v +++ b/reals/CauchySeq.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) (** printing IR %\ensuremath{\mathbb R}% *) @@ -694,36 +678,73 @@ Qed. (** Well definedness. *) -Lemma Cauchy_prop_wd : forall seq1 seq2 : nat -> IR, - Cauchy_prop seq1 -> (forall n, seq1 n [=] seq2 n) -> Cauchy_prop seq2. +Lemma Cauchy_prop_wd' : forall seq1 seq2 : nat -> IR, + Cauchy_prop seq1 -> {N : nat | forall n, N <= n -> seq1 n [=] seq2 n} -> Cauchy_prop seq2. intros seq1 seq2 H H0. red in |- *. intros e H1. -elim (H e H1). -intros N Hn; exists N; intros. -astepr (seq1 m[-]seq1 N). -apply Hn; assumption. +elim (H (e[/]TwoNZ) (pos_div_two IR e H1)). +intros N Hn. +destruct H0 as [M H0]. +exists (max M N). intros. +astepr (seq1 m[-]seq1 (max M N)). +astepr ((seq1 m[-]seq1 N)[+](seq1 N [-]seq1 (max M N))). +apply AbsSmall_eps_div_two. +apply Hn. eauto with arith. +apply AbsSmall_minus. apply Hn. eauto with arith. +rational. +apply cg_minus_wd; apply H0; eauto with arith. Qed. -Lemma Cauchy_Lim_prop2_wd : forall seq1 seq2 c, Cauchy_Lim_prop2 seq1 c -> - (forall n, seq1 n [=] seq2 n) -> Cauchy_Lim_prop2 seq2 c. -intros seq1 seq2 c H H0. -red in |- *. intros eps H1. -elim (H eps H1). -intros N Hn; exists N; intros. +Lemma Cauchy_prop_wd : forall seq1 seq2 : nat -> IR, + Cauchy_prop seq1 -> (forall n, seq1 n [=] seq2 n) -> Cauchy_prop seq2. +intros. +apply Cauchy_prop_wd' with seq1; auto. +exists 0. +auto. +Qed. + +Lemma Cauchy_Lim_prop2_wd' : forall seq1 seq2 c, Cauchy_Lim_prop2 seq1 c -> + { N : nat | forall n, N <= n -> seq1 n [=] seq2 n} -> Cauchy_Lim_prop2 seq2 c. +intros seq1 seq2 c H1 H2. +red in |- *. intros eps H3. +elim (H1 eps H3). +intros M H4. +destruct H2 as [N H2]. +exists (max N M) . +intros. +assert (N <= m); eauto with arith. +assert (M <= m); eauto with arith. astepr (seq1 m[-]c). -apply Hn; assumption. +apply H4; auto. Qed. -Lemma Lim_wd' : forall seq1 seq2 : CauchySeqR, - (forall n, seq1 n [=] seq2 n) -> Lim seq1 [=] Lim seq2. +Lemma Cauchy_Lim_prop2_wd : forall seq1 seq2 c, Cauchy_Lim_prop2 seq1 c -> + (forall n, seq1 n [=] seq2 n) -> Cauchy_Lim_prop2 seq2 c. intros. +apply Cauchy_Lim_prop2_wd' with seq1; auto. +exists 0. +auto. +Qed. + +Lemma Lim_wd'' : forall seq1 seq2 : CauchySeqR, + {N : nat | forall n : nat, N <= n -> seq1 n [=] seq2 n} -> Lim seq1 [=] Lim seq2. +intros seq1 seq2 H. destruct H as [N H]. cut (Cauchy_Lim_prop2 seq1 (Lim seq2)). intro. apply eq_symmetric_unfolded. apply Limits_unique; assumption. -apply Cauchy_Lim_prop2_wd with (seq2:nat -> IR). +apply Cauchy_Lim_prop2_wd' with (seq2:nat -> IR). apply Cauchy_complete. -intro; apply eq_symmetric_unfolded; Algebra. +exists N. +intros; apply eq_symmetric_unfolded. auto. +Qed. + +Lemma Lim_wd' : forall seq1 seq2 : CauchySeqR, + (forall n : nat, seq1 n [=] seq2 n) -> Lim seq1 [=] Lim seq2. +intros. +apply Lim_wd''; auto. +exists 0. +auto. Qed. Lemma Lim_unique : forall seq x y, diff --git a/reals/Cauchy_CReals.v b/reals/Cauchy_CReals.v index 6f871a6cb..4097d7bff 100644 --- a/reals/Cauchy_CReals.v +++ b/reals/Cauchy_CReals.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export Cauchy_COF. @@ -202,7 +186,7 @@ Qed. Lemma ing_nring' : forall m n : nat, CS_seq _ (nring (R:=R_COrdField') n) m [=] CS_seq _ (inject_Q (nring n)) m. intros. -induction n as [| n Hrecn]; simpl in |- *; Algebra. +induction n as [| n Hrecn]; simpl in |- *; algebra. Qed. Lemma ing_nring : forall n : nat, nring n [=] inject_Q (nring n). @@ -262,7 +246,7 @@ Proof. apply eq_symmetric_unfolded. apply ing_mult. astepr (inject_Q x). - apply ing_eq; Algebra. + apply ing_eq; algebra. Qed. Transparent R_COrdField. diff --git a/reals/Cesaro.v b/reals/Cesaro.v new file mode 100644 index 000000000..8de8c0306 --- /dev/null +++ b/reals/Cesaro.v @@ -0,0 +1,183 @@ +Require Export Series. +Require Export PosSeq. + +Section AlgebraBits. + +Lemma algebraic_transform1 : forall (l : IR) (x : nat->IR) (y : nat->IR) +(H2 : seq_pos y) (m : nat), +(seq_part_sum (fun k : nat => y k [*] (x k [-] l)) (S m)[/] + seq_part_sum y (S m)[//]seq_pos_imp_ap_zero y H2 m) [=] +((seq_part_sum (fun k : nat => x k[*]y k) (S m)[/] + seq_part_sum y (S m)[//]seq_pos_imp_ap_zero y H2 m)[-]l). +intros. +rstepr (((seq_part_sum (fun k : nat => x k[*]y k) (S m))[-] l[*](seq_part_sum y (S m)))[/] + seq_part_sum y (S m)[//]seq_pos_imp_ap_zero y H2 m). +apply div_wd. +2: apply eq_reflexive_unfolded. +unfold seq_part_sum. +unfold cg_minus. +astepr (Sum0 (G:=IR) (S m) (fun k : nat => x k[*]y k)[+] + Sum0 (G:=IR) (S m) (fun k : nat => [--]l[*]y k)). +astepr (Sum0 (G:=IR) (S m) (fun k : nat => x k[*]y k[+][--]l[*]y k)). +apply Sum0_wd. intros. rational. +apply (Sum0_plus_Sum0 IR (fun k : nat => x k [*] y k) (fun k : nat => [--] l [*] y k) (S m)). +apply plus_resp_eq. +astepr ([--]l [*] (Sum0 (G:=IR) (S m) y)). +apply mult_distr_sum0_lft. +Qed. + +Lemma algebraic_transform2 : forall (l : IR) (x : nat->IR) (y : nat->IR) +(H2 : seq_pos y) (m N1: nat), +(( seq_part_sum (fun k : nat => y k [*] (x k [-] l)) (S N1)[+] + Sum (S N1) m (fun k : nat => y k [*] (x k [-] l)) )[/] + seq_part_sum y (S m)[//]seq_pos_imp_ap_zero y H2 m) [=] +(seq_part_sum (fun k : nat => y k [*] (x k [-] l)) (S m)[/] + seq_part_sum y (S m)[//]seq_pos_imp_ap_zero y H2 m). +intros. +unfold seq_part_sum. +apply div_wd. +2: apply eq_reflexive_unfolded. +unfold Sum. +unfold Sum1. +rational. +Qed. + +Lemma algebraic_transform3: forall (eps: IR) (y : nat->IR) +(H2 : seq_pos y) (m N1: nat), +(eps[/]TwoNZ [*] (Sum (S N1) m (fun k: nat => y k)[/] + seq_part_sum y (S m)[//]seq_pos_imp_ap_zero y H2 m)) [=] +(Sum (G:=IR) (S N1) m (fun k : nat => y k[*]eps [/]TwoNZ)[/] + seq_part_sum y (S m)[//]seq_pos_imp_ap_zero y H2 m). +intros. +astepl ((eps[/]TwoNZ [*] (Sum (S N1) m (fun k: nat => y k)))[/] + seq_part_sum y (S m)[//]seq_pos_imp_ap_zero y H2 m). +astepr (Sum (G:=IR) (S N1) m (fun k : nat => eps[/]TwoNZ[*]y k)[/] + seq_part_sum y (S m)[//]seq_pos_imp_ap_zero y H2 m). +apply div_wd. +2: apply eq_reflexive_unfolded. +apply eq_symmetric_unfolded. +astepr (eps[/]TwoNZ[*]Sum (G:=IR) (S N1) m y). +apply mult_distr_sum_lft. +Qed. + +Lemma algebraic_estimate1 : +forall (e l: IR) (H1 : Zero [<] e) (x : nat -> IR) (y : nat->IR) +(H2 : seq_pos y) (m N1: nat) (H3 : S N1 <= m) +(H4 : forall i, S N1 <= i -> i <= m -> AbsSmall e (x i[-]l)), +AbsSmall + (Sum (G:=IR) (S N1) m (fun k : nat => y k[*]e)[/] + seq_part_sum y (S m)[//]seq_pos_imp_ap_zero y H2 m) + (Sum (G:=IR) (S N1) m (fun k : nat => y k[*](x k[-]l))[/] + seq_part_sum y (S m)[//]seq_pos_imp_ap_zero y H2 m). +intros. +apply AbsSmall_cancel_mult with (seq_part_sum y (S m)). +apply seq_pos_imp_sum_pos; auto. +astepl (Sum (G:=IR) (S N1) m (fun k : nat => y k[*]e)). +astepr (Sum (G:=IR) (S N1) m (fun k : nat => y k[*](x k[-]l))). +apply sum_resp_AbsSmall; auto. +intros. +apply mult_resp_AbsSmall. +apply less_leEq. +apply H2. +apply H4; auto. +Qed. + +End AlgebraBits. + +Section Cesaro. + +Theorem cesaro_transform : +forall (l : IR) (x : nat -> IR) (y : nat -> IR) +(H1 : Cauchy_Lim_prop2 x l) +(H2 : seq_pos y) (H3 : seq_inf_sum y), +Cauchy_Lim_prop2 (fun n : nat => seq_part_sum (fun k : nat => x k [*] y k) (S n) + [/](seq_part_sum y (S n)) [//] (seq_pos_imp_ap_zero y H2 n)) l. +unfold Cauchy_Lim_prop2. +intros. + +(* Find N such that forall m > N |x - l| < eps / 2*) + +assert (H4 : Zero [<] eps[/]TwoNZ). apply pos_div_two. auto. +assert ({N : nat | forall m, N <= m -> AbsSmall (eps[/]TwoNZ) ((x m) [-] l) }). +apply (H1 (eps[/]TwoNZ) H4). +destruct X0 as [N1 H5]. + +(* find N1 such that a the following will be less that eps/2 also *) + +set (C := seq_part_sum (fun k : nat => y k [*] (x k [-] l)) (S N1)); +assert +(H7 : { N : nat | + forall m : nat, N <= m -> AbsSmall (eps[/]TwoNZ) (C [/](seq_part_sum y (S m)) [//] (seq_pos_imp_ap_zero y H2 m))}). + +apply (seq_inf_sum_imp_div_small y H3 H2 C (eps[/]TwoNZ) H4). +destruct H7 as [N2 H7]. + +(* Now we can choose N as max of N1 and N2 *) + +exists (S (max (S N1) N2)). +intros. +astepr (seq_part_sum (fun k : nat => y k [*] (x k [-] l)) (S m)[/] + seq_part_sum y (S m)[//]seq_pos_imp_ap_zero y H2 m). +2: apply (algebraic_transform1 l x y H2 m). + +astepr ((seq_part_sum (fun k : nat => y k [*] (x k [-] l)) (S N1)[+] + Sum (S N1) m (fun k : nat => y k [*] (x k [-] l)) )[/] + seq_part_sum y (S m)[//]seq_pos_imp_ap_zero y H2 m). +2: apply (algebraic_transform2 l x y H2 m). + +astepr (((seq_part_sum (fun k : nat => y k [*] (x k [-] l)) (S N1)) + [/]seq_part_sum y (S m)[//]seq_pos_imp_ap_zero y H2 m) + [+] + ((Sum (S N1) m (fun k : nat => y k [*] (x k [-] l)))[/] + seq_part_sum y (S m)[//]seq_pos_imp_ap_zero y H2 m)). +apply AbsSmall_eps_div_two. + +(* We are ready for estimates *) +apply H7. +eauto with arith. + +apply AbsSmall_leEq_trans with ((Sum (S N1) m (fun k : nat => y k [*] eps [/]TwoNZ))[/] + seq_part_sum y (S m)[//]seq_pos_imp_ap_zero y H2 m). +astepl (eps[/]TwoNZ [*] (Sum (S N1) m (fun k: nat => y k)[/] + seq_part_sum y (S m)[//]seq_pos_imp_ap_zero y H2 m)). +2: apply algebraic_transform3. + +astepr (eps[/]TwoNZ[*]One). +apply mult_resp_leEq_lft. +cut (AbsSmall One (Sum (G:=IR) (S N1) m (fun k : nat => y k)[/] + seq_part_sum y (S m)[//]seq_pos_imp_ap_zero y H2 m)). +unfold AbsSmall. tauto. +apply seq_inf_sum_ratio_bound. +eauto with arith. +apply less_leEq; auto. +apply algebraic_estimate1; auto. +eauto with arith. +intros. +apply H5. +auto with arith. +Qed. + +Theorem cesaro_sum : +forall (l : IR) (x : nat -> IR) (H1 : Cauchy_Lim_prop2 x l), +Cauchy_Lim_prop2 (fun n : nat => seq_part_sum x (S n) + [/]nring (S n)[//](nringS_ap_zero _ n)) l. +intros. +set (y := (fun k : nat => One : IR)). +assert (H2 : seq_pos y). +apply One_seq_is_pos. +assert (H3 : seq_inf_sum y). +apply One_seq_is_inf_sum. +apply Cauchy_Lim_prop2_wd' with (fun n : nat => seq_part_sum (fun k : nat => x k[*] y k) (S n) + [/]seq_part_sum y (S n)[//]seq_pos_imp_ap_zero y H2 n). +apply cesaro_transform; auto. +exists 0. +intros. +apply div_wd. +unfold seq_part_sum. +apply Sum0_wd. +intros. unfold y. algebra. +apply One_part_sum. +Qed. + +End Cesaro. + diff --git a/reals/IVT.v b/reals/IVT.v index d42ae10d7..1139a18cb 100644 --- a/reals/IVT.v +++ b/reals/IVT.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export CPoly_Contin. @@ -402,7 +386,7 @@ astepr (Three[^]i:IR). apply leEq_wdl with (nring i[*]Two[^]i:IR). 2: rstepr (nring i[*] (Small[^]i[*]Three[^]i)). 2: astepr (nring i[*] (Small[*]Three) [^]i). -2: cut (Small[*]Three [=] Two); Algebra. +2: cut (Small[*]Three [=] Two); algebra. 2: unfold Small in |- *; rational. induction i as [| i Hreci]. simpl in |- *. astepl ZeroR. apply less_leEq. apply pos_one. diff --git a/reals/Intervals.v b/reals/Intervals.v index 6441f0664..acfd1e98e 100644 --- a/reals/Intervals.v +++ b/reals/Intervals.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export CSetoidInc. @@ -223,11 +207,11 @@ exists (cons a (nil _)). intros x H1. inversion H1. rename X into H2. elim H2. -apply compact_wd with a; Algebra. +apply compact_wd with a; algebra. apply compact_inc_lft. intros. exists a. -right; Algebra. +right; algebra. apply leEq_wdl with ZeroR. apply less_leEq; auto. astepl (AbsIR Zero). @@ -248,10 +232,10 @@ exists (cons a (nil IR)). intros x H1. inversion_clear H1 as [H2|]. elim H2. -apply compact_wd with a; [ apply compact_inc_lft | Algebra ]. +apply compact_wd with a; [ apply compact_inc_lft | algebra ]. intros x Hx; inversion_clear Hx. exists a. -simpl in |- *; right; Algebra. +simpl in |- *; right; algebra. eapply leEq_wdl. 2: apply eq_symmetric_unfolded; apply AbsIR_eq_x. apply leEq_transitive with (b[-]a). @@ -266,7 +250,7 @@ exists (cons ((a[+]b) [/]TwoNZ) (nil IR)). intros x H1. inversion_clear H1 as [H2|]. inversion_clear H2. -apply compact_wd with ((a[+]b) [/]TwoNZ); [ split | Algebra ]. +apply compact_wd with ((a[+]b) [/]TwoNZ); [ split | algebra ]. astepl (a[+]Zero); apply shift_plus_leEq'. apply mult_cancel_leEq with (Two:IR). apply pos_two. @@ -281,7 +265,7 @@ rstepl (a[-]b). apply shift_minus_leEq; astepr b; auto. intros. exists ((a[+]b) [/]TwoNZ). -right; Algebra. +right; algebra. eapply leEq_wdl. 2: apply eq_symmetric_unfolded; apply Abs_Max. apply shift_minus_leEq; apply Max_leEq; apply shift_leEq_plus'; @@ -318,7 +302,7 @@ unfold b' in H1; apply compact_map3 with (e := e) (Hab' := H1) (b := b). assumption. try rename X into H2. simpl in H2; inversion_clear H2. apply Hl'; assumption. -apply compact_wd with b'; [ apply compact_inc_rht | Algebra ]. +apply compact_wd with b'; [ apply compact_inc_rht | algebra ]. intros. cut (x [<] b' or b'[-]e [<] x). intros H3. inversion_clear H3. @@ -332,7 +316,7 @@ inversion_clear H2; split. assumption. apply less_leEq; auto. exists b'. -right; Algebra. +right; algebra. simpl in |- *; unfold ABSIR in |- *. apply Max_leEq. apply shift_minus_leEq; unfold b' in |- *. @@ -466,7 +450,7 @@ set (seq2 := Cauchy_const x) in *. apply leEq_wdl with (Lim seq2[-]Lim seq1). 2: apply cg_minus_wd; [ unfold seq2 in |- *; apply eq_symmetric_unfolded; apply Lim_const - | Algebra ]. + | algebra ]. apply leEq_wdl with @@ -648,7 +632,7 @@ apply inv_resp_leEq. set (seq2 := Cauchy_const x) in *. apply leEq_wdl with (Lim seq1[-]Lim seq2). 2: apply cg_minus_wd; - [ Algebra + [ algebra | unfold seq2 in |- *; apply eq_symmetric_unfolded; apply Lim_const ]. apply leEq_wdl diff --git a/reals/Max_AbsIR.v b/reals/Max_AbsIR.v index 0179ea5c8..1108d6334 100644 --- a/reals/Max_AbsIR.v +++ b/reals/Max_AbsIR.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) (** printing Max %\ensuremath{\max}% *) @@ -47,8 +31,8 @@ Lemma Max_seq_char : forall n, intros. unfold Max_seq in |- *. elim less_cotransitive_unfolded; intro H; simpl in |- *. - left; split; Algebra. -right; split; Algebra. + left; split; algebra. +right; split; algebra. Qed. Lemma Cauchy_Max_seq : Cauchy_prop Max_seq. @@ -106,7 +90,7 @@ red in |- *; apply approach_zero_weak. intros e He. apply leEq_wdl with (Lim (Cauchy_const x) [-]MAX). 2: apply cg_minus_wd; - [ apply eq_symmetric_unfolded; apply Lim_const | Algebra ]. + [ apply eq_symmetric_unfolded; apply Lim_const | algebra ]. unfold MAX in |- *. eapply leEq_wdl. 2: apply Lim_minus. @@ -352,6 +336,53 @@ apply mult_resp_leEq_rht; [ apply rht_leEq_Max | apply less_leEq; assumption ]. Qed. +Lemma max_plus : forall (a b c : IR), +Max (a[+]c) (b[+]c) [=] Max a b [+] c. +intros. +apply equiv_imp_eq_max; intros. +apply shift_plus_less. +apply Max_less; apply shift_less_minus; auto. +apply leEq_less_trans with (Max a b [+]c); auto. +apply plus_resp_leEq. +apply lft_leEq_Max. +apply leEq_less_trans with (Max a b [+]c); auto. +apply plus_resp_leEq. +apply rht_leEq_Max. +Qed. + +Lemma max_mult : forall (a b c : IR), Zero [<] c -> +(Max (c[*]a) (c[*]b)) [=] c[*](Max a b). +intros a b c H. +assert (H1 : c [#] Zero). +apply pos_ap_zero; auto. +assert (H2 : Zero [<=] c). +apply less_leEq; auto. +assert (forall y : IR, c[*]a[<]y -> c[*]b[<]y -> c[*]Max a b[<]y). +intros. +astepl (Max a b [*]c). +apply shift_mult_less with H1; auto. +apply Max_less; +apply shift_less_div; auto. +auto. +astepl (c[*]a). +auto. +astepl (c[*]b). +auto. +assert (forall y : IR, c[*]Max a b[<]y -> c[*]a[<]y). +intros. +apply leEq_less_trans with (c[*]Max a b); auto. +apply mult_resp_leEq_lft; auto. +apply lft_leEq_MAX. +auto. +assert (forall y : IR, c[*]Max a b[<]y -> c[*]b[<]y). +intros. +apply leEq_less_trans with (c[*]Max a b); auto. +apply mult_resp_leEq_lft; auto. +apply rht_leEq_MAX. +auto. +apply equiv_imp_eq_max; auto. +Qed. + End properties_of_Max. End Maximum. @@ -370,7 +401,7 @@ Definition MIN (x y : IR) : IR := [--] (Max [--]x [--]y). Lemma MIN_wd : bin_op_wd _ MIN. intros x1 x2 y1 y2. -unfold MIN in |- *; Algebra. +unfold MIN in |- *; algebra. Qed. Lemma MIN_strext : bin_op_strext _ MIN. @@ -425,7 +456,7 @@ apply less_Max_imp. apply inv_cancel_less. apply less_wdr with z. assumption. -Algebra. +algebra. Qed. Lemma leEq_Min : forall x y z : IR, z [<=] x -> z [<=] y -> z [<=] Min x y. @@ -617,7 +648,7 @@ Qed. Definition AbsIR : CSetoid_un_op IR := Build_CSetoid_un_op _ ABSIR ABSIR_strext. Lemma AbsIR_wd : forall x y : IR, x [=] y -> AbsIR x [=] AbsIR y. -Algebra. +algebra. Qed. Lemma AbsIR_wdl : forall x y e, x [=] y -> AbsIR x [<] e -> AbsIR y [<] e. @@ -625,7 +656,7 @@ Proof. intros. apply less_wdl with (AbsIR x). assumption. -Algebra. +algebra. Qed. Lemma AbsIR_wdr : forall x y e, x [=] y -> e [<] AbsIR x -> e [<] AbsIR y. @@ -633,7 +664,7 @@ Proof. intros. apply less_wdr with (AbsIR x). assumption. -Algebra. +algebra. Qed. Lemma AbsIRz_isz : AbsIR Zero [=] Zero. @@ -772,7 +803,7 @@ Lemma AbsIR_inv : forall x : IR, AbsIR x [=] AbsIR [--]x. intros. unfold AbsIR in |- *; simpl in |- *; unfold ABSIR in |- *. apply eq_transitive_unfolded with (Max [--][--]x [--]x). -apply bin_op_wd_unfolded; Algebra. +apply bin_op_wd_unfolded; algebra. apply Max_comm. Qed. @@ -783,6 +814,18 @@ apply AbsIR_inv. apply AbsIR_wd; rational. Qed. +Lemma AbsIR_mult : forall (x c: IR) (H : Zero [<]c), +c[*] AbsIR (x) [=] AbsIR (c[*]x). +intros. +unfold AbsIR. +simpl. +unfold ABSIR. +rstepr (Max (c[*]x) (c[*]([--]x))). +apply eq_symmetric_unfolded. +apply max_mult; auto. +Qed. + + Lemma AbsIR_eq_x : forall x : IR, Zero [<=] x -> AbsIR x [=] x. intros. unfold AbsIR in |- *; simpl in |- *; unfold ABSIR in |- *. @@ -866,7 +909,7 @@ rename X2 into H3. apply H3. apply less_leEq; apply pos_div_two'; auto. astepr (Zero[+][--]x); apply shift_leEq_plus. apply leEq_wdl with (y[+]x). -2: unfold cg_minus in |- *; Algebra. +2: unfold cg_minus in |- *; algebra. red in |- *; apply approach_zero. cut (forall e : IR, Zero [<] e -> e [<] x [/]TwoNZ -> y[+]x [<] e); intros. cut (x [/]FourNZ [<] x [/]TwoNZ); intros. @@ -929,6 +972,38 @@ intros e H0. eapply leEq_transitive; [ apply inv_leEq_AbsIR | exact (H e H0) ]. Qed. +Lemma AbsSmall_approach : +forall (a b : IR), + (forall (e : IR), Zero[<]e -> AbsSmall (a[+]e) b) -> AbsSmall a b. +unfold AbsSmall. +intros a b H. +split. +assert (forall e : IR, Zero[<]e -> [--]a[-]b[<=]e). +intros. +assert ([--](a[+]e)[<=]b /\ b[<=]a[+]e). +apply H; auto. destruct H0. +apply shift_minus_leEq. +apply shift_leEq_plus'. +astepl ([--]a[+][--]e). +astepl ([--](a[+]e)). +auto. +astepr (b[+]Zero). +apply shift_leEq_plus'. +unfold leEq. +apply approach_zero_weak; auto. +assert (forall e : IR, Zero[<]e -> b[-]a[<=]e). +intros. +assert ([--](a[+]e)[<=]b /\ b[<=]a[+]e). +apply H; auto. destruct H0. +apply shift_minus_leEq. +astepr (a[+]e). +auto. +astepr (a[+]Zero). +apply shift_leEq_plus'. +unfold leEq. +apply approach_zero_weak; auto. +Qed. + Lemma AbsIR_eq_zero : forall x : IR, AbsIR x [=] Zero -> x [=] Zero. intros. apply AbsIR_approach_zero; intros. @@ -994,6 +1069,30 @@ End Absolute. Hint Resolve AbsIRz_isz: algebra. +Section SeqMax. + +(** *** Bound of sequence *) + +Variable seq : nat -> IR. + +Fixpoint SeqBound0 (n : nat) : IR := + match n with + | O => Zero + | S m => Max (AbsIR (seq m)) (SeqBound0 m) + end. + +Lemma SeqBound0_greater : forall (m n : nat), +m < n -> AbsIR (seq m) [<=] SeqBound0 n. +intros. +elim H. +simpl. apply lft_leEq_MAX. +intros. simpl. +apply leEq_transitive with (SeqBound0 m0); auto. +apply rht_leEq_MAX. +Qed. + +End SeqMax. + Section Part_Function_Max. (** *** Functional Operators @@ -1041,14 +1140,14 @@ Definition FAbs := FMax F {--}F. Lemma FMin_char : forall x Hx Hx' Hx'', FMin x Hx [=] Min (F x Hx') (G x Hx''). intros. Opaque Max. -simpl in |- *; unfold MIN; Algebra. +simpl in |- *; unfold MIN; algebra. Qed. Transparent Max. Lemma FAbs_char : forall x Hx Hx', FAbs x Hx [=] AbsIR (F x Hx'). intros. -simpl in |- *; unfold ABSIR in |- *; apply MAX_wd; Algebra. +simpl in |- *; unfold ABSIR in |- *; apply MAX_wd; algebra. Qed. End Part_Function_Abs. diff --git a/reals/NRootIR.v b/reals/NRootIR.v index b4f6ee721..6cb74559e 100644 --- a/reals/NRootIR.v +++ b/reals/NRootIR.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) (** printing NRoot %\ensuremath{\sqrt[n]{\cdot}}% *) @@ -159,7 +143,7 @@ apply eq_transitive_unfolded with (NRoot x k Hx Hk[^]k). apply eq_symmetric_unfolded; apply NRoot_power. apply eq_transitive_unfolded with (NRoot y k Hy Hk[^]k). 2: apply NRoot_power. -apply nexp_wd; Algebra. +apply nexp_wd; algebra. Qed. (** %\begin{convention}% Let [x,y] be nonnegative real numbers. @@ -210,8 +194,8 @@ apply leEq_imp_eq; auto. eapply leEq_wdl. eapply leEq_wdr. eexact H1. - Algebra. -Algebra. + algebra. +algebra. clear H H1. generalize (NRoot_wd _ _ xpos ypos k kpos kpos H2). @@ -378,7 +362,7 @@ intros. apply eq_transitive_unfolded with (AbsIR x[*]AbsIR y). apply AbsIR_resp_mult. apply bin_op_wd_unfolded. -Algebra. +algebra. unfold AbsIR in |- *; simpl in |- *; unfold ABSIR in |- *. apply eq_transitive_unfolded with (Max [--]y y). apply Max_comm. @@ -394,7 +378,7 @@ intros. astepl (AbsIR (y[*]x)). eapply eq_transitive_unfolded. apply AbsIR_mult_pos; auto. -Algebra. +algebra. Qed. Lemma AbsIR_nexp : forall x n, AbsIR (nexp _ n x) [=] nexp _ n (AbsIR x). @@ -404,7 +388,7 @@ simpl in |- *; apply AbsIR_eq_x; apply less_leEq; apply pos_one. simpl in |- *. eapply eq_transitive_unfolded. apply AbsIR_resp_mult. -Algebra. +algebra. Qed. Lemma AbsIR_nexp_op : forall n x, AbsIR (x[^]n) [=] AbsIR x[^]n. @@ -453,7 +437,7 @@ rstepl ( [--]OneR). astepr ( [--]ZeroR); apply inv_resp_leEq; apply less_leEq; apply pos_one. rstepl (One[/] [--]y[//]inv_resp_ap_zero _ _ H). apply div_wd. -Algebra. +algebra. apply eq_symmetric_unfolded; apply AbsIR_eq_inv_x. apply less_leEq; assumption. intros. @@ -461,7 +445,7 @@ apply eq_transitive_unfolded with (One[/] y[//]H). apply AbsIR_eq_x. apply less_leEq; apply recip_resp_pos; assumption. apply div_wd; - [ Algebra + [ algebra | apply eq_symmetric_unfolded; apply AbsIR_eq_x; apply less_leEq; assumption ]. apply ap_imp_less. assumption. @@ -474,7 +458,7 @@ intros x H Ha. apply eq_transitive_unfolded with (AbsIR One[/] AbsIR x[//]Ha). apply AbsIR_division. apply div_wd. -2: Algebra. +2: algebra. apply AbsIR_eq_x; apply less_leEq; apply pos_one. Qed. @@ -488,7 +472,7 @@ apply (ap_symmetric_unfolded _ _ _ (less_imp_ap _ _ _ (pos_two _)))). apply AbsIR_division. apply div_wd. -Algebra. +algebra. apply AbsIR_eq_x; apply less_leEq; apply pos_two. Qed. @@ -555,10 +539,10 @@ unfold cg_minus in |- *. apply leEq_wdr with (AbsIR x[+]AbsIR [--]y). apply triangle_IR. apply bin_op_wd_unfolded. -Algebra. +algebra. unfold AbsIR in |- *; simpl in |- *; unfold ABSIR in |- *. apply eq_transitive_unfolded with (Max [--]y y). -apply bin_op_wd_unfolded; Algebra. +apply bin_op_wd_unfolded; algebra. apply Max_comm. Qed. @@ -592,7 +576,7 @@ apply plus_resp_leEq. eapply leEq_wdr. apply H. apply Sumx_wd. -intros; Algebra. +intros; algebra. Qed. Lemma triangle_Sum2IR : forall m n (f : forall i, m <= i -> i <= n -> IR), @@ -609,7 +593,7 @@ elim (le_lt_dec m i); intro; [ simpl in |- * | elimtype False; apply (le_not_lt m i); auto with arith ]. elim (le_lt_dec i n); intro; [ simpl in |- * | elimtype False; apply (le_not_lt i n); auto with arith ]. -Algebra. +algebra. Qed. Lemma AbsIR_str_bnd_AbsIR : forall a b e, AbsIR (a[-]b) [<] e -> AbsIR b [<] AbsIR a[+]e. diff --git a/reals/OddPolyRootIR.v b/reals/OddPolyRootIR.v index bba4be763..2ef9892be 100644 --- a/reals/OddPolyRootIR.v +++ b/reals/OddPolyRootIR.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export IVT. @@ -119,7 +103,7 @@ Fixpoint flip (p : RX) : RX := Lemma flip_poly : forall (p : RX) x, (flip p) ! x [=] [--]p ! ( [--]x). intro p. elim p. -intros. simpl in |- *. Algebra. +intros. simpl in |- *. algebra. intros c q. intros. change ( [--]c[+]x[*] (cpoly_inv _ (flip q)) ! x [=] [--] (c[+][--]x[*]q ! ( [--]x))) @@ -132,7 +116,7 @@ Qed. Lemma flip_coefficient : forall (p : RX) i, nth_coeff i (flip p) [=] [--] ( [--]One[^]i) [*]nth_coeff i p. intro p. elim p. -simpl in |- *. Algebra. +simpl in |- *. algebra. intros c q. intros. elim i. simpl in |- *. rational. intros. simpl in |- *. diff --git a/reals/PosSeq.v b/reals/PosSeq.v new file mode 100644 index 000000000..f695f5a72 --- /dev/null +++ b/reals/PosSeq.v @@ -0,0 +1,126 @@ +Require Export Series. + +Section SeqProperties. + +Definition seq_pos (x : nat -> IR) := forall n : nat, Zero [<] x n. +Definition seq_inf_sum (x : nat -> IR) := +forall M : IR, {N : nat | forall m : nat, N <= m -> M [<] seq_part_sum x m}. + +Lemma One_part_sum : forall (m : nat), seq_part_sum (fun n : nat => One) m [=] nring m. +intros. +induction m; simpl; algebra. +Qed. + +Lemma One_seq_is_pos : seq_pos (fun n : nat => One). +unfold seq_pos. +intros. apply pos_one. +Qed. + +Lemma One_seq_is_inf_sum : seq_inf_sum (fun n : nat => One). +unfold seq_inf_sum. +intros. +assert ({N : nat | M [<] nring N}). +apply Archimedes'. +destruct X as [N H]. +exists N. intros. +apply less_leEq_trans with (nring (R:=IR) N); auto. +assert (seq_part_sum (fun n : nat => One) m [=] nring m). +apply One_part_sum. +astepr (nring (R:=IR) m). +apply nring_leEq. +auto. +Qed. + +Lemma seq_pos_imp_sum_pos : forall (x : nat -> IR), seq_pos x -> forall n, Zero [<] seq_part_sum x (S n). +intros. +induction n. +simpl. + astepl (Zero[+]Zero:IR). + apply plus_resp_less_lft. apply X. + simpl. +simpl in |- *. + apply plus_resp_pos. + apply IHn. + apply X. +Qed. + +Lemma seq_pos_imp_sum_pos' : + forall (x : nat -> IR) (H1 : seq_pos x) (n m : nat) (H2 : m < n), + Zero [<] Sum m n x. +unfold seq_pos. +intros. +induction n. +assert (~ m < 0). auto with arith. contradiction. +elim (le_lt_eq_dec _ _ H2); intros H3. +astepr (Sum m n x [+] x (S n)). +apply plus_resp_pos. +apply IHn; auto with arith. +apply H1. +replace n with m; auto. +astepr (Sum m m x [+]x (S m)). +apply plus_resp_pos. +astepr (x m). +apply H1. +apply H1. +Qed. + +Lemma seq_pos_imp_ap_zero : forall (x : nat -> IR), seq_pos x -> forall n, seq_part_sum x (S n) [#] Zero. +unfold seq_pos. +intros. +apply ap_symmetric_unfolded. +apply less_imp_ap. +apply seq_pos_imp_sum_pos; auto. +Qed. + +Lemma seq_inf_sum_imp_div_small : +forall (x : nat -> IR) (H1 : seq_inf_sum x) (H2: seq_pos x) (C e : IR) +(H4 : Zero [<] e), { N : nat | + forall m : nat, N <= m -> AbsSmall e (C [/](seq_part_sum x (S m)) [//] (seq_pos_imp_ap_zero x H2 m))}. +unfold seq_inf_sum. unfold seq_pos. +intros. +assert ({N : nat | forall m : nat, + N <= m -> ((AbsIR C)[/]e[//]pos_ap_zero IR e H4)[<]seq_part_sum x m}). +apply (H1 ((AbsIR C) [/] e [//] (pos_ap_zero IR e H4))). +destruct X as [N H]. +exists N. +intros. +assert (H3 : ((AbsIR C)[/]e[//]pos_ap_zero IR e H4)[<]seq_part_sum x (S m)). +apply H; auto. +astepr ((C [/] seq_part_sum x (S m)[//] + (seq_pos_imp_ap_zero x H2 m))). +assert (AbsSmall ((seq_part_sum x (S m))[*]e) C). +apply AbsIR_imp_AbsSmall. +apply less_leEq. +apply (shift_less_mult IR (AbsIR C) (seq_part_sum x (S m)) e (pos_ap_zero IR e H4)); auto. +rstepl ((seq_part_sum x (S m))[*]e [/] (seq_part_sum x (S m))[//] + pos_ap_zero IR (seq_part_sum x (S m)) (seq_pos_imp_sum_pos x H2 m)). +rstepr (C [/] (seq_part_sum x (S m))[//] + pos_ap_zero IR (seq_part_sum x (S m)) (seq_pos_imp_sum_pos x H2 m)). +apply div_resp_AbsSmall. +auto. +Qed. + +Lemma seq_inf_sum_ratio_bound : +forall (y : nat->IR) (H2 : seq_pos y) (m N1: nat) (H3: S N1 < m), +AbsSmall One (Sum (G:=IR) (S N1) m (fun k : nat => y k)[/] + seq_part_sum y (S m)[//]seq_pos_imp_ap_zero y H2 m). +intros. +apply leEq_imp_AbsSmall. +apply shift_leEq_div. +apply seq_pos_imp_sum_pos; auto. +astepl (Zero:IR). +apply less_leEq. +apply seq_pos_imp_sum_pos'; auto. +apply shift_div_leEq. +apply seq_pos_imp_sum_pos; auto. +astepl (Sum (G:=IR) (S N1) m y). +astepr (seq_part_sum y (S m)). +unfold Sum. unfold Sum1. unfold seq_part_sum. +apply shift_zero_leEq_minus'. +rstepr (Sum0 (G:=IR) (S N1) y). +apply less_leEq. +astepr (seq_part_sum y (S N1)). +apply seq_pos_imp_sum_pos; auto. +Qed. + +End SeqProperties. diff --git a/reals/Q_dense.v b/reals/Q_dense.v index 167010862..a89590ca4 100644 --- a/reals/Q_dense.v +++ b/reals/Q_dense.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* begin hide *) Require Export Q_in_CReals. @@ -251,12 +235,12 @@ Proof. left. split. assumption. - Algebra. + algebra. intros. right. split. assumption. - Algebra. + algebra. Qed. diff --git a/reals/Q_in_CReals.v b/reals/Q_in_CReals.v index d95958b7f..a71386ee8 100644 --- a/reals/Q_in_CReals.v +++ b/reals/Q_in_CReals.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) (** * On density of the image of [Q] in an arbitrary real number structure @@ -412,13 +396,13 @@ Proof. apply mult_wdr. astepl (zring (R:=R1) (Z_of_nat (nat_of_P d2))). rewrite inject_nat_convert. - Algebra. + algebra. rewrite H2. astepl (zring (R:=R1) n2[*]zring (R:=R1) d1). apply mult_wdr. astepr (zring (R:=R1) (Z_of_nat (nat_of_P d1))). rewrite inject_nat_convert. - Algebra. + algebra. change (inj_Q (Build_Q n1 d1)[~=]inj_Q (Build_Q n2 d2)) in |- *. apply ap_imp_neq. assumption. @@ -463,7 +447,7 @@ Proof. den_is_nonzero (Build_Q (n1 * d2 + n2 * d1)%Z (d1 * d2)%positive))). apply mult_wdl. rewrite nat_of_P_mult_morphism. - Algebra. + algebra. astepr (zring (R:=R1) n1[*]nring (R:=R1) d2[+]zring (R:=R1) n2[*]nring (R:=R1) d1). @@ -471,10 +455,10 @@ Proof. apply bin_op_wd_unfolded. astepr (zring (R:=R1) n1[*]zring (R:=R1) (Z_of_nat (nat_of_P d2))). rewrite inject_nat_convert. - Algebra. + algebra. astepr (zring (R:=R1) n2[*]zring (R:=R1) (Z_of_nat (nat_of_P d1))). rewrite inject_nat_convert. - Algebra. + algebra. rational. Qed. @@ -503,7 +487,7 @@ Proof. apply mult_wdl. rewrite nat_of_P_mult_morphism. - Algebra. + algebra. astepr (zring (R:=R1) n1[*]zring (R:=R1) n2). apply zring_mult. @@ -545,8 +529,8 @@ Proof. apply zring_mult. rewrite inject_nat_convert. apply zring_mult. - Algebra. - Algebra. + algebra. + algebra. Qed. Lemma less_inj_Q : forall q1 q2, (inj_Q q1 [<] inj_Q q2) -> q1 [<] q2. @@ -598,10 +582,10 @@ Proof. apply inj_Q_plus. astepr (inj_Q Zero). apply inj_Q_wd. - Algebra. + algebra. simpl in |- *. rstepl (Zero:R1). - Algebra. + algebra. Qed. Lemma inj_Q_minus : forall q1 q2, inj_Q (q1[-]q2) [=] inj_Q q1[-]inj_Q q2. @@ -636,7 +620,7 @@ Proof. apply inj_Q_plus. astepr (inj_Q Zero). apply inj_Q_wd. - Algebra. + algebra. simpl in |- *. rational. @@ -728,7 +712,7 @@ Proof. apply inj_Q_plus. astepr (inj_Q Zero). apply inj_Q_wd. - Algebra. + algebra. simpl in |- *. rational. @@ -838,7 +822,7 @@ Proof. apply bin_op_wd_unfolded. rational. - Algebra. + algebra. simpl in |- *. apply swap_div with (z_ := Greater_imp_ap _ e Zero H). diff --git a/reals/R_morphism.v b/reals/R_morphism.v index c4a099b70..556a9ca1f 100644 --- a/reals/R_morphism.v +++ b/reals/R_morphism.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* begin hide *) (* In this file a notion of morphism between two arbitrary real number structures, is introduced together with te proofs that this notion of @@ -150,8 +134,8 @@ Proof. apply eq_symmetric_unfolded. apply map_pres_plus_unfolded. apply map_wd_unfolded with (f := f). - Algebra. - Algebra. + algebra. + algebra. Qed. Lemma map_pres_zero_unfolded : forall f : Homomorphism, f Zero[=]Zero. @@ -174,7 +158,7 @@ Proof. astepl (f Zero). apply map_pres_zero_unfolded. apply map_wd_unfolded. - Algebra. + algebra. Qed. Lemma map_pres_minus_unfolded : @@ -224,7 +208,7 @@ Proof. astepl (f (One[*]One)). apply map_pres_mult_unfolded. apply map_wd_unfolded with (f := f). - Algebra. + algebra. Qed. Lemma map_pres_one_unfolded : forall f : Homomorphism, f One[=]One. @@ -500,7 +484,7 @@ Proof. apply eq_symmetric_unfolded. red in H3. apply f_well_def. - Algebra. + algebra. Qed. Lemma f_pres_minus : forall x : R1, f [--]x[=][--](f x). @@ -511,7 +495,7 @@ Proof. astepl (f (x[+][--]x)). astepr (f Zero). apply f_well_def. - Algebra. + algebra. apply f_pres_Zero. Qed. @@ -521,7 +505,7 @@ Proof. intros. astepr (f (x[+][--]y)). apply f_well_def. - Algebra. + algebra. astepr (f x[+][--](f y)). red in H3. astepr (f x[+]f [--]y). @@ -621,7 +605,7 @@ Proof. astepl (f One). astepr (f (One[*]One)). apply f_well_def. - Algebra. + algebra. Qed. Lemma f_pres_inv : diff --git a/reals/RealCount.v b/reals/RealCount.v new file mode 100644 index 000000000..ef3791402 --- /dev/null +++ b/reals/RealCount.v @@ -0,0 +1,317 @@ +Require Export CReals1. + +(* Consider Reals are enumerated by function f *) + +Section IntervalSequence. + +Variable f : nat -> IR. + +Record interv : Type := + {interv_lft : IR; + interv_rht : IR; + interv_lft_rht : interv_lft [<] interv_rht}. + +Lemma interv_0_correct: +f 0[+]One[<]f 0[+]Two. +apply plus_resp_less_lft. +apply one_less_two. +Qed. + +Let interv_0 := (Build_interv (f 0 [+] One) (f 0[+]Two) interv_0_correct). + +(* FIXME: Reuse this code from IVT -----------------------------------*) + +Let Small : IR := Two [/]ThreeNZ. +Let lft (a b : IR) := (Two[*]a[+]b) [/]ThreeNZ. +Let rht (a b : IR) := (a[+]Two[*]b) [/]ThreeNZ. + +Lemma less_pres_lft : forall a b :IR, a[<] b -> a [<] lft a b. +intros. +unfold lft in |- *. +apply shift_less_div. +apply pos_three. +rstepl (Two[*]a[+]a). +apply plus_resp_less_lft. +auto. +Qed. + +Lemma less_pres_rht : forall a b :IR, a[<] b -> rht a b [<] b. +intros. +unfold rht in |- *. +apply shift_div_less. +apply pos_three. +rstepr (b[+]Two[*]b). +apply plus_resp_less_rht. +auto. +Qed. + +Lemma less_pres_lft_rht : forall a b :IR, a[<] b -> lft a b [<] rht a b. +intros. +unfold lft in |- *. unfold rht in |- *. +apply div_resp_less_rht. +rstepl (a[+]b[+]a). +rstepr (a[+]b[+]b). +apply plus_resp_less_lft. +auto. +apply pos_three. +Qed. + +Lemma smaller_rht : forall (a b : IR), rht a b[-]a [=] Small[*] (b[-]a). +intros. +unfold Small in |- *. unfold rht in |- *. +rational. +Qed. + +Lemma smaller_lft : forall (a b : IR), b[-]lft a b [=] Small[*] (b[-]a). +intros. +unfold Small in |- *. unfold lft in |- *. +rational. +Qed. + +Hint Resolve smaller_lft smaller_rht: algebra. + +Lemma small_greater_zero : Zero [<=] Small. +unfold Small. +assert (Zero[<](Two[/]ThreeNZ:IR)). +apply pos_div_three; auto. +apply pos_two; auto. +apply less_leEq; auto. +Qed. + +Lemma small_less_one : Small [<] One. +unfold Small. +apply mult_cancel_less with (Three:IR). +apply pos_three. +astepl (Two:IR). +astepr (Three:IR). +apply two_less_three. +Qed. + +(* -------------------------------------------------------------- *) + + +Definition seq_fun (I : interv) (n:nat) : interv. +intros I n. +case (less_cotransitive_unfolded IR _ _ (less_pres_lft_rht _ _ (interv_lft_rht I)) (f n)). +intro H1. +apply (Build_interv (interv_lft I) (lft (interv_lft I) (interv_rht I))). +apply less_pres_lft. +apply interv_lft_rht. +intro H2. +apply (Build_interv (rht (interv_lft I) (interv_rht I)) (interv_rht I)). +apply less_pres_rht. +apply interv_lft_rht. +Defined. + +Fixpoint seq1 (n:nat):interv := +match n with + 0 => interv_0 +| (S p) => seq_fun (seq1 p) (S p) +end. + +Definition seq1_lft := fun n:nat => interv_lft (seq1 n). +Definition seq1_rht := fun n:nat => interv_rht (seq1 n). + +Lemma next_smaller : forall (I : interv) (n : nat), +seq1_rht (S n)[-]seq1_lft (S n) [<=] +Small [*](seq1_rht n[-]seq1_lft n). +intros. +unfold seq1_lft. unfold seq1_rht. +astepl (interv_rht (seq_fun (seq1 n) (S n))[-]interv_lft (seq_fun (seq1 n) (S n))). +unfold seq_fun. +case (less_cotransitive_unfolded IR _ _ (less_pres_lft_rht _ _ (interv_lft_rht (seq1 n))) (f (S n))). + +intros. +simpl. +apply leEq_transitive with (rht (interv_lft (seq1 n)) (interv_rht (seq1 n))[-]interv_lft (seq1 n)). +apply minus_resp_leEq. +apply less_leEq. +apply less_pres_lft_rht. +apply interv_lft_rht. +apply eq_imp_leEq. +apply smaller_rht. + +intros. +simpl. +apply leEq_transitive with (interv_rht (seq1 n)[-]lft (interv_lft (seq1 n)) (interv_rht (seq1 n))). +apply minus_resp_leEq_rht. +apply less_leEq. +apply less_pres_lft_rht. +apply interv_lft_rht. +apply eq_imp_leEq. +apply smaller_lft. +Qed. + +Lemma intervals_smaller : forall N : nat, +seq1_rht N[-]seq1_lft N [<=]Small[^]N. +intros. +induction N. +astepl ((One[-]Zero):IR). +astepr (One:IR). +astepl (One:IR). +apply leEq_reflexive. +unfold seq1_lft. +unfold seq1_rht. +simpl. +astepr ((Two [-] One):IR); rational. +apply leEq_transitive with (Small[*](seq1_rht N[-]seq1_lft N)); auto. +apply next_smaller; auto. +astepr (Small[*]Small[^]N). +apply mult_resp_leEq_lft; auto. +apply small_greater_zero. +Qed. + +Lemma grow_lft : forall N m : nat, N <= m -> +interv_lft (seq1 N) [<=] interv_lft (seq1 m). +intros. +induction m. destruct N; auto. +apply leEq_reflexive. +assert (S N = 0); auto with arith. +elim H0. +apply leEq_reflexive. +elim H. +apply leEq_reflexive. +clear IHm. clear H. clear m. +intros. +apply leEq_transitive with (interv_lft (seq1 m)); auto. +astepr (interv_lft (seq_fun (seq1 m) (S m))). +unfold seq_fun. +case (less_cotransitive_unfolded IR _ _ (less_pres_lft_rht _ _ (interv_lft_rht (seq1 m))) (f (S m))). +intros. simpl. apply leEq_reflexive. +intros. simpl. +apply less_leEq. +apply less_transitive_unfolded with (lft (interv_lft (seq1 m)) (interv_rht (seq1 m))). +apply less_pres_lft. +apply interv_lft_rht. +apply less_pres_lft_rht. +apply interv_lft_rht. +Qed. + +Lemma grow_rht : forall N m : nat, N <= m -> +interv_rht (seq1 m) [<=] interv_rht (seq1 N). +intros. +induction m. destruct N; auto. +apply leEq_reflexive. +assert (S N = 0); auto with arith. +elim H0. +apply leEq_reflexive. +elim H. +apply leEq_reflexive. +clear IHm. clear H. clear m. +intros. +apply leEq_transitive with (interv_rht (seq1 m)); auto. +astepl (interv_rht (seq_fun (seq1 m) (S m))). +unfold seq_fun. +case (less_cotransitive_unfolded IR _ _ (less_pres_lft_rht _ _ (interv_lft_rht (seq1 m))) (f (S m))). +simpl. intros. +apply less_leEq. +apply less_transitive_unfolded with (rht (interv_lft (seq1 m)) (interv_rht (seq1 m))). +apply less_pres_lft_rht. +apply interv_lft_rht. +apply less_pres_rht. +apply interv_lft_rht. +simpl. intros. +apply leEq_reflexive. +Qed. + +Lemma intervals_embed : forall N m : nat, N <= m -> +AbsSmall (R:=IR) (seq1_rht N[-]seq1_lft N) (seq1_lft m[-]seq1_lft N). +intros. +unfold seq1_rht. unfold seq1_lft. +unfold AbsSmall. split. +apply leEq_transitive with (Zero:IR). +astepr ([--]Zero:IR). +apply inv_resp_leEq. +apply shift_leEq_lft. +apply less_leEq. +apply interv_lft_rht. +apply shift_leEq_lft. +2: apply minus_resp_leEq. +apply grow_lft; auto. +apply leEq_transitive with (interv_rht (seq1 m)). +apply less_leEq. apply interv_lft_rht. +apply grow_rht; auto. +Qed. + +Lemma Cauchy_seq1_lft : Cauchy_prop seq1_lft. +unfold Cauchy_prop in |- *. +intro eps. intros H. +assert ({ N : nat | Small[^]N[<=]eps}). +apply (qi_yields_zero (Two[/]ThreeNZ) small_greater_zero small_less_one eps); auto. +destruct X as [N H1]. +exists N. intros. +apply AbsSmall_leEq_trans with (seq1_rht N[-]seq1_lft N); auto. +apply leEq_transitive with (Small[^]N); auto. +apply intervals_smaller; auto. +apply intervals_embed; auto. +Qed. + +Definition f_lim := Lim (Build_CauchySeq _ seq1_lft Cauchy_seq1_lft). + +Lemma lim_smaller: +forall (n : nat), f_lim [<=] (seq1_rht n). +intros. unfold f_lim. +apply str_seq_leEq_so_Lim_leEq. +exists n. intros. simpl. +unfold seq1_lft. unfold seq1_rht. +apply leEq_transitive with (interv_rht (seq1 i)). +apply less_leEq. apply interv_lft_rht. +apply grow_rht. auto. +Qed. + +Lemma lim_bigger: +forall (n : nat), (seq1_lft n) [<=] f_lim. +intros. +unfold f_lim. +apply str_leEq_seq_so_leEq_Lim. +exists n. intros. simpl. +unfold seq1_lft. unfold seq1_rht. +apply grow_lft; auto. +Qed. + + +Lemma f_n_not_in_int : +forall (n : nat), (f n) [<] (seq1_lft n) or (seq1_rht n) [<] (f n). +intros. +unfold seq1_lft. unfold seq1_rht. +induction n. +simpl. left. +apply less_plusOne. + +cut (f (S n)[<]interv_lft (seq_fun (seq1 n) (S n)) or interv_rht (seq_fun (seq1 n) (S n))[<]f (S n)); auto. +unfold seq_fun. +elim less_cotransitive_unfolded. +intros. +simpl in |- *. +right. +auto. +intros. +simpl in |- *. +left. +auto. +Qed. + +Lemma lim_not_in_ranf : +forall (n : nat), f_lim [#] (f n). +intros. +elim (f_n_not_in_int n); intros. +assert (f n [<] f_lim). +apply less_leEq_trans with (seq1_lft n); auto. +apply lim_bigger. +apply ap_symmetric. +apply less_imp_ap; auto. +assert (f_lim [<] f n). +apply leEq_less_trans with (seq1_rht n); auto. +apply lim_smaller. +apply less_imp_ap; auto. +Qed. + +End IntervalSequence. + +Theorem reals_not_countable : + forall (f : nat -> IR),{x :IR | forall n : nat, x [#] (f n)}. +intros. +exists (f_lim f). +intros. +apply lim_not_in_ranf. +Qed. diff --git a/reals/RealFuncts.v b/reals/RealFuncts.v index 7aea9d3b9..e31d3fe38 100644 --- a/reals/RealFuncts.v +++ b/reals/RealFuncts.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export CReals1. diff --git a/reals/RealLists.v b/reals/RealLists.v index b5082bc7d..4c2013dbf 100644 --- a/reals/RealLists.v +++ b/reals/RealLists.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export CReals1. @@ -80,7 +64,7 @@ intros F l H. induction l as [| a l Hrecl]. apply nil. apply cons. -cut (member a (cons a l)); [ intro | right; Algebra ]; rename X into H0. +cut (member a (cons a l)); [ intro | right; algebra ]; rename X into H0. apply (Part F a (H a H0)). cut (forall y : IR, member y l -> Dom F y); intros; rename X into H0. 2: apply H; left; assumption. @@ -102,7 +86,7 @@ assumption. right. eapply eq_transitive_unfolded. apply H1. -simpl in |- *; apply pfwdef; Algebra. +simpl in |- *; apply pfwdef; algebra. Qed. Lemma map2_pres_member : forall (F : PartIR) x Hx l H, @@ -176,7 +160,7 @@ intro l; induction l as [| a l Hrecl]. clear Hrecl. intro H; induction l as [| a0 l Hrecl]; intros e H0. simpl in |- *; exists a. - right; Algebra. + right; algebra. apply less_leEq; apply shift_minus_less; apply shift_less_plus'. astepl ZeroR; assumption. cut @@ -186,7 +170,7 @@ cut intro H1. elim H1; intro H2. exists a0. - simpl in |- *; left; right; Algebra. + simpl in |- *; left; right; algebra. apply leEq_transitive with (Max a (maxlist (cons a0 l)) [-]e [/]TwoNZ). astepl (Max a (maxlist (cons a0 l)) [-]e). apply shift_leEq_minus; apply shift_plus_leEq'. @@ -212,7 +196,7 @@ elim Hrecl with (e [/]TwoNZ). apply leEq_transitive with (maxlist (cons a l) [-]e [/]TwoNZ). apply minus_resp_leEq; assumption. assumption. - exists a; right; Algebra. + exists a; right; algebra. apply pos_div_two; assumption. Qed. @@ -224,14 +208,14 @@ clear l. do 2 intro. intro H. clear H; induction l as [| a0 l Hrecl]. simpl in |- *; intros H H0. -apply H0; right; Algebra. +apply H0; right; algebra. generalize l a0 Hrecl; clear Hrecl l a0. intros l b; intros. rename X into H0. eapply less_wdl. 2: apply maxlist_aux. astepl (Max b (maxlist (cons a l))). apply Max_less. -apply H0; left; right; Algebra. +apply H0; left; right; algebra. apply Hrecl. simpl in |- *; apply lt_O_Sn. intros y H1. apply H0. @@ -248,14 +232,14 @@ clear l. do 3 intro. clear H; induction l as [| a0 l Hrecl]. simpl in |- *; intros. -apply H0; right; Algebra. +apply H0; right; algebra. generalize l a0 Hrecl; clear Hrecl l a0. intros l b; intros. eapply leEq_wdl. 2: apply maxlist_aux. astepl (Max b (maxlist (cons a l))). apply Max_leEq. -apply H0; left; right; Algebra. +apply H0; left; right; algebra. apply Hrecl. simpl in |- *; auto with arith. intros x H1. apply H0. @@ -324,7 +308,7 @@ intro l; induction l as [| a l Hrecl]. clear Hrecl. intro H; induction l as [| a0 l Hrecl]; intros e He. simpl in |- *; exists a. - right; Algebra. + right; algebra. apply less_leEq; apply shift_less_plus'. astepl ZeroR; assumption. cut @@ -334,7 +318,7 @@ cut intro H1. elim H1; intro H2. exists a0. - simpl in |- *; left; right; Algebra. + simpl in |- *; left; right; algebra. apply leEq_transitive with (Min a (minlist (cons a0 l)) [+]e [/]TwoNZ). apply shift_leEq_plus. astepr (minlist (cons a (cons a0 l))). @@ -359,7 +343,7 @@ elim Hrecl with (e [/]TwoNZ). apply leEq_transitive with (minlist (cons a l) [+]e [/]TwoNZ). assumption. apply plus_resp_leEq; assumption. - exists a; right; Algebra. + exists a; right; algebra. apply pos_div_two; assumption. Qed. @@ -371,14 +355,14 @@ clear l. do 2 intro. intro H. clear H; induction l as [| a0 l Hrecl]. simpl in |- *; intros H H0. -apply H0; right; Algebra. +apply H0; right; algebra. generalize l a0 Hrecl; clear Hrecl l a0. intros l b; intros. rename X into H0. eapply less_wdr. 2: apply minlist_aux. astepr (Min b (minlist (cons a l))). apply less_Min. -apply H0; left; right; Algebra. +apply H0; left; right; algebra. apply Hrecl. simpl in |- *; auto with arith. intros y H1; apply H0. @@ -395,14 +379,14 @@ clear l. do 3 intro. clear H; induction l as [| a0 l Hrecl]. simpl in |- *; intros. -apply H0; right; Algebra. +apply H0; right; algebra. generalize l a0 Hrecl; clear Hrecl l a0. intros l b; intros. eapply leEq_wdr. 2: apply minlist_aux. astepr (Min b (minlist (cons a l))). apply leEq_Min. -apply H0; left; right; Algebra. +apply H0; left; right; algebra. apply Hrecl. simpl in |- *; auto with arith. intros y H1; apply H0. diff --git a/reals/Series.v b/reals/Series.v index 1dd858044..ebfc03a14 100644 --- a/reals/Series.v +++ b/reals/Series.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) (** printing seq_part_sum %\ensuremath{\sum^n}% #∑n# *) @@ -53,7 +37,7 @@ elim (le_lt_eq_dec _ _ H0); intro. unfold seq_part_sum in |- *. unfold Sum, Sum1 in |- *. rewrite <- S_pred with n 0; auto. -Algebra. +algebra. rewrite b. astepl ZeroR. apply eq_symmetric_unfolded; apply Sum_empty. @@ -246,7 +230,7 @@ apply less_leEq; auto. apply nexp_resp_nonneg; auto. astepl ( [--] (c[^]m[/] _[//]H) [+] (One[/] _[//]H) [-] (One[/] _[//]H)). apply cg_minus_wd. -2: Algebra. +2: algebra. cut (c[-]One [#] Zero). intros H2. apply eq_symmetric_unfolded; eapply eq_transitive_unfolded. apply Sum0_c_exp with (H := H2). @@ -301,7 +285,7 @@ eapply AbsSmall_wdr_unfolded. apply zero_AbsSmall; apply less_leEq; assumption. unfold seq_part_sum in |- *. induction m as [| m Hrecm]. -simpl in |- *; Algebra. +simpl in |- *; algebra. simpl in |- *. eapply eq_transitive_unfolded. apply Hrecm; auto with arith. @@ -319,7 +303,7 @@ eapply AbsSmall_wdr_unfolded. apply zero_AbsSmall; apply less_leEq; assumption. unfold seq_part_sum in |- *. induction m as [| m Hrecm]. -simpl in |- *; Algebra. +simpl in |- *; algebra. simpl in |- *. eapply eq_transitive_unfolded. apply Hrecm; auto with arith. @@ -401,7 +385,7 @@ apply eq_symmetric_unfolded; unfold cg_minus in |- *. eapply eq_transitive_unfolded. apply Sum0_plus_Sum0 with (g := fun n : nat => [--] (y n)). apply bin_op_wd_unfolded. -Algebra. +algebra. apply inv_Sum0. Qed. @@ -418,7 +402,7 @@ unfold cg_minus in |- *. eapply eq_transitive_unfolded. apply Sum0_plus_Sum0 with (g := fun n : nat => [--] (y n)). apply bin_op_wd_unfolded. -Algebra. +algebra. apply inv_Sum0. Qed. @@ -477,9 +461,9 @@ unfold seq_part_sum in |- *. intro. apply eq_symmetric_unfolded; apply eq_transitive_unfolded with (Zero[+]Sum0 n (fun n : nat => [--] (x n))). -Algebra. +algebra. unfold cg_minus in |- *; apply bin_op_wd_unfolded. -Algebra. +algebra. apply inv_Sum0. Qed. @@ -494,7 +478,7 @@ apply with (y := fun n : nat => y n[-]x n) (convY := conv_series_minus _ _ H0 convX). -intro; unfold y in |- *; simpl in |- *; Algebra. +intro; unfold y in |- *; simpl in |- *; algebra. cut (series_sum y H0 [=] Zero); intros. astepr (Zero[-]series_sum x convX). astepr (series_sum y H0[-]series_sum x convX). @@ -551,7 +535,7 @@ exists (max n N). intros. apply AbsSmall_wdr_unfolded with (x m[-]c). apply HN; apply le_trans with (max n N); auto with arith. -apply cg_minus_wd; [ apply Hn | Algebra ]. +apply cg_minus_wd; [ apply Hn | algebra ]. apply le_trans with (max n N); auto with arith. Qed. @@ -743,12 +727,12 @@ unfold seq_part_sum in |- *. apply eq_transitive_unfolded with (Sum (S (max N M) + k) (pred (m + k)) y). unfold Sum, Sum1 in |- *. rewrite <- S_pred with (m := 0). -Algebra. +algebra. apply lt_le_trans with (S (max N M)); auto with arith. astepr (Sum (S (max N M)) (pred m) x). 2: unfold Sum, Sum1 in |- *. 2: rewrite <- S_pred with (m := 0). -2: Algebra. +2: algebra. 2: apply lt_le_trans with (S (max N M)); auto with arith. replace (pred (m + k)) with (pred m + k). apply eq_symmetric_unfolded; apply Sum_big_shift. @@ -794,12 +778,12 @@ apply eq_transitive_unfolded with (Sum (S (max N M + k) - k) (pred (m - k)) x). unfold Sum, Sum1 in |- *. rewrite <- S_pred with (m := 0). -Algebra. +algebra. omega. astepr (Sum (S (max N M + k)) (pred m) y). 2: unfold Sum, Sum1 in |- *. 2: rewrite <- S_pred with (m := 0). -2: Algebra. +2: algebra. 2: omega. replace (pred m) with (pred (m - k) + k). 2: omega. @@ -840,13 +824,13 @@ exists N. exists 0. intro. rewrite plus_comm; rewrite Minus.minus_plus. -Algebra. +algebra. simple induction n. intro. cut (N = 0); [ intro | auto with arith ]. rewrite H1. apply eq_imp_leEq. -simpl in |- *; Algebra. +simpl in |- *; algebra. clear n; intros. cut ({N < S n} + {N = S n}). 2: apply le_lt_eq_dec; assumption. @@ -863,7 +847,7 @@ auto with arith. rewrite H3. rewrite <- minus_n_n. apply eq_imp_leEq. -simpl in |- *; Algebra. +simpl in |- *; algebra. Qed. Lemma ratio_test_div : {N : nat | @@ -896,7 +880,7 @@ induction n as [| n Hrecn]. inversion H. clear Hrecn; induction n as [| n Hrecn]. inversion H. -rewrite <- H1; apply eq_imp_leEq; Algebra. +rewrite <- H1; apply eq_imp_leEq; algebra. inversion H1. elim (le_lt_eq_dec _ _ H); intro. apply leEq_transitive with (AbsIR (x (S n))). @@ -906,7 +890,7 @@ astepl (One[*]AbsIR (x (S n))); apply mult_resp_leEq_rht. assumption. apply AbsIR_nonneg. apply Hn; auto with arith. -rewrite b; apply eq_imp_leEq; Algebra. +rewrite b; apply eq_imp_leEq; algebra. Qed. End More_CC. @@ -1341,7 +1325,7 @@ apply eq_symmetric_unfolded. apply eq_transitive_unfolded with (AbsIR (One[/] _[//]Greater_imp_ap IR _ _ (pos_nring_S _ (m + m)))). -apply AbsIR_wd; Algebra. +apply AbsIR_wd; algebra. apply AbsIR_eq_x; apply less_leEq. apply recip_resp_pos; apply pos_nring_S. intros. diff --git a/reals/iso_CReals.v b/reals/iso_CReals.v index 614dbfaa5..f3ac563c2 100644 --- a/reals/iso_CReals.v +++ b/reals/iso_CReals.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* begin hide *) (* in this file the concrete canonical isomorphism -in te sense of R_morphisms.v - between two arbitrary model of real numbers is built *) diff --git a/tactics/.cvsignore b/tactics/.cvsignore deleted file mode 100644 index 6e857ea2a..000000000 --- a/tactics/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -*.cm[iox] diff --git a/tactics/AlgReflection.v b/tactics/AlgReflection.v index f78f924ab..b766aaeed 100644 --- a/tactics/AlgReflection.v +++ b/tactics/AlgReflection.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) (* begin hide *) @@ -433,4 +417,71 @@ auto. apply eq_nat_corr. assumption. Qed. End Correctness_Results. + +Ltac ClosedNat t := +match t with +| O => constr:true +| (S ?n) => ClosedNat n +| _ => constr:false +end. + +Ltac ClosedPositive t := +match t with +| xH => constr:true +| (xI ?n) => ClosedPositive n +| (xO ?n) => ClosedPositive n +| _ => constr:false +end. + +Ltac ClosedZ t := +match t with +| Z0 => constr:true +| (Zpos ?n) => ClosedPositive n +| (Zneg ?n) => ClosedPositive n +| _ => constr:false +end. + +(*To prevent universe inconsitencies, we need lists at a higher +type level than the one provided in algebra/ListType *) + +Section MetaList. + +Variable A : Type. + +Inductive metalist : Type := + | Mnil : metalist + | Mcons : A -> metalist -> metalist. + +Fixpoint Mnth (n:nat) (l:metalist) (default:A) {struct l} : A := + match n, l with + | O, Mcons x l' => x + | O, other => default + | S m, Mnil => default + | S m, Mcons x t => Mnth m t default + end. + +End MetaList. +Implicit Arguments Mcons [A]. +Implicit Arguments Mnth [A]. + +Ltac FindIndex t l := +match l with +| (Mcons ?x ?xs) => + match x with + | t => constr:O + | _ => let n := FindIndex t xs in constr:(S n) + end +end. + +(*To prevent universe inconsitencies, we define quadruple, +rather than using the ProdT multiple times *) + +Section Quadruple. +Variable A B C D: Type. + +Inductive quadruple : Type := + Quad : A -> B -> C -> D -> quadruple. +End Quadruple. +Implicit Arguments Quad [A B C D]. + (* end hide *) diff --git a/tactics/DiffTactics1.v b/tactics/DiffTactics1.v index a966d005c..785f6d98c 100644 --- a/tactics/DiffTactics1.v +++ b/tactics/DiffTactics1.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* begin hide *) Ltac Contin := auto with continuous included. Ltac Deriv := eauto with derivate continuous included. diff --git a/tactics/DiffTactics2.v b/tactics/DiffTactics2.v index 247d3d1af..0e0533213 100644 --- a/tactics/DiffTactics2.v +++ b/tactics/DiffTactics2.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) (* begin hide *) diff --git a/tactics/DiffTactics3.v b/tactics/DiffTactics3.v index 179430349..41f719ab1 100644 --- a/tactics/DiffTactics3.v +++ b/tactics/DiffTactics3.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) (* begin hide *) diff --git a/tactics/FieldReflection.v b/tactics/FieldReflection.v index 487bc8dd6..985410b60 100644 --- a/tactics/FieldReflection.v +++ b/tactics/FieldReflection.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) (* begin hide *) @@ -105,50 +89,50 @@ Lemma xexprF2interpF : forall (x:F) (e:xexprF x), interpF (xforgetF _ e) x. intros x e. induction e. -apply (interpF_var i); Algebra. +apply (interpF_var i); algebra. -apply (interpF_int k); Algebra. +apply (interpF_int k); algebra. -apply (interpF_plus (xforgetF _ e1) (xforgetF _ e2) x y (x[+]y)); Algebra. +apply (interpF_plus (xforgetF _ e1) (xforgetF _ e2) x y (x[+]y)); algebra. -apply (interpF_mult (xforgetF _ e1) (xforgetF _ e2) x y (x[*]y)); Algebra. +apply (interpF_mult (xforgetF _ e1) (xforgetF _ e2) x y (x[*]y)); algebra. -apply (interpF_unop (xforgetF _ e) f x (unop f x)); Algebra. +apply (interpF_unop (xforgetF _ e) f x (unop f x)); algebra. apply (interpF_binop (xforgetF _ e1) (xforgetF _ e2) f x y (binop f x y)); - Algebra. + algebra. eapply (interpF_part (xforgetF _ e) f x (pfun f x Hx)). apply eq_reflexive_unfolded. -Algebra. +algebra. apply (interpF_div (xforgetF _ e1) (xforgetF _ e2) x y (x[/]y[//]nzy) nzy); - Algebra. + algebra. -apply (interpF_int 0); Algebra. +apply (interpF_int 0); algebra. apply (interpF_int 1); Step_final (One:F). -apply (interpF_int (Z_of_nat n)); Algebra. +apply (interpF_int (Z_of_nat n)); algebra. apply (interpF_mult (xforgetF _ e) (expr_int (-1)) x (zring (-1)) [--]x); auto. Step_final (zring (-1)[*]x). -apply (interpF_int (-1)); Algebra. +apply (interpF_int (-1)); algebra. apply (interpF_plus (xforgetF _ e1) (xforgetF _ (xexprF_inv _ e2)) x [--]y (x[-]y)); - Algebra. + algebra. apply (interpF_mult (xforgetF _ e2) (expr_int (-1)) y (zring (-1)) [--]y); auto. Step_final (zring (-1)[*]y). -apply (interpF_int (-1)); Algebra. +apply (interpF_int (-1)); algebra. induction n. apply (interpF_int 1); Step_final (One:F). apply (interpF_mult (xforgetF _ e) (expr_power n (xforgetF _ e)) x ( - x[^]n) (x[^]S n)); Algebra. + x[^]n) (x[^]S n)); algebra. Qed. Definition xexprF_diagram_commutes : @@ -242,7 +226,7 @@ Qed. Lemma interpF_wd : forall (e:expr) (x y:F), interpF e x -> (x[=]y) -> interpF e y. intros e x y H H0. -inversion H; try (rewrite <- H2; rewrite H3 in H1). (* Compat 8.0 *) +inversion H; rewrite <- H2; rewrite H3 in H1. apply interpF_var. Step_final x. apply interpF_int. Step_final x. apply interpF_plus with x0 y0; auto. Step_final x. @@ -304,18 +288,18 @@ simple induction z0; simpl in |- *; auto. simple induction z; simpl in |- *; auto. simple induction z; simpl in |- *; auto. simple induction z; simpl in |- *; auto. -intros; apply interpF_mult with x y; Algebra. +intros; apply interpF_mult with x y; algebra. intros; apply interpF_wd with (zring (i * j):F). -apply interpF_int; Algebra. +apply interpF_int; algebra. inversion X. inversion X0. Step_final (zring i[*]zring j:F). -intros. inversion X0. try (rewrite H in X2; rewrite H1 in X3; rewrite H0 in H2). (* compat 8.0 *) -apply interpF_wd with (x0[*](y0[*]y)); Algebra. -apply interpF_mult with x0 (y0[*]y); Algebra. +intros. inversion X0. rewrite H in X2. rewrite H1 in X3. rewrite H0 in H2. +apply interpF_wd with (x0[*](y0[*]y)); algebra. +apply interpF_mult with x0 (y0[*]y); algebra. Step_final (x0[*]y0[*]y). -intros. inversion X. try (rewrite H in H0; rewrite H1 in H0). (* compat 8.0 *) +intros. inversion X. rewrite H in H0. rewrite H1 in H0. apply interpF_wd with (zring 0:F). -apply interpF_int; Algebra. +apply interpF_int; algebra. astepl (Zero:F). astepl (x[*]Zero). Step_final (x[*]zring 0). @@ -371,17 +355,17 @@ intros n e0 H3 e1 H4 f. elim f; simpl in |- *; auto. intros n e0 H3 f. elim f; simpl in |- *; auto. -intros; apply interpF_mult with x y; Algebra. -intros; apply interpF_wd with (y[*]x); Algebra. -apply interpF_mult with y x; Algebra. +intros; apply interpF_mult with x y; algebra. +intros; apply interpF_wd with (y[*]x); algebra. +apply interpF_mult with y x; algebra. intros; apply interpF_wd with (y[*]One[*]x). apply MI_mult_corr_F; auto. -apply interpF_mult with y (One:F); Algebra. -apply (interpF_int F val unop binop pfun 1); Algebra. +apply interpF_mult with y (One:F); algebra. +apply (interpF_int F val unop binop pfun 1); algebra. Step_final (x[*](y[*]One)). -intros. inversion X0. try (rewrite H0 in H2; rewrite H in X2; rewrite H1 in X3). (* compat 8.0 *) +intros. inversion X0. rewrite H0 in H2. rewrite H in X2. rewrite H1 in X3. apply interpF_wd with (x0[*](y0[*]y)). -apply interpF_mult with x0 (y0[*]y); Algebra. +apply interpF_mult with x0 (y0[*]y); algebra. Step_final (x0[*]y0[*]y). Qed. Transparent MI_mult. @@ -401,10 +385,10 @@ cut (forall (e f:expr) (x y:F), II e x -> II f y -> II (expr_mult e f) (x[*]y)). intros H H0 H1 e. elim e; intros; simpl in |- *; auto. -intros; apply interpF_mult with x y; Algebra. -intros; apply interpF_wd with (y[*]x); Algebra. +intros; apply interpF_mult with x y; algebra. +intros; apply interpF_wd with (y[*]x); algebra. apply MI_mult_corr_F; auto. -intros. inversion X0. try (rewrite H in X2; rewrite H1 in X3; rewrite H0 in H2). (* compat 8.0 *) +intros. inversion X0. rewrite H in X2. rewrite H1 in X3. rewrite H0 in H2. apply interpF_wd with (y0[*]y[*]x0). apply MV_mult_corr_F; auto. astepl (x0[*](y0[*]y)). @@ -433,8 +417,8 @@ elim f1; simpl in |- *; auto. intro m. cut (eq_nat n m = true -> n = m). elim (eq_nat n m); simpl in |- *; auto. -intros. inversion X. try (rewrite H6 in X1; rewrite H8 in X2; rewrite H7 in H9). (* compat 8.0 *) -inversion X0. try (rewrite H10 in X3; rewrite H12 in X4; rewrite H11 in H13). (* compat 8.0 *) +intros. inversion X. rewrite H6 in X1. rewrite H8 in X2. rewrite H7 in H9. +inversion X0. rewrite H10 in X3. rewrite H12 in X4. rewrite H11 in H13. apply interpF_wd with ((y0[+]y1)[*]x0). apply MV_mult_corr_F; auto. astepl (x0[*](y0[+]y1)). @@ -455,14 +439,14 @@ cut (andb (eq_nat u u0) (eq_expr e0 e5) = true -> u = u0). cut (andb (eq_nat u u0) (eq_expr e0 e5) = true -> e0 = e5). elim andb; simpl in |- *; auto. intros H' H''. intros. -inversion X. try (rewrite H7 in X1; rewrite H9 in X2; rewrite H8 in H10). (* compat 8.0 *) -inversion X0. try (rewrite H11 in X3; rewrite H13 in X4; rewrite H12 in H14). (* compat 8.0 *) +inversion X. rewrite <- H7. rewrite H9 in X2. rewrite H8 in H10. +inversion X0. rewrite H11 in X3. rewrite H13 in X4. rewrite H12 in H14. apply interpF_wd with ((y0[+]y1)[*]x0). apply MV_mult_corr_F; auto. astepr (x0[*]y0[+]x1[*]y1). astepl (y0[*]x0[+]y1[*]x0). -apply bin_op_wd_unfolded. Algebra. astepr (y1[*]x1). apply mult_wdr. +apply bin_op_wd_unfolded. algebra. astepr (y1[*]x1). apply mult_wdr. apply refl_interpF with val unop binop pfun (expr_unop u e0). -auto. rewrite H'. rewrite H''. auto. auto. auto. +rewrite <- H7; auto. rewrite H'. rewrite H''. auto. auto. auto. intro. elim (andb_prop _ _ H7); intros. apply eq_expr_corr; auto. intro. elim (andb_prop _ _ H7); intros. apply eq_nat_corr; auto. @@ -479,14 +463,14 @@ cut (andb (eq_nat u u0) (andb (eq_expr e0 e6) (eq_expr e3 e7)) = true -> e3 = e7). elim andb; simpl in |- *; auto. intros H' H'' H'''. intros. -inversion X. try (rewrite H9 in X1; rewrite H11 in X2; rewrite H10 in H12). (* compat 8.0 *) -inversion X0. try (rewrite H13 in X3; rewrite H15 in X4; rewrite H14 in H16). (* compat 8.0 *) +inversion X. rewrite <- H9. rewrite H11 in X2. rewrite H10 in H12. +inversion X0. rewrite H13 in X3. rewrite H15 in X4. rewrite H14 in H16. apply interpF_wd with ((y0[+]y1)[*]x0). apply MV_mult_corr_F; auto. astepr (x0[*]y0[+]x1[*]y1). astepl (y0[*]x0[+]y1[*]x0). -apply bin_op_wd_unfolded. Algebra. astepr (y1[*]x1). apply mult_wdr. +apply bin_op_wd_unfolded. algebra. astepr (y1[*]x1). apply mult_wdr. apply refl_interpF with val unop binop pfun (expr_binop u e0 e3). -auto. rewrite H'. rewrite H''. rewrite H'''. auto. auto. auto. +rewrite <- H9; auto. rewrite H'. rewrite H''. rewrite H'''. auto. auto. auto. auto. intro. elim (andb_prop _ _ H9); intros. elim (andb_prop _ _ H11); intros. apply eq_expr_corr; auto. @@ -504,14 +488,14 @@ cut (andb (eq_nat f f1) (eq_expr e0 e5) = true -> f = f1). cut (andb (eq_nat f f1) (eq_expr e0 e5) = true -> e0 = e5). elim (andb (eq_nat f f1) (eq_expr e0 e5)); simpl in |- *; auto. intros. -inversion X. try (rewrite H9 in X1; rewrite H11 in X2; rewrite H10 in H12). (* compat 8.0 *) -inversion X0. try (rewrite H13 in X3; rewrite H15 in X4; rewrite H14 in H16). (* compat 8.0 *) +inversion X. rewrite <- H9. rewrite H11 in X2. rewrite H10 in H12. +inversion X0. rewrite H13 in X3. rewrite H15 in X4. rewrite H14 in H16. apply interpF_wd with ((y0[+]y1)[*]x0). apply MV_mult_corr_F; auto. astepr (x0[*]y0[+]x1[*]y1). astepl (y0[*]x0[+]y1[*]x0). -apply bin_op_wd_unfolded. Algebra. astepr (y1[*]x1). apply mult_wdr. +apply bin_op_wd_unfolded. algebra. astepr (y1[*]x1). apply mult_wdr. apply refl_interpF with val unop binop pfun (expr_part f e0). -auto. rewrite H7. rewrite H8; auto. auto. +rewrite <- H9; auto. rewrite H7. rewrite H8; auto. auto. intro. elim (andb_prop _ _ H7); intros. apply eq_expr_corr; auto. intro. elim (andb_prop _ _ H7); intros. apply eq_nat_corr; auto. simpl in |- *; auto. @@ -523,11 +507,11 @@ elim f; simpl in |- *; auto. intros u e0 H1 f. elim f; simpl in |- *; auto. -intros; apply interpF_plus with x y; Algebra. -intros. inversion X. try (rewrite H1 in H0; rewrite H in H0). (* compat 8.0 *) -inversion X0. try (rewrite H2 in H3; rewrite H4 in H3). (* compat 8.0 *) +intros; apply interpF_plus with x y; algebra. +intros. inversion X. rewrite H1 in H0. rewrite H in H0. +inversion X0. rewrite H2 in H3. rewrite H4 in H3. apply interpF_wd with (zring (i + j):F). -apply interpF_int; Algebra. +apply interpF_int; algebra. Step_final (zring i[+]zring j:F). Qed. Transparent MV_mult. @@ -561,19 +545,19 @@ simpl in |- *; auto. simpl in |- *; auto. simpl in |- *; auto. simpl in |- *; auto. -intros; apply interpF_wd with (y[+]x); Algebra. -apply interpF_plus with y x; Algebra. -intros; apply interpF_plus with x y; Algebra. +intros; apply interpF_wd with (y[+]x); algebra. +apply interpF_plus with y x; algebra. +intros; apply interpF_plus with x y; algebra. intros; apply MM_plus_corr_F; auto. -intros. inversion X0. try (rewrite H in X2; rewrite H1 in X3; rewrite H0 in H2). (* compat 8.0 *) +intros. inversion X0. rewrite H in X2. rewrite H1 in X3. rewrite H0 in H2. apply interpF_wd with (y0[+](x0[+]y)). apply X; auto. apply MM_plus_corr_F; auto. astepl (y0[+]x0[+]y). Step_final (x0[+]y0[+]y). -intros. inversion X0. try (rewrite H in X2; rewrite H1 in X3; rewrite H0 in H2). (* compat 8.0 *) +intros. inversion X0. rewrite H in X2. rewrite H1 in X3. rewrite H0 in H2. apply interpF_wd with (x0[+](y0[+]y)). -apply interpF_plus with x0 (y0[+]y); Algebra. +apply interpF_plus with x0 (y0[+]y); algebra. Step_final (x0[+]y0[+]y). Qed. Transparent MM_plus. @@ -593,10 +577,10 @@ cut (forall (e f:expr) (x y:F), II e x -> II f y -> II (expr_plus e f) (x[+]y)). intros H H0 H1 e. elim e; intros; simpl in |- *; auto. -intros. apply interpF_plus with x y; Algebra. -intros. apply interpF_wd with (y[+]x); Algebra. +intros. apply interpF_plus with x y; algebra. +intros. apply interpF_wd with (y[+]x); algebra. apply PM_plus_corr_F; auto. -intros. inversion X0. try (rewrite H in X2; rewrite H1 in X3; rewrite H0 in H2). (* compat 8.0 *) +intros. inversion X0. rewrite H in X2. rewrite H1 in X3. rewrite H0 in H2. apply interpF_wd with (y0[+]y[+]x0). apply PM_plus_corr_F; auto. astepl (x0[+](y0[+]y)). @@ -620,14 +604,14 @@ cut (forall (e f:expr) (x y:F), II e x -> II f y -> II (expr_mult e f) (x[*]y)). intros H H0 H1 e. elim e; intros; simpl in |- *; auto. -intros. apply interpF_mult with x y; Algebra. +intros. apply interpF_mult with x y; algebra. intros. apply interpF_wd with (zring 0[+]y[*]x). apply PM_plus_corr_F. -apply interpF_int; Algebra. +apply interpF_int; algebra. apply MI_mult_corr_F; auto. astepl (Zero[+]y[*]x). Step_final (y[*]x). -intros. inversion X0. try (rewrite H in X2; rewrite H1 in X3; rewrite H0 in H2). (* compat 8.0 *) +intros. inversion X0. rewrite H in X2. rewrite H1 in X3. rewrite H0 in H2. apply interpF_wd with (y0[*]y[+]x0[*]y). apply PM_plus_corr_F; auto. apply MM_mult_corr_F; auto. @@ -650,10 +634,10 @@ cut (forall (e f:expr) (x y:F), II e x -> II f y -> II (expr_mult e f) (x[*]y)). intros H H0 H1 e. elim e; intros; simpl in |- *; auto. -intros. apply interpF_mult with x y; Algebra. -intros. apply interpF_wd with (y[*]x); Algebra. +intros. apply interpF_mult with x y; algebra. +intros. apply interpF_wd with (y[*]x); algebra. apply PM_mult_corr_F; auto. -intros. inversion X0. try (rewrite H in X2; rewrite H1 in X3; rewrite H0 in H2). (* compat 8.0 *) +intros. inversion X0. rewrite H in X2. rewrite H1 in X3. rewrite H0 in H2. apply interpF_wd with (y[*]x0[+]y0[*]y). apply PP_plus_corr_F; auto. apply PM_mult_corr_F; auto. @@ -674,9 +658,9 @@ cut (forall (e f:expr) (x y:F), II e x -> II f y -> II (expr_plus e f) (x[+]y)). intros H H0 e f. elim e; elim f; intros; simpl in |- *; auto. -intros. apply interpF_plus with x y; Algebra. -intros. inversion X. try (rewrite H in X1; rewrite H1 in X2; rewrite H0 in H2). (* compat 8.0 *) -inversion X0. try (rewrite H3 in X3; rewrite H5 in X4; rewrite H4 in H6). (* compat 8.0 *) +intros. apply interpF_plus with x y; algebra. +intros. inversion X. rewrite H in X1. rewrite H1 in X2. rewrite H0 in H2. +inversion X0. rewrite H3 in X3. rewrite H5 in X4. rewrite H4 in H6. cut (y0[*]y1[#]Zero). intro H13. apply interpF_div with (x0[*]y1[+]y0[*]x1) (y0[*]y1) H13; auto. astepl ((x0[*]y1[/] y0[*]y1[//]H13)[+](y0[*]x1[/] y0[*]y1[//]H13)). @@ -703,9 +687,9 @@ cut (forall (e f:expr) (x y:F), II e x -> II f y -> II (expr_mult e f) (x[*]y)). intros H H0 e f. elim e; elim f; intros; simpl in |- *; auto. -intros. apply interpF_mult with x y; Algebra. -intros. inversion X. try (rewrite H in X1; rewrite H1 in X2; rewrite H0 in H2). (* compat 8.0 *) -inversion X0. try (rewrite H3 in X3; rewrite H5 in X4; rewrite H4 in H6). (* compat 8.0 *) +intros. apply interpF_mult with x y; algebra. +intros. inversion X. rewrite H in X1. rewrite H1 in X2. rewrite H0 in H2. +inversion X0. rewrite H3 in X3. rewrite H5 in X4. rewrite H4 in H6. cut (y0[*]y1[#]Zero). intro H13. apply interpF_div with (x0[*]x1) (y0[*]y1) H13. Step_final ((x0[/] y0[//]nzy)[*](x1[/] y1[//]nzy0)). @@ -728,9 +712,9 @@ cut II e x -> II f y -> II (expr_div e f) (x[/]y[//]nzy)). intros H H0 e f. elim e; elim f; intros; simpl in |- *; auto. -intros. apply interpF_div with x y nzy; Algebra. -intros. inversion X. try (rewrite H in X1; rewrite H1 in X2; rewrite H0 in H2). (* compat 8.0 *) -inversion X0. try (rewrite H3 in X3; rewrite H5 in X4; rewrite H4 in H6). (* compat 8.0 *) +intros. apply interpF_div with x y nzy; algebra. +intros. inversion X. rewrite H in X1. rewrite H1 in X2. rewrite H0 in H2. +inversion X0. rewrite H3 in X3. rewrite H5 in X4. rewrite H4 in H6. cut (x1[#]Zero). intro nzx1. cut (y0[*]x1[#]Zero). intro H13. cut ((x1[/]y1[//]nzy1)[#]Zero). intro H14. @@ -754,91 +738,89 @@ apply (interpF_div F val unop binop pfun (expr_plus (expr_mult (expr_var v) expr_one) expr_zero) expr_one x (One:F) x (ring_non_triv F)). -Algebra. +algebra. apply (interpF_plus F val unop binop pfun (expr_mult (expr_var v) expr_one) expr_zero x (Zero:F) x). -Algebra. +algebra. apply (interpF_mult F val unop binop pfun (expr_var v) expr_one x (One:F) x); - Algebra. -apply (interpF_int F val unop binop pfun 1); Algebra. -apply (interpF_int F val unop binop pfun 0); Algebra. -apply (interpF_int F val unop binop pfun 1); Algebra. + algebra. +apply (interpF_int F val unop binop pfun 1); algebra. +apply (interpF_int F val unop binop pfun 0); algebra. +apply (interpF_int F val unop binop pfun 1); algebra. apply (interpF_div F val unop binop pfun (expr_int z) expr_one x ( One:F) x (ring_non_triv F)). -Algebra. Algebra. apply (interpF_int F val unop binop pfun 1); Algebra. +algebra. algebra. apply (interpF_int F val unop binop pfun 1); algebra. -inversion X1. try (rewrite H in X2; rewrite H1 in X3; rewrite H0 in H2). (* compat 8.0 *) +inversion X1. rewrite H in X2. rewrite H1 in X3. rewrite H0 in H2. apply interpF_wd with (x0[+]y). apply FF_plus_corr_F; auto. auto. -inversion X1. try (rewrite H in X2; rewrite H1 in X3; rewrite H0 in H2). (* compat 8.0 *) +inversion X1. rewrite H in X2. rewrite H1 in X3. rewrite H0 in H2. apply interpF_wd with (x0[*]y). apply FF_mult_corr_F; auto. auto. -inversion X1. try (rewrite H in X2; rewrite H1 in X3; rewrite H0 in H2). (* compat 8.0 *) +inversion X1. rewrite H in X2. rewrite H1 in X3. rewrite H0 in H2. apply interpF_wd with (x0[/]y[//]nzy). apply FF_div_corr_F; auto. auto. -inversion X0. try (rewrite H in H2; rewrite H1 in X1; rewrite H0 in H2). (* compat 8.0 *) +inversion X0. rewrite H in H2. rewrite H1 in X1. rewrite H0 in H2. apply (interpF_div F val unop binop pfun (expr_plus (expr_mult (expr_unop u (NormF e0)) expr_one) expr_zero) expr_one x (One:F) x (ring_non_triv F)). -Algebra. +algebra. apply (interpF_plus F val unop binop pfun (expr_mult (expr_unop u (NormF e0)) expr_one) expr_zero x ( Zero:F) x). -Algebra. +algebra. apply (interpF_mult F val unop binop pfun (expr_unop u (NormF e0)) expr_one x - (One:F) x); Algebra. -apply (interpF_unop F val unop binop pfun (NormF e0) u x0); Algebra. -apply (interpF_int F val unop binop pfun 1); Algebra. -apply (interpF_int F val unop binop pfun 0); Algebra. -apply (interpF_int F val unop binop pfun 1); Algebra. + (One:F) x); algebra. +apply (interpF_unop F val unop binop pfun (NormF e0) u x0); algebra. +apply (interpF_int F val unop binop pfun 1); algebra. +apply (interpF_int F val unop binop pfun 0); algebra. +apply (interpF_int F val unop binop pfun 1); algebra. -inversion X1. try (rewrite H in H3; rewrite H1 in X2; rewrite H2 in X3; rewrite H0 in H3). (* compat 8.0 *) +inversion X1. rewrite H in H3. rewrite H1 in X2. rewrite H2 in X3. rewrite H0 in H3. apply (interpF_div F val unop binop pfun (expr_plus (expr_mult (expr_binop b (NormF e0) (NormF e1)) expr_one) expr_zero) expr_one x (One:F) x (ring_non_triv F)). -Algebra. +algebra. apply (interpF_plus F val unop binop pfun (expr_mult (expr_binop b (NormF e0) (NormF e1)) expr_one) expr_zero x (Zero:F) x). -Algebra. +algebra. apply (interpF_mult F val unop binop pfun (expr_binop b (NormF e0) (NormF e1)) - expr_one x (One:F) x); Algebra. + expr_one x (One:F) x); algebra. apply (interpF_binop F val unop binop pfun (NormF e0) (NormF e1) b x0 y); - Algebra. -apply (interpF_int F val unop binop pfun 1); Algebra. -apply (interpF_int F val unop binop pfun 0); Algebra. -apply (interpF_int F val unop binop pfun 1); Algebra. - -inversion X0. - try ((generalize Hx H2; clear Hx H2; rewrite H; intros Hx H2); - rewrite H1 in X1; rewrite H0 in H2). (* compat 8.0 *) + algebra. +apply (interpF_int F val unop binop pfun 1); algebra. +apply (interpF_int F val unop binop pfun 0); algebra. +apply (interpF_int F val unop binop pfun 1); algebra. + +inversion X0. rewrite <- H. rewrite H1 in X1. rewrite H0 in H2. apply (interpF_div F val unop binop pfun - (expr_plus (expr_mult (expr_part p (NormF e0)) expr_one) expr_zero) + (expr_plus (expr_mult (expr_part f (NormF e0)) expr_one) expr_zero) expr_one x (One:F) x (ring_non_triv F)). -Algebra. +algebra. apply (interpF_plus F val unop binop pfun - (expr_mult (expr_part p (NormF e0)) expr_one) expr_zero x ( + (expr_mult (expr_part f (NormF e0)) expr_one) expr_zero x ( Zero:F) x). -Algebra. +algebra. apply - (interpF_mult F val unop binop pfun (expr_part p (NormF e0)) expr_one x - (One:F) x); Algebra. -apply (interpF_part F val unop binop pfun (NormF e0) p x0) with (Hx := Hx); - Algebra. -apply (interpF_int F val unop binop pfun 1); Algebra. -apply (interpF_int F val unop binop pfun 0); Algebra. -apply (interpF_int F val unop binop pfun 1); Algebra. + (interpF_mult F val unop binop pfun (expr_part f (NormF e0)) expr_one x + (One:F) x); algebra. +apply (interpF_part F val unop binop pfun (NormF e0) f x0) with (Hx := Hx); + algebra. +apply (interpF_int F val unop binop pfun 1); algebra. +apply (interpF_int F val unop binop pfun 0); algebra. +apply (interpF_int F val unop binop pfun 1); algebra. Qed. Lemma Norm_wfF : @@ -865,10 +847,10 @@ elim e0; simpl in |- *; try (intros; elimtype False; inversion H2; fail). intro. elim z; simpl in |- *; try (intros; elimtype False; inversion H2; fail); intros H2 H3. -inversion H2. try (rewrite H4 in X; rewrite H6 in X0; rewrite H5 in H7). (* compat 8.0 *) +inversion H2. rewrite H4 in X. rewrite H6 in X0. rewrite H5 in H7. apply interpF_div with (Zero:F) y nzy; auto. -Algebra. -apply (interpF_int F val unop binop pfun 0); Algebra. +algebra. +apply (interpF_int F val unop binop pfun 0); algebra. Qed. Lemma Tactic_lemma_zero_F : @@ -897,4 +879,135 @@ assumption. Qed. End Field_NormCorrect. + +Ltac QuoteF R l t := +match l with + (Quad ?vl ?ul ?bl ?pl) => +(let a := constr:(fun n:varindex => (Mnth n vl (cm_unit R))) in + let b := constr:(fun n:unopindex => (Mnth n ul (@cg_inv R))) in + let c := constr:(fun n:binopindex => (Mnth n bl (@csg_op R))) in + let d := constr:(fun n:pfunindex => (Mnth n pl (total_eq_part _ (@cg_inv R)))) in + match t with + | (zring ?k) => + match (ClosedZ k) with + | true => constr:(xexprF_int R a b c d k) + end + | (csbf_fun _ _ _ csg_op ?x ?y) => + let x' := QuoteF R l x in + let y' := QuoteF R l y in + constr:(xexprF_plus R a b c d _ _ x' y') + | (csbf_fun _ _ _ cr_mult ?x ?y) => + let x' := QuoteF R l x in + let y' := QuoteF R l y in + constr:(xexprF_mult R a b c d _ _ x' y') + | (cf_div ?x ?y ?H) => + let x' := QuoteF R l x in + let y' := QuoteF R l y in + constr:(xexprF_div R a b c d _ _ x' y' H) + | (Zero) => constr:(xexprF_zero R a b c d) + | (One) => constr:(xexprF_one R a b c d) + | (nring ?n) => + match (ClosedNat n) with + | true => constr:(xexprF_nat R a b c d n) + end + | (csf_fun _ _ cg_inv ?x) => + let x' := QuoteF R l x in + constr:(xexprF_inv R a b c d _ x') + | (cg_minus ?x ?y) => + let x' := QuoteF R l x in + let y' := QuoteF R l y in + constr:(xexprF_minus R a b c d _ _ x' y') + | (csf_fun _ _ (@nexp_op _ ?n) ?x) => + match (ClosedNat n) with + | true => let x' := QuoteF R l x in + constr:(xexprF_power R a b c d _ x' n) + end + | (pfpfun ?f ?x ?h) => + let x' := QuoteF R l x in + let i := FindIndex f pl in + constr:(xexprF_part R a b c d _ i x' h) + | (csf_fun _ _ ?f ?x) => + let x' := QuoteF R l x in + let i := FindIndex f ul in + constr:(xexprF_unop R a b c d _ i x') + | (csbf_fun _ _ _ ?f ?x ?y) => + let x' := QuoteF R l x in + let y' := QuoteF R l y in + let i := FindIndex f bl in + constr:(xexprF_binop R a b c d _ _ i x' y') + | ?t => + let i := FindIndex t vl in + constr:(xexprF_var R a b c d i) +end) +end. + +Ltac FindTermVariablesF t l := +match t with +| (zring ?k) => + match (ClosedZ k) with + | true => constr:l + end +| (csbf_fun _ _ _ csg_op ?x ?y) => + let l1 := FindTermVariablesF x l in + let l2 := FindTermVariablesF y l1 in + constr:l2 +| (csbf_fun _ _ _ cr_mult ?x ?y) => + let l1 := FindTermVariablesF x l in + let l2 := FindTermVariablesF y l1 in + constr:l2 +| (cf_div ?x ?y ?H) => + let l1 := FindTermVariablesF x l in + let l2 := FindTermVariablesF y l1 in + constr:l2 +| (Zero) => constr:l +| (One) => constr:l +| (nring ?n) => + match (ClosedNat n) with + | true => constr:l + end +| (csf_fun _ _ cg_inv ?x) => + let l1 := FindTermVariablesF x l in + constr:l1 +| (cg_minus ?x ?y) => + let l1 := FindTermVariablesF x l in + let l2 := FindTermVariablesF y l1 in + constr:l2 +| (csf_fun _ _ (@nexp_op _ ?n) ?x) => + match (ClosedNat n) with + | true => let l1 := FindTermVariablesF x l in + constr:l1 + end +| (pfpfun ?f ?x ?h) => + let l1 := FindTermVariablesF x l in + match l1 with + (Quad ?vl ?ul ?bl ?pl) => constr:(Quad vl ul bl (Mcons f pl)) + end +| (csf_fun _ _ ?f ?x) => + let l1 := FindTermVariablesF x l in + match l1 with + (Quad ?vl ?ul ?bl ?pl) => constr:(Quad vl (Mcons f ul) bl pl) + end +| (csbf_fun _ _ _ ?f ?x ?y) => + let l1 := FindTermVariablesF x l in + let l2 := FindTermVariablesF y l1 in + match l2 with + (Quad ?vl ?ul ?bl ?pl) => constr:(Quad vl ul (Mcons f bl) pl) + end +| ?t => match l with + (Quad ?vl ?ul ?bl ?pl) => constr:(Quad (Mcons t vl) ul bl pl) + end +end. + +Ltac FindTermsVariablesF fn t1 t2 := + let l1 := FindTermVariablesF t1 (Quad (Mnil fn) (Mnil (CSetoid_un_op fn)) (Mnil (CSetoid_bin_op fn)) (Mnil (PartFunct fn))) in + let l2 := FindTermVariablesF t2 l1 in + constr:l2. + +Ltac rationalF F x y := + let l:=FindTermsVariablesF F x y in + let t1:=(QuoteF F l x) in + let t2:=(QuoteF F l y) in + eapply Tactic_lemmaF with (e:=t1) (f:=t2) + ; reflexivity. + (* end hide *) diff --git a/tactics/GroupReflection.v b/tactics/GroupReflection.v index 148d6d2f5..e4aeb3be3 100644 --- a/tactics/GroupReflection.v +++ b/tactics/GroupReflection.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) (* begin hide *) @@ -129,29 +113,29 @@ induction e e0 Hrece0]. -apply (interpG_var i); Algebra. +apply (interpG_var i); algebra. -apply interpG_zero; Algebra. +apply interpG_zero; algebra. -apply (interpG_plus (xforgetG _ e1) (xforgetG _ e0) x y (x[+]y)); Algebra. +apply (interpG_plus (xforgetG _ e1) (xforgetG _ e0) x y (x[+]y)); algebra. -apply (interpG_mult_int (xforgetG _ e) k x (zmult x k)); Algebra. +apply (interpG_mult_int (xforgetG _ e) k x (zmult x k)); algebra. -apply (interpG_unop (xforgetG _ e) f x (unop f x)); Algebra. +apply (interpG_unop (xforgetG _ e) f x (unop f x)); algebra. apply (interpG_binop (xforgetG _ e1) (xforgetG _ e0) f x y (binop f x y)); - Algebra. + algebra. eapply (interpG_part (xforgetG _ e) f x (pfun f x Hx)). apply eq_reflexive_unfolded. -Algebra. +algebra. -apply (interpG_mult_int (xforgetG _ e) (-1) x); Algebra. +apply (interpG_mult_int (xforgetG _ e) (-1) x); algebra. apply (interpG_plus (xforgetG _ e1) (xforgetG _ (xexprG_inv _ e0)) x [--]y (x[-]y)); - Algebra. -apply (interpG_mult_int (xforgetG _ e0) (-1) y); Algebra. + algebra. +apply (interpG_mult_int (xforgetG _ e0) (-1) y); algebra. Qed. Definition xexprG_diagram_commutes : @@ -277,7 +261,7 @@ Qed. Lemma interpG_wd : forall (e : expr) (x y : G), interpG e x -> (x[=]y) -> interpG e y. intros e x y H H0. -inversion H; try (rewrite <- H2; rewrite H3 in H1). (* compat 8.0 *) +inversion H; rewrite <- H2; rewrite H3 in H1. apply interpG_var. Step_final x. apply interpG_zero. Step_final x. apply interpG_plus with x0 y0; auto. Step_final x. @@ -334,53 +318,53 @@ intros. apply interpG_zero. inversion X. Step_final (zmult x0 0). intros z f; case f; simpl in |- *; auto. intro z0; case z0; simpl in |- *; auto. - intros. inversion X. try (rewrite H in X0; rewrite H1 in H2; rewrite H0 in H2). (* compat 8.0 *) + intros. inversion X. rewrite H in X0. rewrite H1 in H2. rewrite H0 in H2. apply interpG_zero. Step_final (zmult x0 0). - intros. inversion X. try (rewrite H in X0; rewrite H1 in H2; rewrite H0 in H2). (* compat 8.0 *) - inversion X0. try (rewrite <- H3; rewrite H5 in H4). (* compat 8.0 *) + intros. inversion X. rewrite H in X0. rewrite H1 in H2. rewrite H0 in H2. + inversion X0. rewrite <- H3. rewrite H5 in H4. rewrite Zmult_comm. rewrite <- Zmult_0_r_reverse. apply interpG_zero. astepr (zmult (G:=G) Zero (Zpos p)). Step_final (zmult x0 (Zpos p)). -intros. inversion X. try (rewrite H in X0; rewrite H1 in H2; rewrite H0 in H2). (* compat 8.0 *) -inversion X0. try (rewrite <- H3; rewrite H5 in H4). (* compat 8.0 *) +intros. inversion X. rewrite H in X0. rewrite H1 in H2. rewrite H0 in H2. +inversion X0. rewrite <- H3. rewrite H5 in H4. rewrite Zmult_comm. rewrite <- Zmult_0_r_reverse. apply interpG_zero. astepr (zmult (G:=G) Zero (Zneg p)). Step_final (zmult x0 (Zneg p)). intros e0 e1 f; case f; simpl in |- *; auto. intro z; case z; simpl in |- *; auto. -intros. inversion X. try (rewrite H in X0; rewrite H1 in H2; rewrite H0 in H2). (* compat 8.0 *) +intros. inversion X. rewrite H in X0. rewrite H1 in H2. rewrite H0 in H2. apply interpG_zero. Step_final (zmult x0 0). intros e0 e1 f; case f; simpl in |- *; auto; try (intros; inversion X; fail). intro z; case z; simpl in |- *; auto. - intros. inversion X. try (rewrite H in X0; rewrite H1 in H2; rewrite H0 in H2). (* compat 8.0 *) + intros. inversion X. rewrite H in X0. rewrite H1 in H2. rewrite H0 in H2. apply interpG_zero. Step_final (zmult x0 0). - intros; inversion X. try (rewrite H in X0; rewrite H1 in H2; rewrite H0 in H2). (* compat 8.0 *) - inversion X0. try (rewrite H3 in X1; rewrite H4 in H6; rewrite <- H5). (* compat 8.0 *) + intros; inversion X. rewrite H in X0. rewrite H1 in H2. rewrite H0 in H2. + inversion X0. rewrite H3 in X1. rewrite H4 in H6. rewrite <- H5. simpl in |- *; apply interpG_mult_int with x1; auto. astepr (zmult x0 (Zpos p)). Step_final (zmult (zmult x1 k0) (Zpos p)). -intros; inversion X. try (rewrite H in X0; rewrite H1 in H2; rewrite H0 in H2). (* compat 8.0 *) -inversion X0. try (rewrite H3 in X1; rewrite H4 in H6; rewrite <- H5). (* compat 8.0 *) +intros; inversion X. rewrite H in X0. rewrite H1 in H2. rewrite H0 in H2. +inversion X0. rewrite H3 in X1. rewrite H4 in H6. rewrite <- H5. simpl in |- *; apply interpG_mult_int with x1; auto. astepr (zmult x0 (Zneg p)). Step_final (zmult (zmult x1 k0) (Zneg p)). intros e0 e1 f; case f; simpl in |- *; auto. intro z; case z; simpl in |- *; auto. -intros; inversion X. try (rewrite H in X0; rewrite H1 in H2; rewrite H0 in H2). (* compat 8.0 *) +intros; inversion X. rewrite H in X0. rewrite H1 in H2. rewrite H0 in H2. apply interpG_zero. Step_final (zmult x0 0). intros n e0 f x; case f; simpl in |- *; auto. intro z; case z; simpl in |- *; auto. -intros; inversion X. try (rewrite H in X0; rewrite H1 in H2; rewrite H0 in H2). (* compat 8.0 *) +intros; inversion X. rewrite H in X0. rewrite H1 in H2. rewrite H0 in H2. apply interpG_zero. Step_final (zmult x0 0). intros n e0 e1 f x; case f; simpl in |- *; auto. intro z; case z; simpl in |- *; auto. -intros; inversion X. try (rewrite H in X0; rewrite H1 in H2; rewrite H0 in H2). (* compat 8.0 *) +intros; inversion X. rewrite H in X0. rewrite H1 in H2. rewrite H0 in H2. apply interpG_zero. Step_final (zmult x0 0). intros n e0 f x; case f; simpl in |- *; auto. intro z; case z; simpl in |- *; auto. -intros; inversion X. try (rewrite H in X0; rewrite H1 in H2; rewrite H0 in H2). (* compat 8.0 *) +intros; inversion X. rewrite H in X0. rewrite H1 in H2. rewrite H0 in H2. apply interpG_zero. Step_final (zmult x0 0). Qed. Transparent Zmult. @@ -389,10 +373,10 @@ Opaque MI_mult. Lemma MV_mult_corr_G : forall (e f : expr) (x : G), II (expr_mult f e) x -> II (MV_mult e f) x. intro e; case e; simpl in |- *; intros; inversion X. -try (rewrite H in X0; rewrite H1 in H2; rewrite H0 in H2). (* compat 8.0 *) +rewrite H in X0. rewrite H1 in H2. rewrite H0 in H2. apply MI_mult_corr_G. apply interpG_mult_int with x0; auto. -unfold expr_one in |- *. apply interpG_mult_int with x0; Algebra. +unfold expr_one in |- *. apply interpG_mult_int with x0; algebra. Qed. Opaque MV_mult. @@ -400,7 +384,7 @@ Lemma MM_mult_corr_G : forall (e f : expr) (x : G), II (expr_mult e f) x or II (expr_mult f e) x -> II (MM_mult e f) x. intro e; case e; simpl in |- *; intros; elim X; clear X; intro X; inversion X; - try (rewrite H in X0; rewrite H0 in H2; rewrite <- H1). (* Compat 8.0 *) + rewrite H in X0; rewrite H0 in H2; rewrite <- H1. apply interpG_mult_int with x0; auto. @@ -412,7 +396,7 @@ apply MI_mult_corr_G. apply interpG_mult_int with x0; auto. apply interpG_mult_int with x0; auto. apply MV_mult_corr_G. -inversion X0. try (rewrite H3 in X1; rewrite <- H5; rewrite H4 in H6). (* compat 8.0 *) +inversion X0. rewrite H3 in X1. rewrite <- H5. rewrite H4 in H6. replace (MM_mult (expr_int k0) (expr_int k)) with (expr_int (k0 * k)). apply interpG_mult_int with x1; auto. astepr (zmult x0 k). Step_final (zmult (zmult x1 k0) k). @@ -449,8 +433,8 @@ elim f1; simpl in |- *; auto. intro m. cut (eq_nat n m = true -> n = m). elim (eq_nat n m); simpl in |- *; auto. -intros. inversion X. try (rewrite H6 in X1; rewrite <- H8; rewrite H7 in H9). (* compat 8.0 *) -inversion X0. try (rewrite H10 in X2; rewrite <- H12; rewrite H11 in H13). (* compat 8.0 *) +intros. inversion X. rewrite H6 in X1. rewrite <- H8. rewrite H7 in H9. +inversion X0. rewrite H10 in X2. rewrite <- H12. rewrite H11 in H13. apply MV_mult_corr_G. simpl in |- *. apply interpG_mult_int with x0; auto. astepr (zmult x0 k[+]zmult x1 k0). @@ -470,15 +454,15 @@ cut (andb (eq_nat u u0) (eq_expr e0 e5) = true -> u = u0). cut (andb (eq_nat u u0) (eq_expr e0 e5) = true -> e0 = e5). elim andb; simpl in |- *; auto. intros H' H''. intros. -inversion X. try (rewrite H7 in X1; rewrite <- H9; rewrite H8 in H10). -inversion X0. try (rewrite H11 in X2; rewrite <- H13; rewrite H12 in H14). +inversion X. rewrite <- H7. rewrite <- H9. rewrite H8 in H10. +inversion X0. rewrite H11 in X2. rewrite <- H13. rewrite H12 in H14. apply MV_mult_corr_G. simpl in |- *. apply interpG_mult_int with x0; auto. astepr (zmult x0 k[+]zmult x1 k0). cut (x0[=]x1); intros. Step_final (zmult x0 k[+]zmult x0 k0). apply refl_interpG with val unop binop pfun (expr_unop u e0). -auto. rewrite H'. rewrite H''. auto. auto. auto. +rewrite <- H7; auto. rewrite H'. rewrite H''. auto. auto. auto. intro. elim (andb_prop _ _ H7); intros. apply eq_expr_corr; auto. intro. elim (andb_prop _ _ H7); intros. apply eq_nat_corr; auto. @@ -495,15 +479,15 @@ cut (andb (eq_nat u u0) (andb (eq_expr e0 e6) (eq_expr e3 e7)) = true -> e3 = e7). elim andb; simpl in |- *; auto. intros H' H'' H'''. intros. -inversion X. try (rewrite H9 in X1; rewrite <- H11; rewrite H10 in H12). (* compat 8.0 *) -inversion X0. try (rewrite H13 in X2; rewrite <- H15; rewrite H14 in H16). (* compat 8.0 *) +inversion X. rewrite <- H9. rewrite <- H11. rewrite H10 in H12. +inversion X0. rewrite H13 in X2. rewrite <- H15. rewrite H14 in H16. apply MV_mult_corr_G. simpl in |- *. apply interpG_mult_int with x0; auto. astepr (zmult x0 k[+]zmult x1 k0). cut (x0[=]x1); intros. Step_final (zmult x0 k[+]zmult x0 k0). apply refl_interpG with val unop binop pfun (expr_binop u e0 e3). -auto. rewrite H'. rewrite H''. rewrite H'''. auto. auto. auto. +rewrite <- H9; auto. rewrite H'. rewrite H''. rewrite H'''. auto. auto. auto. auto. intro. elim (andb_prop _ _ H9); intros. elim (andb_prop _ _ H11); intros. apply eq_expr_corr; auto. @@ -520,15 +504,15 @@ cut (andb (eq_nat u u0) (eq_expr e0 e5) = true -> u = u0). cut (andb (eq_nat u u0) (eq_expr e0 e5) = true -> e0 = e5). elim andb; simpl in |- *; auto. intros H' H''. intros. -inversion X. try (rewrite H7 in X1; rewrite <- H9; rewrite H8 in H10). (* compat 8.0 *) -inversion X0. try (rewrite H11 in X2; rewrite <- H13; rewrite H12 in H14). (* compat 8.0 *) +inversion X. rewrite <- H7. rewrite <- H9. rewrite H8 in H10. +inversion X0. rewrite H11 in X2. rewrite <- H13. rewrite H12 in H14. apply MV_mult_corr_G. simpl in |- *. apply interpG_mult_int with x0; auto. astepr (zmult x0 k[+]zmult x1 k0). cut (x0[=]x1); intros. Step_final (zmult x0 k[+]zmult x0 k0). apply refl_interpG with val unop binop pfun (expr_part u e0). -auto. rewrite H'. rewrite H''. auto. auto. auto. +rewrite <- H7; auto. rewrite H'. rewrite H''. auto. auto. auto. intro. elim (andb_prop _ _ H7); intros. apply eq_expr_corr; auto. intro. elim (andb_prop _ _ H7); intros. apply eq_nat_corr; auto. @@ -540,9 +524,9 @@ elim f; simpl in |- *; auto. intros u e0 H1 f. elim f; simpl in |- *; auto. -intros; apply interpG_plus with x y; Algebra. -intros. inversion X. try (rewrite H1 in H0; rewrite <- H). (* compat 8.0 *) -inversion X0. try (rewrite <- H2; rewrite H4 in H3). (* compat 8.0 *) +intros; apply interpG_plus with x y; algebra. +intros. inversion X. rewrite H1 in H0. rewrite <- H. +inversion X0. rewrite <- H2. rewrite H4 in H3. simpl in |- *. apply interpG_zero. Step_final ((Zero:G)[+]Zero). Qed. @@ -581,19 +565,19 @@ simpl in |- *; auto. simpl in |- *; auto. simpl in |- *; auto. simpl in |- *; auto. -intros; apply interpG_wd with (y[+]x); Algebra. -apply interpG_plus with y x; Algebra. -intros; apply interpG_plus with x y; Algebra. +intros; apply interpG_wd with (y[+]x); algebra. +apply interpG_plus with y x; algebra. +intros; apply interpG_plus with x y; algebra. intros; apply MM_plus_corr_G; auto. -intros. inversion X0. try (rewrite H in X2; rewrite H1 in X3; rewrite <- H0). (* compat 8.0 *) +intros. inversion X0. rewrite H in X2. rewrite H1 in X3. rewrite <- H0. apply interpG_wd with (y0[+](x0[+]y)). apply X; auto. apply MM_plus_corr_G; auto. astepl (y0[+]x0[+]y). Step_final (x0[+]y0[+]y). -intros. inversion X0. try (rewrite H in X2; rewrite H1 in X3; rewrite <- H0). (* compat 8.0 *) +intros. inversion X0. rewrite H in X2. rewrite H1 in X3. rewrite <- H0. apply interpG_wd with (x0[+](y0[+]y)). -apply interpG_plus with x0 (y0[+]y); Algebra. +apply interpG_plus with x0 (y0[+]y); algebra. Step_final (x0[+]y0[+]y). Qed. Transparent MM_plus. @@ -614,10 +598,10 @@ cut II e x -> II f y -> II (expr_plus e f) (x[+]y)). intros H H0 H1 e. elim e; intros; simpl in |- *; auto. -intros. apply interpG_plus with x y; Algebra. -intros. apply interpG_wd with (y[+]x); Algebra. +intros. apply interpG_plus with x y; algebra. +intros. apply interpG_wd with (y[+]x); algebra. apply PM_plus_corr_G; auto. -intros. inversion X0. try (rewrite H in X2; rewrite H1 in X3; rewrite <- H0). (* compat 8.0 *) +intros. inversion X0. rewrite H in X2. rewrite H1 in X3. rewrite <- H0. apply interpG_wd with (y0[+]y[+]x0). apply PM_plus_corr_G; auto. astepl (x0[+](y0[+]y)). @@ -659,29 +643,29 @@ intro e; Hrece]; simpl in |- *; auto. intros f x H; elim H; clear H; intro H; inversion H. - try (rewrite H0 in X; rewrite <- H2; rewrite H1 in H3). (* compat 8.0 *) + rewrite H0 in X. rewrite <- H2. rewrite H1 in H3. apply interpG_mult_int with x0; auto. intros f x H; elim H; clear H; intro H; inversion H. - try (rewrite H0 in X; rewrite <- H2; rewrite H1 in H3). (* compat 8.0 *) - apply interpG_wd with (Zero[+]x); Algebra. - apply PM_plus_corr_G. apply interpG_zero; Algebra. + rewrite H0 in X. rewrite <- H2. rewrite H1 in H3. + apply interpG_wd with (Zero[+]x); algebra. + apply PM_plus_corr_G. apply interpG_zero; algebra. rewrite MI_mult_comm_int. apply MI_mult_corr_G. apply interpG_mult_int with x0; auto. -apply interpG_wd with (Zero[+]x); Algebra. -apply PM_plus_corr_G. apply interpG_zero; Algebra. +apply interpG_wd with (Zero[+]x); algebra. +apply PM_plus_corr_G. apply interpG_zero; algebra. apply MI_mult_corr_G. auto. intros f x H; elim H; clear H; intro H; inversion H. -try (rewrite H0 in X; rewrite <- H2; rewrite H1 in H3). (* compat 8.0 *) -inversion X. try (rewrite H4 in X0; rewrite H6 in X1; rewrite H5 in H7). (* compat 8.0 *) +rewrite H0 in X. rewrite <- H2. rewrite H1 in H3. +inversion X. rewrite H4 in X0. rewrite H6 in X1. rewrite H5 in H7. apply interpG_wd with (zmult y k[+]zmult x1 k). 2: astepl (zmult (y[+]x1) k); astepl (zmult (x1[+]y) k); Step_final (zmult x0 k). apply PM_plus_corr_G. - apply Hrece0. left. apply interpG_mult_int with y; Algebra. + apply Hrece0. left. apply interpG_mult_int with y; algebra. apply MM_mult_corr_G; left. -apply interpG_mult_int with x1; Algebra. +apply interpG_mult_int with x1; algebra. intros f x H; inversion H; simpl in |- *; auto. inversion X. @@ -734,13 +718,13 @@ intro e; intros f x H. apply PM_mult_corr_G; auto. -intros f x H. inversion H. try (rewrite H0 in X; rewrite <- H2; rewrite <- H1). (* compat 8.0 *) -inversion X. try (rewrite H4 in X0; rewrite H6 in X1; rewrite H5 in H7). (* compat 8.0 *) +intros f x H. inversion H. rewrite H0 in X; rewrite <- H2; rewrite <- H1. +inversion X. rewrite H4 in X0. rewrite H6 in X1. rewrite H5 in H7. apply interpG_wd with (zmult x1 k[+]zmult y k). 2: astepl (zmult (x1[+]y) k); Step_final (zmult x0 k). apply PP_plus_corr_G. - apply PM_mult_corr_G; right. apply interpG_mult_int with x1; Algebra. -apply Hrece0. apply interpG_mult_int with y; Algebra. + apply PM_mult_corr_G; right. apply interpG_mult_int with x1; algebra. +apply Hrece0. apply interpG_mult_int with y; algebra. Qed. Lemma NormG_corr_G : forall (e : expr) (x : G), II e x -> II (NormG e) x. @@ -748,55 +732,52 @@ intro; elim e; intros; simpl in |- *. apply (interpG_plus G val unop binop pfun (expr_mult (expr_var v) expr_one) expr_zero x (Zero:G) x). -Algebra. -apply (interpG_mult_int G val unop binop pfun (expr_var v) 1 x); Algebra. -apply interpG_zero; Algebra. +algebra. +apply (interpG_mult_int G val unop binop pfun (expr_var v) 1 x); algebra. +apply interpG_zero; algebra. auto. -inversion X1. try (rewrite H in X2; rewrite H1 in X3; rewrite H0 in H2). (* compat 8.0 *) +inversion X1. rewrite H in X2. rewrite H1 in X3. rewrite H0 in H2. apply interpG_wd with (x0[+]y). apply PP_plus_corr_G; auto. auto. -inversion X1. try (rewrite H in X2; rewrite <- H1; rewrite H0 in H2). (* compat 8.0 *) +inversion X1. rewrite H in X2. rewrite <- H1. rewrite H0 in H2. simpl in |- *. apply interpG_wd with (zmult x0 k). -apply PP_mult_corr_G. apply interpG_mult_int with x0; Algebra. auto. +apply PP_mult_corr_G. apply interpG_mult_int with x0; algebra. auto. auto. -inversion X0. try (rewrite H in H2; rewrite H1 in X1; rewrite H0 in H2). (* compat 8.0 *) +inversion X0. rewrite H in H2. rewrite H1 in X1. rewrite H0 in H2. apply (interpG_plus G val unop binop pfun (expr_mult (expr_unop u (NormG e0)) expr_one) expr_zero x ( Zero:G) x). -Algebra. +algebra. apply (interpG_mult_int G val unop binop pfun (expr_unop u (NormG e0)) 1 x); - Algebra. -apply (interpG_unop G val unop binop pfun (NormG e0) u x0); Algebra. -apply interpG_zero; Algebra. + algebra. +apply (interpG_unop G val unop binop pfun (NormG e0) u x0); algebra. +apply interpG_zero; algebra. -inversion X1. try (rewrite H in H3; rewrite H1 in X2; rewrite H2 in X3; rewrite H0 in H3). (* compat 8.0 *) +inversion X1. rewrite H in H3. rewrite H1 in X2. rewrite H2 in X3. rewrite H0 in H3. apply (interpG_plus G val unop binop pfun (expr_mult (expr_binop b (NormG e0) (NormG e1)) expr_one) expr_zero x (Zero:G) x). -Algebra. +algebra. apply (interpG_mult_int G val unop binop pfun (expr_binop b (NormG e0) (NormG e1)) - 1 x); Algebra. + 1 x); algebra. apply (interpG_binop G val unop binop pfun (NormG e0) (NormG e1) b x0 y); - Algebra. -apply interpG_zero; Algebra. + algebra. +apply interpG_zero; algebra. -inversion X0. - (* circumvent inversion bug in Type in coq 8.0 *) - try ((generalize Hx H2; clear Hx H2; rewrite H; intros Hx H2); - rewrite H1 in X1; rewrite H0 in H2). (* compat 8.0 *) +inversion X0. rewrite <- H. rewrite H1 in X1. rewrite H0 in H2. apply (interpG_plus G val unop binop pfun - (expr_mult (expr_part p (NormG e0)) expr_one) expr_zero x ( + (expr_mult (expr_part f (NormG e0)) expr_one) expr_zero x ( Zero:G) x). -Algebra. -apply (interpG_mult_int G val unop binop pfun (expr_part p (NormG e0)) 1 x); - Algebra. -apply (interpG_part G val unop binop pfun (NormG e0) p x0) with (Hx := Hx); - Algebra. -apply interpG_zero; Algebra. +algebra. +apply (interpG_mult_int G val unop binop pfun (expr_part f (NormG e0)) 1 x); + algebra. +apply (interpG_part G val unop binop pfun (NormG e0) f x0) with (Hx := Hx); + algebra. +apply interpG_zero; algebra. Qed. Lemma Tactic_lemmaG : @@ -812,4 +793,100 @@ apply NormG_corr_G; apply xexprG2interpG. Qed. End Group_NormCorrect. + +Ltac QuoteG G l t := +match l with + (Quad ?vl ?ul ?bl ?pl) => +(let a := constr:(fun n:varindex => (Mnth n vl (cm_unit G))) in + let b := constr:(fun n:unopindex => (Mnth n ul (@cg_inv G))) in + let c := constr:(fun n:binopindex => (Mnth n bl (@csg_op G))) in + let d := constr:(fun n:pfunindex => (Mnth n pl (total_eq_part _ (@cg_inv G)))) in + match t with + | (csbf_fun _ _ _ csg_op ?x ?y) => + let x' := QuoteG G l x in + let y' := QuoteG G l y in + constr:(xexprG_plus G a b c d _ _ x' y') + | (Zero) => constr:(xexprG_zero G a b c d) + | (csf_fun _ _ cg_inv ?x) => + let x' := QuoteG G l x in + constr:(xexprG_inv G a b c d _ x') + | (cg_minus ?x ?y) => + let x' := QuoteG G l x in + let y' := QuoteG G l y in + constr:(xexprG_minus G a b c d _ _ x' y') + | (zmult ?x ?n) => + match (ClosedZ n) with + | true => let x' := QuoteG G l x in + constr:(xexprG_mult_int G a b c d _ n x') + end + | (pfpfun ?f ?x ?h) => + let x' := QuoteG G l x in + let i := FindIndex f pl in + constr:(xexprG_part G a b c d _ i x' h) + | (csf_fun _ _ ?f ?x) => + let x' := QuoteG G l x in + let i := FindIndex f ul in + constr:(xexprG_unop G a b c d _ i x') + | (csbf_fun _ _ _ ?f ?x ?y) => + let x' := QuoteG G l x in + let y' := QuoteG G l y in + let i := FindIndex f bl in + constr:(xexprG_binop G a b c d _ _ i x' y') + | ?t => + let i := FindIndex t vl in + constr:(xexprG_var G a b c d i) +end) +end. + +Ltac FindTermVariablesG t l := +match t with +| (csbf_fun _ _ _ csg_op ?x ?y) => + let l1 := FindTermVariablesG x l in + let l2 := FindTermVariablesG y l1 in + constr:l2 +| (Zero) => constr:l +| (csf_fun _ _ cg_inv ?x) => + let l1 := FindTermVariablesG x l in + constr:l1 +| (cg_minus ?x ?y) => + let l1 := FindTermVariablesG x l in + let l2 := FindTermVariablesG y l1 in + constr:l2 +| (zmult ?x ?n) => + match (ClosedZ n) with + | true => let l1 := FindTermVariablesG x l in + constr:l1 + end +| (pfpfun ?f ?x ?h) => + let l1 := FindTermVariablesG x l in + match l1 with + (Quad ?vl ?ul ?bl ?pl) => constr:(Quad vl ul bl (Mcons f pl)) + end +| (csf_fun _ _ ?f ?x) => + let l1 := FindTermVariablesG x l in + match l1 with + (Quad ?vl ?ul ?bl ?pl) => constr:(Quad vl (Mcons f ul) bl pl) + end +| (csbf_fun _ _ _ ?f ?x ?y) => + let l1 := FindTermVariablesG x l in + let l2 := FindTermVariablesG y l1 in + match l2 with + (Quad ?vl ?ul ?bl ?pl) => constr:(Quad vl ul (Mcons f bl) pl) + end +| ?t => match l with + (Quad ?vl ?ul ?bl ?pl) => constr:(Quad (Mcons t vl) ul bl pl) + end +end. + +Ltac FindTermsVariablesG fn t1 t2 := + let l1 := FindTermVariablesG t1 (Quad (Mnil fn) (Mnil (CSetoid_un_op fn)) (Mnil (CSetoid_bin_op fn)) (Mnil (PartFunct fn))) in + let l2 := FindTermVariablesG t2 l1 in + constr:l2. + +Ltac rationalG G x y := + let l:=FindTermsVariablesG G x y in + let t1:=(QuoteG G l x) in + let t2:=(QuoteG G l y) in + eapply Tactic_lemmaG with (e:=t1) (f:=t2) + ; reflexivity. (* end hide *) diff --git a/tactics/Opaque_algebra.v b/tactics/Opaque_algebra.v index bde1efb15..2b1a9896d 100644 --- a/tactics/Opaque_algebra.v +++ b/tactics/Opaque_algebra.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) (* Opaque cs_crr. *) diff --git a/tactics/Rational.v b/tactics/Rational.v new file mode 100644 index 000000000..4fb00d2b0 --- /dev/null +++ b/tactics/Rational.v @@ -0,0 +1,35 @@ +Require Export FieldReflection. +Require Export RingReflection. +Require Export GroupReflection. + +Inductive AlgebraName : Type := +|cfield : CField -> AlgebraName +|cring : CRing -> AlgebraName +|cabgroup : CAbGroup -> AlgebraName. + +Ltac GetStructureName t := +match t with +| (csg_crr (cm_crr (cg_crr (cag_crr ?s)))) => + match s with + | (cr_crr ?r) => + match r with + | (cf_crr ?q) => constr:(cfield q) + | _ => constr:(cring r) + end + | _ => constr:(cabgroup s) + end +end. + +Ltac rational := +match goal with +[|-@cs_eq ?T ?x ?y] => + match GetStructureName T with + |(cfield ?F) => rationalF F x y + |(cring ?R) => rationalR R x y + |(cabgroup ?G) => rationalG G x y + end +end. + +Tactic Notation "rstepl" constr(c) := stepl c;[idtac | rational]. + +Tactic Notation "rstepr" constr(c) := stepr c;[idtac | rational]. diff --git a/tactics/RingReflection.v b/tactics/RingReflection.v index 949023182..f579a09d3 100644 --- a/tactics/RingReflection.v +++ b/tactics/RingReflection.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) (* begin hide *) @@ -96,47 +80,47 @@ Lemma xexprR2interpR : forall (x:R) (e:xexprR x), interpR (xforgetR _ e) x. intros x e. induction e. -apply (interpR_var i); Algebra. +apply (interpR_var i); algebra. -apply (interpR_int k); Algebra. +apply (interpR_int k); algebra. -apply (interpR_plus (xforgetR _ e1) (xforgetR _ e2) x y (x[+]y)); Algebra. +apply (interpR_plus (xforgetR _ e1) (xforgetR _ e2) x y (x[+]y)); algebra. -apply (interpR_mult (xforgetR _ e1) (xforgetR _ e2) x y (x[*]y)); Algebra. +apply (interpR_mult (xforgetR _ e1) (xforgetR _ e2) x y (x[*]y)); algebra. -apply (interpR_unop (xforgetR _ e) f x (unop f x)); Algebra. +apply (interpR_unop (xforgetR _ e) f x (unop f x)); algebra. apply (interpR_binop (xforgetR _ e1) (xforgetR _ e2) f x y (binop f x y)); - Algebra. + algebra. eapply (interpR_part (xforgetR _ e) f x (pfun f x Hx)). apply eq_reflexive_unfolded. -Algebra. +algebra. -apply (interpR_int 0); Algebra. +apply (interpR_int 0); algebra. apply (interpR_int 1); Step_final (One:R). -apply (interpR_int (Z_of_nat n)); Algebra. +apply (interpR_int (Z_of_nat n)); algebra. apply (interpR_mult (xforgetR _ e) (expr_int (-1)) x (zring (-1)) [--]x); auto. Step_final (zring (-1)[*]x). -apply (interpR_int (-1)); Algebra. +apply (interpR_int (-1)); algebra. apply (interpR_plus (xforgetR _ e1) (xforgetR _ (xexprR_inv _ e2)) x [--]y (x[-]y)); - Algebra. + algebra. apply (interpR_mult (xforgetR _ e2) (expr_int (-1)) y (zring (-1)) [--]y); auto. Step_final (zring (-1)[*]y). -apply (interpR_int (-1)); Algebra. +apply (interpR_int (-1)); algebra. induction n. apply (interpR_int 1); Step_final (One:R). apply (interpR_mult (xforgetR _ e) (expr_power n (xforgetR _ e)) x ( - x[^]n) (x[^]S n)); Algebra. + x[^]n) (x[^]S n)); algebra. Qed. Definition xexprR_diagram_commutes : @@ -244,9 +228,7 @@ Qed. Lemma interpR_wd : forall (e:expr) (x y:R), interpR e x -> (x[=]y) -> interpR e y. intros e x y H H0. -inversion H; - (* inversion bug fixed in V8.1 makes these rewritings useless *) - try (rewrite <- H2; rewrite H3 in H1). +inversion H; rewrite <- H2; rewrite H3 in H1. apply interpR_var. Step_final x. apply interpR_int. Step_final x. apply interpR_plus with x0 y0; auto. Step_final x. @@ -307,20 +289,18 @@ simple induction z0; simpl in |- *; auto. simple induction z; simpl in |- *; auto. simple induction z; simpl in |- *; auto. simple induction z; simpl in |- *; auto. -intros; apply interpR_mult with x y; Algebra. +intros; apply interpR_mult with x y; algebra. intros; apply interpR_wd with (zring (i * j):R). -apply interpR_int; Algebra. +apply interpR_int; algebra. inversion X. inversion X0. Step_final (zring i[*]zring j:R). -intros. inversion X0. - try (rewrite H in X2; rewrite H1 in X3; rewrite H0 in H2). (* compat 8.0 *) -apply interpR_wd with (x0[*](y0[*]y)); Algebra. -apply interpR_mult with x0 (y0[*]y); Algebra. +intros. inversion X0. rewrite H in X2. rewrite H1 in X3. rewrite H0 in H2. +apply interpR_wd with (x0[*](y0[*]y)); algebra. +apply interpR_mult with x0 (y0[*]y); algebra. Step_final (x0[*]y0[*]y). -intros. inversion X. - try (rewrite H in H0; rewrite H1 in H0). (* compat 8.0 *) +intros. inversion X. rewrite H in H0. rewrite H1 in H0. apply interpR_wd with (zring 0:R). -apply interpR_int; Algebra. +apply interpR_int; algebra. astepl (Zero:R). astepl (x[*]Zero). Step_final (x[*]zring 0). @@ -376,18 +356,17 @@ intros n e0 H3 e1 H4 f. elim f; simpl in |- *; auto. intros n e0 H3 f. elim f; simpl in |- *; auto. -intros; apply interpR_mult with x y; Algebra. -intros; apply interpR_wd with (y[*]x); Algebra. -apply interpR_mult with y x; Algebra. +intros; apply interpR_mult with x y; algebra. +intros; apply interpR_wd with (y[*]x); algebra. +apply interpR_mult with y x; algebra. intros; apply interpR_wd with (y[*]One[*]x). apply MI_mult_corr_R; auto. -apply interpR_mult with y (One:R); Algebra. -apply (interpR_int R val unop binop pfun 1); Algebra. +apply interpR_mult with y (One:R); algebra. +apply (interpR_int R val unop binop pfun 1); algebra. Step_final (x[*](y[*]One)). -intros. inversion X0. - try (rewrite H0 in H2; rewrite H in X2; rewrite H1 in X3). (* compat 8.0 *) +intros. inversion X0. rewrite H0 in H2. rewrite H in X2. rewrite H1 in X3. apply interpR_wd with (x0[*](y0[*]y)). -apply interpR_mult with x0 (y0[*]y); Algebra. +apply interpR_mult with x0 (y0[*]y); algebra. Step_final (x0[*]y0[*]y). Qed. Transparent MI_mult. @@ -407,11 +386,10 @@ cut (forall (e f:expr) (x y:R), II e x -> II f y -> II (expr_mult e f) (x[*]y)). intros H H0 H1 e. elim e; intros; simpl in |- *; auto. -intros; apply interpR_mult with x y; Algebra. -intros; apply interpR_wd with (y[*]x); Algebra. +intros; apply interpR_mult with x y; algebra. +intros; apply interpR_wd with (y[*]x); algebra. apply MI_mult_corr_R; auto. -intros. inversion X0. - try (rewrite H0 in H2; rewrite H in X2; rewrite H1 in X3). (* compat 8.0 *) +intros. inversion X0. rewrite H0 in H2. rewrite H in X2. rewrite H1 in X3. apply interpR_wd with (y0[*]y[*]x0). apply MV_mult_corr_R; auto. astepl (x0[*](y0[*]y)). @@ -440,10 +418,8 @@ elim f1; simpl in |- *; auto. intro m. cut (eq_nat n m = true -> n = m). elim (eq_nat n m); simpl in |- *; auto. -intros. inversion X. - try (rewrite H6 in X1; rewrite H8 in X2; rewrite H7 in H9). (* compat 8.0 *) -inversion X0. - try (rewrite H10 in X3; rewrite H12 in X4; rewrite H11 in H13). (* compat 8.0 *) +intros. inversion X. rewrite H6 in X1. rewrite H8 in X2. rewrite H7 in H9. +inversion X0. rewrite H10 in X3. rewrite H12 in X4. rewrite H11 in H13. apply interpR_wd with ((y0[+]y1)[*]x0). apply MV_mult_corr_R; auto. astepl (x0[*](y0[+]y1)). @@ -464,16 +440,14 @@ cut (andb (eq_nat u u0) (eq_expr e0 e5) = true -> u = u0). cut (andb (eq_nat u u0) (eq_expr e0 e5) = true -> e0 = e5). elim andb; simpl in |- *; auto. intros H' H''. intros. -inversion X. - try (rewrite -> H7 in X1; rewrite H9 in X2; rewrite H8 in H10). (* compat 8.0 *) -inversion X0. - try (rewrite H11 in X3; rewrite H13 in X4; rewrite H12 in H14). (* compat 8.0 *) +inversion X. rewrite <- H7. rewrite H9 in X2. rewrite H8 in H10. +inversion X0. rewrite H11 in X3. rewrite H13 in X4. rewrite H12 in H14. apply interpR_wd with ((y0[+]y1)[*]x0). apply MV_mult_corr_R; auto. astepr (x0[*]y0[+]x1[*]y1). astepl (y0[*]x0[+]y1[*]x0). -apply bin_op_wd_unfolded. Algebra. astepr (y1[*]x1). apply mult_wdr. +apply bin_op_wd_unfolded. algebra. astepr (y1[*]x1). apply mult_wdr. apply refl_interpR with val unop binop pfun (expr_unop u e0). -auto. rewrite H'. rewrite H''. auto. auto. auto. +rewrite <- H7; auto. rewrite H'. rewrite H''. auto. auto. auto. intro. elim (andb_prop _ _ H7); intros. apply eq_expr_corr; auto. intro. elim (andb_prop _ _ H7); intros. apply eq_nat_corr; auto. @@ -490,16 +464,14 @@ cut (andb (eq_nat u u0) (andb (eq_expr e0 e6) (eq_expr e3 e7)) = true -> e3 = e7). elim andb; simpl in |- *; auto. intros H' H'' H'''. intros. -inversion X. - try (rewrite H9 in X1; rewrite H11 in X2; rewrite H10 in H12). (* compat 8.0 *) -inversion X0. - try (rewrite H13 in X3; rewrite H15 in X4; rewrite H14 in H16). (* compat 8.0 *) +inversion X. rewrite <- H9. rewrite H11 in X2. rewrite H10 in H12. +inversion X0. rewrite H13 in X3. rewrite H15 in X4. rewrite H14 in H16. apply interpR_wd with ((y0[+]y1)[*]x0). apply MV_mult_corr_R; auto. astepr (x0[*]y0[+]x1[*]y1). astepl (y0[*]x0[+]y1[*]x0). -apply bin_op_wd_unfolded. Algebra. astepr (y1[*]x1). apply mult_wdr. +apply bin_op_wd_unfolded. algebra. astepr (y1[*]x1). apply mult_wdr. apply refl_interpR with val unop binop pfun (expr_binop u e0 e3). -auto. rewrite H'. rewrite H''. rewrite H'''. auto. auto. auto. +rewrite <- H9; auto. rewrite H'. rewrite H''. rewrite H'''. auto. auto. auto. auto. intro. elim (andb_prop _ _ H9); intros. elim (andb_prop _ _ H11); intros. apply eq_expr_corr; auto. @@ -517,16 +489,14 @@ cut (andb (eq_nat f f1) (eq_expr e0 e5) = true -> f = f1). cut (andb (eq_nat f f1) (eq_expr e0 e5) = true -> e0 = e5). elim (andb (eq_nat f f1) (eq_expr e0 e5)); simpl in |- *; auto. intros. -inversion X. - try (rewrite H9 in X1; rewrite H11 in X2; rewrite H10 in H12). (* compat 8.0 *) -inversion X0. - try (rewrite H13 in X3; rewrite H15 in X4; rewrite H14 in H16). (* compat 8.0 *) +inversion X. rewrite <- H9. rewrite H11 in X2. rewrite H10 in H12. +inversion X0. rewrite H13 in X3. rewrite H15 in X4. rewrite H14 in H16. apply interpR_wd with ((y0[+]y1)[*]x0). apply MV_mult_corr_R; auto. astepr (x0[*]y0[+]x1[*]y1). astepl (y0[*]x0[+]y1[*]x0). -apply bin_op_wd_unfolded. Algebra. astepr (y1[*]x1). apply mult_wdr. +apply bin_op_wd_unfolded. algebra. astepr (y1[*]x1). apply mult_wdr. apply refl_interpR with val unop binop pfun (expr_part f e0). -auto. rewrite H7. rewrite H8; auto. auto. +rewrite <- H9; auto. rewrite H7. rewrite H8; auto. auto. intro. elim (andb_prop _ _ H7); intros. apply eq_expr_corr; auto. intro. elim (andb_prop _ _ H7); intros. apply eq_nat_corr; auto. simpl in |- *; auto. @@ -538,13 +508,11 @@ elim f; simpl in |- *; auto. intros u e0 H1 f. elim f; simpl in |- *; auto. -intros; apply interpR_plus with x y; Algebra. -intros. inversion X. - try (rewrite H1 in H0; rewrite H in H0). (* compat 8.0 *) -inversion X0. - try (rewrite H2 in H3; rewrite H4 in H3). (* compat 8.0 *) +intros; apply interpR_plus with x y; algebra. +intros. inversion X. rewrite H1 in H0. rewrite H in H0. +inversion X0. rewrite H2 in H3. rewrite H4 in H3. apply interpR_wd with (zring (i + j):R). -apply interpR_int; Algebra. +apply interpR_int; algebra. Step_final (zring i[+]zring j:R). Qed. Transparent MV_mult. @@ -578,21 +546,19 @@ simpl in |- *; auto. simpl in |- *; auto. simpl in |- *; auto. simpl in |- *; auto. -intros; apply interpR_wd with (y[+]x); Algebra. -apply interpR_plus with y x; Algebra. -intros; apply interpR_plus with x y; Algebra. +intros; apply interpR_wd with (y[+]x); algebra. +apply interpR_plus with y x; algebra. +intros; apply interpR_plus with x y; algebra. intros; apply MM_plus_corr_R; auto. -intros. inversion X0. - try (rewrite H in X2; rewrite H1 in X3; rewrite H0 in H2). (* compat 8.0 *) +intros. inversion X0. rewrite H in X2. rewrite H1 in X3. rewrite H0 in H2. apply interpR_wd with (y0[+](x0[+]y)). apply X; auto. apply MM_plus_corr_R; auto. astepl (y0[+]x0[+]y). Step_final (x0[+]y0[+]y). -intros. inversion X0. - try (rewrite H in X2; rewrite H1 in X3; rewrite H0 in H2). (* compat 8.0 *) +intros. inversion X0. rewrite H in X2. rewrite H1 in X3. rewrite H0 in H2. apply interpR_wd with (x0[+](y0[+]y)). -apply interpR_plus with x0 (y0[+]y); Algebra. +apply interpR_plus with x0 (y0[+]y); algebra. Step_final (x0[+]y0[+]y). Qed. Transparent MM_plus. @@ -612,11 +578,10 @@ cut (forall (e f:expr) (x y:R), II e x -> II f y -> II (expr_plus e f) (x[+]y)). intros H H0 H1 e. elim e; intros; simpl in |- *; auto. -intros. apply interpR_plus with x y; Algebra. -intros. apply interpR_wd with (y[+]x); Algebra. +intros. apply interpR_plus with x y; algebra. +intros. apply interpR_wd with (y[+]x); algebra. apply PM_plus_corr_R; auto. -intros. inversion X0. - try (rewrite H in X2; rewrite H1 in X3; rewrite H0 in H2). (* compat 8.0 *) +intros. inversion X0. rewrite H in X2. rewrite H1 in X3. rewrite H0 in H2. apply interpR_wd with (y0[+]y[+]x0). apply PM_plus_corr_R; auto. astepl (x0[+](y0[+]y)). @@ -640,15 +605,14 @@ cut (forall (e f:expr) (x y:R), II e x -> II f y -> II (expr_mult e f) (x[*]y)). intros H H0 H1 e. elim e; intros; simpl in |- *; auto. -intros. apply interpR_mult with x y; Algebra. +intros. apply interpR_mult with x y; algebra. intros. apply interpR_wd with (zring 0[+]y[*]x). apply PM_plus_corr_R. -apply interpR_int; Algebra. +apply interpR_int; algebra. apply MI_mult_corr_R; auto. astepl (Zero[+]y[*]x). Step_final (y[*]x). -intros. inversion X0. - try (rewrite H in X2; rewrite H1 in X3; rewrite H0 in H2). (* compat 8.0 *) +intros. inversion X0. rewrite H in X2. rewrite H1 in X3. rewrite H0 in H2. apply interpR_wd with (y0[*]y[+]x0[*]y). apply PM_plus_corr_R; auto. apply MM_mult_corr_R; auto. @@ -671,11 +635,10 @@ cut (forall (e f:expr) (x y:R), II e x -> II f y -> II (expr_mult e f) (x[*]y)). intros H H0 H1 e. elim e; intros; simpl in |- *; auto. -intros. apply interpR_mult with x y; Algebra. -intros. apply interpR_wd with (y[*]x); Algebra. +intros. apply interpR_mult with x y; algebra. +intros. apply interpR_wd with (y[*]x); algebra. apply PM_mult_corr_R; auto. -intros. inversion X0. - try (rewrite H in X2; rewrite H1 in X3; rewrite H0 in H2). (* compat 8.0 *) +intros. inversion X0. rewrite H in X2. rewrite H1 in X3. rewrite H0 in H2. apply interpR_wd with (y[*]x0[+]y0[*]y). apply PP_plus_corr_R; auto. apply PM_mult_corr_R; auto. @@ -696,15 +659,15 @@ Cut (e1,e2,f1,f2:expr; x,y:R) Cut (e,f:expr; x,y:R)(II e x)->(II f y)->(II (expr_plus e f) x[+]y). Intros H H0 e f. Elim e; Elim f; Intros; Simpl; Auto. -Intros. Apply interpR_plus with x y; Algebra. +Intros. Apply interpR_plus with x y; algebra. Intros. Inversion H. Inversion H0. Apply interpR_div_one with x[+]y. -Algebra. +algebra. Apply interpR_wd with x0[*]One[+]One[*]x1. Apply PP_plus_corr_R; Apply PP_mult_corr_R; Auto; - Apply interpR_int with k:=`1`; Algebra. + Apply interpR_int with k:=`1`; algebra. Step_final x0[+]x1. -Apply interpR_wd with (One::R)[*]One; Algebra. +Apply interpR_wd with (One::R)[*]One; algebra. Apply PP_mult_corr_R; Auto. Qed. @@ -717,12 +680,12 @@ Cut (e1,e2,f1,f2:expr; x,y:R) Cut (e,f:expr; x,y:R)(II e x)->(II f y)->(II (expr_mult e f) x[*]y). Intros H H0 e f. Elim e; Elim f; Intros; Simpl; Auto. -Intros. Apply interpR_mult with x y; Algebra. +Intros. Apply interpR_mult with x y; algebra. Intros. Inversion H. Inversion H0. Apply interpR_div_one with x0[*]x1. -Algebra. +algebra. Apply PP_mult_corr_R; Auto. -Apply interpR_wd with (One::R)[*]One; Algebra. +Apply interpR_wd with (One::R)[*]One; algebra. Apply PP_mult_corr_R; Auto. Qed. @@ -749,69 +712,62 @@ intro; induction e; intros; simpl in |- *. apply (interpR_plus R val unop binop pfun (expr_mult (expr_var v) expr_one) expr_zero x (Zero:R) x). -Algebra. +algebra. apply (interpR_mult R val unop binop pfun (expr_var v) expr_one x (One:R) x); - Algebra. -apply (interpR_int R val unop binop pfun 1); Algebra. -apply (interpR_int R val unop binop pfun 0); Algebra. + algebra. +apply (interpR_int R val unop binop pfun 1); algebra. +apply (interpR_int R val unop binop pfun 0); algebra. assumption. -inversion X. - try (rewrite H in X0; rewrite H1 in X1; rewrite H0 in H2). (* compat 8.0 *) +inversion X. rewrite H in X0. rewrite H1 in X1. rewrite H0 in H2. apply interpR_wd with (x0[+]y). apply PP_plus_corr_R; auto. auto. -inversion X. - try (rewrite H in X0; rewrite H1 in X1; rewrite H0 in H2). (* compat 8.0 *) +inversion X. rewrite H in X0. rewrite H1 in X1. rewrite H0 in H2. apply interpR_wd with (x0[*]y). apply PP_mult_corr_R; auto. auto. assumption. -inversion X. - try (rewrite H in H2; rewrite H1 in X0; rewrite H0 in H2). (* compat 8.0 *) +inversion X. rewrite H in H2. rewrite H1 in X0. rewrite H0 in H2. apply (interpR_plus R val unop binop pfun (expr_mult (expr_unop u (NormR e)) expr_one) expr_zero x ( Zero:R) x). -Algebra. +algebra. apply (interpR_mult R val unop binop pfun (expr_unop u (NormR e)) expr_one x - (One:R) x); Algebra. -apply (interpR_unop R val unop binop pfun (NormR e) u x0); Algebra. -apply (interpR_int R val unop binop pfun 1); Algebra. -apply (interpR_int R val unop binop pfun 0); Algebra. - -inversion X. - (* compat 8.0 *) - try (rewrite H in H3; rewrite H1 in X0; rewrite H2 in X1; rewrite H0 in H3). + (One:R) x); algebra. +apply (interpR_unop R val unop binop pfun (NormR e) u x0); algebra. +apply (interpR_int R val unop binop pfun 1); algebra. +apply (interpR_int R val unop binop pfun 0); algebra. + +inversion X. rewrite H in H3. rewrite H1 in X0. rewrite H2 in X1. rewrite H0 in H3. apply (interpR_plus R val unop binop pfun (expr_mult (expr_binop b (NormR e1) (NormR e2)) expr_one) expr_zero x (Zero:R) x). -Algebra. +algebra. apply (interpR_mult R val unop binop pfun (expr_binop b (NormR e1) (NormR e2)) - expr_one x (One:R) x); Algebra. + expr_one x (One:R) x); algebra. apply (interpR_binop R val unop binop pfun (NormR e1) (NormR e2) b x0 y); - Algebra. -apply (interpR_int R val unop binop pfun 1); Algebra. -apply (interpR_int R val unop binop pfun 0); Algebra. + algebra. +apply (interpR_int R val unop binop pfun 1); algebra. +apply (interpR_int R val unop binop pfun 0); algebra. -inversion X. - try ((generalize Hx H2; clear Hx H2; rewrite H; intros Hx H2); - rewrite H1 in X0; rewrite H0 in H2). (* compat 8.0 *) +inversion X. rewrite <- H. rewrite H1 in X0. rewrite H0 in H2. apply (interpR_plus R val unop binop pfun - (expr_mult (expr_part p (NormR e)) expr_one) expr_zero x ( + (expr_mult (expr_part f (NormR e)) expr_one) expr_zero x ( Zero:R) x). -Algebra. +algebra. apply - (interpR_mult R val unop binop pfun (expr_part p (NormR e)) expr_one x - (One:R) x); Algebra. -apply (interpR_part R val unop binop pfun (NormR e) p x0) with (Hx := Hx); - Algebra. -apply (interpR_int R val unop binop pfun 1); Algebra. -apply (interpR_int R val unop binop pfun 0); Algebra. + (interpR_mult R val unop binop pfun (expr_part f (NormR e)) expr_one x + (One:R) x); algebra. +apply (interpR_part R val unop binop pfun (NormR e) f x0) with (Hx := Hx); + algebra. +apply (interpR_int R val unop binop pfun 1); algebra. +apply (interpR_int R val unop binop pfun 0); algebra. Qed. Lemma Tactic_lemmaR : @@ -827,4 +783,127 @@ apply NormR_corr; apply xexprR2interpR. Qed. End Ring_NormCorrect. + +Ltac QuoteR R l t := +match l with + (Quad ?vl ?ul ?bl ?pl) => +(let a := constr:(fun n:varindex => (Mnth n vl (cm_unit R))) in + let b := constr:(fun n:unopindex => (Mnth n ul (@cg_inv R))) in + let c := constr:(fun n:binopindex => (Mnth n bl (@csg_op R))) in + let d := constr:(fun n:pfunindex => (Mnth n pl (total_eq_part _ (@cg_inv R)))) in + match t with + | (zring ?k) => + match (ClosedZ k) with + | true => constr:(xexprR_int R a b c d k) + end + | (csbf_fun _ _ _ csg_op ?x ?y) => + let x' := QuoteR R l x in + let y' := QuoteR R l y in + constr:(xexprR_plus R a b c d _ _ x' y') + | (csbf_fun _ _ _ cr_mult ?x ?y) => + let x' := QuoteR R l x in + let y' := QuoteR R l y in + constr:(xexprR_mult R a b c d _ _ x' y') + | (Zero) => constr:(xexprR_zero R a b c d) + | (One) => constr:(xexprR_one R a b c d) + | (nring ?n) => + match (ClosedNat n) with + | true => constr:(xexprR_nat R a b c d n) + end + | (csf_fun _ _ cg_inv ?x) => + let x' := QuoteR R l x in + constr:(xexprR_inv R a b c d _ x') + | (cg_minus ?x ?y) => + let x' := QuoteR R l x in + let y' := QuoteR R l y in + constr:(xexprR_minus R a b c d _ _ x' y') + | (csf_fun _ _ (@nexp_op _ ?n) ?x) => + match (ClosedNat n) with + | true => let x' := QuoteR R l x in + constr:(xexprR_power R a b c d _ x' n) + end + | (pfpfun ?f ?x ?h) => + let x' := QuoteR R l x in + let i := FindIndex f pl in + constr:(xexprR_part R a b c d _ i x' h) + | (csf_fun _ _ ?f ?x) => + let x' := QuoteR R l x in + let i := FindIndex f ul in + constr:(xexprR_unop R a b c d _ i x') + | (csbf_fun _ _ _ ?f ?x ?y) => + let x' := QuoteR R l x in + let y' := QuoteR R l y in + let i := FindIndex f bl in + constr:(xexprR_binop R a b c d _ _ i x' y') + | ?t => + let i := FindIndex t vl in + constr:(xexprR_var R a b c d i) +end) +end. + +Ltac FindTermVariablesR t l := +match t with +| (zring ?k) => + match (ClosedZ k) with + | true => constr:l + end +| (csbf_fun _ _ _ csg_op ?x ?y) => + let l1 := FindTermVariablesR x l in + let l2 := FindTermVariablesR y l1 in + constr:l2 +| (csbf_fun _ _ _ cr_mult ?x ?y) => + let l1 := FindTermVariablesR x l in + let l2 := FindTermVariablesR y l1 in + constr:l2 +| (Zero) => constr:l +| (One) => constr:l +| (nring ?n) => + match (ClosedNat n) with + | true => constr:l + end +| (csf_fun _ _ cg_inv ?x) => + let l1 := FindTermVariablesR x l in + constr:l1 +| (cg_minus ?x ?y) => + let l1 := FindTermVariablesR x l in + let l2 := FindTermVariablesR y l1 in + constr:l2 +| (csf_fun _ _ (@nexp_op _ ?n) ?x) => + match (ClosedNat n) with + | true => let l1 := FindTermVariablesR x l in + constr:l1 + end +| (pfpfun ?f ?x ?h) => + let l1 := FindTermVariablesR x l in + match l1 with + (Quad ?vl ?ul ?bl ?pl) => constr:(Quad vl ul bl (Mcons f pl)) + end +| (csf_fun _ _ ?f ?x) => + let l1 := FindTermVariablesR x l in + match l1 with + (Quad ?vl ?ul ?bl ?pl) => constr:(Quad vl (Mcons f ul) bl pl) + end +| (csbf_fun _ _ _ ?f ?x ?y) => + let l1 := FindTermVariablesR x l in + let l2 := FindTermVariablesR y l1 in + match l2 with + (Quad ?vl ?ul ?bl ?pl) => constr:(Quad vl ul (Mcons f bl) pl) + end +| ?t => match l with + (Quad ?vl ?ul ?bl ?pl) => constr:(Quad (Mcons t vl) ul bl pl) + end +end. + +Ltac FindTermsVariablesR fn t1 t2 := + let l1 := FindTermVariablesR t1 (Quad (Mnil fn) (Mnil (CSetoid_un_op fn)) (Mnil (CSetoid_bin_op fn)) (Mnil (PartFunct fn))) in + let l2 := FindTermVariablesR t2 l1 in + constr:l2. + +Ltac rationalR R x y := + let l:=FindTermsVariablesR R x y in + let t1:=(QuoteR R l x) in + let t2:=(QuoteR R l y) in + eapply Tactic_lemmaR with (e:=t1) (f:=t2) + ; reflexivity. + (* end hide *) diff --git a/tactics/Step.v b/tactics/Step.v index 0a7293799..f6886fe0b 100644 --- a/tactics/Step.v +++ b/tactics/Step.v @@ -1,48 +1,12 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* begin hide *) -Declare ML Module "rational". - -Ltac Algebra := auto with algebra_r algebra algebra_c algebra_s. +Ltac algebra := auto with algebra_r algebra algebra_c algebra_s. -Ltac astepl x := stepl x; [idtac | Algebra]. +Ltac astepl x := stepl x; [idtac | algebra]. -Ltac astepr x := stepr x; [idtac | Algebra]. +Ltac astepr x := stepr x; [idtac | algebra]. Tactic Notation "astepl" constr(c) := astepl c. Tactic Notation "astepr" constr(c) := astepr c. -Ltac rstepl x := stepl x; [idtac | rational]. - -Ltac rstepr x := stepr x; [idtac | rational]. - -Tactic Notation "rstepl" constr(c) := rstepl c. - -Tactic Notation "rstepr" constr(c) := rstepr c. - Ltac Included := eauto with included. - -(* end hide *) - -(** * [algebra] and [step] -These tactics simplify equational reasoning. See the references for a -description. - -* [Included] -[Included] will solve goals of the form [(included A (dom F))]. -*) diff --git a/tactics/Transparent_algebra.v b/tactics/Transparent_algebra.v index 80e21a3f9..0e939fdc2 100644 --- a/tactics/Transparent_algebra.v +++ b/tactics/Transparent_algebra.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Transparent cs_crr. diff --git a/tactics/csetoid_rewrite.v b/tactics/csetoid_rewrite.v index 339519842..b7fb2693e 100644 --- a/tactics/csetoid_rewrite.v +++ b/tactics/csetoid_rewrite.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) (** 200904: first experimental version submitted to corn; diff --git a/tactics/rational.ml b/tactics/rational.ml index bbd571b71..c959ccb0d 100644 --- a/tactics/rational.ml +++ b/tactics/rational.ml @@ -58,9 +58,10 @@ let sixth_arg c = (args_app c).(5) let xinterp g c = sixth_arg (pf_type_of g c) +let mk_existential env = Evarutil.new_evar_in_sign env + let mk_lambda n t c = mkLambda (n,t,c) -let mk_cast c k t = mkCast (c,k,t) -let mk_default_cast c t = mk_cast c DEFAULTcast t +let mk_cast c t = mkCast (c,t) let mk_case ci a b c = mkCase (ci,a,b,c) let pf_nf_betadeltaiota = pf_reduce nf_betadeltaiota @@ -102,9 +103,11 @@ let xrational verbose g a = and pos_xI = coq_constant "xI" and pos_xO = coq_constant "xO" and pos_xH = coq_constant "xH" - and int_Z0 = coq_constant "Z0" - and int_Zpos = coq_constant "Zpos" - and int_Zneg = coq_constant "Zneg" in + and int_ZERO = coq_constant "ZERO" + and int_POS = coq_constant "POS" + and int_NEG = coq_constant "NEG" + + and cs_eq = constant_algebra "CSetoids.cs_eq" in let xexpr_constant s = try constant_tactics (the_file ^ ".xexpr" ^ the_suffix ^ "_" ^ s) @@ -184,13 +187,13 @@ let xrational verbose g a = else raise (Failure "evalint") in let rec evalint n = - if eq_constr n int_Z0 then 0 + if eq_constr n int_ZERO then 0 else if isApp n then let f = hd_app n and a = args_app n in if Array.length a > 0 then - if eq_constr f int_Zpos then evalpos a.(0) - else if eq_constr f int_Zneg then -(evalpos a.(0)) + if eq_constr f int_POS then evalpos a.(0) + else if eq_constr f int_NEG then -(evalpos a.(0)) else raise (Failure "evalint") else raise (Failure "evalint") else raise (Failure "evalint") in @@ -302,9 +305,9 @@ let xrational verbose g a = mkApp((if l == 0 then pos_xO else pos_xI), [| posconstr (k / 2) |]) in let rec intconstr k = - if k == 0 then int_Z0 else - if k > 0 then mkApp(int_Zpos, [| posconstr k |]) else - mkApp(int_Zneg, [| posconstr (- k) |]) in + if k == 0 then int_ZERO else + if k > 0 then mkApp(int_POS, [| posconstr k |]) else + mkApp(int_NEG, [| posconstr (- k) |]) in let rec xexprconstr t rhoV rhoU rhoB rhoP = match t with @@ -357,7 +360,7 @@ let xrational verbose g a = let rec valconstr e ta = match e with [] -> mk_lambda Anonymous nat_nat - (mk_default_cast (mkApp(csg_unit, [|the_cmonoid |])) ta) + (mk_cast (mkApp(csg_unit, [|the_cmonoid |])) ta) | [c] -> mk_lambda Anonymous nat_nat c | c::f -> mk_lambda (Name (id_of_string "n")) nat_nat (mk_case nat_info ta (mkRel 1) [| c; valconstr f ta |]) in @@ -365,7 +368,7 @@ let xrational verbose g a = let rec unconstr e ta = match e with [] -> mk_lambda Anonymous nat_nat - (mk_default_cast (mkApp(id_un_op, [|the_csetoid |])) ta) + (mk_cast (mkApp(id_un_op, [|the_csetoid |])) ta) | [c] -> mk_lambda Anonymous nat_nat c | c::f -> mk_lambda (Name (id_of_string "n")) nat_nat (mk_case nat_info ta (mkRel 1) [| c; unconstr f ta |]) in @@ -373,7 +376,7 @@ let xrational verbose g a = let rec binconstr e ta = match e with [] -> mk_lambda Anonymous nat_nat - (mk_default_cast (mkApp(cs_binproj1, [|the_csetoid |])) ta) + (mk_cast (mkApp(cs_binproj1, [|the_csetoid |])) ta) | [c] -> mk_lambda Anonymous nat_nat c | c::f -> mk_lambda (Name (id_of_string "n")) nat_nat (mk_case nat_info ta (mkRel 1) [| c; binconstr f ta |]) in @@ -381,7 +384,7 @@ let xrational verbose g a = let rec funconstr e ta = match e with [] -> mk_lambda Anonymous nat_nat - (mk_default_cast (mkApp(fid, [|the_csetoid |])) ta) + (mk_cast (mkApp(fid, [|the_csetoid |])) ta) | [c] -> mk_lambda Anonymous nat_nat c | c::f -> mk_lambda (Name (id_of_string "n")) nat_nat (mk_case nat_info ta (mkRel 1) [| c; funconstr f ta |]) in @@ -466,10 +469,10 @@ let hrational1 verbose g = if verbose then msgnl (str "begin Rational"); hrational verbose g -TACTIC EXTEND rational -| ["rational"] -> [ hrational1 false ] +TACTIC EXTEND Rational +| ["Rational"] -> [ hrational1 false ] END -TACTIC EXTEND rational_verbose -| ["rational" "verbose"] -> [ hrational1 true ] +TACTIC EXTEND RationalVerbose +| ["Rational" "Verbose"] -> [ hrational1 true ] END diff --git a/tools/COPYING b/tools/COPYING index 5b6e7c66c..b6f92f3db 100644 --- a/tools/COPYING +++ b/tools/COPYING @@ -2,7 +2,7 @@ Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -305,7 +305,7 @@ the "copyright" line and a pointer to where the full notice is found. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA Also add information on how to contact you by electronic and paper mail. diff --git a/tools/realpath.c b/tools/realpath.c index d7b991852..3768332f8 100644 --- a/tools/realpath.c +++ b/tools/realpath.c @@ -1,62 +1,143 @@ /* This file is extracted unchanged from the dwww program. - * dwww is free software. You may copy it according to the - * GNU General Public License, version 2. + * dwww is free software. You can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* * realpath.c -- output the real path of a filename. * Lars Wirzenius. */ - + +#define _GNU_SOURCE #include #include #include #include #include -#include #include #include +#include +#include static char *stripdir(char * dir, char *buf, int maxlen); -int main(int argc, char **argv) { - char buf[10240]; - int i; - int err; - int do_strip; - - err = 0; - do_strip = (argc < 2 || strcmp(argv[1], "-s")) ? 0 : 1; +int option_strip = 0; /* do stripdir */ +int option_zero = 0; /* output zero terminated */ +char * myname = ""; +extern int optind; + +static const struct option long_options [] = { + {"strip", no_argument, NULL, 's'}, + {"zero", no_argument, NULL, 'z'}, + {"help", no_argument, NULL, 'h'}, + {"version", no_argument, NULL, 'v'}, + {0, 0, 0, 0 } +}; +static const char *short_options = "szhv?"; + +static void error( char * fmt, ... ) { + va_list list; + + va_start(list, fmt); + vfprintf(stderr, fmt, list); + fflush(stderr); + va_end(list); +} + + +static void show_usage( int exit_code ) { + error( "Usage:\n" + " %s [-s|--strip] [-z|--zero] filename ...\n" + " %s -h|--help\n" + " %s -v|--version\n", myname, myname, myname); + exit( exit_code ); +} + +static void show_version( int exit_code ) { + error("%s version %s\n", myname, VERSION); + exit ( exit_code ); +} + + + +static void parse_options(int argc, char ** argv ) { + int c, opt_idx; - if (argc < 2 + do_strip) { - fprintf(stderr, "usage: %s [-s] filename ...\n", argv[0]); - return 1; + while ((c = getopt_long( argc, + argv, + short_options, + long_options, + &opt_idx )) != EOF ) { + switch (c) { + case 's': + option_strip = 1; + break; + case 'z': + option_zero = 1; + break; + case 'v': + show_version( 0 ); + /* NOT REACHED */ + case 'h': + case '?': + show_usage( 0 ); + /* NOT REACHED */ + default: + error("%s: Unknown option: %c\n", myname, c); + show_usage( 2 ); + /* NOT REACHED */ + } + } + + if ( optind == argc ) { + error("%s: need at least one filename\n", myname); + show_usage(2); + /* NOT REACHED */ } +} + + + +int main(int argc, char **argv) { + char buf[10240]; + char * p; + int status = 0; + char * ok; + + myname = ( p = strchr(argv[0], '/') ) ? p+1 : argv[0]; - for (i = 1 + do_strip; i < argc; ++i) { - if ( - (do_strip && stripdir(argv[i], buf, 10240) == NULL) - || (!do_strip && realpath(argv[i], buf) == NULL) - ) { - fprintf(stderr, "%s: %s\n", argv[i], strerror(errno)); - fflush(stderr); - err = 1; + parse_options(argc, argv); + + while (optind < argc) { + if (option_strip) { + ok = stripdir( argv[optind], buf, sizeof(buf)); } else { - - printf("%s\n", buf); + ok = realpath(argv[optind], buf); + } + if (!ok) { + error( "%s: %s\n", argv[optind], strerror(errno)); + status = 1; + } else { + fprintf(stdout, "%s", buf); + putc(option_zero ? '\0' : '\n', stdout); fflush(stdout); if (ferror(stdout)) { - perror("stdout"); - return 1; + error("error writing to stdout: %s\n", strerror(errno)); + exit( 3 ); } } + optind++; } - - return err; + return status; } -char *stripdir(char * dir, char *buf, int maxlen) { +static char *stripdir(char * dir, char *buf, int maxlen) { char * in, * out; char * last; int ldots; @@ -99,13 +180,13 @@ char *stripdir(char * dir, char *buf, int maxlen) { } ldots = 0; - } else if (*in == '.') { + } else if (*in == '.' && ldots > -1) { ldots++; } else { - ldots = 0; + ldots = -1; } - out++; + out++; if (!*in) break; diff --git a/transc/Exponential.v b/transc/Exponential.v index 2ec61faa4..85c8aad59 100644 --- a/transc/Exponential.v +++ b/transc/Exponential.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export TaylorSeries. @@ -36,7 +20,7 @@ Qed. Lemma Exp_wd : forall x y : IR, x [=] y -> Exp x [=] Exp y. intros x y H. -unfold Exp in |- *; Algebra. +unfold Exp in |- *; algebra. Qed. Hint Resolve Exp_wd: algebra. @@ -55,7 +39,7 @@ intro H. cut (convergent h). intro H0. apply eq_transitive_unfolded with (series_sum h H0). - apply series_sum_wd; Algebra. + apply series_sum_wd; algebra. unfold series_sum in |- *. apply eq_symmetric_unfolded. eapply eq_transitive_unfolded. @@ -65,14 +49,14 @@ apply Lim_seq_eq_Lim_subseq with (f := fun n : nat => S n). intro n; exists (S n); split; auto with arith. intro n; simpl in |- *. induction n as [| n Hrecn]; simpl in |- *; - [ Algebra | Step_final (OneR[+]Zero) ]. + [ algebra | Step_final (OneR[+]Zero) ]. apply convergent_wd with (fun n : nat => (One[/] _[//]nring_fac_ap_zero IR n) [*]nexp _ n (Zero[-]Zero)). - Algebra. + algebra. exact (fun_series_conv_imp_conv Zero Zero (leEq_reflexive IR Zero) Exp_ps (Exp_conv Zero Zero (leEq_reflexive IR Zero) @@ -114,7 +98,7 @@ eapply Derivative_wdr. Derivative_FPowerSeries1' with (a := fun _ : nat => OneR) (Hg := H0). FEQ. simpl in |- *. -apply series_sum_wd; Algebra. +apply series_sum_wd; algebra. fold Exp_ps in |- *; apply Exp_conv. Qed. @@ -167,7 +151,7 @@ Lemma One_leEq_Exp : forall x : IR, Zero [<=] x -> One [<=] Exp x. intros x H. astepl (Exp Zero). apply resp_leEq_char; auto. - Algebra. + algebra. intro H0; astepl OneR. apply One_less_Exp; auto. Qed. @@ -194,7 +178,7 @@ Qed. Lemma Exp_bnd : Taylor_bnd (fun n => Expon). apply bnd_imp_Taylor_bnd with Expon. - intros n x Hx Hx'; apply eq_imp_leEq; Algebra. + intros n x Hx Hx'; apply eq_imp_leEq; algebra. Contin. Included. Qed. @@ -215,7 +199,7 @@ apply (bndf := bndf) (derF := derF); auto. apply bnd_imp_Taylor_bnd with F. - intros; apply eq_imp_leEq; Algebra. + intros; apply eq_imp_leEq; algebra. apply Derivative_n_imp_Continuous with CI 1 F; auto with arith. intro n. change (included realline (Dom F)) in |- *. @@ -223,7 +207,7 @@ apply intros; astepr OneR. astepr (Exp Zero). Opaque Expon. - unfold Exp in |- *; simpl in |- *; Algebra. + unfold Exp in |- *; simpl in |- *; algebra. Transparent Expon. apply Taylor_Series_conv_to_fun; auto. @@ -319,7 +303,7 @@ Lemma Exp_inv_char : forall x : IR, Exp x[*]Exp [--]x [=] One. intro x. astepr (Exp Zero). apply eq_symmetric_unfolded; apply Exp_plus'. -Algebra. +algebra. Qed. Hint Resolve Exp_inv_char: algebra. @@ -396,7 +380,7 @@ Lemma Exp_inv : forall x : IR, Exp [--]x [=] (One[/] _[//]Exp_ap_zero x). intro x. apply mult_cancel_lft with (Exp x). apply Exp_ap_zero. -rstepr OneR; Algebra. +rstepr OneR; algebra. Qed. Hint Resolve Exp_inv: algebra. @@ -405,7 +389,7 @@ Lemma Exp_minus : forall x y : IR, Exp (x[-]y) [=] (Exp x[/] _[//]Exp_ap_zero y) intros x y. unfold cg_minus in |- *; astepl (Exp x[*]Exp [--]y). rstepr (Exp x[*] (One[/] _[//]Exp_ap_zero y)). -Algebra. +algebra. Qed. Hint Resolve Exp_minus: algebra. @@ -454,7 +438,7 @@ Qed. Lemma Exp_resp_leEq : forall x y : IR, x [<=] y -> Exp x [<=] Exp y. intros x y; apply resp_leEq_char. - Algebra. + algebra. intro H; apply Exp_resp_less; auto. Qed. @@ -482,7 +466,7 @@ Hint Resolve Continuous_Log: continuous. Lemma Log_one : forall H, Log One H [=] Zero. intro H; unfold Log in |- *; simpl in |- *. -apply Integral_empty; Algebra. +apply Integral_empty; algebra. Qed. Hint Resolve Log_one: algebra. @@ -497,7 +481,7 @@ Qed. Lemma Log_wd : forall (x y : IR) Hx Hy, x [=] y -> Log x Hx [=] Log y Hy. intros x y Hx Hy H. -unfold Log in |- *; Algebra. +unfold Log in |- *; algebra. Qed. Hint Resolve Log_wd: algebra. @@ -527,7 +511,7 @@ cut (Dom (Logarithm{-}G) x); [ intro H2 | repeat split; simpl in |- *; auto ]. eapply eq_transitive_unfolded. 2: apply (H5 x Hx H2 CI). Opaque Logarithm. -simpl in |- *; Algebra. +simpl in |- *; algebra. clear H5. exists (CAnd_intro _ _ CI CI); apply mult_resp_pos; auto. @@ -535,7 +519,7 @@ exists (CAnd_intro _ _ CI CI); apply mult_resp_pos; auto. intros z w t H3. rstepl (z[-]t[+]t). apply bin_op_wd_unfolded. - 2: Algebra. + 2: algebra. apply cg_inv_unique_2. astepr ( [--]ZeroR). rstepl ( [--] (w[-] (z[-]t))). @@ -547,7 +531,7 @@ apply eq_symmetric_unfolded; eapply eq_transitive_unfolded. 2: apply (H5 One (pos_one IR) H2 CI). simpl in |- *. rstepl (Zero[-] (Log y Hy[-]Log y Hy)). -Algebra. +algebra. Transparent Logarithm. simpl in |- *; apply pos_one. @@ -624,7 +608,7 @@ apply Feq_criterium with CI (Fconst (S:=IR) One) ZeroR. exists CI. split; auto. intro; simpl in |- *; apply Greater_imp_ap. - apply less_wdr with (Exp x); [ apply Exp_pos | simpl in |- *; Algebra ]. + apply less_wdr with (Exp x); [ apply Exp_pos | simpl in |- *; algebra ]. Included. intros; simpl in |- *; rational. apply Derivative_comp with (openl Zero) CI; Deriv. @@ -641,11 +625,11 @@ apply Feq_criterium with CI (Fconst (S:=IR) One) ZeroR. intros x Hx H2; elim H2; intros H3 H4; split. apply leEq_wdr with (Exp x). apply Exp_resp_leEq; auto. - simpl in |- *; Algebra. + simpl in |- *; algebra. apply less_leEq; apply leEq_less_trans with (Exp b). apply leEq_wdl with (Exp x). apply Exp_resp_leEq; auto. - simpl in |- *; Algebra. + simpl in |- *; algebra. apply less_plusOne. Deriv. split. @@ -653,7 +637,7 @@ intros; simpl in |- *. astepr (Log One (pos_one _)). unfold Log in |- *; apply pfwdef. astepr (Exp Zero). -simpl in |- *; Algebra. +simpl in |- *; algebra. Qed. Lemma Log_Exp : forall x H, Log (Exp x) H [=] x. @@ -662,7 +646,7 @@ cut (Dom (Logarithm[o]Expon) x). intro H0. unfold Log in |- *; simpl in |- *; apply eq_transitive_unfolded with (Part _ _ H0). - simpl in |- *; Algebra. + simpl in |- *; algebra. astepr (Part FId x CI). apply Feq_imp_eq with realline. apply Log_Exp_inv. @@ -671,7 +655,7 @@ split. exists CI. apply Log_domain. apply less_wdr with (Exp x); auto. -simpl in |- *; Algebra. +simpl in |- *; algebra. Qed. Transparent Logarithm. @@ -696,7 +680,7 @@ apply leEq_wdr with (Integral (prim_lemma _ _ log_defn_lemma x Hx y Hy)). (Integral (prim_lemma _ _ log_defn_lemma One (pos_one _) x Hx) [+] Integral (prim_lemma _ _ log_defn_lemma x Hx y Hy) [-] Integral (prim_lemma _ _ log_defn_lemma One (pos_one _) x Hx)). - 2: apply cg_minus_wd; Algebra. + 2: apply cg_minus_wd; algebra. 2: apply eq_symmetric_unfolded; apply Integral_plus_Integral with (Min3_leEq_Max3 One y x). 2: apply included_imp_Continuous with (openl Zero); @@ -724,13 +708,13 @@ Lemma Exp_Log : forall x H, Exp (Log x H) [=] x. intros x H. set (y := Exp (Log x H)) in *. cut (Zero [<] y); [ intro H0 | unfold y in |- *; apply Exp_pos ]. -cut (Log y H0 [=] Log x H); [ intro H1 | unfold y in |- *; Algebra ]. +cut (Log y H0 [=] Log x H); [ intro H1 | unfold y in |- *; algebra ]. cut (Zero [=] Log y H0[-]Log x H); [ clear H1; intro H1 | apply eq_symmetric_unfolded; apply x_minus_x; auto ]. apply leEq_imp_eq. apply Exp_Log_lemma with H H0; auto. apply Exp_Log_lemma with H0 H. -astepl ( [--]ZeroR); rstepr ( [--] (Log y H0[-]Log x H)); Algebra. +astepl ( [--]ZeroR); rstepr ( [--] (Log y H0[-]Log x H)); algebra. Qed. Hint Resolve Exp_Log: algebra. @@ -758,7 +742,7 @@ apply eq_imp_Feq. Included. intros x H Hx Hx'; simpl in |- *. astepr (Exp (Log x H)). -unfold Log in |- *; simpl in |- *; Algebra. +unfold Log in |- *; simpl in |- *; algebra. Qed. Lemma Log_E : forall He, Log E He [=] One. @@ -814,13 +798,13 @@ exists y. split; [ apply Min_leEq_rht | apply rht_leEq_Max ]. repeat split. intro; simpl in |- *; apply pos_ap_zero; auto. - simpl in |- *; Algebra. + simpl in |- *; algebra. astepl ZeroR; auto. Qed. Lemma Log_resp_leEq : forall (x y : IR) Hx Hy, x [<=] y -> Log x Hx [<=] Log y Hy. intros x y Hx Hy; apply resp_leEq_char' with (P := fun x : IR => Zero [<] x). - Algebra. + algebra. apply Log_resp_less. Qed. diff --git a/transc/InvTrigonom.v b/transc/InvTrigonom.v index 679721617..460697039 100644 --- a/transc/InvTrigonom.v +++ b/transc/InvTrigonom.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export RealPowers. @@ -233,7 +217,7 @@ apply Abs_Sin_less_One; auto. apply (half_lt1 IR). intros x Hx H1. apply compact_wd with (Sin x). -2: simpl in |- *; Algebra. +2: simpl in |- *; algebra. unfold min, max in |- *; inversion_clear H1. split. eapply leEq_transitive; [ apply Min_leEq_lft | apply Sin_resp_leEq; auto ]. @@ -287,7 +271,7 @@ apply inv_resp_less. astepr (OneR[^]2); apply AbsIR_less_square. apply less_wdl with (AbsIR (Sin x)). inversion_clear X; apply Abs_Sin_less_One; auto. -apply AbsIR_wd; simpl in |- *; Algebra. +apply AbsIR_wd; simpl in |- *; algebra. split. split. intros x H3 Hx Hx'. @@ -300,7 +284,7 @@ unfold power, FPower in |- *. unfold FPower in Hx. astepl (Part _ _ (ProjIR1 Hx) [*]Part _ _ (ProjIR2 Hx)). apply mult_wd. -2: simpl in |- *; Algebra. +2: simpl in |- *; algebra. elim Hx; clear Hx; intros Hx Hx1. astepl (Part _ _ Hx); clear Hx1. astepl (Part _ _ (ProjT2 Hx)). @@ -323,8 +307,8 @@ astepl (Part _ _ (ProjIR1 Hx4) [-]Part _ _ (ProjIR2 Hx4)). elim Hx4; clear Hx5 Hx4 Hx3 Hx2; intros Hx2 Hx3. astepl (Part _ _ Hx2[-]Part _ _ Hx3). apply cg_minus_wd. -Algebra. -simpl in |- *; Algebra. +algebra. +simpl in |- *; algebra. unfold power in |- *. astepl (Exp [--] (One [/]TwoNZ[*]Log _ H4) [*]Cos x). astepl ((One[/] _[//]Exp_ap_zero (One [/]TwoNZ[*]Log _ H4)) [*]Cos x). @@ -332,7 +316,7 @@ astepr (Exp (One [/]TwoNZ[*]Log _ H4) [/] _[//]Exp_ap_zero (One [/]TwoNZ[*]Log _ H4)). rstepl (Cos x[/] _[//]Exp_ap_zero (One [/]TwoNZ[*]Log _ H4)). apply div_wd. -2: Algebra. +2: algebra. astepr (Exp (Log _ H4[*]One [/]TwoNZ)). assert (H5 : Zero [<] Cos x). inversion_clear H3; apply Cos_pos; auto. astepl (Exp (Log _ H5)). @@ -340,7 +324,7 @@ apply Exp_wd. rstepl ((Log _ H5[+]Log _ H5) [/]TwoNZ). rstepr (Log _ H4 [/]TwoNZ). apply div_wd. -2: Algebra. +2: algebra. astepl (Log _ (mult_resp_pos _ _ _ H5 H5)). astepl (Log _ (pos_square _ _ (pos_ap_zero _ _ H5))). apply Log_wd. @@ -353,7 +337,7 @@ inversion_clear H3; apply Abs_Sin_less_One; auto. Deriv. split; auto. intros; simpl in |- *; apply Integral_empty. -astepl (Sin Zero); simpl in |- *; Algebra. +astepl (Sin Zero); simpl in |- *; algebra. Qed. Opaque ArcSin. @@ -364,7 +348,7 @@ unfold Sin in |- *. astepr (FId x CI). cut (Dom (ArcSin[o]Sine) x). intro H2. apply eq_transitive_unfolded with ((ArcSin[o]Sine) x H2). -simpl in |- *; Algebra. +simpl in |- *; algebra. apply Feq_imp_eq with (olor [--] (Pi [/]TwoNZ) (Pi [/]TwoNZ)). apply ArcSin_Sin_inv. split; auto. @@ -379,8 +363,8 @@ cut forall Hy, Sine y Hy [=] x}. intros H; elim H; clear H; intros y H H0. elim H; clear H; intros H1 H2. -assert (H : Sin y [=] x). simpl in |- *; Algebra. -assert (H3 : Dom ArcSin (Sin y)). apply dom_wd with x; Algebra. +assert (H : Sin y [=] x). simpl in |- *; algebra. +assert (H3 : Dom ArcSin (Sin y)). apply dom_wd with x; algebra. split. astepr (ArcSin _ H3). apply less_wdr with y; auto. @@ -401,9 +385,9 @@ intros x0 y H3 H4 H5 Hx0 Hy. auto. 2: apply included_imp_Continuous with realline; Contin. apply less_wdl with (Sin x0). -2: simpl in |- *; Algebra. +2: simpl in |- *; algebra. apply less_wdr with (Sin y). -2: simpl in |- *; Algebra. +2: simpl in |- *; algebra. inversion_clear H3; inversion_clear H4; apply Sin_resp_less; auto. Qed. @@ -430,16 +414,16 @@ unfold FPower in |- *; intros. astepr (Part _ _ (ProjT2 Hx0)). apply less_wdr with (Exp (Part _ _ (ProjT1 Hx0))). apply Exp_pos. -simpl in |- *; Algebra. +simpl in |- *; algebra. unfold FPower in |- *; intros. apply less_leEq; astepr (Part _ _ (ProjT2 Hx0)). apply less_wdr with (Exp (Part _ _ (ProjT1 Hx0))). apply Exp_pos. -simpl in |- *; Algebra. +simpl in |- *; algebra. auto. apply eq_transitive_unfolded with (ArcSin y H[-]ArcSin x Hx). rstepl (ArcSin x Hx[+]Integral H1[-]ArcSin x Hx). -apply cg_minus_wd; [ simpl in |- * | Algebra ]. +apply cg_minus_wd; [ simpl in |- * | algebra ]. apply eq_symmetric_unfolded; apply Integral_plus_Integral with (Min3_leEq_Max3 Zero y x). apply included_imp_Continuous with (olor [--]One One). @@ -448,7 +432,7 @@ apply included3_interval; auto. split. astepr ( [--]ZeroR); apply inv_resp_less; apply pos_one. apply pos_one. -apply x_minus_x; simpl in |- *; Algebra. +apply x_minus_x; simpl in |- *; algebra. apply included_imp_Continuous with (olor [--]One One). exact ArcSin_def_lemma. apply included_interval; auto. @@ -475,9 +459,9 @@ intros x H Hx Hx'. elim Hx; intros x0 H0. astepr x; astepl (Part _ _ (ProjT2 Hx)); astepl (Part _ _ H0). apply eq_transitive_unfolded with (Sin (ArcSin x x0)). -simpl in |- *; Algebra. +simpl in |- *; algebra. apply eq_symmetric_unfolded; apply Sin_ArcSin. -Algebra. +algebra. Qed. Lemma ArcSin_resp_leEq : forall x y, @@ -498,7 +482,7 @@ apply with (Exp (( [-C-] [--] (One [/]TwoNZ) {*} (Logarithm[o] [-C-]One{-}FId{^}2)) z x0)). apply less_leEq; apply Exp_pos. -simpl in |- *; Algebra. +simpl in |- *; algebra. Qed. (** ***Cosine and Arcosine @@ -507,13 +491,13 @@ Qed. Lemma ArcCos_Cos : forall x, Zero [<] x -> x [<] Pi -> forall H, ArcCos (Cos x) H [=] x. intros x H H0 H1. assert (H2 : Dom ArcCos (Sin (Pi [/]TwoNZ[-]x))). - apply dom_wd with (Cos x); Algebra. + apply dom_wd with (Cos x); algebra. astepl (Part _ _ H2). unfold ArcCos in |- *. astepl (Pi [/]TwoNZ[-]Part _ _ (ProjIR2 H2)). rstepr (Pi [/]TwoNZ[-] (Pi [/]TwoNZ[-]x)). apply cg_minus_wd. -Algebra. +algebra. apply ArcSin_Sin. apply shift_less_minus; apply shift_plus_less'. rstepr Pi; auto. @@ -536,14 +520,14 @@ Included. intros. apply ArcCos_domain. apply less_wdr with (Cos x). -2: simpl in |- *; Algebra. +2: simpl in |- *; algebra. apply inv_cancel_less. astepr OneR. eapply leEq_less_trans. apply inv_leEq_AbsIR. inversion_clear X; apply Abs_Cos_less_One; auto. apply less_wdl with (Cos x). -2: simpl in |- *; Algebra. +2: simpl in |- *; algebra. eapply leEq_less_trans. apply leEq_AbsIR. inversion_clear X; apply Abs_Cos_less_One; auto. @@ -552,11 +536,11 @@ intros. astepl (Part _ _ (ProjT2 Hx)); astepr x. cut (Dom ArcCos (Cos x)). intro H0. apply eq_transitive_unfolded with (ArcCos (Cos x) H0). -apply pfwdef; simpl in |- *; Algebra. +apply pfwdef; simpl in |- *; algebra. inversion_clear X; apply ArcCos_Cos; auto. inversion_clear Hx. apply dom_wd with (Cosine x x0); auto. -simpl in |- *; Algebra. +simpl in |- *; algebra. Qed. Lemma Cos_ArcCos_inv : Feq (olor [--]One One) (Cosine[o]ArcCos) FId. @@ -569,7 +553,7 @@ intros. inversion_clear Hx. astepr x; astepl (Part _ _ (ProjT2 Hx)); astepl (Part _ _ X0). apply eq_transitive_unfolded with (Cos (ArcCos x x0)). -simpl in |- *; Algebra. +simpl in |- *; algebra. apply eq_symmetric_unfolded; apply Cos_ArcCos. Qed. @@ -615,14 +599,14 @@ split. apply cos_domain. intros; apply ap_wdl with (Cos a). apply Greater_imp_ap; apply Cos_pos; auto. -simpl in |- *; Algebra. +simpl in |- *; algebra. split. apply sin_domain. split. apply cos_domain. intros; apply ap_wdl with (Cos b). apply Greater_imp_ap; apply Cos_pos; auto. -simpl in |- *; Algebra. +simpl in |- *; algebra. Qed. Lemma ArcTan_Tan_inv : Feq (olor [--] (Pi [/]TwoNZ) (Pi [/]TwoNZ)) (ArcTang[o]Tang) FId. @@ -671,7 +655,7 @@ inversion_clear Hx. Opaque Tang. simpl in |- *. apply Integral_empty. -Algebra. +algebra. Qed. Transparent Tang. @@ -683,7 +667,7 @@ unfold Tan, ArcTan in |- *. astepr (FId x CI). cut (Dom (ArcTang[o]Tang) x). intro H2. apply eq_transitive_unfolded with ((ArcTang[o]Tang) x H2). -simpl in |- *; Algebra. +simpl in |- *; algebra. apply Feq_imp_eq with (olor [--] (Pi [/]TwoNZ) (Pi [/]TwoNZ)). apply ArcTan_Tan_inv. split; auto. @@ -770,14 +754,14 @@ unfold ArcCos in |- *; simpl in |- *. Transparent iprop. elim H4; intros H6' H7; elim H7; intros. apply iprop_wd with (Pi [/]TwoNZ[-]ArcSin _ H7). -2: Algebra. +2: algebra. elim (ArcSin_range _ H7); intros; split. apply shift_less_minus; apply shift_plus_less'. rstepr Pi; apply less_transitive_unfolded with (Pi [/]TwoNZ); PiSolve. apply shift_minus_less; apply shift_less_plus'. astepl ZeroR. assert (H6 : Dom ArcSin (Sin Zero)). - apply dom_wd with ZeroR; [ split | Algebra ]; + apply dom_wd with ZeroR; [ split | algebra ]; [ astepr ( [--]ZeroR); apply inv_resp_less | idtac ]; apply pos_one. apply less_wdl with (ArcSin _ H6). @@ -795,16 +779,16 @@ apply ap_symmetric_unfolded; apply pos_ap_zero; apply recip_resp_pos. apply mult_resp_pos; [ apply pos_two | apply less_transitive_unfolded with aux_val; auto ]. apply eq_transitive_unfolded with (Sin (ArcSin _ H7)); - [ apply Sin_ArcSin | simpl in |- *; Algebra ]. + [ apply Sin_ArcSin | simpl in |- *; algebra ]. apply eq_transitive_unfolded with (Sin (ArcSin _ H6)); - [ astepl (Sin Zero); apply Sin_ArcSin | simpl in |- *; Algebra ]. + [ astepl (Sin Zero); apply Sin_ArcSin | simpl in |- *; algebra ]. intros; unfold Tan, Tang in |- *. assert (H6 : Cos (ArcCos _ H4) [#] Zero). eapply ap_wdl_unfolded. 2: apply Cos_ArcCos. apply recip_ap_zero; auto. apply leEq_wdr with (Sin (ArcCos _ H4) [/] _[//]H6). -2: simpl in |- *; Algebra. +2: simpl in |- *; algebra. apply shift_leEq_div. Opaque Cos. unfold ArcCos in |- *; simpl in |- *. @@ -828,7 +812,7 @@ PiSolve. astepl (Pi [/]TwoNZ[-]ArcSin _ (ProjIR2 H4)). apply shift_minus_leEq; apply shift_leEq_plus'; astepl ZeroR. assert (H7 : Dom ArcSin (Sin Zero)). - apply dom_wd with ZeroR; [ split | Algebra ]; + apply dom_wd with ZeroR; [ split | algebra ]; [ astepr ( [--]ZeroR); apply inv_resp_less | idtac ]; apply pos_one. apply leEq_wdl with (ArcSin _ H7). @@ -875,7 +859,7 @@ apply sin_domain. split. apply cos_domain. intro; apply ap_wdl_unfolded with (Cos min). -2: simpl in |- *; Algebra. +2: simpl in |- *; algebra. apply pos_ap_zero; apply Cos_pos. apply min1. apply min2. @@ -897,7 +881,7 @@ apply sin_domain. split. apply cos_domain. intro; apply ap_wdl_unfolded with (Cos max). -2: simpl in |- *; Algebra. +2: simpl in |- *; algebra. apply pos_ap_zero; apply Cos_pos. apply max1. apply max2. @@ -911,7 +895,7 @@ apply sin_domain. split. apply cos_domain. intro; apply ap_wdl_unfolded with (Cos [--]min). -2: simpl in |- *; Algebra. +2: simpl in |- *; algebra. astepl (Cos min). apply pos_ap_zero; apply Cos_pos. apply min1. @@ -929,7 +913,7 @@ apply sin_domain. split. apply cos_domain. intro; apply ap_wdl_unfolded with (Cos [--]max). -2: simpl in |- *; Algebra. +2: simpl in |- *; algebra. astepl (Cos max). apply pos_ap_zero; apply Cos_pos. apply max1. @@ -1149,19 +1133,19 @@ Transparent ArcTang. elim ArcTan_range_lemma; intros y H H0. elim H; intros. cut (Dom Tang y). intro H1. -assert (H2 : Tan y H1 [=] x). unfold Tan in |- *; Algebra. +assert (H2 : Tan y H1 [=] x). unfold Tan in |- *; algebra. split. apply less_wdr with y; auto. apply eq_symmetric_unfolded; eapply eq_transitive_unfolded. 2: apply ArcTan_Tan with (H := H1); auto. -unfold ArcTan in |- *; Algebra. +unfold ArcTan in |- *; algebra. apply less_wdl with y; auto. apply eq_symmetric_unfolded; eapply eq_transitive_unfolded. 2: apply ArcTan_Tan with (H := H1); auto. -unfold ArcTan in |- *; Algebra. +unfold ArcTan in |- *; algebra. repeat split. intro; apply Greater_imp_ap. -apply less_wdr with (Cos y); [ apply Cos_pos; auto | simpl in |- *; Algebra ]. +apply less_wdr with (Cos y); [ apply Cos_pos; auto | simpl in |- *; algebra ]. Qed. End ArcTan_Range. @@ -1191,13 +1175,13 @@ astepr (x0[^]2); apply sqr_nonneg. auto. apply eq_transitive_unfolded with (ArcTan y[-]ArcTan x). rstepl (ArcTan x[+]Integral H0[-]ArcTan x). -apply cg_minus_wd; [ simpl in |- * | Algebra ]. +apply cg_minus_wd; [ simpl in |- * | algebra ]. apply eq_symmetric_unfolded; unfold ArcTan in |- *; simpl in |- *. apply Integral_plus_Integral with (Min3_leEq_Max3 Zero y x). apply included_imp_Continuous with realline. exact ArcTan_def_lemma. apply included3_interval; split. -apply x_minus_x; simpl in |- *; Algebra. +apply x_minus_x; simpl in |- *; algebra. apply included_imp_Continuous with realline. exact ArcTan_def_lemma. apply included_interval; split. @@ -1214,7 +1198,7 @@ auto. intros. apply ap_wdl with (Cos (ArcTan x)). Opaque ArcTang. -2: unfold ArcTan in |- *; simpl in |- *; Algebra. +2: unfold ArcTan in |- *; simpl in |- *; algebra. elim ArcTan_range with x; intros. apply pos_ap_zero; apply Cos_pos; auto. Included. @@ -1222,10 +1206,10 @@ intros; inversion_clear Hx. astepr x; astepl (Part _ _ (ProjT2 Hx)); astepl (Part _ _ X0). cut (Dom Tang (ArcTan x)); intros. apply eq_transitive_unfolded with (Tan (ArcTan x) X1). -unfold Tan, ArcTan in |- *; Algebra. +unfold Tan, ArcTan in |- *; algebra. apply eq_symmetric_unfolded; apply Tan_ArcTan. apply dom_wd with (ArcTang x x0); auto. -unfold ArcTan in |- *; Algebra. +unfold ArcTan in |- *; algebra. Qed. End Inverses. diff --git a/transc/Pi.v b/transc/Pi.v index 1e1ac2832..e875024f5 100644 --- a/transc/Pi.v +++ b/transc/Pi.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - Require Export SinCos. Section Properties_of_Pi. @@ -67,7 +51,7 @@ apply leEq_reflexive. apply included_imp_Continuous with realline; Contin. intros. apply less_wdr with (Cos t0). -2: simpl in |- *; Algebra. +2: simpl in |- *; algebra. auto. clear H2 H1 t; intros t H1 H2 Ht. @@ -84,11 +68,11 @@ set (B := Barrow _ _ Continuous_Sin Zero CI CI {--}Cosine) in *. set (B' := B H3 x t H4 CI CI) in *. apply less_wdr with (Cosine x CI[-]Integral H4). 2: unfold cg_minus at 1 in |- *; apply bin_op_wd_unfolded. -2: Algebra. +2: algebra. 2: rstepr ( [--] ( {--}Cosine t Ht[-] {--}Cosine x CI)). 2: apply un_op_wd_unfolded; eapply eq_transitive_unfolded. 2: apply B'. -2: Algebra. +2: algebra. clear B' B H3. apply less_wdl with (Cos (pi_seq n) [-] (pi_seq (S n) [-]pi_seq n)). 2: simpl in |- *; rational. @@ -104,11 +88,11 @@ apply (ub_Integral _ _ _ _ H4 (less_imp_ap _ _ _ H1) One) with x CI. intros. apply leEq_wdl with (AbsIR (Sin x0)). apply AbsIR_Sin_leEq_One. -apply AbsIR_wd; simpl in |- *; Algebra. +apply AbsIR_wd; simpl in |- *; algebra. apply compact_map2 with (Hab := less_leEq _ _ _ H1). apply compact_inc_lft. apply less_wdl with (AbsIR (Sin x)). -2: simpl in |- *; Algebra. +2: simpl in |- *; algebra. apply AbsIR_Sin_less_One. apply H0; auto. apply leEq_reflexive. @@ -156,7 +140,7 @@ apply leEq_glb. intros y0 H2 Hy. apply less_leEq. apply less_wdr with (Cos y0). -2: simpl in |- *; Algebra. +2: simpl in |- *; algebra. inversion_clear H2. apply cos_pi_seq_pos with n. apply leEq_transitive with x; auto. @@ -210,11 +194,11 @@ apply sin_pi_seq_mon with n; auto. astepl (Sin y[^]2[+]Cos y[^]2[-]Cos y[^]2). apply cg_minus_wd. Step_final (Cos y[^]2[+]Sin y[^]2). -Algebra. +algebra. astepl (Sin x[^]2[+]Cos x[^]2[-]Cos x[^]2). apply cg_minus_wd. Step_final (Cos x[^]2[+]Sin x[^]2). -Algebra. +algebra. Qed. (* begin hide *) @@ -282,7 +266,7 @@ Lemma pi_seq_bnd' : intro; induction n as [| n Hrecn]. eapply leEq_wdr. apply pi_seq_bnd. -Algebra. +algebra. eapply leEq_transitive. apply pi_seq_bnd. apply @@ -308,7 +292,7 @@ intro; case n; intros. elimtype False; inversion H; inversion H1. eapply leEq_wdr. apply pi_seq_bnd'. -Algebra. +algebra. Qed. (* end hide *) @@ -333,7 +317,7 @@ apply less_leEq; apply pos_one. apply leEq_reflexive. apply leEq_glb. intros y H Hy; apply leEq_wdr with (Cos y). -2: simpl in |- *; Algebra. +2: simpl in |- *; algebra. inversion_clear H. apply cos_pi_seq_mon with 1. eapply leEq_wdl. @@ -372,9 +356,9 @@ apply with (Sum (S (S N)) (pred m) (fun i : nat => pi_seq (S i) [-]pi_seq i)). 2: eapply eq_transitive_unfolded. 2: apply Mengolli_Sum_gen with (f := pi_seq). -2: Algebra. +2: algebra. 2: auto with arith. -2: rewrite <- H3; Algebra. +2: rewrite <- H3; algebra. set (z := One[-]Sin One) in *. apply leEq_transitive @@ -396,7 +380,7 @@ apply leEq_wdl with (Sum (S N) (pred (pred m)) (fun i : nat => z[^]i)). 2: cut (pred m = S (pred (pred m))); [ intro | apply S_pred with N; auto with arith ]. 2: pattern (pred m) at 2 in |- *; rewrite H4. -2: apply Sum_shift; Algebra. +2: apply Sum_shift; algebra. cut (z[-]One [#] Zero). intro H4. eapply leEq_wdl. 2: apply eq_symmetric_unfolded; apply Sum_c_exp with (H := H4). @@ -412,7 +396,7 @@ apply Sin_One_pos. astepr ZeroR; astepr ( [--]ZeroR). apply inv_resp_less. apply less_wdl with (ZeroR[^]S (pred (pred m))). -2: simpl in |- *; Algebra. +2: simpl in |- *; algebra. apply nexp_resp_less. auto with arith. apply leEq_reflexive. @@ -485,17 +469,17 @@ assert (H : Cauchy_prop (fun n : nat => pi_seq (S n))). apply conv_seq_imp_conv_subseq with pi_seq S; auto with arith. intro; exists (S n); split; apply lt_n_Sn. simpl in |- *; auto. - Algebra. + algebra. apply pi_seq_Cauchy. apply eq_transitive_unfolded with (Lim (Build_CauchySeq _ _ H) [-]Lim (Build_CauchySeq _ _ pi_seq_Cauchy)). -2: apply cg_minus_wd; Algebra. +2: apply cg_minus_wd; algebra. 2: apply Lim_subseq_eq_Lim_seq with S; auto with arith. 2: intro; exists (S n); split; apply lt_n_Sn. 2: simpl in |- *; auto. -2: Algebra. +2: algebra. 2: left; intros; simpl in |- *. 2: apply local_mon_imp_mon'; auto; apply pi_seq_incr. eapply eq_transitive_unfolded. @@ -688,7 +672,7 @@ astepl (Cos (x[+]x)). astepl (Cos x[*]Cos x[-]Sin x[*]Sin x). astepl (Cos x[^]2[-]Sin x[^]2). rstepr (Cos x[^]2[-] (One[-]Cos x[^]2)). -apply cg_minus_wd; Algebra. +apply cg_minus_wd; algebra. astepr (Cos x[^]2[+]Sin x[^]2[-]Cos x[^]2); rational. Qed. @@ -709,7 +693,7 @@ eapply eq_transitive_unfolded. apply Tan_plus with (Hx := Hx) (Hy := Hx) (H := H1). simpl in |- *; rational. astepl (One[-]Tan x Hx[^]2). auto. -apply dom_wd with (Two[*]x); Algebra. +apply dom_wd with (Two[*]x); algebra. Qed. (* begin hide *) @@ -737,9 +721,9 @@ astepr ((ZeroR[+]One) [/]TwoNZ). astepr ((Cos (Pi [/]TwoNZ) [+]One) [/]TwoNZ). rstepl ((Two[*]Cos (Pi [/]FourNZ) [^]2[-]One[+]One) [/]TwoNZ). apply div_wd. -2: Algebra. +2: algebra. apply bin_op_wd_unfolded. -2: Algebra. +2: algebra. apply eq_transitive_unfolded with (Cos (Two[*]Pi [/]FourNZ)). apply eq_symmetric_unfolded; apply Cos_double. apply Cos_wd; rational. @@ -767,8 +751,8 @@ rstepr repeat apply div_wd. astepl (Sin (Two[*]One [/]TwoNZ)). apply Sin_double. -Algebra. -Algebra. +algebra. +algebra. apply pos_cos; PiSolve. apply pos_div_two; apply pos_one. apply less_transitive_unfolded with (pi_seq 1). @@ -797,7 +781,7 @@ apply cg_minus_wd. apply bin_op_wd_unfolded. apply nexp_wd. apply eq_symmetric_unfolded; apply Cos_QuarterPi. -Algebra. +algebra. apply eq_symmetric_unfolded; apply sqrt_lemma. Qed. @@ -814,15 +798,15 @@ cut (sqrt Two pos2 [#] Zero). 2: apply sqrt_nonneg. 2: apply less_wdl with ZeroR. 2: astepr (Two:IR); apply pos_two. -2: simpl in |- *; Algebra. +2: simpl in |- *; algebra. intro H0. unfold Tan in |- *; simpl in |- *. astepr ((One[/] _[//]H0) [/] _[//]recip_ap_zero _ _ H0). apply div_wd. astepr (Sin (Pi [/]FourNZ)). -simpl in |- *; Algebra. +simpl in |- *; algebra. astepr (Cos (Pi [/]FourNZ)). -simpl in |- *; Algebra. +simpl in |- *; algebra. Qed. (** Shifting sine and cosine by [Pi[/]Two] and [Pi]. *) @@ -868,7 +852,7 @@ unfold cg_minus in |- *. astepl (Sin ( [--]x[+]Pi [/]TwoNZ)). eapply eq_transitive_unfolded. apply Sin_plus_HalfPi. -Algebra. +algebra. Qed. Lemma Cos_plus_HalfPi : forall x : IR, Cos (x[+]Pi [/]TwoNZ) [=] [--] (Sin x). @@ -893,7 +877,7 @@ apply eq_transitive_unfolded with (Sin (Pi [/]TwoNZ[+]Pi [/]TwoNZ)). apply Sin_wd; rational. eapply eq_transitive_unfolded. apply Sin_plus_HalfPi. -Algebra. +algebra. Qed. Lemma Cos_Pi : Cos Pi [=] [--]One. @@ -901,7 +885,7 @@ apply eq_transitive_unfolded with (Cos (Pi [/]TwoNZ[+]Pi [/]TwoNZ)). apply Cos_wd; rational. eapply eq_transitive_unfolded. apply Cos_plus_HalfPi. -Algebra. +algebra. Qed. Lemma Sin_plus_Pi : forall x : IR, Sin (x[+]Pi) [=] [--] (Sin x). @@ -947,11 +931,11 @@ intros. cut (Cos x [#] Zero). intro H. assert (H0 : [--] (Cos x) [#] Zero). apply inv_resp_ap_zero; auto. apply eq_transitive_unfolded with (Sin x[/] _[//]H). -2: unfold Tan, Tang in |- *; simpl in |- *; Algebra. +2: unfold Tan, Tang in |- *; simpl in |- *; algebra. rstepr ( [--] (Sin x) [/] _[//]H0). assert (H1 : Cos (x[+]Pi) [#] Zero). astepl ( [--] (Cos x)); auto. astepr (Sin (x[+]Pi) [/] _[//]H1). -unfold Tan, Tang in |- *; simpl in |- *; Algebra. +unfold Tan, Tang in |- *; simpl in |- *; algebra. inversion_clear Hx. inversion_clear X0. simpl in |- *; auto. diff --git a/transc/PowerSeries.v b/transc/PowerSeries.v index 5b04ac029..c13ca66b2 100644 --- a/transc/PowerSeries.v +++ b/transc/PowerSeries.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) (** printing Exp %\ensuremath{\exp}% *) @@ -201,11 +185,11 @@ apply (AbsIR (a (S n)) [/] _[//] AbsIR_resp_ap_zero _ (nring_fac_ap_zero _ (S n))). 3: apply eq_symmetric_unfolded; apply AbsIR_division. -2: apply div_wd; Algebra. +2: apply div_wd; algebra. 2: apply eq_symmetric_unfolded; apply AbsIR_eq_x; apply nring_nonneg. 2: apply eq_symmetric_unfolded; eapply eq_transitive_unfolded. 2: apply AbsIR_resp_mult. -2: apply mult_wd; apply AbsIR_wd; simpl in |- *; Algebra. +2: apply mult_wd; apply AbsIR_wd; simpl in |- *; algebra. apply leEq_wdr with @@ -216,12 +200,12 @@ apply 2: apply mult_wdr. 2: eapply eq_transitive_unfolded. 2: apply AbsIR_resp_mult. -2: apply mult_wdl; simpl in |- *; Algebra. +2: apply mult_wdl; simpl in |- *; algebra. 2: apply eq_transitive_unfolded with (AbsIR (a n) [/] _[//]AbsIR_resp_ap_zero _ (nring_fac_ap_zero _ n)). 2: apply AbsIR_division. -2: apply div_wd; Algebra. +2: apply div_wd; algebra. 2: apply AbsIR_eq_x; apply nring_nonneg. rstepl (AbsIR (a (S n)) [*]AbsIR (x[-]x0) [*]AbsIR ((x[-]x0) [^]n) [/] _[//] @@ -386,7 +370,7 @@ rstepr mult_resp_ap_zero _ _ _ (pos_ap_zero _ _ (pos_nring_S _ n)) (nring_fac_ap_zero _ n))). apply mult_wdr. -apply div_wd; Algebra. +apply div_wd; algebra. Step_final (nring (R:=IR) (S n * fac n)). Qed. @@ -424,7 +408,7 @@ unfold Exp_ps in |- *. apply FPowerSeries'_conv'. exists 0; exists OneR. apply pos_one. -intros; apply eq_imp_leEq; Algebra. +intros; apply eq_imp_leEq; algebra. Qed. Lemma Exp_conv : fun_series_convergent_IR realline Exp_ps. @@ -432,7 +416,7 @@ unfold Exp_ps in |- *. apply FPowerSeries'_conv. exists 0; exists OneR. apply pos_one. -intros; apply eq_imp_leEq; Algebra. +intros; apply eq_imp_leEq; algebra. Qed. Lemma sin_conv : fun_series_convergent_IR realline sin_ps. diff --git a/transc/RealPowers.v b/transc/RealPowers.v index c942d6a77..ab6f9a66e 100644 --- a/transc/RealPowers.v +++ b/transc/RealPowers.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) (** printing [!] %\ensuremath{\hat{\ }}% #^# *) @@ -45,7 +29,7 @@ coincides with the exponential function. Lemma power_wd : forall x x' y y' Hx Hx', x [=] x' -> y [=] y' -> x[!]y[//]Hx [=] x'[!]y'[//]Hx'. intros. -unfold power in |- *; Algebra. +unfold power in |- *; algebra. Qed. Lemma power_strext : forall x x' y y' Hx Hx', x[!]y[//]Hx [#] x'[!]y'[//]Hx' -> x [#] x' or y [#] y'. @@ -76,13 +60,13 @@ intros. unfold cg_minus in |- *. astepl (x[!]y[//]Hx[*]x[!][--]z[//]Hx). rstepr (x[!]y[//]Hx[*] (One[/] _[//]Hxz)). -Algebra. +algebra. Qed. Lemma power_nat : forall x n Hx, x[!]nring n[//]Hx [=] x[^]n. intros; unfold power in |- *. induction n as [| n Hrecn]. -simpl in |- *; astepr (Exp Zero); simpl in |- *; Algebra. +simpl in |- *; astepr (Exp Zero); simpl in |- *; algebra. simpl in |- *. astepr (Exp (nring n[*]Log x Hx) [*]Exp (Log x Hx)). astepr (Exp (nring n[*]Log x Hx[+]Log x Hx)). @@ -101,7 +85,7 @@ Lemma power_one : forall (x : IR) Hx, x[!]One[//]Hx [=] x. intros. astepr (x[^]1). astepr (x[!]nring 1[//]Hx). -simpl in |- *; Algebra. +simpl in |- *; algebra. Qed. Hint Resolve power_zero power_one: algebra. @@ -167,7 +151,7 @@ intros; unfold power in |- *. apply Exp_wd. astepl (z[*]y[*]Log x Hx). astepl (z[*] (y[*]Log x Hx)). -Algebra. +algebra. Qed. Lemma power_pos : forall (x y : IR) Hx, Zero [<] x[!]y[//]Hx. @@ -343,7 +327,7 @@ cut (Dom Expon (Part _ _ Hx4[*]Part _ _ Hx5)). intro H7. dom_wd with (x := Part _ _ (ProjIR1 (CAnd_intro _ _ Hx4 Hx5)) [*] - Part _ _ (ProjIR2 (CAnd_intro _ _ Hx4 Hx5))); Algebra. + Part _ _ (ProjIR2 (CAnd_intro _ _ Hx4 Hx5))); algebra. astepl (Part _ (Part _ _ Hx4[*]Part _ _ Hx5) H7[*]Part _ _ Hx2). clear Hx3; rename H7 into Hx3. astepl (Part _ (Part _ _ Hx4[*]Part _ _ (ProjT2 Hx5)) Hx3[*]Part _ _ Hx2). @@ -374,7 +358,7 @@ apply (A[*] (Part _ _ Hx10[*] (Part _ _ Hx14[*]Part _ _ Hx15) [+] Part _ _ Hx12[*]Part _ _ Hx13)). -apply mult_wd; Algebra. +apply mult_wd; algebra. astepl (A[*] (Part _ _ Hx10[*] (Part _ _ Hx14[*]Part _ _ Hx15) [+] @@ -433,7 +417,7 @@ astepr (Part _ _ Hx1[+]Part _ _ Hx2[*] (Part _ _ H12[*]Part _ _ Hx4)). apply eq_transitive_unfolded with (Part _ _ Hx1[+]Part _ _ Hx2[*] (Part _ _ H12[*]Log _ H9)). -2: unfold Log in |- *; apply bin_op_wd_unfolded; Algebra. +2: unfold Log in |- *; apply bin_op_wd_unfolded; algebra. clear Hx3 Hx4. astepr (Part _ _ Hx1[+]Part _ _ (ProjT2 Hx2) [*] (Part _ _ H12[*]Log _ H9)). elim Hx2; clear Hx2; intros Hx2 Hx3. @@ -450,7 +434,7 @@ astepr apply eq_transitive_unfolded with (Part _ _ Hx1[+]Part _ _ H13[*] (Part _ _ H12[*]Log _ H9)). -2: apply bin_op_wd_unfolded; Algebra. +2: apply bin_op_wd_unfolded; algebra. generalize H13; clear H13 Hx3. elim Hx5; clear Hx5; intros Hx5 Hx6 Hx3. astepr @@ -460,8 +444,8 @@ apply eq_transitive_unfolded with (Part _ _ Hx1[+]Exp (Part _ _ H7[*]Log _ H9) [*] (Part _ _ H12[*]Log _ H9)). -2: apply bin_op_wd_unfolded; [ Algebra | unfold Log in |- *; simpl in |- * ]. -2: apply bin_op_wd_unfolded; Algebra. +2: apply bin_op_wd_unfolded; [ algebra | unfold Log in |- *; simpl in |- * ]. +2: apply bin_op_wd_unfolded; algebra. eapply eq_transitive_unfolded. apply ring_dist_unfolded. apply bin_op_wd_unfolded. @@ -479,24 +463,24 @@ astepr (Part _ _ H7[*] (Part _ _ Hx2[*]Part _ _ H11)). apply eq_transitive_unfolded with (Part _ _ H7[*] (Exp (Part _ _ Hx1) [*]Part _ _ H11)). -2: simpl in |- *; Algebra. +2: simpl in |- *; algebra. clear Hx2. apply eq_transitive_unfolded with (Part _ _ H7[*] (Exp (Part _ _ (ProjIR1 Hx1) [*]Part _ _ (ProjIR2 Hx1)) [*]Part _ _ H11)). -2: apply mult_wdr; Algebra. +2: apply mult_wdr; algebra. elim Hx1; clear Hx1; intros Hx1 Hx2. apply eq_transitive_unfolded with (Part _ _ H7[*] (Exp (Part _ _ Hx1[*]Part _ _ Hx2) [*]Part _ _ H11)). -2: apply mult_wdr; Algebra. +2: apply mult_wdr; algebra. apply eq_transitive_unfolded with (Part _ _ H7[*] (Exp ((Part _ _ H7[-]One) [*]Log _ H9) [*]Part _ _ H11)). 2: unfold Log in |- *; simpl in |- *. -2: apply mult_wdr; apply mult_wd; Algebra. +2: apply mult_wdr; apply mult_wd; algebra. clear Hx1 Hx2. rstepl ((Exp (Part _ _ H7[*]Log _ H9) [/] _[//]H10) [*] (Part _ _ H7[*]Part _ _ H11)). @@ -505,7 +489,7 @@ apply mult_wdl. apply eq_transitive_unfolded with (Exp (Part _ _ H7[*]Log _ H9[-]Log _ H9)). 2: apply Exp_wd; rational. astepr (Exp (G x H7[*]Log _ H9) [/] _[//]Exp_ap_zero (Log _ H9)). -Algebra. +algebra. Transparent Logarithm. astepr (Part _ _ Hx16); auto. Opaque Logarithm. diff --git a/transc/SinCos.v b/transc/SinCos.v index 3fe58ab52..884212acb 100644 --- a/transc/SinCos.v +++ b/transc/SinCos.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export Trigonometric. @@ -57,8 +41,8 @@ simpl in |- *. eapply eq_transitive_unfolded. eapply eq_transitive_unfolded. 2: apply H2. -Algebra. -Algebra. +algebra. +algebra. apply Feq_imp_eq with (fun x : IR => CTrue); auto. repeat split. exists (CAnd_intro _ _ CI CI); split. @@ -76,8 +60,8 @@ simpl in |- *. eapply eq_transitive_unfolded. eapply eq_transitive_unfolded. 2: apply (H0 x CI H1 H2). -Algebra. -Algebra. +algebra. +algebra. repeat split. exists (CAnd_intro _ _ CI CI); repeat split. Qed. @@ -96,7 +80,7 @@ cut (Cos y [#] Zero). cut (Cos x [#] Zero). intros H0 H1 H2. apply eq_transitive_unfolded with (Sin (x[+]y) [/] _[//]H2). -unfold Tan in |- *; simpl in |- *; Algebra. +unfold Tan in |- *; simpl in |- *; algebra. rstepr ((Tan x Hx[+]Tan y Hy) [*]Cos x[*]Cos y[/] _[//] mult_resp_ap_zero _ _ _ H (mult_resp_ap_zero _ _ _ H0 H1)). @@ -162,7 +146,7 @@ apply with ( [--]One[^]x0[*][--] ((x[-]Zero) [^]n) [/] _[//]nring_fac_ap_zero IR n). 2: simpl in |- *; rational. apply div_wd. -2: Algebra. +2: algebra. apply mult_wdr. rewrite b. eapply eq_transitive_unfolded. @@ -179,10 +163,10 @@ intros; unfold Tan, Tang in |- *. cut (Cos x [#] Zero). cut (Cos [--]x [#] Zero). intros H H0. apply eq_transitive_unfolded with (Sin [--]x[/] _[//]H). -simpl in |- *; Algebra. +simpl in |- *; algebra. astepl ( [--] (Sin x) [/] _[//]H0). rstepl ( [--] (Sin x[/] _[//]H0)). -simpl in |- *; Algebra. +simpl in |- *; algebra. inversion_clear Hx'. inversion_clear X0. simpl in |- *; auto. @@ -204,13 +188,13 @@ intros. astepl (Cos x[*]Cos x[+]Sin x[*]Sin x). astepr (Cos Zero). apply eq_transitive_unfolded with (Cos (x[+][--]x)). -2: Algebra. +2: algebra. apply eq_symmetric_unfolded. eapply eq_transitive_unfolded. apply Cos_plus. unfold cg_minus in |- *. apply bin_op_wd_unfolded. -Algebra. +algebra. astepl (Sin x[*][--] (Sin [--]x)). Step_final (Sin x[*][--][--] (Sin x)). Qed. @@ -262,15 +246,15 @@ unfold Tan in H; exact (pfstrx _ _ _ _ _ _ H). Qed. Lemma Sin_wd : forall x y : IR, x [=] y -> Sin x [=] Sin y. -intros; Algebra. +intros; algebra. Qed. Lemma Cos_wd : forall x y : IR, x [=] y -> Cos x [=] Cos y. -intros; Algebra. +intros; algebra. Qed. Lemma Tan_wd : forall x y Hx Hy, x [=] y -> Tan x Hx [=] Tan y Hy. -intros; unfold Tan in |- *; Algebra. +intros; unfold Tan in |- *; algebra. Qed. (** diff --git a/transc/TaylorSeries.v b/transc/TaylorSeries.v index a213f25fd..e719558e8 100644 --- a/transc/TaylorSeries.v +++ b/transc/TaylorSeries.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export PowerSeries. @@ -67,7 +51,7 @@ Opaque N_Deriv. Lemma Taylor_Rem_char : forall n H x Hx Hx' Hx'', F x Hx[-]FSum0 (S n) Taylor_Series x Hx' [=] Taylor_Rem J pJ F a x Ha Hx'' n H. intros; unfold Taylor_Rem in |- *; repeat apply cg_minus_wd. -Algebra. +algebra. simpl in |- *. apply bin_op_wd_unfolded. 2: apply mult_wdl. @@ -94,14 +78,14 @@ exact (FSumx_char _ _ _ _ H0). apply Sumx_Sum0. intros; simpl in |- *. apply mult_wdl; apply div_wd. -2: Algebra. +2: algebra. apply Feq_imp_eq with J; auto. apply Derivative_n_unique with pJ i F; auto. apply N_Deriv_lemma. red in |- *; do 3 intro. rewrite H0; intros; simpl in |- *; auto. apply div_wd. -2: Algebra. +2: algebra. apply Feq_imp_eq with J; auto. apply Derivative_n_unique with pJ n F; auto. Deriv. @@ -214,7 +198,7 @@ eapply leEq_transitive. 2: apply (HN (S n) (le_S _ _ H2) w H4). simpl in |- *. cut (forall z : IR, AbsIR z [=] AbsIR (z[-]Zero)); intros. -2: apply AbsIR_wd; Algebra. +2: apply AbsIR_wd; algebra. eapply leEq_wdr. 2: apply H3. clear H3; eapply leEq_wdr. @@ -229,7 +213,7 @@ cut eapply leEq_wdr. 2: apply H3. clear H3; apply mult_resp_leEq_rht. -apply eq_imp_leEq; apply AbsIR_wd; Algebra. +apply eq_imp_leEq; apply AbsIR_wd; algebra. apply less_leEq; auto. rstepr ((AbsIR z[/] _[//]nring_fac_ap_zero _ (S n)) [*]r'[^]S n). apply mult_wdl. @@ -237,7 +221,7 @@ eapply eq_transitive_unfolded. apply AbsIR_division with (y__ := AbsIR_resp_ap_zero _ (nring_fac_ap_zero _ (S n))). apply div_wd. -Algebra. +algebra. apply AbsIR_eq_x. apply nring_nonneg. apply less_leEq; apply div_resp_pos; [ apply pos_nring_fac | auto ]. @@ -283,10 +267,10 @@ rstepl (H1 (S n))) [*]AbsIR ((z[+][--]w) [^]n[*] (z[+][--]a)) [*] Two[^]S n). repeat apply mult_wdl. -apply div_wd; Algebra. +apply div_wd; algebra. eapply eq_transitive_unfolded. 2: apply eq_symmetric_unfolded; apply mult_nexp. -Algebra. +algebra. apply leEq_wdr with (AbsIR (Max y (Max a t) [-]Min x (Min a t))). apply compact_elements with Hxy'; auto. inversion_clear H0; split. @@ -343,7 +327,7 @@ apply (H5 (Part _ _ (Derivative_n_imp_inc' _ _ _ _ _ (derF (S p)) a Ha) [/] _[//] nring_fac_ap_zero _ (S p)) a)). -apply AbsIR_wd; Algebra. +apply AbsIR_wd; algebra. Qed. (* end hide *) @@ -375,8 +359,8 @@ elim (Taylor_Series_conv_lemma2 _ _ Hab One (pos_one _)); intros N HN; eapply leEq_wdr. eapply leEq_wdl. apply (HN _ H0 _ X Hx). -apply AbsIR_wd; Algebra. -simpl in |- *; Algebra. +apply AbsIR_wd; algebra. +simpl in |- *; algebra. Qed. (* begin hide *) @@ -430,7 +414,7 @@ apply with (AbsIR a'[*] (One[/] _[//]AbsIR_resp_ap_zero _ Hb) [*]AbsIR c[*]AbsIR d[/] e[//]He). -apply div_wd; Algebra. +apply div_wd; algebra. repeat (eapply eq_transitive_unfolded; [ apply AbsIR_resp_mult | apply mult_wdl ]). @@ -445,10 +429,10 @@ repeat [ apply AbsIR_resp_mult | apply mult_wdl ]). eapply eq_transitive_unfolded; [ apply AbsIR_division with (y__ := AbsIR_resp_ap_zero _ Hx) - | apply div_wd; Algebra ]. + | apply div_wd; algebra ]. eapply eq_transitive_unfolded. 2: apply AbsIR_mult_pos; auto. -Algebra. +algebra. Qed. (* end hide *) @@ -580,7 +564,7 @@ eapply eq_transitive_unfolded. 2: apply nring_comm_mult. Transparent fac. replace (fac (S n)) with (fac n * S n). -Algebra. +algebra. Opaque mult. unfold fac in |- *; fold (fac n) in |- *. auto with arith. @@ -607,7 +591,7 @@ exists N; intros. eapply leEq_transitive. 2: apply HN with (n := n) (Hx := Hx); auto. cut (forall (z t : IR) Ht, AbsIR z [=] AbsIR (z[-][-C-]Zero t Ht)); intros. -2: simpl in |- *; apply AbsIR_wd; Algebra. +2: simpl in |- *; apply AbsIR_wd; algebra. eapply leEq_wdl. 2: apply H2. eapply leEq_wdr. @@ -639,7 +623,7 @@ apply convergent_wd with (fun n : nat => Part (Exp_ps n) r (H n)). Opaque nexp_op. intros; simpl in |- *. rstepl ((r[-]Zero) [^]n[/] _[//]nring_fac_ap_zero _ n). -Algebra. +algebra. apply fun_series_conv_imp_conv_IR with realline. apply Exp_conv. split. @@ -705,7 +689,7 @@ apply Feq_transitive with (FSeries_Sum Hf); auto. apply Feq_transitive with (FSeries_Sum Hg). apply eq_imp_Feq; simpl in |- *; Included. intros; apply series_sum_wd. -intros; Algebra. +intros; algebra. apply Feq_symmetric; apply Taylor_Series_conv_to_fun; auto. apply Taylor_Series_conv_IR; auto. Qed. diff --git a/transc/TrigMon.v b/transc/TrigMon.v index e75d151b6..c71d188de 100644 --- a/transc/TrigMon.v +++ b/transc/TrigMon.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export Pi. @@ -77,11 +61,11 @@ apply shift_less_div. apply less_wdr with (Cos x). apply Cos_pos; auto. apply less_transitive_unfolded with ZeroR; PiSolve. -simpl in |- *; Algebra. +simpl in |- *; algebra. astepl ZeroR; apply less_wdr with (Sin x). apply Sin_pos; auto. apply less_transitive_unfolded with (Pi [/]TwoNZ); PiSolve. -simpl in |- *; Algebra. +simpl in |- *; algebra. Qed. Lemma Cos_nonneg : forall x, [--] (Pi [/]TwoNZ) [<=] x -> x [<=] Pi [/]TwoNZ -> Zero [<=] Cos x. @@ -91,10 +75,10 @@ intros; PiSolve. intros x0 H1 Hx; inversion_clear H1. apply less_wdr with (Cos x0); - [ apply Cos_pos; auto | simpl in |- *; Algebra ]. + [ apply Cos_pos; auto | simpl in |- *; algebra ]. astepr (Cos [--] (Pi [/]TwoNZ)); apply eq_imp_leEq; Step_final (Cos (Pi [/]TwoNZ)). -fold (Cos (Pi [/]TwoNZ)) in |- *; apply eq_imp_leEq; Algebra. +fold (Cos (Pi [/]TwoNZ)) in |- *; apply eq_imp_leEq; algebra. split; auto. Qed. @@ -104,9 +88,9 @@ intros; apply olor_pos_clcr_nonneg with ZeroR Pi CI CI. PiSolve. intros x0 H1 Hx; inversion_clear H1. apply less_wdr with (Sin x0); - [ apply Sin_pos; auto | simpl in |- *; Algebra ]. -fold (Sin Zero) in |- *; apply eq_imp_leEq; Algebra. -fold (Sin Pi) in |- *; apply eq_imp_leEq; Algebra. + [ apply Sin_pos; auto | simpl in |- *; algebra ]. +fold (Sin Zero) in |- *; apply eq_imp_leEq; algebra. +fold (Sin Pi) in |- *; apply eq_imp_leEq; algebra. split; auto. Qed. @@ -163,7 +147,7 @@ apply leEq_transitive with (Min y x); try apply leEq_Min; auto; apply leEq_transitive with x; auto. apply leEq_transitive with (Max y x); try apply Max_leEq; auto; apply leEq_transitive with y; auto. -simpl in |- *; Algebra. +simpl in |- *; algebra. PiSolve. Qed. @@ -207,7 +191,7 @@ eapply leEq_wdr. apply lb_integral. intros z H6 Hx. apply leEq_wdr with (Sin z). -2: simpl in |- *; Algebra. +2: simpl in |- *; algebra. cut ( [--] (Pi [/]TwoNZ) [<=] x); intros. inversion_clear H6; apply Sin_resp_leEq; auto. apply leEq_transitive with y; auto. @@ -222,7 +206,7 @@ eapply eq_transitive_unfolded. apply Barrow with (derG0 := H6) (Ha := CI) (Hb := CI) (pJ := CI) (x0 := ZeroR); Contin; split. -simpl in |- *; Algebra. +simpl in |- *; algebra. Qed. Lemma Cos_resp_less_aux' : @@ -260,11 +244,11 @@ apply strict_dec_glues with (Hab := Hab) (Hbc := Hbc) (Hac := Hac). Included. intros x0 y0 H2 H3 H4 Hx Hy. apply less_wdl with (Cos x0); [ apply less_wdr with (Cos y0) | idtac ]; - [ idtac | simpl in |- *; Algebra | simpl in |- *; Algebra ]. + [ idtac | simpl in |- *; algebra | simpl in |- *; algebra ]. inversion_clear H2; inversion_clear H3; apply Cos_resp_less_aux'; auto. intros x0 y0 H2 H3 H4 Hx Hy. apply less_wdl with (Cos x0); [ apply less_wdr with (Cos y0) | idtac ]; - [ idtac | simpl in |- *; Algebra | simpl in |- *; Algebra ]. + [ idtac | simpl in |- *; algebra | simpl in |- *; algebra ]. astepl (Cos [--]x0); astepl ( [--][--] (Cos [--]x0)); astepl ( [--] (Cos ( [--]x0[+]Pi))). apply less_wdl with ( [--] (Cos (Pi[-]x0))). @@ -326,7 +310,7 @@ apply leEq_wdr with (Cos y). 2: apply eq_transitive_unfolded with (AbsIR (Cos y)). 2: apply eq_symmetric_unfolded; apply AbsIR_eq_x. 2: apply less_leEq; elim (H y X); intros; apply Cos_pos; auto. -2: apply AbsIR_wd; simpl in |- *; Algebra. +2: apply AbsIR_wd; simpl in |- *; algebra. elim (less_cotransitive_unfolded _ _ _ pos_QuarterPi y); intros. eapply leEq_transitive. apply Min_leEq_lft. @@ -433,12 +417,12 @@ apply included_FMinus; Included. Included. intros; simpl in |- *; apply ap_wdl with (Cos x[*]Cos x). apply mult_resp_ap_zero; auto. -simpl in |- *; Algebra. +simpl in |- *; algebra. apply included_FRecip. Included. intros; simpl in |- *; apply ap_wdl with (Cos x[*]Cos x). apply mult_resp_ap_zero; auto. -astepl (One[*]Cos x[*]Cos x); simpl in |- *; Algebra. +astepl (One[*]Cos x[*]Cos x); simpl in |- *; algebra. intros x H3 Hx Hx'. apply eq_transitive_unfolded @@ -455,20 +439,20 @@ simpl in |- *. astepl (Part _ _ (ProjIR1 H4) [-]Part _ _ (ProjIR2 H4)). elim H4; clear H4; intros H6 H7. astepl (Part _ _ H6[-]Part _ _ H7). -apply cg_minus_wd; simpl in |- *; Algebra. +apply cg_minus_wd; simpl in |- *; algebra. elim H5; clear H5; intros H6 H7. astepl (Part _ _ H6). -simpl in |- *; Algebra. +simpl in |- *; algebra. apply eq_transitive_unfolded with (One[/] _[//]mult_resp_ap_zero _ _ _ (H2 x H3) (H2 x H3)). apply div_wd. -2: simpl in |- *; Algebra. +2: simpl in |- *; algebra. astepr (Cos x[^]2[+]Sin x[^]2); simpl in |- *; rational. simpl in Hx'; astepr (One[/] _[//]ext2 (S:=IR) Hx'). apply div_wd. -Algebra. -astepl (One[*]Cos x[*]Cos x); simpl in |- *; Algebra. +algebra. +astepl (One[*]Cos x[*]Cos x); simpl in |- *; algebra. apply Derivative_div. Deriv. Deriv. @@ -487,30 +471,30 @@ apply included_FRecip. Included. intros; simpl in |- *; apply ap_wdl with (Cos x[*]Cos x). apply mult_resp_ap_zero; auto. -astepl (One[*]Cos x[*]Cos x); simpl in |- *; Algebra. +astepl (One[*]Cos x[*]Cos x); simpl in |- *; algebra. apply included_FPlus. Included. apply included_FNth. unfold Tang in |- *; apply included_FDiv. Included. Included. -intros; simpl in |- *; astepl (Cos x). Algebra. -simpl in |- *; Algebra. +intros; simpl in |- *; astepl (Cos x). algebra. +simpl in |- *; algebra. intros x H1 Hx Hx'. apply eq_transitive_unfolded with (One[/] _[//]mult_resp_ap_zero _ _ _ (H0 x H1) (H0 x H1)). simpl in |- *; apply div_wd. -Algebra. -astepr (One[*]Cos x[*]Cos x); simpl in |- *; Algebra. +algebra. +astepr (One[*]Cos x[*]Cos x); simpl in |- *; algebra. astepl (Cos x[^]2[+]Sin x[^]2[/] _[//]mult_resp_ap_zero _ _ _ (H0 x H1) (H0 x H1)). apply eq_transitive_unfolded with (One[+]One[*] (Sin x[/] _[//]H0 x H1) [*] (Sin x[/] _[//]H0 x H1)). 2: simpl in |- *; apply bin_op_wd_unfolded. -2: Algebra. -2: repeat apply mult_wd; try apply div_wd; Algebra. +2: algebra. +2: repeat apply mult_wd; try apply div_wd; algebra. simpl in |- *. rational. Qed. diff --git a/transc/Trigonometric.v b/transc/Trigonometric.v index b2203c124..2f833bcb9 100644 --- a/transc/Trigonometric.v +++ b/transc/Trigonometric.v @@ -1,19 +1,3 @@ -(* This program 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 2.1 *) -(* of the License, or (at your option) any later version. *) -(* *) -(* 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. *) -(* *) -(* You should have received a copy of the GNU Lesser General Public *) -(* License along with this program; if not, write to the Free *) -(* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *) -(* 02110-1301 USA *) - - (* $Id$ *) Require Export TaylorSeries. @@ -116,8 +100,8 @@ Lemma Tan_zero : forall H, Tan Zero H [=] Zero. intros; unfold Tan, Tang in |- *. simpl in |- *. astepr (ZeroR [/]OneNZ); apply div_wd. -astepr (Sin Zero); simpl in |- *; Algebra. -astepr (Cos Zero); simpl in |- *; Algebra. +astepr (Sin Zero); simpl in |- *; algebra. +astepr (Cos Zero); simpl in |- *; algebra. Qed. Transparent Sine Cosine. @@ -147,11 +131,11 @@ elim p; intros; simpl in |- *. elim even_or_odd_plus; intros; simpl in |- *. elim p0; intros; simpl in |- *. elimtype False; omega. -Algebra. +algebra. elim even_or_odd_plus; intros; simpl in |- *. elim p0; intros; simpl in |- *. cut (x0 = x); [ intro | omega ]. -rewrite H; Algebra. +rewrite H; algebra. elimtype False; omega. Qed. @@ -163,7 +147,7 @@ elim p; intros; simpl in |- *. elim even_or_odd_plus; intros; simpl in |- *. elim p0; intros; simpl in |- *. elimtype False; omega. -Algebra. +algebra. elim even_or_odd_plus; intros; simpl in |- *. elim p0; intros; simpl in |- *. cut (S x = x0); [ intro | omega ]. @@ -185,7 +169,7 @@ apply series_sum_wd; intros. apply mult_wdl. apply div_wd. apply eq_symmetric_unfolded; apply cos_sin_seq. -Algebra. +algebra. apply fun_series_convergent_wd_IR with (FPowerSeries' Zero cos_seq). intros; FEQ. repeat split. @@ -194,7 +178,7 @@ simpl in |- *. apply mult_wdl. apply div_wd. apply cos_sin_seq. -Algebra. +algebra. apply cos_conv. Qed. @@ -227,7 +211,7 @@ apply div_wd. apply eq_symmetric_unfolded. astepr ( [--][--] (cos_seq (S n))); apply un_op_wd_unfolded. apply sin_cos_seq. -Algebra. +algebra. simpl in |- *. apply series_sum_inv @@ -247,7 +231,7 @@ apply mult_wdl. apply div_wd. astepr ( [--][--] (cos_seq (S n))); apply un_op_wd_unfolded. apply sin_cos_seq. -Algebra. +algebra. apply FSeries_Sum_inv_conv. apply sin_conv. Qed. @@ -357,7 +341,7 @@ apply AbsIR_wd; simpl in |- *; rational. apply FAbs_nonneg. apply bin_op_wd_unfolded. apply AbsIR_inv. -Algebra. +algebra. intros. unfold F' in |- *. @@ -375,7 +359,7 @@ apply eq_transitive_unfolded with (AbsIR (Part _ _ (ProjIR1 (ProjIR2 Hx')))). apply FAbs_char. apply AbsIR_wd; simpl in |- *; rational. apply bin_op_wd_unfolded. -Algebra. +algebra. apply AbsIR_inv. auto. @@ -485,7 +469,7 @@ apply AbsIR_wd; simpl in |- *; rational. apply FAbs_nonneg. apply bin_op_wd_unfolded. apply AbsIR_inv. -Algebra. +algebra. intros. unfold G' in |- *. @@ -513,7 +497,7 @@ apply eq_transitive_unfolded with (AbsIR (Part _ _ (ProjIR1 (ProjIR2 Hx')))). apply FAbs_char. apply AbsIR_wd; simpl in |- *; rational. apply bin_op_wd_unfolded. -Algebra. +algebra. apply AbsIR_minus. auto. @@ -538,34 +522,34 @@ intros; simpl in |- *. apply eq_transitive_unfolded with (Sin y). simpl in |- *; rational. apply eq_transitive_unfolded with (Sin Zero[*]Cos y[+]Cos Zero[*]Sin y). -2: simpl in |- *; Algebra. +2: simpl in |- *; algebra. rstepl (Zero[*]Cos y[+]One[*]Sin y). -Algebra. +algebra. intros; simpl in |- *. apply eq_transitive_unfolded with (Cos y). simpl in |- *; rational. apply eq_transitive_unfolded with (Cos Zero[*]Cos y[-]Sin Zero[*]Sin y). -2: simpl in |- *; Algebra. +2: simpl in |- *; algebra. rstepl (One[*]Cos y[-]Zero[*]Sin y). -Algebra. +algebra. intros; simpl in |- *. apply un_op_wd_unfolded. apply eq_transitive_unfolded with (Sin y). simpl in |- *; rational. apply eq_transitive_unfolded with (Sin Zero[*]Cos y[+]Cos Zero[*]Sin y). -2: simpl in |- *; Algebra. +2: simpl in |- *; algebra. rstepl (Zero[*]Cos y[+]One[*]Sin y). -Algebra. +algebra. intros; simpl in |- *. apply eq_transitive_unfolded with ( [--] (Cos y)). simpl in |- *; rational. apply eq_transitive_unfolded with (Sin Zero[*]Sin y[-]Cos Zero[*]Cos y). -2: simpl in |- *; Algebra. +2: simpl in |- *; algebra. rstepl (Zero[*]Sin y[-]One[*]Cos y). -Algebra. +algebra. intros. simpl in |- *; auto.