1
; ACL2 Euclidean Domain books -- Book 3 -- Algebraic Theory
2
; Convenient notation and events for using the theory of an
4
; Copyright (C) 2005 John R. Cowles, University of Wyoming
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.
22
; Department of Computer Science
23
; University of Wyoming
24
; Laramie, WY 82071-3682 U.S.A.
26
; Last modified Feb. 2006.
29
To certify this book, first, create a world with the following packages:
33
(UNION-EQ *ACL2-EXPORTS*
34
*COMMON-LISP-SYMBOLS-FROM-MAIN-LISP-PACKAGE*)
39
(UNION-EQ *ACL2-EXPORTS*
40
*COMMON-LISP-SYMBOLS-FROM-MAIN-LISP-PACKAGE*)
45
(UNION-EQ *ACL2-EXPORTS*
46
*COMMON-LISP-SYMBOLS-FROM-MAIN-LISP-PACKAGE*)
55
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
56
;; An Euclidean Domain is an integral domain, together with a Size function
57
;; from nonzero domain elements into the nonnegative integers, that
58
;; satisfies the Division Propery:
60
;; Division Propery. For all domain elements x and all nonzero domain
61
;; elements y there are domain elements q and r such that
63
;; x = yq + r and either r is the domain's zero or Size(r) < Size(y)
65
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
66
;; An Integral Domain is a commutative ring with no zero-divisors.
68
;; A Zero-Divisor in a commutative ring is a nonzero ring element, x, such
69
;; that there is a nonzero ring element y such that the product xy equals
70
;; the zero element of the ring.
72
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
73
;; A Commutative Ring is a nonempty set with two binary operations, addition
74
;; and multiplication, an unary operation, minus, and a ring element, zero,
77
;; (1) the binary operations are commutative and associative,
78
;; (2) multiplication distributes over addition,
79
;; (3) zero is an identity for addition, and
80
;; (4) minus produces an additive inverse
82
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
83
;; This book assumes the result reported in ed1.lisp which is Book 1 of
84
;; ACL2 Euclidean Domain books
86
;; Multiplicative Identity Existence
88
;; That is, every Euclidean Domain has a multiplicative identity.
90
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
91
;; This book also assumes the result reported in ed2.lisp which is Book 2
92
;; of the ACL2 Euclidean Domain books.
94
;; There is no loss of generality in assuming the
95
;; Multiplicative Size Property:
97
;; For all nonzero domain elements x and y, Size(x) <= Size(xy).
99
;; If the original Size function does not satisfy this property,
100
;; then it can replaced by another that does satisfy this and the
101
;; division property.
103
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
104
;; Brief Contents of This Book
106
;; Axioms and convenient notation for
107
;; the theory of an Euclidean Domain.
109
;; Integral Domain Theory.
114
;; ;; Divides-p (x y)
115
;; ;; (exists z (and (edp x)
120
;; Associates-p Theory.
123
;; ;; Associates-p (x y)
124
;; ;; (if (and (edp x)
126
;; ;; (and (divides-p x y)
127
;; ;; (divides-p y x))
134
;; ;; (divides-p x (1_e)))
137
;; Irreducible-p Theory.
140
;; ;; Reducible-p (x)
141
;; ;; (exists (y z)(and (edp y)
143
;; ;; (not (unit-p y))
144
;; ;; (not (unit-p z))
145
;; ;; (=_e (*_e y z) x))))
148
;; ;; Irreducible-p (x)
150
;; ;; (not (unit-p x))
151
;; ;; (not (reducible-p x))))
153
;; Factorization Existence Theory.
156
;; ;; IRREDUCIBLE-FACTORIZATION-EXISTENCE
157
;; ;; (and (true-listp (irreducible-factors x))
158
;; ;; (edp-listp (irreducible-factors x))
159
;; ;; (irreducible-listp (irreducible-factors x))
160
;; ;; (implies (and (edp x)
161
;; ;; (not (=_e x (0_e)))
162
;; ;; (not (unit-p x)))
163
;; ;; (=_e (*_e-lst (irreducible-factors x)) x)))
164
;; ;; :rule-classes nil)
168
;; ;; Determine if g is a gcd of x and y.
171
;; ;; (forall d (and (divides-p g x)
172
;; ;; (divides-p g y)
173
;; ;; (implies (and (divides-p d x)
174
;; ;; (divides-p d y))
175
;; ;; (divides-p d g)))))
177
;; Unit-associates-p Theory.
180
;; ;; unit-associates-p (x y)
181
;; ;; (exists u (if (and (edp x)
183
;; ;; (and (unit-p u)
187
;; ;; Unit-associates-p is equivalent to Associates-p.
189
;; Unique Factorization Theory.
192
;; ;; IRREDUCIBLE-FACTORIZATION-UNIQUENESS-general
193
;; ;; (implies (and (irreducible-listp lst1)
194
;; ;; (irreducible-listp lst2)
195
;; ;; (unit-associates-p (*_e-lst lst1)
196
;; ;; (*_e-lst lst2)))
197
;; ;; (bag-equal-unit-associates lst1 lst2))
198
;; ;; :hints (("Goal"
202
;; ;; IRREDUCIBLE-FACTORIZATION-UNIQUENESS
203
;; ;; (implies (and (irreducible-listp lst1)
204
;; ;; (irreducible-listp lst2)
205
;; ;; (=_e (*_e-lst lst1)
206
;; ;; (*_e-lst lst2)))
207
;; ;; (bag-equal-unit-associates lst1 lst2))
208
;; ;; :hints (("Goal"
210
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
212
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
213
; Make temporary use of an ACL2 Arithmetic Book to help certify this book,
216
(include-book "arithmetic/top" :dir :system
217
; Matt K.: Commenting out use of :uncertified-okp after v4-3 in order to
218
; support provisional certification:
219
; :uncertified-okp nil
221
:skip-proofs-okp nil))
223
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
224
;; Axioms and convenient notation for
225
;; the theory of an Euclidean Domain.
229
(((edp *) => *) ; x is in Euclidean Domain iff (NOT (EQUAL (edp x) NIL)).
230
((=_e * *) => *) ; Equality predicate for Euclidean Domain elements.
231
((C_=_e *) => *) ; Choose unique equivalence class representative for =_e.
232
((binary-+_e * *) => *) ; Addition in Euclidean Domain.
233
((binary-*_e * *) => *) ; Multiplication in Euclidean Domain.
234
((-_e *) => *) ; Unary minus in Euclidean Domain.
235
((0_e) => *) ; 0 element in Euclidean Domain.
236
((1_e) => *) ; 1 element in Euclidean Domain.
237
((size *) => *) ; Natp size of each nonzero Euclidean Domain element.
238
((q_e * *) => *) ; Quotient in Euclidean Domain.
239
((r_e * *) => *)) ; Remainder in Euclidean Domain.
285
(declare (ignore x y))
288
; Convenient Notation:
293
(xxxjoin 'binary-+_e rst)
294
(list 'binary-+_e '(0_e)(car rst)))
301
(xxxjoin 'binary-*_e rst)
302
(list 'binary-*_e '(1_e)(car rst)))
306
; Integral Domain Axioms:
309
(and (implies (edp x)
310
(and (implies (edp y)
322
(and (booleanp (=_e x y))
326
(implies (and (=_e x y)
335
(implies (and (edp y1)
337
(and (implies (edp x)
357
Equivalence-class-Laws
358
(and (implies (edp x)
360
(implies (and (edp y1)
369
(implies (and (edp x)
378
(implies (and (edp x)
381
(and (=_e (+_e (+_e x y) z)
383
(=_e (*_e (*_e x y) z)
384
(*_e x (*_e y z))))))
387
Left-Distributivity-Law
388
(implies (and (edp x)
391
(=_e (*_e x (+_e y z))
398
(and (=_e (+_e (0_e) x)
411
(implies (and (edp x)
413
(equal (=_e (*_e x y)(0_e))
417
; Euclidean Domain Axioms:
420
(implies (and (edp x)
422
(and (integerp (size x))
424
:rule-classes (:type-prescription
429
(implies (and (edp y1)
438
(implies (and (edp x)
445
Congruence-for-q_e-&-r_e
446
(implies (and (edp y1)
449
(and (implies (and (edp x)
450
(not (=_e y1 (0_e))))
455
(implies (and (edp z)
465
(implies (and (edp x)
468
(and (=_e x (+_e (*_e y (q_e x y))
470
(or (=_e (r_e x y)(0_e))
477
(implies (and (edp x)
483
:rule-classes (:linear :rewrite))
486
(add-invisible-fns binary-+_e -_e)
487
(add-invisible-fns -_e -_e)
489
(add-binop +_e binary-+_e)
490
(add-binop *_e binary-*_e)
494
"==_e nicely extends =_e
495
to entire ACL2 universe."
506
"binary-++_e nicely extends +_e
507
to entire ACL2 universe."
515
"binary-**_e nicely extends *_e
516
to entire ACL2 universe."
522
; Convenient Notation:
527
(xxxjoin 'binary-++_e rst)
528
(list 'binary-++_e '(0_e)(car rst)))
535
(xxxjoin 'binary-**_e rst)
536
(list 'binary-**_e '(1_e)(car rst)))
539
(add-invisible-fns binary-++_e -_e)
541
(add-binop ++_e binary-++_e)
542
(add-binop **_e binary-**_e)
544
;; Restate Integral Domain Axioms in
545
;; terms of ==_e, C_==_e, ++_e, and **_e
546
;; in place of =_e, C_=_e, +_e, +_e, and *_e.
549
Closure-Laws-for-++_e-&-**_e
550
(implies (and (edp x)
552
(and (edp (++_e x y))
557
(and (booleanp (==_e x y))
561
(implies (and (==_e x y)
564
:rule-classes :equivalence)
568
(implies (==_e y1 y2)
571
:rule-classes :congruence)
574
==_e-implies-==_e-++_e-1
575
(implies (==_e y1 y2)
578
:rule-classes :congruence
580
:use congruence-laws)))
583
==_e-implies-==_e-++_e-2
584
(implies (==_e y1 y2)
587
:rule-classes :congruence
589
:use congruence-laws)))
592
==_e-implies-==_e-**_e-1
593
(implies (==_e y1 y2)
596
:rule-classes :congruence
598
:use congruence-laws)))
601
==_e-implies-==_e-**_e-2
602
(implies (==_e y1 y2)
605
:rule-classes :congruence
607
:use congruence-laws)))
610
==_e-implies-==_e_-_e
611
(implies (==_e y1 y2)
614
:rule-classes :congruence
616
:use congruence-laws)))
620
"C_==_e nicely extends C_=_e
621
to entire ACL2 universe."
630
:use Equivalence-class-Laws)))
633
==_e-implies-equal-C_==_e
634
(implies (==_e y1 y2)
637
:rule-classes :congruence
639
:use Equivalence-class-Laws)))
642
Commutativity-Laws-for-++_e-&-**_e
643
(implies (and (edp x)
645
(and (==_e (++_e x y)
651
Associativity-Laws-for-++_e-&-**_e
652
(implies (and (edp x)
655
(and (==_e (++_e (++_e x y) z)
657
(==_e (**_e (**_e x y) z)
658
(**_e x (**_e y z)))))
660
:in-theory (disable Commutativity-Laws-for-++_e-&-**_e))))
663
Left-Distributivity-Law-for-++_e-&-**_e
664
(implies (and (edp x)
667
(==_e (**_e x (++_e y z))
672
Left-Unicity-Laws-for-++_e-&-**_e
674
(and (==_e (++_e (0_e) x)
680
Right-Inverse-Law-for-++_e
682
(==_e (++_e x (-_e x))
686
Zero-Divisor-Law-for-**_e
687
(implies (and (edp x)
689
(equal (==_e (**_e x y)(0_e))
693
;; Restate Euclidean Domain Axioms in
694
;; terms of ==_e, ++_e, **_e, qq_e, and rr_e
695
;; in place of =_e, +_e, +_e, and *_e, q_e, and r_e.
699
(implies (and (edp x)
700
(not (==_e x (0_e))))
701
(and (integerp (size x))
703
:rule-classes (:type-prescription
707
==_e-implies-equal-size
708
(implies (==_e y1 y2)
711
:rule-classes :congruence
713
:use Congruence-for-Size)))
717
"qq_e nicely extends q_e
718
to entire ACL2 universe."
721
(not (==_e y (0_e))))
727
"rr_e nicely extends r_e
728
to entire ACL2 universe."
731
(not (==_e y (0_e))))
736
Closure-of-qq_e-&-rr_e
737
(implies (and (edp x)
739
(not (==_e y (0_e))))
740
(and (edp (qq_e x y))
744
==_e-implies-==_e-qq_e-1
745
(implies (==_e y1 y2)
748
:rule-classes :congruence
750
:use Congruence-for-q_e-&-r_e)))
753
==_e-implies-==_e-qq_e-2
754
(implies (==_e y1 y2)
757
:rule-classes :congruence
759
:use Congruence-for-q_e-&-r_e)))
762
==_e-implies-==_e-rr_e-1
763
(implies (==_e y1 y2)
766
:rule-classes :congruence
768
:use Congruence-for-q_e-&-r_e)))
771
==_e-implies-==_e-rr_e-2
772
(implies (==_e y1 y2)
775
:rule-classes :congruence
777
:use Congruence-for-q_e-&-r_e)))
780
Division-property-for-qq_e-&-rr_e
781
(implies (and (edp x)
783
(not (==_e y (0_e))))
784
(and (==_e x (++_e (**_e y (qq_e x y))
786
(or (==_e (rr_e x y)(0_e))
789
:rule-classes ((:elim
791
(implies (and (edp x)
793
(not (==_e y (0_e))))
794
(==_e (++_e (rr_e x y)
799
(implies (and (edp x)
801
(not (==_e y (0_e))))
802
(and (==_e (++_e (rr_e x y)
805
(implies (not (==_e (rr_e x y) (0_e)))
810
(implies (and (edp x)
813
(not (==_e (rr_e x y)(0_e))))
817
:in-theory (disable commutativity-laws-for-++_e-&-**_e)
818
:use Division-property)))
822
(implies (and (edp x)
825
(not (==_e y (0_e))))
828
:rule-classes (:linear :rewrite))
830
(in-theory (disable (:definition ==_e)
832
(:definition binary-++_e)
833
(:definition binary-**_e)
837
;;;;;;;;;;;;;;;;;;;;;;;;;;
838
;; Integral Domain Theory:
843
(and (==_e (++_e x (0_e))
849
Right-Distributivity-Law
850
(implies (and (edp x)
853
(==_e (**_e (++_e x y) z)
859
(implies (and (edp x)
862
(and (==_e (++_e x y z)
868
(:functional-instance
869
acl2-asg::commutativity-2-of-op
870
(acl2-asg::equiv ==_e)
872
(acl2-asg::op binary-++_e))
877
(:functional-instance
878
acl2-asg::commutativity-2-of-op
879
(acl2-asg::equiv ==_e)
881
(acl2-asg::op binary-**_e))
889
(and (==_e (**_e (0_e) x)
901
(:functional-instance
902
acl2-agp::Involution-of-inv
903
(acl2-agp::equiv ==_e)
905
(acl2-agp::op binary-++_e)
911
Inverse-Distributive-Law
912
(implies (and (edp x)
914
(==_e (-_e (++_e x y))
915
(++_e (-_e x)(-_e y))))
918
(:functional-instance
919
acl2-agp::Distributivity-of-inv-over-op
920
(acl2-agp::equiv ==_e)
922
(acl2-agp::op binary-++_e)
929
Inverse-Cancellation-Laws
930
(implies (and (edp x)
932
(and (==_e (++_e x y (-_e x))
934
(==_e (++_e x (-_e x) y)
938
(:functional-instance
939
acl2-agp::inv-cancellation-on-right
940
(acl2-agp::equiv ==_e)
942
(acl2-agp::op binary-++_e)
949
Cancellation-Laws-for-++_e
950
(implies (and (edp x)
953
(and (equal (==_e (++_e x z)(++_e y z))
955
(equal (==_e (++_e z x)(++_e z y))
957
(equal (==_e (++_e z x)(++_e y z))
959
(equal (==_e (++_e x z)(++_e z y))
963
(:functional-instance
964
acl2-agp::Right-cancellation-for-op
965
(acl2-agp::equiv ==_e)
967
(acl2-agp::op binary-++_e)
975
Functional-Commutativity-Laws-1
976
(implies (and (edp x)
978
(and (==_e (**_e x (-_e y))
980
(==_e (**_e (-_e y) x)
984
(:functional-instance
985
acl2-crg::functional-commutativity-of-minus-times-right
986
(acl2-crg::equiv ==_e)
988
(acl2-crg::plus binary-++_e)
989
(acl2-crg::times binary-**_e)
991
(acl2-crg::minus -_e))
1001
Cancellation-Laws-for-++_e
1009
(equal (==_e (0_e)(-_e x))
1013
==_e-implies-==_e_-_e
1019
(implies (and (edp x)
1021
(equal (==_e (-_e x)(-_e y))
1025
==_e-implies-==_e_-_e
1032
(equal (==_e (++_e x x) x)
1036
(:functional-instance
1037
acl2-agp::Uniqueness-of-id-as-op-idempotent
1038
(acl2-agp::equiv ==_e)
1039
(acl2-agp::pred edp)
1040
(acl2-agp::op binary-++_e)
1042
(acl2-agp::inv -_e))
1043
(acl2-agp::x x))))))
1047
(implies (and (edp x)
1049
(equal (==_e (++_e x (-_e y))(0_e))
1053
Cancellation-Laws-for-++_e
1054
(x (++_e x (-_e y)))
1059
Cancellation-Laws-for-**_e
1060
(implies (and (edp x)
1063
(and (equal (==_e (**_e x z)(**_e y z))
1066
(equal (==_e (**_e x z)(**_e z y))
1069
(equal (==_e (**_e z x)(**_e y z))
1072
(equal (==_e (**_e z x)(**_e z y))
1077
Zero-Divisor-Law-for-**_e
1078
(x (++_e x (-_e y)))
1083
(implies (and (edp x)
1085
(and (equal (==_e (**_e x y) x)
1088
(equal (==_e (**_e y x) x)
1091
(equal (==_e (++_e x y) x)
1093
(equal (==_e (++_e y x) x)
1097
Cancellation-Laws-for-**_e
1098
(z x)(x y)(y (1_e)))
1100
Cancellation-Laws-for-++_e
1101
(z x)(x y)(y (0_e)))))))
1104
Commutativity-of-==_e
1115
(implies (and (edp x)
1117
(and (equal (==_e x (**_e x y))
1120
(equal (==_e x (**_e y x))
1123
(equal (==_e x (++_e x y))
1125
(equal (==_e x (++_e y x))
1129
Commutativity-of-==_e
1132
Commutativity-of-==_e
1137
(implies (and (edp x)
1138
(not (==_e x (0_e))))
1139
(not (==_e (1_e)(0_e))))
1140
:rule-classes ((:rewrite
1142
(implies (and (not (==_e x (0_e)))
1144
(not (==_e (1_e)(0_e))))))
1146
:use Left-Unicity-Laws-for-++_e-&-**_e)))
1148
;;;;;;;;;;;;;;;;;;;;
1149
;; Divides-p theory:
1153
(exists z (and (edp x)
1160
(exists z (and (edp x)
1166
Divides-p-implies-divides-p1
1167
(implies (divides-p x y)
1171
:in-theory (enable (:definition ==_e)
1172
(:definition binary-**_e))
1175
(y1 (*_e x (divides-p-witness x y)))
1179
Divides-p1-implies-divides-p
1180
(implies (divides-p1 x y)
1184
:in-theory (enable (:definition ==_e)
1185
(:definition binary-**_e)))))
1188
Divides-p-iff-divides-p1
1189
(iff (divides-p x y)
1193
:use (Divides-p-implies-divides-p1
1194
Divides-p1-implies-divides-p))))
1198
(Booleanp (divides-p x y))
1199
:rule-classes :type-prescription
1203
(y1 (*_e x (divides-p-witness x y)))
1207
Divides-p-=-divides-p1
1208
(equal (divides-p x y)
1212
:in-theory (disable (:definition divides-p)
1213
(:definition divides-p1))
1214
:use Divides-p-iff-divides-p1)))
1217
Divides-pp-witness (x y)
1218
"Divides-pp-witness nicely
1219
modifies divides-p1-witness."
1220
(divides-p1-witness (C_==_e x)(C_==_e y)))
1223
==_e-implies-==_e-divides-pp-witness-1
1224
(implies (==_e y1 y2)
1225
(==_e (divides-pp-witness y1 z)
1226
(divides-pp-witness y2 z)))
1227
:rule-classes :congruence)
1230
==_e-implies-==_e-divides-pp-witness-2
1231
(implies (==_e y1 y2)
1232
(==_e (divides-pp-witness x y1)
1233
(divides-pp-witness x y2)))
1234
:rule-classes :congruence)
1238
(let ((z (divides-pp-witness x y)))
1241
(==_e (**_e x z) y))))
1244
==_e-implies-equal-divides-pp-1
1245
(implies (==_e y1 y2)
1246
(equal (divides-pp y1 z)
1248
:rule-classes :congruence)
1251
==_e-implies-equal-divides-pp-2
1252
(implies (==_e y1 y2)
1253
(equal (divides-pp x y1)
1255
:rule-classes :congruence)
1259
(implies (and (edp x)
1261
(==_e (**_e x z) y))
1264
:in-theory (disable divides-p1-suff)
1270
(in-theory (disable (:definition Divides-pp-witness)
1271
(:executable-counterpart divides-pp)))
1274
Divides-p1-=-Divides-pp
1275
(equal (divides-p1 x y)
1280
(implies (divides-p1 x y)
1283
(implies (divides-pp x y)
1284
(divides-p1 x y)))))))
1287
Divides-p-=-Divides-pp
1288
(equal (divides-p x y)
1292
:use (Divides-p-=-Divides-p1
1293
Divides-p1-=-Divides-pp))))
1297
(implies (divides-pp x y)
1299
:rule-classes :forward-chaining)
1303
(implies (divides-pp x y)
1305
:rule-classes :forward-chaining
1308
Closure-Laws-for-++_e-&-**_e
1309
(y (divides-pp-witness x y))))))
1312
Divides-pp-edp-divides-pp-witness
1313
(implies (divides-pp x y)
1314
(edp (divides-pp-witness x y))))
1316
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1317
;; (O_e) is greatest element with
1318
;; respect to divides-pp relation.
1320
Greatest-divides-pp=0_e
1322
(divides-pp x (0_e))))
1324
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1325
;; (1_e) is least element with
1326
;; respect to divides-pp relation.
1328
Least-divides-pp=1_e
1330
(divides-pp (1_e) x)))
1333
Transitivity-divides-pp-lemma
1334
(implies (and (edp x)
1335
(edp (divides-pp-witness x y))
1336
(edp (divides-pp-witness y z))
1337
(==_e (**_e x (divides-pp-witness x y)) y)
1338
(==_e (**_e y (divides-pp-witness y z)) z))
1340
(divides-pp-witness x y)
1341
(divides-pp-witness y z))
1345
Associativity-laws-for-++_e-&-**_e
1346
(y (divides-pp-witness x y))
1347
(z (divides-pp-witness y z))))))
1350
Transitivity-divides-pp
1351
(implies (and (divides-pp x y)
1354
:rule-classes (:rewrite
1360
(z (**_e (divides-pp-witness x y)
1361
(divides-pp-witness y z)))))))
1365
(implies (and (divides-pp x y)
1367
(divides-pp x (++_e y z)))
1372
(z (++_e (divides-pp-witness x y)
1373
(divides-pp-witness x z)))))))
1377
(implies (and (divides-pp x y)
1379
(divides-pp x (++_e y (-_e z))))
1383
(y (++_e y (-_e z)))
1384
(z (++_e (divides-pp-witness x y)
1385
(-_e (divides-pp-witness x z))))))))
1389
(implies (and (edp v)
1391
(and (divides-pp x (**_e y v))
1392
(divides-pp x (**_e v y))))
1394
:in-theory (disable divides-pp-edp-2)
1398
(z (**_e v (divides-pp-witness x y))))
1399
divides-pp-edp-2))))
1402
Divides-pp-witness-0_e
1403
(implies (and (edp x)
1404
(not (==_e x (0_e))))
1405
(==_e (divides-pp-witness x (0_e))
1408
:in-theory (disable divides-pp-suff
1409
Greatest-divides-pp=0_e)
1416
Rr_e=0-implies-divides-pp
1417
(implies (and (edp x)
1418
(not (==_e x (0_e)))
1420
(==_e (rr_e y x)(0_e)))
1423
:in-theory (disable closure-of-qq_e-&-rr_e)
1428
closure-of-qq_e-&-rr_e
1433
Divides-pp-implies-rr_e=0-lemma
1434
(implies (and (divides-pp x y)
1435
(not (==_e x (0_e))))
1436
(==_e (**_e x (++_e (divides-pp-witness x y)
1440
:in-theory (disable closure-of-qq_e-&-rr_e
1443
closure-of-qq_e-&-rr_e
1446
divides-pp-edp-2))))
1449
Divides-pp-implies-rr_e=0-lemma-1
1450
(implies (and (==_e (divides-pp-witness x y)(qq_e y x))
1453
(==_e (**_e x (divides-pp-witness x y)) y)
1454
(not (==_e x (0_e))))
1455
(==_e (rr_e y x)(0_e)))
1457
:in-theory (disable closure-of-qq_e-&-rr_e)
1459
closure-of-qq_e-&-rr_e
1464
Divides-p-implies-rr_e=0
1465
(implies (and (divides-pp x y)
1466
(not (==_e x (0_e))))
1467
(==_e (rr_e y x)(0_e)))
1469
:in-theory (disable divides-pp-edp-2)
1470
:use (divides-pp-edp-2
1473
(y (++_e (divides-pp-witness x y)
1474
(-_e (qq_e y x)))))))))
1477
Divides-pp-implies-witness=qq_e
1478
(implies (and (divides-pp x y)
1479
(not (==_e x (0_e))))
1480
(==_e (divides-pp-witness x y)
1483
:in-theory (disable divides-pp-edp-2
1484
divides-pp-edp-divides-pp-witness)
1485
:use (divides-pp-edp-2
1487
Cancellation-Laws-for-**_e
1489
(x (divides-pp-witness x y))
1492
Division-property-for-qq_e-&-rr_e
1496
;;;;;;;;;;;;;;;;;;;;;;;
1497
;; Associates-p theory:
1503
(and (divides-p x y)
1511
(and (divides-pp x y)
1516
Associates-p-=-Associates-pp
1517
(equal (associates-p x y)
1518
(associates-pp x y))
1521
:in-theory (disable (:definition divides-p)
1522
(:definition divides-pp))
1523
:use (Divides-p-=-Divides-pp
1525
Divides-p-=-Divides-pp
1530
Associates-pp-is-an-equivalence
1531
(and (booleanp (associates-pp x y))
1533
(implies (associates-pp x y)
1534
(associates-pp y x))
1535
(implies (and (associates-pp x y)
1536
(associates-pp y z))
1537
(associates-pp x z)))
1538
:rule-classes :equivalence
1540
:in-theory (disable divides-pp))))
1543
==_e-implies-equal-associates-pp-1
1544
(implies (==_e y1 y2)
1545
(equal (associates-pp y1 z)
1546
(associates-pp y2 z)))
1547
:rule-classes :congruence
1549
:in-theory (disable (:definition divides-pp)))
1551
:in-theory (enable (:definition ==_e)))
1553
:in-theory (enable (:definition ==_e)))))
1556
==_e-implies-equal-associates-pp-2
1557
(implies (==_e y1 y2)
1558
(equal (associates-pp x y1)
1559
(associates-pp x y2)))
1560
:rule-classes :congruence
1562
:in-theory (disable (:definition divides-pp)))
1564
:in-theory (enable (:definition ==_e)))
1566
:in-theory (enable (:definition ==_e)))))
1569
==_e-refines-associates-pp
1571
(associates-pp x y))
1572
:rule-classes :refinement)
1575
Associates-pp-implies-equal-divides-pp-1
1576
(implies (associates-pp x1 x2)
1577
(equal (divides-pp x1 y)
1579
:rule-classes :congruence
1582
Transitivity-divides-pp
1587
Transitivity-divides-pp
1593
Associates-pp-implies-equal-divides-pp-2
1594
(implies (associates-pp y1 y2)
1595
(equal (divides-pp x y1)
1597
:rule-classes :congruence
1600
associates-pp-implies-equal-divides-pp-1)
1602
Transitivity-divides-pp
1606
Transitivity-divides-pp
1612
(implies (and (divides-pp x y)
1613
(not (==_e y (0_e))))
1617
:in-theory (disable divides-pp-implies-witness=qq_e)
1620
(y (divides-pp-witness x y))))))
1623
Associates-pp-implies-equal-Size-lemma-1
1624
(implies (and (associates-pp x y)
1625
(not (==_e y (0_e))))
1630
:in-theory (disable (:definition divides-pp))
1631
:use (Divides-pp-<=-Size
1637
(implies (and (associates-pp x y)
1638
(not (==_e y (0_e))))
1639
(not (==_e x (0_e)))))))
1641
:in-theory (enable (:definition divides-pp)))))
1644
Associates-pp-implies-equal-Size-lemma-2
1645
(implies (and (associates-pp x y)
1646
(not (==_e x (0_e))))
1651
:in-theory (disable (:definition divides-pp))
1652
:use (Divides-pp-<=-Size
1658
(implies (and (associates-pp x y)
1659
(not (==_e x (0_e))))
1660
(not (==_e y (0_e)))))))
1662
:in-theory (enable (:definition divides-pp)))))
1665
Associates-pp-implies-equal-Size
1666
(implies (associates-pp x1 x2)
1669
:rule-classes :congruence
1671
:cases ((not (==_e x2 (0_e)))
1672
(not (==_e x1 (0_e)))))
1675
Associates-pp-implies-equal-Size-lemma-1
1680
Associates-pp-implies-equal-Size-lemma-2
1689
(divides-p x (1_e)))
1693
(divides-p1 x (1_e)))
1697
(divides-pp x (1_e)))
1706
Divides-p-=-Divides-p1
1716
Divides-p1-=-Divides-pp
1726
Divides-p-=-Divides-pp
1730
==_e-implies-equal-unit-pp
1731
(implies (==_e x1 x2)
1734
:rule-classes :congruence)
1737
Associates-pp-implies-equal-unit-pp
1738
(implies (associates-pp x1 x2)
1741
:rule-classes :congruence)
1749
(unit-pp (-_e (1_e)))
1758
Size-unit-pp=Size-1_e
1759
(implies (unit-pp x)
1764
:in-theory (disable (:definition associates-pp))
1766
(implies (unit-pp x)
1767
(associates-pp x (1_e)))))
1769
:in-theory (enable (:definition associates-pp)))))
1772
Size-unit-p=Size-1_e
1778
:in-theory (disable (:definition unit-p)
1779
(:definition unit-pp))
1780
:use (unit-p-=-unit-pp
1781
Size-unit-pp=Size-1_e))))
1785
(implies (and (not (==_e x (0_e)))
1787
(>= (size x)(size (1_e))))
1788
:rule-classes (:linear
1793
(implies (and (edp x)
1794
(not (==_e x (0_e)))
1797
(==_e (rr_e (1_e) x)(0_e))))
1800
Size=Size-1_e-implies-unit-pp
1801
(implies (and (edp x)
1802
(not (==_e x (0_e)))
1808
Size=Size-1_e-implies-unit-p
1809
(implies (and (edp x)
1815
:in-theory (e/d ((:definition ==_e))
1816
((:definition unit-p)
1817
(:definition unit-pp)
1818
Size=Size-1_e-implies-unit-pp))
1819
:use (unit-p-=-unit-pp
1820
Size=Size-1_e-implies-unit-pp))))
1823
Size-<-Size-**_e-lemma-1
1824
(implies (and (edp x)
1825
(not (==_e x (0_e)))
1827
(not (==_e y (0_e))))
1829
(-_e (**_e x y (qq_e x (**_e x y)))))
1830
(rr_e x (**_e x y))))
1834
Division-property-for-qq_e-&-rr_e
1838
(implies (and (edp x)
1841
(iff (==_e x (++_e y z))
1842
(==_e y (++_e x (-_e z))))))
1843
(y (rr_e x (**_e x y)))
1844
(z (**_e x y (qq_e x (**_e x y)))))))))
1847
Size-<-Size-**_e-lemma-2
1848
(implies (and (edp x)
1849
(not (==_e x (0_e)))
1851
(not (==_e y (0_e)))
1852
(not (==_e (rr_e x (**_e x y))
1854
(>= (Size (rr_e x (**_e x y)))
1858
:use (Size-<-Size-**_e-lemma-1))))
1861
Size-<-Size-**_e-lemma-3
1862
(implies (and (edp x)
1863
(not (==_e x (0_e)))
1865
(not (==_e y (0_e)))
1871
:use (Size-<-Size-**_e-lemma-2
1876
(z (qq_e x (**_e x y))))
1878
Division-property-for-qq_e-&-rr_e
1883
(implies (and (not (unit-pp y))
1885
(not (==_e x (0_e)))
1887
(not (==_e y (0_e))))
1890
:rule-classes (:linear
1893
:use Size-<-Size-**_e-lemma-3)
1896
(implies (and (edp x)
1897
(not (==_e x (0_e)))
1899
(not (==_e y (0_e))))
1900
(integerp (size (**_e x y))))))
1903
(implies (and (edp x)
1904
(not (==_e x (0_e)))
1906
(not (==_e y (0_e))))
1907
(integerp (size (**_e x y))))))))
1910
Unit-pp-divides-pp-witness
1911
(implies (unit-pp x)
1912
(unit-pp (divides-pp-witness x (1_e)))))
1915
Divides-pp-witness-divides-pp-witness
1916
(implies (unit-pp x)
1917
(==_e (divides-pp-witness (divides-pp-witness x (1_e))
1921
:in-theory (disable divides-pp-implies-witness=qq_e)
1922
:use (Unit-pp-divides-pp-witness
1924
Cancellation-Laws-for-**_e
1925
(z (divides-pp-witness x (1_e)))
1926
(y (divides-pp-witness (divides-pp-witness x (1_e))
1930
(x (divides-pp-witness (0_e)(0_e))))))
1935
Unit-pp-closure-**_e
1936
(implies (and (unit-pp u)
1938
(unit-pp (**_e u v)))
1940
:in-theory (disable divides-pp-edp-1)
1945
(z (**_e (divides-pp-witness u (1_e))
1946
(divides-pp-witness v (1_e))))))))
1949
Inverse-Cancellation-Laws-**_e
1950
(implies (and (edp u)
1953
(==_e (**_e u x)(1_e)))
1954
(and (==_e (**_e u x y) y)
1955
(==_e (**_e u y x) y)
1956
(==_e (**_e x u y) y)
1957
(==_e (**_e x y u) y)
1958
(==_e (**_e y u x) y)
1959
(==_e (**_e y x u) y)))
1962
associativity-laws-for-++_e-&-**_e
1968
Unit-pp-**_e-inverse
1969
(implies (and (unit-pp u)
1973
(==_e (**_e y (divides-pp-witness u (1_e)))
1975
:rule-classes ((:rewrite
1977
(implies (and (unit-pp u)
1981
(==_e (**_e y (divides-pp-witness u (1_e)))
1985
Unit-pp-Inverse-Distributive-Law
1986
(implies (and (unit-pp x)
1988
(==_e (divides-pp-witness (**_e x y)(1_e))
1989
(**_e (divides-pp-witness x (1_e))
1990
(divides-pp-witness y (1_e)))))
1993
(:functional-instance
1994
acl2-agp::Distributivity-of-inv-over-op
1995
(acl2-agp::equiv ==_e)
1996
(acl2-agp::pred unit-pp)
1997
(acl2-agp::op binary-**_e)
1999
(acl2-agp::inv (lambda (x)(divides-pp-witness x (1_e)))))
2003
; Changed after v4-3 by Kaufmann/Moore, for tau system --
2004
; tau on {"Subgoal 3"} tau off: {"Subgoal 8"}
2006
Unit-pp-closure-**_e
2011
Divides-pp-witness-1_e
2012
(==_e (divides-pp-witness (1_e)(1_e))
2015
:in-theory (disable least-divides-pp=1_e
2024
Divides-pp-witness-_-_e-1_e
2025
(==_e (divides-pp-witness (-_e (1_e))(1_e))
2029
Unit-pp-**_e-inverse
2036
(implies (and (not (==_e x (0_e)))
2038
(not (unit-pp (0_e))))
2040
:in-theory (disable 1_e-0_e)
2045
(implies (==_e (1_e)(0_e))
2050
(implies (unit-pp x)
2052
:rule-classes :forward-chaining)
2055
Unit-pp-**_e=>unit-pp-factor-left
2056
(implies (and (edp x)
2058
(unit-pp (**_e x y)))
2065
(z (**_e y (divides-pp-witness (**_e x y)(1_e))))))))
2068
Unit-pp-**_e=>unit-pp-factor-right
2069
(implies (and (edp x)
2071
(unit-pp (**_e x y)))
2076
Unit-pp-**_e=>unit-pp-factor-left
2080
(in-theory (disable (:executable-counterpart unit-p)
2081
(:executable-counterpart unit-p1)
2082
(:executable-counterpart unit-pp)))
2084
;;;;;;;;;;;;;;;;;;;;;;;;
2086
;; Irreducible-p theory:
2090
(exists (y z)(and (edp y)
2094
(=_e (*_e y z) x))))
2098
(exists (y z)(and (edp y)
2102
(==_e (**_e y z) x))))
2106
(implies (and (==_e (**_e y z) x)
2114
:in-theory (disable (:definition unit-p)
2115
(:definition unit-p1))
2125
(implies (and (=_e (*_e y z) x)
2132
:in-theory (e/d ((:definition ==_e)
2133
(:definition binary-**_e))
2134
((:definition reducible-p1)
2135
(:definition unit-p)))
2136
:use (Reducible-p1-suff-1
2143
Reducible-p-implies-reducible-p1
2144
(implies (reducible-p x)
2148
:in-theory (disable (:definition reducible-p1)
2149
(:definition unit-p)))))
2153
(implies (and (=_e (*_e y z) x)
2161
:in-theory (disable (:definition unit-p)
2162
(:definition unit-p1))
2172
(implies (and (==_e (**_e y z) x)
2179
:in-theory (e/d ((:definition ==_e)
2180
(:definition binary-**_e))
2181
((:definition reducible-p)
2182
(:definition unit-p1)))
2183
:use Reducible-p-suff-1)))
2185
(in-theory (disable (:executable-counterpart binary-**_e)))
2188
Reducible-p1-implies-reducible-p
2189
(implies (reducible-p1 x)
2193
:in-theory (disable (:definition reducible-p)
2194
(:definition unit-p1)))))
2197
Reducible-p-iff-reducible-p1
2198
(iff (reducible-p x)
2202
:use (Reducible-p-implies-reducible-p1
2203
Reducible-p1-implies-reducible-p))))
2206
Booleanp-reducible-p
2207
(Booleanp (reducible-p x))
2208
:rule-classes :type-prescription
2210
:in-theory (disable (:definition unit-p))
2213
(y1 (*_e (mv-nth 0 (reducible-p-witness x))
2214
(mv-nth 1 (reducible-p-witness x))))
2218
Reducible-p-=-reducible-p1
2219
(equal (reducible-p x)
2223
:in-theory (disable (:definition reducible-p)
2224
(:definition reducible-p1))
2225
:use Reducible-p-iff-reducible-p1)))
2228
Reducible-pp-witness (x)
2229
"Reducible-pp-witness nicely
2230
modifies reducible-p1-witness."
2231
(reducible-p1-witness (C_==_e x)))
2234
==_e-implies-equal-reducible-pp-witness
2235
(implies (==_e y1 y2)
2236
(equal (reducible-pp-witness y1)
2237
(reducible-pp-witness y2)))
2238
:rule-classes :congruence)
2243
(reducible-pp-witness x)
2248
(==_e (**_e y z) x))))
2251
==_e-implies-equal-reducible-pp
2252
(implies (==_e y1 y2)
2253
(equal (reducible-pp y1)
2255
:rule-classes :congruence)
2259
(implies (and (edp y)
2263
(==_e (**_e y z) x))
2275
(implies (and (==_e (**_e y z) x)
2282
:in-theory (disable reducible-p1-suff-3)
2287
(in-theory (disable (:definition reducible-pp-witness)
2288
(:executable-counterpart reducible-pp)))
2291
Reducible-p1-implies-reducible-pp
2292
(implies (reducible-p1 x)
2296
:in-theory (disable unit-p1 unit-pp
2297
(:definition reducible-pp))
2300
(y (car (reducible-p1-witness x)))
2301
(z (mv-nth 1 (reducible-p1-witness x))))
2304
(x (car (reducible-p1-witness x))))
2307
(x (mv-nth 1 (reducible-p1-witness x))))))))
2310
Reducible-pp-implies-reducible-p1
2311
(implies (reducible-pp x)
2315
:in-theory (disable unit-p1 unit-pp
2316
(:definition reducible-p1))
2319
(y (car (reducible-pp-witness x)))
2320
(z (mv-nth 1 (reducible-pp-witness x))))))))
2323
Reducible-p1-=-reducible-pp
2324
(equal (reducible-p1 x)
2328
:in-theory (disable reducible-p1
2330
:use (Reducible-p1-implies-reducible-pp
2331
Reducible-pp-implies-reducible-p1))))
2334
Reducible-p-=-reducible-pp
2335
(equal (reducible-p x)
2339
:use (Reducible-p1-=-reducible-pp
2340
Reducible-p-=-reducible-p1))))
2344
(implies (reducible-pp x)
2346
:rule-classes :forward-chaining
2349
closure-laws-for-++_e-&-**_e
2350
(x (mv-nth 0 (reducible-pp-witness x)))
2351
(y (mv-nth 1 (reducible-pp-witness x)))))))
2355
(implies (and (not (==_e x (0_e)))
2357
(reducible-pp (0_e)))
2359
:in-theory (disable (:definition unit-pp)
2360
(:definition reducible-pp))
2368
Unit-pp-not-reducible-pp
2369
(implies (unit-pp x)
2370
(not (reducible-pp x)))
2372
:in-theory (disable (:definition unit-pp))
2374
unit-pp-**_e=>unit-pp-factor-left
2375
(x (mv-nth 0 (reducible-pp-witness x)))
2376
(y (mv-nth 1 (reducible-pp-witness x)))))))
2378
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2379
;; Now, define Irreducible-p so that some form of unique
2380
;; factorization (into irreducible elements) can be
2381
;; proved for Euclidean Domains.
2383
;; Clearly (0_e) can be factored in many ways, if the
2384
;; Euclidean Domain is not trivial (that is, if the
2385
;; domain contains at least two distinct elements).
2386
;; Also any factorization of (0_e) must contain at
2389
;; Also units can be factored in many ways. For example
2390
;; (-_e (1_e)) = (*_e (-_e (1_e))(-_e (1_e))(-_e (1_e)))
2391
;; = (*_e (-_e (1_e))(-_e (1_e))(-_e (1_e))
2392
;; (-_e (1_e))(-_e (1_e)))
2393
;; Unique factorization should at least imply that any two
2394
;; factorizations contain the same number of factors.
2396
;; Irreducible elements are non-zero, non-unit, non-reducible
2397
;; elements of the domain.
2403
(not (reducible-p x))))
2405
(in-theory (disable (:executable-counterpart irreducible-p)))
2411
(not (reducible-pp x))))
2413
(in-theory (disable (:executable-counterpart irreducible-pp)))
2416
==_e-implies-equal-irreducible-pp
2417
(implies (==_e y1 y2)
2418
(equal (irreducible-pp y1)
2419
(irreducible-pp y2)))
2420
:rule-classes :congruence)
2423
Irreducible-p-=-irreducible-pp
2424
(equal (irreducible-p x)
2428
:in-theory (disable (:definition reducible-p)
2429
(:definition reducible-pp)
2430
(:definition unit-p)
2431
(:definition unit-pp))
2432
:use (Unit-p-=-Unit-pp
2433
Reducible-p-=-reducible-pp))))
2436
Irreducible-pp-not-0_e
2437
(implies (irreducible-pp x)
2438
(not (==_e x (0_e))))
2439
:rule-classes :forward-chaining
2441
:in-theory (disable (:definition reducible-pp)
2442
(:definition unit-pp))
2446
Irreducible-pp-implies-unit-pp-factor
2447
(implies (and (irreducible-pp x)
2450
(==_e (**_e y z) x))
2453
:rule-classes ((:rewrite
2455
(and (implies (and (==_e (**_e y z) x)
2461
(implies (and (==_e (**_e y z) x)
2468
:use reducible-pp-suff)))
2470
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2471
;; Factorization existence theory:
2474
Irreducible-factors-1 (x)
2475
"Return a list, lst, of irreducible
2476
elements of edp, so that if x is
2477
in edp, x is not ==_e to 0_e, and x
2478
is not an unit, then x ==_e product
2479
of the members in lst."
2480
(declare (xargs :measure (if (and (edp x)
2481
(not (==_e x (0_e))))
2484
:hints (("subgoal 2"
2485
:in-theory (disable (:definition mv-nth)
2489
(x (mv-nth 1 (reducible-pp-witness x)))
2490
(y (mv-nth 0 (reducible-pp-witness x)))))
2492
:in-theory (disable (:definition mv-nth)
2496
(x (mv-nth 0 (reducible-pp-witness x)))
2497
(y (mv-nth 1 (reducible-pp-witness x))))))))
2498
(cond ((or (not (edp x))
2505
(reducible-pp-witness x)
2506
(append (irreducible-factors-1 y)
2507
(irreducible-factors-1 z))))
2510
(in-theory (disable (:executable-counterpart irreducible-factors-1)))
2514
(implies (and (not (unit-p y))
2518
(not (=_e y (0_e))))
2519
(< (size x) (size (*_e x y))))
2522
:in-theory (e/d ((:definition ==_e)
2523
(:definition binary-**_e))
2524
((:definition unit-p)
2525
(:definition unit-pp)))
2526
:use (size-<-size-**_e
2533
Irreducible-factors (x)
2534
"Return a list, lst, of irreducible
2535
elements of edp, so that if x is
2536
in edp, x is not =_e to 0_e, and x
2537
is not an unit, then x =_e product
2538
of the members in lst."
2539
(declare (xargs :measure (if (and (edp x)
2540
(not (=_e x (0_e))))
2543
:hints (("subgoal 2"
2544
:in-theory (disable (:definition mv-nth)
2545
(:definition unit-p)
2549
(y (*_e (mv-nth 0 (reducible-p-witness x))
2550
(mv-nth 1 (reducible-p-witness x))))
2554
(x (mv-nth 0 (reducible-p-witness x)))
2555
(y (mv-nth 1 (reducible-p-witness x))))
2558
(x (mv-nth 1 (reducible-p-witness x)))
2559
(y (mv-nth 0 (reducible-p-witness x))))
2562
(y1 (*_e (mv-nth 0 (reducible-p-witness x))
2563
(mv-nth 1 (reducible-p-witness x))))
2564
(y2 (*_e (mv-nth 1 (reducible-p-witness x))
2565
(mv-nth 0 (reducible-p-witness x)))))
2568
(y1 (*_e (mv-nth 0 (reducible-p-witness x))
2569
(mv-nth 1 (reducible-p-witness x))))
2572
:in-theory (disable (:definition mv-nth)
2573
(:definition unit-p)
2577
(y (*_e (mv-nth 0 (reducible-p-witness x))
2578
(mv-nth 1 (reducible-p-witness x))))
2582
(x (mv-nth 0 (reducible-p-witness x)))
2583
(y (mv-nth 1 (reducible-p-witness x))))
2586
(x (mv-nth 0 (reducible-p-witness x)))
2587
(y (mv-nth 1 (reducible-p-witness x))))
2590
(y1 (*_e (mv-nth 0 (reducible-p-witness x))
2591
(mv-nth 1 (reducible-p-witness x))))
2593
(cond ((or (not (edp x))
2600
(reducible-p-witness x)
2601
(append (irreducible-factors y)
2602
(irreducible-factors z))))
2605
; No longer needed after v3-6-1 (essentially part of axioms.lisp):
2608
; (implies (true-listp lst2)
2609
; (true-listp (append lst1 lst2)))
2610
; :rule-classes :type-prescription)
2613
True-listp-irreducible-factors-1
2614
(true-listp (irreducible-factors-1 x))
2615
:rule-classes :type-prescription
2617
:in-theory (disable (:definition unit-pp)
2618
(:definition reducible-pp)))))
2621
True-listp-irreducible-factors
2622
(true-listp (irreducible-factors x))
2623
:rule-classes :type-prescription
2625
:in-theory (disable (:definition unit-p)
2626
(:definition reducible-p)))))
2629
Irreducible-listp-1 (lst)
2631
(and (irreducible-pp (car lst))
2632
(irreducible-listp-1 (cdr lst)))
2636
Irreducible-listp (lst)
2638
(and (irreducible-p (car lst))
2639
(irreducible-listp (cdr lst)))
2643
Irreducible-listp-1-append
2644
(implies (and (irreducible-listp-1 lst1)
2645
(irreducible-listp-1 lst2))
2646
(irreducible-listp-1 (append lst1 lst2)))
2648
:in-theory (disable (:definition irreducible-pp)))))
2651
Irreducible-listp-append
2652
(implies (and (irreducible-listp lst1)
2653
(irreducible-listp lst2))
2654
(irreducible-listp (append lst1 lst2)))
2656
:in-theory (disable (:definition irreducible-p)))))
2659
Size-implies-irreducible-pp
2660
(implies (and (edp x)
2661
(not (equal (size x)
2663
(not (reducible-pp x)))
2666
:in-theory (disable (:definition reducible-pp)
2667
(:definition unit-pp))
2668
:use Size-unit-pp=Size-1_e)))
2671
Size-implies-irreducible-p
2672
(implies (and (edp x)
2673
(not (equal (size x)
2675
(not (reducible-p x)))
2678
:in-theory (disable (:definition reducible-p)
2679
(:definition unit-p))
2680
:use Size-unit-p=Size-1_e)))
2683
Irreducible-listp-1-irreducible-factors-1
2684
(irreducible-listp-1 (irreducible-factors-1 x))
2686
:in-theory (disable (:definition reducible-pp)
2687
(:definition unit-pp)))))
2690
Irreducible-listp-irreducible-factors
2691
(irreducible-listp (irreducible-factors x))
2693
:in-theory (disable (:definition reducible-p)
2694
(:definition unit-p)))))
2699
(and (edp (car lst))
2700
(edp-listp (cdr lst)))
2704
Irreducible-listp-1-implies-edp-listp
2705
(implies (irreducible-listp-1 lst)
2709
Irreducible-listp-implies-edp-listp
2710
(implies (irreducible-listp lst)
2714
Edp-listp-irreducible-factors-1
2715
(edp-listp (irreducible-factors-1 x)))
2718
Edp-listp-irreducible-factors
2719
(edp-listp (irreducible-factors x)))
2725
(**_e (car lst)(**_e-lst (cdr lst)))
2729
(in-theory (disable (:executable-counterpart **_e-lst)))
2735
(*_e (car lst)(*_e-lst (cdr lst)))
2739
(in-theory (disable (:executable-counterpart *_e-lst)))
2743
(edp (**_e-lst lst)))
2747
(edp (*_e-lst lst)))
2751
(==_e (**_e-lst (append lst1 lst2))
2752
(**_e (**_e-lst lst1)
2757
(equal (*_e-lst lst)
2760
:hints (("Subgoal *1/1"
2761
:in-theory (enable (:definition binary-**_e)))))
2765
(=_e (*_e-lst (append lst1 lst2))
2769
:in-theory (e/d ((:definition ==_e)
2770
(:definition binary-**_e))
2772
:use (**_e-lst-append
2775
(lst (append lst1 lst2)))
2784
**_e-lst-irreducible-factors-1
2785
(implies (and (edp x)
2786
(not (==_e x (0_e)))
2788
(==_e (**_e-lst (irreducible-factors-1 x)) x))
2790
:in-theory (disable (:definition mv-nth)
2791
(:definition unit-pp)
2793
; The authors want unit-pp to stay in the problem. But the enabled rewrite rule
2794
; (DEFTHM UNIT-PP-NOT-REDUCIBLE-PP
2795
; (IMPLIES (UNIT-PP X)
2796
; (NOT (REDUCIBLE-PP X))))
2797
; is also a tau rule that removes unit-pp given the earlier assumption of
2798
; (reducible-pp x). So we must ensure that the tau-system is disabled.
2800
(:executable-counterpart tau-system)
2804
Right-unicity-law-for-*_e
2806
(=_e (*_e x (1_e)) x))
2808
:in-theory (disable Left-Unicity-Laws
2810
:use (Left-Unicity-Laws
2819
(implies (and (edp x1)
2841
(z (*_e x2 y2)))))))
2844
*_e-lst-irreducible-factors
2845
(implies (and (edp x)
2848
(=_e (*_e-lst (irreducible-factors x)) x))
2851
:in-theory (disable (:definition mv-nth)
2852
(:definition unit-p)))
2854
:in-theory (disable (:definition mv-nth)
2855
(:definition unit-p)
2859
(x1 (*_e-lst (irreducible-factors
2860
(mv-nth 0 (reducible-p-witness x)))))
2861
(x2 (mv-nth 0 (reducible-p-witness x)))
2862
(y1 (*_e-lst (irreducible-factors
2863
(mv-nth 1 (reducible-p-witness x)))))
2864
(y2 (mv-nth 1 (reducible-p-witness x))))
2867
(x (*_e-lst (append (irreducible-factors
2868
(mv-nth 0 (reducible-p-witness x)))
2869
(irreducible-factors
2870
(mv-nth 1 (reducible-p-witness x))))))
2871
(y (*_e (*_e-lst (irreducible-factors
2872
(mv-nth 0 (reducible-p-witness x))))
2873
(*_e-lst (irreducible-factors
2874
(mv-nth 1 (reducible-p-witness x))))))
2875
(z (*_e (mv-nth 0 (reducible-p-witness x))
2876
(mv-nth 1 (reducible-p-witness x)))))
2879
(x (*_e-lst (append (irreducible-factors
2880
(mv-nth 0 (reducible-p-witness x)))
2881
(irreducible-factors
2882
(mv-nth 1 (reducible-p-witness x))))))
2883
(y (*_e (mv-nth 0 (reducible-p-witness x))
2884
(mv-nth 1 (reducible-p-witness x))))
2889
(implies (and (edp x)
2895
(x (*_e (mv-nth 0 (reducible-p-witness x))
2896
(mv-nth 1 (reducible-p-witness x))))
2902
(implies (and (edp x)
2908
(x (*_e (mv-nth 0 (reducible-p-witness x))
2909
(mv-nth 1 (reducible-p-witness x))))
2915
(implies (and (edp x)
2921
(x (*_e (mv-nth 0 (reducible-p-witness x))
2922
(mv-nth 1 (reducible-p-witness x))))
2927
IRREDUCIBLE-FACTORIZATION-EXISTENCE
2928
(and (true-listp (irreducible-factors x))
2929
(edp-listp (irreducible-factors x))
2930
(irreducible-listp (irreducible-factors x))
2931
(implies (and (edp x)
2934
(=_e (*_e-lst (irreducible-factors x)) x)))
2937
:in-theory (disable (:definition unit-p)))))
2942
;;Determine if g is a gcd of x and y.
2945
(forall d (and (divides-p g x)
2947
(implies (and (divides-p d x)
2952
Gcd-pp-witness (x y g)
2953
"Gcd-pp-witness nicely
2954
modifies Gcd-p-witness."
2955
(gcd-p-witness (C_==_e x)
2960
==_e-implies-==_e-gcd-pp-witness-1
2961
(implies (==_e x1 x2)
2962
(==_e (gcd-pp-witness x1 y g)
2963
(gcd-pp-witness x2 y g)))
2964
:rule-classes :congruence)
2967
==_e-implies-==_e-gcd-pp-witness-2
2968
(implies (==_e y1 y2)
2969
(==_e (gcd-pp-witness x y1 g)
2970
(gcd-pp-witness x y2 g)))
2971
:rule-classes :congruence)
2974
==_e-implies-==_e-gcd-pp-witness-3
2975
(implies (==_e g1 g2)
2976
(==_e (gcd-pp-witness x y g1)
2977
(gcd-pp-witness x y g2)))
2978
:rule-classes :congruence)
2982
(let ((d (gcd-pp-witness x y g)))
2983
(and (divides-pp g x)
2985
(implies (and (divides-pp d x)
2987
(divides-pp d g)))))
2990
==_e-implies-equal-gcd-pp-1
2991
(implies (==_e x1 x2)
2992
(equal (gcd-pp x1 y g)
2994
:rule-classes :congruence)
2997
==_e-implies-equal-gcd-pp-2
2998
(implies (==_e y1 y2)
2999
(equal (gcd-pp x y1 g)
3001
:rule-classes :congruence)
3004
==_e-implies-equal-gcd-pp-3
3005
(implies (==_e g1 g2)
3006
(equal (gcd-pp x y g1)
3008
:rule-classes :congruence)
3012
(implies (not (and (divides-pp g x)
3014
(implies (and (divides-pp d x)
3017
(not (gcd-p x y g)))
3019
:in-theory (disable (:definition divides-p)
3020
(:definition divides-pp)
3021
(:definition gcd-p))
3024
divides-p-=-divides-pp
3028
divides-p-=-divides-pp
3031
divides-p-=-divides-pp
3035
divides-p-=-divides-pp
3038
divides-p-=-divides-pp
3044
(implies (not (and (divides-pp g x)
3046
(implies (and (divides-pp d x)
3049
(not (and (divides-p (C_==_e g)(C_==_e x))
3050
(divides-p (C_==_e g)(C_==_e y))
3051
(implies (and (divides-p (gcd-p-witness (C_==_e x)
3055
(divides-p (gcd-p-witness (C_==_e x)
3059
(divides-p (gcd-p-witness (C_==_e x)
3065
:in-theory (disable (:definition divides-p)
3066
(:definition divides-pp))
3075
(implies (not (and (divides-p (C_==_e g)(C_==_e x))
3076
(divides-p (C_==_e g)(C_==_e y))
3077
(implies (and (divides-p (gcd-p-witness (C_==_e x)
3081
(divides-p (gcd-p-witness (C_==_e x)
3085
(divides-p (gcd-p-witness (C_==_e x)
3089
(not (and (divides-pp g x)
3091
(implies (and (divides-pp (gcd-pp-witness x
3095
(divides-pp (gcd-pp-witness x
3099
(divides-pp (gcd-pp-witness x
3105
:in-theory (disable (:definition divides-p)
3106
(:definition divides-pp))
3108
divides-p-=-divides-pp
3112
divides-p-=-divides-pp
3116
divides-p-=-divides-pp
3117
(x (gcd-p-witness (C_==_e x)
3122
divides-p-=-divides-pp
3123
(x (gcd-p-witness (C_==_e x)
3128
divides-p-=-divides-pp
3129
(x (gcd-p-witness (C_==_e x)
3136
(implies (not (and (divides-pp g x)
3138
(implies (and (divides-pp d x)
3141
(not (gcd-pp x y g)))
3143
:in-theory (disable (:definition divides-pp)
3144
(:definition divides-p)
3145
(:definition gcd-pp-witness))
3146
:use (Gcd-pp-necc-lemma-1
3147
Gcd-pp-necc-lemma-2))))
3149
(in-theory (disable (:definition gcd-pp-witness)
3150
(:executable-counterpart gcd-pp)))
3153
Gcd-p-implies-gcd-pp
3154
(implies (gcd-p x y g)
3158
:in-theory (disable (:definition divides-pp)
3159
(:definition gcd-p))
3162
(d (gcd-pp-witness x y g))))))
3165
Gcd-pp-implies-gcd-p
3166
(implies (gcd-pp x y g)
3170
:in-theory (disable (:definition divides-p)
3171
(:definition divides-pp)
3172
(:definition gcd-pp))
3175
(d (gcd-p-witness x y g)))
3177
divides-p-=-divides-pp
3181
divides-p-=-divides-pp
3184
divides-p-=-divides-pp
3185
(x (gcd-p-witness x y g))
3188
divides-p-=-divides-pp
3189
(x (gcd-p-witness x y g))
3192
divides-p-=-divides-pp
3193
(x (gcd-p-witness x y g)))))))
3197
(equal (gcd-p x y g)
3201
:in-theory (disable (:definition gcd-p)
3202
(:definition gcd-pp))
3203
:use (Gcd-p-implies-gcd-pp
3204
Gcd-pp-implies-gcd-p))))
3206
;;For nonzero element x and element y of edp, choose elements
3207
;; z0,z1 of edp so that the linear combination x z0 + y z1 is
3208
;; a nonzero element and has Size n (if they exists).
3210
Bezout1 (z0 z1)(x y n)
3212
(not (==_e x (0_e)))
3216
(not (==_e (++_e (**_e x z0)
3219
(equal (Size (++_e (**_e x z0)
3225
(and (true-listp (Bezout1 x y n))
3226
(implies (and (integerp n)
3229
(not (==_e x (0_e)))
3233
(not (==_e (++_e (**_e x z0)
3236
(equal (Size (++_e (**_e x z0)
3239
(and (edp (mv-nth 0 (Bezout1 x y n)))
3240
(edp (mv-nth 1 (Bezout1 x y n)))
3241
(not (==_e (++_e (**_e x (mv-nth 0 (Bezout1 x y n)))
3242
(**_e y (mv-nth 1 (Bezout1 x y n))))
3244
(equal (Size (++_e (**_e x (mv-nth 0 (Bezout1 x y n)))
3245
(**_e y (mv-nth 1 (Bezout1 x y n)))))
3247
:rule-classes ((:rewrite
3249
(and (true-listp (Bezout1 x y n))
3250
(implies (and (integerp n)
3253
(not (==_e x (0_e)))
3255
(equal (Size (++_e (**_e x z0)
3258
(not (==_e (++_e (**_e x z0)
3263
(and (edp (mv-nth 0 (Bezout1 x y n)))
3264
(edp (mv-nth 1 (Bezout1 x y n)))
3265
(not (==_e (++_e (**_e x
3272
(equal (Size (++_e (**_e x
3282
(true-listp (Bezout1 x y n))))
3287
Bezout1-properties-Size
3288
(implies (and (edp x)
3289
(not (==_e x (0_e)))
3293
(not (==_e (++_e (**_e x z0)
3296
(and (edp (mv-nth 0 (Bezout1 x y (Size (++_e (**_e x z0)
3298
(edp (mv-nth 1 (Bezout1 x y (Size (++_e (**_e x z0)
3300
(not (==_e (++_e (**_e x (mv-nth 0 (Bezout1 x y (Size (++_e (**_e x z0)
3303
(**_e y (mv-nth 1 (Bezout1 x y (Size (++_e (**_e x z0)
3307
(equal (Size (++_e (**_e x (mv-nth 0 (Bezout1 x y (Size (++_e (**_e x z0)
3310
(**_e y (mv-nth 1 (Bezout1 x y (Size (++_e (**_e x z0)
3313
(Size (++_e (**_e x z0)
3318
(n (Size (++_e (**_e x z0)
3322
Bezout1-properties-Size-1_e-0_e
3323
(implies (and (edp x)
3324
(not (==_e x (0_e)))
3326
(and (edp (mv-nth 0 (Bezout1 x y (Size x))))
3327
(edp (mv-nth 1 (Bezout1 x y (Size x))))
3328
(not (==_e (++_e (**_e x (mv-nth 0 (Bezout1 x y (Size x))))
3329
(**_e y (mv-nth 1 (Bezout1 x y (Size x)))))
3331
(equal (Size (++_e (**_e x (mv-nth 0 (Bezout1 x y (Size x))))
3332
(**_e y (mv-nth 1 (Bezout1 x y (Size x))))))
3336
Bezout1-properties-Size
3341
Find-smallest-n (x y n)
3342
"Find smallest natp n such that the first two elements
3343
of the true list (Bezout1 x y n) are in edp, the linear
3346
(mv-nth 0 (Bezout1 x y n)))
3348
(mv-nth 1 (Bezout1 x y n))))
3349
is nonzero, and the size of the linear conbination is n."
3350
(declare (xargs :measure (let ((n (nfix n)))
3351
(nfix (- (Size x) n)))))
3353
(not (==_e x (0_e)))
3356
(if (and (< n (size x))
3361
(not (==_e (++_e (**_e x z0)
3364
(equal (Size (++_e (**_e x z0)
3367
(Find-smallest-n x y (+ n 1))
3371
(in-theory (disable (:executable-counterpart Find-smallest-n)))
3374
Integerp-Find-smallest-n
3375
(implies (integerp n)
3376
(integerp (Find-smallest-n x y n)))
3377
:rule-classes :type-prescription)
3380
Natp-Find-smallest-n
3381
(implies (and (edp x)
3382
(not (==_e x (0_e)))
3384
(and (integerp (Find-smallest-n x y n))
3385
(>= (Find-smallest-n x y n) 0)))
3386
:rule-classes :type-prescription)
3389
Find-smallest-n-Size-x
3390
(implies (<= n (Size x))
3391
(<= (Find-smallest-n x y n)
3395
Bezout1-Find-smallest-n
3396
(implies (and (integerp n)
3400
(not (==_e x (0_e)))
3402
(and (edp (mv-nth 0 (Bezout1 x y (Find-smallest-n x y n))))
3403
(edp (mv-nth 1 (Bezout1 x y (Find-smallest-n x y n))))
3404
(not (==_e (++_e (**_e x
3406
(Bezout1 x y (Find-smallest-n x y n)))
3410
(Bezout1 x y (Find-smallest-n x y n)))
3414
(equal (Size (++_e (**_e x
3416
(Bezout1 x y (Find-smallest-n x y n))
3421
(Bezout1 x y (Find-smallest-n x y n))
3424
(Find-smallest-n x y n))))
3426
:in-theory (disable (:definition mv-nth)))))
3429
Not-Size-Bezout1-n-=-n
3430
(implies (and (integerp k)
3434
(< n (Find-smallest-n x y k))
3436
(not (==_e x (0_e)))
3438
(not (and (edp (mv-nth 0 (Bezout1 x y n)))
3439
(edp (mv-nth 1 (Bezout1 x y n)))
3440
(not (==_e (++_e (**_e x (mv-nth 0 (Bezout1 x y n)))
3441
(**_e y (mv-nth 1 (Bezout1 x y n))))
3443
(equal (Size (++_e (**_e x (mv-nth 0 (Bezout1 x y n)))
3444
(**_e y (mv-nth 1 (Bezout1 x y n)))))
3446
:rule-classes ((:rewrite
3448
(implies (and (< n (Find-smallest-n x y k))
3454
(not (==_e x (0_e)))
3456
(edp (mv-nth 0 (Bezout1 x y n)))
3457
(edp (mv-nth 1 (Bezout1 x y n)))
3458
(not (==_e (++_e (**_e x (mv-nth 0 (Bezout1 x y n)))
3459
(**_e y (mv-nth 1 (Bezout1 x y n))))
3461
(not (equal (Size (++_e (**_e x (mv-nth 0 (Bezout1 x y n)))
3462
(**_e y (mv-nth 1 (Bezout1 x y n)))
3466
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3467
;; (Find-smallest-n x y 0),
3468
;; provided x is a nonzero element of edp,
3469
;; finds the smallest natp n such that
3470
;; (and (edp (mv-nth 0 (Bezout1 x y n)))
3471
;; (edp (mv-nth 1 (Bezout1 x y n)))
3472
;; (not (equal (+_e (*_e x (mv-nth 0 (Bezout1 x y n)))
3473
;; (*_e y (mv-nth 1 (Bezout1 x y n))))
3475
;; (equal (Size (+_e (*_e x (mv-nth 0 (Bezout1 x y n)))
3476
;; (*_e y (mv-nth 1 (Bezout1 x y n)))))
3481
Natp-Find-smallest-n-0
3482
(implies (and (edp x)
3483
(not (==_e x (0_e)))
3485
(and (integerp (Find-smallest-n x y 0))
3486
(>= (Find-smallest-n x y 0) 0)))
3490
Bezout1-Find-smallest-n-0
3491
(implies (and (edp x)
3492
(not (==_e x (0_e)))
3494
(and (edp (mv-nth 0 (Bezout1 x y (Find-smallest-n x y 0))))
3495
(edp (mv-nth 1 (Bezout1 x y (Find-smallest-n x y 0))))
3496
(not (==_e (++_e (**_e x
3498
(Bezout1 x y (Find-smallest-n x y 0)))
3502
(Bezout1 x y (Find-smallest-n x y 0)))
3506
(equal (Size (++_e (**_e x
3508
(Bezout1 x y (Find-smallest-n x y 0))
3513
(Bezout1 x y (Find-smallest-n x y 0))
3516
(Find-smallest-n x y 0))))
3519
Bezout1-Find-smallest-n
3523
Not-Size-Bezout1-n-=-n-1
3524
(implies (and (integerp n)
3526
(< n (Find-smallest-n x y 0))
3528
(not (==_e x (0_e)))
3530
(not (and (edp (mv-nth 0 (Bezout1 x y n)))
3531
(edp (mv-nth 1 (Bezout1 x y n)))
3532
(not (==_e (++_e (**_e x (mv-nth 0 (Bezout1 x y n)))
3533
(**_e y (mv-nth 1 (Bezout1 x y n))))
3535
(equal (Size (++_e (**_e x (mv-nth 0 (Bezout1 x y n)))
3536
(**_e y (mv-nth 1 (Bezout1 x y n)))))
3541
Not-Size-Bezout1-n-=-n
3545
Size->=-Find-smallest-n-0
3546
(implies (and (edp x)
3547
(not (==_e x (0_e)))
3551
(not (==_e (++_e (**_e x z0)
3554
(>= (Size (++_e (**_e x z0)
3556
(Find-smallest-n x y 0)))
3557
:rule-classes (:rewrite
3560
:in-theory (disable (:definition mv-nth))
3562
Not-Size-Bezout1-n-=-n-1
3563
(n (Size (++_e (**_e x z0)
3566
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3567
;; The next sequence of equations and inequalities
3568
;; is used to establish the existence of the gcd
3569
;; of any two elements of edp when at least one
3570
;; of the elements is nonzero. Any gcd of two
3571
;; elements can always be written as a linear
3572
;; combination of the two elements.
3576
(implies (and (edp a)
3579
(iff (==_e (++_e a b) c)
3580
(==_e (++_e c (-_e b)) a)))
3585
(implies (and (edp a)
3588
(equal (==_e (++_e a b) c)
3589
(==_e (++_e c (-_e b)) a)))
3596
(implies (and (edp x)
3598
(not (==_e y (0_e))))
3614
(implies (and (edp x)
3615
(not (==_e x (0_e)))
3617
(let ((lc (++_e (**_e x (mv-nth 0 (Bezout1 x y (Find-smallest-n x y 0))))
3618
(**_e y (mv-nth 1 (Bezout1 x y (Find-smallest-n x y 0))))
3626
:in-theory (disable (:definition find-smallest-n)
3627
(:definition mv-nth))
3630
(y (++_e (**_e x (mv-nth 0 (Bezout1 x y (Find-smallest-n x y 0))))
3631
(**_e y (mv-nth 1 (Bezout1 x y (Find-smallest-n x y 0))))
3636
(implies (and (edp x)
3637
(not (==_e x (0_e)))
3639
(let ((lc (++_e (**_e x (mv-nth 0 (Bezout1 x y (Find-smallest-n x y 0))))
3640
(**_e y (mv-nth 1 (Bezout1 x y (Find-smallest-n x y 0))))
3648
:in-theory (disable (:definition find-smallest-n)
3649
(:definition mv-nth))
3653
(y (++_e (**_e x (mv-nth 0 (Bezout1 x y (Find-smallest-n x y 0))))
3654
(**_e y (mv-nth 1 (Bezout1 x y (Find-smallest-n x y 0))))
3659
(implies (and (edp x)
3660
(not (==_e x (0_e)))
3662
(let ((lc (++_e (**_e x (mv-nth 0 (Bezout1 x y (Find-smallest-n x y 0))))
3663
(**_e y (mv-nth 1 (Bezout1 x y (Find-smallest-n x y 0))))
3672
(Find-smallest-n x y 0)))))
3675
:in-theory (disable (:definition find-smallest-n)
3676
(:definition mv-nth))
3681
(implies (and (edp x)
3682
(not (==_e x (0_e)))
3684
(let ((lc (++_e (**_e x (mv-nth 0 (Bezout1 x y (Find-smallest-n x y 0))))
3685
(**_e y (mv-nth 1 (Bezout1 x y (Find-smallest-n x y 0))))
3694
(Find-smallest-n x y 0)))))
3697
:in-theory (disable (:definition find-smallest-n)
3698
(:definition mv-nth))
3703
(implies (and (edp x)
3709
(-_e (**_e (++_e (**_e x b0)
3715
(-_e (**_e y b1 q)))))
3720
(implies (and (edp x)
3726
(-_e (**_e (++_e (**_e x b0)
3732
(-_e (**_e x b0 q)))))
3737
(implies (and (edp x)
3738
(not (==_e x (0_e)))
3740
(let ((lc (++_e (**_e x (mv-nth 0 (Bezout1 x y (Find-smallest-n x y 0))))
3741
(**_e y (mv-nth 1 (Bezout1 x y (Find-smallest-n x y 0))))
3743
(b0 (mv-nth 0 (Bezout1 x y (Find-smallest-n x y 0))))
3744
(b1 (mv-nth 1 (Bezout1 x y (Find-smallest-n x y 0)))))
3757
:in-theory (disable (:definition find-smallest-n)
3758
(:definition mv-nth))
3761
(b0 (mv-nth 0 (Bezout1 x y (Find-smallest-n x y 0))))
3762
(b1 (mv-nth 1 (Bezout1 x y (Find-smallest-n x y 0))))
3765
(mv-nth 0 (Bezout1 x y (Find-smallest-n x y 0))))
3767
(mv-nth 1 (Bezout1 x y (Find-smallest-n x y 0))))
3772
(implies (and (edp x)
3773
(not (==_e x (0_e)))
3775
(let ((lc (++_e (**_e x (mv-nth 0 (Bezout1 x y (Find-smallest-n x y 0))))
3776
(**_e y (mv-nth 1 (Bezout1 x y (Find-smallest-n x y 0))))
3778
(b0 (mv-nth 0 (Bezout1 x y (Find-smallest-n x y 0))))
3779
(b1 (mv-nth 1 (Bezout1 x y (Find-smallest-n x y 0)))))
3792
:in-theory (disable (:definition find-smallest-n)
3793
(:definition mv-nth))
3796
(b0 (mv-nth 0 (Bezout1 x y (Find-smallest-n x y 0))))
3797
(b1 (mv-nth 1 (Bezout1 x y (Find-smallest-n x y 0))))
3800
(mv-nth 0 (Bezout1 x y (Find-smallest-n x y 0))))
3802
(mv-nth 1 (Bezout1 x y (Find-smallest-n x y 0))))
3807
(implies (and (edp x)
3808
(not (==_e x (0_e)))
3810
(let* ((lc (++_e (**_e x (mv-nth 0 (Bezout1 x y (Find-smallest-n x y 0))))
3811
(**_e y (mv-nth 1 (Bezout1 x y (Find-smallest-n x y 0))))
3813
(b0 (mv-nth 0 (Bezout1 x y (Find-smallest-n x y 0))))
3814
(b1 (mv-nth 1 (Bezout1 x y (Find-smallest-n x y 0))))
3820
(or (==_e (++_e (**_e x z0)
3823
(>= (Size (++_e (**_e x z0)
3825
(Find-smallest-n x y 0)))))
3828
:in-theory (disable (:definition mv-nth)
3829
(:definition find-smallest-n))
3831
Size->=-Find-smallest-n-0
3833
(-_e (**_e (mv-nth 0 (Bezout1 x y (Find-smallest-n x y 0)))
3840
(Find-smallest-n x y 0)))
3846
(Find-smallest-n x y 0)))
3849
(**_e (mv-nth 1 (Bezout1 x y (Find-smallest-n x y 0)))
3854
(Bezout1 x y (Find-smallest-n x y 0)
3858
(Bezout1 x y (Find-smallest-n x y 0)
3863
(implies (and (edp x)
3864
(not (==_e x (0_e)))
3866
(let* ((lc (++_e (**_e x (mv-nth 0 (Bezout1 x y (Find-smallest-n x y 0))))
3867
(**_e y (mv-nth 1 (Bezout1 x y (Find-smallest-n x y 0))))
3869
(b0 (mv-nth 0 (Bezout1 x y (Find-smallest-n x y 0))))
3870
(b1 (mv-nth 1 (Bezout1 x y (Find-smallest-n x y 0))))
3876
(or (==_e (++_e (**_e x z0)
3879
(>= (Size (++_e (**_e x z0)
3881
(Find-smallest-n x y 0)))))
3884
:in-theory (disable (:definition mv-nth)
3885
(:definition find-smallest-n))
3887
Size->=-Find-smallest-n-0
3889
(-_e (**_e (mv-nth 1 (Bezout1 x y (Find-smallest-n x y 0)))
3896
(Find-smallest-n x y 0)))
3902
(Find-smallest-n x y 0)))
3905
(**_e (mv-nth 0 (Bezout1 x y (Find-smallest-n x y 0)))
3910
(Bezout1 x y (Find-smallest-n x y 0)
3914
(Bezout1 x y (Find-smallest-n x y 0)
3919
(implies (and (edp x)
3920
(not (==_e x (0_e)))
3922
(let ((lc (++_e (**_e x (mv-nth 0 (Bezout1 x y (Find-smallest-n x y 0))))
3923
(**_e y (mv-nth 1 (Bezout1 x y (Find-smallest-n x y 0))))
3930
:in-theory (disable (:definition find-smallest-n)
3931
(:definition mv-nth)
3932
right-distributivity-law)
3939
(implies (and (edp x)
3940
(not (==_e x (0_e)))
3942
(let ((lc (++_e (**_e x (mv-nth 0 (Bezout1 x y (Find-smallest-n x y 0))))
3943
(**_e y (mv-nth 1 (Bezout1 x y (Find-smallest-n x y 0))))
3950
:in-theory (disable (:definition find-smallest-n)
3951
(:definition mv-nth)
3952
right-distributivity-law)
3959
Divides-pp-Bezout1-x
3960
(implies (and (edp x)
3961
(not (==_e x (0_e)))
3963
(divides-pp (++_e (**_e x (mv-nth 0 (Bezout1 x y (Find-smallest-n x y 0))))
3964
(**_e y (mv-nth 1 (Bezout1 x y (Find-smallest-n x y 0)))))
3967
:in-theory (disable (:definition find-smallest-n)
3968
(:definition mv-nth))
3972
(x (++_e (**_e x (mv-nth 0 (Bezout1 x y (Find-smallest-n x y 0))))
3973
(**_e y (mv-nth 1 (Bezout1 x y (Find-smallest-n x y 0))))))
3975
(z (qq_e x (++_e (**_e x
3977
(Bezout1 x y (Find-smallest-n x y 0)))
3981
(Bezout1 x y (Find-smallest-n x y 0)))
3985
Divides-pp-Bezout1-y
3986
(implies (and (edp x)
3987
(not (==_e x (0_e)))
3989
(divides-pp (++_e (**_e x (mv-nth 0 (Bezout1 x y (Find-smallest-n x y 0))))
3990
(**_e y (mv-nth 1 (Bezout1 x y (Find-smallest-n x y 0)))))
3993
:in-theory (disable (:definition find-smallest-n)
3994
(:definition mv-nth))
3998
(x (++_e (**_e x (mv-nth 0 (Bezout1 x y (Find-smallest-n x y 0))))
3999
(**_e y (mv-nth 1 (Bezout1 x y (Find-smallest-n x y 0))))))
4000
(z (qq_e y (++_e (**_e x
4002
(Bezout1 x y (Find-smallest-n x y 0)))
4006
(Bezout1 x y (Find-smallest-n x y 0))))
4011
"Return (mv b0 b1) so that
4012
x b0 + y b1 is a gcd of x and y."
4014
(not (==_e x (0_e)))
4016
(Bezout1 x y (Find-smallest-n x y 0))
4021
(and (edp (mv-nth 0 (Bezout x y)))
4022
(edp (mv-nth 1 (Bezout x y))))
4024
:in-theory (disable (:definition mv-nth)
4025
(:definition find-smallest-n)))))
4028
Gcd-pp-mv-nth-Bezout
4029
(implies (and (edp x)
4031
(gcd-pp x y (++_e (**_e x (mv-nth 0 (Bezout x y)))
4032
(**_e y (mv-nth 1 (Bezout x y))))))
4034
:in-theory (disable (:definition mv-nth)
4035
(:definition find-smallest-n)))))
4039
(equal (nth k lst)(mv-nth k lst)))
4043
(implies (and (edp x)
4045
(gcd-pp x y (++_e (**_e x (nth 0 (Bezout x y)))
4046
(**_e y (nth 1 (Bezout x y))))))
4048
:in-theory (disable (:definition mv-nth)
4049
(:definition find-smallest-n)))))
4051
(in-theory (disable nth-mv-nth))
4055
(and (equal (first lst)(mv-nth 0 lst))
4056
(equal (second lst)(mv-nth 1 lst))))
4060
(implies (and (edp x)
4062
(Gcd-pp x y (++_e (**_e x (first (Bezout x y)))
4063
(**_e y (second (Bezout x y))))))
4065
:in-theory (disable (:definition mv-nth)
4066
(:definition find-smallest-n)))))
4068
(in-theory (disable 1st-2nd-mv-nth))
4071
COMMON-divisor-mv-nth-Bezout
4072
(implies (and (edp x)
4074
(and (divides-pp (++_e (**_e x (mv-nth 0 (Bezout x y)))
4075
(**_e y (mv-nth 1 (Bezout x y))))
4077
(divides-pp (++_e (**_e x (mv-nth 0 (Bezout x y)))
4078
(**_e y (mv-nth 1 (Bezout x y))))
4081
:in-theory (disable (:definition mv-nth)
4082
(:definition find-smallest-n)))))
4085
GREATEST-common-divisor-mv-nth-Bezout
4086
(implies (and (divides-pp d x)
4088
(divides-pp d (++_e (**_e x (mv-nth 0 (Bezout x y)))
4089
(**_e y (mv-nth 1 (Bezout x y))))))
4091
:in-theory (disable (:definition mv-nth)
4092
(:definition bezout)))))
4095
Gcd-pp-associates-pp
4096
(implies (and (gcd-pp x y g1)
4098
(equal (associates-pp g1 g2) t))
4111
(implies (gcd-pp x y g)
4113
:rule-classes :forward-chaining
4115
:in-theory (disable (:definition divides-pp)))))
4119
(implies (gcd-pp x y g)
4121
:rule-classes :forward-chaining
4123
:in-theory (disable (:definition divides-pp)))))
4127
(implies (gcd-pp x y g)
4129
:rule-classes :forward-chaining)
4131
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
4132
;; Show that any gcd of two edp elements can
4133
;; always be written as a linear combination
4134
;; of the two elements.
4137
Gcd=linear-combination
4138
(implies (gcd-pp x y g)
4140
(mv-nth 0 (Bezout x y))
4142
(++_e (**_e x (mv-nth 0 (Bezout x y)))
4143
(**_e y (mv-nth 1 (Bezout x y))))
4146
(mv-nth 1 (Bezout x y))
4148
(++_e (**_e x (mv-nth 0 (Bezout x y)))
4149
(**_e y (mv-nth 1 (Bezout x y))))
4153
:in-theory (disable (:definition bezout)
4154
(:definition mv-nth)
4155
gcd-pp-mv-nth-Bezout
4156
gcd-pp-associates-pp)
4157
:use (gcd-pp-mv-nth-Bezout
4159
gcd-pp-associates-pp
4161
(g1 (++_e (**_e x (mv-nth 0 (Bezout x y)))
4162
(**_e y (mv-nth 1 (Bezout x y))))))))))
4165
Associates-pp-implies-equal-gcd-pp-1
4166
(implies (associates-pp x1 x2)
4167
(equal (gcd-pp x1 y g)
4169
:rule-classes :congruence
4171
:in-theory (disable (:definition divides-pp))
4174
(d (gcd-pp-witness x2 y g))
4178
(d (gcd-pp-witness x1 y g))
4182
Associates-pp-implies-iff-gcd-pp-2
4183
(implies (associates-pp y1 y2)
4184
(iff (gcd-pp x y1 g)
4188
:in-theory (disable (:definition divides-pp))
4191
(d (gcd-pp-witness x y2 g))
4195
(d (gcd-pp-witness x y1 g))
4199
Associates-pp-implies-equal-gcd-pp-2
4200
(implies (associates-pp y1 y2)
4201
(equal (gcd-pp x y1 g)
4203
:rule-classes :congruence
4205
:use (Associates-pp-implies-iff-gcd-pp-2
4208
(implies (and (booleanp x)
4213
(y (gcd-pp x y2 g)))))))
4216
Associates-pp-implies-iff-gcd-pp-3
4217
(implies (associates-pp g1 g2)
4218
(iff (gcd-pp x y g1)
4222
:in-theory (disable (:definition divides-pp))
4225
(d (gcd-pp-witness x y g2))
4229
(d (gcd-pp-witness x y g1))
4233
Associates-pp-implies-equal-gcd-pp-3
4234
(implies (associates-pp g1 g2)
4235
(equal (gcd-pp x y g1)
4237
:rule-classes :congruence
4239
:use (Associates-pp-implies-iff-gcd-pp-3
4242
(implies (and (booleanp x)
4247
(y (gcd-pp x y g2)))))))
4250
Linear-combination-divides-pp-gcd
4251
(implies (gcd-pp x y g)
4252
(divides-pp (++_e (**_e x
4253
(mv-nth 0 (bezout x y)))
4255
(mv-nth 1 (bezout x y))))
4258
:in-theory (disable (:definition gcd-pp)
4259
(:definition bezout)
4260
(:definition divides-pp)
4261
gcd-pp-associates-pp)
4262
:use (gcd-pp-mv-nth-bezout
4264
gcd-pp-associates-pp
4266
(mv-nth 0 (bezout x y)))
4268
(mv-nth 1 (bezout x y)))))
4272
Edp-divides-p-witness-linear-combination
4273
(implies (gcd-pp x y g)
4274
(edp (divides-pp-witness (++_e (**_e x (mv-nth 0 (bezout x y)))
4275
(**_e y (mv-nth 1 (bezout x y))))
4278
:in-theory (disable (:definition bezout)
4279
(:definition divides-pp)
4280
(:definition mv-nth)))))
4282
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
4283
;; Unit-associates-p theory:
4286
Unit-associates-p (x y)
4287
(exists u (if (and (edp x)
4295
Unit-associates-p1 (x y)
4296
(exists u (if (and (edp x)
4305
(implies (and (edp x)
4307
(equal (*_e x y)(**_e x y)))
4310
:in-theory (enable (:definition binary-**_e)))))
4314
(implies (and (edp x)
4316
(equal (=_e x y)(==_e x y)))
4319
:in-theory (enable (:definition ==_e)))))
4327
Unit-associates-p-implies-unit-associates-p1
4328
(implies (unit-associates-p x y)
4329
(unit-associates-p1 x y))
4332
:in-theory (disable (:definition unit-p)
4333
(:definition unit-associates-p1))
4335
unit-associates-p1-suff
4336
(u (unit-associates-p-witness x y)))
4339
(x (unit-associates-p-witness x y))
4343
(x (**_e (unit-associates-p-witness x y) x)))))))
4346
Unit-associates-p1-implies-unit-associates-p
4347
(implies (unit-associates-p1 x y)
4348
(unit-associates-p x y))
4351
:in-theory (disable (:definition unit-p)
4352
(:definition unit-associates-p))
4354
unit-associates-p-suff
4355
(u (unit-associates-p1-witness x y)))
4358
(x (unit-associates-p1-witness x y))
4362
(x (**_e (unit-associates-p1-witness x y) x)))))))
4365
Unit-associates-p-iff-unit-associates-p1
4366
(iff (unit-associates-p x y)
4367
(unit-associates-p1 x y))
4370
:use (Unit-associates-p-implies-unit-associates-p1
4371
Unit-associates-p1-implies-unit-associates-p))))
4374
Booleanp-unit-associates-p
4375
(booleanp (unit-associates-p x y))
4376
:rule-classes :type-prescription)
4379
Unit-associates-p-=-unit-associates-p1
4380
(equal (unit-associates-p x y)
4381
(unit-associates-p1 x y))
4384
:in-theory (disable (:definition unit-associates-p)
4385
(:definition unit-associates-p1))
4386
:use Unit-associates-p-iff-unit-associates-p1)))
4389
Unit-associates-pp-witness (x y)
4390
"Unit-associates-pp-witness nicely
4391
modifies unit-associates-p1-witness."
4392
(unit-associates-p1-witness (C_==_e x)
4396
==_e-implies-==_e-associates-pp-witness-1
4397
(implies (==_e x1 x2)
4398
(==_e (Unit-associates-pp-witness x1 y)
4399
(Unit-associates-pp-witness x2 y)))
4400
:rule-classes :congruence)
4403
==_e-implies-==_e-associates-pp-witness-2
4404
(implies (==_e y1 y2)
4405
(==_e (Unit-associates-pp-witness x y1)
4406
(Unit-associates-pp-witness x y2)))
4407
:rule-classes :congruence)
4410
Unit-associates-pp (x y)
4411
(let ((u (unit-associates-pp-witness x y)))
4415
(==_e (**_e u x) y))
4420
(implies (not (edp y1))
4425
:in-theory (enable (:definition ==_e)))))
4428
==_e-implies-equal-unit-associates-pp-1
4429
(implies (==_e y1 y2)
4430
(equal (unit-associates-pp y1 z)
4431
(unit-associates-pp y2 z)))
4432
:rule-classes :congruence
4434
:use ==_e-=-equal)))
4436
(in-theory (disable (:definition divides-pp)))
4439
==_e-implies-equal-unit-associates-pp-2
4440
(implies (==_e y1 y2)
4441
(equal (unit-associates-pp x y1)
4442
(unit-associates-pp x y2)))
4443
:rule-classes :congruence
4445
:use ==_e-=-equal)))
4448
Unit-associates-pp-suff
4449
(implies (if (and (edp x)
4452
(==_e (**_e u x) y))
4454
(unit-associates-pp x y))
4456
:in-theory (disable unit-associates-p1-suff
4457
(:definition unit-p)
4458
(:definition unit-pp))
4460
unit-associates-p1-suff
4468
(x (unit-associates-p1-witness (c_==_e x)
4471
(in-theory (disable (:definition unit-associates-pp-witness)
4472
(:executable-counterpart unit-associates-pp)))
4475
Unit-associates-p1-implies-unit-associates-pp
4476
(implies (unit-associates-p1 x y)
4477
(unit-associates-pp x y))
4480
:in-theory (disable (:definition unit-p)
4481
(:definition unit-pp))
4483
Unit-associates-pp-suff
4484
(u (unit-associates-p1-witness x y)))
4487
(x (unit-associates-p1-witness x y)))))))
4490
Unit-associates-pp-implies-unit-associates-p1
4491
(implies (unit-associates-pp x y)
4492
(unit-associates-p1 x y))
4495
:in-theory (disable (:definition unit-p)
4496
(:definition unit-pp))
4498
Unit-associates-p1-suff
4499
(u (unit-associates-pp-witness x y)))
4502
(x (unit-associates-pp-witness x y)))))))
4505
Unit-associates-p1-iff-unit-associates-pp
4506
(iff (unit-associates-p1 x y)
4507
(unit-associates-pp x y))
4510
:use (Unit-associates-p1-implies-unit-associates-pp
4511
Unit-associates-pp-implies-unit-associates-p1))))
4514
Unit-associates-p1-=-unit-associates-pp
4515
(equal (unit-associates-p1 x y)
4516
(unit-associates-pp x y))
4519
:in-theory (disable (:definition unit-associates-p1)
4520
(:definition unit-associates-pp))
4521
:use Unit-associates-p1-iff-unit-associates-pp)))
4524
Unit-associates-p-=-unit-associates-pp
4525
(equal (unit-associates-p x y)
4526
(unit-associates-pp x y))
4529
:in-theory (disable (:definition unit-associates-p)
4530
(:definition unit-associates-p1)
4531
(:definition unit-associates-pp))
4532
:use (Unit-associates-p-=-unit-associates-p1
4533
Unit-associates-p1-=-unit-associates-pp))))
4536
Reflexivity-unit-associates-pp
4537
(unit-associates-pp x x)
4539
:in-theory (disable (:definition unit-associates-pp))
4541
unit-associates-pp-suff
4545
(set-backchain-limit 1)
4548
Symmetry-unit-associates-pp
4549
(implies (unit-associates-pp x y)
4550
(unit-associates-pp y x))
4552
:in-theory (disable unit-pp-**_e-inverse
4553
(:definition unit-pp))
4555
unit-associates-pp-suff
4556
(u (divides-pp-witness (unit-associates-pp-witness x y)
4561
unit-pp-**_e-inverse
4562
(u (unit-associates-pp-witness x y)))))
4564
:in-theory (enable (:definition unit-pp)))
4566
:in-theory (enable (:definition unit-pp)))))
4569
Transitivity-unit-associates-pp
4570
(implies (and (unit-associates-pp x y)
4571
(unit-associates-pp y z))
4572
(unit-associates-pp x z))
4574
:in-theory (disable (:definition unit-pp)
4575
commutativity-laws-for-++_e-&-**_e)
4577
unit-associates-pp-suff
4578
(u (**_e (unit-associates-pp-witness y z)
4579
(unit-associates-pp-witness x y)))
4582
(set-backchain-limit nil)
4585
Unit-associates-pp-is-an-equivalence
4586
(and (booleanp (unit-associates-pp x y))
4587
(unit-associates-pp x x)
4588
(implies (unit-associates-pp x y)
4589
(unit-associates-pp y x))
4590
(implies (and (unit-associates-pp x y)
4591
(unit-associates-pp y z))
4592
(unit-associates-pp x z)))
4593
:rule-classes :equivalence
4595
:in-theory (disable (:definition unit-associates-pp)))))
4597
(in-theory (disable Reflexivity-unit-associates-pp
4598
Symmetry-unit-associates-pp
4599
Transitivity-unit-associates-pp))
4602
Associates-pp-implies-iff-edp
4603
(implies (associates-pp x y)
4606
:rule-classes :congruence)
4608
(set-backchain-limit 1)
4611
Associates-pp-refines-unit-associates-pp-lemma-1
4612
(implies (and (edp x)
4613
(not (==_e x (0_e)))
4614
(associates-pp x y))
4615
(==_e (**_e (divides-pp-witness x y)
4616
(divides-pp-witness y x))
4619
:in-theory (e/d ((:definition divides-pp))
4620
(divides-pp-implies-witness=qq_e
4621
divides-pp-edp-divides-pp-witness))
4624
(y (**_e (divides-pp-witness x y)
4625
(divides-pp-witness y x))))))))
4627
(set-backchain-limit 2)
4630
Associates-pp-refines-unit-associates-pp-lemma-2
4631
(implies (and (edp x)
4632
(not (==_e x (0_e)))
4633
(associates-pp x y))
4634
(unit-pp (divides-pp-witness x y)))
4636
:in-theory (enable (:definition divides-pp))
4638
Associates-pp-refines-unit-associates-pp-lemma-1)))
4641
Associates-pp-refines-unit-associates-pp-lemma-3
4642
(implies (and (edp x)
4643
(not (==_e x (0_e)))
4644
(associates-pp x y))
4645
(unit-associates-pp x y))
4648
:in-theory (e/d ((:definition divides-pp))
4649
((:definition unit-pp)
4650
divides-pp-implies-witness=qq_e
4651
unit-associates-pp-suff))
4653
Unit-associates-pp-suff
4654
(u (divides-pp-witness x y))))))
4657
Associates-pp-refines-unit-associates-pp
4658
(implies (associates-pp x y)
4659
(unit-associates-pp x y))
4660
:rule-classes :refinement
4662
:in-theory (e/d ((:definition divides-pp))
4663
((:definition unit-pp)
4664
(:definition unit-associates-pp)))
4665
:cases ((not (edp x))
4668
:use Associates-pp-refines-unit-associates-pp-lemma-3)
4671
unit-associates-pp-suff
4675
Unit-associates-pp-implies-iff-edp
4676
(implies (unit-associates-pp x y)
4679
:rule-classes :congruence)
4682
Unit-associates-pp-refines-associates-pp-lemma-1
4683
(implies (and (edp x)
4684
(unit-associates-pp x y))
4687
:in-theory (disable (:definition unit-pp)
4688
(:definition divides-pp)))))
4691
Unit-associates-pp-refines-associates-pp
4692
(implies (unit-associates-pp x y)
4693
(associates-pp x y))
4694
:rule-classes :refinement
4698
:in-theory (disable (:definition unit-associates-pp)))))
4701
Unit-associates-pp-implies-reducible-pp-lemma-1
4702
(implies (and (not (edp (unit-associates-pp-witness x y)))
4703
(unit-associates-pp x y)
4704
(edp (mv-nth 0 (reducible-pp-witness x)))
4705
(edp (mv-nth 1 (reducible-pp-witness x)))
4706
(not (unit-pp (mv-nth 0 (reducible-pp-witness x))))
4707
(not (unit-pp (mv-nth 1 (reducible-pp-witness x))))
4708
(==_e (**_e (mv-nth 0 (reducible-pp-witness x))
4709
(mv-nth 1 (reducible-pp-witness x)))
4713
:in-theory (disable (:definition unit-pp)
4714
(:definition reducible-pp)))))
4717
Unit-associates-pp-implies-reducible-pp-lemma-2
4718
(implies (and (not (==_e (**_e (unit-associates-pp-witness x y)
4721
(not (unit-pp (**_e (mv-nth 0 (reducible-pp-witness x))
4722
(unit-associates-pp-witness x y))))
4723
(unit-associates-pp x y)
4724
(edp (mv-nth 0 (reducible-pp-witness x)))
4725
(edp (mv-nth 1 (reducible-pp-witness x)))
4726
(not (unit-pp (mv-nth 0 (reducible-pp-witness x))))
4727
(not (unit-pp (mv-nth 1 (reducible-pp-witness x))))
4728
(==_e (**_e (mv-nth 0 (reducible-pp-witness x))
4729
(mv-nth 1 (reducible-pp-witness x)))
4733
:in-theory (disable (:definition unit-pp)
4734
(:definition reducible-pp)))))
4737
Unit-associates-pp-implies-reducible-pp-lemma-3
4738
(implies (and (not (==_e (**_e (**_e (unit-associates-pp-witness x y)
4739
(mv-nth 0 (reducible-pp-witness x)))
4740
(mv-nth 1 (reducible-pp-witness x)))
4742
(==_e (**_e (mv-nth 0 (reducible-pp-witness x))
4743
(mv-nth 1 (reducible-pp-witness x))
4744
(unit-associates-pp-witness x y))
4746
(not (unit-pp (**_e (mv-nth 0 (reducible-pp-witness x))
4747
(unit-associates-pp-witness x y))))
4748
(unit-associates-pp x y)
4749
(edp (mv-nth 0 (reducible-pp-witness x)))
4750
(edp (mv-nth 1 (reducible-pp-witness x)))
4751
(not (unit-pp (mv-nth 0 (reducible-pp-witness x))))
4752
(not (unit-pp (mv-nth 1 (reducible-pp-witness x))))
4753
(==_e (**_e (mv-nth 0 (reducible-pp-witness x))
4754
(mv-nth 1 (reducible-pp-witness x)))
4758
:in-theory (disable (:definition unit-pp)
4759
(:definition reducible-pp)))))
4762
Unit-associates-pp-implies-reducible-pp-lemma-4
4763
(implies (and (unit-pp (**_e (unit-associates-pp-witness x y)
4764
(mv-nth 0 (reducible-pp-witness x))))
4765
(==_e (**_e (mv-nth 0 (reducible-pp-witness x))
4766
(mv-nth 1 (reducible-pp-witness x))
4767
(unit-associates-pp-witness x y))
4769
(not (unit-pp (**_e (mv-nth 0 (reducible-pp-witness x))
4770
(unit-associates-pp-witness x y))))
4771
(unit-associates-pp x y)
4772
(edp (mv-nth 0 (reducible-pp-witness x)))
4773
(edp (mv-nth 1 (reducible-pp-witness x)))
4774
(not (unit-pp (mv-nth 0 (reducible-pp-witness x))))
4775
(not (unit-pp (mv-nth 1 (reducible-pp-witness x))))
4776
(==_e (**_e (mv-nth 0 (reducible-pp-witness x))
4777
(mv-nth 1 (reducible-pp-witness x)))
4781
:in-theory (disable (:definition unit-pp)
4782
(:definition reducible-pp)))))
4785
Unit-associates-pp-implies-reducible-pp-lemma-5
4786
(implies (and (not (edp (**_e (unit-associates-pp-witness x y)
4787
(mv-nth 0 (reducible-pp-witness x)))))
4788
(==_e (**_e (mv-nth 0 (reducible-pp-witness x))
4789
(mv-nth 1 (reducible-pp-witness x))
4790
(unit-associates-pp-witness x y))
4792
(not (unit-pp (**_e (mv-nth 0 (reducible-pp-witness x))
4793
(unit-associates-pp-witness x y))))
4794
(unit-associates-pp x y)
4795
(edp (mv-nth 0 (reducible-pp-witness x)))
4796
(edp (mv-nth 1 (reducible-pp-witness x)))
4797
(not (unit-pp (mv-nth 0 (reducible-pp-witness x))))
4798
(not (unit-pp (mv-nth 1 (reducible-pp-witness x))))
4799
(==_e (**_e (mv-nth 0 (reducible-pp-witness x))
4800
(mv-nth 1 (reducible-pp-witness x)))
4804
:in-theory (disable (:definition unit-pp)
4805
(:definition reducible-pp)))))
4808
Unit-associates-pp-implies-reducible-pp
4809
(implies (and (unit-associates-pp x y)
4814
:in-theory (disable (:definition mv-nth)
4815
(:definition unit-pp)
4816
(:definition reducible-pp)
4817
(:definition unit-associates-pp)
4820
:expand ((reducible-pp x))
4824
(y (**_e (unit-associates-pp-witness x y)
4825
(mv-nth 0 (reducible-pp-witness x))))
4826
(z (mv-nth 1 (reducible-pp-witness x))))
4829
(implies (and (edp a)
4833
(==_e (**_e a b) x))
4834
(==_e (**_e a b c) y)))
4835
(a (mv-nth 0 (reducible-pp-witness x)))
4836
(b (mv-nth 1 (reducible-pp-witness x)))
4837
(c (unit-associates-pp-witness x y)))
4839
unit-pp-**_e=>unit-pp-factor-right
4840
(x (unit-associates-pp-witness x y))
4841
(y (mv-nth 0 (reducible-pp-witness x))))))))
4843
(in-theory (disable Unit-associates-pp-implies-reducible-pp-lemma-1
4844
Unit-associates-pp-implies-reducible-pp-lemma-2
4845
Unit-associates-pp-implies-reducible-pp-lemma-3
4846
Unit-associates-pp-implies-reducible-pp-lemma-4
4847
Unit-associates-pp-implies-reducible-pp-lemma-5))
4850
Unit-associates-pp-implies-equal-reducible-pp
4851
(implies (unit-associates-pp x y)
4852
(equal (reducible-pp x)
4854
:rule-classes :congruence
4856
:in-theory (disable (:definition reducible-pp)
4857
(:definition unit-associates-pp))
4858
:use (unit-associates-pp-implies-reducible-pp
4860
Unit-associates-pp-implies-reducible-pp
4865
Unit-associates-pp-implies-equal-irreducible-pp
4866
(implies (unit-associates-pp x y)
4867
(equal (irreducible-pp x)
4868
(irreducible-pp y)))
4869
:rule-classes :congruence
4871
:in-theory (disable (:definition reducible-pp)
4872
(:definition unit-associates-pp)))))
4874
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
4875
;; Unique factorization theory:
4878
Member-unit-associate (x lst)
4879
"Determine if an unit-associate-p
4880
of x is a member of lst."
4883
((unit-associates-p x (car lst))
4885
(t (member-unit-associate x (cdr lst)))))
4888
Member-unit-associate-pp (x lst)
4889
"Determine if an unit-associate-pp
4890
of x is a member of lst."
4893
((unit-associates-pp x (car lst))
4895
(t (member-unit-associate-pp x (cdr lst)))))
4897
(in-theory (disable (:definition unit-associates-p)))
4898
(in-theory (disable (:definition unit-associates-pp)))
4901
Member-unit-associate-=-member-unit-associate-pp
4902
(equal (member-unit-associate x lst)
4903
(member-unit-associate-pp x lst))
4905
:hints (("Subgoal *1/3"
4907
Unit-associates-p-=-unit-associates-pp
4911
Unit-associates-p-=-unit-associates-pp
4915
Delete-one-unit-associate (x lst)
4916
"Return the result of deleting one occurrence
4917
of an unit-associate-p of x from the list lst."
4919
(if (unit-associates-p x (car lst))
4921
(cons (car lst)(delete-one-unit-associate x (cdr lst))))
4925
Delete-one-unit-associate-pp (x lst)
4926
"Return the result of deleting one occurrence
4927
of an unit-associate-pp of x from the list lst."
4929
(if (unit-associates-pp x (car lst))
4931
(cons (car lst)(delete-one-unit-associate-pp x (cdr lst))))
4935
Delete-one-unit-associate-=-Delete-one-unit-associate-pp
4936
(equal (Delete-one-unit-associate x lst)
4937
(Delete-one-unit-associate-pp x lst))
4939
:hints (("Subgoal *1/2"
4941
Unit-associates-p-=-unit-associates-pp
4945
Unit-associates-p-=-unit-associates-pp
4949
Bag-equal-unit-associates (lst1 lst2)
4950
"Return T iff lst1 and lst2 have the same
4951
members, up to unit-associates-p, with the
4952
same multiplicity, up to unit-associates-p."
4954
(and (member-unit-associate (car lst1) lst2)
4955
(bag-equal-unit-associates (cdr lst1)
4956
(delete-one-unit-associate (car lst1)
4961
Bag-equal-unit-associates-pp (lst1 lst2)
4962
"Return T iff lst1 and lst2 have the same
4963
members, up to unit-associates-pp, with the
4964
same multiplicity, up to unit-associates-pp."
4966
(and (member-unit-associate-pp (car lst1) lst2)
4967
(bag-equal-unit-associates-pp (cdr lst1)
4968
(delete-one-unit-associate-pp (car lst1)
4973
Bag-equal-unit-associates-=-Bag-equal-unit-associates-pp
4974
(equal (Bag-equal-unit-associates lst1 lst2)
4975
(Bag-equal-unit-associates-pp lst1 lst2))
4977
:hints (("Subgoal *1/2"
4979
Member-unit-associate-=-member-unit-associate-pp
4984
Member-unit-associate-=-member-unit-associate-pp
4988
Delete-one-unit-associate-=-Delete-one-unit-associate-pp
4992
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
4993
;; Show that bag-equal-unit-associates has the expected properties:
4995
;; Lisp objects that are bag-equal-unit-associates have the same length.
4997
;; Lisp objects that are bag-equal-unit-associates have the same members,
4998
;; up to unit-associates-p
5000
;; Elements in Lisp objects that are bag-equal-unit-associates occur
5001
;; in each object with the same multiplicity, up to unit-associates-p.
5004
Len-delete-one-unit-associate
5005
(implies (member-unit-associate x lst)
5006
(equal (+ 1 (len (delete-one-unit-associate x lst)))
5010
Len-delete-one-unit-associate-pp
5011
(implies (member-unit-associate-pp x lst)
5012
(equal (+ 1 (len (delete-one-unit-associate-pp x lst)))
5016
Bag-equal-unit-associates->equal-len
5017
(implies (bag-equal-unit-associates lst1 lst2)
5023
Bag-equal-unit-associates-pp->equal-len
5024
(implies (bag-equal-unit-associates-pp lst1 lst2)
5030
Member-unit-associate-pp-delete-one-unit-associate-pp
5031
(implies (not (unit-associates-pp x y))
5032
(iff (member-unit-associate-pp x
5033
(delete-one-unit-associate-pp y lst))
5034
(member-unit-associate-pp x lst))))
5037
Unit-associates-pp-member-unit-associate-pp
5038
(implies (and (unit-associates-pp x y)
5039
(member-unit-associate-pp y lst))
5040
(member-unit-associate-pp x lst)))
5043
Unit-associates-pp-implies-iff-member-unit-associate-pp
5044
(implies (unit-associates-pp x1 x2)
5045
(iff (member-unit-associate-pp x1 lst)
5046
(member-unit-associate-pp x2 lst)))
5047
:rule-classes :congruence)
5049
(in-theory (disable Unit-associates-pp-member-unit-associate-pp))
5052
Bag-equal-unit-associates-pp->iff-member-unit-associate-pp
5053
(implies (bag-equal-unit-associates-pp lst1 lst2)
5054
(iff (member-unit-associate-pp x lst1)
5055
(member-unit-associate-pp x lst2)))
5059
Bag-equal-unit-associates->iff-member-unit-associate
5060
(implies (bag-equal-unit-associates lst1 lst2)
5061
(iff (member-unit-associate x lst1)
5062
(member-unit-associate x lst2)))
5065
:use (Bag-equal-unit-associates-pp->iff-member-unit-associate-pp
5066
Bag-equal-unit-associates-=-Bag-equal-unit-associates-pp
5068
Member-unit-associate-=-member-unit-associate-pp
5071
Member-unit-associate-=-member-unit-associate-pp
5075
Multiplicity-unit-associate (x lst)
5077
(if (unit-associates-p x (car lst))
5078
(+ 1 (multiplicity-unit-associate x (cdr lst)))
5079
(multiplicity-unit-associate x (cdr lst)))
5083
Multiplicity-unit-associate-pp (x lst)
5085
(if (unit-associates-pp x (car lst))
5086
(+ 1 (multiplicity-unit-associate-pp x (cdr lst)))
5087
(multiplicity-unit-associate-pp x (cdr lst)))
5091
Multiplicity-unit-associate-=-Multiplicity-unit-associate-pp
5092
(equal (Multiplicity-unit-associate x lst)
5093
(Multiplicity-unit-associate-pp x lst))
5095
:hints (("Subgoal *1/2"
5097
Unit-associates-p-=-unit-associates-pp
5101
Unit-associates-p-=-unit-associates-pp
5105
Multiplicity-unit-associate-pp-delete-one-unit-associate-pp-1
5106
(implies (and (member-unit-associate-pp y lst)
5107
(unit-associates-pp x y))
5108
(equal (+ 1 (multiplicity-unit-associate-pp
5110
(delete-one-unit-associate-pp y lst)))
5111
(multiplicity-unit-associate-pp x lst))))
5114
Multiplicity-unit-associate-pp-delete-one-unit-associate-pp-2
5115
(implies (not (unit-associates-pp x y))
5116
(equal (multiplicity-unit-associate-pp
5118
(delete-one-unit-associate-pp y lst))
5119
(multiplicity-unit-associate-pp x lst))))
5122
Bag-equal-unit-associates-pp->equal-multiplicity-unit-associate-pp
5123
(implies (bag-equal-unit-associates-pp lst1 lst2)
5124
(equal (multiplicity-unit-associate-pp x lst1)
5125
(multiplicity-unit-associate-pp x lst2)))
5129
Bag-equal-unit-associates->equal-multiplicity-unit-associate
5130
(implies (bag-equal-unit-associates lst1 lst2)
5131
(equal (multiplicity-unit-associate x lst1)
5132
(multiplicity-unit-associate x lst2)))
5135
:use (Bag-equal-unit-associates-pp->equal-multiplicity-unit-associate-pp
5136
Bag-equal-unit-associates-=-Bag-equal-unit-associates-pp
5138
Multiplicity-unit-associate-=-Multiplicity-unit-associate-pp
5141
Multiplicity-unit-associate-=-Multiplicity-unit-associate-pp
5145
Divides-pp-member-unit-associate-pp-**_e-lst
5146
(implies (and (edp-listp lst)
5147
(member-unit-associate-pp x lst))
5148
(divides-pp x (**_e-lst lst)))
5150
:in-theory (disable (:definition divides-pp)
5151
unit-associates-pp-refines-associates-pp-lemma-1
5152
irreducible-listp-implies-edp-listp
5153
irreducible-listp-1-implies-edp-listp))))
5156
Divisors-of-irreducible-pp
5157
(implies (and (irreducible-pp x)
5159
(or (unit-associates-pp d x)
5163
:in-theory (e/d ((:definition divides-pp))
5164
((:definition unit-pp)
5165
(:definition reducible-pp)))
5167
unit-associates-pp-suff
5168
(u (divides-pp-witness d x))
5173
Gcd-pp-of-irreducible-pp
5174
(implies (and (irreducible-pp x)
5176
(or (unit-associates-pp g x)
5180
:in-theory (disable (:definition irreducible-pp))
5182
Divisors-of-irreducible-pp
5186
Gcd-pp-of-irreducible-pp-divides-pp
5187
(implies (and (irreducible-pp x)
5189
(or (divides-pp x y)
5193
:in-theory (disable (:definition irreducible-pp))
5194
:use Gcd-pp-of-irreducible-pp)))
5198
(implies (and (edp x)
5201
(not (divides-pp x y)))
5202
(unit-pp (++_e (**_e x (first (Bezout x y)))
5203
(**_e y (second (Bezout x y))))))
5207
Gcd-pp-of-irreducible-pp-divides-pp
5208
(g (++_e (**_e x (first (Bezout x y)))
5209
(**_e y (second (Bezout x y))))))))))
5212
Associate-pp-unit-pp
5213
(implies (and (unit-pp x)
5215
(equal (associates-pp x y) t)))
5218
Irreducible-pp-gcd=1_e
5219
(implies (and (irreducible-pp x)
5221
(not (divides-pp x y)))
5224
:in-theory (disable (:definition associates-pp)
5225
(:definition bezout)
5226
(:definition unit-pp)
5227
(:definition gcd-pp)
5228
unit-associates-pp-refines-associates-pp-lemma-1
5231
Associate-pp-unit-pp
5232
(x (++_e (**_e x (first (Bezout x y)))
5233
(**_e y (second (Bezout x y)))))
5238
Edp-linear-combination
5239
(implies (gcd-pp x y g)
5240
(edp (divides-pp-witness (++_e (**_e x (mv-nth 0 (bezout x y)))
5241
(**_e y (mv-nth 1 (bezout x y))))
5244
:in-theory (disable (:definition bezout)
5245
(:definition mv-nth)))))
5247
(in-theory (disable unit-associates-pp-refines-associates-pp-lemma-1))
5249
(set-backchain-limit 3)
5252
Prime-property-lemma
5253
(implies (and (gcd-pp x y (1_e))
5254
(divides-pp x (**_e y z))
5258
:in-theory (disable (:definition gcd-pp)
5259
(:definition bezout)
5260
(:definition mv-nth)
5261
gcd=linear-combination)
5268
(mv-nth 0 (bezout x y))
5270
(++_e (**_e x (mv-nth 0 (bezout x y)))
5271
(**_e y (mv-nth 1 (bezout x y))))
5274
(mv-nth 1 (bezout x y))
5276
(++_e (**_e x (mv-nth 0 (bezout x y)))
5277
(**_e y (mv-nth 1 (bezout x y))))
5281
gcd=linear-combination
5285
(implies (and (edp c)
5289
(divides-pp x (++_e (**_e a c)
5294
(mv-nth 0 (bezout x y))
5297
(mv-nth 0 (bezout x y)))
5299
(mv-nth 1 (bezout x y))))
5301
(d (**_e (mv-nth 1 (bezout x y))
5304
(mv-nth 0 (bezout x y)))
5305
(**_e y (mv-nth 1 (bezout x y))))
5309
Irreducible-pp-implies-prime-property
5310
(implies (and (irreducible-pp x)
5313
(divides-pp x (**_e y z)))
5314
(or (divides-pp x y)
5316
:rule-classes ((:rewrite
5318
(and (implies (and (irreducible-pp x)
5319
(divides-pp x (**_e y z))
5322
(not (divides-pp x y)))
5324
(implies (and (irreducible-pp x)
5325
(divides-pp x (**_e y z))
5328
(not (divides-pp x z)))
5329
(divides-pp x y)))))
5331
:in-theory (disable (:definition gcd-pp)
5332
(:definition irreducible-pp)
5333
Irreducible-pp-gcd=1_e)
5334
:use Irreducible-pp-gcd=1_e)))
5337
Irreducible-p-implies-prime-property
5338
(implies (and (irreducible-p x)
5341
(divides-p x (*_e y z)))
5346
:in-theory (disable Irreducible-pp-implies-prime-property
5347
(:definition irreducible-pp)
5348
(:definition irreducible-p)
5349
(:definition divides-p))
5350
:use (Irreducible-pp-implies-prime-property
5351
Irreducible-p-=-irreducible-pp
5352
Divides-p-=-Divides-pp
5354
Divides-p-=-Divides-pp
5357
Divides-p-=-Divides-pp
5365
Irreducible-pp-unit-associates
5366
(implies (and (divides-pp x y)
5369
(equal (unit-associates-pp x y) t))
5371
:in-theory (e/d ((:definition divides-pp))
5372
((:definition irreducible-pp)
5373
(:definition unit-pp)))
5375
irreducible-pp-implies-unit-pp-factor
5378
(z (divides-pp-witness x y)))
5380
unit-associates-pp-suff
5381
(u (divides-pp-witness x y)))))))
5384
Irreducible-p-unit-associates
5385
(implies (and (divides-p x y)
5388
(unit-associates-p x y))
5391
:in-theory (disable Irreducible-pp-unit-associates
5392
(:definition irreducible-pp)
5393
(:definition irreducible-p)
5394
(:definition unit-pp)
5395
(:definition unit-p)
5396
(:definition unit-associates-pp)
5397
(:definition unit-associates-p))
5398
:use (Irreducible-pp-unit-associates
5399
Divides-p-=-Divides-pp
5402
Irreducible-p-=-irreducible-pp
5404
Unit-associates-p-=-unit-associates-pp))))
5408
(implies (irreducible-pp x)
5410
:rule-classes :forward-chaining)
5413
Divides-pp-**_e-lst-implies-member-unit-associate-lemma
5414
(implies (and (irreducible-pp x)
5417
(irreducible-listp-1 lst)
5418
(divides-pp x (**_e-lst lst)))
5419
(member-unit-associate-pp x lst))
5421
:in-theory (disable irreducible-listp-implies-edp-listp
5422
(:definition irreducible-pp)))))
5425
Irreducible-pp-not-unit-pp
5426
(implies (irreducible-pp x)
5428
:rule-classes :forward-chaining)
5431
Divides-pp-**_e-lst-implies-member-unit-associate-pp
5432
(implies (and (irreducible-pp x)
5433
(irreducible-listp-1 lst)
5434
(divides-pp x (**_e-lst lst)))
5435
(member-unit-associate-pp x lst))
5437
:in-theory (disable (:definition irreducible-pp)))))
5440
Edp-Unit-associates-pp-witness
5441
(implies (and (edp x)
5442
(unit-associates-pp x y))
5443
(edp (unit-associates-pp-witness x y)))
5445
:in-theory (e/d ((:definition unit-associates-pp))
5446
((:definition unit-pp))))))
5449
==_e-**_e-Unit-associates-pp-witness
5450
(implies (and (edp x)
5451
(unit-associates-pp x y))
5452
(==_e (**_e x (unit-associates-pp-witness x y)) y))
5454
:in-theory (e/d ((:definition unit-associates-pp))
5455
((:definition unit-pp))))))
5458
==_e-**_e-Unit-associates-pp-witness-1
5459
(implies (and (edp x)
5460
(unit-associates-pp (**_e x (**_e-lst lst1))
5464
(unit-associates-pp-witness (**_e x (**_e-lst lst1))
5468
:in-theory (disable ==_e-**_e-Unit-associates-pp-witness
5469
(:definition unit-pp))
5471
==_e-**_e-Unit-associates-pp-witness
5472
(x (**_e x (**_e-lst lst1)))
5473
(y (**_e-lst lst2))))))
5476
**_e-irreducible-pp-**_e-lst-implies-member-unit-associate-pp-lemma
5477
(implies (and (unit-associates-pp (**_e x (**_e-lst lst1))
5480
(divides-pp x (**_e-lst lst2)))
5482
:in-theory (disable (:definition unit-pp))
5486
(z (**_e (unit-associates-pp-witness (**_e x (**_e-lst lst1))
5488
(**_e-lst lst1)))))))
5491
**_e-irreducible-pp-**_e-lst-implies-member-unit-associate-pp
5492
(implies (and (unit-associates-pp (**_e x (**_e-lst lst1))
5495
(irreducible-listp-1 lst2))
5496
(member-unit-associate-pp x lst2))
5498
:in-theory (disable (:definition reducible-pp)
5499
(:definition unit-pp)))))
5502
**_e-lst-of-irreducible-listp-1-not-unit-associate-pp-1_e
5503
(implies (and (irreducible-listp-1 lst)
5505
(not (unit-associates-pp (1_e)(**_e-lst lst))))
5507
:in-theory (disable (:definition unit-p)
5508
(:definition reducible-pp)))))
5511
Irreducible-listp-1-delete-one-unit-associate-pp
5512
(implies (and (member-unit-associate-pp x lst)
5513
(irreducible-listp-1 lst))
5514
(irreducible-listp-1 (delete-one-unit-associate-pp x lst)))
5516
:in-theory (disable (:definition unit-pp)
5517
(:definition reducible-pp)))))
5520
Unit-associates-pp-**_e-lst-implies-member-unit-associate-pp
5521
(implies (and (irreducible-pp x)
5522
(irreducible-listp-1 lst)
5523
(unit-associates-pp x (**_e-lst lst)))
5524
(member-unit-associate-pp x lst))
5526
:in-theory (disable (:definition reducible-pp)
5527
(:definition unit-pp)))))
5529
(set-backchain-limit 1)
5533
(implies (and (edp x)
5535
(reducible-pp (**_e x y)))
5536
:rule-classes ((:rewrite
5538
(implies (and (edp x)
5540
(and (reducible-pp (**_e x y))
5541
(reducible-pp (**_e y x))))
5543
:in-theory (disable (:definition reducible-pp))))))
5545
:in-theory (disable (:definition unit-pp)
5546
(:definition mv-nth)
5547
(:rewrite reducible-pp-suff))
5551
(y (**_e x (mv-nth 0 (reducible-pp-witness y))))
5552
(z (mv-nth 1 (reducible-pp-witness y))))
5554
unit-pp-**_e=>unit-pp-factor-right
5555
(y (mv-nth 0 (reducible-pp-witness y))))))))
5559
(implies (and (edp x)
5563
(reducible-pp (**_e x y)))
5565
:in-theory (disable (:definition reducible-pp)
5566
(:definition unit-pp))
5574
Reducible-pp-**_e-lst
5575
(implies (and (irreducible-listp-1 lst)
5578
(reducible-pp (**_e-lst lst)))
5580
:in-theory (disable (:definition reducible-pp)
5581
(:definition unit-pp)))))
5584
Not-irreducible-pp-1_e
5585
(not (irreducible-pp (1_e))))
5588
Irreducible-listp-1-irreducible-pp-member-unit-associate-pp
5589
(implies (and (member-unit-associate-pp x lst)
5590
(irreducible-listp-1 lst))
5593
:in-theory (disable (:definition irreducible-pp)))))
5595
(set-backchain-limit 3)
5598
Unit-associates-pp-**_e-lst-implies-member-unit-associate-pp-1
5599
(implies (and (unit-associates-pp (**_e-lst lst1)
5601
(irreducible-listp-1 lst1)
5602
(irreducible-listp-1 lst2)
5603
(member-unit-associate-pp x lst1))
5604
(member-unit-associate-pp x lst2))
5606
:in-theory (disable (:definition member-unit-associate-pp)))))
5609
Member-unit-associate-pp-edp-listp-implies-edp
5610
(implies (and (member-unit-associate-pp x lst)
5615
Unit-pp-unit-associates-pp-witness
5616
(implies (and (edp x)
5617
(unit-associates-pp x y))
5618
(unit-pp (unit-associates-pp-witness x y)))
5621
:in-theory (e/d ((:definition unit-associates-pp))
5622
((:definition unit-pp))))))
5625
==_e-**_e-Unit-associates-pp-witness-a
5626
(implies (and (edp x)
5628
(unit-associates-pp x y))
5629
(==_e (**_e x z (unit-associates-pp-witness x y))
5633
:in-theory (disable ==_e-**_e-Unit-associates-pp-witness
5634
cancellation-laws-for-**_e
5635
==_e-implies-==_e-**_e-1)
5636
:use (==_e-**_e-Unit-associates-pp-witness
5638
==_e-implies-==_e-**_e-1
5639
(y1 (**_e x (unit-associates-pp-witness x y)))
5643
Unit-associates-pp-**_e-1
5644
(implies (and (unit-associates-pp x y)
5647
(unit-associates-pp (**_e x z)
5651
:in-theory (disable (:definition unit-pp))
5653
unit-associates-pp-suff
5656
(u (unit-associates-pp-witness x y)))
5657
Unit-pp-unit-associates-pp-witness
5658
==_e-**_e-Unit-associates-pp-witness-a))))
5661
Unit-associates-pp-==_e-**_e-2
5662
(implies (and (unit-associates-pp x y)
5665
(unit-associates-pp (**_e z x)
5669
:use Unit-associates-pp-**_e-1)))
5672
Unit-associates-pp-**_e-**_e-lst-delete-one-unit-associate-lemma
5673
(implies (and (unit-associates-pp
5674
(**_e x (**_e-lst (delete-one-unit-associate-pp x (cdr lst))))
5675
(**_e-lst (cdr lst)))
5677
(edp-listp (cdr lst))
5678
(member-unit-associate-pp x (cdr lst)))
5679
(unit-associates-pp (**_e x
5682
(delete-one-unit-associate-pp x
5684
(**_e (car lst) (**_e-lst (cdr lst)))))
5686
:in-theory (disable (:definition unit-pp))
5688
Unit-associates-pp-==_e-**_e-2
5690
(x (**_e x (**_e-lst (delete-one-unit-associate-pp x (cdr lst)))))
5691
(y (**_e-lst (cdr lst)))))))
5694
Unit-associates-pp-**_e-**_e-lst-delete-one-unit-associate
5695
(implies (and (edp-listp lst)
5696
(member-unit-associate-pp x lst))
5697
(unit-associates-pp (**_e x (**_e-lst
5698
(delete-one-unit-associate-pp x
5702
:in-theory (disable (:definition unit-pp)))
5705
Unit-associates-pp-**_e-1
5706
(z (**_e-lst (cdr lst)))
5710
Unit-associates-pp-**_e-cancellation
5711
(implies (and (unit-associates-pp (**_e x y)
5713
(not (==_e x (0_e)))
5717
(unit-associates-pp y z))
5720
:in-theory (e/d ((:definition unit-associates-pp))
5721
((:definition unit-pp)))
5723
unit-associates-pp-suff
5726
(u (unit-associates-pp-witness (**_e x y)
5730
Unit-associates-pp-**_e-**_e-lst-delete-one-unit-associate-pp-cancellation
5731
(implies (and (unit-associates-pp (**_e x (**_e-lst lst1))
5735
(irreducible-listp-1 lst2))
5736
(unit-associates-pp (**_e-lst (delete-one-unit-associate-pp x lst2))
5739
:in-theory (disable (:definition reducible-pp)
5740
(:definition unit-pp))
5741
:use (Irreducible-pp-not-0_e
5743
Unit-associates-pp-**_e-cancellation
5744
(y (**_e-lst (delete-one-unit-associate-pp x lst2)))
5745
(z (**_e-lst lst1)))))))
5748
IRREDUCIBLE-FACTORIZATION-UNIQUENESS-general-1
5749
(implies (and (irreducible-listp-1 lst1)
5750
(irreducible-listp-1 lst2)
5751
(unit-associates-pp (**_e-lst lst1)
5753
(bag-equal-unit-associates-pp lst1 lst2))
5755
:in-theory (disable (:definition reducible-pp)
5756
(:definition unit-pp)))))
5759
Irreducible-listp-=-irreducible-listp-1
5760
(equal (irreducible-listp lst)
5761
(irreducible-listp-1 lst))
5763
:hints (("Subgoal *1/2"
5764
:in-theory (disable (:definition irreducible-pp)
5765
(:definition irreducible-p))
5767
Irreducible-p-=-irreducible-pp
5770
:in-theory (disable (:definition irreducible-pp)
5771
(:definition irreducible-p))
5773
Irreducible-p-=-irreducible-pp
5777
IRREDUCIBLE-FACTORIZATION-UNIQUENESS-general
5778
(implies (and (irreducible-listp lst1)
5779
(irreducible-listp lst2)
5780
(unit-associates-p (*_e-lst lst1)
5782
(bag-equal-unit-associates lst1 lst2))
5784
:use (IRREDUCIBLE-FACTORIZATION-UNIQUENESS-general-1
5786
Irreducible-listp-=-irreducible-listp-1
5789
Irreducible-listp-=-irreducible-listp-1
5798
unit-associates-p-=-unit-associates-pp
5801
bag-equal-unit-associates-=-bag-equal-unit-associates-pp))))
5804
IRREDUCIBLE-FACTORIZATION-UNIQUENESS-1
5805
(implies (and (irreducible-listp-1 lst1)
5806
(irreducible-listp-1 lst2)
5807
(==_e (**_e-lst lst1)
5809
(bag-equal-unit-associates-pp lst1 lst2))
5812
:in-theory (disable (:definition irreducible-pp)))))
5815
IRREDUCIBLE-FACTORIZATION-UNIQUENESS
5816
(implies (and (irreducible-listp lst1)
5817
(irreducible-listp lst2)
5820
(bag-equal-unit-associates lst1 lst2))
5823
:use (IRREDUCIBLE-FACTORIZATION-UNIQUENESS-1
5825
Irreducible-listp-=-irreducible-listp-1
5828
Irreducible-listp-=-irreducible-listp-1
5840
bag-equal-unit-associates-=-bag-equal-unit-associates-pp))))