1
; ACL2 Univariate Polynomials over a Field books -- Sum Congruences
2
;; Congruences for Sums of Univariate Polynomials over a Field
3
; Copyright (C) 2006 John R. Cowles and Ruben A. Gamboa, University of
6
; This book is free software; you can redistribute it and/or modify
7
; it under the terms of the GNU General Public License as published by
8
; the Free Software Foundation; either version 2 of the License, or
9
; (at your option) any later version.
11
; This book is distributed in the hope that it will be useful,
12
; but WITHOUT ANY WARRANTY; without even the implied warranty of
13
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
; GNU General Public License for more details.
16
; You should have received a copy of the GNU General Public License
17
; along with this book; if not, write to the Free Software
18
; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20
;; Modified by J. Cowles
22
;; Last modified July 2006 (for ACL2 Version 3.0).
25
;;; ------------------------------------------------------------------
26
;;; Congruencia de la igualdad con la suma de polinomios
30
;;; Inmaculada Medina Bulo
31
;;; Francisco Palomo Lozano
35
;;; Aqu� se demuestran las congruencias de la igualdad de polinomios
36
;;; con la suma. Las demostraciones son complejas debido a que
37
;;; necesitan reglas expansivas. Estas reglas son peligrosas, ya que
38
;;; pueden producir f�cilmente ciclos en el demostrador. Para
39
;;; restringir su aplicaci�n caben dos opciones:
41
;;; 1. Desactivarlas y usarlas expl�citamente donde sea necesario. Una
42
;;; variante es no generar la regla en absoluto (es decir, introducir
43
;;; el teorema con la clases de reglas vac�a).
45
;;; 2. Restringir su aplicaci�n sint�cticamente para prevenir
46
;;; expansiones en cadena. Esto se puede lograr graciasa syntaxp.
48
;;; Elegimos la segunda opci�n porque se consigue un mayor grado de
49
;;; automatizaci�n y hace a las demostraciones menos sensibles a los
51
;;; ------------------------------------------------------------------
53
To certify this book, first, create a world with the following packages:
57
(defconst *import-symbols*
59
(union-eq *acl2-exports*
60
*common-lisp-symbols-from-main-lisp-package*)
61
'(null + * - < = / commutativity-of-* associativity-of-*
62
commutativity-of-+ associativity-of-+ distributivity)))
71
(union-eq *import-symbols*
72
'(FLD::fdp FUTER::terminop)))
75
(union-eq *import-symbols*
76
'(FUTER::naturalp FUTER::terminop FUMON::monomio FUMON::coeficiente
77
FUMON::termino FUMON::monomiop)))
79
(certify-book "fucongruencias-suma"
86
;;(include-book "suma")
87
(include-book "fusuma"
88
:load-compiled-file nil)
90
;;; ----------------------------------------------------
91
;;; Congruencia de la igualdad de polinomios con la suma
92
;;; ----------------------------------------------------
98
;;; Esta propiedad es expansiva; restringimos su aplicaci�n sint�cticamente
101
polinomiop-implies-true-listp
102
(implies (polinomiop p)
104
:rule-classes :compound-recognizer)
107
Right-identity-append
108
(implies (true-listp p)
109
(equal (append p nil) p)))
111
(defthm |p + q = p + fn(q)|
112
(implies (syntaxp (not (and (consp q) (eq (primero q) 'fn))))
113
(= (+ p q) (+ p (fn q)))))
116
=P-implies-=P-append-1
120
:rule-classes :congruence)
123
=P-implies-=P-append-2
127
:rule-classes :congruence)
134
:rule-classes :congruence)
136
;;(defcong = = (+ p q) 2)
142
:rule-classes :congruence)
146
;; (defcong = = (+ p q) 1
148
;; :in-theory (disable |p + q = q + p| + =)
149
;; :use (|p + q = q + p|
150
;; (:instance |p + q = q + p| (p p-equiv))))))
156
:rule-classes :congruence
158
:in-theory (disable |p + q = q + p| + =)
168
;;; Esta propiedad es expansiva; restringimos su aplicaci�n sint�cticamente
170
(defthm |p + q = fn(p) + q|
171
(implies (syntaxp (not (and (consp p) (eq (primero p) 'fn))))
172
(= (+ p q) (+ (fn p) q)))
174
:in-theory (disable |p + q = p + fn(q)|)
175
:use ((:instance |p + q = p + fn(q)| (p q) (q p))))))
177
(defthm |fn(p) + fn(q) = p + q|
178
(= (+ (fn p) (fn q)) (+ p q)))
180
(in-theory (disable |p + q = p + fn(q)|
182
|fn(p) + fn(q) = p + q|))